/* Kuizzy — styles partagés (principes Ank Design) */
:root {
  --spring: linear(0, 0.13 6%, 0.45 15%, 0.78 27%, 0.93 38%, 0.99 52%, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-instant: 100ms;
  --dur-fast: 200ms;
  --dur-base: 320ms;
  --dur-slow: 500ms;
  --dur-classement: 700ms;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;

  --shadow-1: 0 1px 2px rgb(0 0 0 / .06), 0 1px 1px rgb(0 0 0 / .04);
  --shadow-2: 0 4px 12px rgb(0 0 0 / .08), 0 1px 3px rgb(0 0 0 / .06);
  --shadow-3: 0 12px 32px rgb(0 0 0 / .12), 0 2px 6px rgb(0 0 0 / .06);

  --material-regular: rgb(255 255 255 / .72);
  --blur: saturate(180%) blur(20px);
  --radius: 12px;
  --radius-lg: 20px;
  --tap-min: 44px;

  /* Couleurs (clair) */
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #ececf1;
  --text: #121218;
  --text-2: #55556a;
  --border: rgb(0 0 0 / .10);
  --accent: #5b3df5;          /* 6.6:1 sur blanc */
  --accent-doux: #e9e4ff;
  --accent-texte: #ffffff;
  --or: #b86e00;              /* 2e accent : la tête du classement */
  --jaune-marque: #FFC83D;    /* jaune Kuizzy : logo et K */
  --encre-marque: #1B1440;
  --danger: #c4262e;
  --ok: #1d7a46;

  /* z-index : 0 contenu · 10 barre · 100 feuille · 1000 toast */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d12; --surface: #17171f; --surface-2: #22222d; --text: #f4f4f8; --text-2: #a9a9bc;
    --border: rgb(255 255 255 / .12); --accent: #9d8bff; --accent-doux: #2a2350; --accent-texte: #0d0d12;
    --or: #ffbe3d; --danger: #ff6b6b; --ok: #4fd18b; --material-regular: rgb(23 23 31 / .72);
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d12; --surface: #17171f; --surface-2: #22222d; --text: #f4f4f8; --text-2: #a9a9bc;
  --border: rgb(255 255 255 / .12); --accent: #9d8bff; --accent-doux: #2a2350; --accent-texte: #0d0d12;
  --or: #ffbe3d; --danger: #ff6b6b; --ok: #4fd18b; --material-regular: rgb(23 23 31 / .72);
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; --dur-classement: 0ms; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 2.125rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.0625rem; }
p { margin: 0; }
.discret { color: var(--text-2); font-size: .9375rem; }
.cache { display: none !important; }

/* ── Boutons ── */
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  min-height: var(--tap-min); padding: var(--space-2) var(--space-5); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  transition: transform var(--dur-instant) var(--ease-out), background-color var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
  text-decoration: none; -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-principal { background: var(--accent); color: var(--accent-texte); }
.btn-leger { background: transparent; color: var(--accent); padding-inline: var(--space-3); }
.btn-danger { background: transparent; color: var(--danger); }
.btn-plein { width: 100%; }
@media (hover: hover) {
  .btn:not([disabled]):hover { background: color-mix(in srgb, var(--surface-2) 80%, var(--text) 8%); }
  .btn-principal:not([disabled]):hover { background: color-mix(in srgb, var(--accent) 88%, var(--text) 12%); }
  .btn-leger:not([disabled]):hover, .btn-danger:not([disabled]):hover { background: var(--surface-2); }
}

/* ── Champs ── */
input, textarea, select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  min-height: var(--tap-min); padding: var(--space-2) var(--space-3); width: 100%;
}
textarea { resize: vertical; min-height: 120px; }
label { display: grid; gap: var(--space-1); font-size: .9375rem; font-weight: 600; }

.carte { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: var(--space-5); }

