/* Pile Poil : interface du jeu (lot G).
   Composants de la promo Mantan (promo/src/commun.tsx) traduits en em :
   Bulle, Mot, Badge, Pastille, Carte. Fond « Soleil » sous le canvas WebGL
   transparent, écrans titre, jeu, pause, résultat et secours, portrait et
   paysage. Aucun attribut style= dans le HTML (CSP) : ce qui bouge à chaque
   image passe par le CSSOM (el.style.translate, rotate…). */

/* --- polices auto-hébergées (woff2 latin de @fontsource, copiées par le lot J) --- */
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 800;
  font-display: block;
  src: url(/fonts/baloo-2-latin-800.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url(/fonts/baloo-2-latin-700.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 800;
  font-display: block;
  src: url(/fonts/nunito-latin-800.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/nunito-latin-700.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --vert: #16a34a;
  --vert-fonce: #15803d;
  --vert-clair: #22c55e;
  --vert-nuit: #166534;
  --creme: #fffbeb;
  --encre: #1f2937;
  --orange: #f97316;
  --orange-fonce: #ea580c;
  --rouge: #ef4444;
  --bleu: #1d4ed8;
  --ciel: #7dd3fc;
  --soleil: #facc15;
  --pistolet: #374151;
  --titre: 'Baloo 2', sans-serif;
  --texte: 'Nunito', sans-serif;
  --haut-sur: env(safe-area-inset-top, 0px);
  --bas-sur: env(safe-area-inset-bottom, 0px);
  --gauche-sur: env(safe-area-inset-left, 0px);
  --droite-sur: env(safe-area-inset-right, 0px);
  /* 100 px de la maquette portrait 390 × 844 (§4 Cadrage), à l'échelle de
     l'écran. Pas 1 px : Firefox tronque calc(100vw / 390) au 1/60 de pixel
     (59/60 px), soit 14 px d'erreur sur la hauteur ; à 100 px, elle tombe
     sous le 1/60 de pixel. */
  --u: min(calc(100vw / 3.9), calc(100vh / 8.44));
  --h: 100vh;
  color-scheme: light;
}
@supports (height: 100dvh) {
  :root {
    --u: min(calc(100vw / 3.9), calc(100dvh / 8.44));
    --h: 100dvh;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  height: 100%;
  background: var(--creme);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
}
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--texte);
  font-weight: 800;
  color: var(--encre);
  background: var(--creme);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button {
  font: inherit;
  color: inherit;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--bleu);
  outline-offset: 3px;
}

/* --- fond « Soleil » : uni, 20 rayons de 9° tous les 18° à 55 %, fondu radial --- */
.fond {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--creme);
  --rayon: #fde68a;
  --fond-x: 50vw;
  --fond-y: 40vh;
}
.fond[data-variante='vert'] {
  background: var(--vert);
  --rayon: var(--vert-clair);
}
.fond[data-variante='rose'] {
  background: #fff1f2;
  --rayon: #fecaca;
}
.fond[data-variante='ciel'] {
  background: #e0f2fe;
  --rayon: #bae6fd;
}
.fond[data-variante='aube'] {
  background: linear-gradient(180deg, #fed7aa 0%, #fef3c7 45%, #fffbeb 100%);
}
.fond-rayons {
  /* diamètre 2 × 1,169 × min(L, H) : au-delà, le fondu est nul */
  --d: calc(2.338 * min(100vw, 100vh));
  position: absolute;
  left: calc(var(--d) / -2);
  top: calc(var(--d) / -2);
  width: var(--d);
  height: var(--d);
  translate: var(--fond-x) var(--fond-y);
  background: repeating-conic-gradient(var(--rayon) 0deg 9deg, transparent 9deg 18deg);
  opacity: 0.55;
  /* plein jusqu'à 0,283 × min(L, H), soit 24,21 % du rayon, nul au bord */
  -webkit-mask-image: radial-gradient(circle closest-side, #000 24.21%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 24.21%, transparent 100%);
  animation: fond-tourne 34.2857s linear infinite;
  will-change: rotate, translate;
}
.fond-anime .fond-rayons {
  animation: none;
}
.fond[data-variante='aube'] .fond-rayons {
  display: none;
}
@keyframes fond-tourne {
  from {
    rotate: 0deg;
  }
  to {
    rotate: 360deg;
  }
}
.fond-soleil {
  display: none;
  position: absolute;
  --s: calc(0.72 * min(100vw, 100vh));
  left: calc(var(--s) / -2);
  top: calc(var(--s) / -2);
  width: var(--s);
  height: var(--s);
  translate: var(--fond-x) var(--fond-y);
  border-radius: 50%;
  background: radial-gradient(circle, #fde047 0%, #fbbf24 55%, rgba(251, 191, 36, 0) 72%);
}
.fond[data-variante='aube'] .fond-soleil {
  display: block;
}
.fond-disque {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  background: var(--creme);
}
.fond-volet {
  position: absolute;
  inset: 0;
}

/* --- calques : fond, canvas WebGL transparent, interface --- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  touch-action: none;
}
.ui {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.ecran {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ecran button,
.ecran a,
.ecran input,
.ecran select,
.ecran textarea,
.ecran label,
.ecran-social,
.bouton-son,
.toast {
  pointer-events: auto;
}
/* le panneau de partage du lot H se pose où il veut : sa section ne bloque rien */
.ecran-social.ecran-partage {
  pointer-events: none;
}
.ecran-social.ecran-partage > * {
  pointer-events: auto;
}
.annonce {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  margin: 0;
}

/* --- composants de la promo --- */

/* Bulle : étiquette autocollante (commun.tsx, Bulle à 92 px rapportée en em) */
.bulle {
  margin: 0;
  width: max-content;
  max-width: min(15em, calc(100vw - 32px));
  font-family: var(--titre);
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1.05;
  color: #fff;
  text-align: center;
  background: var(--vert-fonce);
  padding: 0.196em 0.478em 0.109em;
  border-radius: 0.435em;
  box-shadow: 0 0.152em 0 rgba(0, 0, 0, 0.18);
  rotate: -3deg;
}
.bulle-vert {
  background: var(--vert-fonce);
}
.bulle-rouge {
  background: var(--rouge);
}
.bulle-bleu {
  background: var(--bleu);
}
.bulle-encre {
  background: var(--encre);
}
.bulle-orange {
  background: var(--orange-fonce);
}

/* Mot : grand texte qui surgit, incliné avec le ressort */
.mot {
  margin: 0;
  font-family: var(--titre);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  text-align: center;
  text-shadow: 0 0.05em 0 #15803d22;
  transform: rotate(-4deg);
}
.mot-vert {
  color: var(--vert-fonce);
}
.mot-encre {
  color: var(--encre);
}
.mot-blanc {
  color: #fff;
  text-shadow: 0 0.05em 0 rgba(0, 0, 0, 0.18);
}

/* Badge « EXCLUSIF » : jaune, capitales, oscillation 4° ± 2° sur 1,26 s */
.badge {
  display: inline-block;
  margin: 0;
  font-family: var(--titre);
  font-weight: 800;
  color: var(--encre);
  background: var(--soleil);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1.15;
  padding: 0.18em 0.6em 0.07em;
  border-radius: 0.54em;
  box-shadow: 0 0.14em 0 rgba(0, 0, 0, 0.15);
  rotate: 4deg;
  animation: badge-oscille 0.6283s ease-in-out infinite alternate;
}
@keyframes badge-oscille {
  from {
    rotate: 2deg;
  }
  to {
    rotate: 6deg;
  }
}

/* Pastille : blanche, texte vert foncé, −2° */
.pastille {
  display: inline-block;
  margin: 0;
  font-family: var(--titre);
  font-weight: 800;
  line-height: 1.2;
  color: var(--vert-fonce);
  background: #fff;
  padding: 0.267em 0.667em 0.1em;
  border-radius: 0.567em;
  box-shadow: 0 0.167em 0 rgba(0, 0, 0, 0.15);
  transform: rotate(-2deg);
}
.pastille-petite {
  font-size: 0.875rem;
}
button.pastille {
  border: 0;
  cursor: pointer;
}
.pastille-bouton {
  font-size: 1.0625rem;
  min-height: 2.75rem;
}
button.pastille:active {
  translate: 0 0.1em;
  box-shadow: 0 0.067em 0 rgba(0, 0, 0, 0.15);
}

/* Carte (« Sous ») : la seule ombre floue, pour ce qui se lit */
.carte {
  margin: 0;
  background: #fff;
  color: var(--encre);
  font-family: var(--texte);
  font-weight: 800;
  line-height: 1.3;
  border-radius: 0.68em;
  padding: 0.45em 0.77em;
  box-shadow: 0 0.27em 0.68em rgba(0, 0, 0, 0.18);
}

/* boutons principaux : pleine largeur, Baloo 800, ombre dure */
.bouton-principal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 4rem;
  margin: 0;
  padding: 0.3em 0.8em 0.1em;
  border: 0;
  border-radius: 0.7em;
  font-family: var(--titre);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.1;
  color: #fff;
  background: var(--vert-fonce);
  box-shadow: 0 0.25em 0 var(--vert-nuit);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.bouton-principal:active {
  translate: 0 0.18em;
  box-shadow: 0 0.07em 0 var(--vert-nuit);
}
.bouton-principal:disabled {
  cursor: default;
}
.bouton-principal.attente {
  background: #4b8f61;
  box-shadow: 0 0.25em 0 #3c7550;
}
.lien-discret {
  border: 0;
  background: none;
  padding: 0.5em 0.6em;
  min-height: 2.75rem;
  font-family: var(--texte);
  font-weight: 800;
  font-size: 0.9375rem;
  color: var(--vert-fonce);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

/* bouton son, en haut à droite de chaque écran (44 × 44) */
.bouton-son {
  position: fixed;
  z-index: 5;
  top: calc(var(--haut-sur) + 10px);
  right: calc(var(--droite-sur) + 10px);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--vert-fonce);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15);
  cursor: pointer;
}
.icone-son {
  width: 24px;
  height: 24px;
}

/* toasts : pastilles en bas de l'écran, 2,5 s */
.toasts {
  position: fixed;
  z-index: 6;
  left: 16px;
  right: 16px;
  bottom: calc(var(--bas-sur) + 24px);
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  font-size: 1.0625rem;
}

/* touches du clavier, écrites seulement là où il y a une souris */
.touche {
  display: none;
  font-family: var(--texte);
  font-weight: 800;
  font-size: 0.75rem;
  line-height: 1;
  color: var(--vert-fonce);
  text-align: center;
  white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
  .touche {
    display: block;
  }
}

/* ===================== écran titre ===================== */
.ecran-titre {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* le titre passe sous le bouton son (44 px en haut à droite) */
  padding: calc(var(--haut-sur) + clamp(40px, 6vh, 56px)) 16px calc(var(--bas-sur) + 10px);
  gap: clamp(6px, 1.2vh, 12px);
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
}
.arrivee ~ .ecran-titre {
  display: none;
}
.titre-tete {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.2vh, 12px);
}
.titre-nom {
  font-size: min(4.75rem, 19.5vw, 9.2vh);
  color: var(--vert-fonce);
  padding-top: 0.08em;
}
.titre-autocollants {
  display: grid;
  justify-items: center;
}
.titre-autocollant {
  grid-area: 1 / 1;
  font-size: min(1.375rem, 5.6vw, 2.9vh);
}
.titre-accroche {
  margin: 0;
  font-size: min(1.0625rem, 4.4vw, 2.2vh);
  text-align: center;
  color: var(--encre);
}
.titre-hors-ligne {
  font-size: 0.875rem;
}
.titre-mascotte {
  position: relative;
  flex: 1 1 0;
  min-height: 120px;
  width: 100%;
}
/* centrée dans sa zone, 300 px au plus : la mascotte 3D prendra la même place */
.mascotte-titre {
  position: absolute;
  inset: 0;
  margin: auto;
  height: min(300px, 100%);
  width: auto;
  max-width: 100%;
  aspect-ratio: 1;
  overflow: visible;
}
.mascotte-3d .mascotte-titre {
  visibility: hidden;
}
.titre-menu {
  width: min(100%, 380px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vh, 12px);
}
.choix {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.5rem;
  margin: 0;
  padding: 0.45em 0.9em 0.35em;
  border: 0;
  border-radius: 1.1rem;
  background: #fff;
  box-shadow: 0 0.25rem 0 rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transform: rotate(1deg);
}
.choix:nth-child(3) {
  transform: rotate(-1.5deg);
}
.choix-principal {
  min-height: 4rem;
  padding: 0;
  overflow: hidden;
  background: var(--vert);
  box-shadow: 0 0.3rem 0 var(--vert-nuit);
  transform: rotate(-2deg);
}
.choix:active {
  translate: 0 0.2rem;
  box-shadow: 0 0.06rem 0 rgba(0, 0, 0, 0.15);
}
.choix-principal:active {
  box-shadow: 0 0.06rem 0 var(--vert-nuit);
}
.choix-nom {
  font-family: var(--titre);
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1.1;
  color: var(--vert-fonce);
  padding-top: 0.1em;
}
.choix-sous {
  font-family: var(--texte);
  font-weight: 800;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: var(--encre);
  text-align: center;
  /* deux lignes égales plutôt qu'un mot seul sur la seconde (« cœurs. » à 390 px) */
  text-wrap: balance;
}
.choix-principal .choix-nom {
  color: #fff;
  font-size: 1.5rem;
  padding: 0.45em 0.6em 0.2em;
}
/* blanc sur #16a34a : réservé au gros texte gras (§6 Accessibilité) ; le
   sous-titre passe sur un bandeau vert foncé, en bas du bouton */
.choix-principal .choix-sous {
  align-self: stretch;
  color: #fff;
  background: var(--vert-fonce);
  padding: 0.35em 1em 0.4em;
}
.titre-allumes {
  margin: 0;
  font-size: 0.875rem;
  color: var(--vert-fonce);
  text-align: center;
}
.titre-pied {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 10px;
}
.titre-pied .pastille:nth-child(2) {
  transform: rotate(1deg);
}

/* mascotte 2D : sautillement sur le temps, clignement, flexible et feuille qui se balancent */
.mascotte .m-corps {
  transform-origin: 32px 58px;
  animation: m-sautille 0.5s linear infinite;
}
.mascotte .m-flexible {
  transform-origin: 45px 39px;
  animation: m-flexible 0.5s ease-in-out infinite alternate;
  animation-delay: -0.25s;
}
.mascotte .m-feuille {
  transform-origin: 32px 9px;
  animation: m-feuille 0.5s ease-in-out infinite alternate;
  animation-delay: -0.409s;
}
.mascotte .m-oeil-g {
  transform-origin: 28.2px 22.8px;
  animation: m-cligne 3.7s linear infinite;
}
.mascotte .m-oeil-d {
  transform-origin: 35.8px 22.8px;
  animation: m-cligne 3.7s linear infinite;
}
@keyframes m-sautille {
  /* e = 1 → 1,1 → 1 à 0 / 0,1 / 0,267 s, échelle (1/√e, e) au pied du socle */
  0% {
    transform: scale(1, 1);
  }
  20% {
    transform: scale(0.9535, 1.1);
  }
  53.4%,
  100% {
    transform: scale(1, 1);
  }
}
@keyframes m-flexible {
  from {
    transform: rotate(-9deg);
  }
  to {
    transform: rotate(9deg);
  }
}
@keyframes m-feuille {
  from {
    transform: rotate(-12deg);
  }
  to {
    transform: rotate(12deg);
  }
}
@keyframes m-cligne {
  0%,
  86% {
    transform: scaleY(1);
  }
  88.7% {
    transform: scaleY(0.12);
  }
  91.4%,
  100% {
    transform: scaleY(1);
  }
}

/* ===================== écran de jeu ===================== */
.ecran-jeu {
  /* écran verrouillé : rien ne défile, rien ne se zoome */
  position: fixed;
  height: var(--h);
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  /* gâchette : rond de 168 px, à 85 % de la hauteur */
  --g: calc(1.68 * var(--u));
}
html[data-ecran='jeu'],
html[data-ecran='jeu'] body,
html[data-ecran='pause'],
html[data-ecran='pause'] body {
  position: fixed;
  inset: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.jeu-hud {
  position: absolute;
  top: calc(var(--haut-sur) + 0.12 * var(--u));
  left: calc(var(--gauche-sur) + 12px);
  right: calc(var(--droite-sur) + 12px);
  height: calc(0.4 * var(--u));
  min-height: 40px;
}
.hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 100%;
}
.hud-gauche {
  justify-self: start;
  display: flex;
  align-items: center;
}
.hud-droite {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 52px;
}
.hud-coeurs {
  display: flex;
  gap: 4px;
}
.torse {
  display: block;
  width: 36px;
  height: 30px;
  overflow: visible;
}
.torse.perdu .torse-coeur {
  fill: #fecaca;
}
.hud-pleins {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.hud-pleins-texte {
  font-size: 0.8125rem;
  line-height: 1;
  color: var(--vert-fonce);
}
.hud-pastilles {
  display: flex;
  gap: 5px;
}
/* plein à jouer : un rond vide ; plein joué : la couleur du verdict, liseré blanc */
.hud-pastille {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(21, 128, 61, 0.4);
  background: transparent;
}
.hud-pastille[data-verdict] {
  border-color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}
/* sur le fond vert du pile poil, le petit texte vert passe en blanc */
html[data-fond='vert'] .hud-pleins-texte,
html[data-fond='vert'] .touche,
html[data-fond='vert'] .titre-allumes,
html[data-fond='vert'] .ecran-jeu .lien-discret {
  color: #fff;
}
html[data-fond='vert'] .hud-pastille:not([data-verdict]) {
  border-color: rgba(255, 255, 255, 0.45);
  border-width: 1.5px;
}
html[data-fond='vert'] .hud-pastille[data-verdict] {
  border-width: 3px;
}
.hud-chrono {
  position: relative;
  width: 40px;
  height: 40px;
}
.chrono-disque {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--vert);
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
}
.chrono-liquide {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  background: var(--vert);
}
/* secondes toujours lisibles, sur le liquide comme sur le disque vidé : encre
   cernée de crème, comme les chiffres du compteur sur leur papier */
.chrono-secondes {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 0.14em;
  font-family: var(--titre);
  font-weight: 800;
  font-size: 1.1875rem;
  line-height: 1;
  color: var(--encre);
  font-variant-numeric: tabular-nums;
  text-shadow:
    1.5px 0 0 var(--creme),
    -1.5px 0 0 var(--creme),
    0 1.5px 0 var(--creme),
    0 -1.5px 0 var(--creme),
    1px 1px 0 var(--creme),
    -1px -1px 0 var(--creme),
    1px -1px 0 var(--creme),
    -1px 1px 0 var(--creme);
}
.chrono-fin .chrono-secondes {
  color: #b91c1c;
}
.chrono-onde {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 3px solid #dc2626;
  pointer-events: none;
}
/* l'annonce du chrono le désigne d'une onde verte */
.chrono-onde-annonce {
  border-color: var(--vert);
}
.hud-score {
  font-family: var(--titre);
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1;
  padding-top: 0.12em;
  color: var(--encre);
  font-variant-numeric: tabular-nums;
}
.hud-combo {
  font-size: 0.9375rem;
}

/* centré par les marges, pas par translate : ui.zones() lit la mise en page
   sans les transformations (offsetLeft), un translate fausserait le compteur */
.jeu-haut {
  position: absolute;
  top: calc(var(--haut-sur) + 0.64 * var(--u));
  left: 0;
  right: 0;
  margin-inline: auto;
  width: min(calc(3.44 * var(--u)), calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* la hauteur suit le texte (police agrandie à 130 %) : le compteur descend plutôt
   que de passer sous l'autocollant */
.jeu-objectif {
  min-height: max(46px, calc(0.52 * var(--u)));
  margin-bottom: calc(0.12 * var(--u));
  display: grid;
  place-items: center;
}
/* objectif : autocollant crème à −3°, posé sur le haut du compteur */
.objectif {
  font-family: var(--titre);
  font-weight: 800;
  color: var(--encre);
  background: var(--creme);
  text-align: center;
  padding: 0.196em 0.6em 0.109em;
  border-radius: 0.435em;
  box-shadow: 0 0.152em 0 rgba(0, 0, 0, 0.18);
  rotate: -3deg;
  font-size: 1.625rem;
}
.objectif.tremble {
  animation: objectif-tremble 0.11s linear infinite alternate;
}
@keyframes objectif-tremble {
  from {
    rotate: -4deg;
  }
  to {
    rotate: -2deg;
  }
}
.objectif-montant {
  margin: 0;
  line-height: 1.05;
  white-space: nowrap;
}
.objectif-regle,
.objectif-tolerance {
  margin: 0 0 0.25em;
  font-family: var(--texte);
  font-size: 0.4643em;
  line-height: 1.15;
  color: var(--vert-fonce);
}
.jeu-zone-compteur {
  position: relative;
  width: 100%;
  height: calc(1.84 * var(--u));
}
/* épinglé au coin haut droit du compteur, sous l'objectif */
.badge-caractere {
  position: absolute;
  right: 6px;
  /* tenu par son bas (≈ top: −6px à la police par défaut) : agrandi par la
     police du système, il monte au lieu de couvrir le montant */
  bottom: calc(100% - 28px);
  font-size: 0.75rem;
  text-align: center;
  max-width: 58%;
}
.badge-nom {
  display: block;
}
.badge-sous {
  display: block;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--texte);
  font-size: 0.85em;
  line-height: 1.1;
  padding-bottom: 0.15em;
}
.carte-station {
  margin-top: calc(0.08 * var(--u));
  max-width: 100%;
  font-size: 0.8125rem;
  padding: 0.3em 0.8em;
  text-align: center;
  border-radius: 0.8em;
}
.station-prix {
  color: var(--vert-fonce);
  white-space: nowrap;
}
.station-releve {
  display: block;
  font-weight: 700;
  font-size: 0.85em;
  color: #57534e;
}
.jeu-zone-scene {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--haut-sur) + 3.12 * var(--u));
  height: calc(3.56 * var(--u));
}

