/* ==========================================================================
   « NDOKOTI RUN » — css/style.css
   Interface façon « enseigne peinte à la main » (docs/GAME_DESIGN.md §8) :
   panneaux crème, contours indigo, ombres décalées rouges, aplats sans dégradé.

   Le DOM est construit par js/ui.js dans #ui. Toutes les classes sont préfixées
   « dla- ». Les animations ne touchent que transform et opacity.

   Sommaire
    1. Variables                 8. Menu
    2. Page et canvas            9. HUD (course)
    3. Surcouche #ui            10. Pause
    4. Écrans                   11. Fin de course
    5. Composants               12. Crédits
    6. Logo-enseigne            13. Animations
    7. Chargement               14. Mouvement réduit
   ========================================================================== */

/* ---------------------------------------------------------------- 1. Variables */
:root {
  /* Couleurs de DLA.CONFIG.ui (js/ui.js les recopie depuis la config au démarrage) */
  --dla-primary: #FFC21A;    /* jaune soleil : bouton principal, titre */
  --dla-secondary: #12A5A0;  /* turquoise d'enseigne : devises, boutons secondaires */
  --dla-accent: #F0483C;     /* rouge d'enseigne : ombres décalées, filets fins */
  --dla-dark: #1B1F4B;       /* indigo : textes, contours */
  --dla-light: #FFF4DC;      /* crème : panneaux, texte sur sombre */
  --dla-danger: #D81E3A;     /* menace, fin de bonus */
  --dla-success: #1FB36B;    /* record, geste réussi */

  /* Couleurs d'appoint (pièce de 100 FCFA de DLA.CONFIG.coin : couronne en laiton, centre en acier, tranche ;
     plaque orange « LT »). Aucune règle ne les lit aujourd'hui : l'icône de la pièce est un SVG de js/ui.js. */
  --dla-coin-ring: #FFC52E;
  --dla-coin-core: #DCE2EC;
  --dla-coin-edge: #D08A12;
  --dla-plate: #F47B20;

  /* Polices de DLA.CONFIG.fonts */
  --dla-font-display: "Lilita One", "Arial Black", sans-serif;
  --dla-font-body: "Baloo 2", system-ui, sans-serif;
  --dla-font-script: "Permanent Marker", "Comic Sans MS", cursive;

  /* Zones sûres (encoche, coins arrondis, barre de gestes) */
  --dla-sat: env(safe-area-inset-top, 0px);
  --dla-sar: env(safe-area-inset-right, 0px);
  --dla-sab: env(safe-area-inset-bottom, 0px);
  --dla-sal: env(safe-area-inset-left, 0px);
}

/* ------------------------------------------------------------ 2. Page et canvas */
html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html {
  background: var(--dla-dark);
}

/* Fond indigo à semis de points : visible avant le premier rendu et sous l'écran de chargement */
body,
.dla-loading {
  background-color: var(--dla-dark);
  background-image:
    radial-gradient(circle, rgba(255, 244, 220, 0.1) 1.6px, rgba(255, 244, 220, 0) 2.2px),
    radial-gradient(circle, rgba(255, 244, 220, 0.1) 1.6px, rgba(255, 244, 220, 0) 2.2px);
  background-size: 26px 26px;
  background-position: 0 0, 13px 13px;
}

body {
  position: fixed;
  left: 0;
  top: 0;
  font-family: var(--dla-font-body);
  color: var(--dla-light);
}

canvas#game {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;                           /* bords de la fenêtre et non 100vh : sans dvh (Chrome < 108, iOS < 15.4), */
  bottom: 0;                          /* 100vh ignore la barre d'adresse et cache le bas de l'écran */
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}

/* Pré-chargement (index.html, D01) : texte statique visible tant que js/ui.js n'a pas construit l'interface.
   Police du système : les polices Google peuvent ne jamais arriver. */
.dla-preboot {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 16px 20px;                 /* repli : navigateur sans env() */
  padding: calc(16px + env(safe-area-inset-top, 0px)) calc(20px + env(safe-area-inset-right, 0px))
    calc(16px + env(safe-area-inset-bottom, 0px)) calc(20px + env(safe-area-inset-left, 0px));
  text-align: center;
  font: 700 18px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #FFF4DC;
  color: var(--dla-light);
  background: transparent;
}

/* C05 : titre et signature du pré-chargement (index.html, textes statiques ; retirés avec .dla-preboot quand
   l'interface démarre, gardés par le repli de js/preboot.js). Police du système, comme le message. */
.dla-preboot__title {
  position: absolute;
  left: 0;
  right: 0;
  top: 11%;
  z-index: 1;
  margin: 0;
  padding: 0 16px;
  padding: 0 calc(16px + env(safe-area-inset-right, 0px)) 0 calc(16px + env(safe-area-inset-left, 0px));
  text-align: center;
  font: 800 34px/1.1 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: clamp(28px, 6vmin, 56px);
  letter-spacing: 0.02em;
  color: #FFC21A;
  color: var(--dla-primary);
  text-shadow: 0 3px 0 #1B1F4B;
  pointer-events: none;
}

.dla-preboot__sig {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 1;
  margin: 0;
  padding: 0 16px;
  text-align: center;
  font: 700 13px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: 0.08em;
  color: #FFF4DC;
  color: var(--dla-light);
  opacity: 0.85;
  pointer-events: none;
}

.dla-noscript {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 24px;
  text-align: center;
  font: 700 18px/1.4 var(--dla-font-body);
  color: var(--dla-light);
}

/* ------------------------------------------------------------ 3. Surcouche #ui */
#ui {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;                           /* même cadre que le canvas : la fenêtre visible, barre d'adresse comprise */
  bottom: 0;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;               /* les gestes traversent vers le canvas… (voir .dla-b) */
  cursor: default;
  font-family: var(--dla-font-body);
  font-weight: 700;
  font-size: clamp(14px, calc(7px + 1.9vmin), 22px);   /* 1em = l'unité de toute l'interface */
  line-height: 1.2;
  color: var(--dla-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  --line: clamp(3px, 0.5vmin, 4.5px);                  /* épaisseur des contours */
  --btn: max(48px, 3.2em);                             /* côté d'un bouton rond (cible tactile ≥ 48 px) */
  --pt: calc(8px + var(--dla-sat));                    /* marges de sécurité */
  --pr: calc(8px + var(--dla-sar));
  --pb: calc(8px + var(--dla-sab));
  --pl: calc(8px + var(--dla-sal));
  --sig: max(26px, 1.55em);                            /* place réservée à la signature de l'auteur */
  --pbs: calc(var(--pb) + var(--sig));                 /* marge basse des écrans signés */
}

/* Signature de l'auteur (TEXT.signature) : tout en bas, centrée, hors course seulement.
   Pastille indigo à texte crème : lisible sur un décor clair comme sombre. */
.dla-sig {
  position: absolute;
  left: 50%;
  bottom: calc(var(--pb) - 2px);
  z-index: 7;
  max-width: calc(100% - var(--pl) - var(--pr));
  padding: 0.1em 0.85em 0.14em;
  border-radius: 1em;
  background: rgba(27, 31, 75, 0.82);
  color: var(--dla-light);
  font-family: var(--dla-font-body);
  font-weight: 800;
  font-size: 0.86em;                /* repli : navigateur sans min() / max() (D28) */
  font-size: max(12px, 0.7em);
  line-height: 1.25;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%);
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

#ui[data-screen="loading"] .dla-sig,
#ui[data-screen="menu"] .dla-sig,
#ui[data-screen="pause"] .dla-sig,
#ui[data-screen="gameover"] .dla-sig {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0s linear 0s;
}

#ui *,
#ui *::before,
#ui *::after {
  box-sizing: border-box;
}

