*,
*::before,
*::after {
    box-sizing: border-box;
}

/* La page ne défile jamais, quelle que soit la résolution */
html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Le body est un conteneur flex qui centre le bloc de jeu
   horizontalement ET verticalement */
body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    height: 100dvh; /* tient compte de la barre d'adresse sur mobile */
    padding: clamp(10px, 3vmin, 40px);
    background-color: #6bb37b;
    font-family: "Parkinsans", sans-serif;
    text-align: center;
}

/* Bloc de jeu */
#game {
    width: 50%;
    max-height: 100%;            /* ne dépasse jamais l'écran */
    padding: clamp(14px, 4vmin, 50px);
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    overflow-x: hidden;
    overflow-y: auto;            /* filet de sécurité pour les écrans minuscules */
    overflow-wrap: break-word;
    scrollbar-width: thin;
}

#lives {
    margin: 1vh 0;
    font-size: clamp(14px, 2.6vh, 20px);
}

#logo {
    display: block;
    width: clamp(70px, 16vh, 150px);
    height: auto;
    margin: auto;
}

#credits {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    margin: 0;
    padding: 7px;
    background: rgba(108, 180, 123, 0);
    color: white;
    font-size: clamp(10px, 1.7vh, 14px);
    line-height: 1.3;
}

#presentation {
    width: 80%;
    margin: auto;
    padding: clamp(8px, 2vh, 20px) 0;
    color: white;
    font-family: "Parkinsans", sans-serif;
    font-size: clamp(12px, 2vh, 16px);
    line-height: 1.4;
}

.maj {
    font-weight: 700;
    text-transform: uppercase;
}

h2 {
    margin: 0.6em 0;
    color: white;
    font-size: clamp(14px, 2.6vh, 20px);
    font-weight: 200;
}

button {
    display: block;
    width: 100%;
    margin: clamp(6px, 1.2vh, 10px) 0;
    padding: clamp(8px, 1.8vh, 12px);
    font-size: clamp(12px, 2.2vh, 16px);
    line-height: 1.25;
    cursor: pointer;
    border: none;
    border-radius: 5px;
}

#startBtn {
    background: #4caf50;
    color: #fff;
    font-family: "Parkinsans", sans-serif;
    font-size: clamp(16px, 3.4vh, 25px);
    font-weight: 700;
    text-transform: uppercase;
}

.answer {
    background: #333;
    color: #fff;
    font-family: "Parkinsans", sans-serif;
    transition: background-color 0s ease;
}

.answer:hover {
    opacity: 0.8;
}

.answer.good {
    background-color: #2ecc71;
    color: white;
}

.answer.bad {
    background-color: #e74c3c;
    color: white;
}

#scoreLive {
    margin-bottom: 1.5vh;
    color: #fff;
    font-family: "Parkinsans", sans-serif;
    font-size: clamp(13px, 2.3vh, 18px);
    font-weight: 200;
}

#acronym {
    margin-bottom: 2vh;
    color: white;
    font-family: "Parkinsans", sans-serif;
    font-size: clamp(20px, 4.5vh, 30px);
    font-weight: 700;
    text-transform: uppercase;
}

#score {
    margin-top: 2vh;
    color: white;
    font-family: "Parkinsans", sans-serif;
    font-size: clamp(14px, 2.6vh, 20px);
}

/* Personnage : limité en taille pour ne jamais faire déborder la page */
#perso {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: -1;
    width: auto;
    height: auto;
    max-width: 45vw;
    max-height: 60vh;
    object-fit: contain;
    object-position: right bottom;
}

/* Grands écrans (et assez hauts) : bloc plus aéré */
@media (min-width: 1500px) and (min-height: 800px) {
    #game {
        padding: 80px;
    }
}

/* Tablettes et mobiles */
@media (max-width: 1000px) {
    body {
        padding: 20px;
    }

    #game {
        width: 90%;
        padding: clamp(14px, 3vmin, 20px);
        border-radius: 8px;
    }

    #credits {
        background: rgba(108, 180, 123, 0.5);
        padding: 0;
    }
}

/* Écrans très bas (téléphone en paysage) : on masque les crédits
   pour qu'ils ne chevauchent pas le jeu */
@media (max-height: 500px) {
    #credits {
        display: none;
    }
}
