/* ============================================================
   quiz.css — Quiz IA ou pas IA
   ============================================================ */

/* ── Wrapper global ── */
.quiz-wrapper {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: var(--nav-h);
  box-sizing: border-box;
  background: var(--ss-bg);
  color: var(--ss-text);
  font-family: var(--ss-font-body);
}

/* ── Écran intro ── */
.quiz-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  max-width: 580px;
  padding: 1.5rem 2rem;
}

.quiz-intro h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.quiz-intro h1 em {
  font-style: normal;
  color: var(--ss-accent);
}

.quiz-intro > p {
  font-size: 1rem;
  color: var(--ss-muted);
  line-height: 1.6;
}

.quiz-rules {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
  width: 100%;
}

.quiz-rule {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--ss-font-mono);
  font-size: 0.85rem;
  color: var(--ss-muted);
  padding: 0.5rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
}

.quiz-rule .material-icons-round {
  color: var(--ss-accent);
  font-size: 16px;
  flex-shrink: 0;
}

/* ── Écran question ── */
.quiz-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 720px;
  padding: 1rem 1.5rem;
  height: calc(100vh - var(--nav-h));
  box-sizing: border-box;
  justify-content: center;
}

/* Progress */
.quiz-progress {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quiz-progress-track {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--ss-accent);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.quiz-progress-label {
  font-family: var(--ss-font-mono);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

/* Media */
.quiz-media {
  width: 100%;
  display: flex;
  justify-content: center;
}

.quiz-image-wrap {
  width: min(340px, 100%);
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.quiz-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.quiz-audio-player {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.quiz-audio-icon {
  font-size: 2.8rem;
  line-height: 1;
}

.quiz-audio-hint {
  font-family: var(--ss-font-mono);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.3);
}

.quiz-audio-controls {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
}

.quiz-play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ss-accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}
.quiz-play-btn:hover {
  background: #2563eb;
  transform: scale(1.05);
}
.quiz-play-btn .material-icons-round {
  font-size: 22px;
  color: #fff;
}

.quiz-audio-bar-track {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
}

.quiz-audio-bar-fill {
  height: 100%;
  background: var(--ss-accent);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.quiz-audio-time {
  font-family: var(--ss-font-mono);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

/* Boutons vote */
.quiz-btns {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.quiz-btn {
  flex: 1;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  color: var(--ss-text);
}

.quiz-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.quiz-btn-emoji {
  font-size: 2.2rem;
  line-height: 1;
}

.quiz-btn-label {
  font-family: var(--ss-font-mono);
  font-size: 0.95rem;
  font-weight: 700;
}

.quiz-btn--ai:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}
.quiz-btn--human:hover {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.quiz-btn--correct {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.15) !important;
  transform: none !important;
}
.quiz-btn--wrong {
  border-color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.1) !important;
  opacity: 0.5;
  transform: none !important;
}
.quiz-btn--missed {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.08) !important;
  opacity: 0.7;
}

/* Révélation */
.quiz-reveal {
  width: 100%;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-family: var(--ss-font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  display: none;
  animation: quizRevealIn 0.3s ease;
}
.quiz-reveal.is-visible {
  display: block;
}

@keyframes quizRevealIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quiz-reveal--correct {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}
.quiz-reveal--wrong {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #fca5a5;
}

.quiz-next-btn {
  align-self: flex-end;
  display: none;
}
.quiz-next-btn.is-visible {
  display: flex;
}

/* ── Écran résultat ── */
.quiz-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  max-width: 580px;
  padding: 1.5rem 2rem;
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  box-sizing: border-box;
}

.quiz-score-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 4px solid var(--ss-accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.08);
  flex-shrink: 0;
}

.quiz-score-number {
  font-family: var(--ss-font-mono);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--ss-accent);
  line-height: 1;
}

.quiz-score-total {
  font-family: var(--ss-font-mono);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.4);
}

.quiz-score-msg {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ss-text);
}

.quiz-score-sub {
  font-size: 0.95rem;
  color: var(--ss-muted);
  line-height: 1.55;
}

.quiz-recap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}

.quiz-recap-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.9rem;
  border-radius: 7px;
  font-family: var(--ss-font-mono);
  font-size: 0.82rem;
}

.quiz-recap-item--correct {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}
.quiz-recap-item--wrong {
  background: rgba(244, 63, 94, 0.06);
  border: 1px solid rgba(244, 63, 94, 0.15);
  color: #fca5a5;
}

.quiz-recap-icon {
  font-size: 1rem;
  flex-shrink: 0;
}
.quiz-recap-text {
  flex: 1;
  color: rgba(255, 255, 255, 0.6);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .quiz-btns {
    flex-direction: column;
  }
  .quiz-image-wrap {
    width: min(260px, 100%);
  }
}
