/**
 * CSS specifico per Pong Retro
 * Adattato per il nuovo layout standardizzato
 */

/* Override stili base per Pong */
.game-page .game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 10px; /* Ridotto padding */
    min-height: 550px;
}

/* Stile del punteggio */
.scoreboard {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 800px;
    margin-bottom: 20px;
    font-size: 32px;
    z-index: 10;
    position: relative;
}

#player1-score {
    margin-right: auto;
    margin-left: 100px;
    color: #fff;
}

#player2-score {
    margin-left: auto;
    margin-right: 100px;
    color: #fff;
}

/* Stile dei pulsanti di controllo nella scoreboard */
.control-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.control-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.control-btn:hover {
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

.audio-icon,
.pause-icon {
    width: 28px;
    height: 28px;
    fill: #00ff66; /* Verde di default */
    transition: fill 0.2s ease;
}

/* Stile del canvas di gioco */
#gameCanvas {
    border: 4px solid #fff;
    background-color: #000;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 800px;
    height: auto;
}

/* Stile overlay iniziale */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 4px solid #fff;
    background-color: rgba(0, 0, 0, 0.8);
    width: 70%;
    max-width: 500px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.overlay-content .game-title {
    font-size: 48px;
    margin-bottom: 30px;
    letter-spacing: 5px;
    text-shadow: 4px 4px 0 rgba(255, 255, 255, 0.3);
    animation: flicker 2s infinite alternate;
    color: #fff;
}

.retro-button {
    background-color: #000;
    color: #fff;
    border: 3px solid #fff;
    font-family: 'Press Start 2P', cursive;
    padding: 15px 30px;
    font-size: 24px;
    margin: 30px 0;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.8);
}

.retro-button:hover {
    background-color: #fff;
    color: #000;
    transform: translateY(-2px);
}

.retro-button:active {
    transform: translateY(2px);
    box-shadow: 2px 2px 0 rgba(255, 255, 255, 0.8);
}

.instruction-text {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 15px;
    color: #fff;
}

.pixel-art-ball {
    width: 30px;
    height: 30px;
    background-color: #fff;
    margin: 15px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: bounce 1s infinite alternate;
}

/* Stile del pulsante audio nella sidebar */
.game-info #audio-toggle {
    background-color: transparent;
    border: 2px solid var(--game-border-color);
    color: var(--game-accent-color);
    font-size: 1rem;
    width: 100%;
    height: auto;
    border-radius: 0;
    cursor: pointer;
    margin-top: 0;
    font-family: var(--game-font-family);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    padding: 0.8rem 1.5rem;
}

.game-info #audio-toggle:hover {
    background-color: var(--game-accent-color);
    color: var(--game-primary-color);
}

/* Animazioni */
@keyframes flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% { 
        text-shadow: 4px 4px 0 rgba(255, 255, 255, 0.3);
    }
    20%, 24%, 55% { 
        text-shadow: none;
    }
}

@keyframes bounce {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-10px);
    }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.blink {
    animation: blink 0.5s infinite;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .scoreboard {
        font-size: 24px;
    }
    
    #player1-score {
        margin-left: 50px;
    }
    
    #player2-score {
        margin-right: 50px;
    }
    
    .overlay-content .game-title {
        font-size: 36px;
    }
    
    .retro-button {
        font-size: 18px;
        padding: 12px 24px;
    }
}

@media (max-width: 600px) {
    .scoreboard {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    #player1-score {
        margin-left: 20px;
    }
    
    #player2-score {
        margin-right: 20px;
    }
    
    .overlay-content {
        width: 90%;
        padding: 20px;
    }
    
    .overlay-content .game-title {
        font-size: 28px;
        margin-bottom: 20px;
    }
    
    .retro-button {
        font-size: 16px;
        padding: 10px 20px;
        margin: 20px 0;
    }
}
