/* Chain — portrait d'abord, bandes décoratives sur desktop, zéro dépendance. */

:root {
  /* Palette : pilotée par le THÈME (themes.js) — ces valeurs sont le repli. */
  --bg0: #0e0b16;
  --bg1: #1a1526;
  --glow: #ff9d5c;
  --accent: #ffb37a;
  --card: #16203466;
  --ink: #f4e9ff;
  --dim: #8ea0bd;
  --gold: #ffd45e;
  --red: #ff5d6c;
  --cold: #39c2ff;
  --line: rgba(255, 255, 255, .07);

  /* ————— LE langage visuel : un seul jeu de rayons, d'ombres et d'easings.
     Tout composant s'y réfère — c'est ce qui empêche les styles de diverger. */
  --r-sm: 12px;   /* petits contrôles */
  --r-md: 16px;   /* boutons */
  --r-lg: 22px;   /* cartes, panneaux */
  --r-pill: 999px;
  --sh-1: 0 6px 18px -8px rgba(0, 0, 0, .55);              /* posé */
  --sh-2: 0 18px 44px -18px rgba(0, 0, 0, .65);            /* flottant */
  --sh-3: 0 30px 70px -20px rgba(0, 0, 0, .72);            /* modal */
  --spring: cubic-bezier(.3, 1.6, .5, 1);                  /* entrées, pops */
  --ease: cubic-bezier(.22, .61, .36, 1);                  /* transitions d'état */
  --t-fast: .18s;
  --t-mid: .32s;
  /* Largeur de la scène en paysage — partagée avec la bande latérale, qui doit
     tenir dans ce qui RESTE de chaque côté (sinon elle mord sur le plateau).
     Le terme `100vw - 220px` GARANTIT 96 px de bande lisible : en paysage le
     plateau est borné par la HAUTEUR, donc rétrécir la scène ne lui coûte
     rien — mais sans ce terme la bande tombait à 40 px et hachait son texte. */
  --stage-w: min(max(96vh, 560px), 92vw, calc(100vw - 220px));
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* L'attribut hidden gagne TOUJOURS — nos display:flex/grid sur les éléments
   masquables ont déjà mordu trois fois la règle UA. Plus jamais. */
[hidden] { display: none !important; }

html, body {
  position: fixed; inset: 0; overflow: hidden;
  background: var(--bg0); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* Décor : trame diagonale lente + deux voiles de lumière du thème qui
   RESPIRENT (transform/opacity uniquement → composités par le GPU, coût nul
   sur la boucle de jeu). Discret par construction : jamais au-dessus de .16. */
body::before {
  content: ""; position: fixed; inset: -80px; z-index: 0;
  background:
    repeating-linear-gradient(135deg, transparent 0 30px, rgba(255, 255, 255, .018) 30px 60px),
    radial-gradient(120% 90% at 50% 0%, var(--bg1) 0%, var(--bg0) 72%);
  animation: drift 80s linear infinite;
}
#bgGlow {
  position: fixed; inset: -25%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38% 30% at 22% 26%, var(--glow) 0%, transparent 62%),
    radial-gradient(34% 28% at 78% 74%, var(--accent) 0%, transparent 62%);
  opacity: .13;
  filter: blur(38px);
  animation: breathe 17s ease-in-out infinite;
  transition: opacity .6s var(--ease);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(90% 70% at 50% 45%, transparent 55%, rgba(0, 0, 0, .42) 100%);
}
@keyframes drift { to { transform: translateY(-84.85px) translateX(-84.85px); } }
@keyframes breathe {
  0%, 100% { transform: scale(1) translate(0, 0); opacity: .11; }
  50% { transform: scale(1.14) translate(2%, -2%); opacity: .17; }
}
@media (prefers-reduced-motion: reduce) { #bgGlow { animation: none; } }

#stage {
  position: relative; z-index: 1;
  height: 100%; width: min(100vw, 64vh);
  margin: 0 auto;
  display: flex; flex-direction: column; gap: 8px; /* grille de 8 px */
  padding: calc(8px + env(safe-area-inset-top, 0px)) 8px calc(8px + env(safe-area-inset-bottom, 0px));
  touch-action: manipulation;
}

/* ---------- HUD : UN ensemble — wordmark · modes · cœurs/réglages ---------- */
#hud { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; }
/* LOGO v5 : le wordmark fait 5,93:1, le monogramme est carré. Une seule
   famille de règles — la taille se pilote par la largeur du conteneur. */
.hudWm { width: 132px; flex: 0 0 auto; }
.hudWmS { display: none; width: 38px; flex: 0 0 auto; }
.hudWm svg, .hudWmS svg, #wordmark svg, .wmMini svg, .gameName svg {
  width: 100%; height: auto; display: block;
}
.wmMini { width: 104px; }
.gameName svg { width: 148px; margin: 0 auto 4px; }
.gnSub {
  display: block; font-size: 10.5px; letter-spacing: 3px; text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 55%, transparent); font-weight: 800;
}
/* ---------- Bannière d'objectif (Aventure) : 2 LIGNES en portrait ---------- */
#objBar {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px 14px;
  background: linear-gradient(180deg, var(--cellTop, #3c3350), var(--cellBot, #2b2440));
  border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--sh-1);
  font-size: 13.5px; font-weight: 700;
}
/* PORTRAIT : la bannière est CENTRÉE, comme la cible juste en dessous — deux
   bandeaux d'information empilés ne peuvent pas avoir deux alignements (audit
   du 22 août : « du texte au milieu et du texte à gauche »). Le paysage remet
   flex-start plus bas : là, la bannière est une colonne latérale étroite. */
#objL1, #objL2 { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; }
/* La FICHE DE NIVEAU (retour Nic, 22 août) : le niveau est le titre, le monde
   est un sur-titre en petites capitales — plus jamais « Dawn · Level 1 » posé
   comme une ligne de log. */
#objText { color: var(--ink); flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1px; }
#objText em {
  font-style: normal; font-size: 9.5px; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase;
  color: color-mix(in srgb, var(--accent, #ffb37a) 80%, var(--ink));
}
#objText b { font-size: 15px; letter-spacing: .01em; }
#objTarget { color: color-mix(in srgb, var(--ink) 62%, transparent); font-size: 12.5px; }
/* Le défi ★★★ ne doit JAMAIS être coupé en plein mot : il passe à la ligne
   (2 lignes max) — le joueur doit toujours connaître sa condition. */
#objChal {
  /* centré comme la ligne du dessus : c'est LUI qui remplit objL2 (flex:1),
     donc c'est lui qui doit centrer ses pips (paysage : flex-start plus bas) */
  color: var(--gold); display: flex; flex-wrap: wrap; gap: 2px 10px;
  justify-content: center;
  min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: clip;
  line-height: 1.35;
  /* deux lignes RÉELLES de PASTILLES : padding 3+4, bordure 1+1 — une rangée
     fait ~25 px, deux rangées + l'écart ≈ 54 px. L'ancien plafond (3.4em,
     calibré pour du texte nu) rognait la seconde rangée à 336 px de large. */
  max-height: 4.2em;
}
/* Les CHIPS d'objectif (retour Nic) : de vraies pastilles, pas du texte en
   vrac — le nombre d'étoiles dit ce qu'on gagne, la condition dit comment. */
#objChal .chalPip {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  position: relative; padding: 3px 9px 4px;
  background: #ffffff0d; border: 1px solid #ffffff14; border-radius: var(--r-pill);
  overflow: hidden;   /* la barre du bas suit l'arrondi de la pastille */
}
#objChal .pipStars { display: inline-flex; gap: 1px; color: var(--gold); }
#objChal .pipStars .ic { width: 9px; height: 9px; }
#objChal .pipPlus { font-style: normal; font-weight: 800; color: var(--dim); }
/* C20-7 : le badge statique — sa BARRE se vide (le décompte sans chiffre),
   ✗ gris quand le délai passe, ✓ vert (l'étoile se teinte) quand c'est tenu */
#objChal .chalPip .tbar {
  /* left:0 et pas un pixel de plus : une barre qui déborde du pip est comptée
     « tronquée » par la matrice (scrollWidth), et elle a raison */
  position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: color-mix(in srgb, var(--gold, #ffd45e) 65%, transparent);
  border-radius: 1px; transition: width .3s linear;
}
#objChal .chalPip .pipX { display: none; }
#objChal .chalPip.dead .ic-star { display: none; }
#objChal .chalPip.dead .pipX { display: inline-flex; }
#objChal .chalPip.dead .tbar { display: none; }
#objChal .chalPip.ok { color: #57d492; }
#objChal .chalPip.ok .tbar { background: #57d492; }
#objChal .chalPip.dead { opacity: .45; }
/* Le PAR (★★) se distingue du défi (★★★) : étiqueté et porté en ENCRE, jamais
   doré — deux conditions de rangs différents ne doivent pas se ressembler. */
#objChal .parPip { color: var(--ink); }
#objChal .parPip b { font-weight: 800; letter-spacing: .2px; }
#objChal .ic { width: 12px; height: 12px; }
/* VRAIE jauge libellée : « PAR 53s · 41s » écrit dedans */
#parBar {
  position: relative; flex: 1 1 60px; max-width: 170px; height: 16px; margin-left: auto;
  background: #00000052; border-radius: 8px; overflow: hidden;
}
#parFill {
  position: absolute; inset: 0; height: 100%; width: 100%; border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 55%, transparent);
  transition: width .4s linear; /* elle se VIDE doucement, pas un compte à rebours */
}
#parText {
  position: relative; z-index: 1; display: block; text-align: center;
  font-size: 10.5px; line-height: 16px; font-weight: 800; color: var(--ink);
  letter-spacing: .3px; white-space: nowrap;
}
#objMotif {
  position: absolute; right: -6px; top: 50%; transform: translateY(-50%);
  width: 120px; color: var(--accent); opacity: .16; pointer-events: none;
}
#objMotif svg { width: 100%; height: auto; }
#hudRight { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* Onglets de mode : des PASTILLES de la même famille que les tuiles du plateau
   (même dégradé, même ombre, même liseré) — fluides jusqu'à 320 px de large. */
#tabs { display: flex; gap: 6px; max-width: 100%; min-width: 0; flex: 1 1 auto; justify-content: center; overflow: hidden; }
#tabs button {
  width: clamp(44px, 13vw, 58px); height: 56px; flex: 0 1 auto; min-width: 0;
  flex-direction: column; gap: 2px; padding: 4px 2px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: linear-gradient(180deg, var(--cellTop, #3c3350), var(--cellBot, #2b2440));
  box-shadow: var(--sh-1);
  /* libellés inactifs : alpha 0,72 — contraste ≥ 4,5:1 sur la tuile */
  color: color-mix(in srgb, var(--ink) 72%, transparent);
  cursor: pointer; font-family: inherit; touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease), transform var(--t-mid) var(--spring);
}
#tabs button.active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: var(--sh-1), 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
#tabs button:active { transform: scale(.9); }
#tabs .ic { width: 26px; height: 26px; flex: 0 0 auto; }
/* le TEXTE règle « les icônes ne veulent rien dire » */
.tabLbl { font-size: 10px; font-weight: 800; letter-spacing: .2px; line-height: 1; }
#dots { display: flex; gap: 7px; align-items: center; padding: 0 2px; font-weight: 800; letter-spacing: .5px; }
#dots .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: #263450; border: 2px solid #35486b;
  transition: transform .45s var(--spring), background .3s, border-color .3s;
}
#dots .dot.done { background: var(--gold); border-color: var(--gold); }
#dots .dot.cur { border-color: var(--cold); transform: scale(1.25); }
#dots .inf { font-size: 19px; color: var(--dim); }
#dots .infScore { font-size: 19px; color: var(--ink); }
/* La SÉRIE de l'Infini : le seul chiffre du mode qui puisse se perdre. */
#dots .infStreak {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 12px; font-weight: 800; color: var(--dim); margin-left: 4px;
}
#dots .infStreak.on { color: var(--gold); }
#dots .infStreak .ic { width: 12px; height: 12px; }
#dots .infStreak i { font-style: normal; opacity: .6; font-size: 10.5px; }
/* Les LIBELLÉS des compteurs (P2-4) : minuscules, en petites capitales, sans
   soulignement — assez pour nommer le nombre, jamais assez pour lui disputer
   la lecture. Sous 360 px de large, le HUD n'a plus la place : ils partent. */
