body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    color: #333; /* Couleur de texte par défaut */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1 {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 10px;
    font-size: 2.5em;
    letter-spacing: 1px;
    color: #34495e; /* Couleur spécifique pour H1 */
    font-family: 'Roboto Slab', serif;
}

/* Style général pour H2 - S'applique PARTOUT sauf si surchargé */
h2 {
    text-align: center;
    font-size: 1.5em;
    margin-bottom: 20px;
    margin-top: 20px;
    /* NOTE: Pas de couleur définie ici pour éviter conflit facile */
}

/* --- Bouton Mute --- */
#mute-button {
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    cursor: pointer;
    color: #555;
    transition: background-color 0.3s, color 0.3s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}
#mute-button:hover {
    background-color: #ddd;
}
#mute-button i {
    line-height: 1;
}

/* --- Conteneur Principal du Quiz --- */
#quiz-container {
    width: 80%;
    max-width: 900px;
    margin: 30px auto;
    text-align: center;
    background-color: #ffffff; /* Fond blanc */
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-grow: 1;
}
#quiz-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* --- Écran de Démarrage --- */
.start-btn {
    margin: 20px;
    padding: 15px 25px;
    color: white;
    background: linear-gradient(135deg, #1a9bf1, #0b7ac1);
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2em;
    font-weight: 500;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.start-btn:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #0b7ac1, #1a9bf1);
}

/* --- Zone des Questions --- */
#question-text {
    font-size: 1.5em;
    margin-bottom: 30px;
    color: #555; /* Couleur visible pour la question */
    font-weight: bold;
    font-family: 'Roboto Slab', serif;
}

#answers-container {
    list-style-type: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.answer {
    margin: 5px;
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #74ebd5, #ACB6E5);
    color: #fff; /* Texte blanc sur fond coloré */
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
    flex: 1 1 45%;
    max-width: 45%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    font-weight: 500;
}
.answer:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #ACB6E5, #74ebd5);
}

