/* ════════════════════════════════════════════════════════════════
   Jeux eXtragone — galerie /jeux et quiz du jour
   Couleurs du site (primary #335ca3, secondary #d83b39) en variables,
   redéfinies sous html.dark. Le JS construit le DOM du quiz avec ces
   classes : pas d'utilitaires Tailwind générés à la volée.
   ════════════════════════════════════════════════════════════════ */

:root {
  --g-blue: #335ca3;
  --g-blue-strong: #24467f;
  --g-blue-soft: #e8eef8;
  --g-red: #d83b39;
  --g-red-soft: #fdecec;
  /* Vert = bonne réponse (couleur sémantique « succès » de DESIGN.md). green-700 : texte blanc à 5:1. */
  --g-green: #15803d;
  --g-green-strong: #166534;
  --g-green-text: #15803d;
  --g-green-soft: #dcfce7;
  --g-gold: #f2b705;
  --g-card: #ffffff;
  --g-sunk: #f1f5f9;
  --g-line: #e2e8f0;
  --g-line-strong: #cbd5e1;
  --g-text: #0f172a;
  --g-muted: #64748b;
  /* Plat au repos (DESIGN.md, « Earned Lift ») : l'ombre marquée est réservée au survol. */
  --g-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  --g-shadow-lift: 0 4px 6px -1px rgba(15, 23, 42, .1), 0 2px 4px -2px rgba(15, 23, 42, .1);
  /* Décélérations exponentielles, jamais de rebond. */
  --g-ease: cubic-bezier(.22, 1, .36, 1);
  --g-ease-expo: cubic-bezier(.16, 1, .3, 1);
  --g-radius: 16px;
  --g-radius-el: 12px;
}
html.dark {
  --g-blue: #6b93d6;
  --g-blue-strong: #8fb0e6;
  --g-blue-soft: rgba(51, 92, 163, .22);
  --g-red: #f0706e;
  --g-red-soft: rgba(216, 59, 57, .2);
  --g-green: #15803d;
  --g-green-strong: #14532d;
  --g-green-text: #4ade80;
  --g-green-soft: rgba(22, 163, 74, .2);
  --g-gold: #f5c842;
  --g-card: #1e293b;
  --g-sunk: #0f172a;
  --g-line: #334155;
  --g-line-strong: #475569;
  --g-text: #f8fafc;
  --g-muted: #94a3b8;
  --g-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --g-shadow-lift: 0 4px 6px -1px rgba(0, 0, 0, .35), 0 2px 4px -2px rgba(0, 0, 0, .3);
}

/* ─── Galerie ─────────────────────────────────────────────────── */