#dots u { text-decoration: none; font-size: 9px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; opacity: .55; margin-left: 3px; }
@media (max-width: 359px) { #dots u { display: none; } }
#streak { font-size: 15px; color: var(--gold); font-weight: 700; }
#streak b { font-size: 16px; }

/* Boutons-pastilles : la MÊME matière que les tuiles du plateau (dégradé
   vertical, ombre douce, liseré), icône teintée dans l'accent du thème. */
.iconBtn {
  min-width: 46px; height: 46px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 19px; font-weight: 800; color: var(--accent);
  background: linear-gradient(180deg, var(--cellTop, #3c3350), var(--cellBot, #2b2440));
  border: 1px solid var(--line); border-radius: var(--r-sm);
  cursor: pointer; touch-action: manipulation;
  transition: transform var(--t-mid) var(--spring), box-shadow var(--t-fast) var(--ease);
  font-family: inherit;
  box-shadow: var(--sh-1);
}
.iconBtn:active { transform: scale(.9); background: #ffffff1c; }
/* Le NOM du bouton, quand la barre haute a VRAIMENT la place de le porter.
   Le palier est 700 px et pas 520 : mesuré à 540 px de large, ces 52 px de
   texte volaient leur largeur aux onglets, qui tombaient à 38 px — sous le
   plancher tactile. En dessous, l'icône seule suffit : elle est redevenue un
   engrenage reconnaissable. */
.btnLbl { font-size: 11px; font-weight: 800; letter-spacing: .2px; margin-left: 5px; }
@media (max-width: 699px) { .btnLbl { display: none; } }
.optSec i { font-style: normal; font-weight: 700; color: var(--dim); font-size: 10.5px; }
.iconBtn b { font-size: 14px; color: var(--gold); }
.iconBtn.spent b { color: var(--dim); }
/* Le PRIX de l'indice : annoncé avant le clic, jamais après. Il est posé en
   ABSOLU dans le bouton, donc il ne coûte pas un pixel de largeur — mesuré,
   les 26 px qu'il prenait en flux faisaient chevaucher le chrono et les
   actions à 320 et 375 px, où la barre basse n'a que ~23 px de marge. */
#btnHint { position: relative; }
/* P2-5 : l'indice ARME. Le bouton dit qu'il attend une confirmation, du meme
   or que le prix qu'il annonce, et il respire tant que la fenetre dure. */
#btnHint.armed {
  background: color-mix(in srgb, var(--gold, #ffd45e) 22%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold, #ffd45e) 55%, transparent);
  animation: hintArm 1.05s ease-in-out infinite;
}
@keyframes hintArm { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold, #ffd45e) 12%, transparent); } }
@media (prefers-reduced-motion: reduce) { #btnHint.armed { animation: none; } }
#btnHint.withCost { padding-bottom: 9px; }
.hintStack { display: contents; }
#hintCost {
  position: absolute; left: 1px; right: 1px; bottom: 2px;
  text-align: center; line-height: 1;
  font-style: normal; font-size: 8.5px; font-weight: 800; letter-spacing: -.3px;
  color: var(--gold);
}
#hintCost[hidden] { display: none; }

/* IMPASSE : le bouton « annuler » est la sortie — il se signale. */
.iconBtn.urge {
  border-color: var(--gold);
  animation: urgePulse 1.1s ease-in-out infinite;
}
@keyframes urgePulse {
  0%, 100% { box-shadow: var(--sh-1); }
  50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 38%, transparent), var(--sh-1); }
}
@media (prefers-reduced-motion: reduce) {
  .iconBtn.urge { animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 38%, transparent); }
}
/* 🎵 coupé : l'icône reste, éteinte et barrée — lisible sans deuxième emoji */
.iconBtn.off { opacity: .42; }
.iconBtn.off::after {
  content: ''; position: absolute; left: 9px; right: 9px; top: 50%;
  border-top: 2.5px solid var(--ink); transform: rotate(-38deg); border-radius: 2px;
}
#btnMusic { position: relative; }

/* ---------- Somme courante ---------- */
/* ---------- Barre basse : progression/cible à gauche, actions à droite ---------- */
#subBar {
  /* minmax(0, 1fr) et non 1fr : une piste 1fr refuse de descendre sous le
     min-content de son contenu et fait DÉBORDER la grille (le compteur passait
     alors sous le chrono en paysage court). */
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 8px; min-height: 56px;
}
/* min-width:0 : sans lui, le contenu impose sa largeur intrinsèque et pousse
   le chrono/les actions hors de l'écran à 320 px et en paysage court. */
#subLeft { display: flex; align-items: center; gap: 16px; min-width: 0; overflow: hidden; justify-self: start; }
#timerZone {
  justify-self: center; display: flex; flex-direction: column; align-items: center;
  gap: 3px; min-width: 62px; flex: 0 0 auto;
}
#subRight { display: flex; align-items: center; gap: 8px; justify-self: end; }
/* ---------- LA CIBLE, contre le plateau (C19v2) ----------
   Hiérarchie inversée : c'est la CIBLE qui est grosse et dorée, la somme
   courante qui l'accompagne. L'ancien agencement mettait en avant le chiffre
   que le joueur voit déjà bouger sous son doigt, et cachait celui qu'il doit
   garder en tête. #boardMsg garde sa ligne RÉSERVÉE en permanence : un message
   qui apparaît ne doit jamais pousser le plateau. */
#goalBar { display: flex; flex-direction: column; align-items: center; gap: 1px; }
#goalMain { display: flex; align-items: baseline; justify-content: center; gap: 12px; flex-wrap: wrap; }
#goalLbl {
  font-size: 10.5px; font-weight: 800; letter-spacing: .18em;
  color: var(--dim); text-transform: uppercase;
}
#goalTarget {
  font-size: clamp(30px, 5vh, 42px); line-height: 1; font-weight: 800;
  color: var(--gold); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px color-mix(in srgb, var(--gold) 35%, transparent);
}
/* La cible MOBILE de l'Échelle : la flèche et le plancher, et un battement
   quand elle vient de descendre. */
#goalDrift {
  font-style: normal; font-size: 13px; font-weight: 800;
  color: var(--red); letter-spacing: .3px; align-self: center;
}
#goalDrift[hidden] { display: none; }
#goalTarget.drift { animation: goalDrift .5s ease-out; }
@keyframes goalDrift {
  0% { transform: translateY(-6px) scale(1.15); color: var(--red); }
  100% { transform: none; }
}
#boardMsg {
  min-height: 16px; line-height: 16px; text-align: center;
  font-size: 12.5px; font-weight: 800; letter-spacing: .2px;
  color: color-mix(in srgb, var(--ink) 70%, transparent);
  opacity: 0; transition: opacity .12s var(--ease);
}
#boardMsg.show { opacity: 1; }
#boardMsg.bad { color: var(--red); }
#sumLine { display: flex; align-items: baseline; gap: 8px; flex: 0 0 auto; }
#sumNow {
  /* LE COMPTEUR SE MESURE EN PART DU PETIT COTE, pas en hauteur de fenetre.
     `3vh` suit la HAUTEUR : en portrait elle est grande et le chiffre fait
     3,5 % du petit cote, en paysage elle est le petit cote et il tombe a 3 %.
     Reduite a 480p — la taille a laquelle le portail montre une preview — la
     difference se voit : 12 px de chiffre en portrait, 10 en paysage, sous le
     seuil de lisibilite. Le plancher monte donc a 26 px : c'est le nombre que
     le joueur SUIT, il n'a rien a faire en petit. */
  font-size: clamp(26px, 3vh, 28px); line-height: 1; font-weight: 800;
  font-variant-numeric: tabular-nums; color: var(--cold);
  transition: color .15s;
  display: inline-block;
}
#sumNow.pop { animation: sumPop .4s var(--spring); }
#sumNow { position: relative; }
/* anneau de victoire : se dilate depuis la cible */
#sumRing {
  position: absolute; left: 50%; top: 50%;
  width: 1.25em; height: 1.25em; margin: -0.625em;
  border: .05em solid var(--gold); border-radius: 50%;
  opacity: 0; pointer-events: none;
}
#sumRing.ping { animation: ringOut .62s ease-out; }
@keyframes ringOut {
  0% { transform: scale(.55); opacity: .9; }
  100% { transform: scale(2.3); opacity: 0; }
}

/* confettis plein écran du GRAND moment — au-dessus de tout, jamais bloquant */
#fxTop { position: fixed; inset: 0; z-index: 70; pointer-events: none; width: 100%; height: 100%; }
@keyframes sumPop { 0% { transform: scale(1.18); } 100% { transform: scale(1); } }
#sumNow.over { animation: overFlash .45s ease-out; }
@keyframes overFlash {
  0%, 60% { color: var(--red); transform: translateX(0); }
  15% { transform: translateX(-7px); } 30% { transform: translateX(6px); } 45% { transform: translateX(-3px); }
}
#sumTarget { font-size: clamp(12px, 2vh, 15px); font-weight: 700; color: var(--dim); font-variant-numeric: tabular-nums; }

/* Cœurs : dans la barre haute, à droite — le ROUGE CHAUD porte le sens. */
#hearts { display: flex; align-items: center; gap: 6px; }
#hearts[hidden] { display: none; }
#hearts .h {
  /* vide, mais toujours ROUGE et pâle : c'est le même cœur, en creux — pas
     une autre pastille d'une autre couleur */
  font-size: 15px; line-height: 1; color: rgba(255, 122, 138, .42);
  transition: color .3s, transform .35s var(--spring);
}
#hearts .h.on { color: var(--red); }
#hearts .h.losing { animation: heartLoss .55s ease-out; }
/* Présentation des cœurs, une fois : ils se signalent au lieu d'apparaître.
   Halo et non ÉCHELLE : un scale(1.35) sur une pastille de 15 px espacée de
   6 px faisait se recouvrir les trois cœurs — la matrice de layout l'a
   attrapé. Un halo ne déplace aucune géométrie. */
#hearts.callout .h { animation: heartHello 1s ease-out 3; }
@keyframes heartHello {
  0%, 100% { filter: none; color: var(--red); }
  35% { filter: drop-shadow(0 0 7px var(--red)) drop-shadow(0 0 12px var(--red)); color: #ffb3bb; }
}
#hearts.callout .h:nth-child(2) { animation-delay: .12s; }
#hearts.callout .h:nth-child(3) { animation-delay: .24s; }
@keyframes heartLoss {
  0% { transform: scale(1.75); color: #ff8b96; }
  50% { transform: scale(.75) rotate(-14deg); }
  100% { transform: scale(1); }
}

#timerBar {
  width: clamp(70px, 16vw, 150px); height: 6px;
  background: #1b2740; border-radius: 4px; overflow: hidden; flex: 0 0 auto;
}
#timerFill { display: block; height: 100%; width: 100%; border-radius: 4px; background: var(--cold); }

/* Temps restant (Échelle) ; sous 5 s : pulse + rouge */
#timerText {
  font-size: clamp(18px, 3.2vh, 26px); font-weight: 800;
  font-variant-numeric: tabular-nums; color: var(--dim); line-height: 1;
}
#timerText[hidden] { display: none; }
/* Échelle : ROUGE en permanence (mode fatal) — pas seulement sous 10 s */
#timerText { color: var(--red); }
#timerText.low { color: var(--red); animation: timePulse .5s ease-in-out infinite; }
/* Mode PAR (Aventure) : le MÊME composant, mais DORÉ EN PERMANENCE — sinon les
   deux modes affichent la même couleur tant qu'il reste plus de 10 s, et le
   joueur ne distingue pas « une étoile en jeu » de « la manche en jeu ». */