/* ── Classement temps réel (partagé écran + animateur) ── */
.classement { position: relative; --rang-h: 52px; list-style: none; margin: 0; padding: 0; }
.rang {
  position: absolute; left: 0; right: 0; top: 0; height: var(--rang-h);
  display: grid; grid-template-columns: 2.2em 1fr auto; align-items: center; gap: var(--space-3);
  transform: translateY(calc(var(--i) * var(--rang-h)));
  transition: transform var(--dur-classement) var(--spring), opacity var(--dur-base) var(--ease-out);
}
.rang.entre { opacity: 0; transform: translateY(calc(var(--i) * var(--rang-h) + 16px)); }
.rang.sort { opacity: 0; }
.rang-num {
  font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; color: var(--text-2);
  transition: color var(--dur-base);
}
.rang-corps { position: relative; min-width: 0; height: calc(var(--rang-h) - 12px); display: flex; align-items: center; }
.rang-barre {
  position: absolute; inset: 0; border-radius: 8px; background: var(--surface-2);
  transform-origin: left center; transform: scaleX(var(--p, 0));
  transition: transform var(--dur-classement) var(--spring), background-color var(--dur-base);
}
.rang.tete .rang-barre { background: var(--accent); }
.rang.tete .rang-num { color: var(--or); }
.rang-libelle {
  position: relative; padding-inline: var(--space-3); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color var(--dur-base);
}
.rang.tete .rang-libelle { color: var(--accent-texte); }
.rang-valeur { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 3.5em; text-align: right; line-height: 1.1; }
.rang-valeur small { display: block; font-weight: 400; color: var(--text-2); font-size: .7em; }
.rang-fleche {
  position: absolute; right: calc(100% + 2px); font-size: .7em; color: var(--ok); opacity: 0;
  transition: opacity var(--dur-base);
}
.rang.monte .rang-fleche { opacity: 1; }

/* ── Nuage de mots ── */
.nuage { position: relative; overflow: hidden; }
.mot {
  position: absolute; left: 0; top: 0; font-size: 100px; font-weight: 700; line-height: 1;
  white-space: nowrap; transform-origin: center; will-change: transform;
  transition: transform var(--dur-classement) var(--spring), opacity var(--dur-slow) var(--ease-out), color var(--dur-base);
  color: var(--text);
}
.mot.r0 { color: var(--accent); }
.mot.r1, .mot.r2 { color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.mot.petit { color: var(--text-2); }

/* ── Échelle ── */
.echelle { display: grid; grid-template-rows: auto 1fr auto; gap: var(--space-4); height: 100%; }
.echelle-moyenne { display: flex; align-items: baseline; gap: var(--space-3); }
.echelle-moyenne strong { font-size: 3.5em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.echelle-piste { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); margin-block: var(--space-2); }
.echelle-curseur {
  position: absolute; top: 50%; left: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  background: var(--accent); box-shadow: var(--shadow-2);
  transform: translateX(var(--x, 0px)); transition: transform var(--dur-classement) var(--spring);
}
.echelle-colonnes { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--space-2); align-items: end; min-height: 120px; }
.colonne { display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; gap: var(--space-1); }
.colonne-piste { position: relative; }
.colonne-barre {
  position: absolute; inset: 0; border-radius: 8px 8px 4px 4px; background: var(--surface-2);
  transform-origin: bottom; transform: scaleY(var(--p, 0));
  transition: transform var(--dur-classement) var(--spring), background-color var(--dur-base);
}
.colonne.tete .colonne-barre { background: var(--accent); }
.colonne-nombre { font-variant-numeric: tabular-nums; font-weight: 700; }
.colonne-note { font-weight: 700; color: var(--text-2); }
.echelle-bornes { display: flex; justify-content: space-between; color: var(--text-2); font-size: .8em; }

/* ── Réponses ouvertes ── */
.mur { display: flex; flex-wrap: wrap; gap: var(--space-3); align-content: flex-start; overflow: hidden; }
.bulle {
  background: var(--surface); border-radius: var(--radius); padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-1); max-width: 32ch; line-height: 1.35;
  transition: transform var(--dur-slow) var(--spring), opacity var(--dur-slow) var(--ease-out);
}
.bulle.entre { opacity: 0; transform: translateY(12px) scale(.96); }

