/* solo.php — règles propres à cette page.
   L'habillage commun (body, #app, top-bar, h1, info-bar, boutons, overlay,
   footer, shake) vient de fichiers-partages-des-jeux/css/jeu.css.
   Ne garder ici que ce qui est propre au quizz. */

/* Le contexte d'empilement de #app (position + z-index) est pose dans
   quizz-banner.css, au meme endroit que le body::before qui le rend
   necessaire. Ne pas le dupliquer ici : deux copies finissent par diverger. */

/* --- Compteurs de la barre d'info ----------------------------------------- */
.question-count {
  color: var(--color-light);
}

.timer-display {
  color: #d07070;
}

.score-display {
  color: #64ab7c;
}

/* --- Jauge de temps -------------------------------------------------------- */
.timer-bar-container {
  width: 100%;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
}

.timer-bar {
  width: 100%;
  height: 100%;
  background: var(--color-mid);
  border-radius: 3px;
  transition: width 0.3s linear;
}

.timer-bar.warning {
  background: #d07070;
}

/* --- Question -------------------------------------------------------------- */
.question-zone {
  margin-bottom: 24px;
}

.question-categorie {
  font-size: 0.8rem;
  color: var(--color-light);
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.question-texte {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--texte);
  line-height: 1.5;
  margin-bottom: 24px;
  min-height: 60px;
}

.anecdote {
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--color-mid);
  border-radius: 4px;
  color: var(--texte-doux);
  font-size: 0.88rem;
  line-height: 1.5;
  text-align: left;
  animation: fadeInAnecdote 0.3s ease;
}

@keyframes fadeInAnecdote {

  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Passage anticipé à la question suivante, sans attendre la fin de lecture. */
.suite-question {
  margin-top: 14px;
  text-align: center;
}

/* --- Réponses --------------------------------------------------------------
   Quatre états doivent rester distincts d'un coup d'oeil : neutre, la reponse
   choisie et juste, la reponse choisie et fausse, et la bonne reponse revelee
   apres une erreur. Fonds opaques : deux voiles rgba() sur un fond sombre
   composent presque la meme couleur. */
.reponses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.reponse-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 16px 14px;
  border: 1px solid var(--line-forte);
  border-radius: 6px;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--texte);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  text-align: center;
  line-height: 1.4;
}

.reponse-btn:hover:not(.disabled) {
  background: color-mix(in srgb, var(--color-light) 12%, var(--surface-2));
  border-color: var(--color-light);
}

/* Choisie et juste : vert plein. */
.reponse-btn.correct {
  background: #14432a;
  border-color: #2f7f52;
  color: #7ee29b;
}

/* Choisie et fausse : rouge plein. */
.reponse-btn.incorrect {
  background: #4d1f24;
  border-color: #a33a48;
  color: #ff9a9a;
}

/* La bonne reponse, revelee apres une erreur : verte elle aussi, mais creuse
   plutot que pleine, pour ne pas se confondre avec « tu as trouve ». */
.reponse-btn.show-correct {
  background: var(--surface-2);
  border-color: #2f7f52;
  color: #7ee29b;
}

.reponse-btn.disabled {
  cursor: default;
  opacity: 0.6;
}

.loading-zone {
  padding: 40px 0;
  color: var(--texte-doux);
  font-size: 1rem;
}

/* --- Fin de partie --------------------------------------------------------- */
.overlay-box .win {
  color: #64ab7c;
}

.overlay-box .ok {
  color: #d2973a;
}

.overlay-box .lose {
  color: #d07070;
}

.overlay-box .score-final {
  font-size: 2rem;
  font-weight: 800;
  color: var(--texte);
  margin: 12px 0;
}

.cta-score-msg {
  font-size: 0.88rem;
  color: var(--texte-doux);
  margin-bottom: 12px;
}

.cta-auth-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
}

/* --- Confettis ------------------------------------------------------------- */
.confetti {
  position: fixed;
  top: -10px;
  z-index: 200;
  pointer-events: none;
  font-size: 1.2rem;
  animation: confetti-fall 3s ease-in forwards;
}

@keyframes confetti-fall {

  to {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

/* --- Responsive ------------------------------------------------------------ */

@media (max-width: 480px) {

  .reponses {
    grid-template-columns: 1fr;
  }

  .question-texte {
    font-size: 1.05rem;
  }
}