/* Styles réponses correctes/incorrectes */
.answer.correct {
    background: linear-gradient(135deg, #2ecc71, #25a25a);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}
.answer.incorrect {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Désactiver hover après réponse */
.answered .answer:not(.correct):not(.incorrect):hover {
    transform: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #74ebd5, #ACB6E5);
    cursor: default;
}
.answered .answer.correct:hover,
.answered .answer.incorrect:hover {
    cursor: default;
}

/* --- Bannière d'Explication (Modal) --- */
#explanation-banner {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.explanation-content-wrapper {
    background-color: #fff; /* Fond blanc */
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.explanation-flex-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    gap: 20px;
    margin-bottom: 20px;
}
.explanation-img {
    flex: 0 0 40%;
    text-align: center;
}
.explanation-img img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.explanation-text-content {
    flex: 1 1 55%;
    text-align: left;
}
.explanation-title { /* Titre dans l'explication */
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 15px;
    /* Couleurs spécifiques gérées par les classes .correct/.incorrect */
}
.explanation-title.correct { color: #2ecc71; }
.explanation-title.incorrect { color: #e74c3c; }
.explanation-text { /* Texte dans l'explication */
    font-size: 1.1em;
    color: #555; /* Couleur visible */
    line-height: 1.6;
}
.next-btn { /* Bouton "Suivant" dans l'explication */
    margin-top: 20px;
    padding: 12px 25px;
    font-size: 1.1em;
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.next-btn:hover {
    background: linear-gradient(135deg, #3498db, #2980b9);
    transform: translateY(-2px);
}

/* --- Zone des Résultats --- */
#result-container {
    /* display: none; est géré par la classe .hidden */
    text-align: center;
     /* Ajout pour s'assurer qu'il n'est pas caché par autre chose */
     opacity: 1;
     visibility: visible;
}

/* Titre H2 spécifique aux résultats */
#result-title-message {
    font-size: 2.8em;
    font-weight: bold;
    margin-bottom: 15px;
    line-height: 1.2;
    color: #34495e; /* Couleur par défaut VISIBLE */
    text-transform: uppercase;
    letter-spacing: 1px;
    /* Garanties de visibilité */
    opacity: 1;
    visibility: visible;
}
/* Couleurs spécifiques au titre des résultats */
#result-title-message.excellent { color: #2ecc71; }
#result-title-message.good { color: #3498db; }
#result-title-message.average { color: #f39c12; }
#result-title-message.poor { color: #e74c3c; }

/* Cercle des résultats */
.result-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(#d808c7 0%, #d808c7 0%, #eee 0%, #eee 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px auto;
    font-size: 2.5em;
    color: #333; /* Couleur visible pour le % */
    font-weight: bold;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    transition: background 1s ease-out;
}
/* Couleurs spécifiques au texte du % */
#score-percentage.red { color: #e74c3c; }
#score-percentage.orange { color: #f39c12; }
#score-percentage.yellow { color: #f1c40f; }
#score-percentage.green { color: #2ecc71; }

/* Message paragraphe sous le cercle */
#result-message {
    font-size: 1.5em;
    margin-bottom: 25px;
    color: #555; /* Couleur visible */
     /* Garanties de visibilité */
     opacity: 1;
     visibility: visible;
}

/* Bouton Recommencer */
.restart-btn {
    margin-top: 20px;
    padding: 12px 25px;
    font-size: 1.1em;
    background: linear-gradient(135deg, #d808c7, #a00696);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.restart-btn:hover {
    background: linear-gradient(135deg, #a00696, #d808c7);
    transform: translateY(-2px);
}

/* Boutons de Partage */
.share-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    margin-bottom: 20px;
    flex-wrap: wrap;
     /* Garanties de visibilité */
     opacity: 1;
     visibility: visible;
}
.share-button { /* Style pour chaque bouton individuel */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 1em;
    font-weight: 600;
    color: #fff; /* Texte blanc sur fond coloré */
    padding: 10px 18px;
    border-radius: 8px;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
     /* Garanties de visibilité */
     opacity: 1;
     visibility: visible;
}
.share-button i {
    font-size: 1.3em;
}
.share-button:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}
#share-facebook { background: #1877F2; }
#share-facebook:hover { background: #166fe5; }
#share-instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
#share-instagram:hover { opacity: 0.9; }

/* --- Autres Styles --- */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 2000;
}

footer {
    margin-top: auto;
    /* bottom: 0; left: 0; width: 100%; */ /* Pas nécessaire avec flex-grow sur le container */
    background-color: #064e72;
    color: #fff;
    text-align: center;
    padding: 15px 0;
}
footer h2 { /* Styles spécifiques au H2 du footer */
    font-size: 1.1em;
    margin: 5px 0;
    font-family: 'Montserrat', sans-serif;
    color: #fff; /* Assurer la couleur blanche ici */
    font-weight: normal; /* Éviter un bold hérité potentiellement */
}
footer a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}
footer span {
    color: #e74c3c;
}
footer a:hover {
    color: #f39c12;
}

audio { /* Cacher les contrôles audio par défaut */
    display: none;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    #quiz-container { width: 95%; padding: 20px; }
    .answer { flex: 1 1 100%; max-width: 95%; font-size: 1em; }
    h1 { font-size: 2em; }
    #question-text { font-size: 1.3em; }
    .explanation-content-wrapper { width: 95%; padding: 20px; }
    .explanation-flex-container { flex-direction: column; gap: 15px; }
    .explanation-img { flex: 0 0 auto; width: 60%; }
    .explanation-text-content { flex: 1 1 auto; text-align: center; }
    .explanation-title { font-size: 1.5em; }
    .explanation-text { font-size: 1em; }
    #result-title-message { font-size: 2em; } /* Responsive titre résultat */
    .result-circle { width: 140px; height: 140px; font-size: 2em; }
    #result-message { font-size: 1.2em; } /* Responsive message résultat */
    .share-button { font-size: 0.9em; padding: 8px 15px; }
    .share-buttons { gap: 10px; }
    footer h2 { font-size: 1em; }
}

/* Classe Utiliaire Cruciale */
.hidden {
    display: none !important; /* !important pour surcharger d'autres display potentiels */
}

/* Tuto dynamique à droite */
.tuto-overlay.tuto-right {
    position: fixed;
    top: 0;
    right: 0;
    width: 370px;
    max-width: 95vw;
    height: 100vh;
    background: transparent;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    pointer-events: none;
  }
  .tuto-box {
    background: #fff;
    border-radius: 18px 0 0 18px;
    box-shadow: -4px 0 24px rgba(0,0,0,0.18);
    margin: 32px 0 32px 0;
    padding: 38px 38px 28px 38px;
    min-height: 320px;
    min-width: 350px;
    max-width: 470px;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    animation: tuto-slide-in 0.6s cubic-bezier(.4,0,.2,1);
  }
  @keyframes tuto-slide-in {
    from {transform: translateX(120%); opacity:0;}
    to {transform: translateX(0); opacity:1;}
  }
  .tuto-character img {
    width: 130px;
    height: 130px;
    display: block;
    margin-bottom: 20px;
  }
  .tuto-text-container {
    width: 100%;
    text-align: left;
    font-size: 1.35rem;
    color: #222;
    min-height: 100px;
    margin-bottom: 20px;
    line-height: 1.6;
  }
  #tuto-next-btn {
    background: #36badb;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 28px;
    font-size: 1.04rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(54,186,219,0.09);
    transition: background 0.2s;
  }
  #tuto-next-btn:hover {
    background: #1d04e0;
  }
  .tuto-open-btn {
    position: fixed;
    bottom: 32px;
    right: 38px;
    z-index: 9998;
    background: #36badb;
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(54,186,219,0.12);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
  }
  .tuto-open-btn:hover {
    background: #1d04e0;
    box-shadow: 0 4px 16px rgba(29,4,224,0.17);
  }
  @media (max-width: 600px) {
    .tuto-overlay.tuto-right {
      width: 100vw;
      align-items: flex-end;
    }
    .tuto-box {
      border-radius: 18px 18px 0 0;
      max-width: 98vw;
      min-width: 0;
      margin: 0 0 12px 0;
      padding: 20px 10px 12px 10px;
    }
    .tuto-open-btn {
      right: 10px;
      bottom: 10px;
      padding: 12px 18px;
      font-size: 0.98rem;
    }
  }