/* Base de tous les boutons : ce sont les SEULS éléments qui reçoivent les gestes */
.dla-b {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: normal;
  text-align: center;
  text-transform: none;
  cursor: pointer;
  pointer-events: auto;               /* …sauf sur les boutons */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.dla-b::-moz-focus-inner {
  border: 0;
}

.dla-b:focus-visible {
  outline: var(--line) solid var(--dla-light);
  outline-offset: 3px;
}

/* Rappels adaptés à l'appareil : clavier ou doigt (classe posée sur #ui par ui.js) */
.is-touch .dla-only-keys,
.is-keys .dla-only-touch {
  display: none !important;
}

/* ------------------------------------------------------------------- 4. Écrans */
.dla-screen {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;                 /* écran éteint : ni visible, ni cliquable, ni focalisable */
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.dla-screen.is-on {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0s linear 0s;
}

/* crash test 1.3, B1 : un écran qui s'éteint (fondu de 0,2 s) ne reçoit plus de tape sur ses boutons */
.dla-screen:not(.is-on) .dla-b {
  pointer-events: none;
}

.dla-hud {
  transition-duration: 0.1s, 0s;
  transition-delay: 0s, 0.1s;
}

.dla-hud.is-on {
  transition-delay: 0s, 0s;
}

.dla-loading {
  z-index: 5;
  transition-duration: 0.3s, 0s;
  transition-delay: 0s, 0.3s;
}

.dla-loading.is-on {
  transition-delay: 0s, 0s;
}

/* Voile indigo (pause, fin de course, crédits) */
.dla-veil {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--dla-dark);
  opacity: 0.7;
}

/* Zone centrée dans les marges de sécurité */
.dla-center {
  position: absolute;
  left: var(--pl);
  right: var(--pr);
  top: var(--pt);
  bottom: var(--pbs);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------- 5. Composants */

/* Icônes : SVG en ligne dessinés par ui.js (aplats, contour indigo) */
.dla-ico {
  display: inline-flex;
  flex: none;
  width: 1em;
  height: 1em;
}

.dla-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: var(--dla-dark);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Texte clair détouré d'indigo : lisible sur n'importe quel décor, même en plein soleil */
.dla-ink {
  color: var(--dla-light);
  -webkit-text-stroke: 0.2em var(--dla-dark);
  paint-order: stroke fill;
  stroke-linejoin: round;
  text-shadow: 0 0.09em 0 var(--dla-dark);
}

/* Panneau d'enseigne : fond crème, filet épais indigo, filet fin rouge, ombre décalée */
.dla-board {
  position: relative;
  background: var(--dla-light);
  color: var(--dla-dark);
  border: var(--line) solid var(--dla-dark);
  border-radius: 1.05em;
  box-shadow: 0 0.42em 0 rgba(12, 14, 40, 0.42);
}

.dla-board::before {
  content: "";
  position: absolute;
  left: calc(var(--line) * 0.9);
  right: calc(var(--line) * 0.9);
  top: calc(var(--line) * 0.9);
  bottom: calc(var(--line) * 0.9);
  border: 1.5px solid var(--dla-accent);
  border: max(1.5px, calc(var(--line) * 0.42)) solid var(--dla-accent);
  border-radius: 0.72em;
  pointer-events: none;
}

.dla-screen.is-on .dla-board--pop {
  animation: dla-pop 0.3s cubic-bezier(0.3, 1.35, 0.5, 1) both;
}

/* Bouton d'enseigne : une face colorée posée sur une tranche rouge (l'« ombre décalée ») */
.dla-btn {
  --face: var(--dla-primary);
  --ink: var(--dla-dark);
  --depth: calc(var(--line) * 1.7);
  position: relative;
  display: inline-block;
  flex: none;
  vertical-align: middle;
  padding: 0 0 var(--depth);
  border: var(--line) solid var(--dla-dark);
  border-radius: 0.85em;
  background: var(--dla-accent);
  color: var(--ink);
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.25em;
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dla-btn::after {                     /* marge de tolérance autour de la cible tactile */
  content: "";
  position: absolute;
  left: -0.45em;
  right: -0.45em;
  top: -0.45em;
  bottom: -0.45em;
}

.dla-btn__face {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(48px - var(--depth));
  margin: calc(var(--line) * -1) calc(var(--line) * -1) 0;   /* recouvre le contour de la tranche */
  padding: 0.3em 1.15em 0.26em;
  border: var(--line) solid var(--dla-dark);
  border-radius: 0.85em;
  background: var(--face);
  transition: transform 0.07s ease-out;
}

.dla-btn:active .dla-btn__face {
  transform: translateY(calc(var(--depth) * 0.8));
}

.dla-btn__ico {
  width: 0.8em;
  height: 0.8em;
  margin-right: 0.35em;
}

.dla-btn--play {
  font-size: 2.2em;
}

.dla-btn--play .dla-btn__face {
  padding: 0.2em 1.2em 0.16em;
}

.dla-btn--big {
  font-size: 1.6em;
}

.dla-btn--second {
  --face: var(--dla-secondary);
}

.dla-btn--light {
  --face: var(--dla-light);
}

/* Bouton rond : pastille crème à contour indigo (pause, son) */
.dla-round {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--btn);
  height: var(--btn);
  border: var(--line) solid var(--dla-dark);
  border-radius: 50%;
  background: var(--dla-light);
  color: var(--dla-dark);
  box-shadow: 0 0.2em 0 var(--dla-dark);
  transition: transform 0.07s ease-out;
}

.dla-round:active {
  transform: translateY(0.14em) scale(0.95);
}

.dla-round > .dla-ico {
  width: 56%;
  height: 56%;
}

.dla-round--quiet {                   /* version discrète (crédits) : même cible tactile */
  border-color: var(--dla-light);
  background: var(--dla-dark);
  color: var(--dla-light);
  box-shadow: none;
  opacity: 0.82;
}

.dla-round--quiet > .dla-ico {
  width: 46%;
  height: 46%;
}

/* Icône du son : haut-parleur avec ou sans ondes selon .is-muted sur #ui */
.dla-snd-off,
.is-muted .dla-snd-on {
  display: none;
}

.is-muted .dla-snd-off {
  display: inline-flex;
}

/* Bouton pilule (son dans le panneau de pause) */
.dla-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.2em 1em 0.2em 0.7em;
  border: var(--line) solid var(--dla-dark);
  border-radius: 2em;
  background: var(--dla-light);
  color: var(--dla-dark);
  font-family: var(--dla-font-body);
  font-weight: 800;
  font-size: 1em;
  transition: transform 0.07s ease-out;
}

.dla-pill:active {
  transform: scale(0.95);
}

.dla-pill > .dla-ico {
  width: 1.5em;
  height: 1.5em;
  margin-right: 0.45em;
}

/* Plaque orange façon plaque minéralogique du Littoral (record, distance) */
.dla-plate {
  display: inline-flex;
  align-items: center;
  flex: none;
  height: 2em;
  padding-right: 0.6em;
  overflow: hidden;
  border: var(--line) solid var(--dla-dark);
  border-radius: 0.45em;
  background: var(--dla-plate);
  color: var(--dla-dark);
  font-family: var(--dla-font-display);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 0.16em 0 rgba(12, 14, 40, 0.45);
}

.dla-plate__lt {
  align-self: stretch;
  display: flex;
  align-items: center;
  margin-right: 0.5em;
  padding: 0 0.4em;
  background: var(--dla-dark);
  color: var(--dla-plate);
  font-size: 0.86em;
  font-size: max(12px, 0.8em);
  letter-spacing: 0.05em;
}

.dla-plate__k {
  margin-right: 0.5em;
  font-size: 0.8em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dla-plate__u {
  margin-left: 0.3em;
  font-size: 0.86em;
  font-size: max(12px, 0.8em);
}

/* Compteur à chiffres de largeur fixe : le nombre ne « danse » pas quand il défile.
   Chaque chiffre vient de son attribut data-d (un seul accès au DOM par chiffre qui change). */
.dla-num {
  display: inline-flex;
  align-items: baseline;
  flex: none;
  isolation: isolate;
  font-family: var(--dla-font-display);
  font-weight: 400;
  line-height: 1;
}

.dla-num > i {
  position: relative;
  display: inline-block;
  width: 0.64em;
  font-style: normal;
  text-align: center;
}

.dla-num > i::after {
  content: attr(data-d);
}

.dla-num > b {                        /* séparateur de milliers */
  display: inline-block;
  width: 0.2em;
}

.dla-num > .is-off {
  display: none;
}

/* Variante détourée : le contour de TOUS les chiffres est peint sous les chiffres
   (sinon le contour d'un chiffre rognerait son voisin) */
.dla-num--ink {
  color: var(--dla-light);
}

.dla-num--ink > i::before {
  content: attr(data-d);
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: -1;
  color: var(--dla-dark);
  -webkit-text-stroke: 0.22em var(--dla-dark);
  stroke-linejoin: round;
  text-shadow: 0 0.1em 0 var(--dla-dark);
}

/* Touche de clavier */
.dla-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 1.75em;
  height: 1.75em;
  padding: 0 0.4em;
  border: 2px solid var(--dla-dark);
  border: max(2px, 0.12em) solid var(--dla-dark);
  border-radius: 0.4em;
  background: var(--dla-light);
  color: var(--dla-dark);
  box-shadow: 0 0.18em 0 rgba(12, 14, 40, 0.55);
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 0.95em;
  line-height: 1;
  white-space: nowrap;
}

.dla-key > .dla-ico {
  width: 0.95em;
  height: 0.95em;
}

/* Flèches : une seule icône (vers le haut), tournée */
.dla-dir--right > .dla-svg {
  transform: rotate(90deg);
}

.dla-dir--down > .dla-svg {
  transform: rotate(180deg);
}

.dla-dir--left > .dla-svg {
  transform: rotate(-90deg);
}

/* Picto de glissement du doigt : une pastille qui file vers une flèche (dessiné vers la droite, puis tourné) */
.dla-swipe {
  position: relative;
  display: inline-block;
  flex: none;
  width: 1.5em;
  height: 1.5em;
  border: 2px solid var(--dla-light);
  border: max(2px, 0.1em) solid var(--dla-light);
  border-radius: 50%;
  background: var(--dla-dark);
}

.dla-swipe--left {
  transform: rotate(180deg);
}

.dla-swipe--up {
  transform: rotate(-90deg);
}

.dla-swipe--down {
  transform: rotate(90deg);
}

.dla-swipe__trail {
  position: absolute;
  left: 14%;
  top: 50%;
  width: 46%;
  height: 0.22em;
  margin-top: -0.11em;
  border-radius: 0.11em;
  background: var(--dla-light);
  opacity: 0.55;
  transform-origin: 0 50%;
}

.dla-swipe__finger {
  position: absolute;
  left: 12%;
  top: 50%;
  width: 0.46em;
  height: 0.46em;
  margin-top: -0.23em;
  border-radius: 50%;
  background: var(--dla-light);
}

.dla-swipe__head {
  position: absolute;
  right: 9%;
  top: 50%;
  width: 0.56em;
  height: 0.56em;
  margin-top: -0.28em;
  color: var(--dla-primary);
}

/* ---------------------------------------------------------- 6. Logo-enseigne */
/* Enseigne de salon : panneau crème penché, lettres jaunes à contour indigo et ombre
   décalée rouge posées sur une ligne de base qui danse, devise au pinceau. Tout en CSS. */
.dla-logo {
  --logo: min(11.8vw, 13.5vh, 120px);
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  flex: none;
  font-size: var(--logo);
  line-height: 1;
}

.dla-logo__sign {
  position: relative;
  /* jamais plus large que l'écran (médaillon compris) : la devise passe alors sur deux lignes */
  max-width: calc(100vw - 16px - var(--dla-sal) - var(--dla-sar) - 0.7em);
  padding: 0.1em 0.42em 0.13em;
  border: 0.07em solid var(--dla-dark);
  border-radius: 0.2em;
  background-color: var(--dla-light);
  /* patine : poussière de latérite en bas, deux coulures de pluie */
  background-image:
    radial-gradient(ellipse 0.9em 0.14em at 22% 100%, rgba(201, 112, 44, 0.3) 98%, rgba(201, 112, 44, 0) 100%),
    radial-gradient(ellipse 1.3em 0.11em at 68% 100%, rgba(201, 112, 44, 0.24) 98%, rgba(201, 112, 44, 0) 100%),
    linear-gradient(rgba(59, 59, 50, 0.1), rgba(59, 59, 50, 0.1)),
    linear-gradient(rgba(59, 59, 50, 0.08), rgba(59, 59, 50, 0.08));
  background-repeat: no-repeat;
  background-size: 100% 100%, 100% 100%, 0.035em 34%, 0.03em 22%;
  background-position: 0 0, 0 0, 86% 0, 12% 0;
  box-shadow: 0.03em 0.09em 0 rgba(12, 14, 40, 0.4);
  transform: rotate(-3deg);
  transform-origin: 50% 0;
}

.dla-logo__sign::before {             /* filet fin rouge */
  content: "";
  position: absolute;
  left: 0.05em;
  right: 0.05em;
  top: 0.05em;
  bottom: 0.05em;
  border: 1.5px solid var(--dla-accent);
  border: max(1.5px, 0.02em) solid var(--dla-accent);
  border-radius: 0.12em;
  pointer-events: none;
}

.dla-logo__title {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: center;
  white-space: nowrap;
  font-family: var(--dla-font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0.02em;
  color: var(--dla-primary);
  -webkit-text-stroke: 0.13em var(--dla-dark);
  paint-order: stroke fill;
  stroke-linejoin: round;
  text-shadow: 0.045em 0.06em 0 var(--dla-accent);
}

.dla-logo__w {
  display: inline-flex;
  margin-right: 0.24em;
}

.dla-logo__w:last-child {
  margin-right: 0;
}

.dla-logo__w.is-punct {
  margin-left: -0.1em;
}

.dla-logo__l {
  display: inline-block;
  transform: translateY(var(--y, 0em)) rotate(var(--r, 0deg));
}

.dla-logo__tag {
  position: relative;
  margin-top: 0.06em;
  font-family: var(--dla-font-script);
  font-weight: 400;
  font-size: 16px;
  font-size: max(16px, 0.25em);
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
  color: var(--dla-secondary);
}

.dla-logo__arrow {
  width: 1.15em;
  height: 0.8em;
  margin-left: 0.3em;
  vertical-align: -0.08em;
}

/* Médaillon « demi-tête » : le logo du héros, collé sur le coin du panneau */
.dla-logo__head {
  position: absolute;
  left: -0.4em;
  top: -0.36em;
  width: 0.84em;
  height: 0.84em;
  transform: rotate(-8deg);
}

/* Plaque du record, accrochée sous l'enseigne par deux chaînettes */
.dla-logo__hang {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: 0.02em;
  padding-top: 0.15em;
  font-size: 13px;
  font-size: max(13px, 0.2em);
  transform: rotate(1.5deg);
}

.dla-logo__hang.is-off {
  visibility: hidden;
}

.dla-logo__hang::before,
.dla-logo__hang::after {
  content: "";
  position: absolute;
  top: -0.5em;
  width: var(--line);
  height: 1.3em;
  background: var(--dla-dark);
  border-radius: 2px;
}

.dla-logo__hang::before {
  left: 18%;
}

.dla-logo__hang::after {
  right: 18%;
}

.dla-logo__plate {
  position: relative;
  z-index: 1;
}

.dla-screen.is-on .dla-logo__l {
  animation: dla-letter 0.55s cubic-bezier(0.25, 1.5, 0.45, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms + 120ms);
}

.dla-screen.is-on .dla-logo__sign {
  animation: dla-swing 5s ease-in-out infinite;
}

/* ------------------------------------------------------------- 7. Chargement */
.dla-loading__in {
  position: absolute;
  left: var(--pl);
  right: var(--pr);
  top: var(--pt);
  bottom: var(--pbs);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.dla-loading .dla-logo {
  --logo: min(11.2vw, 15vh, 110px);
  margin-top: 0.1em;
}

/* Barre de progression : une bande de cheveux qu'une tondeuse rase de gauche à droite */
.dla-hairbar {
  width: 82vw;
  max-width: 25em;
  width: min(82vw, 25em);
  margin-top: 2.6em;
}

.dla-hairbar__track {
  position: relative;
  height: 2.2em;
  border: var(--line) solid var(--dla-light);
  border-radius: 0.6em;
  /* ce qui reste après le passage de la tondeuse : un dégradé net, en trois aplats */
  background: linear-gradient(to bottom, #2B1D17 0, #2B1D17 30%, #5E3D2A 30%, #5E3D2A 60%, #9A6644 60%, #9A6644 100%);
}

.dla-hairbar__win {                   /* fenêtre fixe : rogne les cheveux pas encore coupés */
  position: absolute;
  left: 0;
  right: 0;
  top: -0.85em;
  bottom: 0;
  overflow: hidden;
  border-radius: 0 0.38em 0.38em 0;
}

.dla-hairbar__move,
.dla-hairbar__hair,
.dla-hairbar__rail {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.dla-hairbar__move {                  /* son bord gauche = la tondeuse : rien des cheveux ne dépasse à gauche */
  overflow: hidden;
}

.dla-hairbar__hair {                  /* afro : frise de bosses puis aplat */
  background-image:
    radial-gradient(circle at 50% 100%, #17110F 0.48em, rgba(23, 17, 15, 0) 0.5em),
    linear-gradient(#17110F, #17110F);
  background-repeat: repeat-x, no-repeat;
  background-size: 0.86em 0.56em, 100% 100%;
  background-position: 0 0.12em, 0 0.66em;
}

.dla-hairbar__clipper {
  position: absolute;
  left: 0;
  top: 50%;
  width: 3.3em;
  height: 3.3em;
  margin: -2.3em 0 0 -1.9em;
  transform: rotate(152deg);
}

.dla-hairbar__clipper > .dla-ico {
  width: 100%;
  height: 100%;
  animation: dla-vibrate 0.14s linear infinite;
}

.dla-hairbar__clipper .dla-svg {
  stroke: var(--dla-light);           /* contour clair : la tondeuse se détache du fond indigo */
}

/* Sans progression chiffrée (setLoading jamais appelé) : la tondeuse avance toute seule */
.dla-loading:not(.has-p) .dla-hairbar__move,
.dla-loading:not(.has-p) .dla-hairbar__rail {
  animation: dla-load-fwd 2.6s cubic-bezier(0.2, 0.6, 0.3, 1) both;
}

.dla-loading:not(.has-p) .dla-hairbar__hair {
  animation: dla-load-back 2.6s cubic-bezier(0.2, 0.6, 0.3, 1) both;
}

.dla-hairbar__pct {
  min-height: 1.2em;
  margin-top: 0.45em;
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.25em;
  color: var(--dla-primary);
}

.dla-loading__label {
  margin-top: 0.2em;
  max-width: 24em;
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.3em;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.dla-loading__tip {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 26em;
  width: min(100%, 26em);
  min-height: 3.9em;
  margin-top: 0.9em;
  font-weight: 500;
  font-size: 1em;
  line-height: 1.3;
  text-wrap: balance;
  opacity: 0.86;
  transition: opacity 0.2s ease;
}

.dla-loading__tip.is-out {
  opacity: 0;
}

/* Le moteur 3D n'a pas démarré : message d'erreur à la place de la progression */
.dla-loading.is-error .dla-hairbar,
.dla-loading.is-error .dla-loading__tip {
  display: none;
}

/* Bouton Recharger : seulement sur l'écran d'erreur (D01) */
.dla-loading__reload {
  display: none;
}

.dla-loading.is-error .dla-loading__reload {
  display: inline-block;
  margin-top: 1.3em;
  font-size: 1.35em;
}

.dla-loading.is-error .dla-loading__label {
  margin-top: 2em;
  padding: 0.7em 1em;
  border: var(--line) solid var(--dla-dark);
  border-radius: 0.8em;
  background: var(--dla-light);
  color: var(--dla-dark);
  box-shadow: 0.3em 0.3em 0 var(--dla-accent);
  font-family: var(--dla-font-body);
  font-weight: 700;
  font-size: 1.1em;
  line-height: 1.35;
  letter-spacing: 0;
}

/* --------------------------------------------------------------------- 8. Menu */
/* Le héros 3D est derrière : titre en haut, bouton en bas, centre dégagé. */
.dla-menu__top {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--pt) + var(--btn) + 0.7em + 2px);   /* (28/11) + 2 px : la petite tête du logo ne touche plus le bouton (i) */
  display: flex;
  justify-content: center;
}

.dla-menu__info,
.dla-menu__sound {
  position: absolute;
  top: var(--pt);
}

.dla-menu__info {
  left: var(--pl);
}

.dla-menu__sound {
  right: var(--pr);
}

.dla-menu__bottom {
  position: absolute;
  left: var(--pl);
  right: var(--pr);
  bottom: calc(var(--pbs) + 0.1em);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dla-screen.is-on .dla-btn--play {
  animation: dla-pulse 1.2s ease-in-out infinite;
}

.dla-menu__tap {
  margin-top: 0.7em;
  font-weight: 800;
  font-size: 0.95em;
  line-height: 1.2;
  text-align: center;
}

/* Rappel des commandes : pilule indigo, pictos de touches ou de glissement */
.dla-hint {
  max-width: 100%;
  margin-top: 0.65em;
  padding: 0.5em 0.95em 0.55em;
  border-radius: 1.2em;
  background: var(--dla-dark);
  color: var(--dla-light);
  font-weight: 700;
  font-size: 0.86em;
  line-height: 1.2;
}

.dla-hint__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5em 1.1em;
}

.dla-hint__pre {
  flex: 0 0 100%;
  text-align: center;
  color: var(--dla-primary);
}

.dla-hint__seg {
  display: inline-flex;
  align-items: center;
  gap: 0.32em;
  white-space: nowrap;
}

.dla-hint__lbl {
  margin-left: 0.12em;
}

.dla-hint__or {
  opacity: 0.75;
}

@media (orientation: landscape) {
  .dla-menu__top {
    top: calc(var(--pt) + 0.2em + 8px);   /* (28/11) + 8 px : la petite tête du logo ne sort plus par le haut de l'écran */
  }

  .dla-hint__pre {
    flex: 0 0 auto;
  }
}

/* Écrans courts : on garde le bouton, on retire la ligne d'invitation */
@media (orientation: portrait) and (max-height: 700px), (orientation: landscape) and (max-height: 430px) {
  .dla-menu__tap {
    display: none;
  }
}

/* Portrait court (320×568…) : bas d'écran plus compact pour laisser voir les baskets de Molo */
@media (orientation: portrait) and (max-height: 700px) {
  .dla-btn--play {
    font-size: 1.75em;
  }

  .dla-btn--play .dla-btn__face {
    padding: 0.14em 1.1em 0.1em;
  }

  .dla-hint {
    margin-top: 0.45em;
    padding: 0.3em 0.8em 0.36em;
    font-size: 0.86em;
    font-size: max(12px, 0.82em);     /* jamais sous 12 px (D29) ; navigateur ancien : la ligne du dessus */
  }

  .dla-hint__row {
    gap: 0.25em 0.9em;
  }
}

@media (orientation: landscape) and (max-height: 430px) {
  .dla-btn--play {
    font-size: 1.9em;
  }

  .dla-hint {
    margin-top: 0.5em;
    padding: 0.35em 0.9em 0.4em;
  }
}

/* ---------------------------------------------------------------------- 9. HUD */
/* Tout tient dans le tiers haut et le coin bas gauche : le centre et le bas sont au héros. */

/* Menace : vignette rouge douce sur les bords quand Prosper est tout près */
.dla-vignette,
.dla-vignette__flash {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 15vmin 2.5vmin var(--dla-danger);
  opacity: 0;
}

.dla-vignette__flash.is-a {
  animation: dla-flash-a 0.5s ease-out both;
}

.dla-vignette__flash.is-b {
  animation: dla-flash-b 0.5s ease-out both;
}

/* Haut gauche : pause (+ distance en paysage) */
.dla-hud__tl {
  position: absolute;
  left: var(--pl);
  top: var(--pt);
  display: flex;
  align-items: center;
}

.dla-hud__dist {
  display: none;
  margin-left: 0.5em;
  font-size: 1.05em;
}

.dla-hud.is-under .dla-hud__pause,
.dla-hud.is-dying .dla-hud__pause {
  visibility: hidden;
}

/* Haut droite : multiplicateur + score, pièces dessous */
.dla-hud__tr {
  position: absolute;
  right: var(--pr);
  top: var(--pt);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.dla-hud__scoreRow {
  display: flex;
  align-items: center;
  min-height: 2.4em;
}

.dla-score {
  font-size: 2em;
}

.dla-mult {                           /* caché à ×1 : n'apparaît qu'avec le Gombo (classe is-on posée par ui.js) */
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 2.2em;
  height: 1.75em;
  margin-right: 0.4em;
  padding: 0.06em 0.36em 0;
  border: var(--line) solid var(--dla-dark);
  border-radius: 0.9em;
  background: var(--dla-primary);
  color: var(--dla-dark);
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.2em;
  line-height: 1;
  transform-origin: 100% 50%;
  transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.dla-mult.is-on {
  display: flex;
}

.dla-mult.is-boost {                  /* Gombo actif : la pastille grossit et passe au vert */
  background: var(--dla-success);
  color: var(--dla-light);
  transform: scale(1.22);
}

.dla-hud__coins {
  display: flex;
  align-items: center;
  margin-top: 0.1em;
  transform-origin: 100% 50%;
}

.dla-hud__coins.is-a {
  animation: dla-bump-a 0.15s ease-out;
}

.dla-hud__coins.is-b {
  animation: dla-bump-b 0.15s ease-out;
}

/* (lot 3 §3) pièces volées : le compteur tremble et clignote en rouge 0,6 s (deux classes alternées : un second vol
   relance l'animation). Seule la couleur des chiffres et de « FCFA » change : aucun nouveau contour au trait. */
.dla-hud__coins.is-loss-a {
  animation: dla-loss-shake-a 0.6s linear;
}

.dla-hud__coins.is-loss-b {
  animation: dla-loss-shake-b 0.6s linear;
}

.dla-hud__coins.is-loss-a .dla-coins__num,
.dla-hud__coins.is-loss-a .dla-coins__unit {
  animation: dla-loss-blink-a 0.6s steps(1, end);
}

.dla-hud__coins.is-loss-b .dla-coins__num,
.dla-hud__coins.is-loss-b .dla-coins__unit {
  animation: dla-loss-blink-b 0.6s steps(1, end);
}

.dla-coinico {
  width: 1.55em;
  height: 1.55em;
  margin-right: 0.35em;
}

.dla-coins__num {
  font-size: 1.3em;
}

.dla-coins__unit {
  margin-left: 0.32em;
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 0.86em;
  line-height: 1;
  letter-spacing: 0.03em;
}

/* Bonus actifs. Portrait : rangée de pastilles sous le bouton pause. Paysage : colonne en bas à gauche. */
.dla-gauges {
  position: absolute;
  left: var(--pl);
  top: calc(var(--pt) + var(--btn) + 0.45em);
  display: flex;
  flex-direction: row;
  align-items: flex-start;
}

.dla-gauge {
  --pu: var(--dla-secondary);
  display: none;
  flex-direction: column;
  align-items: stretch;
  width: 2.5em;
  margin-right: 0.3em;
}

.dla-gauge.is-on {
  display: flex;
  animation: dla-pop 0.25s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}

.dla-gauge.is-on.is-ending {
  animation: dla-blink 0.44s linear infinite;
}

.dla-gauge__ico {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.5em;
  height: 2.5em;
  border: var(--line) solid var(--dla-dark);
  border-radius: 50%;
  background: var(--pu);
}

.dla-gauge__ico > .dla-ico {
  width: 1.7em;
  height: 1.7em;
}

.dla-gauge__glyph {                   /* icône textuelle (« ×2 ») */
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.15em;
  line-height: 1;
}

.dla-gauge__body {
  display: block;
  margin-top: 0.15em;
}

.dla-gauge__name {
  display: none;
}

.dla-gauge__track {
  display: block;
  height: 0.46em;
  overflow: hidden;
  border-radius: 0.23em;
  background: var(--dla-dark);
  box-shadow: 0 0 0 1.5px var(--dla-dark);
}

.dla-gauge__bar {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--pu);
  transform-origin: 0 50%;
}

.dla-gauge.is-ending .dla-gauge__bar {
  background: var(--dla-danger);
}

/* Haut centre : bandeau de quartier et tutoriel (même emplacement, jamais ensemble) */
.dla-hud__mid {
  position: absolute;
  left: var(--pl);
  right: var(--pr);
  top: calc(var(--pt) + var(--btn) + 4.1em);
  display: flex;
  justify-content: center;
}

.dla-banner__board,
.dla-tuto__card {
  display: flex;
  align-items: center;
  max-width: 100%;
  border: var(--line) solid var(--dla-dark);
  border-radius: 0.85em;
  background: var(--dla-light);
  color: var(--dla-dark);
  box-shadow: 0 0.32em 0 rgba(12, 14, 40, 0.42);
  opacity: 0;
}

/* Bandeau : panneau directionnel, nom en capitales, accroche au pinceau */
.dla-banner__board {
  padding: 0.35em 0.95em 0.4em 0.6em;
}

.dla-banner.is-a .dla-banner__board {
  animation: dla-banner-a 2.5s both;
}

.dla-banner.is-b .dla-banner__board {
  animation: dla-banner-b 2.5s both;
}

.dla-banner__arrow {
  width: 2.1em;
  height: 2.1em;
  margin-right: 0.6em;
}

.dla-banner__star {
  display: none;
  width: 2.1em;
  height: 2.1em;
  margin-right: 0.6em;
}

.dla-banner.is-record .dla-banner__arrow {
  display: none;
}

.dla-banner.is-record .dla-banner__star {
  display: inline-flex;
}

.dla-banner__txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dla-banner__kicker {
  margin-bottom: 0.1em;
  font-weight: 800;
  font-size: 0.8em;
  line-height: 1.1;
  color: var(--dla-accent);
}

.dla-banner__kicker:empty,
.dla-banner__sub:empty {
  display: none;
}

.dla-banner__name {
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.7em;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 0.06em 0.07em 0 var(--dla-accent);
}

.dla-banner__sub {
  margin-top: 0.12em;
  font-family: var(--dla-font-script);
  font-weight: 400;
  font-size: 16px;
  font-size: max(16px, 1.02em);
  line-height: 1.15;
  color: var(--dla-secondary);
}

.dla-banner.is-record .dla-banner__board {
  background: var(--dla-primary);
}

.dla-banner.is-record .dla-banner__sub {
  color: var(--dla-dark);
}

/* (27/11) CONSIGNE DU TIR sous la puce du lance-pierre (texte existant kwHowTap / kwHowKey / kwHowAuto) : un doigt qui tape (pastille qui
   pulse, animations existantes) ; colonne du haut droite, jamais au milieu de la route */
.dla-hud__slinghow {
  display: none;
  align-items: center;
  max-width: 10.5em;
  margin-top: 0.3em;
  padding: 0.22em 0.6em 0.26em 0.28em;
  border: var(--line) solid var(--dla-dark);
  border-radius: 1em;
  box-sizing: border-box;
  background: var(--dla-primary);
  color: var(--dla-dark);
  font: 800 0.8em/1.12 var(--dla-font-body);
  text-align: left;
  box-shadow: 0 0.18em 0 rgba(12, 14, 40, 0.35);
}

.dla-hud__slinghow.is-on {
  display: flex;
  animation: dla-crois-in 0.35s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

.dla-slinghow__tap {
  position: relative;
  flex: none;
  width: 1.7em;
  height: 1.7em;
  margin-right: 0.4em;
  border: 2px solid var(--dla-dark);
  border-radius: 50%;
  box-sizing: border-box;
  background: var(--dla-light);
  animation: dla-pulse 1.1s ease-in-out infinite;
}

.dla-slinghow__dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.62em;
  height: 0.62em;
  margin: -0.31em 0 0 -0.31em;
  border-radius: 50%;
  background: var(--dla-dark);
  animation: dla-key-press 1.1s ease-in-out infinite;
}

.dla-hud__slinghow.is-keys .dla-slinghow__tap {
  display: none;
}

.dla-hud__slinghow.is-keys {
  padding-left: 0.6em;
  animation: dla-crois-in 0.35s cubic-bezier(0.3, 1.5, 0.5, 1) both, dla-pulse 1.1s ease-in-out 0.35s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .dla-hud__slinghow.is-on,
  .dla-slinghow__tap,
  .dla-slinghow__dot {
    animation: none;
  }
}

/* (§13.13 k) annonce du mode d'un personnage : le bandeau du record, nom écrit tel quel (texte exact du client, minuscules comprises) */
.dla-banner.is-mode .dla-banner__name {
  text-transform: none;
  letter-spacing: 0.01em;
}

/* Tutoriel des 4 gestes : un geste à la fois, coché dès qu'il est fait */
.dla-tuto__card {
  padding: 0.3em 0.95em 0.34em 0.4em;
  transform: translateY(-140%);
  transition: transform 0.22s ease-in, opacity 0.18s ease-in;
}

.dla-tuto.is-on .dla-tuto__card {
  opacity: 1;
  transform: translateY(0) rotate(-1deg);
  transition: transform 0.32s cubic-bezier(0.3, 1.45, 0.5, 1), opacity 0.15s ease-out;
}

.dla-hud.is-dying .dla-tuto,
.dla-hud.is-under .dla-tuto {
  visibility: hidden;
}

.dla-tuto__pic {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 3.2em;
  height: 3.2em;
  margin-right: 0.7em;
  padding: 0 0.45em;
  border-radius: 0.75em;
  background: var(--dla-dark);
  color: var(--dla-light);
}

.dla-gest {
  display: none;
  align-items: center;
  justify-content: center;
}

.dla-tuto__card[data-step="left"] .dla-gest[data-g="left"],
.dla-tuto__card[data-step="right"] .dla-gest[data-g="right"],
.dla-tuto__card[data-step="jump"] .dla-gest[data-g="jump"],
.dla-tuto__card[data-step="roll"] .dla-gest[data-g="roll"] {
  display: flex;
}

.dla-gest__touch,
.dla-gest__keys {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dla-gest__keys > * + * {
  margin-left: 0.3em;
}

.dla-gest .dla-swipe {
  font-size: 1.6em;
  border-color: transparent;
  background: none;
}

.dla-gest .dla-swipe__trail {
  animation: dla-swipe-trail 1.1s ease-out infinite;
}

.dla-gest .dla-swipe__finger {
  animation: dla-swipe-finger 1.1s ease-out infinite;
}

.dla-gest .dla-key {
  font-size: 1.1em;
  animation: dla-key-press 1.1s ease-in-out infinite;
}

.dla-gest .dla-hint__or {
  font-size: 0.8em;
}

.dla-tuto__ok {                       /* coche verte du geste réussi */
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.5em;
  height: 2.5em;
  margin: -1.25em 0 0 -1.25em;
  padding: 0.5em;
  border-radius: 50%;
  background: var(--dla-success);
  color: var(--dla-light);
  opacity: 0;
  transform: scale(0.3);
}

.dla-tuto__ok > .dla-ico {
  width: 100%;
  height: 100%;
}

.dla-tuto.is-ok .dla-tuto__ok {
  opacity: 1;
  transform: scale(1);
  transition: transform 0.22s cubic-bezier(0.3, 1.6, 0.5, 1), opacity 0.1s linear;
}

.dla-tuto.is-ok .dla-gest {
  opacity: 0;
}

.dla-tuto__side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.dla-tuto__label {
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.25em;
  line-height: 1.02;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dla-tuto__pips {
  display: flex;
  margin-top: 0.35em;
}

.dla-tuto__pips > i {
  width: 0.62em;
  height: 0.62em;
  margin-right: 0.3em;
  border: 2px solid var(--dla-dark);
  border-radius: 50%;
  background: transparent;
}

.dla-tuto__pips > i.is-cur {
  background: var(--dla-primary);
}

.dla-tuto__pips > i.is-done {
  background: var(--dla-success);
}

/* (tuto, dev/CONTRACT.md §13.12) Carte guidée (.is-big, posée par js/ui.js) : l'action entière, en grand, près du héros.
   Debout : centrée sous ses pieds, au-dessus de la tondeuse. Couché : en bas, à droite du héros. Le bandeau du quartier
   garde le haut de l'écran : les deux se voient ensemble. */
.dla-tuto.is-big {
  top: auto;
  bottom: calc(var(--pb) + var(--btn) + 1.2em);
}

.dla-tuto.is-big .dla-tuto__card {
  padding: 0.3em 0.9em 0.34em 0.4em;
  font-size: 1.3em;
  transform: translateY(70%);
}

.dla-tuto.is-big.is-on .dla-tuto__card {
  transform: translateY(0) rotate(-1deg);
}

.dla-tuto.is-big .dla-tuto__label {
  font-size: 1.2em;
  white-space: nowrap;
}

.dla-tuto.is-big .dla-tuto__pips {
  margin-top: 0.25em;
}

/* le doigt animé (le pictogramme de glissement d'avant), deux fois plus grand dans la grande carte */
.dla-tuto.is-big .dla-tuto__pic {
  min-width: 3.5em;
  height: 3.5em;
  margin-right: 0.6em;
}

.dla-tuto.is-big .dla-gest .dla-swipe {
  font-size: 2.15em;
}

.dla-tuto__why {                      /* petite ligne : « pour sauter », « attends le signal » */
  margin-top: 0.12em;
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 0.82em;
  line-height: 1.1;
  letter-spacing: 0.01em;
  opacity: 0.82;
}

.dla-tuto__why:empty {
  display: none;
}

/* annonce d'un saut ou d'une roulade (« Bientôt : saute ») : carte calme, le doigt ne bouge pas encore */
.dla-tuto.is-soon .dla-tuto__card {
  background: #E9E3D4;
}

.dla-tuto.is-soon .dla-gest {
  opacity: 0.4;
}

.dla-tuto.is-soon .dla-gest .dla-swipe__trail,
.dla-tuto.is-soon .dla-gest .dla-swipe__finger,
.dla-tuto.is-soon .dla-gest .dla-key {
  animation: none;
}

/* le signal : c'est maintenant (la carte passe au jaune et grossit d'un coup) */
.dla-tuto.is-big.is-on.is-go .dla-tuto__card {
  background: var(--dla-primary);
  transform: translateY(-6%) scale(1.12) rotate(-1deg);
  transition: transform 0.16s cubic-bezier(0.3, 1.7, 0.5, 1), background-color 0.08s linear;
}

/* téléphone étroit debout : « GLISSE VERS LE HAUT » remplit déjà la largeur, la carte du signal ne grossit pas */
@media (orientation: portrait) and (max-width: 374px) {
  .dla-tuto.is-big.is-on.is-go .dla-tuto__card {
    transform: translateY(-6%) rotate(-1deg);
  }
}

/* debout, la bulle de Prosper (bas gauche) est au même endroit que la grande carte : elle lui cède la place */
@media (orientation: portrait) {
  .dla-hud.is-tuto .dla-bubble {
    visibility: hidden;
  }
}

/* petit téléphone debout : la carte descend d'un cran pour ne pas couvrir les pieds du héros */
@media (orientation: portrait) and (max-height: 640px) {
  .dla-tuto.is-big {
    bottom: calc(var(--pb) + var(--btn) + 0.15em);
  }

  .dla-tuto.is-big .dla-tuto__card {
    font-size: 1.2em;
  }
}

/* couché : en bas à droite, contre le bord (le héros est au centre) ; le signal grossit vers la gauche */
@media (orientation: landscape) {
  .dla-tuto.is-big {
    left: 56%;
    right: calc(var(--pr) + 0.9em);
    bottom: calc(var(--pb) + 1em);
    justify-content: flex-end;
  }

  .dla-tuto.is-big .dla-tuto__card {
    font-size: 1.1em;
    transform-origin: 100% 100%;
  }

  .dla-tuto.is-big.is-on.is-go .dla-tuto__card {
    transform: scale(1.1) rotate(-1deg);
  }
}

/* Toasts : répliques courtes, entre 20 % et 35 % de la hauteur */
.dla-toasts {
  position: absolute;
  left: var(--pl);
  right: var(--pr);
  top: calc(var(--pt) + var(--btn) + 10.2em);
  top: max(20%, calc(var(--pt) + var(--btn) + 10.2em));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dla-toast {
  max-width: 20em;
  max-width: min(100%, 20em);
  min-height: 1.3em;
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.55em;
  line-height: 1.12;
  letter-spacing: 0.02em;
  word-spacing: 0.14em;                /* le contour épais mange l'espace étroit de Lilita One */
  text-align: center;
  text-wrap: balance;
  text-shadow: 0.07em 0.09em 0 var(--dla-accent);
  opacity: 0;
}

.dla-toast.is-a {
  animation: dla-toast-a 1.25s both;
}

.dla-toast.is-b {
  animation: dla-toast-b 1.25s both;
}

/* Chiffre du 3-2-1 de reprise (ui.js, toast) : quatre fois plus grand, au centre, sans montée, un seul à la fois.
   Hors flux : il ne décale pas les répliques voisines. */
.dla-toast--count {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  max-width: none;
  font-size: 6.2em;
  line-height: 1;
  -webkit-text-stroke-width: 0.12em;
}

.dla-toast--count.is-a {
  animation: dla-count-a 0.75s both;
}

.dla-toast--count.is-b {
  animation: dla-count-b 0.75s both;
}

/* Bas gauche : la tondeuse de Prosper qui vibre, et son cri dans une bulle peinte */
.dla-threat {
  position: absolute;
  left: var(--pl);
  bottom: var(--pb);
  display: flex;
  flex-direction: column-reverse;     /* portrait : la bulle au-dessus de la tondeuse */
  align-items: flex-start;
  max-width: calc(100% - var(--pl) - var(--pr));
}

.dla-threat__ico {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--btn);
  height: var(--btn);
  border: var(--line) solid var(--dla-dark);
  border-radius: 50%;
  background: var(--dla-danger);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.15s linear, transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.dla-threat.is-on .dla-threat__ico {
  opacity: 1;
  transform: scale(1);
}

.dla-threat__ico > .dla-ico {
  width: 68%;
  height: 68%;
}

.dla-threat.is-on .dla-threat__ico > .dla-ico {
  animation: dla-vibrate 0.12s linear infinite;
}

.dla-bubble {
  position: relative;
  max-width: 17em;
  max-width: min(72vw, 17em);
  margin: 0 0 0.75em 0.2em;
  padding: 0.4em 0.75em 0.42em;
  border: var(--line) solid var(--dla-dark);
  border-radius: 0.95em;
  background: var(--dla-light);
  color: var(--dla-dark);
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1em;
  line-height: 1.15;
  letter-spacing: 0.01em;
  opacity: 0;
  transform-origin: 1.4em 130%;
}

.dla-bubble::after {                  /* queue de la bulle, vers la tondeuse */
  content: "";
  position: absolute;
  left: 1em;
  bottom: calc(-0.36em - var(--line));
  width: 0.72em;
  height: 0.72em;
  border: var(--line) solid var(--dla-dark);
  border-left-color: transparent;
  border-top-color: transparent;
  background: var(--dla-light);
  background-clip: padding-box;
  transform: rotate(45deg);
}

.dla-bubble.is-a {
  animation: dla-bubble-a 1.4s both;
}

.dla-bubble.is-b {
  animation: dla-bubble-b 1.4s both;
}

@media (orientation: landscape) {
  .dla-hud__dist {
    display: inline-flex;
  }

  .dla-hud__mid {
    left: calc(var(--pl) + 12.5em);
    right: calc(var(--pr) + 12.5em);
    top: var(--pt);
  }

  .dla-toasts {
    top: calc(var(--pt) + 6.6em);
    top: max(22%, calc(var(--pt) + 6.6em));
  }

  /* (§13.13 k) jauge du mode d'un personnage : son annonce se lit ENTIÈRE, la pastille s'allonge (14 em au plus) */
  .dla-gauge--mode .dla-gauge__body {
    width: auto;
    min-width: 8.2em;
    max-width: 14em;
  }

  .dla-gauge--mode .dla-gauge__name {
    overflow: visible;
    text-overflow: clip;
  }

  /* bonus : colonne de jauges (pastille + nom + barre) au-dessus de la tondeuse */
  .dla-gauges {
    top: auto;
    bottom: calc(var(--pb) + var(--btn) + 0.6em);
    flex-direction: column;
  }

  .dla-gauge {
    flex-direction: row;
    align-items: center;
    width: auto;
    margin: 0.4em 0 0;
  }

  .dla-gauge__body {
    width: 8.2em;
    margin: 0 0 0 -1.1em;
    padding: 0.18em 0.6em 0.3em 1.45em;
    border: var(--line) solid var(--dla-dark);
    border-radius: 0 0.8em 0.8em 0;
    background: var(--dla-light);
  }

  .dla-gauge__name {
    display: block;
    overflow: hidden;
    margin-bottom: 0.14em;
    font-family: var(--dla-font-display);
    font-weight: 400;
    font-size: 0.8em;
    line-height: 1.1;
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--dla-dark);
  }

  .dla-gauge.is-ending .dla-gauge__name {
    color: var(--dla-danger);
  }

  .dla-threat {
    flex-direction: row;              /* paysage : la bulle à droite de la tondeuse */
    align-items: center;
  }

  .dla-bubble {
    margin: 0 0 0 0.85em;
    transform-origin: -0.6em 50%;
  }

  .dla-bubble::after {
    left: calc(-0.36em - var(--line));
    bottom: auto;
    top: 50%;
    margin-top: -0.36em;
    border-color: var(--dla-dark);
    border-top-color: transparent;
    border-right-color: transparent;
  }
}

/* -------------------------------------------------------------------- 10. Pause */
.dla-pause__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 19em;
  width: min(100%, 19em);
  max-height: 100%;
  padding: 1.1em 1.2em 1.2em;
}

.dla-pause__title {
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 2em;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0.055em 0.065em 0 var(--dla-accent);
}

.dla-pause__btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.8em;
}

.dla-pause__btns > .dla-btn {
  flex: 1 1 100%;
  min-width: 0;                       /* sinon la largeur du texte (nowrap) l'emporte sur flex-basis */
  margin-top: 0.6em;
}

.dla-pause__btns .dla-btn__face {
  padding-left: 0.6em;                /* boutons étirés : la marge latérale ne sert qu'à ne pas déborder */
  padding-right: 0.6em;
  white-space: normal;                /* dernier recours sur très petit écran : retour à la ligne plutôt que débordement */
}

.dla-pause__panel > .dla-pill {
  margin-top: 1em;
}

@media (orientation: landscape) and (max-height: 430px) {
  .dla-pause__panel {
    width: 100%;
    max-width: 28em;
    width: min(100%, 28em);
    padding: 0.8em 1.1em 0.9em;
  }

  .dla-pause__title {
    font-size: 1.7em;
  }

  .dla-pause__btns {
    justify-content: center;
    gap: 0 0.6em;
    margin-top: 0.35em;
  }

  .dla-pause__btns > .dla-btn {       /* « rejouer » et « menu » côte à côte, même largeur */
    flex: 1 1 0;
    font-size: 1.1em;
  }

  .dla-pause__btns > .dla-btn--big {
    flex: 1 1 100%;
  }

  .dla-pause__panel > .dla-pill {
    margin-top: 0.7em;
  }
}

/* Mention « bouton silence » (iOS, son actif : classes is-ios et is-muted posées par js/ui.js, D30).
   .dla-silent place la mention et garde la taille de texte de #ui : --btn vaut max(48px, 3.2em) et se calcule sur
   l'élément qui s'en sert, un texte réduit ici décalerait la mention sous le bouton (tablettes, grands écrans).
   Le texte réduit est dans .dla-silent__txt. */
.dla-silent {
  display: none;
  line-height: 0;                     /* la boîte prend exactement la hauteur du texte intérieur */
}

.dla-silent__txt {
  display: inline-block;
  vertical-align: top;
  font-weight: 700;
  font-size: 0.72em;
  font-size: max(12px, 0.72em);
  line-height: 1.2;
}

.is-ios:not(.is-muted) .dla-silent {
  display: block;
}

.dla-menu__silent {                   /* portrait : sur la ligne des boutons ronds, à gauche du son */
  position: absolute;
  top: calc(var(--pt) + var(--btn) * 0.5);
  right: calc(var(--pr) + var(--btn) + 0.4em);
  max-width: calc(100% - var(--pl) - var(--pr) - var(--btn) * 2 - 0.8em);
  text-align: right;
  transform: translateY(-50%);
}

.dla-menu__silent .dla-silent__txt {
  padding: 0.25em 0.75em 0.3em;
  border-radius: 1em;
  background: rgba(27, 31, 75, 0.82);
  color: var(--dla-light);
}

@media (orientation: landscape) {
  .dla-menu__silent {                 /* paysage : le logo occupe le haut, la mention passe sous le bouton du son */
    top: calc(var(--pt) + var(--btn) + 0.4em);
    right: var(--pr);
    max-width: none;
    transform: none;
  }

  .dla-menu__silent .dla-silent__txt {
    max-width: 11em;
  }
}

/* tablette en paysage (iPad) : l'enseigne du titre, large de 101vh (898 px au plus), ne laisse à droite qu'une
   colonne étroite ; la mention s'y tient, en petit, sans mordre sur l'enseigne */
@media (orientation: landscape) and (max-aspect-ratio: 3/2) {
  .dla-menu__silent .dla-silent__txt {
    font-size: 12px;
    max-width: max(96px, calc(50vw - min(51.5vh, 455px) - var(--pr)));
  }
}

.dla-pause__silent {
  margin-top: 0.4em;
  text-align: center;
  color: var(--dla-dark);
  opacity: 0.8;
}

/* ----------------------------------------------------------- 11. Fin de course */
.dla-over .dla-veil {
  opacity: 0.56;                      /* on devine encore Molo derrière */
}

.dla-over__title {
  max-width: 100%;
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 2.2em;
  font-size: min(3em, 9.4vw);
  line-height: 1;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: uppercase;
  color: var(--dla-primary);
  -webkit-text-stroke: 0.15em var(--dla-dark);
  paint-order: stroke fill;
  stroke-linejoin: round;
  text-shadow: 0.05em 0.07em 0 var(--dla-accent);
  transform: rotate(-3deg);
}

.dla-screen.is-on .dla-over__title {
  animation: dla-title-in 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

.dla-over__panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 23em;
  width: min(100%, 23em);
  margin-top: 1.55em;
  padding: 1.25em 1.1em 1em;
}

.dla-over__cause {                    /* étiquette de la cause, à cheval sur le bord du panneau */
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 1;
  max-width: 96%;
  padding: 0.12em 0.75em 0.14em;
  border: var(--line) solid var(--dla-dark);
  border-radius: 0.6em;
  background: var(--dla-danger);
  color: var(--dla-light);
  font-weight: 800;
  font-size: 0.86em;
  line-height: 1.2;
  white-space: nowrap;
  transform: translate(-50%, -62%) rotate(-1.5deg);
}

.dla-over__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.dla-over__tip {                      /* (tuto, §13.12) le geste qu'il fallait : une phrase, au-dessus de la réplique */
  margin: 0 0 0.5em;
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.12em;
  line-height: 1.15;
  text-wrap: balance;
  color: var(--dla-dark);
}

.dla-over__tip:empty {
  display: none;
}

.dla-over__line {
  font-family: var(--dla-font-script);
  font-weight: 400;
  font-size: 16px;
  font-size: max(16px, 1.08em);
  line-height: 1.2;
  text-wrap: balance;
  color: var(--dla-secondary);
}

.dla-over__scoreLbl {
  margin-top: 0.75em;
  font-weight: 800;
  font-size: 0.86em;
  font-size: max(12px, 0.8em);
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.84;
}

.dla-over__score {
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 3.5em;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-shadow: 0.045em 0.055em 0 var(--dla-accent);
}

.dla-screen.is-on .dla-over__score {
  animation: dla-pop 0.36s cubic-bezier(0.3, 1.5, 0.5, 1) 0.12s both;
}

/* Record : macaron jaune + réplique, ou l'écart qui reste à combler */
.dla-over__rec {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-top: 0.3em;
}

.dla-over.is-record .dla-over__rec {
  display: flex;
}

.dla-over__badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.14em 0.6em 0.12em;
  border: var(--line) solid var(--dla-dark);
  border-radius: 0.7em;
  background: var(--dla-primary);
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.1em;
  font-size: min(1.2em, 4.8vw);       /* 320 px : tient sur une ligne dans le panneau */
  line-height: 1.1;
  letter-spacing: 0.03em;
  white-space: nowrap;
  box-shadow: 0.14em 0.16em 0 var(--dla-accent);
  transform: rotate(-3deg);
}

.dla-over.is-record.is-on .dla-over__badge {
  animation: dla-badge 0.9s ease-in-out infinite;
}

.dla-over__badge > .dla-ico {
  width: 1em;
  height: 1em;
  margin: 0 0.3em;
}

.dla-over__badge > span:not(.dla-ico) {
  min-width: 0;
  white-space: normal;                /* repli : sur deux lignes plutôt que hors du panneau */
  text-align: center;
}

.dla-over__recLine {
  margin-top: 0.4em;
  font-family: var(--dla-font-script);
  font-weight: 400;
  font-size: 16px;
  font-size: max(16px, 1em);
  line-height: 1.15;
  color: var(--dla-success);
}

.dla-over__gap {
  margin-top: 0.35em;
  font-weight: 700;
  font-size: 0.92em;
  line-height: 1.2;
  opacity: 0.85;
}

.dla-over__gap:empty,
.dla-over.is-record .dla-over__gap {
  display: none;
}

.dla-over__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 0.6em 1em;                /* nom ancien d'abord (Safari < 12, Chrome < 66) */
  gap: 0.6em 1em;
  margin-top: 0.85em;
  padding-top: 0.75em;
  border-top: 2px dashed rgba(27, 31, 75, 0.35);
}

.dla-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.dla-stat__k {
  font-weight: 800;
  font-size: 0.86em;
  font-size: max(12px, 0.74em);
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.84;
}

.dla-stat__v {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.12em;
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.22em;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.dla-stat__v > .dla-ico {
  width: 1.05em;
  height: 1.05em;
  margin-right: 0.3em;
}

.dla-stat__u {
  margin-left: 0.3em;
  font-size: 0.72em;
}

.dla-stamp {                          /* « Coupe payée ! » : tampon vert quand les pièces couvrent la coupe */
  display: none;
  margin: 0.18em 0 0;
  padding: 0.05em 0.45em 0.08em;
  border: 2px solid var(--dla-success);
  border-radius: 0.4em;
  font-family: var(--dla-font-body);
  font-weight: 800;
  font-size: 0.65em;
  font-size: max(10px, 0.62em);
  line-height: 1.15;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--dla-success);
  transform: rotate(-4deg);
}

.dla-stamp.is-on {
  display: inline-block;
}

.dla-over__btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-top: 0.9em;
}

.dla-over__btns > .dla-btn {
  margin: 0.45em 0.45em 0;
}

/* Confettis du nouveau record */
.dla-confetti {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: none;
}

.dla-over.is-record .dla-confetti {
  display: block;
}

.dla-confetti > i {
  position: absolute;
  left: var(--x, 50%);
  top: 0;
  width: 0.6em;
  height: 0.95em;
  border-radius: 0.12em;
  background: var(--c, var(--dla-primary));
  transform: translate3d(0, -14vh, 0);
}

.dla-over.is-record.is-on .dla-confetti > i {
  animation: dla-confetti var(--t, 2.6s) linear var(--d, 0s) infinite;
}

@media (orientation: landscape) {
  .dla-over__panel {
    flex-direction: row;
    align-items: center;
    width: 100%;
    max-width: 37em;
    width: min(100%, 37em);
    margin-top: 1.4em;
    padding: 1.15em 1.2em 0.95em;
  }

  .dla-over__main {
    flex: 1 1 50%;
    min-width: 0;
  }

  .dla-over__badge {                  /* paysage : colonne étroite, le macaron (qui pulse à ×1,07) doit y tenir */
    font-size: 0.9em;
  }

  .dla-over__badge > .dla-ico {
    margin: 0 0.22em;
  }

  .dla-over__stats {
    flex: 1 1 50%;
    margin: 0 0 0 1.1em;
    padding: 0.2em 0 0.2em 1.1em;
    border-top: 0;
    border-left: 2px dashed rgba(27, 31, 75, 0.35);
  }

  .dla-over__btns {
    margin-top: 0.7em;
  }
}

@media (orientation: landscape) and (max-height: 430px) {
  .dla-over__title {
    font-size: 2.3em;
  }

  .dla-over__panel {
    margin-top: 1.2em;
    padding: 0.95em 1.1em 0.7em;
  }

  .dla-over__scoreLbl {
    margin-top: 0.4em;
  }

  .dla-over__score {
    font-size: 2.9em;
  }

  .dla-over__btns {
    margin-top: 0.35em;
  }
}

/* ----------------------------------------------------------------- 12. Crédits */
/* Tout le panneau est un bouton : un appui n'importe où le referme. */
.dla-credits {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}

.is-credits .dla-credits {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.18s ease, visibility 0s linear 0s;
}

.dla-credits .dla-veil {
  opacity: 0.8;
}

.dla-credits__wrap {
  position: absolute;
  left: var(--pl);
  right: var(--pr);
  top: var(--pt);
  bottom: var(--pb);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dla-credits__panel {
  display: block;
  width: 100%;
  max-width: 34em;
  width: min(100%, 34em);
  max-height: 100%;
  overflow: hidden;
  padding: 1.1em 1.3em 1em;
  text-align: left;
}

.is-credits .dla-credits__panel {
  animation: dla-pop 0.28s cubic-bezier(0.3, 1.35, 0.5, 1) both;
}

.dla-credits__sig {
  display: block;
  margin: 0 2.4em 0.35em 0;            /* laisse la place de la croix de fermeture */
  font-weight: 800;
  font-size: 0.86em;
  font-size: max(12px, 0.8em);
  letter-spacing: 0.08em;
  color: var(--dla-accent);
}

.dla-credits__title {
  display: block;
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.7em;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 0.055em 0.065em 0 var(--dla-accent);
}

.dla-credits__tag {
  display: block;
  margin-top: 0.15em;
  font-family: var(--dla-font-script);
  font-weight: 400;
  font-size: 16px;
  font-size: max(16px, 1em);
  line-height: 1.15;
  color: var(--dla-secondary);
}

.dla-credits__story,
.dla-credits__txt {
  display: block;
  margin-top: 0.7em;
  font-weight: 700;
  font-size: 0.9em;
  line-height: 1.35;
}

.dla-credits__txt {
  font-weight: 500;
  font-size: 0.86em;
  font-size: max(12px, 0.82em);
  opacity: 0.9;
}

.dla-credits__close {
  position: absolute;
  right: 0.6em;
  top: 0.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.1em;
  height: 2.1em;
  padding: 0.55em;
  border: var(--line) solid var(--dla-dark);
  border-radius: 50%;
  background: var(--dla-accent);
  color: var(--dla-light);
}

.dla-credits__close > .dla-ico {
  width: 100%;
  height: 100%;
}

@media (max-height: 430px) {
  .dla-credits__panel {
    padding: 0.75em 1.1em 0.7em;
  }

  .dla-credits__story,
  .dla-credits__txt {
    margin-top: 0.45em;
    line-height: 1.25;
  }
}

/* --------------------------------------------------------------- 13. Animations */
/* Uniquement transform et opacity. Les paires -a / -b sont identiques : alterner de l'une
   à l'autre relance l'animation sans forcer de recalcul de mise en page. */
@keyframes dla-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes dla-pop {
  0% { opacity: 0; transform: scale(0.6); }
  70% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes dla-letter {
  0% { opacity: 0; transform: translateY(-0.55em) rotate(calc(var(--r, 0deg) - 14deg)) scale(1.25); }
  55% { opacity: 1; }
  100% { opacity: 1; transform: translateY(var(--y, 0em)) rotate(var(--r, 0deg)) scale(1); }
}

@keyframes dla-swing {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(-1.7deg); }
}

@keyframes dla-title-in {
  0% { opacity: 0; transform: rotate(-9deg) scale(0.5); }
  100% { opacity: 1; transform: rotate(-3deg) scale(1); }
}

@keyframes dla-badge {
  0%, 100% { transform: rotate(-3deg) scale(1); }
  50% { transform: rotate(-1deg) scale(1.07); }
}

@keyframes dla-vibrate {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(0.03em, -0.02em) rotate(-3deg); }
  50% { transform: translate(-0.03em, 0.02em) rotate(2deg); }
  75% { transform: translate(0.02em, 0.03em) rotate(-2deg); }
}

@keyframes dla-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.4; }
}

/* bandeau : glisse du haut en 0,35 s avec rebond, reste 1,8 s, repart */
@keyframes dla-banner-a {
  0% { opacity: 0; transform: translateY(-150%) rotate(-1.5deg); }
  9% { opacity: 1; transform: translateY(9%) rotate(-1.5deg); }
  14% { opacity: 1; transform: translateY(0) rotate(-1.5deg); }
  87% { opacity: 1; transform: translateY(0) rotate(-1.5deg); }
  100% { opacity: 0; transform: translateY(-150%) rotate(-1.5deg); }
}

@keyframes dla-banner-b {
  0% { opacity: 0; transform: translateY(-150%) rotate(-1.5deg); }
  9% { opacity: 1; transform: translateY(9%) rotate(-1.5deg); }
  14% { opacity: 1; transform: translateY(0) rotate(-1.5deg); }
  87% { opacity: 1; transform: translateY(0) rotate(-1.5deg); }
  100% { opacity: 0; transform: translateY(-150%) rotate(-1.5deg); }
}

/* toast : « pop » de 0,12 s, puis monte de 24 px en s'effaçant sur 0,7 s */
@keyframes dla-toast-a {
  0% { opacity: 0; transform: scale(0.5); }
  10% { opacity: 1; transform: scale(1.14); }
  17% { opacity: 1; transform: translateY(0) scale(1); }
  44% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-24px) scale(1); }
}