#timerText.par { color: color-mix(in srgb, var(--gold) 85%, transparent); }
#timerText.par.low { color: var(--gold); animation: timePulse .5s ease-in-out infinite; }
/* Le prix de l'indice se VOIT sur le chrono : il saute de quinze secondes. */
#timerText.penalty { animation: timerPenalty 1.1s ease-out; }
@keyframes timerPenalty {
  0% { transform: scale(1.4); color: var(--red); }
  100% { transform: scale(1); }
}
/* …et sur l'objectif : l'ancien barré, le nouveau à côté. */
#objChal .chalPip s { opacity: .55; margin-right: 3px; }
#timerFill.par { background: color-mix(in srgb, var(--gold) 72%, transparent); }
@keyframes timePulse { 50% { transform: scale(1.14); } }

/* ---------- Plateau ---------- */
#boardWrap {
  flex: 1; min-height: 0; min-width: 0;
  display: grid; place-items: center; position: relative;
  padding-bottom: 1vh;
}
/* EN PORTRAIT, le plateau est borné par la LARGEUR : il reste donc de la
   hauteur, et le centrage la répartissait en deux vides égaux — la cible se
   retrouvait à 200 px du plateau alors qu'elle est censée être CONTRE lui
   (C19v2, point 5). On aligne le plateau en haut de son espace : il colle à la
   cible, et le mou passe en dessous, là où il ne sépare rien. En paysage c'est
   la hauteur qui borne, il n'y a pas de mou, et le centrage reste. */
@media (max-aspect-ratio: 6/5) {
  #boardWrap { place-items: start center; }
}
#boardCard {
  position: relative; border-radius: var(--r-lg); padding: 10px;
  background: linear-gradient(180deg, #ffffff0c, #00000026);
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
  will-change: transform;
}
#board { display: block; touch-action: none; border-radius: 14px; }

/* ---------- LE TOAST ----------
   Signalé trois fois comme « invisible », et il l'était pour une raison qu'on
   ne voit qu'en regardant l'écran : il s'affichait bien, au-dessus de tout
   (z-88), mais dans la MÊME couleur que les cartes — un `bg1` assombri sur un
   liseré `--line`. Posé à 12 % du bas, il tombait pile sur le bord inférieur
   d'une carte de fin haute de 92 vh : une pastille sombre sur une carte
   sombre, à l'endroit exact où l'œil s'attend à voir du décor de carte. Il
   était là, et il ne se voyait pas.

   Il est maintenant la SEULE pastille dorée de l'écran, en encre sombre —
   aucune surface du jeu ne lui ressemble, quelle que soit la carte derrière. */
#toast {
  /* AU-DESSUS DE LA BARRE D'ACTIONS, jamais dessus (audit final). À 7 % de la
     hauteur il retombait sur le chrono et sur les boutons annuler/indice —
     une confirmation qui cache les commandes. 72 px dégagent la barre (56 au
     plus) et sa marge, à toutes les tailles servies. Il peut encore flotter
     au-dessus du PLATEAU : c'est une confirmation d'un geste déjà fait, elle
     dure 1,6 s et ne prend aucun clic (pointer-events: none). */
  position: fixed; left: 50%; bottom: 72px; z-index: 88;
  transform: translateX(-50%) translateY(10px) scale(.94);
  background: var(--gold); border: none; color: #1a1204;
  font-size: 15px; font-weight: 800; letter-spacing: .2px;
  padding: 10px 20px; border-radius: var(--r-pill);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55), 0 0 0 3px rgba(0, 0, 0, .35);
  opacity: 0; pointer-events: none; white-space: nowrap;
  transition: opacity .18s, transform .4s var(--spring);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
@media (prefers-reduced-motion: reduce) {
  #toast { transition: opacity .18s; transform: translateX(-50%); }
  #toast.show { transform: translateX(-50%); }
}

/* ---------- Célébration de victoire mise en scène ---------- */
#endCard { overflow: hidden; }
#endCard > :not(.rays) { position: relative; }
.rays {
  position: absolute; left: 50%; top: 26%; width: 150%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(rgba(255, 212, 94, .13) 0deg 9deg, transparent 9deg 26deg);
  border-radius: 50%; pointer-events: none;
  -webkit-mask-image: radial-gradient(circle, black 0%, transparent 60%);
  mask-image: radial-gradient(circle, black 0%, transparent 60%);
  animation: raysSpin 16s linear infinite;
}
@keyframes raysSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
/* 3 CRÉNEAUX à condition fixe : Solve · PAR · Challenge, remplis indépendamment */
.starRow { display: flex; justify-content: center; gap: 18px; }
.starRow .star { opacity: .35; transition: opacity .2s; display: inline-flex; flex-direction: column; align-items: center; gap: 3px; }
.starRow .star em { font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .3px; opacity: .85; }
.starRow .star.on {
  opacity: 1; color: var(--gold, #ffd45e);
  animation: starPop .38s var(--spring);
}
@keyframes starPop { 0% { transform: scale(.2); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
.celMissing { opacity: .75; font-size: 13px; }
/* « NEXT LEVEL » EST DISPONIBLE TOUT DE SUITE. Les boutons attendaient la fin
   de la mise en scène — étoiles, pièces, tuile de mosaïque — soit jusqu'à cinq
   secondes pendant lesquelles le joueur qui veut enchaîner n'a rien à toucher.
   Une célébration est un cadeau, pas un péage. Ils sont là dès la première
   frame, à pleine opacité et pleinement cliquables ; l'animation continue
   derrière, et un tap la saute comme avant. Seule la petite montée reste, en
   décoration pure — jamais en verrou. */
.celLater { opacity: 1; transform: none; pointer-events: auto; }
.celLater.show { animation: celRise .3s var(--ease); }
@keyframes celRise { from { opacity: .6; transform: translateY(6px); } }

/* ---------- La carte est une VRAIE carte ---------- */
.worldBlock { position: relative; }
.worldDecor {
  position: absolute; inset: 0; width: 100%; height: 100%;
  color: var(--w-accent, #ffd45e); opacity: .1; pointer-events: none;
}
.mapPath { position: absolute; left: 0; top: 0; pointer-events: none; }
.node.cur::before, .node.cur::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px;
  border-radius: 50%; background: #ffd45e; pointer-events: none;
  animation: nodeSpark 1.9s ease-out infinite;
}
.node.cur::after { animation-delay: .95s; animation-name: nodeSpark2; }
@keyframes nodeSpark {
  0% { opacity: 0; transform: translate(-50%, -50%); }
  18% { opacity: .95; }
  100% { opacity: 0; transform: translate(calc(-50% + 15px), calc(-50% - 30px)) scale(.4); }
}
@keyframes nodeSpark2 {
  0% { opacity: 0; transform: translate(-50%, -50%); }
  18% { opacity: .95; }
  100% { opacity: 0; transform: translate(calc(-50% - 17px), calc(-50% - 26px)) scale(.4); }
}
.mapStats2 { grid-column: 1; font-size: 12.5px; opacity: .62; font-weight: 700; }

/* ---------- Boutique : vignette réelle + aperçu ---------- */
.themeCard { cursor: pointer; position: relative; }
.thumb { width: 74px; height: 74px; border-radius: 11px; box-shadow: var(--sh-1); }
.tPrev {
  position: absolute; top: 7px; right: 7px;
  font-size: 11px; font-weight: 800; color: var(--ink);
  background: #ffffff14; border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 3px 9px; cursor: pointer; font-family: inherit;
}
.tPrev:active { transform: scale(.92); }

/* ---------- Transitions : fondu-glissement doux partout ---------- */
/* max-height + scroll : en paysage court la carte de victoire mesurait 413 px
   pour 360 px d'écran — le bouton « Level map » tombait hors de l'écran et
   devenait INCLIQUABLE (on ne pouvait plus revenir à la carte). */
.overlay > .card { animation: cardIn .3s var(--ease); max-height: 92vh; overflow-y: auto; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } }
#boardCard.sweep { animation: sweepIn .32s var(--ease); }
@keyframes sweepIn { from { opacity: 0; transform: translateX(30px); } }
/* refus d'une case non adjacente : le PLATEAU tressaille FRANCHEMENT
   (±9 px réels sur 200 ms — l'erreur se voit sans le son) */
#boardCard.shakeX { animation: shakeX .2s linear; }
@keyframes shakeX {
  0%, 100% { transform: none; }
  20% { transform: translateX(-9px); }
  45% { transform: translateX(8px); }
  70% { transform: translateX(-5px); }
  88% { transform: translateX(3px); }
}

/* ---- C20-6 · le top 10 personnel de l'Echelle ---- */
.lbCap {
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim); margin: 10px 0 4px;
}
#lbTop { display: flex; flex-direction: column; gap: 3px; max-height: 200px; overflow-y: auto; }
.lbRow {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: var(--r-sm);
  background: #ffffff0a; font-size: 13px;
}
.lbRow i { font-style: normal; font-weight: 800; color: var(--dim); width: 16px; text-align: right; }
.lbRow b { flex: 1; text-align: left; }
.lbRow span { font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--ink) 72%, transparent); }
.lbRow em { font-style: normal; font-size: 11px; color: var(--dim); }
.lbRow.cur { border: 1px solid color-mix(in srgb, var(--gold, #ffd45e) 45%, transparent); }
.lbRow.empty { justify-content: center; color: var(--dim); }

/* ---- C20-3 · le bandeau de victoire ordinaire ---- */
#winFlash {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 26px; border-radius: var(--r-lg); z-index: 3;
  background: color-mix(in srgb, var(--bg2, #0e0b16) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold, #ffd45e) 40%, transparent);
  box-shadow: 0 8px 40px rgba(0, 0, 0, .45);
  pointer-events: none;   /* il constate — il n'intercepte jamais un tap */
}
#winFlash[hidden] { display: none; }
#winFlash.show { animation: wfPop .32s var(--spring, cubic-bezier(.2, 1.6, .4, 1)); }
@keyframes wfPop { from { opacity: 0; transform: translate(-50%, -50%) scale(.7); } }
#winFlash .wfStars { display: flex; gap: 8px; }
#winFlash .wfStars i { font-style: normal; color: #3a4a6b; }
#winFlash .wfStars i.on { color: var(--gold, #ffd45e); }
#winFlash .wfStars .ic { width: 30px; height: 30px; }
#winFlash .wfCoins { font-size: 17px; font-weight: 800; color: var(--gold, #ffd45e); }
#winFlash .wfCoins .ic { width: 16px; height: 16px; }
#winFlash .wfStreak { font-size: 13px; font-weight: 800; color: var(--gold, #ffd45e); opacity: .85; }
#winFlash .wfStreak .ic { width: 13px; height: 13px; }
/* C20-4 : la série de défis, dans la bannière d'objectif */
#objChal .streakPip { color: var(--gold); }
/* La pastille du Quotidien sans chiffre : un POINT, pour le joueur qui n'a pas
   encore de série. Même couleur, même place — seule la forme change. */
.tabBadge.dot {
  min-width: 9px; width: 9px; height: 9px; padding: 0;
  font-size: 0; line-height: 0; border-radius: 50%;
}
/* C21-3 : la SEULE fois ou la serie se presente, le pip respire pendant que
   la phrase se lit. Trois battements, puis il redevient un compteur calme. */
@keyframes streakHello {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 60%, transparent); }
  35%  { transform: scale(1.14); box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 0%, transparent); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 0%, transparent); }
}
#objChal .streakPip.callout { animation: streakHello 1.05s ease-out 3; }
.endStreakBit { color: var(--gold); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  #objChal .streakPip.callout { animation: none; outline: 2px solid var(--gold); outline-offset: 2px; }
}
/* C20-4 : l'annonce du défi à l'entrée — la même pastille, en doré */
#boardMsg.chal { border-color: color-mix(in srgb, var(--gold, #ffd45e) 55%, transparent); color: var(--gold, #ffd45e); }
/* F5 : les pastilles de FAIT du Quotidien (date, manche). Neutres : l'or de la
   fiche est reserve a ce qui vaut une etoile. */
#objChal .infoPip { color: color-mix(in srgb, var(--ink) 74%, transparent); }
/* F4 : la ligne de bourse des cartes qui affichent un prix. Discrete, mais
   toujours sous le bouton qui demande de payer. */