.vide-resultats { display: grid; place-items: center; height: 100%; color: var(--text-2); text-align: center; gap: var(--space-2); }

/* ── Mise en page des résultats ── */
.res-nuage, .res-choix, .res-ouverte, .res-echelle { position: relative; height: 100%; min-height: 0; }
.res-nuage { display: grid; grid-template-columns: 1fr minmax(300px, 34%); gap: var(--space-6); }
.zone-nuage { height: 100%; min-height: 200px; }
.zone-rang { display: grid; gap: var(--space-3); align-content: start; min-width: 0; }
.zone-rang h3 { font-size: .8em; text-transform: uppercase; letter-spacing: .08em; }
.res-ouverte { display: grid; grid-template-columns: minmax(260px, 36%) 1fr; gap: var(--space-6); }
.res-attente { position: absolute; inset: 0; pointer-events: none; transition: opacity var(--dur-base); }
.compact .res-nuage, .compact .res-ouverte { grid-template-columns: 1fr; grid-template-rows: auto auto; }
.compact .zone-nuage { height: 220px; }
.compact .classement { --rang-h: 40px; font-size: .9375rem; }
.compact .res-echelle { min-height: 260px; }

/* ── Quiz ── */
.res-quiz { display: grid; grid-template-rows: auto 1fr; gap: var(--space-5); height: 100%; min-height: 0; }
.chrono { display: flex; align-items: center; gap: var(--space-4); }
.chrono-num { font-size: 2.5em; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 1.6em; color: var(--accent); line-height: 1; transition: color var(--dur-base); }
.chrono-piste { flex: 1; height: 14px; border-radius: 7px; background: var(--surface-2); overflow: hidden; }
.chrono-barre { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.chrono-info { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.quiz-corps { display: grid; gap: var(--space-6); align-content: start; min-height: 0; }
.phase-revele .quiz-corps { grid-template-columns: 1fr minmax(280px, 30%); }
.compact .phase-revele .quiz-corps { grid-template-columns: 1fr; }
.tuiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); align-content: start; }
.compact .tuiles { gap: var(--space-2); }
.tuile {
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-4);
  background: var(--surface); border-radius: var(--radius); padding: var(--space-4) var(--space-5); box-shadow: var(--shadow-1);
  font-weight: 600; font-size: 1.15em; transition: opacity var(--dur-slow) var(--ease-out);
}
.compact .tuile { padding: var(--space-3); font-size: 1em; gap: var(--space-3); }
.tuile > :not(.tuile-fond) { position: relative; }
.tuile-fond {
  position: absolute; inset: 0; background: var(--surface-2); transform-origin: left; transform: scaleX(var(--p, 0));
  transition: transform var(--dur-classement) var(--spring);
}
.tuile-lettre { width: 1.9em; height: 1.9em; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-weight: 800; }
.tuile-nombre { font-variant-numeric: tabular-nums; font-weight: 700; }
.phase-attente .tuile { opacity: .6; }
.phase-revele .tuile:not(.bonne) { opacity: .5; }
.tuile.bonne { box-shadow: 0 0 0 3px var(--ok), var(--shadow-2); }
.tuile.bonne .tuile-fond { background: color-mix(in srgb, var(--ok) 28%, var(--surface)); }
.tuile.bonne .tuile-lettre { background: var(--ok); color: var(--bg); }
.tuile.bonne .tuile-nombre::before { content: "✓ "; color: var(--ok); }
.res-podium { display: grid; gap: var(--space-3); align-content: start; max-width: 1100px; }
.res-podium h2 { font-size: 2em; }
.res-podium .classement { --rang-h: clamp(36px, 5vh, 72px); font-size: 1.15em; }
.compact .res-podium .classement { --rang-h: 40px; font-size: .9375rem; }