/* Grammaire de la promo : le titre en haut de l'écran (le Mot du verdict prend
   la place de l'objectif, qui sort), la carte à lire (« Sous ») en bas, sur la
   gâchette inactive pendant le verdict. Les bulles d'aide se posent sous la
   fiche de la station. */
.jeu-verdict {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(var(--haut-sur) + 0.58 * var(--u));
  min-height: calc(0.64 * var(--u));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.jeu-tuto {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(var(--haut-sur) + 3.54 * var(--u) + 14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}
.jeu-lecture {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 71%;
  bottom: calc(var(--bas-sur) + 24px);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.mot-verdict {
  font-size: min(3rem, 12.5vw);
  max-width: 100%;
}
.mot-verdict.mot-long {
  font-size: min(2.25rem, 9vw);
}
.carte-verdict {
  font-size: 1rem;
  max-width: 21em;
  text-align: center;
}
.carte-tuto {
  font-size: 1.0625rem;
  max-width: 19em;
  text-align: center;
}
/* plein d'essai : pas de vraie station, la bulle d'aide prend la place de la fiche */
.ecran-jeu[data-mode='essai'] .carte-station {
  display: none;
}
.ecran-jeu[data-mode='essai'] .jeu-tuto {
  top: calc(var(--haut-sur) + 3.2 * var(--u) + 60px);
}

/* Jauge du plein d'essai, posée sous le compteur (tuto.js) : la zone où
   lâcher, le plein en vert, l'élan en orange, au-delà de la ligne rouge le
   dépassement. Les derniers euros s'étirent : c'est là que tout se joue. */
.jauge-essai {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}
.jauge-piste {
  position: relative;
  height: 18px;
  border-radius: 9px;
  background: var(--creme);
  border: 2px solid var(--vert-fonce);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.jauge-piste > i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
}
.jauge-plein {
  background: var(--vert);
}
.jauge-elan {
  background: var(--orange);
}
.jauge-trop {
  background: var(--rouge);
}
/* la zone hachurée reste lisible quand le plein passe dessous */
.jauge-zone {
  background: repeating-linear-gradient(-45deg, var(--soleil) 0 4px, rgba(250, 204, 21, 0.25) 4px 8px);
  box-shadow: inset 2px 0 0 var(--soleil), inset -2px 0 0 var(--soleil);
}
.jauge-ligne {
  position: absolute;
  top: -5px;
  height: 32px;
  width: 5px;
  margin-left: -2.5px;
  border-radius: 2.5px;
  background: var(--rouge);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}
.jauge-pile .jauge-plein {
  background: var(--vert-clair);
}
.jauge-pile .jauge-ligne {
  background: var(--vert-fonce);
}
.jauge-repere {
  position: absolute;
  top: 31px;
  translate: -50% 0;
  margin: 0;
  font-family: var(--titre);
  font-weight: 800;
  font-size: 0.9375rem;
  line-height: 1;
  white-space: nowrap;
  color: var(--vert-fonce);
  background: #fff;
  padding: 0.3em 0.6em 0.16em;
  border-radius: 0.5em;
  box-shadow: 0 0.15em 0 rgba(0, 0, 0, 0.15);
  transform-origin: 50% 0;
}
/* la pointe vers la zone */
.jauge-repere::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -6px;
  margin-left: -7px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #fff;
}
.jauge-repere[data-etat='maintenant'] {
  color: #fff;
  background: var(--rouge);
  font-size: 1.25rem;
}
.jauge-repere[data-etat='maintenant']::before {
  border-bottom-color: var(--rouge);
}

/* Cause d'un arrêt automatique, collée sur le bas du compteur à l'instant de
   l'arrêt : dépassement (rouge), chrono (encre, l'urgence), verrou pile (vert) */
.cause-arret {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  width: max-content;
  max-width: min(21em, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--titre);
  font-weight: 800;
  color: #fff;
  text-align: center;
  padding: 0.22em 0.65em 0.16em;
  border-radius: 0.435em;
  box-shadow: 0 0.152em 0 rgba(0, 0, 0, 0.18);
  rotate: -3deg;
  pointer-events: none;
}
.cause-titre {
  font-size: 1.625rem;
  line-height: 1.05;
}
.cause-ligne {
  font-family: var(--texte);
  font-size: 0.9375rem;
  line-height: 1.2;
  padding-bottom: 0.15em;
}
.cause-depasse {
  background: var(--rouge);
}
.cause-chrono {
  background: var(--encre);
}
.cause-verrou {
  background: var(--vert-fonce);
}

/* autocollants accrochés aux ancres de la scène (voiture, file) */
.jeu-autocollants {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.accroche {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
}
.bulle-accrochee {
  position: absolute;
  left: 0;
  bottom: 0;
  translate: -50% 0;
  transform-origin: 50% 100%;
  font-size: 1.1875rem;
  max-width: min(12em, calc(100vw - 32px));
}
.bulle-annonce {
  font-size: 1.25rem;
}
.mot-plus {
  position: absolute;
  left: 0;
  top: 0;
  translate: -50% -50%;
  font-size: 1.5rem;
  color: var(--vert-fonce);
  white-space: nowrap;
}
.mot-plus.mot-blanc {
  color: #fff;
}
.pastille-elan {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.9375rem;
  white-space: nowrap;
}

/* gâchette : tout le bas de l'écran à partir de 71 % de la hauteur */
.gachette-zone {
  position: absolute;
  left: 0;
  right: 0;
  top: 71%;
  bottom: 0;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}
.gachette {
  position: absolute;
  left: 50%;
  width: var(--g);
  height: var(--g);
  margin-left: calc(var(--g) / -2);
  /* centre à 85 % de la hauteur (48,28 % de la zone), bord bas ≥ 40 px au-dessus de la zone sûre */
  top: min(calc(48.28% - var(--g) / 2), calc(100% - 40px - var(--bas-sur) - var(--g)));
  pointer-events: none;
}
.gachette-anneau {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.gachette-piste,
.gachette-jauge {
  fill: none;
  stroke-width: 7;
}
.gachette-piste {
  stroke: rgba(21, 128, 61, 0.16);
}
.gachette-jauge {
  stroke: var(--vert-clair);
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50px 50px;
}
.gachette-bouton {
  position: absolute;
  inset: 13%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25em;
  border-radius: 50%;
  background: var(--vert);
  color: #fff;
  box-shadow: 0 calc(0.08 * var(--u)) 0 var(--vert-fonce);
  font-family: var(--titre);
  font-weight: 800;
  font-size: min(1.25rem, calc(0.22 * var(--u)));
}
.gachette-pistolet {
  width: 30%;
  height: auto;
  aspect-ratio: 12.2 / 17;
}
.gachette-texte {
  line-height: 1;
  padding-top: 0.12em;
  white-space: nowrap;
}
.gachette-zone.presse .gachette-bouton {
  translate: 0 calc(0.06 * var(--u));
  box-shadow: 0 calc(0.02 * var(--u)) 0 var(--vert-fonce);
}
.gachette-zone[data-etat='inactive'] .gachette {
  opacity: 0.45;
}
.gachette-zone[data-etat='raccroche'] .gachette-bouton {
  background: var(--vert-fonce);
  box-shadow: 0 calc(0.08 * var(--u)) 0 var(--vert-nuit);
}
.gachette-ondes {
  position: absolute;
  inset: 0;
}
.gachette-onde {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 6px solid var(--vert-clair);
}
.touche-gachette {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--bas-sur) + 12px);
}

/* Raccrocher : pastille crème 132 × 52, 16 px au-dessus de la zone de gâchette */
.raccrocher {
  position: absolute;
  right: calc(var(--droite-sur) + 16px);
  top: calc(71% - 16px - 0.52 * var(--u));
  min-width: max(118px, calc(1.32 * var(--u)));
  height: calc(0.52 * var(--u));
  min-height: 46px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  margin: 0;
  padding: 0.2em 0.6em 0;
  border: 0;
  border-radius: 0.9em;
  background: var(--creme);
  color: var(--encre);
  font-family: var(--titre);
  font-weight: 800;
  font-size: 1.125rem;
  box-shadow: 0 0.167em 0 rgba(0, 0, 0, 0.18);
  transform: rotate(-2deg);
  cursor: pointer;
}
.raccrocher:disabled {
  cursor: default;
}
.raccrocher:disabled .raccrocher-icone,
.raccrocher:disabled .raccrocher-texte {
  opacity: 0.45;
}
.raccrocher-icone {
  width: 0.95em;
  height: 1.32em;
  margin-top: -0.15em;
  color: var(--pistolet);
  flex: none;
}
.touche-raccrocher {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
}
.lien-passer {
  position: absolute;
  top: calc(var(--haut-sur) + 10px);
  right: calc(var(--droite-sur) + 60px);
}

/* ===================== pause ===================== */
.ecran-pause {
  display: grid;
  place-items: center;
  pointer-events: auto;
}
.pause-voile {
  position: absolute;
  inset: 0;
  background: rgba(255, 251, 235, 0.88);
}
.pause-boite {
  position: relative;
  width: min(340px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.pause-titre {
  font-size: min(3.5rem, 13vw);
}
.pause-sous {
  margin: 0 0 6px;
  font-size: 1.0625rem;
  text-align: center;
}
.pause-boutons {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.pause-decompte {
  margin: 0;
  min-height: 0;
  display: grid;
}
.mot-decompte {
  grid-area: 1 / 1;
  font-size: 6rem;
  color: var(--vert-fonce);
}

/* ===================== résultat ===================== */
.ecran-resultat {
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.resultat-tete {
  flex: none;
  display: grid;
  grid-template-columns: 38% 1fr;
  align-items: center;
  height: calc(var(--haut-sur) + 1.76 * var(--u));
  min-height: 150px;
  padding: calc(var(--haut-sur) + 10px) 60px 6px 12px;
}
.resultat-zone-scene {
  height: 100%;
}
.resultat-titres {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.resultat-autocollant {
  font-size: 1.1875rem;
}
.resultat-mot {
  font-size: min(2.75rem, 11vw);
}
.resultat-vert .resultat-mot {
  color: #fff;
}
/* sur le fond vert, ce qui est posé à même le fond passe en blanc */
.resultat-vert .resultat-percentile,
.resultat-vert .resultat-prochain,
.resultat-vert .resultat-demain,
.resultat-vert .resultat-points,
.resultat-vert .resultat-record,
.resultat-vert .lien-discret {
  color: #fff;
}
.resultat-points {
  margin: 0;
  font-family: var(--titre);
  font-size: 1.1875rem;
  line-height: 1.2;
  text-align: center;
  color: var(--encre);
  font-variant-numeric: tabular-nums;
}
.resultat-record {
  margin: 0;
  font-size: 0.875rem;
  text-align: center;
}
.resultat-defile {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
  padding: 10px 16px calc(var(--bas-sur) + 28px);
}
.resultat-corps {
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.resultat-corps > * {
  width: 100%;
}
.resultat-court .resultat-defile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: calc(var(--bas-sur) + 12vh);
}
.resultat-court .resultat-corps {
  width: 100%;
}
.resultat-corps > .pastille,
.resultat-corps > .lien-discret {
  width: auto;
}
.resultat-bandeau {
  font-size: 0.9375rem;
}

/* ticket de pompe : papier, bord bas dentelé, filets pointillés */
.ticket-ombre {
  filter: drop-shadow(0 0.27rem 0.68rem rgba(0, 0, 0, 0.18));
}
.ticket {
  background: #fff;
  padding: 14px 16px 26px;
  font-family: var(--texte);
  color: var(--encre);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), 97.5% 100%, 95% calc(100% - 9px), 92.5% 100%, 90% calc(100% - 9px), 87.5% 100%, 85% calc(100% - 9px), 82.5% 100%, 80% calc(100% - 9px), 77.5% 100%, 75% calc(100% - 9px), 72.5% 100%, 70% calc(100% - 9px), 67.5% 100%, 65% calc(100% - 9px), 62.5% 100%, 60% calc(100% - 9px), 57.5% 100%, 55% calc(100% - 9px), 52.5% 100%, 50% calc(100% - 9px), 47.5% 100%, 45% calc(100% - 9px), 42.5% 100%, 40% calc(100% - 9px), 37.5% 100%, 35% calc(100% - 9px), 32.5% 100%, 30% calc(100% - 9px), 27.5% 100%, 25% calc(100% - 9px), 22.5% 100%, 20% calc(100% - 9px), 17.5% 100%, 15% calc(100% - 9px), 12.5% 100%, 10% calc(100% - 9px), 7.5% 100%, 5% calc(100% - 9px), 2.5% 100%, 0 calc(100% - 9px));
}
.ticket-tete {
  padding-bottom: 10px;
  border-bottom: 2px dashed #d6d3d1;
  font-family: var(--titre);
  font-size: 0.875rem;
  text-align: center;
  letter-spacing: 0.04em;
  color: var(--encre);
}
.ticket-mot {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--vert-fonce);
}
.ticket-lignes {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ticket-ligne {
  padding: 9px 0;
  border-bottom: 2px dashed #e7e5e4;
}
.ticket-ligne-haut {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9375rem;
  line-height: 1.2;
}
.ticket-plein {
  color: #57534e;
  white-space: nowrap;
}
.ticket-lieu {
  color: #57534e;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ticket-montant {
  font-family: var(--titre);
  font-size: 1.125rem;
  padding-top: 0.12em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ticket-pastille {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d6d3d1;
}
.ticket-verdict {
  flex: 1;
  min-width: 0;
}
.ticket-points {
  font-family: var(--titre);
  font-size: 1.125rem;
  padding-top: 0.12em;
  font-variant-numeric: tabular-nums;
}
.ticket-lecture {
  margin: 3px 0 0;
  font-weight: 700;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: #57534e;
}
.ticket-pied {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 10px;
  font-family: var(--titre);
  font-size: 1.125rem;
}
.ticket-score {
  font-size: 1.5rem;
  color: var(--vert-fonce);
  font-variant-numeric: tabular-nums;
}
.resultat-percentile {
  margin: 0;
  text-align: center;
  font-size: 1rem;
  color: var(--vert-fonce);
}
.resultat-envoi {
  color: #57534e;
}
.resultat-principal {
  font-size: 1.625rem;
}
.resultat-secondaires {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 10px;
}
.resultat-secondaires .pastille:nth-child(even) {
  transform: rotate(1.5deg);
}
.resultat-serie {
  font-size: 0.9375rem;
}
.serie-tete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0;
}
.serie-jours {
  font-family: var(--titre);
  font-size: 1.25rem;
  color: var(--vert-fonce);
  padding-top: 0.1em;
}
.serie-record {
  color: #57534e;
}
.serie-jokers {
  display: inline-flex;
  gap: 3px;
}
.serie-joker {
  width: 18px;
  height: 15px;
}
.serie-total,
.serie-titre {
  margin: 6px 0 0;
}
.serie-titre {
  color: #57534e;
  font-size: 0.8125rem;
}
.repartition {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 5px;
}
.repartition-ligne {
  display: grid;
  grid-template-columns: 2.2em 1fr 2em;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
}
.repartition-piste {
  height: 14px;
}
.repartition-barre {
  display: block;
  height: 100%;
  border-radius: 7px;
}
.repartition-ligne.aujourdhui .repartition-cle,
.repartition-ligne.aujourdhui .repartition-n {
  color: var(--vert-fonce);
}
.repartition-ligne.aujourdhui .repartition-barre {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--encre);
}
.repartition-n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.resultat-prochain,
.resultat-demain {
  margin: 0;
  text-align: center;
  font-size: 0.9375rem;
}
.resultat-prochain {
  font-family: var(--titre);
  font-size: 1.125rem;
  color: var(--vert-fonce);
}
.resultat-equipe {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.resultat-equipe p {
  margin: 0;
}
.resultat-station {
  font-size: 0.875rem;
}
.resultat-station p {
  margin: 0 0 4px;
}
.station-nom {
  font-size: 0.9375rem;
}
.station-details,
.station-tirage {
  font-weight: 700;
  color: #44403c;
}
.lien-mantan {
  display: inline-block;
  margin-top: 4px;
  color: var(--vert-fonce);
  text-underline-offset: 0.18em;
}
.resultat-essai {
  font-size: 1.125rem;
  text-align: center;
}
.resultat-menu {
  align-self: center;
}

/* ===================== écrans de secours ===================== */
.ecran-secours {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: calc(var(--haut-sur) + 24px) 20px calc(var(--bas-sur) + 24px);
  pointer-events: auto;
}
.secours-mascotte {
  width: min(220px, 50vw, 32vh);
  aspect-ratio: 1;
}
.mascotte-secours {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.secours-boite {
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.secours-titre {
  font-size: min(3rem, 12vw);
}
.secours-texte {
  font-size: 1rem;
  text-align: center;
}
.secours-conseil {
  font-weight: 700;
}
.secours-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* sans JavaScript */
.sans-js {
  position: fixed;
  z-index: 7;
  left: 16px;
  right: 16px;
  bottom: calc(var(--bas-sur) + 16px);
  text-align: center;
}

/* ===================== paysage ===================== */
@media (orientation: landscape) {
  /* la bannière YouTube de Mantan : mascotte à gauche, titre et boutons à droite */
  .ecran-titre {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      'mascotte .'
      'mascotte tete'
      'mascotte menu'
      'mascotte allumes'
      'mascotte .'
      'pied .';
    align-items: center;
    justify-items: center;
    column-gap: 24px;
    row-gap: clamp(8px, 2vh, 16px);
    padding: calc(var(--haut-sur) + 16px) calc(var(--droite-sur) + 64px) calc(var(--bas-sur) + 10px) calc(var(--gauche-sur) + 24px);
  }
  .titre-tete {
    grid-area: tete;
  }
  .titre-mascotte {
    grid-area: mascotte;
    height: 100%;
    min-height: 0;
  }
  .mascotte-titre {
    height: min(420px, 100%);
  }
  .titre-menu {
    grid-area: menu;
  }
  .titre-allumes {
    grid-area: allumes;
  }
  .titre-pied {
    grid-area: pied;
  }
  .titre-nom {
    font-size: min(5.5rem, 8vw, 15vh);
  }
  .titre-autocollant {
    font-size: min(1.5rem, 2.4vw, 5vh);
  }
  .titre-accroche {
    font-size: min(1.125rem, 2vw, 4.2vh);
  }

  /* jeu : scène à gauche, compteur à droite centré en hauteur, gâchette en bas à droite */
  .ecran-jeu {
    --col: min(46vw, 520px, calc((var(--h) - 230px) * 1.8696));
    --hc: calc(var(--col) * 0.5349);
    --droite: calc(var(--col) + 48px);
    --g: min(168px, 25vh);
    --pile: calc(64px + var(--hc) + 44px);
  }
  /* HUD groupé en haut à gauche, au-dessus de la scène */
  .jeu-hud {
    right: calc(var(--droite) + 8px);
  }
  .hud {
    grid-template-columns: auto auto auto;
    justify-content: start;
    column-gap: 22px;
  }
  .hud-droite {
    margin-right: 0;
  }
  .jeu-zone-scene {
    top: 0;
    bottom: 0;
    height: auto;
    right: var(--droite);
  }
  .jeu-haut {
    left: auto;
    right: calc(var(--droite-sur) + 24px);
    translate: none;
    width: var(--col);
    top: max(calc(var(--haut-sur) + 8px), calc((var(--h) - var(--g) - 40px - var(--pile)) / 2));
  }
  /* l'objectif à gauche, le badge du caractère au coin droit : ils ne se gênent plus */
  .jeu-objectif {
    min-height: 52px;
    margin-bottom: 12px;
    align-self: stretch;
    justify-items: start;
    padding-left: 6px;
  }
  .badge-caractere {
    right: -8px;
  }
  .jeu-zone-compteur {
    height: var(--hc);
  }
  /* le Mot du verdict prend la place de l'objectif, en tête de la colonne du compteur */
  .jeu-verdict {
    left: auto;
    right: calc(var(--droite-sur) + 24px);
    width: var(--col);
    top: max(calc(var(--haut-sur) + 4px), calc((var(--h) - var(--g) - 40px - var(--pile)) / 2 - 4px));
    min-height: 60px;
  }
  .mot-verdict {
    font-size: min(3rem, calc(var(--col) / 7));
  }
  .mot-verdict.mot-long {
    font-size: min(2.25rem, calc(var(--col) / 9.5));
  }
  .jeu-tuto {
    top: calc(var(--haut-sur) + 72px);
    right: calc(var(--droite) + 12px);
  }
  .jeu-lecture {
    top: auto;
    bottom: calc(var(--bas-sur) + 20px);
    right: calc(var(--droite) + 16px);
  }
  .gachette-zone {
    left: calc(100% - var(--droite));
    top: auto;
    height: calc(var(--g) + 56px);
  }
  /* gâchette au bord droit de la colonne, Raccrocher à son bord gauche */
  .gachette {
    left: auto;
    margin-left: 0;
    right: calc(var(--droite-sur) + 24px);
    top: auto;
    bottom: calc(var(--bas-sur) + 28px);
  }
  /* « Espace » tombe sur la tranche vert foncé de l'îlot : encre sur une pastille crème */
  .touche-gachette {
    left: auto;
    right: calc(var(--droite-sur) + 24px + var(--g) / 2);
    width: max-content;
    translate: 50% 0;
    bottom: calc(var(--bas-sur) + 6px);
    padding: 3px 8px 2px;
    border-radius: 999px;
    background: var(--creme);
    color: var(--encre);
  }
  html[data-fond='vert'] .touche-gachette {
    color: var(--encre);
  }
  .raccrocher {
    right: auto;
    left: calc(100% - var(--droite) + 24px);
    top: auto;
    bottom: calc(var(--bas-sur) + 28px + var(--g) / 2 - 26px);
    min-width: 132px;
    height: 52px;
  }
  .lien-passer {
    right: calc(var(--droite-sur) + 60px);
  }

  .ecran-resultat {
    flex-direction: row;
  }
  .resultat-tete {
    width: 42%;
    height: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    padding: calc(var(--haut-sur) + 16px) 12px calc(var(--bas-sur) + 16px) calc(var(--gauche-sur) + 16px);
  }
  .resultat-titres {
    grid-row: 2;
  }
  .resultat-zone-scene {
    grid-row: 1;
    min-height: 0;
  }
  .resultat-defile {
    padding-top: calc(var(--haut-sur) + 64px);
    padding-right: calc(var(--droite-sur) + 16px);
  }
  .ecran-secours {
    flex-direction: row;
    gap: 40px;
  }
}
/* paysage de téléphone : la fiche de la station laisserait trop peu de place à la gâchette */
@media (orientation: landscape) and (max-height: 500px) {
  .ecran-jeu .carte-station {
    display: none;
  }
  .ecran-jeu {
    --pile: calc(64px + var(--hc));
  }
  /* le Mot du verdict s'arrête avant le bouton son */
  .jeu-verdict {
    right: calc(var(--droite-sur) + 76px);
    width: calc(var(--col) - 52px);
  }
  /* « Passer l'essai » quitte la bande de l'objectif et du Mot : en haut à
     gauche, où le HUD de l'essai est vide */
  .lien-passer {
    left: calc(var(--gauche-sur) + 16px);
    right: auto;
    top: calc(var(--haut-sur) + 12px);
  }
  /* les bulles d'aide et la carte du verdict passent dans le ciel de la
     scène, au-dessus de la mascotte */
  .ecran-jeu .jeu-tuto,
  .ecran-jeu[data-mode='essai'] .jeu-tuto {
    top: calc(var(--haut-sur) + 52px);
  }
  .jeu-lecture {
    top: calc(var(--haut-sur) + 58px);
    bottom: auto;
  }
  /* le bouton principal avant le ticket : sans défiler, un seul geste pour partager */
  .resultat-percentile {
    order: -3;
  }
  .resultat-principal {
    order: -2;
  }
  .resultat-secondaires {
    order: -1;
  }
  .titre-pied .pastille {
    font-size: 0.75rem;
  }
  .choix {
    min-height: 3rem;
  }
  .choix-principal {
    min-height: 3.25rem;
  }
}

/* ===================== moins de mouvement ===================== */
@media (prefers-reduced-motion: reduce) {
  .fond-rayons,
  .badge,
  .mascotte .m-corps,
  .mascotte .m-flexible,
  .mascotte .m-feuille,
  .mascotte .m-oeil,
  .objectif.tremble {
    animation: none;
  }
}