.purseLine {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--gold, #ffd45e);
  opacity: .85; margin: 8px 0 2px;
}
.purseLine .ic { width: 14px; height: 14px; }
/* F2 : les trois etoiles du bandeau d'entree, serrees comme sur la fiche */
#boardMsg .msgStars { display: inline-flex; gap: 1px; vertical-align: -1px; }
#boardMsg .msgStars .ic { width: 11px; height: 11px; }

/* Décor latéral (paysage) : le motif du monde courant, contraste doux mais VISIBLE */
.sideDecor {
  display: none; position: fixed; top: 50%; transform: translateY(-50%);
  z-index: 0; width: 20vw; max-width: 300px;
  color: var(--accent); opacity: .28; pointer-events: none;
}
#sideL { left: 1.5vw; }
#sideR { right: 1.5vw; top: 58%; } /* ASYMÉTRIE : décalé, réduit, élément en moins */
#sideR svg { transform: scaleX(-1) scale(.8) rotate(-4deg); }
.sideDecor svg { width: 100%; height: auto; }

/* Les chips streak/pièces du HUD sont retirées de la scène : la pastille de
   l'onglet Quotidien porte la streak, la carte (près de la quête) les pièces. */
#streak, #coins { display: none !important; }
.optSndRow { display: flex; justify-content: center; gap: 12px; }

/* ---------- Pastille de streak sur l'onglet Quotidien ---------- */
#tabs button { position: relative; }
.tabBadge {
  position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px;
  font-style: normal; font-size: 10px; font-weight: 800; line-height: 15px;
  color: #241a05; background: var(--gold, #ffd45e); border-radius: var(--r-pill);
  padding: 0 3px; pointer-events: none;
}

/* ---------- GALERIE (C19) ----------
   Six vignettes, chacune l'illustration d'un monde qui se decouvre tuile par
   tuile. C'est la reponse au manque structurel face a un nonogramme : chez eux
   resoudre DESSINE, chez nous resoudre REVELE. */
/* La galerie s'ouvre DEPUIS le menu : elle doit passer au-dessus de lui.
   Sans ca, les deux etant au meme plan, c'est l'ordre du DOM qui tranche et le
   menu gagne — la galerie s'ouvrait invisible. */
#gallery { z-index: 55; }
.galleryCard { width: min(94vw, 620px); max-height: 92vh; overflow-y: auto; }
.galleryTop { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.galleryTitle { margin: 0; font-size: 17px; letter-spacing: .4px; }
.galleryGrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin-top: 10px;
}
.galleryItem {
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--line) 30%, transparent);
  border: 1px solid var(--line);
}
.galleryItem canvas { width: 100%; height: auto; display: block; border-radius: var(--r-sm); }
.galleryCap {
  display: flex; justify-content: space-between; align-items: baseline; gap: 6px;
  font-size: 11.5px; font-weight: 700;
}
.galleryCap b { font-size: 12.5px; }
.galleryCap i { font-style: normal; color: var(--dim); }
.galleryItem.done .galleryCap i { color: var(--gold); }

/* la miniature de la carte de victoire : la tuile qui vient de tomber */
.celMosaic { width: min(64%, 190px); margin: 2px auto 0; }
.celMosaic canvas { width: 100%; height: auto; display: block; border-radius: var(--r-sm); }
.celMosaicCap { font-size: 11px; font-weight: 700; color: var(--dim); margin-top: 3px; }

/* le bouton d'acces, sous la progression du menu */
.menuGallery { width: 100%; }

/* Réglages : deux sections, pour qu'un panneau qui s'allonge reste lisible. */
.optSec {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--dim); text-align: left; margin: 6px 2px -2px;
}
.optVal {
  margin-left: auto; font-size: 12px; font-weight: 800;
  color: var(--gold); letter-spacing: .3px;
}

/* ---------- SECONDE CHANCE (C19) ----------
   Le bouton de pub est ORANGE et primaire : c'est l'action qu'on propose. Le
   refus reste juste a cote, en fantome — jamais cache, jamais retarde. */
