#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px; 
    padding: 40px; 
    border-radius: 10px;
    background-color: var(--dark-blue);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    max-width: 900px; 
    margin: 50px auto;
    text-align: center;
    color: var(--white);
    position: relative;
}

#scores {
    display: flex;
    justify-content: space-around;
    width: 100%;
    font-size: 1.8em; 
    font-weight: bold;
}

#choices-container {
    display: flex;
    justify-content: center;
    gap: 60px; 
    width: 100%;
    margin: 20px 0;
}

#choices-container h2 {
    font-size: 1.5em; 
    margin-bottom: 15px;
}

.choice-display {
    width: 180px; 
    height: 180px; 
    border: 3px solid var(--white);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #3e3e3e;
    overflow: hidden; 
}

#options {
    display: flex;
    gap: 30px; 
    margin-top: 25px;
}

.option-btn {
    background: none;
    border: 3px solid var(--electric-blue);
    border-radius: 10px;
    padding: 15px; 
    cursor: pointer;
    transition: transform 0.2s ease-in-out, border-color 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--white);
    font-size: 1.2em; 
    min-width: 160px; 
}

.option-btn:hover {
    transform: scale(1.05);
    border-color: var(--light-blue);
}

.pixel-art {
    width: 150px;
    height: 150px;
    position: relative;
    margin-bottom: 10px; 
    transition: transform 0.2s ease-in-out;
}

#player-hand .pixel-art,
#cpu-hand .pixel-art {
    width: 150px;
    height: 150px;
}

#result-message {
    font-size: 1.8em; 
    font-weight: bold;
    margin-top: 25px;
    min-height: 2em; 
}

#round-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#round-message {
    font-size: 2.2em; 
    font-weight: bold;
    color: var(--light-blue); 
    margin-bottom: 10px;
}

#next-round-btn {
    padding: 15px 30px; 
    font-size: 1.2em; 
    background-color: var(--electric-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#next-round-btn:hover {
    background-color: var(--light-blue);
}

#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 2.5em; 
    border-radius: 10px;
}

#game-over-screen.hidden,
#next-round-btn.hidden {
    display: none;
}

#final-message {
    color: var(--white);
    margin-bottom: 30px;
    font-size: 1.4em; 
}

#restart-btn {
    padding: 15px 30px; 
    font-size: 1.1em; 
    background-color: var(--electric-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#restart-btn:hover {
    background-color: var(--light-blue);
}

/* --- Estilos para la página de reglas --- */
.rules-container {
    max-width: 800px;
    gap: 20px;
}

.rules-container h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

.rules-container p {
    font-size: 1.2em;
    line-height: 1.6;
}

.rules-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 30px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
}

.rule-item img {
    width: 100px;
    height: 100px;
    border: 3px solid var(--electric-blue);
    border-radius: 8px;
}

.rule-item p {
    font-size: 1.4em;
    font-weight: bold;
}

.play-link {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 40px;
    font-size: 1.5em;
    font-weight: bold;
    color: var(--white);
    background-color: var(--electric-blue);
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.play-link:hover {
    background-color: var(--light-blue);
}

/* -------------------------------------------------------------------------------------------------------------------------------------*/
/* -------------------------------------------MEDIA QUERIES PARA DISPOSITIVOS MÓVILES Y TABLETAS----------------------------------------*/
/* -------------------------------------------------------------------------------------------------------------------------------------*/

@media (max-width: 800px) {
    /* Contenedor principal del juego */
    #game-container {
        max-width: 95%;
        gap: 20px;
        padding: 20px;
    }

    /* Puntuación */
    #scores {
        font-size: 1.4em;
    }

    /* Contenedores de las manos (jugador y CPU) */
    #choices-container {
        flex-direction: row; 
        flex-wrap: wrap; /* Permite que los elementos se envuelvan si es necesario */
        justify-content: center;
        gap: 15px;
    }
    
    #choices-container h2 {
        font-size: 1.2em;
        margin-bottom: 5px;
    }

    #choice-player, #choice-cpu {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .choice-display {
        width: 120px; 
        height: 120px;
    }

    /* Opciones (botones) */
    #options {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .option-btn {
        min-width: 25vw; /* Usa el 25% del ancho de la pantalla */
        font-size: 1em;
        padding: 10px;
        /* Aseguramos que el contenido quepa */
        min-height: 140px; 
        box-sizing: border-box; 
    }

    /* ¡AQUÍ ESTÁ LA SOLUCIÓN! Las imágenes se hacen relativas a su contenedor */
    .pixel-art {
        width: 100%; 
        height: auto; 
        max-width: 100px;
        max-height: 100px;
    }

    /* Estas son las imágenes dentro de los recuadros de elección */
    #player-hand .pixel-art,
    #cpu-hand .pixel-art {
        width: 100px; /* Tamaño fijo para estos */
        height: 100px;
        margin-bottom: 0;
    }

    /* Mensajes */
    #result-message {
        font-size: 1.5em;
    }

    #round-message {
        font-size: 1.8em;
    }

    /* Pantalla de fin de juego */
    #game-over-screen {
        font-size: 1.8em;
    }

    #final-message {
        font-size: 1.2em;
        margin-bottom: 20px;
    }

    #restart-btn {
        font-size: 0.9em;
        padding: 10px 20px;
    }

    /* Estilos de la página de reglas */
    .rules-container {
        padding: 20px;
    }

    .rules-container h2 {
        font-size: 2em;
    }

    .rules-container p, .rules-list li p {
        font-size: 1em;
    }

    .rule-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .rule-item img {
        width: 80px;
        height: 80px;
    }

    .play-link {
        font-size: 1.2em;
        padding: 12px 25px;
    }
}