/* ===================================================
   STYLE GÉNÉRAL DE LA PAGE - thème "été"
   =================================================== */

/* Le sélecteur * cible TOUS les éléments de la page */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* box-sizing: border-box évite que les bordures/paddings
       n'agrandissent la taille réelle des éléments */
}

body {
    /* Dégradé de couleurs façon ciel d'été : bleu ciel -> jaune doré */
    background: linear-gradient(180deg, #4FC3F7 0%, #81D4FA 40%, #FFD54F 100%);
    min-height: 100vh; /* prend toute la hauteur de l'écran */
    font-family: 'Trebuchet MS', Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #ffffff;
    overflow-x: hidden;
}

/* ===================================================
   GESTION DES ÉCRANS (accueil / jeu / fin)
   =================================================== */

.ecran {
    width: 90%;
    max-width: 600px;
    padding: 40px 20px;
    background-color: rgba(255, 255, 255, 0.15);
    /* fond légèrement transparent façon "verre" */
    border-radius: 20px;
    backdrop-filter: blur(5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Cette classe est ajoutée/retirée en JavaScript pour cacher un écran */
.cache {
    display: none;
}

h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

h2 {
    font-size: 1.4em;
    margin: 20px 0;
    line-height: 1.4;
}

p {
    font-size: 1.1em;
    margin-bottom: 15px;
}

/* ===================================================
   LE BOUTON-IMAGE DE DÉMARRAGE (demande du prof)
   =================================================== */

.bouton-image {
    /* On enlève le style par défaut d'un bouton HTML */
    background: none;
    border: none;
    cursor: pointer; /* curseur "main" au survol, pour montrer que c'est cliquable */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 10px;
    transition: transform 0.3s ease;
    /* transition = animation fluide quand une propriété change (ici "transform") */
}

.image-demarrage {
    width: 150px;
    height: 150px;
    border-radius: 50%; /* rend l'image ronde */
    box-shadow: 0 0 30px rgba(255, 213, 79, 0.8);
    /* halo lumineux jaune autour du soleil */
    animation: pulse 2s infinite;
    /* animation définie plus bas, donne un effet "pulsation" continu */
}

/* Au survol de la souris, l'image grossit légèrement */
.bouton-image:hover {
    transform: scale(1.08);
}

.bouton-image span {
    font-weight: bold;
    font-size: 1.2em;
    color: #fff8e1;
}

/* Animation de pulsation du soleil (attire l'œil sur le bouton) */
@keyframes pulse {
    0%   { box-shadow: 0 0 20px rgba(255, 213, 79, 0.6); }
    50%  { box-shadow: 0 0 45px rgba(255, 213, 79, 1); }
    100% { box-shadow: 0 0 20px rgba(255, 213, 79, 0.6); }
}

/* ===================================================
   ÉCRAN DE JEU - questions et réponses
   =================================================== */

.info-jeu {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 1em;
}

.zone-reponses {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

/* Style des boutons de réponse, générés dynamiquement en JS */
.bouton-reponse {
    padding: 14px;
    font-size: 1em;
    border: none;
    border-radius: 12px;
    background-color: #ffffff;
    color: #2b3a55;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.bouton-reponse:hover {
    background-color: #fff3cd;
    transform: translateY(-2px);
}

/* Couleur appliquée en JS quand la réponse est correcte */
.bonne-reponse {
    background-color: #81C784 !important; /* vert */
    color: white !important;
}

/* Couleur appliquée en JS quand la réponse est fausse */
.mauvaise-reponse {
    background-color: #E57373 !important; /* rouge */
    color: white !important;
}

.feedback {
    margin-top: 15px;
    font-weight: bold;
    font-size: 1.1em;
    min-height: 1.5em; /* évite que la mise en page "saute" quand le texte apparaît */
}

/* ===================================================
   ÉCRAN DE FIN
   =================================================== */

#scoreFinal {
    font-size: 1.6em;
    font-weight: bold;
}

.bouton-rejouer {
    margin-top: 20px;
    padding: 14px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 30px;
    background-color: #FFD54F;
    color: #2b3a55;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.bouton-rejouer:hover {
    transform: scale(1.05);
}

/* ===================================================
   ADAPTATION MOBILE (écrans étroits)
   =================================================== */
@media (max-width: 480px) {
    h1 {
        font-size: 1.7em;
    }
    .image-demarrage {
        width: 110px;
        height: 110px;
    }
}