.secondCard { width: min(92vw, 380px); }
.btnAd {
  width: 100%;
  background: linear-gradient(180deg, #ffa64d, #f5811f);
  color: #2a1602; border-color: #ffc98a;
}
.btnAd:hover { filter: brightness(1.06); }
.secondCard .endSub { margin-bottom: 2px; }

/* ---------- MENU PRINCIPAL (C19) ----------
   Le refus « overall quality » portait d'abord sur la LISIBILITÉ de l'entrée :
   quatre onglets-icônes n'expliquent pas ce qu'on va jouer. Ici, trois-quatre
   cartes horizontales, chacune un [icône][TITRE][une ligne], et un CONTINUE
   qui domine tout le reste : reprendre est le geste le plus fréquent. */
.menuCard {
  width: min(94vw, 460px); max-height: 92vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px; text-align: left;
}
.menuHead { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.menuWm { display: block; width: min(62vw, 240px); }
.menuWm svg { width: 100%; height: auto; display: block; }
/* LE VOLUME AFFICHÉ : le joueur doit voir tout de suite qu'il en a pour des mois */
.menuVolume {
  font-size: 12.5px; font-weight: 700; letter-spacing: .2px;
  color: color-mix(in srgb, var(--gold) 82%, transparent); text-align: center;
}
/* `.menuCard` en tête : `.btnBig` redéclare `display` plus bas dans la feuille
   et gagnait l'égalité de spécificité par l'ordre — le bouton retombait en
   `block`, et le « ▶ PLAY » se collait à gauche de sa ligne pleine largeur. */
.menuCard .menuPlay {
  width: 100%; display: flex; flex-direction: column; align-items: center;
  gap: 1px; padding: 12px 16px;
}
.menuPlay .mcMain {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 19px; letter-spacing: 1px;
}
.menuPlay .mcSub { font-weight: 700; opacity: .8; font-size: 12px; letter-spacing: .2px; }

.menuModes { display: flex; flex-direction: column; gap: 8px; }
/* LA phrase d'action, sous le bouton : elle dit la regle en une ligne. Un menu
   qui ne dit pas ce qu'on va faire demande au joueur de parier. */
.menuPitch {
  font-size: 12.5px; font-weight: 700; line-height: 1.35;
  color: color-mix(in srgb, var(--ink) 78%, transparent);
  margin: -2px 0 2px;
}
/* ---------- LE CLASSEMENT DE L'ÉCHELLE ----------
   Il n'affiche AUCUN rang, et la mise en page ne fait pas semblant d'en avoir :
   pas de liste, pas de podium vide. Un chiffre — le meilleur score local, le
   seul qui soit vrai — et une ligne d'état honnête sous lui. */
.lbWeek {
  font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--dim); margin-top: -2px;
}
.lbBest {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  margin: 10px 0 6px;
}
.lbBest b { font-size: clamp(26px, 5vh, 34px); line-height: 1; color: var(--gold); font-weight: 800; }
.lbBest span { font-size: 13px; font-weight: 700; color: var(--dim); font-variant-numeric: tabular-nums; }
#lbStatus .ic { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
#lbWhere { margin-top: 6px; }

/* Le pied du menu : regles et galerie cote a cote, discrets. `nowrap` n'est
   pas cosmetique — mesure : sur deux lignes ces deux boutons faisaient 80 px
   et poussaient le bas du menu hors de l'ecran a 320, 375, 667 et 1024. */
/* Le pied peut porter DEUX ou TROIS entrées selon ce que le joueur a débloqué
   (galerie dès la première tuile, classement dès le premier run d'Échelle). Il
   passe donc à la ligne au lieu d'écraser ses libellés : mesuré, trois boutons
   à 320 px ne tiennent pas sur une rangée sans tronquer « How to play ». */
.menuFoot { display: flex; flex-wrap: wrap; gap: 8px; }
.menuFoot > button {
  flex: 1 1 40%; min-width: 0; min-height: 44px; padding: 8px 10px;
  white-space: nowrap; font-size: 12.5px;
}
.modeCard {
  display: grid; grid-template-columns: 42px 1fr 18px; align-items: center; gap: 12px;
  width: 100%; min-height: 62px; padding: 10px 12px; text-align: left;
  border-radius: var(--r-md); cursor: pointer;
  color: var(--ink); font: inherit;
  background: linear-gradient(180deg, var(--cellTop, #2a3350), var(--cellBot, #212a44));
  border: 1px solid var(--line); box-shadow: var(--sh-1);
  transition: transform .12s var(--ease), border-color .12s;
}
.modeCard:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.modeCard:active { transform: translateY(1px); }
.mcIcon {
  width: 42px; height: 42px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.mcIcon .ic { width: 24px; height: 24px; color: var(--accent); }
.mcText { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mcText b { font-size: 15px; font-weight: 800; letter-spacing: .6px; }
/* LA ligne d'explication : c'est elle qui fait comprendre le mode en 2 secondes */
.mcText i {
  font-style: normal; font-size: 12px; font-weight: 600; color: var(--dim);
  line-height: 1.25;
  /* deux lignes autorisées : mesuré, « Timed climb — how far can you go? » ne
     tient pas sur une ligne sous 400 px, et une explication tronquée n'explique
     plus rien. On la laisse passer à la ligne plutôt que de la couper. */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.mcGo { color: var(--dim); font-size: 16px; font-weight: 800; justify-self: end; }
/* La pastille de streak dans une carte de mode : `position: static` la remettait
   dans le flux, où elle héritait de la largeur de la colonne — mesuré, 185 px
   de pilule dorée en travers de la carte « DAILY ». Elle redevient une pastille. */
.modeCard .tabBadge {
  position: static; margin-left: 6px;
  display: inline-flex; width: auto; padding: 0 5px; vertical-align: middle;
}

.menuStats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px;
  font-size: 11.5px; font-weight: 700; color: var(--dim);
}
.menuStats span { display: inline-flex; align-items: center; gap: 4px; }
.menuStats .ic { width: 13px; height: 13px; }
.menuStats b { color: var(--ink); }

/* PORTRAIT ÉTROIT ET COURT (320×568) : avec les descriptions sur deux lignes,
   la carte dépassait le cadre de quelques pixels. On resserre — sans jamais
   toucher aux cibles tactiles, qui restent à 44 px. */
@media (max-width: 360px) {
  /* la fiche de niveau se compacte : sur-titre et titre sur UNE ligne, chips
     serrées — à 320×568 la version haute écrasait le plateau sous 90 % */
  #objBar { padding: 5px 10px; gap: 3px; }
  #objText { flex-direction: row; align-items: baseline; gap: 6px; }
  #objText b { font-size: 13.5px; }
  #objChal .chalPip { padding: 1px 6px 3px; gap: 4px; font-size: 11px; }
  #objChal .pipStars .ic { width: 8px; height: 8px; }
  #objChal { gap: 2px 6px; }
  .menuCard { gap: 8px; padding: 12px; }
  .menuWm { width: min(52vw, 190px); }
  .menuVolume { font-size: 11px; }
  .menuPlay { padding: 9px 12px; }
  .menuModes { gap: 6px; }
  .modeCard { min-height: 54px; padding: 7px 9px; grid-template-columns: 34px 1fr 12px; gap: 9px; }
  .mcIcon { width: 34px; height: 34px; }
  .mcIcon .ic { width: 19px; height: 19px; }
  .mcText b { font-size: 13.5px; }
  .mcText i { font-size: 11px; }
  .menuStats { font-size: 10.5px; gap: 3px 9px; }
}

/* PAYSAGE COURT : le menu doit tenir SANS défilement. Deux colonnes de modes,
   et tout se resserre — mesuré, à 800×360 et 667×375 la colonne unique
   débordait sous le cadre et les deux derniers modes devenaient inatteignables
   sans faire défiler la carte. */
@media (max-height: 700px) and (min-aspect-ratio: 6/5) {
  .menuCard { width: min(94vw, 640px); gap: 8px; padding: 12px 14px; }
  .menuWm { width: min(34vw, 170px); }
  .menuVolume { font-size: 11px; }
  .menuPlay { padding: 8px 14px; }
  .menuModes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .modeCard { min-height: 52px; grid-template-columns: 34px 1fr 12px; gap: 8px; padding: 7px 9px; }
  .mcIcon { width: 34px; height: 34px; }
  .mcIcon .ic { width: 19px; height: 19px; }
  .mcText b { font-size: 13px; }
  .mcText i { font-size: 10.5px; -webkit-line-clamp: 2; }
  .menuStats { font-size: 10.5px; }
}

/* ÉCRAN COURT, tous formats (C19v2) — le menu s'est allongé de la phrase
   d'action et du pied (règles + galerie), et il débordait sous le cadre à
   320×568, 375×667, 1024×600, 800×360 et 667×375 : les deux derniers boutons
   devenaient inatteignables sans deviner qu'on peut faire défiler la carte.
   Un menu qui se cherche est exactement le défaut qu'on répare ici — il tient
   donc EN ENTIER, sans défilement, dès 360 px de haut.
   Déclaré APRÈS `.card` : sans ça le padding de la carte générique gagnait
   l'égalité de spécificité par l'ordre, et le resserrage n'arrivait jamais. */
@media (max-height: 700px) {
  .card.menuCard { gap: 7px; padding: 12px 14px; }
  .menuHead { gap: 4px; }
  .menuWm { width: min(44vw, 176px); }
  .menuVolume { font-size: 11px; }
  .menuPlay { padding: 8px 12px; }
  .menuPlay .mcMain { font-size: 17px; }
  .menuPlay .mcSub { font-size: 11px; }
  .menuPitch { font-size: 11.5px; margin: 0; }
  .menuModes { gap: 6px; }
  .modeCard { min-height: 50px; padding: 6px 10px; grid-template-columns: 34px 1fr 12px; gap: 9px; }
  .mcIcon { width: 34px; height: 34px; }
  .mcIcon .ic { width: 19px; height: 19px; }
  .mcText b { font-size: 13.5px; }
  .mcText i { font-size: 11px; }
  .menuStats { font-size: 10.5px; }
  .menuFoot > button { min-height: 44px; padding: 6px 8px; font-size: 12px; }
}
/* Sous 600 px de haut, la PROGRESSION cède la place : c'est un rappel, pas une
   porte — et une porte qu'on ne voit pas coûte plus cher qu'un rappel absent. */
@media (max-height: 600px) {
  .card.menuCard { gap: 6px; }
  .menuStats { display: none; }
  .modeCard { min-height: 46px; }
}
/* Mobile couché (≤ 430 px de haut) : tout se resserre encore, sauf les cibles
   tactiles, qui restent à 44 px nets. */
@media (max-height: 430px) {
  .card.menuCard { gap: 5px; padding: 9px 12px; }
  .menuWm { width: min(26vw, 132px); }
  .menuPlay { padding: 6px 10px; }
  .menuPlay .mcMain { font-size: 15px; }
  .menuPlay .mcSub { font-size: 10px; }
  .menuPitch { font-size: 10.5px; }
  .modeCard { min-height: 44px; padding: 4px 8px; grid-template-columns: 28px 1fr 10px; gap: 7px; }
  .mcIcon { width: 28px; height: 28px; }
  .mcIcon .ic { width: 16px; height: 16px; }
  .mcText b { font-size: 12px; }
  .mcText i { font-size: 10px; }
  .menuFoot > button { font-size: 11.5px; padding: 4px 6px; }
}

/* le wordmark du HUD devient le retour au menu — zéro pixel de plus dans une
   barre déjà pleine, et « le logo ramène à l'accueil » est une convention */
/* On ne touche PAS au `display` : ce sont les paliers du logo qui le pilotent
   (≥520 wordmark · 375-519 monogramme · <375 aucun), et un sélecteur d'id
   l'emporterait sur eux — mesuré, ça faisait apparaître les deux logos à la
   fois et étranglait les onglets à 10 px. On ne remet à zéro que le costume
   de bouton. */
#btnHome, #btnHomeS {
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  flex: 0 0 auto; line-height: 0; color: inherit; font: inherit;
}

/* ---------- Mouvement réduit : tout s'assagit ---------- */
@media (prefers-reduced-motion: reduce) {
  .overlay > .card, #boardCard.sweep, .rays, .coinFloat, .starRow .star.on,
  .node.cur::before, .node.cur::after, #kbHint { animation: none !important; }
  #titleCard { transition: none; }
}

/* ---------- Iconographie propriétaire (SVG inline, currentColor) ---------- */
.ic { display: inline-block; vertical-align: -0.14em; }
.iconBtn .ic { width: 22px; height: 22px; }
/* la COULEUR porte le sens : cœur rouge chaud, pièce or, ampoule jaune, flamme */
.ic-coin { color: var(--gold); }
.ic-flame { color: #ff9d5c; }
#btnHint .ic-bulb { color: var(--gold); }
.h .ic { width: 22px; height: 22px; }
.cardEmoji .ic { width: 46px; height: 46px; }
#streak .ic, #coins .ic { width: 15px; height: 15px; }
.h .ic { width: 22px; height: 22px; }
.retryHeart .ic { width: 44px; height: 44px; }
.btn2 .ic, .btnBig .ic, .btnGhost .ic, .headBtn .ic { width: 17px; height: 17px; }
.infoBtn .ic { width: 15px; height: 15px; }
#kbHint .ic { width: 19px; height: 19px; }
.coinFloat .ic { width: 19px; height: 19px; }
.lvlStars .ic, .starRow .ic, .mapStats .ic, .worldName .ic { width: 1em; height: 1em; }
.ns .ic { width: 14px; height: 14px; } /* étoiles des pastilles : lisibles (≥ 14 px) */
/* …et EN LIGNE sous le disque : un 3★ se distingue d'un 1★ d'un coup d'œil */
.node .ns {
  display: flex !important; flex-direction: row; gap: 1px; justify-content: center;
  position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%);
  width: max-content;
}

/* ---------- Carton de titre : voile 1,5 s au-dessus du jeu prêt ---------- */
#titleCard {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: radial-gradient(120% 90% at 50% 30%, var(--bg1), var(--bg0) 78%);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
  cursor: pointer;
}
#titleCard.gone { opacity: 0; transform: scale(1.03); pointer-events: none; }
#wordmark { width: min(80vw, 420px); }
#titleSub {
  color: color-mix(in srgb, var(--ink) 72%, transparent);
  font-size: 17px; font-weight: 700; letter-spacing: 5px; text-transform: uppercase;
}

/* ---------- Bandeau du tutoriel jouable + signature de la carte ---------- */
#tutBar {
  /* DANS le flux, entre la barre haute et le plateau : jamais sur une tuile */
  display: flex; align-items: center; justify-content: center; gap: 10px;
  align-self: center; width: max-content; max-width: 100%;
  background: color-mix(in srgb, var(--bg1) 90%, black); border: 1px solid var(--line);
  color: var(--ink); font-size: 15px; font-weight: 700; padding: 8px 8px 8px 16px;
  border-radius: var(--r-pill); box-shadow: var(--sh-1); white-space: nowrap;
}
#tutBar #tutText { overflow: hidden; text-overflow: ellipsis; }
#tutSkip { width: auto; flex: 0 0 auto; padding: 5px 14px; font-size: 13px; opacity: .75; }
.mapPanel { position: relative; }
/* En-tête de carte EN GRILLE : [wordmark] [Themes/Map] [✕] — AUCUN recouvrement
   possible (plus d'absolus qui se marchent dessus, le bloquant du re-audit) */
/* F1 (audit joueur du 23 aout) : LA CROIX D'UN EN-TETE EST UN ENFANT COMME
   LES AUTRES. Heritee de .cardClose, elle etait posee en ABSOLU : la grille
   ne lui reservait aucune colonne. La carte d'Aventure s'en tirait par
   accident (elle a un bouton de plus, qui occupait la place), la boutique
   non : la croix se posait PAR-DESSUS le mot « Map ». Mesure sur douze
   formats : 36x40 px de recouvrement en portrait, 18x36 en paysage court,
   34x30 sur desktop, et elementFromPoint donnait la croix a chaque fois.
   Deux corrections, pas une : la croix rentre dans le flux, et les colonnes
   sont AUTO-GENEREES pour que le nombre de boutons cesse de compter. */
#mapTop {
  display: flex; align-items: center; gap: 8px; padding: 2px 2px 10px;
}
/* Le wordmark pousse tout le reste a droite : plus aucune colonne a compter,
   donc plus aucun en-tete a recompter quand on ajoute ou retire un bouton. */
#mapTop .wmMini { margin-right: auto; }
#mapTop .cardClose { position: static; top: auto; right: auto; flex: 0 0 auto; }
#mapTop .headBtn { flex: 0 0 auto; }

/* ---------- Les règles, consultables à tout moment ---------- */
.ruleList { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 12px; text-align: left; }
.ruleRow { display: flex; align-items: center; gap: 12px; }
.ruleGrid { width: 84px; height: auto; flex: 0 0 auto; }
.ruleRow b { display: block; font-size: 14px; }
.ruleRow span { display: block; font-size: 12.5px; color: color-mix(in srgb, var(--ink) 62%, transparent); }
.ruleStars { display: flex; gap: 8px; margin-bottom: 12px; }
.ruleStar {
  flex: 1 1 0; min-width: 0; text-align: center;
  background: #ffffff0d; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 4px;
}
.ruleStar .ic { width: 16px; height: 16px; color: var(--gold); }
.ruleStar b { display: block; font-size: 12.5px; }
.ruleStar span { display: block; font-size: 10.5px; color: color-mix(in srgb, var(--ink) 58%, transparent); }
#mapTop .wmMini { position: static; }
.mapClose { min-width: 42px; height: 42px; }
.wmMini {
  position: absolute; top: 10px; right: 14px; z-index: 2;
  font-weight: 900; font-size: 12px; letter-spacing: 3px;
  color: color-mix(in srgb, var(--ink) 38%, transparent);
  pointer-events: none;
}

/* Aide desktop « ⌨ or 🖱 » : une fois, jamais bloquante (pointer-events none) */
/* L'aide clavier vit DANS LE FLUX (comme le bandeau de tutoriel) : flottante,
   elle retombait en plein milieu de la grille en paysage court. */
#kbHint {
  align-self: center; width: max-content; max-width: 100%;
  display: flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--bg1) 88%, black); border: 1px solid var(--line);
  color: var(--ink); font-size: 16px; font-weight: 700; padding: 10px 18px;
  border-radius: var(--r-pill); box-shadow: var(--sh-2);
  pointer-events: none; z-index: 30; white-space: nowrap;
  animation: kbIn .5s var(--spring);
}
#kbHint span { font-size: 20px; }
#kbHint i { font-style: normal; font-size: 13px; color: color-mix(in srgb, var(--ink) 55%, transparent); }
@keyframes kbIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } }

/* Options (⚙) : rangée réglage + interrupteur — même langage que les .btn2 */
.optRow { display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: left; }
.tog {
  flex: 0 0 auto; width: 44px; height: 26px; border-radius: var(--r-pill);
  background: #ffffff22; position: relative; transition: background .25s var(--ease);
}
.tog::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--ink); transition: transform .25s var(--spring);
}
.optRow[aria-pressed="true"] .tog { background: var(--accent); }
.optRow[aria-pressed="true"] .tog::after { transform: translateX(18px); }

/* Chiffre flottant 🪙 : gain de pièces, dans TOUS les modes. Au-dessus des
   cartes de fin (le crédit part souvent au moment où la carte s'affiche). */
.coinFloat {
  position: absolute; left: calc(50% + var(--fx, 0px)); top: 34%;
  transform: translateX(-50%);
  z-index: 60; pointer-events: none; white-space: nowrap;
  font-size: 22px; font-weight: 800; color: #ffd45e;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .55);
  animation: coinFloat 1.5s var(--ease) forwards;
}
@keyframes coinFloat {
  0%   { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.8); }
  16%  { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.08); }
  30%  { transform: translateX(-50%) translateY(-6px) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-54px) scale(.94); }
}