@keyframes dla-toast-b {
  0% { opacity: 0; transform: scale(0.5); }
  10% { opacity: 1; transform: scale(1.14); }
  17% { opacity: 1; transform: translateY(0) scale(1); }
  44% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-24px) scale(1); }
}

/* chiffre du 3-2-1 : « pop », tient une demi-seconde (un chiffre par demi-seconde), s'efface sur place */
@keyframes dla-count-a {
  0% { opacity: 0; transform: scale(0.5); }
  14% { opacity: 1; transform: scale(1.12); }
  24% { opacity: 1; transform: scale(1); }
  68% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

@keyframes dla-count-b {
  0% { opacity: 0; transform: scale(0.5); }
  14% { opacity: 1; transform: scale(1.12); }
  24% { opacity: 1; transform: scale(1); }
  68% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

/* bulle de Prosper : 1,2 s à l'écran */
@keyframes dla-bubble-a {
  0% { opacity: 0; transform: scale(0.4); }
  9% { opacity: 1; transform: scale(1.07); }
  15% { opacity: 1; transform: scale(1); }
  88% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.85); }
}

@keyframes dla-bubble-b {
  0% { opacity: 0; transform: scale(0.4); }
  9% { opacity: 1; transform: scale(1.07); }
  15% { opacity: 1; transform: scale(1); }
  88% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.85); }
}

