/* ════════════════════════════════════════════════════════════════════════
   Quizine · thème « Soirée jeux, version nuit » (design/pistes/soiree-jeux-nuit)
   Une table de jeux à minuit : tapis d'ardoise, craie, jetons et dés ivoire,
   UNE couleur (rose pétard) + des neutres. Tout est préfixé par html[data-theme="nuit"].
   1. Polices · 2. Pont de variables (les noms de style.css prennent les valeurs de nuit)
   3. Socle · 4. Composants partagés · 5+. écrans (accueil, question, attente, correction, TV…)
   ════════════════════════════════════════════════════════════════════════ */

@font-face { font-family: "Bagel"; src: url("polices/bagelfatone.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Rubik"; src: url("polices/rubik.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Libron"; src: url("polices/Libron-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Libron"; src: url("polices/Libron-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Libron"; src: url("polices/Libron-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Craie"; src: url("polices/caveat.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

/* ── 2. Variables ───────────────────────────────────────────────────────── */
html[data-theme="nuit"] {
  color-scheme: dark;
  /* jetons de nuit (propres au thème) */
  --encre: #0E0C14; --tapis: #17141F; --feutrine: #211D2C; --feutrine-2: #2E2940; --filet: #4A4460;
  --craie: #F4EFE6; --craie-2: #BDB6CB; --craie-3: #A39CB3; --ivoire-ombre: #CFC8D6;
  --rose: #FF4F9A; --rose-vif: #FF7AB2; --rose-fonce: #C2246A; --rose-voile: rgba(255, 79, 154, .14); --sur-rose: #17141F;
  --holo: linear-gradient(115deg, #ff9ecb 0%, #ffe39e 18%, #9effd8 34%, #9ec9ff 50%, #d79eff 66%, #ff9ecb 82%, #ffe39e 100%);
  --f-titre: "Bagel", "Rubik", system-ui, sans-serif;
  --f-texte: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-lecture: "Libron", Georgia, "Times New Roman", serif;
  --f-craie: "Craie", "Comic Sans MS", cursive;
  --cerne: 3px solid var(--encre);
  --relief: 0 6px 0 var(--encre);
  --lueur-rose: 0 0 0 3px var(--tapis), 0 0 0 6px var(--rose), 0 0 28px 4px rgba(255, 79, 154, .45);
  --rebond: cubic-bezier(.34, 1.56, .64, 1);
  --amorti: cubic-bezier(.22, 1, .36, 1);

  /* pont : les noms du thème riso (style.css) reçoivent les valeurs de nuit */
  --papier: var(--tapis);
  --papier-haut: var(--feutrine);
  --papier-kraft: var(--feutrine-2);
  --papier-ombre: var(--encre);
  --encre-1: var(--rose); --encre-1-dense: var(--rose);
  --encre-1-tr75: var(--rose-vif); --encre-1-tr55: #C25A8A; --encre-1-tr35: #6B3A57; --encre-1-tr15: #3A1F33;
  --encre-2: var(--craie-2); --encre-2-dense: var(--craie-3);
  --encre-2-tr75: #8F88A3; --encre-2-tr55: #6F6885; --encre-2-tr35: var(--filet); --encre-2-tr15: var(--feutrine-2);
  --encre-3: var(--craie); --encre-3-dense: var(--craie);
  --encre-3-tr75: #D9D3E0; --encre-3-tr55: #A39CB3; --encre-3-tr35: #4A4460; --encre-3-tr15: #3A3450;
  --surimp-prune: var(--feutrine-2); --surimp-petrole: var(--feutrine-2); --surimp-olive: var(--feutrine-2);
  --surimp-noir: var(--encre); --surimp-nuit: var(--encre);
  --noir-encre: var(--encre);
  --gris-plomb: var(--craie-2);
  --texte: var(--craie);
  --texte-faible: var(--craie-2);
  --texte-inverse: var(--sur-rose);
  --ft-affiche: var(--f-titre);
  --ft-texte: var(--f-texte);
  --ft-presse: var(--f-texte);
  --chasse-affiche: .005em;
  --chasse-presse: .04em;
  --r-coupe: 16px;
  --coupe-coin: 0px;
  --trait-fin: 2px; --trait: 3px; --trait-gras: 5px;
  --ombre-carte: 0 6px 0 var(--encre);
  --ombre-feuille: 0 8px 0 var(--encre);
  --ombre-encre: 0 6px 0 var(--encre);
  --grain-force: .9;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --cat-geographie: var(--rose); --cat-sciences: var(--rose); --cat-societe: var(--rose); --cat-technologie: var(--rose);
  --cat-histoire: var(--rose); --cat-cinema: var(--rose); --cat-television: var(--rose); --cat-musique: var(--rose);
  --cat-sport: var(--rose); --cat-nature: var(--rose); --cat-gastronomie: var(--rose); --cat-litterature: var(--rose);
  --cat-arts: var(--rose); --cat-religions: var(--rose);
  --niv-1: var(--rose); --niv-2: var(--rose); --niv-3: var(--rose); --niv-4: var(--rose); --niv-5: var(--rose);
  --choix-a: var(--craie); --choix-b: var(--craie); --choix-c: var(--craie); --choix-d: var(--craie);
}

/* ── 3. Socle : le tapis ────────────────────────────────────────────────── */
html[data-theme="nuit"] body {
  background:
    radial-gradient(60% 40% at 18% 12%, rgba(244, 239, 230, .045), transparent 70%),
    radial-gradient(50% 35% at 85% 70%, rgba(244, 239, 230, .035), transparent 70%),
    radial-gradient(120% 80% at 50% 0%, #1d1928 0%, var(--tapis) 55%, #110f17 100%);
  background-attachment: fixed;
  color: var(--craie);
  font-family: var(--f-texte);
  -webkit-font-smoothing: antialiased;
}
html[data-theme="nuit"] body::after { mix-blend-mode: normal; background-size: 220px 220px; opacity: 1; }
html[data-theme="nuit"] :focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; }
html[data-theme="nuit"] a { color: var(--rose-vif); }

/* plus de découpes au massicot : des objets ronds cernés d'encre */
html[data-theme="nuit"] :where(.choix-tuile, .bouton-choix, .ctv-tuile)::before { display: none; }
html[data-theme="nuit"] :where(.choix-tuile, .bouton-choix, .ctv-tuile).c2 { border-radius: var(--r-coupe); }
html[data-theme="nuit"] :where(.choix-tuile, .bouton-choix).c3 { padding-left: 12px; }

/* ── 4. Typographie : Bagel pour les titres (une seule graisse : jamais de faux gras), Rubik partout ── */
html[data-theme="nuit"] * { font-synthesis: none; }
html[data-theme="nuit"] :is(.titre-app, .btn, .cm-hero-titre, .cm-h2, .solo-bilan-titre, .cm-tabs button, .attente-ligne, .etiquette, .badge, h1, h2) { text-transform: none; letter-spacing: .005em; }
html[data-theme="nuit"] :is(.titre-app, .btn, .cm-hero-titre, .solo-bilan-titre, .code-salle, .chrono, .mini-chrono, .compteur b, .cm-score b, .cm-medaille-rang, .att-code) { font-family: var(--f-titre); font-weight: 400; }
html[data-theme="nuit"] .titre-app { color: var(--craie); -webkit-text-stroke: 0; text-shadow: 0 5px 0 var(--encre); letter-spacing: .01em; }
html[data-theme="nuit"] .titre-app span { color: var(--rose); }
html[data-theme="nuit"] :is(.explication, .anecdote, .solo-expl, .solo-anecdote, .cm-anecdote, .cm-expl, .anecdote-hote) { font-family: var(--f-lecture); }
html[data-theme="nuit"] .etiquette { font-family: var(--f-texte); font-weight: 700; letter-spacing: .06em; color: var(--craie-2); }

/* ── 5. Objets « jouet » : cernés d'encre, tranche qui s'écrase sous le doigt ── */
html[data-theme="nuit"] .carte {
  background: var(--feutrine); border: var(--cerne); border-radius: 24px;
  box-shadow: 0 8px 0 var(--encre), 0 18px 30px -16px rgba(0, 0, 0, .7);
}
html[data-theme="nuit"] .btn {
  border: var(--cerne); border-radius: 999px; background: var(--feutrine-2); color: var(--craie);
  box-shadow: var(--relief); font-size: 1.12rem; letter-spacing: .01em;
  transition: transform 140ms var(--amorti), box-shadow 140ms, background 200ms;
}
html[data-theme="nuit"] .btn:hover:not(:disabled) { background: #3a3450; }
html[data-theme="nuit"] .btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--encre); }
html[data-theme="nuit"] .btn-principal { background: var(--rose); color: var(--sur-rose); }
html[data-theme="nuit"] .btn-principal:hover:not(:disabled) { background: var(--rose-vif); }
html[data-theme="nuit"] .btn:disabled { background: var(--feutrine); color: var(--craie-3); border-color: var(--encre); box-shadow: 0 3px 0 var(--encre); }
html[data-theme="nuit"] .btn-gros { font-size: 1.4rem; }
html[data-theme="nuit"] :is(input[type="text"], input[type="number"], input:not([type]), select, textarea) {
  background: #100E16; color: var(--craie); border: 3px solid var(--filet); border-radius: 16px;
}
html[data-theme="nuit"] :is(input, select, textarea):focus { border-color: var(--rose); outline: none; box-shadow: 0 0 0 4px var(--rose-voile); }
html[data-theme="nuit"] ::placeholder { color: var(--craie-3); }
html[data-theme="nuit"] .erreur { color: var(--rose-vif); }
html[data-theme="nuit"] .avertissement { background: var(--feutrine-2); color: var(--craie); border: 2px solid var(--rose); border-radius: 16px; }

/* ── 6. Étiquettes de question : puce catégorie (picto craie) + puce niveau (dé) ── */
html[data-theme="nuit"] .badges-q { gap: 8px; }
html[data-theme="nuit"] .badges-q .puce {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 3px 13px 3px 4px; border-radius: 999px;
  background: var(--feutrine); border: 2px solid var(--filet); box-shadow: none; transform: none;
  font: 650 .92rem/1.1 var(--f-texte); letter-spacing: 0; text-transform: none; color: var(--craie);
}
html[data-theme="nuit"] .badges-q .badge-cat .picto { width: 28px; height: 28px; margin: 0; padding: 4px; color: var(--encre); background: var(--craie); border: 2px solid var(--encre); border-radius: 50%; }
html[data-theme="nuit"] .badges-q .badge-niv { padding-left: 4px; }
html[data-theme="nuit"] .badges-q .de { flex: none; }
html[data-theme="nuit"] .badges-q.grand .puce { font-size: 1.3rem; min-height: 48px; padding-right: 18px; }
html[data-theme="nuit"] .badges-q.grand .badge-cat .picto { width: 40px; height: 40px; }
html[data-theme="nuit"] .badges-q.grand .de { width: 36px; height: 36px; }

/* ── 7. Les quatre réponses : jetons de réponse (forme + lettre + motif) en rangées ── */
html[data-theme="nuit"] .forme { --t: 44px; width: var(--t); height: var(--t); font-size: 1rem; color: var(--craie); flex: none; }
html[data-theme="nuit"] .forme svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: currentColor; }
html[data-theme="nuit"] .forme b { position: relative; font: 400 calc(var(--t) * .46)/1 var(--f-titre); color: var(--encre); }
html[data-theme="nuit"] .forme.f0 b { top: calc(var(--t) * .12); }
html[data-theme="nuit"] .boutons { grid-template-columns: 1fr; gap: 12px; min-height: 0; align-content: start; }
html[data-theme="nuit"] .bouton-choix {
  flex-direction: row; justify-content: flex-start; text-align: left; gap: 14px; min-height: 66px; padding: 14px 72px 10px 12px;
  border: var(--cerne); border-radius: 20px; background-color: var(--feutrine); color: var(--craie);
  box-shadow: var(--relief); font: 650 1.1rem/1.2 var(--f-texte);
  transition: transform 140ms var(--amorti), box-shadow 140ms, background-color 300ms;
}
html[data-theme="nuit"] .bouton-choix .forme { --t: 44px; width: var(--t); height: var(--t); font-size: 1rem; }
html[data-theme="nuit"] .bouton-choix > span:not(.forme):not(.rep-n) { flex: 1; min-width: 0; position: relative; z-index: 1; }
/* motif propre à chaque réponse : 3ᵉ indice après la forme et la lettre */
html[data-theme="nuit"] :is(.bouton-choix, .choix-tuile)::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 38%; pointer-events: none; z-index: 0;
  -webkit-mask: linear-gradient(90deg, transparent, #000 70%); mask: linear-gradient(90deg, transparent, #000 70%); }
html[data-theme="nuit"] :is(.bouton-choix, .choix-tuile).c0::after { background: repeating-linear-gradient(-45deg, rgba(244, 239, 230, .08) 0 3px, transparent 3px 11px); }
html[data-theme="nuit"] :is(.bouton-choix, .choix-tuile).c1::after { background: radial-gradient(rgba(244, 239, 230, .13) 1.6px, transparent 2px) 0 0 / 11px 11px; }
html[data-theme="nuit"] :is(.bouton-choix, .choix-tuile).c2::after { background: repeating-linear-gradient(0deg, rgba(244, 239, 230, .08) 0 3px, transparent 3px 10px); }
html[data-theme="nuit"] :is(.bouton-choix, .choix-tuile).c3::after { background: linear-gradient(rgba(244, 239, 230, .08) 2px, transparent 2px) 0 0 / 12px 12px, linear-gradient(90deg, rgba(244, 239, 230, .08) 2px, transparent 2px) 0 0 / 12px 12px; }
html[data-theme="nuit"] .bouton-choix:hover:not(:disabled) { background-color: var(--feutrine-2); }
html[data-theme="nuit"] .bouton-choix:not(:disabled):active { transform: translateY(5px); box-shadow: 0 1px 0 var(--encre); }
html[data-theme="nuit"] .bouton-choix:disabled { opacity: .62; }
/* ta mise : lueur rose, jeton qui tombe sur la forme */
html[data-theme="nuit"] .bouton-choix.retenu, html[data-theme="nuit"] .bouton-choix.retenu:disabled {
  opacity: 1; outline: 0; background-color: #3A1F33; box-shadow: var(--lueur-rose), var(--relief);
}
html[data-theme="nuit"] .bouton-choix.retenu .forme { color: var(--rose); animation: qn-poser .55s var(--rebond) both; }
html[data-theme="nuit"] .bouton-choix.retenu::after {
  content: "Ta mise"; width: auto; inset: -2px auto auto 66px; -webkit-mask: none; mask: none; z-index: 2;
  background: var(--rose); color: var(--sur-rose); border: 2px solid var(--encre); border-radius: 0 0 10px 10px;
  font: 700 .66rem/1 var(--f-texte); letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px 4px;
}
html[data-theme="nuit"] .en-attente .bouton-choix:disabled { opacity: .85; }
@keyframes qn-poser { 0% { transform: translateY(-60%) rotate(-12deg) scale(1.15); } 60% { transform: translateY(4%) rotate(3deg); } 100% { transform: none; } }

/* ── 8. Répartition en direct : une pile de jetons et un compteur sur chaque réponse ── */
html[data-theme="nuit"] .bouton-choix > .rep-n {
  position: absolute; top: 50%; right: 14px; left: auto; transform: translateY(-50%); z-index: 2;
  display: inline-flex; align-items: center; gap: 5px; padding: 0; background: none; border: 0;
  font: 400 1.5rem/1 var(--f-titre); color: var(--craie);
}
html[data-theme="nuit"] .bouton-choix.c1 > .rep-n { left: auto; right: 14px; }
html[data-theme="nuit"] .bouton-choix > .rep-n .picto { display: none; }
html[data-theme="nuit"] .bouton-choix > .rep-n::before {     /* la pile : un jeton par tranche, dessinée en dégradés */
  content: ""; width: 26px; height: calc(6px + var(--pile, 0) * 5px); max-height: 46px; border-radius: 6px;
  background: repeating-linear-gradient(180deg, var(--craie) 0 3px, var(--rose) 3px 5px); border: 2px solid var(--encre);
}
html[data-theme="nuit"] .bouton-choix > .rep-n.zero::before { background: none; border-style: dashed; border-color: var(--filet); height: 8px; }
html[data-theme="nuit"] .bouton-choix > .rep-n.zero { visibility: hidden; }        /* personne : on n'affiche rien */
/* (pas de changement de rembourrage à la réponse : la place du compteur et de « Ta mise » est réservée dès l'affichage) */
html[data-theme="nuit"] .bouton-choix > .rep-jauge { height: 6px; background: var(--rose); opacity: .9; }
html[data-theme="nuit"] .bouton-choix.retenu > .rep-n { color: var(--rose-vif); }

/* ── 9. Ligne d'attente et narrateur ── */
html[data-theme="nuit"] .attente-ligne { background: var(--feutrine); border: 2px solid var(--filet); border-radius: 18px; box-shadow: none; color: var(--craie-2); }
html[data-theme="nuit"] .attente-ligne b { color: var(--rose-vif); }
/* le narrateur est un « toast » posé en bas de l'écran : il ne pousse jamais les réponses */
/* le narrateur parle dans le flux de la page (sous les réponses, sous le logo…) : il ne masque jamais rien ;
   seuls la TV et le bilan « Wrapped » le posent par-dessus, dans un coin prévu pour lui */
html[data-theme="nuit"] .narrateur-zone, html[data-theme="nuit"] .narrateur-zone[hidden] { margin: 4px 0 6px; height: 96px; display: flex !important; align-items: flex-end; }
html[data-theme="nuit"] .narrateur-zone[hidden] > * { visibility: hidden; }     /* place réservée dès le premier affichage */
html[data-theme="nuit"] .narrateur-zone > .narrateur { flex: 1; }
html[data-theme="nuit"] .narrateur-bulle { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
html[data-theme="nuit"] .narrateur-zone.vide > * { visibility: hidden; }
html[data-theme="nuit"] .wr-narrateur.narrateur-zone { position: absolute; left: 12px; right: 12px; bottom: 16px; max-width: 460px; margin: 0 auto; pointer-events: none; }
html[data-theme="nuit"] .narrateur { display: flex; align-items: flex-end; gap: 6px; }
html[data-theme="nuit"] .narrateur-droite { justify-content: flex-end; }
html[data-theme="nuit"] .narrateur-perso { flex: none; line-height: 0; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .45)); }
html[data-theme="nuit"] .narrateur-bulle {
  position: relative; margin: 0 0 14px; background: var(--craie); color: var(--encre); border: var(--cerne); border-radius: 22px 22px 22px 6px;
  padding: 7px 13px 8px; font: 700 1.18rem/1.08 var(--f-craie); box-shadow: 0 5px 0 var(--encre); max-width: 100%;
}
html[data-theme="nuit"] .narrateur-gauche .narrateur-bulle::before { content: ""; position: absolute; left: -15px; bottom: 9px; width: 18px; height: 16px; background: var(--craie);
  border: solid var(--encre); border-width: 0 0 3px 3px; transform: skewY(-28deg); border-radius: 0 0 0 4px; }
html[data-theme="nuit"] .narrateur-droite .narrateur-bulle { border-radius: 22px 22px 6px 22px; }
html[data-theme="nuit"] .narrateur-droite .narrateur-bulle::before { content: ""; position: absolute; right: -15px; bottom: 9px; width: 18px; height: 16px; background: var(--craie);
  border: solid var(--encre); border-width: 0 3px 3px 0; transform: skewY(28deg); }
html[data-theme="nuit"] .narrateur-entre .narrateur-bulle { animation: qn-bulle .45s var(--rebond) both; }
html[data-theme="nuit"] .narrateur-entre .narrateur-perso { animation: qn-sautille .6s var(--rebond) both; }
@keyframes qn-bulle { from { transform: scale(.6) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes qn-sautille { 0% { transform: translateY(14px) rotate(-6deg); } 60% { transform: translateY(-6px) rotate(3deg); } 100% { transform: none; } }
html[data-theme="nuit"] .dede .pied-tape { animation: qn-tape .45s ease-in-out infinite; transform-origin: 100px 213px; }
html[data-theme="nuit"] .dede .tic-tac { animation: qn-boing .9s var(--rebond) infinite alternate; transform-origin: 164px 46px; }
@keyframes qn-tape { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px) rotate(-8deg); } }
@keyframes qn-boing { 0% { transform: scale(.4); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
/* le thème « nuit » remplace les lignes de voix au micro par Dédé */
html[data-theme="nuit"] .narrateur-actif .voix-intro, html[data-theme="nuit"] .narrateur-actif .voix-ligne { display: none; }

/* ── 10. Chronos ── */
html[data-theme="nuit"] :is(.mini-chrono, .chrono) { background: var(--feutrine); color: var(--craie); border: var(--cerne); border-radius: 999px; box-shadow: var(--relief); }

@media (prefers-reduced-motion: reduce) {
  html[data-theme="nuit"] *, html[data-theme="nuit"] *::before, html[data-theme="nuit"] *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ── 11. Mise en page téléphone : réponses en haut, ligne d'état juste dessous, place pour le narrateur en bas ── */
html[data-theme="nuit"] #j-choix, html[data-theme="nuit"] #s-choix { flex: 0 0 auto !important; }
html[data-theme="nuit"] .mobile { padding-bottom: 24px; }
html[data-theme="nuit"] .entete-joueur { gap: 10px; }
html[data-theme="nuit"] .entete-joueur #j-num { flex: 1; }
html[data-theme="nuit"] .btn-son { width: 44px; height: 44px; border: var(--cerne); background: var(--feutrine-2); color: var(--craie); box-shadow: 0 4px 0 var(--encre); }
html[data-theme="nuit"] .btn-son.on { background: var(--rose); color: var(--sur-rose); }
html[data-theme="nuit"] :is(.question-mini, .question-texte, .solo-carte-q) { background: var(--feutrine); border: var(--cerne); border-radius: 22px; box-shadow: 0 8px 0 var(--encre); color: var(--craie); }
html[data-theme="nuit"] .solo-carte-q { border-top: var(--cerne); }

/* ── 12. Accueil ── */
html[data-theme="nuit"] .accueil-haut { padding: 6px 0 4px; }
html[data-theme="nuit"] .accueil-haut .titre-app { margin: 0; line-height: 0; width: min(240px, 62vw); aspect-ratio: 400 / 168; display: grid; place-items: center; font-size: 0; }
html[data-theme="nuit"] .accueil-haut .titre-app .logo { width: min(240px, 62vw); height: auto; }
html[data-theme="nuit"] .echauffement { border-color: var(--encre); background: var(--feutrine); position: relative; }
html[data-theme="nuit"] .echauffement::before { content: ""; position: absolute; inset: 7px; border: 2px dashed rgba(244, 239, 230, .14); border-radius: 18px; pointer-events: none; }
html[data-theme="nuit"] .ech-etiquette { font: 400 1.05rem/1 var(--f-titre); letter-spacing: .01em; text-transform: none; color: var(--sur-rose);
  background: var(--rose); border: 2.5px solid var(--encre); border-radius: 10px; padding: 5px 11px 4px; transform: rotate(-3deg); display: inline-block; box-shadow: 0 3px 0 var(--encre); }
html[data-theme="nuit"] .ech-hint { font: 700 1.2rem/1 var(--f-craie); color: var(--craie-2); font-style: normal; }
html[data-theme="nuit"] .ech-texte { font: 700 1.28rem/1.25 var(--f-texte); text-align: left; }
html[data-theme="nuit"] .ech-choix { grid-template-columns: 1fr 1fr !important; gap: 10px; }
html[data-theme="nuit"] .ech-choix .bouton-choix { min-height: 72px; font-size: 1rem; padding: 8px 30px 8px 10px; gap: 10px; }
html[data-theme="nuit"] .ech-choix .bouton-choix .forme { --t: 34px; }
html[data-theme="nuit"] .bouton-choix.bon, html[data-theme="nuit"] .bouton-choix.bon:disabled { opacity: 1; outline: 0; transform: none; background-color: var(--craie); color: var(--encre); box-shadow: 0 0 0 4px var(--rose), var(--relief); }
html[data-theme="nuit"] .bouton-choix.bon::after { content: "✓"; width: auto; inset: auto 12px auto auto; top: 50%; transform: translateY(-50%); -webkit-mask: none; mask: none;
  background: none; font: 400 1.6rem/1 var(--f-titre); color: var(--rose-fonce); }
html[data-theme="nuit"] .bouton-choix.choisi:not(.bon) { outline: 0; text-decoration: line-through; text-decoration-thickness: 2px; }
html[data-theme="nuit"] .bouton-choix.choisi:not(.bon)::after { content: "✗"; width: auto; inset: auto 12px auto auto; top: 50%; transform: translateY(-50%); -webkit-mask: none; mask: none; background: none; font: 400 1.4rem/1 var(--f-titre); color: var(--craie-2); }
html[data-theme="nuit"] .bouton-choix.ecarte { opacity: .45; }
html[data-theme="nuit"] .ech-verdict > b { font: 400 1.4rem/1.1 var(--f-titre); }
html[data-theme="nuit"] .ech-verdict.ok > b { color: var(--rose); } html[data-theme="nuit"] .ech-verdict.ko > b { color: var(--craie); }
html[data-theme="nuit"] .ech-verdict span { color: var(--craie-2); }
html[data-theme="nuit"] .ech-anecdote { height: calc(3 * 1.45em + 20px); min-height: 0; line-height: 1.45; box-sizing: border-box; font-family: var(--f-lecture); color: var(--craie); background: #100E16; border-radius: 14px; padding: 10px 12px; border-left: 4px solid var(--rose); }
html[data-theme="nuit"] .ech-anecdote b { font-family: var(--f-texte); color: var(--rose-vif); }
html[data-theme="nuit"] .choix-theme button { background: var(--feutrine); border: 2px solid var(--filet); color: var(--craie); }
html[data-theme="nuit"] .choix-theme button.actif { background: var(--rose); color: var(--sur-rose); border-color: var(--encre); }
html[data-theme="nuit"] .jeu .nb-etape { background: var(--rose); color: var(--sur-rose); border-radius: 50%; font-family: var(--f-titre); font-weight: 400; }
html[data-theme="nuit"] .jeu .separateur::before, html[data-theme="nuit"] .jeu .separateur::after { background: var(--filet); }
html[data-theme="nuit"] .jeu .sous, html[data-theme="nuit"] .jeu .separateur { color: var(--craie-2); }
html[data-theme="nuit"] .jeu .carte.mise-en-avant { outline: 4px solid var(--rose); }
html[data-theme="nuit"] .reprise { background: var(--feutrine-2); color: var(--craie); border: 2px solid var(--rose); border-radius: 16px; }


/* ── 13. Bilan / correction (téléphone) ── */
html[data-theme="nuit"] { --trophee-teinte: var(--rose); --feuille: var(--feutrine); --filet: #4A4460; }
html[data-theme="nuit"] .cm-tabs { background: var(--tapis); box-shadow: 0 14px 12px -10px var(--tapis); border-bottom: 2px solid var(--filet); }
html[data-theme="nuit"] .cm-tabs button { border: 2px solid var(--filet); border-radius: 999px; background: var(--feutrine); font: 700 .82rem/1 var(--f-texte); letter-spacing: .02em; text-transform: none; }
html[data-theme="nuit"] .cm-tabs button[aria-current] { background: var(--rose); color: var(--sur-rose); border-color: var(--encre); }
html[data-theme="nuit"] .cm-hero { background: var(--feutrine); border: var(--cerne); border-radius: 26px; box-shadow: 0 8px 0 var(--encre); }
html[data-theme="nuit"] .cm-medaille { background: radial-gradient(circle at 50% 40%, #2a2438, #17141f); color: var(--rose); border: 5px solid var(--encre);
  box-shadow: inset 0 0 0 6px var(--rose), inset 0 0 0 9px var(--encre), 0 8px 0 var(--encre); }
html[data-theme="nuit"] .cm-medaille::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; border: 3px dashed rgba(244, 239, 230, .22); pointer-events: none; }
html[data-theme="nuit"] .cm-medaille-rang { color: var(--craie); }
html[data-theme="nuit"] .cm-medaille-sur, html[data-theme="nuit"] .cm-eyebrow { color: var(--rose-vif); font-family: var(--f-texte); letter-spacing: .08em; }
html[data-theme="nuit"] .cm-score { background: var(--tapis); border: var(--cerne); border-radius: 18px; }
html[data-theme="nuit"] .cm-score b { color: var(--rose); }
html[data-theme="nuit"] :is(.cm-tuile, .cm-q, .cm-recap, .cm-courbes, .cm-rangs li, .cm-tous li, .cm-partage, .cm-cmp) { background: var(--feutrine); border-color: var(--encre); border-radius: 18px; box-shadow: 0 5px 0 var(--encre); }
html[data-theme="nuit"] .cm-tuile-ico { background: var(--craie); color: var(--encre); border-radius: 50%; }
html[data-theme="nuit"] .cm-carre { border-radius: 12px; border: 2px solid var(--encre); }
html[data-theme="nuit"] .cm-carre.ok { background: var(--rose); color: var(--sur-rose); }
html[data-theme="nuit"] .cm-carre.ko { background: var(--feutrine-2); color: var(--craie-2); }
html[data-theme="nuit"] .cm-carre.nr { background: transparent; color: var(--craie-3); border-style: dashed; border-color: var(--filet); }
html[data-theme="nuit"] .cm-ch { background: var(--feutrine); border: 2px solid var(--filet); border-radius: 16px; }
html[data-theme="nuit"] .cm-ch.bon { background: var(--craie); color: var(--encre); border-color: var(--encre); box-shadow: 0 0 0 3px var(--rose); }
html[data-theme="nuit"] .cm-ch.bon .cm-ch-n, html[data-theme="nuit"] .cm-ch.bon .cm-ch-txt { color: var(--encre); }
html[data-theme="nuit"] .cm-ch.faux-moi { background: #2a2233; border-color: var(--craie-3); }
html[data-theme="nuit"] .cm-ch-lettre .forme, html[data-theme="nuit"] .cm-ch-lettre { --t: 32px; width: 32px; height: 32px; }
html[data-theme="nuit"] .cm-ch.bon .forme { color: var(--rose); }
html[data-theme="nuit"] .cm-ch-barre { background: var(--filet); border-radius: 99px; } html[data-theme="nuit"] .cm-ch-barre i { background: var(--rose); border-radius: 99px; }
html[data-theme="nuit"] .cm-marque { border-radius: 99px; font-family: var(--f-texte); letter-spacing: .04em; }
html[data-theme="nuit"] .cm-marque.bon { background: var(--rose); color: var(--sur-rose); border-color: var(--encre); }
html[data-theme="nuit"] .cm-marque.moi { background: var(--feutrine-2); color: var(--craie); }
html[data-theme="nuit"] .cm-chip { border-radius: 999px; background: var(--feutrine); border: 2px solid var(--filet); font-family: var(--f-texte); letter-spacing: .03em; }
html[data-theme="nuit"] .cm-chip[aria-pressed="true"] { background: var(--rose); color: var(--sur-rose); border-color: var(--encre); }
html[data-theme="nuit"] .cm-troph { border-radius: 22px; background: var(--holo); padding: 4px; box-shadow: 0 8px 0 var(--encre), 0 18px 30px -12px rgba(255, 79, 154, .45); }
html[data-theme="nuit"] .cm-troph-in { background: var(--feutrine); border-radius: 18px; border: 3px solid var(--encre); }
html[data-theme="nuit"] .cm-troph-emoji { color: var(--rose); }
html[data-theme="nuit"] .cm-troph-emoji .picto { width: 1.25em; height: 1.25em; }
html[data-theme="nuit"] .cm-troph-detail { background: var(--tapis); color: var(--craie); border-radius: 99px; }
html[data-theme="nuit"] :is(.cm-anecdote, .cm-expl, .cm-q-corps p) { font-family: var(--f-lecture); }
html[data-theme="nuit"] .cm-anecdote { background: #100E16; border-left: 4px solid var(--rose); border-radius: 14px; }
html[data-theme="nuit"] .cm-pod-bloc { background: var(--feutrine-2); border: var(--cerne); border-radius: 16px 16px 0 0; }
html[data-theme="nuit"] .cm-pod-1 .cm-pod-bloc { background: var(--rose); color: var(--sur-rose); }
html[data-theme="nuit"] .cm-rangs li.moi, html[data-theme="nuit"] .cm-tous li.moi { box-shadow: 0 0 0 3px var(--rose), 0 5px 0 var(--encre); }
html[data-theme="nuit"] .medaille-1, html[data-theme="nuit"] .medaille-2, html[data-theme="nuit"] .medaille-3 { color: var(--rose); }
html[data-theme="nuit"] .cm-hero-podium { background: radial-gradient(120% 70% at 50% 0%, #3a1f33, var(--feutrine) 70%); }
html[data-theme="nuit"] .cm-av-theme { background: none; border: 0; width: 40px; height: 40px; padding: 0; box-shadow: none; }
html[data-theme="nuit"] .cm-av-theme svg { width: 100%; height: 100%; }

/* ── 14. Puces de joueurs (lobby TV, salle d'attente) : jeton-avatar + pseudo ── */
html[data-theme="nuit"] .joueur-puce { display: inline-flex; align-items: center; gap: 8px; padding: 5px 16px 5px 5px; border-radius: 999px;
  background: var(--feutrine-2); color: var(--craie); border: var(--cerne); box-shadow: 0 5px 0 var(--encre); font: 400 1.2rem/1 var(--f-titre); }
html[data-theme="nuit"] .puce-avatar { line-height: 0; }

/* ── 15. Écran TV (hôte) ── */
html[data-theme="nuit"] .ctv {
  --acc: var(--rose); --acc-2: var(--rose); --bon: var(--rose); --bon-clair: var(--rose-vif); --mauvais: var(--craie-3);
  --feuille: var(--feutrine); --filet: var(--encre);
  background: radial-gradient(70% 55% at 50% -10%, #3a1f33 0%, transparent 60%), radial-gradient(120% 80% at 50% 0%, #1d1928 0%, var(--tapis) 55%, #110f17 100%);
}
html[data-theme="nuit"] .ctv::after { mix-blend-mode: normal; opacity: 1; background-size: 220px 220px; }
html[data-theme="nuit"] .ctv-fond::before { background: var(--rose); opacity: .08; }
html[data-theme="nuit"] .ctv-fond::after { background: var(--craie); opacity: .04; }
html[data-theme="nuit"] .ctv-barre { background: var(--tapis); border-top: 2px solid var(--filet); border-bottom: 0; }
html[data-theme="nuit"] .ctv-etat { color: var(--rose-vif); font-family: var(--f-texte); }
html[data-theme="nuit"] .ctv-btn { font-family: var(--f-texte); text-transform: none; letter-spacing: 0; border-radius: 999px; background: var(--feutrine-2); color: var(--craie); border: var(--cerne); box-shadow: 0 .25em 0 var(--encre); }
html[data-theme="nuit"] .ctv-btn-suite { background: var(--rose); color: var(--sur-rose); }
html[data-theme="nuit"] .ctv kbd { background: var(--feutrine-2); color: var(--craie); border-color: var(--encre); border-radius: 6px; font-family: var(--f-texte); }
html[data-theme="nuit"] .ctv-haut { background: var(--feutrine); } html[data-theme="nuit"] .ctv-haut i { background: var(--rose); }
html[data-theme="nuit"] .ctv-tuile { background: var(--feutrine); border: var(--cerne); border-radius: .5em; box-shadow: 0 .14em 0 var(--encre); font-family: var(--f-texte); font-weight: 700; color: var(--craie); }
html[data-theme="nuit"] .ctv-tuile .forme { --t: 1.5em; }
html[data-theme="nuit"] .rep.bon .ctv-tuile { outline: 0; background: var(--craie); color: var(--encre); box-shadow: 0 0 0 .14em var(--rose), 0 0 1em .2em rgba(255, 79, 154, .5), 0 .16em 0 var(--encre); }
html[data-theme="nuit"] .rep.bon .ctv-tuile .forme { color: var(--rose); }
html[data-theme="nuit"] :is(.ctv h1, .ctv h2, .ctv .titre, .ctv .tro-titre, .ctv .b-titre, .ctv .pod-titre, .ctv .acc-titre) { font-family: var(--f-titre); font-weight: 400; text-transform: none; letter-spacing: .005em; }
html[data-theme="nuit"] .ctv .banniere { background: var(--feutrine); border: var(--cerne); border-radius: .8em; color: var(--craie); box-shadow: 0 .2em 0 var(--encre); }
html[data-theme="nuit"] .ctv .tro-emoji { color: var(--rose); filter: drop-shadow(0 .06em 0 var(--encre)); }
html[data-theme="nuit"] .ctv .marche { border-radius: .6em .6em 0 0; border: var(--cerne); }
html[data-theme="nuit"] .ctv .marche .m-bloc { background: var(--feutrine-2); color: var(--craie); }
html[data-theme="nuit"] .ctv .m1 .m-bloc { background: repeating-linear-gradient(180deg, var(--rose) 0 .55em, var(--rose-fonce) .55em .7em); color: var(--sur-rose); }
html[data-theme="nuit"] .ctv .m1 .m-place, html[data-theme="nuit"] .ctv .m1 .m-med { color: var(--sur-rose); }
html[data-theme="nuit"] .ctv .anecdote, html[data-theme="nuit"] .ctv .an-texte, html[data-theme="nuit"] .ctv .expl { font-family: var(--f-lecture); }

/* questions sur la TV (hote.html) : grand énoncé, jetons de réponse lisibles de loin, chrono en sablier rond */
@media (min-width: 1100px) {
  html[data-theme="nuit"] #vue-question .question-texte { font: 700 clamp(2.4rem, 3.2vw, 3.6rem)/1.15 var(--f-texte); padding: 34px 48px; border-radius: 30px; }
  html[data-theme="nuit"] .choix { gap: 22px; }
  html[data-theme="nuit"] .choix-tuile { min-height: 120px; border: 4px solid var(--encre); border-radius: 26px; background: var(--feutrine); color: var(--craie);
    box-shadow: 0 8px 0 var(--encre); font: 700 clamp(1.6rem, 2.4vw, 2.6rem)/1.15 var(--f-texte); gap: 22px; padding: 18px 26px; position: relative; overflow: hidden; }
  html[data-theme="nuit"] .choix-tuile .forme { --t: 74px; }
  html[data-theme="nuit"] .choix-tuile.bon { outline: 0; background: var(--craie); color: var(--encre); box-shadow: 0 0 0 6px var(--rose), 0 8px 0 var(--encre); }
  html[data-theme="nuit"] .chrono { width: 150px; height: 150px; font-size: 4.4rem; border-width: 5px; box-shadow: 0 8px 0 var(--encre), 0 0 0 10px var(--rose-voile); }
  html[data-theme="nuit"] .compteur b { color: var(--rose); font-size: 4rem; }
  html[data-theme="nuit"] .compteur { font-family: var(--f-texte); color: var(--craie-2); }
  html[data-theme="nuit"] #q-num, html[data-theme="nuit"] .badge { font: 400 1.4rem/1 var(--f-titre); background: var(--feutrine-2); color: var(--craie); border: var(--cerne); border-radius: 999px; padding: 10px 18px; }
  html[data-theme="nuit"] #vue-lobby .joueurs { background: var(--feutrine); border: 4px solid var(--encre); border-radius: 30px; box-shadow: inset 0 0 0 10px var(--feutrine), inset 0 0 0 13px rgba(244, 239, 230, .1); }
  html[data-theme="nuit"] #vue-lobby .joueur-puce { font-size: 2.2rem; padding: 8px 26px 8px 8px; gap: 14px; box-shadow: 0 8px 0 var(--encre); }
  html[data-theme="nuit"] #vue-lobby .rangee h2 { font: 400 2.4rem/1 var(--f-titre); text-transform: none; }
  html[data-theme="nuit"] .code-salle { background: var(--feutrine); color: var(--rose); border: 4px solid var(--encre); border-radius: 26px; box-shadow: 0 10px 0 var(--encre); letter-spacing: .12em; }
  html[data-theme="nuit"] .rejoindre-url { font-family: var(--f-texte); }
  html[data-theme="nuit"] .qr-bloc img { border-radius: 18px; border: 4px solid var(--encre); background: #fff; }
  html[data-theme="nuit"] #vue-lobby .etiquette { font-size: 1rem; }
}
/* narrateur sur la TV : grand, en bas à droite */
html[data-theme="nuit"] .narrateur-tv, html[data-theme="nuit"] .ctv-narrateur { position: fixed; left: auto; right: 34px; bottom: 90px; max-width: 760px; z-index: 70; pointer-events: none; }
html[data-theme="nuit"] :is(.narrateur-tv, .ctv-narrateur) .narrateur-bulle { font-size: 2.2rem; padding: 14px 24px 16px; border-width: 4px; }
html[data-theme="nuit"] .ctv-narrateur .narrateur { justify-content: flex-end; }
/* TV : énoncés en casse normale et en Rubik (Bagel en capitales sur deux lignes se lit mal), jetons A-D à la bonne taille */
html[data-theme="nuit"] .ctv :is(.q-texte, .q-rappel, .cl-nom) { font-family: var(--f-texte); text-transform: none; letter-spacing: 0; font-weight: 700; }
html[data-theme="nuit"] .ctv :is(.acc-kicker, .tro-kicker, .groupe h3, .c-etiq, .br-etiq, .an-titre, .ctv-etat) { font-family: var(--f-texte); letter-spacing: .08em; }
html[data-theme="nuit"] .ctv :is(.acc-titre, .tro-nom, .cl-titre, .ti-titre, .cq-titre, .q-suspense, .acc-go) { font-family: var(--f-titre); font-weight: 400; text-transform: none; letter-spacing: .005em; }
html[data-theme="nuit"] .ctv .ctv-tuile .forme { --t: 1.5em; width: var(--t); height: var(--t); font-size: 1em; }
html[data-theme="nuit"] .ctv .ctv-tuile .forme svg { fill: currentColor; }
html[data-theme="nuit"] .ctv .ctv-btn { text-transform: none; }
html[data-theme="nuit"] .ctv-narrateur { bottom: 110px; }
html[data-theme="nuit"] .ctv-bilan .bil-actions, html[data-theme="nuit"] .bil-actions { padding-right: 520px; }
/* ── 16. Bilan « Wrapped » ── */
html[data-theme="nuit"] .wrapped { background: radial-gradient(90% 55% at 50% 0%, #4a2140 0%, var(--tapis) 65%), var(--tapis); }
html[data-theme="nuit"] .wrapped::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: var(--grain); background-size: 220px; }
html[data-theme="nuit"] .wr-geant { color: var(--rose); text-shadow: 0 8px 0 var(--encre); }
html[data-theme="nuit"] .wr-kicker { font-family: var(--f-craie); font-size: 1.6rem; color: var(--craie-2); letter-spacing: 0; }
html[data-theme="nuit"] .wr-trophee .wr-carte { background: var(--holo); padding: 5px; }
html[data-theme="nuit"] .wr-carte { background: var(--feutrine); }
html[data-theme="nuit"] .wr-trophee .wr-carte { position: relative; }
html[data-theme="nuit"] .wr-trophee .wr-carte > * { position: relative; }
html[data-theme="nuit"] .wr-trophee .wr-carte::before { content: ""; position: absolute; inset: 5px; border-radius: 18px; background: var(--feutrine); border: 3px solid var(--encre); }
html[data-theme="nuit"] .wr-trophee .wr-carte { padding: 30px 26px; }
html[data-theme="nuit"] .wr-rang .wr-geant, html[data-theme="nuit"] .wr-taux .wr-geant { color: var(--craie); }

/* ── 17. Transition de catégorie et album : la carte à jouer ── */
html[data-theme="nuit"] .tc-carte { background: var(--craie); color: var(--encre); border: 4px solid var(--encre); border-radius: 24px; box-shadow: 0 12px 0 var(--encre), 0 30px 50px -20px rgba(0, 0, 0, .8); }
html[data-theme="nuit"] .tc-carte .picto { color: var(--rose-fonce); }
html[data-theme="nuit"] .tc-carte b { font-family: var(--f-titre); font-weight: 400; }
html[data-theme="nuit"] .album-carte { border-radius: 18px; border-color: var(--filet); }
html[data-theme="nuit"] .album-carte.obtenu { background: var(--holo); padding: 4px; border: 0; box-shadow: 0 6px 0 var(--encre); }
html[data-theme="nuit"] .album-carte.obtenu > * { background: var(--feutrine); }
html[data-theme="nuit"] .album-carte.obtenu { position: relative; }
html[data-theme="nuit"] .album-carte.obtenu::before { content: ""; position: absolute; inset: 4px; border-radius: 15px; background: var(--feutrine); border: 2px solid var(--encre); }
html[data-theme="nuit"] .album-carte.obtenu > * { position: relative; background: none; }
html[data-theme="nuit"] .album-carte.obtenu { padding: 14px 8px; }
html[data-theme="nuit"] .album-ico .picto { color: var(--rose); }

/* ── 18. Le temps : un sablier couché qui se vide (barre épaisse, sable rose qui coule, sablier qui chevauche le bord) ── */
html[data-theme="nuit"] .temps-barre {
  height: 22px; margin: 2px 0 14px; border-radius: 999px; background: #100E16; border: 3px solid var(--encre);
  box-shadow: 0 4px 0 var(--encre), inset 0 2px 0 rgba(0, 0, 0, .45);
}
html[data-theme="nuit"] .temps-barre > i {
  position: relative; border-radius: 999px; min-width: 0;
  background: repeating-linear-gradient(115deg, var(--rose) 0 12px, var(--rose-vif) 12px 18px);
  background-size: 34px 100%; animation: qn-sable .9s linear infinite;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18);
}
@keyframes qn-sable { to { background-position: -34px 0; } }
/* le petit sablier qui avance avec le bord du sable */
html[data-theme="nuit"] .temps-barre::after {
  content: ""; position: absolute; top: 50%; left: calc(var(--p, 1) * 100%); width: 30px; height: 38px; transform: translate(-50%, -50%) rotate(var(--qn-incl, 0deg));
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 56'%3E%3Cpath d='M9 6h22c0 12-8 15-8 22 0 7 8 10 8 22H9c0-12 8-15 8-22 0-7-8-10-8-22Z' fill='%23211D2C' stroke='%23F4EFE6' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M12 9h16c-1 7-5 10-8 13-3-3-7-6-8-13Z' fill='%23FF4F9A'/%3E%3Cpath d='M11 49q9-6 18 0Z' fill='%23FF4F9A'/%3E%3Crect x='4' y='1' width='32' height='6' rx='3' fill='%23F4EFE6' stroke='%230E0C14' stroke-width='2'/%3E%3Crect x='4' y='49' width='32' height='6' rx='3' fill='%23F4EFE6' stroke='%230E0C14' stroke-width='2'/%3E%3C/svg%3E");
  filter: drop-shadow(0 3px 0 var(--encre)); pointer-events: none;
}
html[data-theme="nuit"] .temps-barre.fige > i { animation: none; }
html[data-theme="nuit"] .temps-barre.fige::after { opacity: .5; }
/* les 5 dernières secondes : le sable devient craie/rose et clignote, le sablier tremble, les bords de l'écran rougeoient */
html[data-theme="nuit"] .temps-barre.presse { animation: qn-presse-barre .5s ease-in-out infinite alternate; }
html[data-theme="nuit"] .temps-barre.presse > i { background: repeating-linear-gradient(115deg, var(--craie) 0 10px, var(--rose) 10px 20px); background-size: 34px 100%; animation-duration: .35s; }
html[data-theme="nuit"] .temps-barre.presse::after { animation: qn-tremble .18s linear infinite; }
@keyframes qn-presse-barre { to { box-shadow: 0 4px 0 var(--encre), 0 0 0 4px var(--rose-voile), 0 0 22px 2px rgba(255, 79, 154, .55); } }
@keyframes qn-tremble { 0%, 100% { transform: translate(-50%, -50%) rotate(-9deg); } 50% { transform: translate(-50%, -50%) rotate(9deg); } }
html[data-theme="nuit"].temps-presse body::before {
  content: ""; position: fixed; inset: 0; z-index: 30; pointer-events: none;
  box-shadow: inset 0 0 0 4px var(--rose), inset 0 0 70px 6px rgba(255, 79, 154, .45); animation: qn-bord .5s ease-in-out infinite alternate;
}
@keyframes qn-bord { from { opacity: .45; } to { opacity: 1; } }
/* le chiffre suit : il grossit et passe au rose dans les 5 dernières secondes */
html[data-theme="nuit"] .question-mini { min-height: calc(4 * 1.3em + 24px); display: flex; align-items: center; justify-content: center; }  /* 4 lignes réservées d'une question à l'autre */
html[data-theme="nuit"] .mini-chrono { min-width: 52px; height: 44px; font-size: 1.5rem; display: inline-grid; place-items: center; padding: 0 10px; }
html[data-theme="nuit"] .mini-chrono.urgent, html[data-theme="nuit"].temps-presse .mini-chrono { background: var(--rose); color: var(--sur-rose); animation: qn-boing .5s var(--rebond) infinite alternate; }
html[data-theme="nuit"] .chrono.urgent { background: var(--rose); color: var(--sur-rose); }
/* TV : la barre fait toute la largeur, épaisse, visible de loin */
@media (min-width: 1100px) {
  html[data-theme="nuit"] .temps-barre-tv { height: 40px; border-width: 4px; margin: 6px 0 22px; }
  html[data-theme="nuit"] .temps-barre-tv::after { width: 52px; height: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-theme="nuit"] .temps-barre > i, html[data-theme="nuit"] .temps-barre.presse, html[data-theme="nuit"] .temps-barre.presse::after,
  html[data-theme="nuit"].temps-presse body::before, html[data-theme="nuit"] .mini-chrono.urgent { animation: none !important; }
}
/* TV en question : le narrateur se range sous les réponses (il ne doit jamais couvrir la réponse D) */
html[data-theme="nuit"] .narrateur-tv { bottom: 12px; right: 24px; max-width: 640px; }
html[data-theme="nuit"] .narrateur-tv .narrateur-bulle { font-size: 1.7rem; padding: 10px 18px 12px; }
html[data-theme="nuit"] .narrateur-tv .narrateur-perso svg { width: 96px; height: auto; }
/* TV : la question doit tenir dans l'écran, image comprise */
@media (min-width: 1100px) {
  html[data-theme="nuit"] .zone-milieu img, html[data-theme="nuit"] .zone-milieu .image.photo img { max-height: 30vh; }
  html[data-theme="nuit"] #vue-question .question-texte { padding: 22px 40px; }
}
html[data-theme="nuit"] .mobile img.illu { background: #100E16; border: 3px solid var(--encre); border-radius: 18px; }
@media (min-width: 1100px) { html[data-theme="nuit"] .zone-milieu img { height: 30vh; } }

/* ── 19. Stabilité : les étiquettes de question tiennent sur UNE ligne (sinon l'énoncé et les réponses sautent d'une question à l'autre) ── */
html[data-theme="nuit"] .mobile .badges-q, html[data-theme="nuit"] .echauffement .badges-q { flex-wrap: nowrap; justify-content: center; min-width: 0; }
html[data-theme="nuit"] .mobile .badges-q .puce, html[data-theme="nuit"] .echauffement .badges-q .puce { min-width: 0; flex: 0 1 auto; }
html[data-theme="nuit"] .mobile .badges-q .badge-cat, html[data-theme="nuit"] .echauffement .badges-q .badge-cat { overflow: hidden; text-overflow: ellipsis; }
html[data-theme="nuit"] .badges-q .badge-niv { flex: none; }
html[data-theme="nuit"] .mobile .badges-q .niv-nom, html[data-theme="nuit"] .echauffement .badges-q .niv-nom { display: none; }
@media (min-width: 420px) { html[data-theme="nuit"] .mobile .badges-q .niv-nom { display: inline; } }
/* accueil : l'emplacement de l'anecdote est invisible tant qu'il est vide (mais sa place est gardée) */
html[data-theme="nuit"] .ech-verdict.attente .ech-anecdote { background: none; border-left-color: transparent; }
html[data-theme="nuit"] .ech-choix .bouton-choix { padding: 8px 22px 8px 8px; gap: 8px; font-size: .97rem; }
html[data-theme="nuit"] .ech-choix .bouton-choix .forme { --t: 30px; }
/* règles de points : un pense-bête à la craie */
html[data-theme="nuit"] .regles-points { background: var(--feutrine); border: 2px dashed var(--filet); border-radius: 18px; padding: 4px 16px; color: var(--craie-2); }
html[data-theme="nuit"] .regles-points summary { color: var(--craie); font: 400 1.05rem/1 var(--f-titre); }
html[data-theme="nuit"] .regles-points[open] { border-color: var(--rose); }
html[data-theme="nuit"] .regles-points li::marker { color: var(--rose); }

/* la valeur de la question, en clair à côté du dé */
html[data-theme="nuit"] .badges-q .valeur-q { font: 400 1.02em/1 var(--f-titre); color: var(--rose-vif); letter-spacing: .01em; }