.games { display: grid; gap: 16px; }
.game-card {
  position: relative;
  display: grid;
  background: var(--g-card);
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius);
  overflow: hidden;
  color: var(--g-text);
  text-decoration: none;
  box-shadow: var(--g-shadow);
  transition: box-shadow .25s var(--g-ease), border-color .25s var(--g-ease);
}
a.game-card:hover { box-shadow: var(--g-shadow-lift); border-color: var(--g-line-strong); }
a.game-card:focus-visible { outline: 2px solid var(--g-blue); outline-offset: 3px; }
@media (min-width: 768px) {
  .game-card--featured { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}

/* Couverture : une question du quiz en miniature, déjà répondue, pour montrer le jeu
   tel qu'il se joue. Une pile de cartes derrière dit « plusieurs questions ». */
.game-cover {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 28px 24px 40px;
  background: var(--g-blue-soft);
  border-bottom: 1px solid var(--g-line);
  overflow: hidden;
}
@media (min-width: 768px) {
  .game-cover { min-height: 300px; border-bottom: 0; border-right: 1px solid var(--g-line); }
}
.game-cover__stack { position: relative; width: min(100% - 20px, 340px); }
.game-cover__ghost,
.game-cover__card {
  border-radius: 14px;
  background: var(--g-card);
  border: 1px solid var(--g-line);
}
.game-cover__ghost {
  position: absolute;
  inset: 0;
  transform: translate(10px, 10px);
  opacity: .7;
  transition: transform .3s var(--g-ease);
}
.game-cover__ghost--2 { transform: translate(20px, 20px); opacity: .4; }
.game-cover__card {
  position: relative;
  padding: 14px;
  box-shadow: var(--g-shadow-lift);
  transition: transform .3s var(--g-ease);
}
a.game-card:hover .game-cover__card { transform: translateY(-3px); }
a.game-card:hover .game-cover__ghost { transform: translate(12px, 12px); }
a.game-card:hover .game-cover__ghost--2 { transform: translate(24px, 25px); }

.game-cover__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--g-muted);
}
.game-cover__tag { color: var(--g-blue-strong); background: var(--g-blue-soft); border-radius: 999px; padding: 4px 7px; }
.game-cover__bar { display: flex; gap: 4px; margin: 10px 0 14px; }
.game-cover__bar i { flex: 1; height: 5px; border-radius: 999px; background: var(--g-sunk); border: 1px solid var(--g-line); }
.game-cover__bar i.is-right { background: var(--g-green); border-color: var(--g-green); }
.game-cover__q { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; line-height: 1.25; }
.game-cover__q img {
  flex: none;
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--g-line);
  border-radius: 10px;
  padding: 4px;
}
.game-cover__choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.game-cover__choices span {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--g-line);
  font-size: 13px;
  font-weight: 600;
  color: var(--g-muted);
}
.game-cover__choices span svg { border-radius: 2px; box-shadow: 0 0 0 1px rgba(15, 23, 42, .15); }
.game-cover__choices .is-right { background: var(--g-green); border-color: var(--g-green); color: #ffffff; }
.game-cover__choices .is-right b,
.game-cover__verdict i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--g-green);
  color: #ffffff;
  font-size: 9px;
}
.game-cover__choices .is-right b { position: absolute; top: -7px; right: -6px; border: 2px solid var(--g-card); width: 20px; height: 20px; }
.game-cover__bar i.is-current { background: var(--g-line-strong); }
.game-cover__pixel {
  width: 96px;
  height: 96px;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid var(--g-line);
  background: #ffffff;
  overflow: hidden;
}
.game-cover__pixel canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.game-cover__meter { display: flex; justify-content: center; gap: 4px; margin: 10px 0 2px; }
.game-cover__meter i { width: 16px; height: 4px; border-radius: 999px; background: var(--g-line-strong); }
.game-cover__meter i.is-on { background: var(--g-blue); }
.game-cover__choices--names span { min-height: 32px; color: var(--g-text); }
.game-cover__verdict { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--g-green-text); }

.game-card__body { display: flex; flex-direction: column; gap: 10px; padding: 22px; }
@media (min-width: 768px) {
  .game-card--featured .game-card__body { justify-content: center; padding: 32px 36px; }
}
.game-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.game-card__eyebrow { font: 600 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--g-muted); }
.game-card__state {
  font-size: 12px;
  font-weight: 600;
  color: var(--g-green-text);
  background: var(--g-green-soft);
  border-radius: 999px;
  padding: 4px 10px;
  animation: g-pop .3s var(--g-ease-expo) both;
}
.game-card__state.is-streak { color: #8a5a00; background: #fff4d6; }
html.dark .game-card__state.is-streak { color: #f5c842; background: rgba(242, 183, 5, .16); }
.game-card__title { font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.game-card__pitch { font-size: 15px; line-height: 1.6; color: var(--g-muted); max-width: 46ch; }
.game-card__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--g-muted); }
.game-card__meta i { color: var(--g-blue); margin-right: 6px; }
.game-card__cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 20px;
  border-radius: var(--g-radius-el);
  background: #335ca3;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  transition: background .2s var(--g-ease);
}
a.game-card:hover .game-card__cta { background: #24467f; }
.game-card__cta i { transition: transform .2s var(--g-ease); }
a.game-card:hover .game-card__cta i { transform: translateX(3px); }

/* Jeux à venir : une ligne discrète, pas une carte jumelle de la carte jouable. */
.games-soon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 14px 18px;
  border: 1px dashed var(--g-line-strong);
  border-radius: var(--g-radius);
  font-size: 14px;
  color: var(--g-muted);
}
.games-soon p { margin: 0; flex: 1 1 260px; }
.games-soon b { color: var(--g-text); font-weight: 600; }
.games-soon__icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--g-sunk); }
.games-soon a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; color: var(--g-blue); font-weight: 600; text-decoration: none; }
.games-soon a:hover { text-decoration: underline; }
.games-soon a:focus-visible { outline: 2px solid var(--g-blue); outline-offset: 2px; border-radius: 4px; }