/* compteur de pièces : rebond ×1,25 en 150 ms */
@keyframes dla-bump-a {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.25); }
}

@keyframes dla-bump-b {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.25); }
}

/* compteur de pièces : vol (0,6 s) — tremblement horizontal, clignotement rouge en trois temps */
@keyframes dla-loss-shake-a {
  0%, 100% { transform: translateX(0); }
  10%, 50% { transform: translateX(-0.14em) rotate(-3deg); }
  30%, 70% { transform: translateX(0.14em) rotate(3deg); }
  85% { transform: translateX(-0.06em); }
}

@keyframes dla-loss-shake-b {
  0%, 100% { transform: translateX(0); }
  10%, 50% { transform: translateX(-0.14em) rotate(-3deg); }
  30%, 70% { transform: translateX(0.14em) rotate(3deg); }
  85% { transform: translateX(-0.06em); }
}

@keyframes dla-loss-blink-a {
  0%, 34%, 68% { color: var(--dla-danger); }
  17%, 51%, 85% { color: var(--dla-light); }
  100% { color: var(--dla-danger); }
}

@keyframes dla-loss-blink-b {
  0%, 34%, 68% { color: var(--dla-danger); }
  17%, 51%, 85% { color: var(--dla-light); }
  100% { color: var(--dla-danger); }
}