/* ---------- Paysage (les 5 tailles d'iframe CrazyGames) ---------- */
/* (Le bloc paysage vit désormais en FIN de feuille : base d'abord, @media
   après — même spécificité, c'est l'ordre qui départage.) */

/* ---------- Aventure : HUD, carte de progression, étoiles ---------- */
#coins { font-size: 15px; color: var(--gold); font-weight: 700; }
#coins[hidden] { display: none; }
.lvlBadge { font-size: 14px; font-weight: 800; color: var(--ink); letter-spacing: .02em; white-space: nowrap; }
/* Les 3 créneaux du HUD : EN LIGNE partout (même à 320 px), jamais empilés —
   le défaut corrigé sur les pastilles de la carte était revenu ici. */
.lvlStars {
  display: flex; flex-direction: row; flex-shrink: 0; flex-wrap: nowrap;
  align-items: center; gap: 2px; white-space: nowrap;
  font-size: 13px; color: var(--gold); margin-left: 6px;
}
.lvlStars i { display: inline-flex; color: #38486b; font-style: normal; } /* éteintes */
/* (l'ancien bloc .starRow/.starPop vivait ici et écrasait les créneaux C10 —
   même spécificité, déclaré plus bas : supprimé, la version C10 fait foi.) */

/* .card.mapPanel : double sélecteur VOLONTAIRE — .card est déclaré plus bas
   dans le fichier et écraserait padding/text-align/overflow à spécificité égale. */
.card.mapPanel {
  width: min(94vw, 460px); height: 88vh; max-height: 88vh;
  padding: 0; overflow: hidden; text-align: left;
  display: flex; flex-direction: column;
}
/* En-tête : le bouton est DANS LE FLUX (une grille 2 colonnes) — en absolu il
   recouvrait le libellé de quête dès qu'il était un peu long. */
#mapHead {
  padding: 14px 16px 12px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg1) 88%, white 6%);
  position: sticky; top: 0; z-index: 2;
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  column-gap: 10px; row-gap: 4px;
}
#mapHead .mapQuest { grid-column: 1; min-width: 0; }
#mapHead .mapStats { grid-column: 1; min-width: 0; }
.headBtn {
  grid-column: 2; grid-row: 1 / span 2; justify-self: end; white-space: nowrap;
  padding: 8px 12px; border-radius: var(--r-pill);
  background: #ffffff14; border: 1px solid var(--line); color: var(--ink);
  font-family: inherit; font-size: 12.5px; font-weight: 800;
  cursor: pointer; touch-action: manipulation;
  transition: transform var(--t-mid) var(--spring), background var(--t-fast) var(--ease);
}
.headBtn:active { transform: scale(.93); background: #ffffff22; }

/* ——— Écran Thèmes : une vignette = un aperçu réel de la palette ——— */
.themeGrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 16px 18px 8px; }
.themeCard {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  padding: 10px; border-radius: var(--r-md);
  background: #ffffff0c; border: 1px solid var(--line); color: var(--ink);
  font-family: inherit; cursor: pointer; touch-action: manipulation; text-align: left;
  transition: transform var(--t-mid) var(--spring), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  box-shadow: var(--sh-1);
}
.themeCard:active { transform: scale(.96); }
.themeCard.equipped { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.themeCard.poor { opacity: .55; }
.swatch {
  position: relative; height: 62px; border-radius: var(--r-sm); overflow: hidden;
  display: flex; align-items: flex-end; gap: 5px; padding: 8px;
  border: 1px solid rgba(255, 255, 255, .08);
}
.swatch i { flex: 1; height: 20px; border-radius: 6px; display: block; }
.swatch.auto { background: linear-gradient(160deg, #1a1526, #0d2439 55%, #1d0f30); }
.swatch.auto i:nth-child(1) { background: #ffb37a; }
.swatch.auto i:nth-child(2) { background: #66c8ff; }
.swatch.auto i:nth-child(3) { background: #ff5fd2; }
.tName { font-size: 14.5px; font-weight: 800; }

/* ---- Boutique de style (rubans + célébrations) ---- */
.shopHead {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim); padding: 18px 18px 0;
}
.shopHead .ic { width: 15px; height: 15px; }
.swatch.trailSw { height: 20px; border-radius: 6px; display: block; }
.swatch.burstSw { height: 24px; display: flex; align-items: center; justify-content: center; }
.swatch.burstSw svg { width: 40px; height: 22px; }
.tBlurb { font-size: 11px; color: color-mix(in srgb, var(--ink) 48%, transparent); line-height: 1.3; }
/* thémé : --dim est une valeur fixe que le thème ne réécrit pas */
.tState { font-size: 12px; font-weight: 700; color: color-mix(in srgb, var(--ink) 62%, transparent); }
.themeCard.equipped .tState { color: var(--accent); }
.mapQuest { font-size: 15px; font-weight: 800; color: var(--ink); }
.mapStats { font-size: 13px; font-weight: 700; color: var(--dim); margin-top: 5px; }
#mapScroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0 26px; -webkit-overflow-scrolling: touch; }
#mapScroll::-webkit-scrollbar { width: 6px; }
#mapScroll::-webkit-scrollbar-thumb { background: #3b4d75; border-radius: 3px; }
#mapScroll::-webkit-scrollbar-track { background: transparent; }
.worldBlock { padding: 6px 0 2px; }
.worldName {
  font-size: 13px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--w-accent); padding: 14px 18px 4px;
}
.worldName small { color: var(--dim); letter-spacing: .04em; font-weight: 700; }
.pathWrap { position: relative; height: calc(20 * 54px + 16px); }
.node {
  position: absolute; transform: translateX(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--w-cell); border: 2px solid #ffffff1f; color: var(--ink);
  font-family: inherit; font-size: 15px; font-weight: 800;
  cursor: pointer; touch-action: manipulation;
  display: grid; place-items: center;
  box-shadow: var(--sh-1);
  transition: transform var(--t-mid) var(--spring);
}
.node.done { background: var(--w-accent); color: #16203a; border-color: transparent; }
.node.cur { border-color: var(--gold); box-shadow: 0 0 0 4px #ffd45e33, var(--sh-1); animation: nodePulse 1.5s ease-in-out infinite; }
@keyframes nodePulse { 50% { transform: translateX(-50%) scale(1.12); } }
.node.locked { background: #1a2338; color: #55658a; border-color: #ffffff10; cursor: default; }
.node .ns {
  position: absolute; bottom: -11px; left: 50%; transform: translateX(-50%);
  font-size: 9px; color: var(--gold); letter-spacing: -1px; font-style: normal;
}

/* ---------- Tutoriel (une main qui trace) ---------- */
#tut {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  pointer-events: none; opacity: 1; transition: opacity .4s;
}
#tut[hidden] { display: none; }
#tut.fade { opacity: 0; }
.tGrid { position: relative; width: 210px; height: 140px; filter: drop-shadow(0 12px 24px rgba(0,0,0,.5)); }
/* Les tuiles du tutoriel doivent être LES MÊMES que celles du plateau :
   même rayon relatif (0,2 × côté), même dégradé de thème, même ombre. */
.tCell {
  position: absolute; width: 58px; height: 58px; border-radius: 11.6px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bg1) 70%, white 12%),
    color-mix(in srgb, var(--bg1) 88%, black 6%));
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: var(--sh-1);
  display: grid; place-items: center; font-size: 24px; font-weight: 800; color: var(--ink);
}
.tCell.c1 { left: 0; top: 6px; animation: tLight 1.9s infinite; }
.tCell.c2 { left: 70px; top: 6px; animation: tLight 1.9s .3s infinite; }
.tCell.c3 { left: 70px; top: 76px; animation: tLight 1.9s .6s infinite; }
@keyframes tLight {
  0%, 15% { filter: none; color: var(--ink); }
  25%, 70% { filter: none; background: var(--accent); color: #182038; transform: scale(1.06); }
  85%, 100% { color: var(--ink); transform: scale(1); }
}
.tHand {
  position: absolute; left: 12px; top: 26px; font-size: 40px;
  animation: tMove 1.9s infinite; transform-origin: 30% 20%;
}
@keyframes tMove {
  0% { transform: translate(0, 26px) scale(1.15); opacity: 0; }
  12% { transform: translate(0, 14px) scale(1); opacity: 1; }
  45% { transform: translate(70px, 14px) scale(1); }
  75% { transform: translate(70px, 84px) scale(1); opacity: 1; }
  92%, 100% { transform: translate(70px, 96px) scale(1.15); opacity: 0; }
}

/* La récompense BAT au lieu de se compter depuis zéro : la valeur finale est
   affichée dès la première frame (C19v2). */
#coinTick { display: inline-block; }
#coinTick.pulse { animation: coinBeat .28s var(--spring); }
@keyframes coinBeat {
  0% { transform: scale(1); }
  45% { transform: scale(1.28); color: var(--gold); }
  100% { transform: scale(1); }
}

/* Le ✕ des panneaux : une modale sans sortie VISIBLE se referme au hasard —
   l'audit a vu des joueurs taper le fond de l'écran en espérant. */
.cardClose {
  position: absolute; top: 8px; right: 8px;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: #ffffff10; border: 1px solid var(--line); color: var(--ink);
  cursor: pointer; font: inherit; touch-action: manipulation;
}
.cardClose:active { transform: scale(.92); }
.cardClose .ic { width: 20px; height: 20px; }
/* « Game paused » : le chrono s'arrête vraiment, et on le DIT. */
.optPaused {
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); margin: -4px 0 2px;
}

/* ---------- Le PIED des cartes de fin (C19v2) ----------
   Une carte de fin recouvre les onglets du HUD. Sans cette rangée, la seule
   sortie était le bouton qu'on avait bien voulu mettre — l'audit a vu des
   joueurs coincés sur « Daily complete! » sans moyen d'aller ailleurs. */
.endNav {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.endNav .endHome {
  min-height: 44px; border-radius: var(--r-sm); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 800; color: var(--ink);
  background: #ffffff10; border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.endModes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.endModes button {
  min-height: 44px; padding: 4px 2px; border-radius: var(--r-sm); cursor: pointer;
  font: inherit; color: var(--dim); background: transparent; border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.endModes button .ic { width: 18px; height: 18px; color: var(--accent); }
.endModes button span { font-size: 8.5px; font-weight: 800; letter-spacing: .3px; }
.endNav button:active { transform: scale(.95); }
@media (max-height: 480px) {
  .endNav { margin-top: 8px; padding-top: 7px; gap: 6px; }
}

/* ---------- Overlays (pop-up indices, écrans de fin) ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(5, 9, 16, .62);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  opacity: 1; transition: opacity .25s;
}
.overlay[hidden] { display: none; }
.card {
  position: relative;
  width: min(88vw, 360px); max-height: 92vh; overflow: hidden auto;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bg1) 92%, white 8%), var(--bg1));
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: var(--r-lg); padding: 22px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  animation: cardIn .5s var(--spring);
  box-shadow: var(--sh-3);
}
@keyframes cardIn { 0% { transform: scale(.82) translateY(14px); opacity: 0; } 100% { transform: scale(1) translateY(0); opacity: 1; } }
.cardEmoji { font-size: 44px; line-height: 1.1; }
.gameName { color: var(--dim); font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; margin-top: 6px; }
.infoBtn {
  position: absolute; top: 10px; right: 12px;
  width: 30px; height: 30px; border: none; border-radius: 50%;
  background: transparent; color: var(--dim); font-size: 17px; font-family: inherit;
  cursor: pointer; touch-action: manipulation; opacity: .7;
}
.infoBtn:active { opacity: 1; }
.legalLink { color: var(--cold); font-weight: 700; text-decoration: none; }
.legalLink:active { color: var(--gold); }
.card h2 { font-size: 22px; font-weight: 800; margin: 8px 0 16px; }
.note { color: var(--dim); font-size: 13.5px; font-weight: 600; margin-top: 14px; }

/* Les DEUX boutons du pop-up d'indices : rigoureusement identiques. */
.btn2 {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 56px; margin-top: 10px;
  padding: 0 12px; border-radius: var(--r-md);
  background: #ffffff14; border: 1px solid rgba(255, 255, 255, .12);
  color: var(--ink); font-family: inherit; font-size: 17px; font-weight: 800;
  cursor: pointer; touch-action: manipulation;
  transition: transform var(--t-mid) var(--spring), background var(--t-fast) var(--ease);
  box-shadow: var(--sh-1);
}
.btn2:active { transform: scale(.95); background: #ffffff22; }
.btn2[disabled] { opacity: .55; pointer-events: none; }
/* display:flex avale les espaces inter-nœuds : « +3 hints(300) » sans ce gap */
.btn2 small { margin-left: .4em; opacity: .8; font-size: .82em; }

/* Boutons des écrans de fin */
.btnBig {
  display: block; width: 100%; margin-top: 12px;
  padding: 16px 12px; border-radius: var(--r-md); border: none;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 82%, white), var(--accent));
  color: #241a05;
  font-family: inherit; font-size: 19px; font-weight: 900; letter-spacing: .3px;
  cursor: pointer; touch-action: manipulation;
  transition: transform var(--t-mid) var(--spring), filter var(--t-fast) var(--ease);
  box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--accent) 60%, transparent);
}
.btnBig:active { transform: scale(.95); filter: brightness(1.06); }
/* « Replay tutorial » est une option de service : plus discrète que la sortie. */
.btnGhost {
  display: block; width: 100%; margin-top: 10px;
  padding: 13px 12px; border-radius: var(--r-md);
  background: transparent; border: 1px solid rgba(255, 255, 255, .16);
  color: var(--ink); font-family: inherit; font-size: 16px; font-weight: 800;
  cursor: pointer; touch-action: manipulation;
  transition: transform var(--t-mid) var(--spring), background var(--t-fast) var(--ease);
}
.btnGhost:active { transform: scale(.95); background: #ffffff12; }

/* P1-11 · LA PORTE DE SERVICE. « Replay tutorial » est utile, pas central :
   il doit rester trouvable sans disputer la ligne au « Let's go ». Déclaré
   APRÈS .btnGhost — même spécificité, l'ordre décide, et déclaré avant il se
   faisait reprendre sa taille de police par la classe de base. */
.rulesTut {
  width: auto; margin: 10px auto 0; padding: 9px 16px;
  font-size: 13px; opacity: .72; border-color: transparent;
}
.rulesTut:hover { opacity: 1; }

.endTime { font-size: 42px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 2px 0 6px; }
.endChips { display: flex; justify-content: center; gap: 8px; margin: 10px 0 4px; font-size: 21px; }
.endChips span {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: #101a2e; border: 1px solid var(--line); border-radius: 12px;
}
.endChips span.clean { background: #2c2410; border-color: #ffd45e55; }
.endStreak { color: var(--gold); font-weight: 800; font-size: 17px; margin: 8px 0 2px; }
.endSub { color: var(--dim); font-size: 13.5px; font-weight: 600; margin-top: 12px; }
.endBig { font-size: 56px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
/* C21-4 : les trois chiffres du bilan d'Infini. Une rangee lisible a 800x450
   comme a 1920x1080 : le nombre porte, le libelle explique dessous. */
/* C21-5 : les deux notes de regle de l'Echelle (carte d'entree, classement) */
.lbRule, .ladderRule { font-size: 12px; line-height: 1.45; opacity: .8; margin: 6px 0 10px; }
.ladderBestLine {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--gold); font-weight: 800; font-size: 15px; margin: 10px 0 2px;
}
.ladderBestLine .ic { width: 16px; height: 16px; }
.endStats {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px;
  margin: 14px 0 2px;
}
.endStats span { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 74px; }
.endStats b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.endStats u {
  text-decoration: none; font-size: 11px; font-weight: 700; color: var(--dim);
  letter-spacing: .06em; text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .tHand, .tCell { animation-duration: 3.5s; }
}


/* =====================================================================
   PAYSAGE — déclaré EN DERNIER : ces overrides partagent la spécificité
   des règles de base, seul l'ordre de la feuille les fait gagner.
   Le layout reste la MÊME colonne (barre haute · plateau · barre basse) :
   #boardWrap tient sa hauteur du flex de #stage (height:100%), donc le
   canvas mesure un conteneur RÉEL — plus jamais le plancher de 180 px.
   ===================================================================== */
@media (min-aspect-ratio: 6/5) {
  /* La scène ne se borne PLUS à la taille du plateau : en paysage court,
     96vh vaut 345 px et les barres étaient aussi étroites que la grille — d'où
     le compteur qui chevauchait le chrono. Le plateau reste borné par la
     hauteur (il se centre tout seul dans #boardWrap) ; seules les barres
     gagnent de l'air. */
  #stage { width: var(--stage-w); }
  #hud, #subBar { min-height: 48px; }
  .sideDecor { display: block; }
  /* la bannière d'objectif habite la BANDE LATÉRALE gauche : le plateau
     garde toute sa hauteur, et la zone morte raconte le niveau */
  #objBar {
    position: fixed; left: 1.5vw; top: 84px; z-index: 2;
    width: 19vw; max-width: 280px;
    flex-direction: column; align-items: flex-start; gap: 8px;
  }
  /* colonne latérale étroite : l'alignement à gauche y est le bon */
  #objL1, #objL2, #objChal { justify-content: flex-start; }
  #parBar { max-width: none; width: 100%; margin-left: 0; }
  #objMotif { display: none; } /* le décor latéral porte déjà le motif */
  /* LA BARRE DU BAS HABITE LA BANDE DROITE (session 2 : « mes informations
     sont dans trois coins », « je compte huit zones d'interface »). Elle
     tenait toute la largeur sous le plateau — donc le chrono au centre-bas,
     un troisième coin — et elle prenait cinquante pixels de HAUTEUR, le
     budget rare en paysage. Passée en colonne à droite, elle rend cette
     hauteur au plateau et referme le troisième coin : progression, chrono et
     actions se lisent d'un seul regard, en face de la fiche et de la cible.
     Il reste quatre zones : la barre du haut, la colonne gauche (niveau +
     cible), le plateau, la colonne droite (progression + chrono + actions). */
  #subBar {
    position: fixed; right: 6px; bottom: 12px; z-index: 2;
    width: min(22vw, calc((100vw - var(--stage-w)) / 2 - 14px));
    display: flex; flex-direction: column; align-items: stretch; gap: 10px;
    min-height: 0; padding: 0;
  }
  #subLeft, #timerZone, #subRight { justify-content: center; }
  /* Dans une bande de 96 px, trois boutons cote a cote descendent sous les
     44 px reglementaires. Ils passent donc a la ligne plutot que de retrecir :
     la cible tactile ne se negocie pas, la mise en page si. */
  #subRight { gap: 8px; flex-wrap: wrap; justify-content: center; }
  #subRight .iconBtn { flex: 0 0 auto; min-width: 44px; min-height: 44px; }
  /* la bande latérale a toute la hauteur voulue : le défi s'y déploie sans
     jamais être rogné, quel que soit le nombre de conditions — et le PAR
     passe SOUS lui (côte à côte, « chain of ≥ 7 tiles » était coupé). */
  /* La bande ne doit JAMAIS mordre sur la scène : sa largeur est ce qui reste
     à gauche du stage, moins la marge — calculé, pas deviné. */
  #objBar {
    left: 6px;
    width: min(22vw, calc((100vw - var(--stage-w)) / 2 - 14px));
  }
  /* LES DEUX PANNEAUX HABITENT LA MÊME BANDE (session 2 du test joueur).
     La cible était en miroir à DROITE : « les objectifs à l'extrême gauche,
     la cible à l'extrême droite, le chronomètre en bas au centre — mes yeux
     font l'aller-retour sur toute la largeur à chaque coup ». Mesuré à
     1136×639 : 876 px entre les deux panneaux.
     Ils sont désormais empilés à GAUCHE, la cible collée SOUS la fiche de
     niveau. `--objH` est publiée par updateObjBar : la fiche change de hauteur
     avec le nombre de conditions, et deviner cette hauteur en CSS finirait par
     les faire se chevaucher. Quand la fiche est absente (Échelle, Infini), la
     variable vaut 0 et la cible remonte d'elle-même. */
  #goalBar {
    position: fixed; left: 6px; right: auto;
    top: calc(84px + var(--objH, 0px)); z-index: 2;
    width: min(22vw, calc((100vw - var(--stage-w)) / 2 - 14px));
    align-items: flex-start; gap: 4px;
    padding: 10px 12px;
    background: linear-gradient(180deg, var(--cellTop, #3c3350), var(--cellBot, #2b2440));
    border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--sh-1);
  }
  #goalMain { flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; }
  #goalTarget { font-size: clamp(34px, 6.5vh, 52px); }
  /* LE REFUS S'AFFICHE PRÈS DE L'ACTION. En portrait la ligne est déjà collée
     au plateau ; en paysage elle suivait la cible dans la bande latérale
     DROITE — à ~500 px du doigt, hors du champ de vision de quelqu'un qui
     regarde sa grille. Elle quitte donc la bande et vient se poser en pastille
     juste au-dessus du plateau, centrée sur la scène. Elle ne réserve rien
     quand elle est vide : pas de fond, pas de hauteur. */
  /* LE MESSAGE NE SE POSE JAMAIS SUR LES TUILES (audit final, élargi). La
     pastille centrée à `top: 54px` mordait la première rangée : en paysage
     COURT il ne reste que trois pixels entre les onglets et le plateau, et
     même en paysage haut (1216×684, 1920×1080) elle recouvrait les onglets
     ET le bord du plateau. Le plateau est CARRÉ dans une scène plus large :
     la bande latérale gauche est libre sur toute sa hauteur, sous la fiche de
     niveau. La pastille s'y installe — près du regard, jamais dessus.
     (Mesuré sur les treize formats paysage de la matrice.) */
  #boardMsg {
    position: fixed; left: 6px; bottom: 12px; top: auto; transform: none;
    width: min(22vw, calc((100vw - var(--stage-w)) / 2 - 12px));
    min-height: 0; text-align: left; z-index: 3;
    padding: 0; border-radius: var(--r-pill); line-height: 1.5;
    background: transparent; box-shadow: none;
  }
  #boardMsg.show {
    padding: 5px 14px;
    background: color-mix(in srgb, var(--bg1) 94%, black);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .5), 0 0 0 1px var(--line);
  }
  #objL1, #objL2 { flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; }
  #objChal { white-space: normal; max-height: none; flex-direction: column; align-items: flex-start; gap: 4px; }
  /* C21 : le pire cas de defi a grandi (« ≤ 50s » + « No mistakes » +
     « Chain ≥ 6 »). Dans une colonne a align-items:flex-start, un enfant se
     dimensionne sur son CONTENU : la liste des conditions debordait donc la
     fiche de niveau PAR LA DROITE, sans jamais paraitre rognee (scrollWidth
     restait egal a clientWidth). On la rattache a la largeur de sa bande.
     Mesure : pastille « No mistakes » a 119 px pour une fiche finissant a 112. */
  #objChal { max-width: 100%; min-width: 0; box-sizing: border-box; }
  /* la bande est ÉTROITE (elle ne prend que la marge à gauche de la scène) :
     une condition longue s'y écrit sur deux lignes plutôt que d'être rognée. */
  #objChal .chalPip { white-space: normal; align-items: flex-start; max-width: 100%; box-sizing: border-box; }
  /* la pastille est une RANGÉE : icone + texte. Le texte ne descend pas sous
     son mot le plus long (« mistakes », 48 px) et les icones ne se compriment
     pas : dans une bande de 76 px la rangée débordait sous son propre
     overflow:hidden. On l'autorise à passer à la ligne : icone dessus, texte
     dessous, rien de rogné. */
  #objChal .chalPip { flex-wrap: wrap; }
  #objChal .chalPip b { min-width: 0; }
  #objChal .chalPip .ic { margin-top: 2px; flex: 0 0 auto; }
  #objBar > *, #objL1, #objL2 { max-width: 100%; min-width: 0; }
  /* panneaux plein écran : la boutique tenait à 2/7 vignettes */
  .card.mapPanel { width: min(94vw, 620px); height: 94vh; max-height: 94vh; }
  .themeGrid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- PALIERS DE LA BARRE HAUTE (portrait) ----------
   Le budget est arithmétique : logo + 4 onglets + 3 cœurs + ⚙ + gaps. Chaque
   palier retire l'élément le MOINS porteur pour que les onglets gardent leur
   cible tactile — jamais l'inverse (c'était le défaut : des puces de 31 px
   avec un libellé illisible).
     ≥ 520 : wordmark complet (132 px) + libellés
     375-519 : MONOGRAMME + libellés (onglets ≥ 44)
     360-374 : monogramme + ICÔNE SEULE
     < 360 : plus de logo dans le HUD + icône seule (onglets 44) */