/* ─── Quiz : cadre ────────────────────────────────────────────── */

.quiz {
  max-width: 560px;
  margin: 0 auto;
  color: var(--g-text);
}
.quiz-card {
  position: relative;
  background: var(--g-card);
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius);
  box-shadow: var(--g-shadow);
  padding: 20px;
  overflow: hidden;
}
@media (min-width: 640px) { .quiz-card { padding: 28px; } }
.quiz-enter { animation: g-enter .35s var(--g-ease) both; }

.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.quiz-step { font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--g-muted); }
.quiz-progress { display: flex; gap: 6px; margin-bottom: 18px; }
.quiz-progress span {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--g-sunk);
  border: 1px solid var(--g-line);
  transition: background .3s, transform .3s;
}
.quiz-progress span.is-current { background: var(--g-line-strong); }
.quiz-progress span.is-right { background: var(--g-green); border-color: var(--g-green); animation: g-bump .35s ease-out; }
.quiz-progress span.is-wrong { background: var(--g-red); border-color: var(--g-red); animation: g-bump .35s ease-out; }

.quiz-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 11px;
  background: var(--g-sunk);
  color: var(--g-text);
  border: 1px solid var(--g-line);
}
.quiz-chip--combo { background: #fff4d6; border-color: #f6d77a; color: #8a5a00; animation: g-pop .35s var(--g-ease-expo) both; }
html.dark .quiz-chip--combo { background: rgba(242, 183, 5, .16); border-color: rgba(242, 183, 5, .45); color: #f5c842; }

.quiz-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--g-blue-strong);
  background: var(--g-blue-soft);
  border-radius: 999px;
  padding: 5px 10px;
}
.quiz-subject {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 18px 0 6px;
}
.quiz-subject img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 20px;
  padding: 12px;
  border: 1px solid var(--g-line);
  box-shadow: var(--g-shadow);
  animation: g-pop .4s var(--g-ease-expo) both;
}
.quiz-prompt {
  margin: 14px 0 18px;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.01em;
  text-align: center;
  text-wrap: balance;
}
@media (min-width: 640px) { .quiz-prompt { font-size: 25px; } }

/* ─── Quiz : choix ────────────────────────────────────────────── */

.quiz-choices { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quiz-choices--list { grid-template-columns: 1fr; }
@media (min-width: 480px) { .quiz-choices--list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.quiz-choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 64px;
  padding: 12px 14px;
  border-radius: var(--g-radius-el);
  border: 2px solid var(--g-line);
  background: var(--g-card);
  color: var(--g-text);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--g-line);
  transition: transform .15s var(--g-ease), box-shadow .15s var(--g-ease), border-color .2s, background .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.quiz-choice:hover:not(:disabled) { border-color: var(--g-blue); transform: translateY(-2px); box-shadow: 0 5px 0 var(--g-blue-soft); }
.quiz-choice:active:not(:disabled) { transform: translateY(2px) scale(.98); box-shadow: 0 1px 0 var(--g-line); }
.quiz-choice:focus-visible { outline: 3px solid var(--g-blue); outline-offset: 2px; }
.quiz-choice:disabled { cursor: default; }
.quiz-choice--tool { justify-content: flex-start; text-align: left; }
.quiz-choice--tool img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  background: #ffffff;
  border-radius: 9px;
  padding: 3px;
}
.quiz-choice--big { min-height: 96px; flex-direction: column; gap: 6px; font-size: 18px; }
.quiz-choice--big .quiz-flag { display: flex; align-items: center; justify-content: center; height: 32px; font-size: 28px; line-height: 1; color: var(--g-muted); }
.quiz-choice.is-right .quiz-flag { color: inherit; }