@keyframes dla-flash-a {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes dla-flash-b {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes dla-swipe-finger {
  0% { opacity: 0; transform: translateX(0) scale(0.6); }
  18% { opacity: 1; transform: translateX(0) scale(1); }
  68% { opacity: 1; transform: translateX(0.6em) scale(1); }
  100% { opacity: 0; transform: translateX(0.6em) scale(1); }
}

@keyframes dla-swipe-trail {
  0%, 18% { opacity: 0; transform: scaleX(0); }
  68% { opacity: 0.6; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1); }
}

@keyframes dla-key-press {
  0%, 52%, 100% { transform: translateY(0); }
  66%, 84% { transform: translateY(0.16em); }
}

@keyframes dla-confetti {
  0% { transform: translate3d(0, -14vh, 0) rotate(0deg); }
  100% { transform: translate3d(var(--dx, 0px), 114vh, 0) rotate(var(--rot, 540deg)); }
}

@keyframes dla-load-fwd {
  0% { transform: translateX(0); }
  100% { transform: translateX(86%); }
}

@keyframes dla-load-back {
  0% { transform: translateX(0); }
  100% { transform: translateX(-86%); }
}

/* ------------------------------- 13 bis. Version 2 : tenue, lieux de référence, détour de Zepol, croissant */
/* Sûr pour les vieux navigateurs (dev/DURCISSEMENT.md §5) : flex et marges (pas de gap), aucun contour de texte au
   trait, min() précédé d'une valeur simple, animations de transform et d'opacité seulement, aucun flou. */

/* Sélecteur de tenue (menu) : ← · « TENUE / nom / pastilles » · → (maquette dev/v2/etude_tenues.md §5) */
.dla-tenue {
  display: flex;
  align-items: center;
  justify-content: center;
  order: -1;                          /* au-dessus de « ON GO ! », mais après lui dans le DOM (Tab) */
  max-width: 100%;
  margin-bottom: 0.6em;
  pointer-events: auto;               /* (correction b) une tape sur le cartouche ne lance pas la course (ui.js : data-ui) */
  touch-action: none;
}

.dla-screen:not(.is-on) .dla-tenue {
  pointer-events: none;
}

.dla-tenue.is-off {
  display: none;
}

.dla-tenue__nav > .dla-ico {
  width: 50%;
  height: 50%;
}

.dla-tenue__mid {
  min-width: 8.6em;
  max-width: 13em;
  margin: 0 0.45em;
  padding: 0.32em 0.9em 0.4em;
  border: var(--line) solid var(--dla-dark);
  border-radius: 1.1em;
  background: var(--dla-light);
  color: var(--dla-dark);
  text-align: center;
  box-shadow: 0 0.2em 0 var(--dla-dark);
}

.dla-tenue__cap {
  display: block;
  font-weight: 800;
  font-size: 0.7em;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.dla-tenue__name {
  display: block;
  overflow: hidden;
  font-weight: 800;
  font-size: 1.02em;
  line-height: 1.15;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dla-tenue__dots {
  display: flex;
  justify-content: center;
  margin-top: 0.28em;
}

.dla-tenue__dot {
  flex: none;
  width: 0.8em;
  height: 0.8em;
  margin: 0 0.16em;
  border: 2px solid var(--dla-dark);
  border-radius: 50%;
  box-sizing: border-box;
  background: #C4CAD0;
  opacity: 0.55;
  transition: transform 0.15s ease-out;
}

.dla-tenue__dot.is-on {
  opacity: 1;
  transform: scale(1.3);
}

@media (orientation: portrait) and (max-height: 700px), (orientation: landscape) and (max-height: 430px) {
  .dla-tenue {
    margin-bottom: 0.35em;
  }

  .dla-tenue__dots,
  .dla-tenue__cap {
    display: none;
  }
}

/* (§13.13) Ligne PERSONNAGE (js/ui.js, classes .dla-tenue + .dla-perso) : sous-titre ou « Chargement… » sous le nom.
   (28/11, client : « le truc pour faire passer est tres haut et passe inapercu ») Dans les deux orientations : dans la pile du bas,
   juste au-dessus de « ON GO ! », la ligne TENUE au-dessus d'elle (order -2 / -1, posés par le script). Plus marquée que la tenue :
   grandes flèches rondes jaunes (56 px au moins ; 48 px sur écran court), nom dans la police du titre, ombre rouge décalée comme
   l'enseigne. Cartouche de HAUTEUR FIXE, contenu centré : le sous-titre et « Chargement… » (à la place des pastilles) ne font
   rien bouger ; la ligne garde sa place d'un personnage à l'autre (les flèches restent sous le doigt). Les écarts au-dessus et
   au-dessous sont du REMPLISSAGE de la ligne (cadre data-ui : une tape à côté d'une flèche ne lance pas la course), posé
   au-dessus de la marge de tolérance de « ON GO ! » (z-index). */
.dla-perso {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  padding: 0.3em 0 0.6em;
}

.dla-menu.has-perso .dla-tenue:not(.dla-perso) {
  margin-bottom: 0;
}

.dla-perso .dla-tenue__nav {
  width: 56px;
  width: max(56px, 3.7em);
  height: 56px;
  height: max(56px, 3.7em);
  background: var(--dla-primary);
}

.dla-perso .dla-tenue__nav > .dla-ico {
  width: 54%;
  height: 54%;
}

.dla-perso .dla-tenue__mid {               /* taille FIXE : les flèches ne bougent pas d'un nom à l'autre */
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  box-sizing: border-box;
  width: 11.6em;
  min-width: 0;
  max-width: none;
  height: 4.3em;
  margin: 0 0.4em;
  padding: 0.16em 0.7em 0.2em;
  box-shadow: 0.2em 0.24em 0 var(--dla-accent);
}

.dla-perso .dla-tenue__cap {
  display: block;
  font-size: 0.68em;
  line-height: 1.15;
  letter-spacing: 0.12em;
  opacity: 0.75;
}

.dla-perso .dla-tenue__name {
  display: block;
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.42em;
  line-height: 1.04;
  letter-spacing: 0.02em;
}

.dla-perso .dla-tenue__dots {
  display: flex;
  flex: none;
  margin-top: 0.24em;
}

.dla-perso .dla-tenue__dot {
  width: 0.72em;
  height: 0.72em;
  margin: 0 0.13em;
}

.dla-perso.is-wait .dla-tenue__dots {
  display: none;
}

/* (27/11) nom de plus de 13 lettres (classe is-long posée par js/ui.js) : plus petit, il tient entier dans le cartouche */
.dla-perso.is-long .dla-tenue__name {
  font-size: 1.16em;
  letter-spacing: 0;
}

/* première fois (classe is-new : le joueur n'a jamais changé de personnage, clé heroPicked) : les deux flèches glissent vers
   l'extérieur et grossissent un peu, puis reviennent ; menu affiché seulement ; un appui les arrête (l'enfoncement se voit) */
.dla-screen.is-on .dla-perso.is-new .dla-tenue__nav {
  animation: dla-perso-nudge-r 1.8s ease-in-out infinite;
}

.dla-screen.is-on .dla-perso.is-new .dla-tenue__nav:first-child {
  animation-name: dla-perso-nudge-l;
}

.dla-screen.is-on .dla-perso.is-new .dla-tenue__nav:active {
  animation: none;
}

@keyframes dla-perso-nudge-r {
  0%, 46%, 100% { transform: translateX(0) scale(1); }
  20% { transform: translateX(0.32em) scale(1.1); }
  33% { transform: translateX(0) scale(1); }
}

@keyframes dla-perso-nudge-l {
  0%, 46%, 100% { transform: translateX(0) scale(1); }
  20% { transform: translateX(-0.32em) scale(1.1); }
  33% { transform: translateX(0) scale(1); }
}

/* écran court (mêmes seuils que la ligne TENUE) : flèches de 48 px (la cible tactile), cartouche plus bas ; la légende et les
   pastilles RESTENT (la TENUE, elle, les cache) */
@media (orientation: portrait) and (max-height: 700px), (orientation: landscape) and (max-height: 430px) {
  .dla-perso {
    padding: 0.25em 0 0.45em;
  }

  .dla-perso .dla-tenue__nav {
    width: var(--btn);
    height: var(--btn);
  }

  .dla-perso .dla-tenue__mid {
    width: 11em;
    height: 3.75em;
    padding: 0.1em 0.55em 0.14em;
  }

  .dla-perso .dla-tenue__cap {
    display: block;
    font-size: 0.64em;
    line-height: 1.1;
  }

  .dla-perso .dla-tenue__name {
    font-size: 1.2em;
    line-height: 1.02;
  }

  .dla-perso.is-long .dla-tenue__name {
    font-size: 1.02em;
  }

  .dla-perso .dla-tenue__dots {
    display: flex;
    margin-top: 0.2em;
  }

  .dla-perso.is-wait .dla-tenue__dots {
    display: none;
  }

  .dla-tenue.dla-perso.is-wait .dla-tenue__name {   /* la règle de la TENUE (plus bas) cache le nom pendant l'attente : pas ici */
    display: block;
  }

  .dla-perso .dla-tenue__dot {
    width: 0.62em;
    height: 0.62em;
    border-width: 1.5px;
  }

  .dla-perso .dla-perso__sub {
    font-size: 0.64em;
    line-height: 1.1;
  }
}

/* portrait TRÈS court (320 × 568, 360 × 640…) : l'aide des commandes cède sa place à la ligne PERSONNAGE (la leçon guidée de la
   première course montre les gestes ; la ligne d'invitation est déjà retirée sur écran court) : le plus grand personnage reste sous
   le titre */
@media (orientation: portrait) and (max-height: 660px) {
  .dla-menu.has-perso .dla-hint {
    display: none;
  }
}

.dla-perso__sub {
  display: block;
  overflow: hidden;
  font-weight: 700;
  font-size: 0.68em;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0.8;
}

.dla-perso__sub.is-off {
  display: none;
}

.dla-perso.is-wait .dla-perso__sub {
  animation: dla-perso-wait 1.1s ease-in-out infinite alternate;
}

@keyframes dla-perso-wait {
  from { opacity: 0.35; }
  to { opacity: 0.9; }
}

/* (§13.13, tenues) ligne TENUE d'un personnage qui en a plusieurs : sa tenue demandée arrive (classe is-wait posée par le script) :
   « Chargement… » à la place des pastilles, à leur hauteur (0,28 em + 0,8 em du cartouche) : rien ne saute. Écran bas (pastilles
   cachées) : il prend la place du nom, à sa hauteur. Le menu de Molo ne bâtit jamais ce nœud. */
.dla-tenue__wait {
  margin-top: 0.41em;
  line-height: 1.18em;
}

.dla-tenue.is-wait .dla-tenue__dots {
  display: none;
}

.dla-tenue.is-wait .dla-tenue__wait {
  animation: dla-perso-wait 1.1s ease-in-out infinite alternate;
}

@media (orientation: portrait) and (max-height: 700px), (orientation: landscape) and (max-height: 430px) {
  .dla-tenue.is-wait .dla-tenue__name {
    display: none;
  }

  .dla-tenue__wait {
    margin-top: 0;
    font-size: 1.02em;
    line-height: 1.15;
  }
}

/* Plaque d'un lieu de référence : petite, sombre, à la place du bandeau de quartier (jamais en même temps) */
.dla-lm__plate {
  display: flex;
  align-items: center;
  max-width: 22em;
  max-width: min(100%, 22em);
  padding: 0.26em 0.85em 0.3em 0.5em;
  border: var(--line) solid var(--dla-dark);
  border-radius: 0.6em;
  background: var(--dla-dark);
  color: var(--dla-light);
  box-shadow: 0 0.22em 0 rgba(12, 14, 40, 0.35);
  opacity: 0;
}

.dla-lm.is-a .dla-lm__plate {
  animation: dla-lm-a 3.2s both;
}

.dla-lm.is-b .dla-lm__plate {
  animation: dla-lm-b 3.2s both;
}

.dla-lm__arrow {
  display: inline-flex;
  flex: none;
  width: 1.45em;
  height: 1.45em;
  margin-right: 0.45em;
  color: var(--dla-primary);
}

.dla-lm__arrow.is-off {
  display: none;
}

.dla-lm__arrow > .dla-ico {
  width: 100%;
  height: 100%;
}

.dla-lm__txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dla-lm__name {
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.15em;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.dla-lm__sub {
  margin-top: 0.08em;
  font-weight: 700;
  font-size: 12px;
  font-size: max(12px, 0.78em);
  line-height: 1.15;
  opacity: 0.85;
}

.dla-lm__sub:empty {
  display: none;
}

.dla-hud.is-dying .dla-lm,
.dla-hud.is-under .dla-lm,
.dla-hud.is-dying .dla-zepol,
.dla-hud.is-under .dla-zepol {
  visibility: hidden;
}

/* Détour de Zepol : carte du côté de la boutique, flèche vers elle, enseigne bleu roi à lettres blanches (comme la vraie) */
.dla-zepol {
  position: absolute;
  left: var(--pl);
  right: var(--pr);
  top: 36%;
  display: flex;
  justify-content: flex-end;
}

.dla-zepol.is-left {
  justify-content: flex-start;
}

.dla-zepol__card {
  display: flex;
  align-items: center;
  max-width: 15em;
  max-width: min(64%, 15em);
  padding: 0.35em 0.7em 0.4em 0.45em;
  border: var(--line) solid var(--dla-dark);
  border-radius: 0.8em;
  background: var(--dla-light);
  color: var(--dla-dark);
  box-shadow: 0 0.25em 0 rgba(12, 14, 40, 0.4);
  opacity: 0;
}

.dla-zepol.is-right .dla-zepol__card {
  flex-direction: row-reverse;
  padding: 0.35em 0.45em 0.4em 0.7em;
}

.dla-zepol.is-a .dla-zepol__card {
  animation: dla-zepol-a 4s both;
}

.dla-zepol.is-b .dla-zepol__card {
  animation: dla-zepol-b 4s both;
}

/* (v2 menu) Portrait : à 36 % la carte couvrait le loin de la voie de droite (là où arrivent les obstacles). Elle monte
   sous la ligne du bandeau (au-dessus de l'horizon, devant les façades) et s'élargit un peu pour tenir en deux lignes. */
@media (orientation: portrait) {
  .dla-zepol {
    top: calc(var(--pt) + var(--btn) + 8.6em);
  }

  .dla-zepol__card {
    max-width: 16em;
    max-width: min(82%, 16em);
  }

  /* (correction b) carte affichée (is-right / is-left, retirées par hideZepol) : les toasts passent juste dessous
     (carte : 8,6 em + au plus ~4,9 em de haut, mesuré en 320 x 480 et 390 x 844). E.toasts suit E.zep dans le DOM. */
  .dla-zepol.is-right + .dla-toasts,
  .dla-zepol.is-left + .dla-toasts {
    top: calc(var(--pt) + var(--btn) + 13.8em);
  }
}

/* (correction b) Paysage : la carte (au plus 15 em, collée à un bord) et les toasts (centrés) se croisaient en largeur
   sur les écrans courts ; les toasts gardent leur hauteur et se centrent dans la place laissée à côté de la carte. */
@media (orientation: landscape) {
  .dla-zepol.is-right + .dla-toasts {
    right: calc(var(--pr) + 15.5em);
  }

  .dla-zepol.is-left + .dla-toasts {
    left: calc(var(--pl) + 15.5em);
  }
}

.dla-zepol__arrow {
  display: inline-flex;
  flex: none;
  width: 1.7em;
  height: 1.7em;
  margin-right: 0.45em;
  color: #1D4FB5;
}

.dla-zepol.is-right .dla-zepol__arrow {
  margin-right: 0;
  margin-left: 0.45em;
}

.dla-zepol__arrow > .dla-ico {
  width: 100%;
  height: 100%;
}

.dla-zepol__txt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.dla-zepol__name {
  padding: 0.08em 0.45em 0.04em;
  border-radius: 0.25em;
  background: #1D4FB5;
  color: #FFFFFF;
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.2em;
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dla-zepol__row {
  display: flex;
  align-items: center;
  margin-top: 0.22em;
  font-weight: 800;
  font-size: 0.86em;
  line-height: 1.15;
}

.dla-zepol__ico {
  width: 1.45em;
  height: 1.45em;
  margin-right: 0.3em;
}

.dla-zepol__price {
  flex: none;
  margin-left: 0.4em;
  padding: 0.05em 0.42em;
  border: 2px solid var(--dla-dark);
  border-radius: 0.6em;
  background: var(--dla-primary);
  white-space: nowrap;
}

.dla-zepol__price:empty {
  display: none;
}

/* (§13.11) Guide de Zepol : l'annonce qui incite à entrer. Même conteneur que la carte de 4 s (.dla-zepol : les toasts
   s'en écartent déjà), classe .is-guide. Trois lignes : ZEPOL + distance ; ce qu'il faut faire ; pourquoi.
   Pastille de distance et consigne : cachées hors du guide (la carte de 4 s reste telle quelle). */
.dla-zepol__dist,
.dla-zepol__do {
  display: none;
}

.dla-zepol.is-guide .dla-zepol__card {
  max-width: 25em;                     /* portrait : carte large et plate (consigne et raison sur une ligne chacune en 390 px) */
  max-width: min(96%, 25em);
  padding: 0.3em 0.45em 0.36em 0.75em;
  opacity: 1;
}

.dla-zepol.is-guide.is-left .dla-zepol__card {
  padding: 0.3em 0.75em 0.36em 0.45em;
}

.dla-zepol.is-guide .dla-zepol__txt {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.dla-zepol.is-guide .dla-zepol__name {
  font-size: 1.1em;
}

.dla-zepol.is-guide .dla-zepol__dist {
  display: inline-block;
  box-sizing: border-box;
  min-width: 3.9em;
  margin-left: 0.45em;
  padding: 0.06em 0.45em 0.04em;
  border: 2px solid var(--dla-dark);
  border-radius: 0.7em;
  background: var(--dla-primary);
  font-weight: 800;
  font-size: 0.9em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}

.dla-zepol.is-guide .dla-zepol__dist:empty {
  display: none;
}

.dla-zepol.is-guide .dla-zepol__do {
  display: block;
  flex: 0 0 100%;
  margin-top: 0.16em;
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.16em;
  line-height: 1.08;
  letter-spacing: 0.015em;
  word-spacing: 0.06em;
  text-wrap: balance;                  /* « Reste à droite : / entre chez Zepol ! » : la coupe tombe après les deux-points */
}

.dla-zepol.is-guide .dla-zepol__row {
  flex: 0 0 100%;
  margin-top: 0.14em;
  font-size: 13px;
  font-size: max(13px, 0.82em);
  line-height: 1.12;
}

.dla-zepol.is-guide .dla-zepol__arrow {
  width: 2em;
  height: 2em;
}

/* assez d'argent : elle incite. Liseré doré autour du contour indigo, flèche qui pousse vers la boutique */
.dla-zepol.is-guide.is-go .dla-zepol__card {
  box-shadow: 0 0 0 var(--line) var(--dla-primary), 0 0.3em 0 var(--line) rgba(12, 14, 40, 0.4);
}

.dla-zepol.is-guide.is-go.is-right .dla-zepol__arrow {
  animation: dla-zg-push-r 0.6s ease-in-out infinite alternate;
}

.dla-zepol.is-guide.is-go.is-left .dla-zepol__arrow {
  animation: dla-zg-push-l 0.6s ease-in-out infinite alternate;
}

/* pas assez d'argent : elle dit combien il manque, sans inciter (bord sombre, flèche immobile et grise) */
.dla-zepol.is-guide.is-short .dla-zepol__arrow {
  color: #5A6079;
}

/* croissant déjà en réserve : une ligne discrète, sans flèche ni distance (3 s, comptées par js/ui.js) */
.dla-zepol.is-guide.is-full .dla-zepol__card {
  max-width: 100%;
  padding: 0.3em 0.6em 0.32em;
  font-size: 0.85em;
}

.dla-zepol.is-guide.is-full .dla-zepol__arrow,
.dla-zepol.is-guide.is-full .dla-zepol__dist,
.dla-zepol.is-guide.is-full .dla-zepol__row {
  display: none;
}

.dla-zepol.is-guide.is-full .dla-zepol__txt {
  flex-wrap: nowrap;
}

.dla-zepol.is-guide.is-full .dla-zepol__name {
  flex: none;
  font-size: 0.95em;
}

.dla-zepol.is-guide.is-full .dla-zepol__do {
  flex: 0 1 auto;
  margin: 0 0 0 0.5em;
  font-family: inherit;
  font-weight: 800;
  font-size: 13px;
  font-size: max(13px, 1em);
  line-height: 1.15;
  letter-spacing: 0;
  word-spacing: 0;
}

/* arrivée (rebond de 0,3 s), dernier appel à 30 m (deux pulsations, liseré épaissi), sortie (fondu) */
.dla-zepol.is-guide.is-in-a .dla-zepol__card {
  animation: dla-zg-in-a 0.3s ease-out both;
}

.dla-zepol.is-guide.is-in-b .dla-zepol__card {
  animation: dla-zg-in-b 0.3s ease-out both;
}

.dla-zepol.is-guide.is-open .dla-zepol__card {
  animation: dla-zg-open 0.5s ease-in-out both;
}

.dla-zepol.is-guide.is-open.is-go .dla-zepol__card {
  box-shadow: 0 0 0 calc(var(--line) * 1.5) var(--dla-primary), 0 0.3em 0 calc(var(--line) * 1.5) rgba(12, 14, 40, 0.4);
}

.dla-zepol.is-guide.is-out .dla-zepol__card {
  animation: dla-zg-out 0.3s ease-in both;
}

.dla-zepol.is-guide.is-out.is-quick .dla-zepol__card {
  animation-duration: 0.2s;
}

.dla-zepol.is-guide.is-out .dla-zepol__arrow {
  animation: none;
}

/* Place du guide. Il se pose JUSTE SOUS LES COMPTEURS, du côté de la boutique : c'est là qu'il laisse le mieux voir
   l'emblème du croissant qui flotte sur la porte (monde, §13.11 b), l'entrée éclairée et la route. js/ui.js pose trois
   classes quand une place est prise :
     .is-res  la rangée du croissant en réserve et du lance-pierre (sous les pièces) est occupée : un cran plus bas ;
     .is-gau  une jauge de bonus est affichée (en portrait, elles sont en haut à gauche) : un cran plus bas en portrait ;
     .is-low  le bandeau, le tutoriel ou la plaque d'un autre lieu occupe le milieu : en portrait, il attend à
              l'ancienne place de la carte de 4 s (8,6 em), puis il remonte.
   Il glisse d'une place à l'autre une fois posé (.is-set). Mesures (dev/v2/zepol_guide/ecran/RAPPORT.md) : à l'ancienne
   place, en portrait, il passait DEVANT l'emblème dès 50 m. */
@media (orientation: portrait) {
  .dla-zepol.is-guide {
    top: calc(var(--pt) + var(--btn) + 1.5em);
  }

  .dla-zepol.is-guide.is-set {
    transition: transform 0.25s ease-out;
  }

  .dla-zepol.is-guide.is-res,
  .dla-zepol.is-guide.is-gau {
    transform: translateY(2.6em);       /* 4,1 em : la place du bandeau et des plaques */
  }

  .dla-zepol.is-guide.is-low {
    transform: translateY(7.1em);       /* 8,6 em : l'ancienne place de la carte */
  }

  /* les toasts : à leur place habituelle sous le guide du haut ; sous le guide quand il est plus bas */
  .dla-zepol.is-guide + .dla-toasts {
    top: calc(var(--pt) + var(--btn) + 11.2em);
    top: max(20%, calc(var(--pt) + var(--btn) + 11.2em));
  }

  .dla-zepol.is-guide.is-go.is-res + .dla-toasts,
  .dla-zepol.is-guide.is-go.is-gau + .dla-toasts,
  .dla-zepol.is-guide.is-short.is-res + .dla-toasts,
  .dla-zepol.is-guide.is-short.is-gau + .dla-toasts {
    top: calc(var(--pt) + var(--btn) + 11.9em);
  }

  .dla-zepol.is-guide.is-low.is-go + .dla-toasts,
  .dla-zepol.is-guide.is-low.is-short + .dla-toasts {
    top: calc(var(--pt) + var(--btn) + 16.4em);
  }

  .dla-zepol.is-guide.is-low.is-full + .dla-toasts {
    top: calc(var(--pt) + var(--btn) + 13.8em);
  }
}

/* Paysage : sous les compteurs, au bord du côté de la boutique, AU-DESSUS de l'horizon (la carte de 4 s, à 36 %, couvrait
   la boutique à 10 m) ; les toasts se centrent dans la place laissée à côté */
@media (orientation: landscape) {
  .dla-zepol.is-guide {
    top: calc(var(--pt) + 4.7em);
  }

  .dla-zepol.is-guide.is-set {
    transition: transform 0.25s ease-out;
  }

  .dla-zepol.is-guide.is-res {
    transform: translateY(1.9em);       /* 6,6 em : sous la rangée du croissant et du lance-pierre */
  }

  .dla-zepol.is-guide .dla-zepol__card {
    max-width: 17.5em;
    max-width: min(34%, 17.5em);
  }

  .dla-zepol.is-guide.is-full .dla-zepol__card {
    max-width: 24em;
    max-width: min(44%, 28em);
  }

  .dla-zepol.is-guide.is-right + .dla-toasts {
    right: calc(var(--pr) + 18em);
  }

  .dla-zepol.is-guide.is-left + .dla-toasts {
    left: calc(var(--pl) + 18em);
  }

  /* (correction J3) le guide incite (is-go, is-short) : les toasts se tiennent dans la moitié opposée à la boutique, pour
     ne pas passer sur l'emblème du croissant qui flotte au-dessus de la porte, juste à côté du milieu (x ≈ 52–55 % de la
     largeur de 80 à 20 m ; « + 500 F · Deux kolos : coupe payée ! » le couvrait de 45 à 37 m en 960 × 540) */
  .dla-zepol.is-guide.is-go.is-right + .dla-toasts,
  .dla-zepol.is-guide.is-short.is-right + .dla-toasts {
    right: 51%;
  }

  .dla-zepol.is-guide.is-go.is-left + .dla-toasts,
  .dla-zepol.is-guide.is-short.is-left + .dla-toasts {
    left: 51%;
  }
}

/* (correction J3) Portrait : l'emblème est au-dessus de l'horizon, à droite du milieu (x ≈ 205–250 à 40 m en 390 × 844),
   à la hauteur des toasts. Pendant que le guide incite, les toasts gardent leur hauteur (au-dessus de l'horizon, hors de
   la route où arrivent les obstacles) mais se tiennent dans la moitié opposée à la boutique ; une réplique longue passe
   sur deux lignes. */
@media (orientation: portrait) {
  .dla-zepol.is-guide.is-go.is-right + .dla-toasts,
  .dla-zepol.is-guide.is-short.is-right + .dla-toasts {
    right: calc(var(--pr) + 46%);
  }

  .dla-zepol.is-guide.is-go.is-left + .dla-toasts,
  .dla-zepol.is-guide.is-short.is-left + .dla-toasts {
    left: calc(var(--pl) + 46%);
  }
}

@keyframes dla-zg-in-a {
  0% { opacity: 0; transform: scale(0.6); }
  65% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes dla-zg-in-b {
  0% { opacity: 0; transform: scale(0.6); }
  65% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes dla-zg-open {
  0%, 50%, 100% { transform: scale(1); }
  25%, 75% { transform: scale(1.06); }
}

@keyframes dla-zg-out {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.94); }
}

@keyframes dla-zg-push-r {
  0% { transform: translateX(-0.06em); }
  100% { transform: translateX(0.22em); }
}

@keyframes dla-zg-push-l {
  0% { transform: translateX(0.06em); }
  100% { transform: translateX(-0.22em); }
}

/* (correction J5) Portrait : la carte large (96 %) dépassait le bord de l'écran pendant le rebond et les pulsations
   (× 1,06 depuis son centre : x 12 → 393 sur 390 px). Elle grandit maintenant depuis le bord du côté de la boutique, et
   de 3 % au plus : son bord reste à sa place, l'autre bord à plus de 10 px du bord opposé. Avant le bloc « mouvement
   réduit », qui garde le dernier mot. */
@media (orientation: portrait) {
  .dla-zepol.is-guide.is-right .dla-zepol__card {
    transform-origin: 100% 50%;
  }

  .dla-zepol.is-guide.is-left .dla-zepol__card {
    transform-origin: 0 50%;
  }

  .dla-zepol.is-guide.is-in-a .dla-zepol__card {
    animation-name: dla-zg-in-a-s;
  }

  .dla-zepol.is-guide.is-in-b .dla-zepol__card {
    animation-name: dla-zg-in-b-s;
  }

  .dla-zepol.is-guide.is-open .dla-zepol__card {
    animation-name: dla-zg-open-s;
  }

  .dla-zepol.is-guide.is-out .dla-zepol__card {
    animation-name: dla-zg-out;
  }
}

@keyframes dla-zg-in-a-s {
  0% { opacity: 0; transform: scale(0.6); }
  65% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes dla-zg-in-b-s {
  0% { opacity: 0; transform: scale(0.6); }
  65% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes dla-zg-open-s {
  0%, 50%, 100% { transform: scale(1); }
  25%, 75% { transform: scale(1.03); }
}

/* mouvement réduit : ni rebond, ni pulsation, ni poussée de la flèche ; un fondu seul */
@media (prefers-reduced-motion: reduce) {
  .dla-zepol.is-guide.is-in-a .dla-zepol__card,
  .dla-zepol.is-guide.is-in-b .dla-zepol__card {
    animation: dla-fade-in 0.3s both;
  }

  .dla-zepol.is-guide.is-open .dla-zepol__card {
    animation: none;
  }

  .dla-zepol.is-guide.is-out .dla-zepol__card {
    animation: dla-zg-fade-out 0.3s both;
  }

  .dla-zepol.is-guide.is-go.is-right .dla-zepol__arrow,
  .dla-zepol.is-guide.is-go.is-left .dla-zepol__arrow {
    animation: none;
  }

  .dla-zepol.is-guide.is-set {
    transition: none;
  }
}

@keyframes dla-zg-fade-out {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Croissant en réserve : pastille sous les pièces */
.dla-hud__crois {
  display: none;
  width: 2.2em;
  height: 2.2em;
  margin-top: 0.25em;
  padding: 0.1em;
  border: var(--line) solid var(--dla-dark);
  border-radius: 50%;
  box-sizing: border-box;
  background: var(--dla-light);
}

.dla-hud__crois.is-on {
  display: flex;
  animation: dla-crois-in 0.35s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

.dla-hud__crois > .dla-ico {
  width: 100%;
  height: 100%;
}

/* (Kwandjan) Réserves sous les pièces : lance-pierre × n puis croissant, sur UNE rangée collée à droite. La colonne du
   haut droit ne s'allonge pas : en portrait, le bandeau (pleine largeur, à pt + btn + 4,1 em) reste dégagé. */
.dla-hud__res {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
}

.dla-hud__sling {
  display: none;
  align-items: center;
  height: 2.2em;
  margin-top: 0.25em;
  padding: 0 0.5em 0 0.15em;
  border: var(--line) solid var(--dla-dark);
  border-radius: 1.1em;
  box-sizing: border-box;
  background: var(--dla-light);
  color: var(--dla-dark);
  white-space: nowrap;
}

.dla-hud__sling.is-on {
  display: flex;
  animation: dla-crois-in 0.35s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

.dla-hud__sling.is-on + .dla-hud__crois.is-on {
  margin-left: 0.3em;
}

.dla-sling__ico {
  width: 1.75em;
  height: 1.75em;
  transform-origin: 50% 85%;
}

.dla-sling__n {
  display: inline-block;
  margin-left: 0.08em;
  padding-top: 0.06em;
  font-family: var(--dla-font-display);
  font-weight: 400;
  font-size: 1.3em;
  line-height: 1;
  letter-spacing: 0.02em;
}

/* une pierre de moins : le chiffre tressaute en rouge, la fourche claque (deux noms : chaque tir relance l'animation) */
.dla-hud__sling.is-dec-a .dla-sling__n {
  animation: dla-sling-dec-a 0.4s ease-out;
}

.dla-hud__sling.is-dec-b .dla-sling__n {
  animation: dla-sling-dec-b 0.4s ease-out;
}

.dla-hud__sling.is-dec-a .dla-sling__ico {
  animation: dla-sling-kick-a 0.3s ease-out;
}

.dla-hud__sling.is-dec-b .dla-sling__ico {
  animation: dla-sling-kick-b 0.3s ease-out;
}

/* une pierre de plus (second lance-pierre ramassé) : le chiffre rebondit */
.dla-hud__sling.is-up-a .dla-sling__n {
  animation: dla-sling-up-a 0.35s ease-out;
}

.dla-hud__sling.is-up-b .dla-sling__n {
  animation: dla-sling-up-b 0.35s ease-out;
}

/* plus de pierres : « ×0 » en rouge, la puce se gonfle puis s'efface (SLING_OUT = 0,6 s dans js/ui.js) */
.dla-hud__sling.is-out {
  animation: dla-sling-out 0.6s ease-in both;
}

.dla-hud__sling.is-out .dla-sling__n {
  color: var(--dla-danger);
}

@keyframes dla-sling-dec-a {
  0% { color: var(--dla-danger); transform: scale(1.45) translateY(-0.08em); }
  60% { color: var(--dla-danger); transform: scale(1); }
  100% { color: var(--dla-dark); transform: scale(1); }
}

@keyframes dla-sling-dec-b {
  0% { color: var(--dla-danger); transform: scale(1.45) translateY(-0.08em); }
  60% { color: var(--dla-danger); transform: scale(1); }
  100% { color: var(--dla-dark); transform: scale(1); }
}

@keyframes dla-sling-kick-a {
  0% { transform: rotate(-16deg); }
  100% { transform: rotate(0); }
}

@keyframes dla-sling-kick-b {
  0% { transform: rotate(-16deg); }
  100% { transform: rotate(0); }
}

@keyframes dla-sling-up-a {
  0% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

@keyframes dla-sling-up-b {
  0% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

@keyframes dla-sling-out {
  0% { opacity: 1; transform: scale(1); }
  30% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 0; transform: scale(0.5); }
}

@media (prefers-reduced-motion: reduce) {
  .dla-hud__sling.is-on,
  .dla-hud__sling.is-on .dla-sling__n,
  .dla-hud__sling.is-on .dla-sling__ico {
    animation: none;
  }

  .dla-hud__sling.is-out {
    display: none;
  }
}

/* (Kwandjan) Bande de meute de js/kwandjan.js (#dla-kw-alert, styles en ligne, rangée des trois cases = dernier enfant) :
   en bas à gauche, elle passait SOUS la tondeuse de Prosper (.dla-threat, bas gauche, au-dessus d'elle : #ui z 10 contre 5)
   et sous sa bulle, justement quand la meute vient de faire trébucher le héros (Prosper colle). Elle passe en bas à
   droite, coin libre du HUD dans les deux orientations, dans la marge sûre de droite (encoche en paysage). Valeur simple
   d'abord : un navigateur qui ignore env() la garde. */
#dla-kw-alert > div:last-child {
  left: auto !important;
  right: 2vmin !important;
  right: calc(2vmin + env(safe-area-inset-right, 0px)) !important;
}

@keyframes dla-lm-a {
  0% { opacity: 0; transform: translateY(-0.5em); }
  8% { opacity: 1; transform: translateY(0); }
  88% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-0.3em); }
}

@keyframes dla-lm-b {
  0% { opacity: 0; transform: translateY(-0.5em); }
  8% { opacity: 1; transform: translateY(0); }
  88% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-0.3em); }
}

@keyframes dla-zepol-a {
  0% { opacity: 0; transform: scale(0.6); }
  7% { opacity: 1; transform: scale(1.06); }
  11% { opacity: 1; transform: scale(1); }
  90% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.9); }
}

@keyframes dla-zepol-b {
  0% { opacity: 0; transform: scale(0.6); }
  7% { opacity: 1; transform: scale(1.06); }
  11% { opacity: 1; transform: scale(1); }
  90% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.9); }
}

@keyframes dla-crois-in {
  0% { opacity: 0; transform: scale(0.3); }
  100% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .dla-lm.is-a .dla-lm__plate,
  .dla-zepol.is-a .dla-zepol__card {
    animation-name: dla-fade-a;
  }

  .dla-lm.is-b .dla-lm__plate,
  .dla-zepol.is-b .dla-zepol__card {
    animation-name: dla-fade-b;
  }

  .dla-hud__crois.is-on {
    animation: none;
  }

  .dla-tenue__dot {
    transition: none;
  }

  .dla-perso.is-wait .dla-perso__sub,
  .dla-tenue.is-wait .dla-tenue__wait {
    animation: none;
  }

  .dla-screen.is-on .dla-perso.is-new .dla-tenue__nav {   /* (28/11) première fois : flèches immobiles, jaunes et grandes */
    animation: none;
  }
}

/* versions sans mouvement (prefers-reduced-motion) */
@keyframes dla-fade-a {
  0% { opacity: 0; }
  10%, 82% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes dla-fade-b {
  0% { opacity: 0; }
  10%, 82% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes dla-fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* ------------------------------------------------------------ 14. Mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  .dla-screen.is-on .dla-btn--play,
  .dla-screen.is-on .dla-logo__sign,
  .dla-screen.is-on .dla-logo__l,
  .dla-over.is-record.is-on .dla-over__badge,
  .dla-threat.is-on .dla-threat__ico > .dla-ico,
  .dla-hairbar__clipper > .dla-ico,
  .dla-gest .dla-swipe__trail,
  .dla-gest .dla-swipe__finger,
  .dla-gest .dla-key,
  .dla-hud__coins.is-a,
  .dla-hud__coins.is-b,
  .dla-hud__coins.is-loss-a,
  .dla-hud__coins.is-loss-b {
    animation: none;
  }

  .dla-over.is-record .dla-confetti {
    display: none;
  }

  .dla-screen.is-on .dla-board--pop,
  .is-credits .dla-credits__panel,
  .dla-screen.is-on .dla-over__title,
  .dla-screen.is-on .dla-over__score,
  .dla-gauge.is-on {
    animation-name: dla-fade-in;
  }

  .dla-banner.is-a .dla-banner__board,
  .dla-toast.is-a,
  .dla-bubble.is-a {
    animation-name: dla-fade-a;
  }

  .dla-banner.is-b .dla-banner__board,
  .dla-toast.is-b,
  .dla-bubble.is-b {
    animation-name: dla-fade-b;
  }

  .dla-gauge.is-on.is-ending {
    animation: none;
    opacity: 0.6;
  }

  .dla-tuto__card,
  .dla-tuto.is-on .dla-tuto__card,
  .dla-tuto.is-big .dla-tuto__card,
  .dla-tuto.is-big.is-on .dla-tuto__card,
  .dla-tuto.is-big.is-on.is-go .dla-tuto__card {
    transform: none;
    transition: opacity 0.2s linear;
  }

  .dla-btn__face,
  .dla-round,
  .dla-pill,
  .dla-mult,
  .dla-threat__ico {
    transition: none;
  }
}

/* --------------------------------------------- 15. Navigateurs anciens (D28) */
/* min(), max() et clamp() dans une variable sont invalides au calcul sur les navigateurs qui ne les connaissent pas
   (Chrome < 79, Safari < 13.1, Samsung Internet < 12) : la variable deviendrait « unset » partout où elle sert
   (boutons sans taille, contours absents, logo géant). Valeurs fixes de repli, à la taille d'un téléphone moyen.
   Les déclarations ordinaires qui emploient min() ou max() (tailles de texte, largeurs de panneaux, filets) sont
   rejetées à la lecture par ces navigateurs : chacune est précédée, dans sa règle, d'une valeur simple de repli.
   Essai : python3 dev/ve_oldcss.py [safari12] puis bash dev/ve_oldrun.sh <étiquette> [tailles]. */
@supports not (width: clamp(1px, 2px, 3px)) {
  #ui {
    font-size: 16px;
    --line: 3px;
    --btn: 48px;
    --sig: 26px;
  }

  /* le logo suit l'écran comme min() le ferait (une valeur fixe déborde à 320 px de large) */
  .dla-logo {
    --logo: 11.8vw;
  }

  .dla-loading .dla-logo {
    --logo: 11.2vw;
  }
}

@supports not (width: clamp(1px, 2px, 3px)) {
  @media (max-width: 360px), (max-height: 360px) {
    #ui {
      font-size: 14px;
    }
  }

  @media (min-width: 700px) and (min-height: 700px) {   /* tablettes (iPad resté sous iOS 12) : l'échelle que clamp() donnerait */
    #ui {
      font-size: 21.6px;
      --line: 4px;
      --btn: 69px;
      --sig: 33px;
    }

    .dla-logo__tag {                  /* la devise suit l'enseigne (le repli à 16 px est celui des téléphones) */
      font-size: 0.25em;
    }

    .dla-logo__hang {
      font-size: 0.2em;
    }
  }

  @media (orientation: landscape) {
    .dla-logo {
      --logo: 13.5vh;
    }

    .dla-loading .dla-logo {
      --logo: 15vh;
    }
  }

  @media (orientation: landscape) and (min-height: 889px), (orientation: portrait) and (min-width: 1017px) {
    .dla-logo,
    .dla-loading .dla-logo {
      --logo: 110px;
    }
  }
}

/* env() inconnu (Chrome < 69, Safari < 11.1) : marges de sécurité nulles au lieu de variables invalides */
@supports not (top: env(safe-area-inset-top, 0px)) {
  :root {
    --dla-sat: 0px;
    --dla-sar: 0px;
    --dla-sab: 0px;
    --dla-sal: 0px;
  }
}

/* « gap » des boîtes flexibles inconnu (Chrome < 84, Safari < 14.1, détecté par js/ui.js : classe no-flexgap sur #ui) :
   les écarts passent par des marges. Les navigateurs récents gardent « gap », mesures inchangées. */
.no-flexgap .dla-hint__row > * {
  margin-top: 0.25em;
  margin-bottom: 0.25em;
}

.no-flexgap .dla-hint__row > * + * {
  margin-left: 1.1em;
}

.no-flexgap .dla-hint__row > .dla-hint__pre + * {
  margin-left: 0;                     /* portrait : la ligne d'invitation occupe toute la largeur, la suite repart à gauche */
}

.no-flexgap .dla-hint__seg > * + * {
  margin-left: 0.32em;
}

@media (orientation: landscape) {
  .no-flexgap .dla-hint__row > .dla-hint__pre + * {
    margin-left: 1.1em;
  }
}

@media (orientation: portrait) and (max-height: 700px) {
  .no-flexgap .dla-hint__row > * + * {
    margin-left: 0.9em;
  }

  .no-flexgap .dla-hint__row > .dla-hint__pre + * {
    margin-left: 0;
  }

  .no-flexgap .dla-hint__row > * {
    margin-top: 0.125em;
    margin-bottom: 0.125em;
  }
}

@media (orientation: landscape) and (max-height: 430px) {
  .no-flexgap .dla-pause__btns > .dla-btn + .dla-btn {
    margin-left: 0.6em;
  }

  .no-flexgap .dla-pause__btns > .dla-btn--big + .dla-btn {
    margin-left: 0;                   /* « continuer » seul sur sa ligne : « rejouer » repart à gauche */
  }
}

/* ------------------------------------------------- Contours de texte sur les navigateurs sans « paint-order »
   Les textes détourés (.dla-ink, titre du menu, titre de fin de course, chiffre du 3-2-1) sont peints avec
   -webkit-text-stroke et « paint-order: stroke fill » : le contour passe SOUS le remplissage. Chrome et la WebView
   d'Android n'appliquent paint-order au texte que depuis la version 123 (mars 2024) ; avant, le contour est peint
   PAR-DESSUS et mange la moitié de son épaisseur dans la lettre : titres « creux », « FCFA » et répliques illisibles
   (vu sur une WebView 113 ; tout Android 7 est bloqué à la version 119). La propriété est pourtant « reconnue » par
   ces versions (elle vaut pour le SVG) : on ne peut pas la tester directement. On teste donc light-dark(), arrivée
   dans la MÊME version de Chrome (123 ; Firefox 120, Safari 17.5) : sans elle, pas de contour au trait, mais une
   couronne d'ombres nettes qui donne le même dessin partout. Les navigateurs récents ne lisent pas ce bloc.
   (Valeurs produites par un petit calcul : 12 ombres à la distance du contour, 6 à mi-distance, puis l'ombre
   décalée d'origine épaissie d'autant. Les chiffres du score, .dla-num--ink, ont déjà leur contour sur un calque
   à part et ne sont pas concernés.) */
@supports not (color: light-dark(#000, #fff)) {
  .dla-ink,
  .dla-toast--count,
  .dla-logo__title,
  .dla-over__title {
    -webkit-text-stroke: 0 transparent;
    -webkit-text-stroke-width: 0;
  }

  .dla-ink {
    text-shadow:
      0.1em 0 0 var(--dla-dark), 0.087em 0.05em 0 var(--dla-dark), 0.05em 0.087em 0 var(--dla-dark), 0 0.1em 0 var(--dla-dark),
      -0.05em 0.087em 0 var(--dla-dark), -0.087em 0.05em 0 var(--dla-dark), -0.1em 0 0 var(--dla-dark), -0.087em -0.05em 0 var(--dla-dark),
      -0.05em -0.087em 0 var(--dla-dark), 0 -0.1em 0 var(--dla-dark), 0.05em -0.087em 0 var(--dla-dark), 0.087em -0.05em 0 var(--dla-dark),
      0.043em 0.025em 0 var(--dla-dark), 0 0.05em 0 var(--dla-dark), -0.043em 0.025em 0 var(--dla-dark), -0.043em -0.025em 0 var(--dla-dark),
      0 -0.05em 0 var(--dla-dark), 0.043em -0.025em 0 var(--dla-dark), 0.1em 0.09em 0 var(--dla-dark), 0.087em 0.14em 0 var(--dla-dark),
      0.05em 0.177em 0 var(--dla-dark), 0 0.19em 0 var(--dla-dark), -0.05em 0.177em 0 var(--dla-dark), -0.087em 0.14em 0 var(--dla-dark),
      -0.1em 0.09em 0 var(--dla-dark);
  }

  .dla-toast {
    text-shadow:
      0.1em 0 0 var(--dla-dark), 0.087em 0.05em 0 var(--dla-dark), 0.05em 0.087em 0 var(--dla-dark), 0 0.1em 0 var(--dla-dark),
      -0.05em 0.087em 0 var(--dla-dark), -0.087em 0.05em 0 var(--dla-dark), -0.1em 0 0 var(--dla-dark), -0.087em -0.05em 0 var(--dla-dark),
      -0.05em -0.087em 0 var(--dla-dark), 0 -0.1em 0 var(--dla-dark), 0.05em -0.087em 0 var(--dla-dark), 0.087em -0.05em 0 var(--dla-dark),
      0.043em 0.025em 0 var(--dla-dark), 0 0.05em 0 var(--dla-dark), -0.043em 0.025em 0 var(--dla-dark), -0.043em -0.025em 0 var(--dla-dark),
      0 -0.05em 0 var(--dla-dark), 0.043em -0.025em 0 var(--dla-dark), 0.07em 0.09em 0 var(--dla-accent), 0.162em 0.128em 0 var(--dla-accent),
      0.108em 0.182em 0 var(--dla-accent), 0.032em 0.182em 0 var(--dla-accent), -0.022em 0.128em 0 var(--dla-accent), -0.022em 0.052em 0 var(--dla-accent),
      0.032em -0.002em 0 var(--dla-accent), 0.108em -0.002em 0 var(--dla-accent), 0.162em 0.052em 0 var(--dla-accent);
  }

  .dla-toast--count {
    text-shadow:
      0.06em 0 0 var(--dla-dark), 0.052em 0.03em 0 var(--dla-dark), 0.03em 0.052em 0 var(--dla-dark), 0 0.06em 0 var(--dla-dark),
      -0.03em 0.052em 0 var(--dla-dark), -0.052em 0.03em 0 var(--dla-dark), -0.06em 0 0 var(--dla-dark), -0.052em -0.03em 0 var(--dla-dark),
      -0.03em -0.052em 0 var(--dla-dark), 0 -0.06em 0 var(--dla-dark), 0.03em -0.052em 0 var(--dla-dark), 0.052em -0.03em 0 var(--dla-dark),
      0.026em 0.015em 0 var(--dla-dark), 0 0.03em 0 var(--dla-dark), -0.026em 0.015em 0 var(--dla-dark), -0.026em -0.015em 0 var(--dla-dark),
      0 -0.03em 0 var(--dla-dark), 0.026em -0.015em 0 var(--dla-dark), 0.07em 0.09em 0 var(--dla-accent), 0.125em 0.113em 0 var(--dla-accent),
      0.093em 0.145em 0 var(--dla-accent), 0.047em 0.145em 0 var(--dla-accent), 0.015em 0.113em 0 var(--dla-accent), 0.015em 0.067em 0 var(--dla-accent),
      0.047em 0.035em 0 var(--dla-accent), 0.093em 0.035em 0 var(--dla-accent), 0.125em 0.067em 0 var(--dla-accent);
  }

  .dla-logo__title {
    text-shadow:
      0.065em 0 0 var(--dla-dark), 0.056em 0.032em 0 var(--dla-dark), 0.033em 0.056em 0 var(--dla-dark), 0 0.065em 0 var(--dla-dark),
      -0.032em 0.056em 0 var(--dla-dark), -0.056em 0.032em 0 var(--dla-dark), -0.065em 0 0 var(--dla-dark), -0.056em -0.032em 0 var(--dla-dark),
      -0.033em -0.056em 0 var(--dla-dark), 0 -0.065em 0 var(--dla-dark), 0.033em -0.056em 0 var(--dla-dark), 0.056em -0.033em 0 var(--dla-dark),
      0.028em 0.016em 0 var(--dla-dark), 0 0.033em 0 var(--dla-dark), -0.028em 0.016em 0 var(--dla-dark), -0.028em -0.016em 0 var(--dla-dark),
      0 -0.033em 0 var(--dla-dark), 0.028em -0.016em 0 var(--dla-dark), 0.045em 0.06em 0 var(--dla-accent), 0.105em 0.085em 0 var(--dla-accent),
      0.07em 0.12em 0 var(--dla-accent), 0.02em 0.12em 0 var(--dla-accent), -0.015em 0.085em 0 var(--dla-accent), -0.015em 0.035em 0 var(--dla-accent),
      0.02em 0 0 var(--dla-accent), 0.07em 0 0 var(--dla-accent), 0.105em 0.035em 0 var(--dla-accent);
  }

  .dla-over__title {
    text-shadow:
      0.075em 0 0 var(--dla-dark), 0.065em 0.037em 0 var(--dla-dark), 0.038em 0.065em 0 var(--dla-dark), 0 0.075em 0 var(--dla-dark),
      -0.037em 0.065em 0 var(--dla-dark), -0.065em 0.037em 0 var(--dla-dark), -0.075em 0 0 var(--dla-dark), -0.065em -0.037em 0 var(--dla-dark),
      -0.038em -0.065em 0 var(--dla-dark), 0 -0.075em 0 var(--dla-dark), 0.038em -0.065em 0 var(--dla-dark), 0.065em -0.038em 0 var(--dla-dark),
      0.032em 0.019em 0 var(--dla-dark), 0 0.037em 0 var(--dla-dark), -0.032em 0.019em 0 var(--dla-dark), -0.032em -0.019em 0 var(--dla-dark),
      0 -0.037em 0 var(--dla-dark), 0.032em -0.019em 0 var(--dla-dark), 0.05em 0.07em 0 var(--dla-accent), 0.119em 0.099em 0 var(--dla-accent),
      0.079em 0.139em 0 var(--dla-accent), 0.021em 0.139em 0 var(--dla-accent), -0.019em 0.099em 0 var(--dla-accent), -0.019em 0.041em 0 var(--dla-accent),
      0.021em 0.001em 0 var(--dla-accent), 0.079em 0.001em 0 var(--dla-accent), 0.119em 0.041em 0 var(--dla-accent);
  }
}

/* crash test 1.3, B2 : petites fenêtres (écran partagé, 412×430, 360×320, 320×240…). Fin de course et pause : centrés
   quand ils tiennent (marges automatiques, sans « safe center » inconnu de Chrome 51), sinon le haut reste visible et
   le reste défile ; titre et panneaux réduits sous une petite hauteur ou une petite largeur. Tailles ordinaires
   (téléphones 360×640 à 430×932, paysage dès 360 px de haut, ordinateur) : rien ne change. */
.dla-over__in,
.dla-pause .dla-center {
  justify-content: flex-start;
}

.dla-over__in > :first-child,
.dla-pause .dla-center > :first-child {
  margin-top: auto;
}

.dla-over__in > :last-child,
.dla-pause .dla-center > :last-child {
  margin-bottom: auto;
}

@media (orientation: portrait) and (max-height: 460px), (orientation: landscape) and (max-height: 340px), (max-width: 300px) {
  .dla-over__in,
  .dla-pause .dla-center {
    overflow-x: hidden;
    overflow-y: auto;
    pointer-events: auto;             /* la molette fait défiler ; une tape hors bouton reste au jeu (js/input.js) */
    left: 0;                          /* la boîte qui défile va jusqu'aux bords : les marges deviennent son rembourrage, */
    right: 0;                         /* un panneau un peu trop large n'est pas rogné plus qu'avant */
    padding: 0.3em var(--pr) 0.3em var(--pl);   /* haut et bas : le titre penché et l'ombre des boutons restent entiers */
    font-size: 0.82em;
  }

  .dla-over__title {
    font-size: 2em;
    font-size: min(2em, 8vw);
  }

  .dla-over__panel {
    margin-top: 0.9em;
    padding: 0.8em 0.9em 0.7em;
  }

  .dla-over__score {
    font-size: 2.4em;
  }

  .dla-over__btns {
    margin-top: 0.1em;
  }

  .dla-pause__panel {
    max-height: none;
    padding: 0.8em 1em 0.9em;
  }

  .dla-pause__title {
    font-size: 1.6em;
  }

  .dla-pause__panel > .dla-pill {
    margin-top: 0.6em;
  }
}

/* crash test 1.3, B8 : témoin de FIN de feuille, lu par js/game.js (boot) pour détecter une feuille coupée.
   TOUJOURS LA DERNIÈRE RÈGLE DU FICHIER : n'ajoutez rien après. */
#ui {
  --dla-css-end: 1;
}