/* ── Quiz : décompte, temps écoulé, bonus, annonce ── */
.res-quiz { position: relative; }
.temps-ecoule {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}
/* Décompte : fond opaque, la question n'apparaît qu'au départ du chrono */
.decompte {
  position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: var(--space-3);
  background: var(--bg); pointer-events: none;
}
.decompte-num { font-size: 10em; font-weight: 800; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.decompte-sur { font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--text-2); }
.decompte-pret { font-size: 1.4em; font-weight: 700; }
.compact .decompte-num { font-size: 4em; }
.compact .decompte-pret { font-size: 1em; }
.zone-resultats.en-decompte > .media-cadre { display: none; }
.zone-resultats.en-decompte { grid-template-columns: minmax(0, 1fr); }
.temps-ecoule { font-size: 3em; font-weight: 800; color: var(--or); animation: apparition var(--dur-slow) var(--spring); }
.compact .temps-ecoule { font-size: 1.75em; }
.phase-termine .tuile { opacity: .45; }
.phase-pret .quiz-corps, .phase-pret .chrono { visibility: hidden; }
@keyframes apparition { from { opacity: 0; transform: scale(.85); } }
.badge-bonus { font-weight: 800; color: var(--bg); background: var(--or); padding: var(--space-1) var(--space-3); border-radius: 999px; white-space: nowrap; }
.annonce {
  height: 100%; min-height: 240px; display: grid; place-content: center; text-align: center; gap: var(--space-4);
  background: var(--accent); color: var(--accent-texte); border-radius: var(--radius-lg); padding: var(--space-6);
  animation: apparition var(--dur-slow) var(--spring);
}
.annonce-sur { font-weight: 700; text-transform: uppercase; letter-spacing: .12em; opacity: .8; }
.annonce-titre { font-size: clamp(2rem, 7vw, 6.5rem); line-height: 1.05; letter-spacing: -0.02em; }
.compact .annonce-titre { font-size: 2rem; }
.annonce-bonus { justify-self: center; font-size: 1.6em; font-weight: 800; background: var(--or); color: var(--bg); padding: var(--space-2) var(--space-5); border-radius: 999px; }
.annonce-sous { font-size: 1.3em; opacity: .9; }
@media (prefers-reduced-motion: reduce) { .annonce, .temps-ecoule { animation: none; } }

/* Barre de temps : clignotement des 5 dernières secondes */
.clignote { animation: clignote 500ms steps(2, jump-none) infinite; }
@keyframes clignote { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .clignote { animation: none; } }

/* ── Médias des questions ── */
.zone-resultats { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: var(--space-6); }
.zone-resultats > .res-cible { min-height: 0; min-width: 0; height: 100%; }
.media-cadre { display: none; position: relative; min-height: 0; min-width: 0; }
.avec-media { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); }
.avec-media > .media-cadre { display: grid; place-items: center; }
.compact.avec-media, .compact .avec-media { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; gap: var(--space-4); }
.compact .media-cadre { max-height: 220px; }
.media-image, .media-video { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-lg); background: #000; }
.compact .media-image, .compact .media-video { max-height: 220px; }
.media-audio {
  width: min(100%, 420px); aspect-ratio: 1; display: grid; place-content: center; justify-items: center; gap: var(--space-5);
  background: var(--accent-doux); border-radius: var(--radius-lg);
}
.media-audio.compact { aspect-ratio: auto; width: 100%; padding: var(--space-4); gap: var(--space-3); }
.media-audio audio:not([controls]) { display: none; }
.media-lecture {
  width: 96px; height: 96px; border: 0; border-radius: 50%; cursor: pointer; font-size: 2rem;
  background: var(--accent); color: var(--accent-texte); transition: transform var(--dur-instant) var(--ease-out);
}
.media-lecture:active { transform: scale(.94); }
.compact .media-lecture { width: 56px; height: 56px; font-size: 1.25rem; }
.media-ondes { display: flex; gap: 6px; align-items: center; height: 64px; }
.media-ondes span { width: 8px; height: 100%; border-radius: 4px; background: var(--accent); transform: scaleY(.2); transform-origin: center; }
.media-audio.joue .media-ondes span { animation: onde 900ms var(--ease-out) infinite alternate; }
.media-ondes span:nth-child(2n) { animation-delay: -300ms !important; }
.media-ondes span:nth-child(3n) { animation-delay: -600ms !important; }
@keyframes onde { from { transform: scaleY(.2); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .media-audio.joue .media-ondes span { animation: none; transform: scaleY(.7); } }
.media-youtube { position: relative; width: 100%; aspect-ratio: 16 / 9; cursor: pointer; }
.media-youtube .media-image, .media-youtube iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius-lg); object-fit: cover; }
.media-yt-lire {
  position: absolute; inset: 0; margin: auto; width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center;
  background: rgb(0 0 0 / .6); color: #fff; font-size: 2rem; pointer-events: none;
}
.media-son {
  position: absolute; left: 50%; bottom: var(--space-4); transform: translateX(-50%); z-index: 10;
  border: 0; border-radius: 999px; padding: var(--space-3) var(--space-5); min-height: var(--tap-min);
  background: var(--or); color: #111; font: inherit; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-3);
}
.media-indice { color: var(--text-2); font-weight: 600; }