/* En PORTRAIT le plateau est TOUJOURS borné par la largeur — mesuré de 320 à
   720 px, la hauteur disponible reste largement supérieure. Chaque pixel de
   padding lui est donc pris directement. Le padding compact ne s'appliquait
   qu'en dessous de 519 px : entre 520 et 720 — dont le 2:3 EXIGÉ par
   CrazyGames pour la vidéo verticale — le plateau retombait à 88,9 % de la
   largeur au lieu des 90 % que la matrice garantit. */
@media (max-aspect-ratio: 6/5) {
  #boardCard { padding: 6px; }
}

@media (max-width: 519px) and (max-aspect-ratio: 6/5) {
  .hudWm { display: none; }
  .hudWmS { display: block; }
  #stage { padding-left: 4px; padding-right: 4px; } /* plateau à ~96 % de large */
  #boardCard { padding: 6px; }
  .tabLbl { letter-spacing: -0.2px; font-size: 9.5px; }
  /* budget mesuré à 375 px : 8(pad) + 38(mono) + 8 + tabs + 8 + 70(cœurs)
     + 6 + 44(⚙) — les gaps sont ce qu'on rogne en dernier, jamais les cibles */
  #tabs { gap: 4px; }
  #hudRight { gap: 6px; }
  #hearts { gap: 3px; }
  .iconBtn { min-width: 44px; height: 46px; padding: 0 8px; }
  /* les actions doivent tenir dans LEUR piste (les deux 1fr sont égales) —
     mesuré : à 375 px, 42 px de puce et 22 px d'icône passent encore, donc on
     ne rabote pas les cibles tactiles avant d'y être obligé. */
  #subRight { gap: 5px; }
  #subRight .iconBtn { min-width: 42px; padding: 0 6px; gap: 3px; }
}
/* 360-374 : les libellés s'effacent (icône seule), mais le MONOGRAMME reste —
   réduit à sa tuile-C il ne coûte que 32 px. MESURÉ : sous 360 px il ne tient
   plus sans faire tomber les puces sous 44 px (budget court de 25 px à 320) —
   la cible tactile passe avant la marque, le logo s'efface donc là. */