.quiz-choice.is-right {
  border-color: var(--g-green);
  background: var(--g-green);
  color: #ffffff;
  box-shadow: 0 3px 0 var(--g-green-strong);
  animation: g-win .45s var(--g-ease);
}
html.dark .quiz-choice.is-right { border-color: #22c55e; }
.quiz-choice.is-wrong {
  border-color: var(--g-red);
  background: var(--g-red-soft);
  color: var(--g-red);
  box-shadow: 0 3px 0 var(--g-red-soft);
  animation: g-shake .45s cubic-bezier(.36, .07, .19, .97);
}
.quiz-choice.is-answer { border-color: var(--g-green); border-style: dashed; background: var(--g-green-soft); }
html.dark .quiz-choice.is-answer { border-color: #22c55e; }
.quiz-choice.is-dim { opacity: .45; }
.quiz-choice .quiz-mark {
  position: absolute;
  top: -10px;
  right: -8px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #ffffff;
  background: var(--g-green);
  border: 2px solid var(--g-card);
  animation: g-pop .3s var(--g-ease-expo) both;
}
.quiz-choice.is-wrong .quiz-mark { background: var(--g-red); }

/* ─── Quiz : révélation ───────────────────────────────────────── */

.quiz-reveal { margin-top: 18px; animation: g-enter .35s var(--g-ease) both; }
/* Centré, comme la question et les choix au-dessus. */
.quiz-verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}
.quiz-verdict--right { color: var(--g-green-text); }
html.dark .quiz-verdict--right .quiz-badge { background: var(--g-green); }
.quiz-verdict--wrong { color: var(--g-red); }
.quiz-verdict__text { display: inline-block; animation: g-stamp .45s var(--g-ease-expo) .08s both; }
.quiz-combo { display: flex; justify-content: center; margin: -4px 0 14px; }
.quiz-combo .quiz-chip { animation-delay: .2s; }
/* Pastille : apparaît, la coche se trace, une onde part autour. */
.quiz-badge {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: currentColor;
  animation: g-pop .4s var(--g-ease-expo) both;
}
.quiz-badge svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: g-draw .32s .2s ease-out forwards;
}
.quiz-badge::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid currentColor;
  animation: g-ring .7s .15s var(--g-ease) both;
}
.quiz-verdict--wrong .quiz-badge::after { display: none; }
.quiz-verdict--wrong .quiz-badge { animation: g-pop .35s var(--g-ease-expo) both, g-shake .4s .3s ease-in-out; }
/* Sous-surface sans bordure ni ombre : pas de carte dans la carte (DESIGN.md, « No-Nesting »). */
.quiz-found {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--g-sunk);
  border-radius: var(--g-radius-el);
  padding: 14px;
}
.quiz-found img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  background: #ffffff;
  border-radius: 14px;
  padding: 5px;
  border: 1px solid var(--g-line);
}
.quiz-lead { margin: -2px auto 14px; max-width: 46ch; text-align: center; font-size: 14px; line-height: 1.55; color: var(--g-muted); text-wrap: balance; }
.quiz-found__kicker { font: 600 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--g-blue-strong); margin-bottom: 4px; }
.quiz-found__name { font-weight: 700; font-size: 17px; }
.quiz-found__where { font-size: 13px; font-weight: 600; color: var(--g-blue-strong); margin-top: 2px; }
.quiz-found__text { font-size: 14px; line-height: 1.55; color: var(--g-muted); margin-top: 6px; }
.quiz-found__link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--g-blue); }
.quiz-found__link:hover { text-decoration: underline; }
.quiz-found__link:focus-visible { outline: 2px solid var(--g-blue); outline-offset: 2px; border-radius: 4px; }
.quiz-crowd { margin-top: 10px; font-size: 13px; color: var(--g-muted); display: flex; align-items: center; gap: 8px; }
.quiz-crowd__bar { flex: 1; height: 6px; border-radius: 999px; background: var(--g-sunk); overflow: hidden; }
/* Largeur pilotée en transform (scaleX), pas en width : pas d'animation de layout. */
.quiz-crowd__bar span { display: block; height: 100%; background: var(--g-blue); border-radius: 999px; transform: scaleX(0); transform-origin: left; transition: transform .8s var(--g-ease) .15s; }

