/* Estilo general */
body {
    font-family: 'Press Start 2P', 'VT323', 'Silkscreen', 'Pixel', monospace;
    background-color: #000;
    color: #fff;
    text-align: center;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Eliminar scroll vertical */
    height: 100vh; /* Asegurar que el body ocupe toda la altura de la pantalla */
    max-width: 76vw; /* Asegurar que el body ocupe toda la anchura de la pantalla */
}

.game-container {
    display: flex;
    flex-wrap: initial;
    flex-direction: row;
    justify-content: center;
    padding-left: 5vw;
    align-items: stretch; /* Alinear elementos para ocupar toda la altura */
    margin: 0 auto;
    max-width: 70vw;
    height: 100vh; /* Ocupar toda la altura de la pantalla */
}

.left-panel {
    width: 30%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding-left: 3vw;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    overflow-y: auto; /* Permitir scroll si el contenido es largo */
    height: 100vh; /* Ocupar toda la altura de la pantalla */
    scrollbar-width: none; /* Ocultar scrollbar en Firefox */
    -ms-overflow-style: none; /* Ocultar scrollbar en IE y Edge */
    &::-webkit-scrollbar {
        display: none; /* Ocultar scrollbar en Chrome */
    }   
}

.game-area {
    width: 80%;
    display: flexbox;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

canvas {
    border: 2px solid #fff;
    background-color: #222;
    display: block;
    margin: 0 auto;
    width: 30vw;
    height: 85vh; /* Ajustar el alto del canvas */
}

.controls {
    font-size: 1vw;
}

.end-game {
    margin-top: 20px;
}

#player-initials {
    font-family: inherit;
    font-size: 1rem;
    padding: 5px;
    text-transform: uppercase;
}

h1 {
    font-size: 4vw;
    color: #ffcc00;
}

button {
    font-family: inherit;
    font-size: 1rem;
    padding: 5px 10px;
    background-color: #ffcc00;
    border: none;
    cursor: pointer;
}

button:hover {
    background-color: #ffaa00;
}

/* Indicador de pausa */
#pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 5vw;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

/* Game Over Overlay */
#game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.game-over-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.game-over-text {
    font-size: 5vw;
    margin-bottom: 30px;
}

.game-over-score {
    font-size: 2vw;
    margin-bottom: 20px;
}

.game-over-input {
    margin-bottom: 20px;
}

.game-over-buttons {
    display: flex;
    gap: 10px;
}

.game-over-buttons button {
    margin: 10px;
    padding: 10px 15px;
}

/* Animación de eliminación de línea */
@keyframes flash-line {
    0% { background-color: #ff0000; }
    50% { background-color: #ffffff; }
    100% { background-color: #ff0000; }
}
.flash-line {
    animation: flash-line 0.5s linear;
}

/* Historia del Tetris */
.history {
    text-align: left;
    font-size: medium;
}

.game-info {
    margin-bottom: 5px;
    font-size: 1.5vw;
    text-align: center;
}

@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
    }

    .left-panel {
        display: none; /* Ocultar el panel izquierdo en móviles */
    }

    .game-area {
        width: 100%;
    }

    canvas {
        width: 90vw;
        height: 70vh; /* Ajustar el alto del canvas en móviles */
    }

    .history {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.9);
        z-index: 10;
        display: none; /* Oculto por defecto en móviles */
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 20px;
        overflow-y: auto; /* Permitir scroll si el contenido es largo */
    }

    .history h2 {
        font-size: 5vw;
    }

    .history p {
        font-size: 3vw;
    }

    .mobile-only {
        display: block;
        margin-top: 20px;
    }
}

.mobile-only {
    display: none;
}

/* Estilo retro ochentoso para textos */
.retro-text {
    color: #ff00ff; /* Magenta neón */
    text-shadow: 
        0 0 5px #ff00ff,
        0 0 10px #ff00ff,
        0 0 20px #ff00ff,
        0 0 40px #ff00ff,
        0 0 80px #ff00ff;
    animation: neon-glow 1.5s ease-in-out infinite alternate;
}

@keyframes neon-glow {
    from {
        text-shadow: 
            0 0 5px #ff00ff,
            0 0 10px #ff00ff,
            0 0 15px #ff00ff,
            0 0 20px #ff00ff;
    }
    to {
        text-shadow: 
            0 0 10px #ff00ff,
            0 0 20px #ff00ff,
            0 0 30px #ff00ff,
            0 0 40px #ff00ff,
            0 0 50px #ff00ff;
    }
}