/* ── Ordre, saisie, estimation ── */
.ordre { display: grid; gap: var(--space-3); align-content: start; }
.ordre-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.ordre-liste li { display: flex; align-items: center; gap: var(--space-3); background: var(--surface); border-radius: var(--radius); padding: var(--space-3) var(--space-4); font-weight: 600; box-shadow: var(--shadow-1); }
.ordre-liste.correct li { box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 60%, transparent); animation: apparition var(--dur-slow) var(--spring) backwards; }
.ordre-liste.correct li:nth-child(2) { animation-delay: 120ms; } .ordre-liste.correct li:nth-child(3) { animation-delay: 240ms; }
.ordre-liste.correct li:nth-child(4) { animation-delay: 360ms; } .ordre-liste.correct li:nth-child(5) { animation-delay: 480ms; }
.ordre-liste.correct li:nth-child(n+6) { animation-delay: 600ms; }
.ordre-num { min-width: 1.9em; height: 1.9em; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-weight: 800; flex-shrink: 0; }
.ordre-liste.correct .ordre-num { background: var(--ok); color: var(--bg); }
.consigne-grande { display: grid; justify-items: center; align-content: center; gap: var(--space-3); text-align: center; font-size: 2.2em; min-height: 40vh; }
.consigne-grande span { font-size: .55em; font-weight: 600; }
.consigne-grande .discret { font-size: .4em; font-weight: 400; }
.compact .consigne-grande { min-height: 0; font-size: 1.5em; }
.saisie-revele { display: grid; gap: var(--space-5); align-content: start; }
.saisie-bonne { display: grid; gap: var(--space-1); }
.saisie-bonne strong { font-size: 2.4em; line-height: 1.1; color: var(--ok); }
.estim { display: grid; gap: var(--space-3); align-content: start; }
.estim-valeur { display: grid; }
.estim-valeur strong { font-size: 2.6em; line-height: 1.1; color: var(--ok); font-variant-numeric: tabular-nums; }
.estim-graphe { position: relative; height: 140px; }
.compact .estim-graphe { height: 80px; }
.estim-barres { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; height: 100%; align-items: end; }
.estim-barres span { height: 100%; border-radius: 6px 6px 2px 2px; background: var(--surface-2); transform-origin: bottom; transform: scaleY(max(var(--p, 0), .02)); transition: transform var(--dur-classement) var(--spring); }
.estim-barres span.cible { background: color-mix(in srgb, var(--ok) 55%, var(--surface-2)); }
.estim-repere { position: absolute; top: -8px; bottom: -8px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--ok); transition: left var(--dur-classement) var(--spring); }
.estim-bornes { display: flex; justify-content: space-between; color: var(--text-2); font-variant-numeric: tabular-nums; }
.estim-proches { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.estim-proches li { display: grid; grid-template-columns: auto 1fr auto auto; gap: var(--space-3); align-items: center; }

/* ── Questions du public ── */
.res-qr { position: relative; display: grid; gap: var(--space-4); align-content: start; height: 100%; }
.qr-consigne { color: var(--text-2); }
.qr-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); max-width: 1100px; }
.qr-carte { display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); align-items: center; background: var(--surface); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); box-shadow: var(--shadow-1); }
.qr-carte.tete { box-shadow: 0 0 0 2px var(--accent), var(--shadow-2); }
.qr-carte.repondue { opacity: .5; }
.qr-carte.repondue .qr-texte::before { content: "✓ Répondue · "; color: var(--ok); font-weight: 700; }
.qr-votes { display: grid; justify-items: center; min-width: 3.2em; color: var(--accent); }
.qr-votes b { font-size: 1.6em; line-height: 1; font-variant-numeric: tabular-nums; }
.qr-votes small { font-size: .7em; color: var(--text-2); }
.qr-texte { font-size: 1.15em; font-weight: 600; line-height: 1.35; }
.compact .qr-carte { padding: var(--space-3); gap: var(--space-3); }
.compact .qr-texte { font-size: 1em; }
.rang[data-etat="juste"] .rang-barre { background: color-mix(in srgb, var(--ok) 45%, var(--surface-2)); }
.rang[data-etat="faux"] .rang-barre { background: color-mix(in srgb, var(--danger) 30%, var(--surface-2)); }