.quiz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  margin-top: 16px;
  border: 0;
  border-radius: var(--g-radius-el);
  background: var(--g-blue);
  color: #ffffff;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 #1b3563;
  transition: transform .15s var(--g-ease), box-shadow .15s var(--g-ease), filter .2s;
}
html.dark .quiz-btn { background: #335ca3; }
.quiz-btn:hover { filter: brightness(1.08); }
.quiz-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #1b3563; }
.quiz-btn:focus-visible { outline: 2px solid var(--g-blue); outline-offset: 3px; }
.quiz-btn--ghost { background: transparent; color: var(--g-text); border: 2px solid var(--g-line); box-shadow: none; }
html.dark .quiz-btn--ghost { background: transparent; }
.quiz-btn--ghost:hover { filter: none; border-color: var(--g-blue); color: var(--g-blue); }
.quiz-btn--ghost:active { box-shadow: none; }

/* ─── Quiz : accueil et fin ───────────────────────────────────── */

.quiz-hero { text-align: center; }
.quiz-hero__title { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
.quiz-hero__text { color: var(--g-muted); font-size: 15px; line-height: 1.5; text-wrap: balance; }
.quiz-logos { display: flex; justify-content: center; margin: 20px 0 4px; }
.quiz-logos img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 12px;
  padding: 5px;
  border: 2px solid var(--g-card);
  box-shadow: var(--g-shadow-lift);
  margin-left: -10px;
}
.quiz-logos img:first-child { margin-left: 0; }

.quiz-score {
  font-size: 84px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--g-blue);
  font-variant-numeric: tabular-nums;
  animation: g-stamp .5s var(--g-ease-expo) both;
}
.quiz-score small { font-size: 36px; font-weight: 700; color: var(--g-muted); }
.quiz-rank { font-size: 20px; font-weight: 700; margin-top: 6px; }
.quiz-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.quiz-stat { background: var(--g-sunk); border-radius: var(--g-radius-el); padding: 12px; text-align: center; }
.quiz-stat b { display: block; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.quiz-stat span { font-size: 13px; color: var(--g-muted); font-weight: 500; }
.quiz-stat--fire b { color: #c2410c; }
html.dark .quiz-stat--fire b { color: #fb923c; }
.quiz-stat--fire b i { display: inline-block; animation: g-pop .4s var(--g-ease-expo) .3s both; }
.quiz-better { margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--g-blue-strong); text-align: center; }
.quiz-better:empty { display: none; }
.quiz-next { margin-top: 14px; text-align: center; font-size: 14px; color: var(--g-muted); }
.quiz-next b { font-variant-numeric: tabular-nums; color: var(--g-text); }
.quiz-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.quiz-row .quiz-btn--ghost { width: auto; padding: 0 18px; min-width: 56px; }

.quiz-discover { margin-top: 22px; }
.quiz-discover h2 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.quiz-discover a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-top: 1px solid var(--g-line);
  color: var(--g-text);
  text-decoration: none;
  font-weight: 600;
}
.quiz-discover a:hover { color: var(--g-blue); }
.quiz-discover img { width: 32px; height: 32px; object-fit: contain; background: #ffffff; border-radius: 8px; padding: 2px; }
.quiz-discover small { margin-left: auto; color: var(--g-muted); font-weight: 500; }

/* ─── Logo mystère ────────────────────────────────────────────── */

/* Points partiels : vert = du premier coup (is-right), puis ambre et orange, rouge = raté. */
.quiz-progress span.is-p2 { background: #ca8a04; border-color: #ca8a04; animation: g-bump .35s ease-out; }
.quiz-progress span.is-p1 { background: #ea580c; border-color: #ea580c; animation: g-bump .35s ease-out; }
.quiz-chip--points { background: var(--g-green-soft); border-color: transparent; color: var(--g-green-text); animation: g-pop .35s var(--g-ease-expo) both; }
.quiz-lead a { color: var(--g-blue); font-weight: 600; }
.quiz-lead a:hover { text-decoration: underline; }

/* Le logo est dessiné dans un canvas : fond blanc dans les deux thèmes, comme les logos du site. */
.logo-stage {
  position: relative;
  width: 208px;
  height: 208px;
  margin: 6px auto 12px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid var(--g-line);
  box-shadow: var(--g-shadow);
  overflow: hidden;
}
@media (max-width: 400px) { .logo-stage { width: 176px; height: 176px; } }
.logo-stage canvas { display: block; width: 100%; height: 100%; }
.logo-stage.is-loading canvas { opacity: .35; }
.logo-stage__msg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: #64748b; }
.logo-stage__msg[hidden] { display: none; }
.logo-meter { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 0 4px; font-size: 12px; color: var(--g-muted); }
.logo-meter[hidden] { display: none; }
.logo-meter i { width: 22px; height: 5px; border-radius: 999px; background: var(--g-line-strong); transition: background .25s var(--g-ease); }
.logo-meter i.is-on { background: var(--g-blue); }
.logo-meter span { margin-left: 4px; font-variant-numeric: tabular-nums; }
.logo-more { display: flex; width: auto; min-height: 44px; margin: 12px auto 0; padding: 0 16px; font-size: 15px; font-weight: 600; }
.logo-more[hidden] { display: none; }
.logo-more:disabled { opacity: .5; cursor: default; }
.logo-more:disabled:hover { border-color: var(--g-line); color: var(--g-text); }
.logo-more__cost { margin-left: 4px; font-size: 12px; font-weight: 600; color: var(--g-muted); background: var(--g-sunk); border-radius: 999px; padding: 2px 8px; }
.logo-teaser { display: flex; justify-content: center; gap: 8px; margin: 18px 0 4px; }
.logo-teaser canvas { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--g-line); background: #ffffff; }
.logo-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.logo-legend .quiz-chip { font-size: 12px; font-weight: 500; }
.logo-legend .quiz-chip b { font-weight: 700; }

.quiz-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translate(-50%, 20px);
  opacity: 0;
  background: #0f172a;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  border-radius: 999px;
  padding: 10px 18px;
  transition: opacity .2s, transform .25s var(--g-ease);
  pointer-events: none;
}
.quiz-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.quiz-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 55; }

/* ─── Animations ──────────────────────────────────────────────── */

/* Le mouvement signale un changement d'état (réponse, révélation, score), rien d'autre :
   pas de boucle infinie, pas de dépassement (rebond) dans les courbes. */
@keyframes g-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes g-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes g-stamp { from { opacity: 0; transform: scale(1.35); } to { opacity: 1; transform: scale(1); } }
@keyframes g-win { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes g-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes g-bump { 0% { transform: scaleY(1); } 50% { transform: scaleY(1.6); } 100% { transform: scaleY(1); } }
@keyframes g-draw { to { stroke-dashoffset: 0; } }
@keyframes g-ring { from { transform: scale(1); opacity: .6; } to { transform: scale(2.2); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .quiz *, .quiz *::before, .quiz *::after, .game-card, .game-card * {
    animation: none !important;
    transition: none !important;
  }
  .quiz-badge svg { stroke-dashoffset: 0; }
  .quiz-badge::after { display: none; }
}

/* ─── Quiz : en-tête de page ──────────────────────────────────── */
/* Aligné sur la colonne du jeu (560 px), pas sur le container de 1280 px :
   sur desktop, un titre collé à gauche flottait loin de la carte. */

.quiz-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.quiz-head__main { min-width: 0; }
.quiz-edition {
  flex: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 84px;
  padding: 10px 12px 9px;
  border: 1px solid var(--g-line);
  border-radius: 14px;
  background: var(--g-card);
  box-shadow: var(--g-shadow);
  text-align: center;
}
.quiz-edition__label { font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--g-muted); }
.quiz-edition__num { margin-top: 4px; font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; color: var(--g-blue); font-variant-numeric: tabular-nums; }
.quiz-edition__date { font-size: 12px; font-weight: 600; color: var(--g-muted); white-space: nowrap; }

.quiz-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--g-line);
  font-size: 13px;
  color: var(--g-muted);
}
.quiz-meta i { color: var(--g-blue); margin-right: 6px; }
.quiz-sound {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--g-line);
  background: transparent;
  color: var(--g-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.quiz-sound[hidden] { display: none; }
.quiz-sound i { margin: 0; }
.quiz-sound:hover { color: var(--g-blue); border-color: var(--g-blue); }
.quiz-sound[aria-pressed="false"] i { color: var(--g-muted); }
.quiz-sound:focus-visible { outline: 3px solid var(--g-blue); outline-offset: 2px; }
