/* ===================================================================
   IrisKids — Kids Quiz
   Aligné sur le design system (iriskids-ui.css déjà importé)
   =================================================================== */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--ik-font, 'Baloo 2', system-ui, sans-serif);
  color: var(--ik-text, #1a1033);
  background:
    radial-gradient(circle at 15% -10%, #fef3c7 0%, transparent 45%),
    radial-gradient(circle at 100% 100%, #ede9fe 0%, transparent 50%),
    #fffafc;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* === Layout commun aux écrans === */
.screen {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--ik-header-h, 52px) + 20px) 18px 40px;
  animation: screen-in .3s cubic-bezier(.34,1.56,.64,1);
}
.screen.hidden { display: none; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === HERO (écran d'accueil) === */
.hero {
  text-align: center;
  padding: 12px 0 8px;
}
.hero-emoji {
  font-size: 64px;
  line-height: 1;
  display: inline-block;
  filter: drop-shadow(0 6px 12px rgba(234, 179, 8, .35));
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0)    rotate(-3deg); }
  50%      { transform: translateY(-6px) rotate(3deg); }
}
.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 8px 0 4px;
  background: linear-gradient(135deg, #eab308 0%, #f97316 60%, #ec4899 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -.01em;
}
.hero-sub {
  margin: 0;
  font-size: 1rem;
  color: var(--ik-muted, #6b7280);
}

/* === Section labels === */
.section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ik-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin: 26px 4px 10px;
}

/* === Catégories === */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 10px;
}
.cat-btn {
  position: relative;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 18px;
  padding: 16px 10px 14px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  box-shadow: 0 4px 16px rgba(15, 10, 30, .06);
  transition: transform .15s cubic-bezier(.34,1.56,.64,1), border-color .15s, box-shadow .15s;
}
.cat-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  border-radius: 18px 18px 0 0;
  background: var(--cat-color, #eab308);
}
.cat-btn:hover  { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(15, 10, 30, .12); }
.cat-btn:active { transform: scale(.96); }
.cat-btn.active {
  border-color: var(--cat-color, #eab308);
  box-shadow: 0 8px 24px rgba(234, 179, 8, .25);
}
.cat-btn .cat-emoji { display: block; font-size: 32px; line-height: 1; margin-bottom: 4px; }
.cat-btn .cat-name  { font-size: .95rem; font-weight: 700; color: var(--ik-text, #1a1033); }

/* === Difficulté === */
.difficulty-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.diff-btn {
  background: #fff;
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 12px 8px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  box-shadow: 0 4px 12px rgba(15, 10, 30, .05);
  transition: transform .15s, border-color .15s, background .15s;
}
.diff-btn:active { transform: scale(.96); }
.diff-btn.active {
  background: linear-gradient(135deg, #fef3c7, #fff);
  border-color: var(--ik-accent, #eab308);
  box-shadow: 0 8px 18px rgba(234, 179, 8, .22);
}
.diff-emoji { display: block; font-size: 24px; line-height: 1; margin-bottom: 2px; }
.diff-name  { font-size: .9rem; font-weight: 700; color: var(--ik-text, #1a1033); }

/* === Boutons primaires / secondaires === */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary {
  background: linear-gradient(135deg, #eab308, #f97316);
  color: #fff;
  box-shadow: 0 8px 22px rgba(234, 179, 8, .35);
  width: 100%;
  margin-top: 22px;
}
.btn-primary:hover  { box-shadow: 0 14px 28px rgba(234, 179, 8, .45); }
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-secondary {
  background: #fff;
  color: var(--ik-text, #1a1033);
  border: 2px solid #e5e7eb;
  width: 100%;
  margin-top: 10px;
}
.btn-secondary:hover { border-color: var(--ik-accent, #eab308); }
.btn-icon  { font-size: 1.2em; line-height: 1; }
.btn-label { white-space: nowrap; }

/* === Topbar du quiz === */
.quiz-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.progress-wrap { flex: 1; }
.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .82rem;
  font-weight: 700;
  color: var(--ik-muted, #6b7280);
  margin-bottom: 6px;
}
.streak-badge {
  background: linear-gradient(135deg, #fb923c, #ef4444);
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .8rem;
  animation: streak-pop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes streak-pop {
  0%   { transform: scale(.6); opacity: 0; }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.progress-bar {
  height: 8px;
  background: rgba(0, 0, 0, .06);
  border-radius: 999px;
  overflow: hidden;
}
#progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #eab308, #f97316);
  border-radius: 999px;
  transition: width .35s ease;
}
.score-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(15, 10, 30, .08);
}
.score-icon { font-size: 1.1em; }

/* === Carte de question === */
.question-card {
  background: #fff;
  border-radius: 22px;
  padding: 22px 18px 18px;
  box-shadow: 0 12px 32px rgba(15, 10, 30, .08);
}
.question-cat {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--ik-muted, #6b7280);
  background: rgba(0, 0, 0, .04);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.question-text {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 18px;
  color: var(--ik-text, #1a1033);
}

/* === Options de réponse === */
.options-list {
  display: grid;
  gap: 10px;
}
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f9fafb;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 14px 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  color: var(--ik-text, #1a1033);
  transition: transform .12s, border-color .15s, background .15s;
}
.option:hover  { background: #fff; border-color: #e5e7eb; transform: translateX(2px); }
.option:active { transform: scale(.98); }
.option .opt-letter {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .85rem;
  color: var(--ik-muted, #6b7280);
}

/* États après clic */
.option.correct {
  background: #dcfce7;
  border-color: #22c55e;
  color: #166534;
}
.option.correct .opt-letter { background: #22c55e; border-color: #22c55e; color: #fff; }

.option.wrong {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
  animation: shake .35s ease;
}
.option.wrong .opt-letter { background: #ef4444; border-color: #ef4444; color: #fff; }

.option.disabled { opacity: .55; cursor: default; }
.option.disabled:hover { transform: none; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}

/* === Feedback === */
.feedback {
  margin-top: 16px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fef3c7, #fff7ed);
  animation: feedback-in .3s cubic-bezier(.34,1.56,.64,1);
}
.feedback.hidden { display: none; }
.feedback.is-correct { background: linear-gradient(135deg, #dcfce7, #ecfdf5); }
.feedback.is-wrong   { background: linear-gradient(135deg, #fee2e2, #fef2f2); }

@keyframes feedback-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.feedback-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.feedback-icon  { font-size: 1.4rem; line-height: 1; }
.feedback-title { font-size: 1.05rem; font-weight: 800; }
.feedback.is-correct .feedback-title { color: #166534; }
.feedback.is-wrong   .feedback-title { color: #991b1b; }

.feedback-fact {
  margin: 0 0 12px;
  font-size: .95rem;
  line-height: 1.45;
  color: var(--ik-text, #1a1033);
}
.feedback .btn-primary { margin-top: 4px; }

/* === Écran de résultat === */
.result-card {
  background: #fff;
  border-radius: 24px;
  padding: 28px 22px 22px;
  box-shadow: 0 16px 40px rgba(15, 10, 30, .1);
  text-align: center;
}
.result-stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 42px;
  line-height: 1;
}
.result-stars .star {
  filter: grayscale(1) opacity(.3);
  transform: scale(.8);
  transition: all .4s cubic-bezier(.34,1.56,.64,1);
}
.result-stars .star.lit {
  filter: none;
  transform: scale(1);
  animation: star-pop .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes star-pop {
  0%   { transform: scale(.4) rotate(-30deg); }
  60%  { transform: scale(1.2) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}
.result-title {
  font-size: 1.7rem;
  font-weight: 800;
  margin: 4px 0 6px;
  color: var(--ik-text, #1a1033);
}
.result-message {
  margin: 0 0 22px;
  color: var(--ik-muted, #6b7280);
  font-size: 1rem;
  line-height: 1.4;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.stat-block {
  background: #f9fafb;
  border-radius: 14px;
  padding: 14px 6px 10px;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ik-text, #1a1033);
  line-height: 1.1;
}
.stat-total {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ik-muted, #6b7280);
  margin-left: 1px;
}
.stat-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--ik-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 4px;
}
.result-actions { display: flex; flex-direction: column; }

/* === Responsive === */
@media (max-width: 380px) {
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-title      { font-size: 1.8rem; }
  .question-text   { font-size: 1.2rem; }
  .stat-value      { font-size: 1.25rem; }
}

@media (min-width: 720px) {
  .result-actions {
    flex-direction: row;
    gap: 10px;
  }
  .result-actions .btn-primary,
  .result-actions .btn-secondary {
    margin-top: 0;
  }
}


/* ═════════════════════════════════════════════════════════════════════════
   Sprint Q2 + Q2.b — Quiz mobile-first fullscreen
   • Zéro scroll sur smartphone (layout flex column 100dvh)
   • Mascotte top : visible desktop, hidden mobile
   • Mascotte feedback : visible partout, dans l'overlay
   • Feedback en overlay absolute par-dessus les options
   • Auto-advance avec progress bar + tap-to-skip
   ═════════════════════════════════════════════════════════════════════════ */

/* ─── Préférences (voix / sons / auto) ───────────────────────────────── */
.prefs-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 16px;
  flex-wrap: wrap;
}
.pref-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 72px;
  padding: 8px 14px;
  border-radius: 16px;
  border: 2px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity .15s, border-color .15s, transform .12s, background .15s;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.pref-btn:hover { transform: translateY(-1px); }
.pref-btn.is-on {
  opacity: 1;
  border-color: var(--ik-accent, #eab308);
  background: #fefce8;
  color: #1a1033;
}
.pref-emoji { font-size: 1.3rem; line-height: 1; }
.pref-label { font-size: 0.72rem; }

/* ─── Best score (écran accueil) ─────────────────────────────────────── */
.best-score-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px auto 0;
  max-width: 380px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
  border: 2px dashed #eab308;
  color: #713f12;
  font-size: 0.92rem;
  line-height: 1.4;
}
.bs-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.bs-text { flex: 1; }
.bs-text strong { font-weight: 800; color: #1a1033; }
.bs-when { font-size: 0.78rem; color: #92400e; }

/* ═════════════════════════════════════════════════════════════════════
   ÉCRAN QUIZ — Layout fixed-screen mobile, zéro scroll
   ═════════════════════════════════════════════════════════════════════ */

/* Quand on est sur l'écran quiz, le body devient fullscreen */
body[data-ik-quiz-mode="fullscreen"] {
  overflow: hidden;
  position: fixed;
  inset: 0;
  height: 100dvh;
}
/* Le footer mini (injecté par iriskids-header.js) est caché en mode quiz */
body[data-ik-quiz-mode="fullscreen"] .ik-footer-mini {
  display: none !important;
}

#screen-quiz {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--ik-header-h, 52px));
  margin-top: var(--ik-header-h, 52px);
  padding: 12px 14px 14px;
  box-sizing: border-box;
  overflow: hidden;
  gap: 10px;
}
#screen-quiz.hidden { display: none; }

/* Topbar compacte */
.quiz-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Card question : flex:1 pour prendre toute la hauteur restante */
.question-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  position: relative;          /* support pour le feedback overlay absolute */
  overflow: hidden;
  min-height: 0;               /* important pour que flex:1 marche */
  margin: 0 !important;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Animation transitions entre questions */
.question-card.q-anim-out { transform: translateX(-30px); opacity: 0; }
.question-card.q-anim-in  { animation: q-slide-in 0.35s ease; }
@keyframes q-slide-in {
  from { transform: translateX(30px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ─── Mascotte au-dessus du card (desktop only) ──────────────────────── */
.mascot-wrap--top {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}
.mascot {
  width: 80px;
  height: 80px;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 4px 8px rgba(123, 63, 228, 0.18));
}

/* Sur mobile : cacher la mascotte top (place trop précieuse) */
@media (max-width: 639px) {
  .mascot-wrap--top { display: none; }
}
@media (min-width: 640px) {
  .mascot { width: 100px; height: 100px; }
}

/* États mascotte */
.mascot--idle     { animation: mascot-bob 2.8s ease-in-out infinite; }
.mascot--thinking { animation: mascot-think 1.2s ease-in-out infinite; }
.mascot--correct  { animation: mascot-bounce 0.6s ease; }
.mascot--correct .mascot-mouth { d: path("M 38,64 Q 50,76 62,64"); stroke-width: 3; }
.mascot--wrong    { animation: mascot-shake 0.55s ease; }
.mascot--wrong .mascot-mouth { d: path("M 42,72 Q 50,64 58,72"); }
.mascot--wrong .mascot-tear  { opacity: 1; animation: mascot-tear-fall 1.6s ease forwards; }
.mascot--victory  { animation: mascot-victory-jump 0.8s ease; transform-origin: center bottom; }
.mascot--victory .mascot-crown { opacity: 1; animation: mascot-crown-pop 0.5s ease; }

@keyframes mascot-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
@keyframes mascot-think {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(3deg); }
}
@keyframes mascot-bounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.18) translateY(-8px); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}
@keyframes mascot-shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px) rotate(-2deg); }
  40%      { transform: translateX(6px) rotate(2deg); }
  60%      { transform: translateX(-4px) rotate(-1deg); }
  80%      { transform: translateX(4px) rotate(1deg); }
}
@keyframes mascot-victory-jump {
  0%   { transform: scale(1) translateY(0); }
  35%  { transform: scale(1.18) translateY(-20px); }
  70%  { transform: scale(0.96) translateY(0); }
  100% { transform: scale(1); }
}
@keyframes mascot-crown-pop {
  from { transform: scale(0) translateY(10px); opacity: 0; }
  60%  { transform: scale(1.3); opacity: 1; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes mascot-tear-fall {
  0%   { opacity: 0; transform: translateY(0); }
  25%  { opacity: 1; transform: translateY(2px); }
  100% { opacity: 0; transform: translateY(20px); }
}

/* ─── Question text : compacté en mode mobile fullscreen ──────────────── */
.question-cat {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  margin: 0 0 4px;
  text-align: center;
}
.question-text {
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 0 0 14px;
  text-align: center;
  color: #1a1033;
  flex-shrink: 0;
}
@media (min-width: 640px) {
  .question-text { font-size: 1.4rem; margin-bottom: 18px; }
}

/* ─── Stage : zone options + feedback overlay (position: relative) ────── */
.quiz-stage {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}
.options-list .option {
  flex-shrink: 0;
}

/* ─── Feedback OVERLAY : absolute par-dessus les options ──────────────── */
.feedback {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #fef3c7 100%);
  cursor: pointer;
  animation: feedback-pop 0.32s cubic-bezier(.34, 1.56, .64, 1);
  -webkit-tap-highlight-color: transparent;
}
.feedback.hidden { display: none; }
.feedback.is-correct {
  background: linear-gradient(180deg, #fff 0%, #d1fae5 100%);
  border: 2px solid #10b981;
}
.feedback.is-wrong {
  background: linear-gradient(180deg, #fff 0%, #fee2e2 100%);
  border: 2px solid #ef4444;
}

@keyframes feedback-pop {
  0%   { transform: scale(0.85); opacity: 0; }
  60%  { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); }
}

/* Mascotte dans le feedback */
.mascot-wrap--feedback {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}
.mascot-wrap--feedback .mascot {
  width: 72px;
  height: 72px;
}
@media (min-width: 640px) {
  .mascot-wrap--feedback .mascot { width: 96px; height: 96px; }
}

.feedback-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: #1a1033;
  text-align: center;
}
.feedback-icon { font-size: 1.6rem; line-height: 1; }
.feedback-title { line-height: 1.25; }

.feedback-fact {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: center;
  color: #1a1033;
  max-width: 100%;
  padding: 0 4px;
}
@media (min-width: 640px) {
  .feedback-fact { font-size: 1.05rem; }
}

/* Footer du feedback : progress bar + bouton */
.feedback-footer {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-shrink: 0;
}

/* Progress bar de l'auto-advance */
.auto-progress {
  flex: 1;
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s;
}
.auto-progress.is-active { opacity: 1; }
.auto-progress-fill {
  height: 100%;
  width: 100%;
  background: var(--ik-accent, #eab308);
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: left center;
}
.feedback.is-correct .auto-progress-fill { background: #10b981; }
.feedback.is-wrong .auto-progress-fill { background: #ef4444; }

/* Bouton "Suivante" dans le feedback : compact */
.feedback-next {
  flex-shrink: 0;
  margin: 0 !important;
  padding: 10px 18px !important;
  min-height: 44px;
  font-size: 0.95rem !important;
}

.feedback-hint {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: #6b7280;
  text-align: center;
  font-style: italic;
}

/* ─── New record badge ────────────────────────────────────────────────── */
.new-record-badge {
  display: inline-block;
  margin: 8px auto 16px;
  padding: 10px 20px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
  border: 2px solid #f59e0b;
  color: #92400e;
  font-weight: 800;
  font-size: 1rem;
  animation: record-pulse 1.2s ease-in-out infinite alternate;
}
@keyframes record-pulse {
  from { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  to   { transform: scale(1.04); box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

/* ─── Timer SVG cercle ────────────────────────────────────────────────── */
.timer-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.timer-svg { width: 100%; height: 100%; display: block; }
.timer-bg { stroke: #e5e7eb; }
.timer-fg {
  stroke: var(--ik-accent, #eab308);
  stroke-dasharray: 113.097;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.95s linear, stroke 0.3s;
}
.timer-wrap.is-warning .timer-fg { stroke: #f97316; }
.timer-wrap.is-danger  .timer-fg { stroke: #ef4444; }
.timer-num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; color: #1a1033;
  font-variant-numeric: tabular-nums;
}
.timer-wrap.is-danger .timer-num {
  color: #ef4444;
  animation: timer-pulse 0.5s ease-in-out infinite alternate;
}
@keyframes timer-pulse {
  from { transform: scale(1); }
  to   { transform: scale(1.15); }
}

/* ─── Mobile compactage final (≤ 480px : iPhone SE-ish) ───────────────── */
@media (max-width: 480px) {
  #screen-quiz {
    padding: 8px 10px 10px;
    gap: 8px;
  }
  .question-card {
    padding: 10px 12px;
    border-radius: 14px;
  }
  .quiz-topbar { gap: 6px; }
  .timer-wrap { width: 40px; height: 40px; }
  .timer-num { font-size: 0.9rem; }
  .progress-meta { font-size: 0.78rem; }
  .score-pill { padding: 4px 10px; font-size: 0.9rem; }
  .question-cat { font-size: 0.72rem; margin-bottom: 2px; }
  .question-text { font-size: 1rem; line-height: 1.25; margin-bottom: 10px; }
  .options-list { gap: 6px; }
  .options-list .option { padding: 10px 12px; font-size: 0.92rem; min-height: 44px; }
  .pref-btn { min-width: 64px; padding: 6px 10px; }
  .pref-emoji { font-size: 1.15rem; }
  .best-score-card { font-size: 0.85rem; padding: 10px 12px; }
  .feedback { padding: 12px 10px; gap: 8px; }
  .feedback-header { font-size: 1rem; gap: 8px; }
  .feedback-icon { font-size: 1.4rem; }
  .feedback-fact { font-size: 0.88rem; line-height: 1.35; }
  .feedback-next { padding: 8px 14px !important; font-size: 0.88rem !important; }
  .mascot-wrap--feedback .mascot { width: 60px; height: 60px; }
  .feedback-hint { font-size: 0.72rem; }
}

/* Très petits écrans (< 360px) : on cache la mascotte feedback pour gagner */
@media (max-width: 359px) {
  .mascot-wrap--feedback { display: none; }
}

/* ─── prefers-reduced-motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mascot, .mascot--idle, .mascot--thinking, .mascot--correct,
  .mascot--wrong, .mascot--victory, .question-card, .new-record-badge,
  .timer-fg, .timer-num, .feedback {
    animation: none !important;
    transition: opacity 0.15s ease !important;
  }
}