/* ── Marque : K dans un carré jaune ── */
.nom-marque { display: inline-flex; align-items: center; gap: 1px; }
.k-marque {
  display: inline-grid; place-items: center; width: 1.2em; height: 1.2em; margin-right: 1px;
  background: var(--jaune-marque); color: var(--encre-marque); border-radius: 5px; line-height: 1;
}

/* ── Classement : équipes, podium final, confettis, réactions ── */
.res-podium.avec-equipes { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); column-gap: var(--space-7); max-width: none; }
.res-podium.avec-equipes > h2, .res-podium.avec-equipes > .podium-info, .res-podium.avec-equipes > .podium-vide { grid-column: 1 / -1; }
.colonne-equipes, .colonne-joueurs { display: grid; gap: var(--space-2); align-content: start; min-width: 0; }
.compact .res-podium.avec-equipes { grid-template-columns: 1fr; }
.podium-final { position: relative; height: 100%; display: grid; grid-template-rows: auto 1fr auto auto; gap: var(--space-4); text-align: center; overflow: hidden; }
.podium-final h2 { font-size: 2em; }
.marches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: var(--space-4); max-width: 1000px; width: 100%; margin: 0 auto; min-height: 0; height: 100%; }
.marche { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: var(--space-2); min-height: 0; animation: monter-marche 700ms var(--spring) backwards; }
.marche-nom { font-size: 1.5em; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marche-points { color: var(--text-2); font-variant-numeric: tabular-nums; }
.marche-bloc { flex-shrink: 1; min-height: 40px; width: 100%; display: grid; place-items: start center; padding-top: var(--space-3); border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--surface-2); font-size: 2.6em; font-weight: 800; }
.place-1 .marche-bloc { height: 62%; background: var(--jaune-marque); color: var(--encre-marque); }
.place-2 .marche-bloc { height: 44%; background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.place-3 .marche-bloc { height: 28%; background: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); }
.place-1 .marche-nom { font-size: 2em; }
.place-3 { animation-delay: 300ms; } .place-2 { animation-delay: 1300ms; } .place-1 { animation-delay: 2400ms; }
@keyframes monter-marche { from { opacity: 0; transform: translateY(40px); } }
.podium-suite { max-width: 800px; width: 100%; margin: 0 auto; text-align: left; animation: apparition var(--dur-slow) var(--ease-out) 3.2s backwards; }
.confettis { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 20; }
@media (prefers-reduced-motion: reduce) { .marche, .equipe-gagnante, .podium-suite { animation: none; } }
.reactions { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 900; }
.reaction { position: absolute; bottom: 2vh; line-height: 1; will-change: transform, opacity; }