@media (max-width: 374px) and (max-aspect-ratio: 6/5) {
  .hudWmS { width: 32px; }
  /* P2-6 (audit du 23 aout) · LES ONGLETS GARDENT LEUR NOM. Sous 375 px, les
     libelles disparaissaient et il restait quatre pictogrammes : rien ne
     distingue « Endless » de « Ladder » quand on decouvre le jeu. Le budget
     etait pense en LARGEUR, mais le libelle ne coute pas de largeur — il
     s'empile sous l'icone, et la puce fait 46 px de haut pour une icone de
     20. On rapetisse donc l'icone et le texte au lieu de supprimer le mot :
     20 + 2 + 9 = 31 px dans 46, et 44 px NETS de cible tactile intacts. */
  .tabLbl { display: block; font-size: 7.5px; letter-spacing: .02em; line-height: 1.1; }
  .h .ic { width: 18px; height: 18px; }
  #hearts { gap: 3px; }
  #tabs { gap: 4px; }
  /* 44 px NETS : c'est le plancher, on rogne les gaps et le logo avant lui */
  #tabs button { width: 44px; min-width: 44px; height: 46px; padding: 0; gap: 1px; flex: 0 0 auto; }
  #tabs .ic { width: 20px; height: 20px; }
  .iconBtn { min-width: 44px; height: 46px; padding: 0 5px; }
  #hudRight { gap: 5px; }
  .iconBtn .ic { width: 20px; height: 20px; }
  /* la barre basse aussi : compteur + chrono + actions doivent tenir en 320 */
  #subLeft { gap: 6px; }
  #sumNow { font-size: 18px; }
  #sumTarget { font-size: 11.5px; }
  #goalTarget { font-size: 28px; }
  #goalLbl { font-size: 9.5px; }
  .lvlStars { font-size: 11px; gap: 1px; margin-left: 2px; }
  #timerZone { min-width: 44px; }
  #timerText { font-size: 17px; }
  #subRight { gap: 3px; }
  /* Le portrait etroit garde 38 px : la barre y est une RANGEE pleine largeur
     sous le plateau, et 44 px la font deborder a 320 px. */
  #subRight .iconBtn { min-width: 38px; padding: 0 4px; gap: 2px; }
  #subRight .iconBtn .ic { width: 18px; height: 18px; }
  #subRight .iconBtn b { font-size: 11px; }
  /* La cible prend de la hauteur, et à 320×568 la hauteur est comptée : on la
     rend en resserrant les gouttières et la barre basse, JAMAIS le plateau. */
  #stage { gap: 5px; }
  #subBar { min-height: 50px; }
  #boardMsg { min-height: 14px; line-height: 14px; font-size: 11.5px; }
}
/* (Le palier « paysage très court sans logo » n'a plus lieu d'être : depuis que
   la scène est découplée de la taille du plateau, le monogramme a sa place.) */
/* Carte en portrait : ✕ et « Themes » à ≥ 44 px de côté (46 : marge sous-pixel) */
@media (max-aspect-ratio: 6/5) {
  .mapClose { min-width: 46px; height: 46px; }
  .headBtn { min-height: 46px; }
}

/* Paysage BAS (mobile couché) : barres compactes, chaque pixel va au plateau */
/* PAYSAGE COURT (h ≤ 480) — le bloquant du re-audit : les libellés ne tiennent
   plus, ils étaient tronqués en « dai/dle/dd » sur des puces de 12-19 px.
   Réponse : ICÔNE SEULE, puce carrée de 44 px (cible tactile intacte), et
   chaque pixel de hauteur gratté rendu au plateau. */
@media (min-aspect-ratio: 6/5) and (max-height: 480px) {
  #stage { padding: 2px 8px; gap: 3px; }
  #hud, #subBar { min-height: 44px; }
  /* P2-3 · LES ONGLETS GARDENT LEUR NOM. Ils étaient réduits à quatre icônes
     dès que la fenêtre passait sous 480 px de haut — y compris en 936×416, où
     la largeur ne manque pas. Une icône seule se devine ; un mot se lit. Le
     libellé rétrécit au lieu de disparaître, et il ne part que là où la place
     manque VRAIMENT (bloc étroit plus bas). */
  .tabLbl { font-size: 8.5px; letter-spacing: -0.1px; }
  /* Le stage vaut min(96vh, 56vw) : sous 480 px de haut il ne fait plus que
     ~345-460 px de large — le wordmark complet (132 px) y écrasait les onglets
     à 13 px. Mêmes paliers qu'en portrait étroit. */
  .hudWm { display: none; }
  .hudWmS { display: block; }
  /* largeur AUTO (au lieu de 44 px fixes) : le bouton s'ajuste au mot qu'il
     porte, et garde ses 44 px de cible tactile en hauteur comme en minimum */
  #tabs button { height: 44px; min-width: 44px; width: auto; padding: 0 4px; gap: 1px; }
  #tabs .ic { width: 21px; height: 21px; }
  .iconBtn { min-width: 44px; height: 44px; padding: 0 6px; }
  .iconBtn .ic { width: 20px; height: 20px; }
  #sumNow { font-size: 19px; }
  #sumTarget { font-size: 12px; }
  #boardCard { padding: 4px; }
  #hudRight { gap: 6px; }
  #hearts { gap: 4px; }
  .h .ic { width: 18px; height: 18px; }
  /* la bannière d'objectif est déjà dans la bande latérale en paysage — elle
     y est ÉTROITE (740×360 : 76 px), donc police compacte et padding réduit */
  #objBar { top: 52px; font-size: 11.5px; padding: 6px 8px; }
  /* La cible reste EMPILEE sous la fiche, ici aussi : le bloc paysage court
     redefinissait son top et ramenait les deux panneaux l'un sur l'autre. */
  #goalBar { top: calc(52px + var(--objH, 0px)); padding: 7px 9px; }
  #objChal .ic { width: 10px; height: 10px; }
  /* la carte de victoire tient dans 360 px de haut : contenu compacté */
  .overlay > .card { padding: 12px 16px; gap: 4px; }
  .cardEmoji { display: none; }
  .gameName svg { width: 104px; }
  /* même en paysage court, AUCUN bouton d'overlay ne descend sous 44 px :
     « Level map » y tombait à 40 px, sous le seuil tactile. */
  .btnBig, .btn2, .btnGhost { min-height: 44px; padding: 9px 14px; font-size: 15px; }
  .starRow { gap: 12px; margin: 4px 0 2px; }
  /* En paysage court, #stage vaut min(96vh, 56vw) — à 800×360 il ne fait que
     345 px : la barre basse subit les MÊMES contraintes qu'un portrait étroit
     et doit se comprimer pareil, sinon compteur et chrono se chevauchent. */
  #subLeft { gap: 6px; }
  #sumNow { font-size: 18px; }
  #sumTarget { font-size: 11.5px; }
  #goalTarget { font-size: 28px; }
  #goalLbl { font-size: 9.5px; }
  .lvlStars { font-size: 11px; gap: 1px; margin-left: 2px; }
  #timerZone { min-width: 46px; }
  #timerText { font-size: 16px; }
  /* Les deux pistes 1fr de #subBar sont ÉGALES : les actions doivent tenir
     dans la moitié de l'espace libre, sinon elles débordent sur le chrono.
     À 800×360 le stage ne fait que 345 px — chaque pixel compte. */
  #subRight { gap: 4px; }
  /* 38 px etait le prix a payer quand les trois actions partageaient une
     RANGEE avec le compteur et le chrono. En paysage elles ont desormais leur
     propre COLONNE, avec de la hauteur a revendre : la cible tactile
     reglementaire redevient possible, et elle passe avant la compacite. */
  #subRight .iconBtn { min-width: 44px; min-height: 44px; padding: 0 4px; gap: 3px; }
  #subRight .iconBtn .ic { width: 18px; height: 18px; }
  #subRight .iconBtn b { font-size: 11px; }
}

/* Sous 360 px : plus de logo du tout (mesure : 4 puces de 44 px + 3 cœurs + ⚙
   + 32 px de monogramme = 345 px de besoin pour 320 px disponibles). */
@media (max-width: 359px) and (max-aspect-ratio: 6/5) {
  .hudWmS { display: none; }
}

/* ---------- C15 : conformité CrazyGames ---------- */
/* Le Skip du tutoriel garde une cible tactile réglementaire tant qu'il existe */
#tutSkip { min-height: 44px; opacity: .85; }
/* Indice discret : taper accélère la mise en scène de victoire */
.celHint {
  font-size: 11px; letter-spacing: .5px; text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
  margin: 2px 0 6px; animation: celHintIn .5s var(--ease) .6s backwards;
}
@keyframes celHintIn { from { opacity: 0; } }
/* Requête publicitaire EN VOL : l'UI est gelée, on le montre */
#modal.adPending .card { pointer-events: none; }
#modal.adPending .card::after {
  content: ''; position: absolute; left: 50%; bottom: 14px; width: 22px; height: 22px;
  margin-left: -11px; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--ink) 25%, transparent);
  border-top-color: var(--accent); animation: adSpin .8s linear infinite;
}
@keyframes adSpin { to { transform: rotate(360deg); } }
#modal.adPending .btn2 { opacity: .5; }
@media (prefers-reduced-motion: reduce) { #modal.adPending .card::after { animation: none; } }