/* ── Lecture : la question seule, puis la question monte et les choix arrivent en dessous ── */
.phase-lecture .chrono { visibility: hidden; }
.lecture {
  display: grid; align-content: center; justify-items: center; gap: var(--space-5); text-align: center;
  min-height: 52vh; animation: apparition var(--dur-slow) var(--spring);
}
.lecture-texte { font-size: clamp(1.8rem, 3.8vw, 4rem); font-weight: 800; line-height: 1.15; max-width: 26ch; letter-spacing: -0.01em; }
.lecture-piste { width: min(480px, 70%); height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.lecture-barre { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.compact .lecture { min-height: 0; padding-block: var(--space-4); }
.compact .lecture-texte { font-size: 1.25rem; }
/* Les choix : un peu plus bas que la question, et ils arrivent du bas */
.phase-chrono .quiz-corps { margin-top: var(--space-7); }
.compact .phase-chrono .quiz-corps { margin-top: var(--space-4); }
.phase-chrono .tuile, .phase-chrono .ordre-liste li, .phase-chrono .consigne-grande { animation: monter-choix 520ms var(--spring) backwards; }
.phase-chrono .tuile:nth-child(2), .phase-chrono .ordre-liste li:nth-child(2) { animation-delay: 70ms; }
.phase-chrono .tuile:nth-child(3), .phase-chrono .ordre-liste li:nth-child(3) { animation-delay: 140ms; }
.phase-chrono .tuile:nth-child(n+4), .phase-chrono .ordre-liste li:nth-child(n+4) { animation-delay: 210ms; }
@keyframes monter-choix { from { opacity: 0; transform: translateY(28px); } }
@media (prefers-reduced-motion: reduce) { .lecture, .phase-chrono .tuile, .phase-chrono .ordre-liste li, .phase-chrono .consigne-grande { animation: none; } }

/* ── Icônes au trait (remplacent les emojis) ── */
.icone-svg { vertical-align: -0.15em; flex-shrink: 0; }
.icone-svg.plein path { fill: currentColor; }
.coche .icone-svg { width: 2.1rem; height: 2.1rem; stroke-width: 2.4; }
.media-lecture .icone-svg { width: 2.2rem; height: 2.2rem; }
.media-yt-lire .icone-svg { width: 2rem; height: 2rem; }
.consigne-grande .icone-svg { color: var(--accent); }
.modele-emoji { color: var(--accent); line-height: 1; }
.reaction { filter: drop-shadow(0 2px 6px rgb(0 0 0 / .35)); }
.reaction .icone-svg { width: 1em; height: 1em; stroke-width: 2.2; }
.reaction .icone-svg path { fill: color-mix(in srgb, currentColor 35%, transparent); }

/* ── Équipe gagnante : nom + membres ── */
.equipe-gagnante { display: grid; gap: var(--space-3); justify-items: center; animation: apparition var(--dur-slow) var(--spring) 3s backwards; }
.eg-titre { font-size: 1.35em; }
.eg-titre .icone-svg { color: var(--jaune-marque); }
.eg-membres { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); max-width: 1100px; }
.eg-membres li {
  display: inline-flex; align-items: baseline; gap: var(--space-2); padding: var(--space-2) var(--space-4); border-radius: 999px; font-size: 1.2em;
  background: var(--jaune-marque); color: var(--encre-marque); font-weight: 700;
  animation: apparition 500ms var(--spring) backwards; animation-delay: calc(3.2s + var(--d) * 90ms);
}
.eg-membres li small { font-weight: 600; opacity: .75; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .eg-membres li { animation: none; } }
