/* Guerre des prix : interface du jeu (lot D).
   Identité de Pile Poil (docs/conception.md §1) : composants de la promo
   Mantan traduits en em (Bulle, Mot, Badge, Pastille, Carte), fond « Soleil »
   sous le canvas WebGL transparent, ressort de la promo. Aucun attribut
   style= dans le HTML (CSP) : ce qui bouge à chaque image passe par le CSSOM
   (el.style.translate…). Tailles en rem : l'interface tient à 130 %.

   Portrait 390 × 844 : HUD 0–56, semaine 56–92, carte 92–548, panneau
   548–844 (gérante 112 × 150 à gauche). Paysage : carte à gauche, panneau à
   droite min(36vw, 420px) avec HUD, gérante 160 × 200, prix, puces, cuve,
   semaine (§7 Zones). */

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

:root {
  --vert: #16a34a;
  --vert-fonce: #15803d;
  --vert-clair: #22c55e;
  --vert-nuit: #166534;
  --creme: #fffbeb;
  --plateau: #fdf2d9;
  --encre: #1f2937;
  --orange: #f97316;
  --orange-fonce: #ea580c;
  --rouge: #ef4444;
  --bleu: #1d4ed8;
  --rose: #db2777;
  --ciel: #7dd3fc;
  --soleil: #facc15;
  --pistolet: #374151;
  --gris: #57534e;
  --titre: 'Baloo 2', sans-serif;
  --texte: 'Nunito', sans-serif;
  --haut-sur: env(safe-area-inset-top, 0px);
  --bas-sur: env(safe-area-inset-bottom, 0px);
  --gauche-sur: env(safe-area-inset-left, 0px);
  --droite-sur: env(safe-area-inset-right, 0px);
  --h: 100vh;
  color-scheme: light;
}
@supports (height: 100dvh) {
  :root {
    --h: 100dvh;
  }
}

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

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

/* --- calques : fond, canvas WebGL, étiquettes de prix, interface --- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  /* la caméra (glisser, molette, pincement) et la pioche passent par ici */
  touch-action: none;
}
.etiquettes {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.ui {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.ecran {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ecran button,
.ecran a,
.ecran input,
.ecran select,
.ecran textarea,
.ecran label,
.ecran [tabindex],
.ecran .carte,
.ecran .panneau-prix,
.ecran-social,
.calque-haut button,
.calque-haut a,
.calque-haut .carte,
.bouton-son,
.toast {
  pointer-events: auto;
}
.annonce {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  margin: 0;
}
.calque-bulles,
.calque-haut {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.calque-bulles {
  z-index: 1;
}
.calque-haut {
  z-index: 2;
}
.ecran-bilan,
.ecran-pause,
.ecran-erreur {
  z-index: 3;
}

/* ===================== composants de la promo ===================== */

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

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

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

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

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

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

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

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

/* touches du clavier, écrites seulement là où il y a une souris */
.touche {
  display: none;
  font-family: var(--texte);
  font-weight: 800;
  font-size: 0.6875rem;
  line-height: 1;
  color: var(--vert-fonce);
  text-align: center;
  white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
  .touche {
    display: block;
  }
}
.touche-blanche {
  color: #fff;
  opacity: 0.85;
}
.licence {
  position: absolute;
  right: 8px;
  bottom: 4px;
  margin: 0;
  font-family: var(--texte);
  font-weight: 700;
  font-size: 0.6875rem;
  color: var(--vert-fonce);
  pointer-events: none;
}

/* le geste attendu pulse sur les temps (journée d'essai, puce visée, camion) */
.pulse {
  animation: pulse 1s ease-in-out infinite;
  outline: 3px solid var(--soleil);
  outline-offset: 3px;
}
@keyframes pulse {
  0%,
  100% {
    scale: 1;
  }
  20% {
    scale: 1.08;
  }
  50% {
    scale: 1;
  }
}

/* ===================== écran titre ===================== */
.ecran-titre {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--haut-sur) + 14px) 16px calc(var(--bas-sur) + 10px);
  gap: clamp(6px, 1.2vh, 12px);
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
}
.arrivee ~ .ecran-titre {
  display: none;
}
.titre-tete {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(4px, 1vh, 10px);
  width: 100%;
}
.titre-marque {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding-right: 40px;
}
.mascotte-titre {
  flex: none;
  width: clamp(3.5rem, 15vw, 5rem);
  height: auto;
  aspect-ratio: 1;
}
.titre-nom {
  font-size: min(4rem, 15.5vw, 8vh);
  color: var(--vert-fonce);
  padding-top: 0.08em;
  max-width: 4.6em;
  text-align: left;
}
.titre-autocollants {
  display: grid;
  justify-items: center;
}
.titre-autocollant {
  grid-area: 1 / 1;
  font-size: min(1.375rem, 5.6vw, 2.9vh);
}
.titre-accroche {
  margin: 0;
  max-width: 24em;
  font-size: min(1rem, 4.2vw, 2.1vh);
  text-align: center;
  color: var(--encre);
}
.titre-carte {
  position: relative;
  flex: 1 1 0;
  min-height: 140px;
  width: 100%;
}
.titre-nouvelles {
  width: min(100%, 380px);
}
.titre-nouvelles:empty {
  display: none;
}
.titre-menu {
  width: min(100%, 380px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.2vh, 10px);
}
.choix {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.5rem;
  margin: 0;
  padding: 0.45em 0.9em 0.35em;
  border: 0;
  border-radius: 1.1rem;
  background: #fff;
  box-shadow: 0 0.25rem 0 rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transform: rotate(1deg);
}
.choix-principal[aria-busy='true'] {
  animation: choix-attend 0.9s ease-in-out infinite alternate;
}
@keyframes choix-attend {
  to {
    opacity: 0.6;
    scale: 0.97;
  }
}
@media (prefers-reduced-motion: reduce) {
  .choix-principal[aria-busy='true'] {
    animation: none;
    opacity: 0.7;
  }
}
.choix-principal {
  min-height: 4rem;
  padding: 0;
  overflow: hidden;
  background: var(--vert);
  box-shadow: 0 0.3rem 0 var(--vert-nuit);
  transform: rotate(-2deg);
}
.choix:active {
  translate: 0 0.2rem;
  box-shadow: 0 0.06rem 0 var(--vert-nuit);
}
.choix-nom {
  font-family: var(--titre);
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1.1;
  color: var(--vert-fonce);
  padding-top: 0.1em;
}
.choix-sous {
  font-family: var(--texte);
  font-weight: 800;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: var(--encre);
  text-align: center;
}
.choix-principal .choix-nom {
  color: #fff;
  font-size: 1.5rem;
  padding: 0.45em 0.6em 0.2em;
}
/* blanc sur #16a34a : réservé au gros texte gras ; le sous-titre passe sur un bandeau vert foncé */
.choix-principal .choix-sous {
  align-self: stretch;
  color: #fff;
  background: var(--vert-fonce);
  padding: 0.35em 1em 0.4em;
}
.titre-info,
.titre-abattre {
  margin: 0;
  font-size: 0.875rem;
  color: var(--vert-fonce);
  text-align: center;
}
.titre-abattre {
  font-family: var(--titre);
  font-size: 1.0625rem;
  color: var(--encre);
  background: var(--soleil);
  padding: 0.2em 0.7em 0.05em;
  border-radius: 0.54em;
  rotate: 2deg;
  box-shadow: 0 0.14em 0 rgba(0, 0, 0, 0.15);
}
.titre-pied {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 10px;
}
.titre-pied .pastille:nth-child(2) {
  transform: rotate(1deg);
}
.sans-js {
  max-width: 24rem;
  font-size: 0.9375rem;
  text-align: center;
}

/* ===================== placement ===================== */
.ecran-placement {
  display: grid;
  grid-template-rows: 1fr auto;
}
.placement-haut {
  position: absolute;
  z-index: 1;
  top: calc(var(--haut-sur) + 10px);
  left: 12px;
  right: 60px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
}
.placement-titre {
  font-size: 1.25rem;
}
.placement-aide {
  font-size: 0.8125rem;
}
.placement-carte {
  position: relative;
  min-height: 0;
}
.placement-fiche {
  margin: 0 10px calc(var(--bas-sur) + 12px);
  padding: 0.6rem 0.9rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9375rem;
}
.placement-prevision {
  margin: 0;
  font-family: var(--titre);
  font-size: 1.25rem;
  line-height: 1.15;
  color: var(--vert-fonce);
}
.placement-ami {
  margin: 0;
  color: var(--rose);
}
.placement-precedent {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--gris);
}
.placement-voisines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  font-size: 0.8125rem;
  color: var(--gris);
}
.placement-voisine {
  display: flex;
  justify-content: space-between;
  gap: 0.6em;
}
.placement-voisine-prix {
  font-family: var(--titre);
  color: var(--encre);
}
.placement-prix {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
}
.placement-prix-titre {
  flex: 1;
  color: var(--gris);
  font-size: 0.875rem;
}
.placement-prix .bouton-pas {
  flex: none;
  width: auto;
  height: auto;
  min-width: 3.5rem;
  min-height: 2.75rem;
  font-size: 1rem;
}
.placement-prix-valeur {
  font-family: var(--titre);
  font-size: 1.25rem;
  color: var(--encre);
  min-width: 5.5ch;
  text-align: center;
}
.placement-etude {
  margin: 0;
  font-weight: 800;
  color: var(--vert-fonce);
}
.placement-ouvrir {
  margin-top: 0.3rem;
  flex-direction: column;
  gap: 0.1em;
}
.placement-clavier {
  align-self: center;
}

/* ===================== jeu ===================== */
.ecran-jeu {
  pointer-events: none;
}
.jeu-grille {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: calc(3.5rem + var(--haut-sur)) 2.25rem minmax(0, 1fr) auto;
  grid-template-areas: 'hud' 'semaine' 'carte' 'panneau';
}
.hud {
  grid-area: hud;
}
.semaine {
  grid-area: semaine;
}
.jeu-carte {
  grid-area: carte;
}
.panneau {
  grid-area: panneau;
}
.ecran-jeu[data-mode='essai'] .semaine {
  visibility: hidden;
}

/* --- HUD --- */
.hud {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: calc(var(--haut-sur) + 6px) calc(var(--droite-sur) + 58px) 6px calc(var(--gauche-sur) + 8px);
  pointer-events: auto;
}
.hud-bouton {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--vert-fonce);
  font-family: var(--titre);
  font-size: 1rem;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15);
  cursor: pointer;
}
.hud-bouton .icone {
  width: 1.25rem;
  height: 1.25rem;
}
.hud-temps {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hud-temps {
  container-type: inline-size;
}
.hud-date {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* HUD étroit (police agrandie, petit téléphone) : « Jeu. · 08 h 45 », l'heure d'abord */
@container (max-width: 8rem) {
  .hud-date-jj {
    display: none;
  }
}
/* plus étroit encore (130 % en portrait) : l'heure seule, le jour se lit sur la bande de la semaine */
@container (max-width: 6.5rem) {
  .hud-date-jour,
  .hud-date-sep {
    display: none;
  }
}
.hud-jour {
  position: relative;
  height: 0.5rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px #e7e5e4;
}
.hud-pointe {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #fed7aa;
  border-radius: 1rem;
}
/* pointes de 7 h à 9 h et de 17 h à 19 h, sur 6 h → 22 h */
.hud-pointe-matin {
  left: 6.25%;
  width: 12.5%;
}
.hud-pointe-soir {
  left: 68.75%;
  width: 12.5%;
}
.hud-midi {
  position: absolute;
  left: 37.5%;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: #d6d3d1;
}
.hud-soleil {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0.875rem;
  height: 0.875rem;
  margin: -0.4375rem 0 0 -0.4375rem;
  border-radius: 50%;
  background: var(--soleil);
  box-shadow: 0 0 0 2px #fff, 0 1px 0 2px rgba(0, 0, 0, 0.12);
}
.hud-course {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}
.hud-toi {
  margin: 0;
  font-family: var(--titre);
  font-size: 1.25rem;
  line-height: 1.05;
  color: var(--vert-fonce);
  white-space: nowrap;
}
.hud-pepere {
  margin: 0;
  font-family: var(--titre);
  font-size: 0.8125rem;
  line-height: 1.1;
  color: var(--gris);
  white-space: nowrap;
}
.hud-derriere .hud-toi {
  color: var(--rouge);
}
.hud-essai {
  display: none;
  margin: 0;
  font-family: var(--titre);
  font-size: 1rem;
  color: var(--vert-fonce);
}
.hud[data-mode='essai'] .hud-course,
.hud[data-mode='essai'] .hud-vitesse {
  display: none;
}
.hud[data-mode='essai'] .hud-essai {
  display: block;
}

/* --- bande de la semaine --- */
.semaine {
  list-style: none;
  margin: 0;
  padding: 3px calc(var(--droite-sur) + 10px) 5px calc(var(--gauche-sur) + 10px);
  display: flex;
  gap: 5px;
}
.semaine-case {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  place-items: center;
  border-radius: 0.5rem;
  background: #fff;
  border: 2px dashed #d6d3d1;
  font-family: var(--titre);
  font-size: 0.75rem;
  line-height: 1;
  color: var(--gris);
}
.semaine-jour {
  padding-top: 0.15em;
}
.semaine-case[data-etat='encours'] {
  border: 2px solid var(--encre);
}
.semaine-case[data-etat='fini'] {
  border: 0;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}
.semaine-case[data-pastille='vert'] {
  background: var(--vert);
  color: #fff;
}
.semaine-case[data-pastille='jaune'] {
  background: var(--soleil);
  color: var(--encre);
}
.semaine-case[data-pastille='orange'] {
  background: var(--orange);
  color: var(--encre);
}
.semaine-case[data-pastille='rouge'] {
  background: var(--rouge);
  color: #fff;
}

/* --- carte --- */
.jeu-carte {
  position: relative;
  min-height: 0;
}
.jeu-carte-haut {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}
.hud-pris {
  font-size: 1rem;
  color: var(--rose);
}
.jeu-passer {
  margin-left: auto;
  min-height: 2.25rem;
  padding: 0.3em 0.6em;
  background: #fff;
  border-radius: 0.6em;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

/* --- panneau --- */
.panneau {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px calc(var(--droite-sur) + 10px) calc(var(--bas-sur) + 10px) calc(var(--gauche-sur) + 10px);
}
.panneau-haut {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.panneau-gerante {
  width: 7rem;
  height: 9.375rem;
}
.panneau-prix {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.prix-bulle {
  position: relative;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--titre);
  font-weight: 800;
  color: #fff;
  background: var(--vert);
  padding: 0.12em 0.45em 0.02em;
  border-radius: 0.38em;
  box-shadow: 0 0.12em 0 rgba(0, 0, 0, 0.2);
  rotate: -2deg;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  font-size: 2.125rem;
  line-height: 1.05;
  transition: background-color 0.24s;
}
.prix-bulle.glisse {
  scale: 1.04;
}
.prix-valeur {
  white-space: nowrap;
}
/* repère du pépère : centré sous la bulle, jamais hors de l'écran */
.prix-pepere {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  bottom: -0.7rem;
  font-family: var(--texte);
  font-size: 0.6875rem;
  line-height: 1;
  color: var(--pistolet);
  background: #fff;
  padding: 0.25em 0.5em;
  border-radius: 0.6em;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
  rotate: 3deg;
  white-space: nowrap;
}
.prix-marge {
  margin: 0.4rem 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--vert-fonce);
}
.prix-marge-negative {
  color: var(--rouge);
}
.prix-boutons {
  display: flex;
  gap: 8px;
}
.bouton-pas {
  flex: 1 1 0;
  min-height: 4rem;
  border: 0;
  border-radius: 1rem;
  background: var(--vert);
  color: #fff;
  font-family: var(--titre);
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1;
  padding-top: 0.15em;
  box-shadow: 0 6px 0 var(--vert-fonce);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.bouton-pas:active,
.bouton-pas.appui {
  translate: 0 4px;
  box-shadow: 0 2px 0 var(--vert-fonce);
}

/* puces de l'échelle des prix */
.panneau-puces {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
/* nom sur sa ligne, prix et distance dessous ; la distance passe à la ligne
   quand la place manque (police agrandie) au lieu de chevaucher le prix */
.puce {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: center;
  gap: 0 6px;
  min-height: 3.125rem;
  padding: 0.3rem 0.5rem 0.25rem;
  border: 0;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15);
  text-align: left;
  cursor: pointer;
}
.puce:active {
  translate: 0 2px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}
.puce-nom {
  flex: 1 0 100%;
  min-width: 0;
  font-size: 0.75rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--gris);
}
.puce-prix {
  font-family: var(--titre);
  font-size: 1.0625rem;
  line-height: 1.1;
  color: var(--bleu);
  white-space: nowrap;
}
.puce-dist {
  font-size: 0.6875rem;
  color: var(--gris);
  white-space: nowrap;
}
.puce-touche {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 1.1rem;
  padding: 2px 4px;
  border-radius: 0.4rem;
  background: var(--encre);
  color: #fff;
}
.puce-riposte {
  background: var(--rouge);
}
.puce-riposte .puce-nom,
.puce-riposte .puce-prix,
.puce-riposte .puce-dist {
  color: #fff;
}
.puce-fermee {
  opacity: 0.55;
  filter: grayscale(1);
}

/* cuve et camion */
.panneau-stock {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.cuve {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 0.35rem 0.6rem;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15);
}
.cuve-texte {
  font-size: 0.8125rem;
  line-height: 1.1;
}
.cuve-jauge {
  display: block;
  height: 0.5rem;
  border-radius: 1rem;
  background: #e7e5e4;
  overflow: hidden;
}
.cuve-niveau {
  display: block;
  height: 100%;
  background: var(--vert);
  transform-origin: left center;
  scale: 0 1;
}
.cuve-basse .cuve-texte {
  color: var(--rouge);
}
.cuve-basse .cuve-niveau {
  background: var(--rouge);
}
.camion {
  position: relative;
  flex: 0 1 9.5rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0.3rem 0.6rem;
  border: 0;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15);
  text-align: left;
  cursor: pointer;
}
.camion .touche {
  position: absolute;
  top: -6px;
  right: -4px;
  padding: 2px 4px;
  border-radius: 0.4rem;
  background: var(--encre);
  color: #fff;
}
.camion-nom {
  font-family: var(--titre);
  font-size: 0.9375rem;
  line-height: 1.1;
  color: var(--vert-fonce);
}
.camion-sous {
  font-size: 0.6875rem;
  line-height: 1.15;
  color: var(--gris);
}
.camion-indisponible .camion-nom {
  color: var(--gris);
}
.camion-urgent {
  background: var(--rouge);
}
.camion-urgent .camion-nom,
.camion-urgent .camion-sous {
  color: #fff;
}
.panneau[data-mode='essai'] .panneau-stock {
  display: none;
}

/* --- matin : bandeau en haut de la carte, carte figée au centre --- */
.matin-bandeau {
  position: absolute;
  top: 6px;
  left: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.5rem 0.7rem 0.6rem;
  font-size: 0.8125rem;
  pointer-events: auto;
  cursor: pointer;
}
.matin-ligne {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.matin-titre {
  margin: 0;
  font-family: var(--titre);
  font-size: 1.125rem;
  color: var(--vert-fonce);
  line-height: 1.1;
}
.matin-gros {
  margin: 0;
  font-family: var(--titre);
  font-size: 0.9375rem;
  color: var(--encre);
}
.matin-hausse {
  color: var(--vert-fonce);
}
.matin-conseil {
  margin: 0;
  color: var(--bleu);
}
.matin-ventes,
.matin-sous {
  margin: 0;
  color: var(--gris);
}
.commande {
  display: flex;
  gap: 6px;
}
.commande-choix {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 4.5rem;
  min-height: 2.75rem;
  padding: 0.3rem 0.6rem 0.2rem;
  border: 2px solid #e7e5e4;
  border-radius: 0.7rem;
  background: #fff;
  cursor: pointer;
}
.commande-choix[aria-checked='true'] {
  border-color: var(--vert);
  background: #dcfce7;
}
.commande-conseil {
  outline: 3px solid var(--soleil);
  outline-offset: 2px;
}
.commande-choix:disabled {
  opacity: 0.5;
  cursor: default;
}
.commande-nom {
  white-space: nowrap;
  font-family: var(--titre);
  font-size: 1rem;
  line-height: 1.1;
  color: var(--vert-fonce);
}
.commande-cout {
  font-size: 0.6875rem;
  color: var(--gris);
  white-space: nowrap;
}
.commande .touche {
  position: absolute;
  top: -6px;
  right: -4px;
  padding: 2px 4px;
  border-radius: 0.4rem;
  background: var(--encre);
  color: #fff;
}
.matin-changer {
  font-size: 0.8125rem;
  min-height: 2.25rem;
}
.matin-fige {
  position: fixed;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: min(26rem, calc(100vw - 24px));
  max-height: calc(var(--h) - 24px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  padding: 0.9rem 1rem 1rem;
  font-size: 0.875rem;
  pointer-events: auto;
}
.matin-fige .matin-titre {
  font-size: 2rem;
  align-self: center;
  padding-top: 0.1em;
}
.matin-raison {
  align-self: center;
  font-size: 1rem;
}
.matin-journal {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  font-size: 0.8125rem;
}
.matin-journal li::before {
  content: '';
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.45em;
  border-radius: 50%;
  background: var(--vert-fonce);
}
.matin-journal .matin-journal-rouge::before {
  background: var(--rouge);
}
.matin-journal .matin-journal-bleu::before {
  background: var(--bleu);
}
.matin-journal .matin-journal-encre::before {
  background: var(--encre);
}
.matin-fige .commande {
  justify-content: stretch;
}
.matin-fige .commande-choix {
  flex: 1 1 0;
}
.amenagements {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.amenagement {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 5rem;
  /* à droite, la place de la lettre A ou B */
  padding: 0.55rem 1.3rem 0.55rem 0.7rem;
  border: 2px solid #e7e5e4;
  border-radius: 0.9rem;
  background: var(--creme);
  text-align: left;
  cursor: pointer;
  rotate: -1deg;
}
.amenagement + .amenagement {
  rotate: 1.5deg;
}
.amenagement[aria-pressed='true'] {
  border-color: var(--vert);
  background: #dcfce7;
  box-shadow: 0 4px 0 var(--vert-fonce);
}
.amenagement-lettre {
  position: absolute;
  top: -8px;
  right: -6px;
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soleil);
  font-family: var(--titre);
  font-size: 0.875rem;
}
.amenagement-titre {
  font-family: var(--titre);
  font-size: 1.0625rem;
  line-height: 1.1;
  color: var(--vert-fonce);
}
.amenagement-texte {
  font-size: 0.8125rem;
  color: var(--gris);
}
.matin-ouvrir {
  margin-top: 0.3rem;
  flex-direction: column;
  gap: 0.1em;
}
/* téléphone couché : la carte défile, « Ouvrir la station » reste en bas, visible */
.matin-fige .matin-ouvrir {
  position: sticky;
  bottom: 0;
  z-index: 1;
}

/* --- autocollants ancrés sur la carte --- */
.accroche {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.accroche > * {
  position: absolute;
  left: 0;
  bottom: 0;
  translate: -50% 0;
}
.bulle-accrochee {
  font-size: 1.0625rem;
  max-width: min(14em, calc(100vw - 24px));
}
.bulle-centre {
  font-size: 1.25rem;
}
.carte-accrochee {
  width: max-content;
  max-width: min(17rem, calc(100vw - 24px));
  font-size: 0.875rem;
  line-height: 1.25;
  padding: 0.5em 0.75em;
}
.pastille-accrochee {
  width: max-content;
  font-size: 0.875rem;
}
.bulle-pouet {
  font-size: 1.125rem;
}
.badge-centre {
  font-size: 1.5rem;
  width: max-content;
}
.mot-centre {
  font-size: 2.25rem;
  width: max-content;
}
.pastille-caisse {
  width: max-content;
  font-size: 0.9375rem;
}
.pastille-negative {
  color: var(--rouge);
}

/* --- fiche d'une station --- */
.fiche {
  position: fixed;
  left: 0;
  top: 0;
  width: min(16rem, calc(100vw - 24px));
  padding: 0.6rem 0.8rem 0.7rem;
  font-size: 0.8125rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fiche p {
  margin: 0;
}
.fiche-nom {
  font-family: var(--titre);
  font-size: 1.0625rem;
  line-height: 1.15;
  padding-right: 1.6rem;
}
.fiche-adresse,
.fiche-etat {
  color: var(--gris);
}
.fiche-prix {
  color: var(--bleu);
}
.fiche-perso {
  color: var(--encre);
}
.fiche-mantan {
  align-self: flex-start;
  margin-top: 0.35rem;
  text-decoration: none;
}
.fiche-fermer {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  background: none;
  font-size: 1.25rem;
  color: var(--gris);
  cursor: pointer;
}
.fiche-liste {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.fiche-cible {
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}
.fiche-cible:focus-visible {
  opacity: 1;
}

/* --- fin de la journée d'essai --- */
.tuto-fin {
  position: fixed;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: min(24rem, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  padding: 1.1rem 1rem 1rem;
  text-align: center;
  pointer-events: auto;
}
.tuto-fin-titre {
  font-size: 1.75rem;
}
.tuto-fin-sous {
  margin: 0;
  font-size: 0.9375rem;
}

/* ===================== bilan : le ticket ===================== */
.ecran-bilan {
  pointer-events: none;
}
.bilan-carte {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 30%;
}
.bilan-gerante {
  position: absolute;
  left: 4px;
  top: calc(30% - 7.5rem);
  width: 6rem;
  height: 7.5rem;
}
/* le ticket défile par-dessus la carte ; le verdict se lit sous elle, sur le fond */
.bilan-defile {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(30vh + 4px) 16px calc(var(--bas-sur) + 24px);
  pointer-events: auto;
}
.bilan-entete {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
}
.bilan-verdict {
  font-size: min(2.75rem, 11vw);
  color: var(--vert-fonce);
}
.ecran-bilan[data-verdict='roi'] .bilan-verdict,
.ecran-bilan[data-verdict='belle'] .bilan-verdict {
  color: #fff;
  text-shadow: 0 0.05em 0 rgba(0, 0, 0, 0.18);
}
.ecran-bilan[data-verdict='faillite'] .bilan-verdict {
  color: var(--rouge);
}
.bilan-fois {
  font-size: 1rem;
}
.ticket {
  max-width: 30rem;
  margin: 0 auto;
  background: #fff;
  padding: 14px 16px 26px;
  font-family: var(--texte);
  color: var(--encre);
  box-shadow: 0 0.27em 0.68em rgba(0, 0, 0, 0.18);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), 97.5% 100%, 95% calc(100% - 9px), 92.5% 100%, 90% calc(100% - 9px), 87.5% 100%, 85% calc(100% - 9px), 82.5% 100%, 80% calc(100% - 9px), 77.5% 100%, 75% calc(100% - 9px), 72.5% 100%, 70% calc(100% - 9px), 67.5% 100%, 65% calc(100% - 9px), 62.5% 100%, 60% calc(100% - 9px), 57.5% 100%, 55% calc(100% - 9px), 52.5% 100%, 50% calc(100% - 9px), 47.5% 100%, 45% calc(100% - 9px), 42.5% 100%, 40% calc(100% - 9px), 37.5% 100%, 35% calc(100% - 9px), 32.5% 100%, 30% calc(100% - 9px), 27.5% 100%, 25% calc(100% - 9px), 22.5% 100%, 20% calc(100% - 9px), 17.5% 100%, 15% calc(100% - 9px), 12.5% 100%, 10% calc(100% - 9px), 7.5% 100%, 5% calc(100% - 9px), 2.5% 100%, 0 calc(100% - 9px));
}
.ticket p {
  margin: 0;
}
.ticket-tete {
  padding-bottom: 10px;
  border-bottom: 2px dashed #d6d3d1;
  font-family: var(--titre);
  font-size: 0.875rem;
  text-align: center;
  letter-spacing: 0.04em;
}
.ticket-mot {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--vert-fonce);
}
.bilan-guerre {
  padding: 8px 0;
  border-bottom: 2px dashed #e7e5e4;
  font-size: 0.9375rem;
}
.bilan-guerre-gagne {
  color: var(--vert-fonce);
}
.bilan-guerre-perd {
  color: var(--rouge);
}
.bilan-guerre-defi {
  color: var(--gris);
  font-size: 0.8125rem;
}
.ticket-lignes,
.ticket-gerants {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ticket-ligne {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto 0.9rem;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 2px dashed #e7e5e4;
  font-size: 0.875rem;
}
.ticket-jour {
  font-family: var(--titre);
  color: var(--gris);
}
.ticket-detail {
  color: var(--gris);
  min-width: 0;
}
.ticket-montant {
  font-family: var(--titre);
  font-size: 1.0625rem;
  white-space: nowrap;
  text-align: right;
  padding-top: 0.12em;
}
.ticket-montant.negatif {
  color: var(--rouge);
}
.ticket-case {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 0.25rem;
  background: #d6d3d1;
}
.case-vert {
  background: var(--vert);
}
.case-jaune {
  background: var(--soleil);
}
.case-orange {
  background: var(--orange);
}
.case-rouge {
  background: var(--rouge);
}
.ticket-reprise {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 2px dashed #e7e5e4;
  font-size: 0.8125rem;
}
.ticket-totaux {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  margin: 0;
  padding: 10px 0;
  border-bottom: 2px dashed #e7e5e4;
}
.ticket-total-nom,
.ticket-total-valeur {
  margin: 0;
  font-size: 0.9375rem;
}
.ticket-total-valeur {
  font-family: var(--titre);
  text-align: right;
}
.ticket .ticket-guerres {
  padding: 6px 0;
  border-bottom: 2px dashed #e7e5e4;
  font-size: 0.875rem;
  color: var(--rouge);
}
.ticket-total-nom.ticket-benefice {
  font-family: var(--titre);
  font-size: 1.25rem;
}
.ticket-total-valeur.ticket-benefice {
  font-size: 1.75rem;
  color: var(--vert-fonce);
}
.ticket-total-valeur.ticket-benefice.negatif {
  color: var(--rouge);
}
.ticket-sous {
  padding: 10px 0 4px;
  font-family: var(--titre);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vert-fonce);
}
.ticket-gerant {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
}
.gerant-nom {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.gerant-sous {
  font-size: 0.6875rem;
  color: var(--gris);
}
.gerant-toi {
  background: #dcfce7;
  box-shadow: inset 0 0 0 2px var(--vert);
}
.bilan-badge-bloc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 0 4px;
}
.bilan-badge {
  font-size: 1rem;
}
.bilan-badge-sous {
  font-size: 0.8125rem;
  color: var(--vert-fonce);
}
.ticket-conseil {
  font-size: 0.9375rem;
  line-height: 1.35;
}
.bilan-social {
  max-width: 30rem;
  margin: 16px auto 0;
}
.bilan-social:empty {
  display: none;
}
.bilan-actions {
  max-width: 30rem;
  margin: 18px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.bilan-secondaires {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.bilan-rejouer {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

/* ===================== pause et erreur ===================== */
.ecran-pause,
.ecran-erreur {
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(31, 41, 55, 0.28);
  pointer-events: auto;
}
.ecran-erreur {
  background: transparent;
}
.pause-carte,
.erreur-carte {
  width: min(24rem, 100%);
  max-height: calc(var(--h) - 32px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  padding: 1.2rem 1rem 1rem;
  text-align: center;
}
.pause-titre,
.erreur-titre {
  font-size: 2.5rem;
}
.erreur-titre {
  font-size: 1.75rem;
}
.pause-regle,
.erreur-texte {
  margin: 0;
  font-size: 0.9375rem;
}
.erreur-detail {
  margin: 0;
  font-size: 0.75rem;
  color: var(--gris);
}
.pause-reprendre {
  flex-direction: column;
  gap: 0.1em;
}
.pause-touches {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  font-size: 0.8125rem;
  color: var(--gris);
  text-align: left;
}

/* ===================== paysage : carte à gauche, panneau à droite ===================== */
@media (orientation: landscape) and (min-width: 700px) {
  .jeu-grille {
    grid-template-columns: minmax(0, 1fr) min(36vw, 420px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: 'carte hud' 'carte panneau' 'carte semaine';
  }
  /* la course contre le pépère prend sa propre ligne, en grand, sous l'heure */
  .hud {
    flex-wrap: wrap;
    row-gap: 4px;
    padding: calc(var(--haut-sur) + 10px) calc(var(--droite-sur) + 60px) 6px 10px;
  }
  .hud-course {
    order: 5;
    flex-basis: 100%;
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 0.6em;
  }
  .hud-toi {
    font-size: 1.375rem;
  }
  .hud-pepere {
    font-size: 1rem;
  }
  .semaine {
    height: 3rem;
    padding: 4px calc(var(--droite-sur) + 12px) calc(var(--bas-sur) + 12px) 12px;
  }
  .panneau {
    justify-content: center;
    gap: 10px;
    padding: 6px calc(var(--droite-sur) + 12px) 6px 12px;
  }
  .panneau-haut {
    grid-template-columns: 10rem minmax(0, 1fr);
  }
  .panneau-gerante {
    width: 10rem;
    height: 12.5rem;
  }
  .ecran-placement {
    grid-template-columns: minmax(0, 1fr) min(36vw, 420px);
    grid-template-rows: 1fr;
  }
  .placement-fiche {
    align-self: end;
    margin: 0 calc(var(--droite-sur) + 16px) calc(var(--bas-sur) + 16px) 0;
  }
  .placement-haut {
    right: calc(min(36vw, 420px) + 12px);
  }
  .ecran-titre {
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(42vw, 460px);
    grid-template-rows: auto 1fr auto auto auto;
    grid-template-areas: 'carte tete' 'carte nouvelles' 'carte menu' 'carte pied';
    align-items: center;
    justify-items: center;
    column-gap: 24px;
    padding: calc(var(--haut-sur) + 20px) calc(var(--droite-sur) + 24px) calc(var(--bas-sur) + 16px) calc(var(--gauche-sur) + 16px);
  }
  .titre-tete {
    grid-area: tete;
    padding-top: 30px;
  }
  .titre-carte {
    grid-area: carte;
    align-self: stretch;
    height: 100%;
  }
  .titre-nouvelles {
    grid-area: nouvelles;
    align-self: end;
  }
  .titre-menu {
    grid-area: menu;
  }
  .titre-pied {
    grid-area: pied;
  }
  .bilan-carte {
    left: 0;
    top: 0;
    bottom: 0;
    right: min(46vw, 520px);
    height: auto;
  }
  .bilan-gerante {
    left: 16px;
    top: auto;
    bottom: 16px;
    width: 8rem;
    height: 10rem;
  }
  /* la colonne du ticket s'arrête avant le bouton son, fixe en haut à droite */
  .bilan-defile {
    left: auto;
    width: min(46vw, 520px);
    padding: calc(var(--haut-sur) + 64px) calc(var(--droite-sur) + 62px) 0 12px;
  }
  /* « Défie tes amis » et « Rejouer » restent au bas de la colonne : le
     ticket remplit l'écran, et ils tombaient 400 px sous le bord */
  .bilan-actions {
    position: sticky;
    bottom: 0;
    z-index: 1;
    max-width: none;
    margin: 18px -8px 0;
    padding: 12px 8px calc(var(--bas-sur) + 12px);
    gap: 8px;
    background: var(--creme);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -6px 16px rgb(28 25 23 / 0.12);
  }
  .matin-bandeau {
    right: auto;
    width: min(30rem, calc(100% - 16px));
  }
}
/* téléphone couché : tout se resserre en hauteur */
@media (orientation: landscape) and (max-height: 520px) {
  .jeu-grille {
    grid-template-columns: minmax(0, 1fr) min(40vw, 340px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: 'carte hud' 'carte panneau' 'carte semaine';
  }
  /* téléphone couché : pas de place pour une seconde ligne de HUD */
  .hud {
    flex-wrap: nowrap;
    padding: calc(var(--haut-sur) + 4px) calc(var(--droite-sur) + 56px) 2px 8px;
  }
  .hud-course {
    order: 0;
    flex-basis: auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
  }
  .hud-toi {
    font-size: 1.125rem;
  }
  .hud-pepere {
    font-size: 0.75rem;
  }
  .hud-bouton {
    width: 2.25rem;
    height: 2.25rem;
  }
  .semaine {
    height: 2rem;
    padding: 2px 8px calc(var(--bas-sur) + 4px);
  }
  .panneau {
    gap: 4px;
    padding: 2px 8px;
  }
  .panneau-haut {
    grid-template-columns: 5rem minmax(0, 1fr);
  }
  .panneau-gerante {
    width: 5rem;
    height: 6.25rem;
  }
  .prix-bulle {
    font-size: 1.625rem;
  }
  .bouton-pas {
    min-height: 2.75rem;
    box-shadow: 0 4px 0 var(--vert-fonce);
  }
  .puce {
    min-height: 2.5rem;
  }
  .ecran-placement {
    grid-template-columns: minmax(0, 1fr) min(40vw, 340px);
    grid-template-rows: 1fr;
  }
  .placement-fiche {
    align-self: end;
    margin: 0 8px 8px 0;
  }
}
/* écrans étroits et bas (portrait de petit téléphone) */
@media (orientation: portrait) and (max-height: 700px) {
  .panneau-gerante {
    width: 5.5rem;
    height: 7.5rem;
  }
  .panneau-haut {
    grid-template-columns: 5.5rem minmax(0, 1fr);
  }
  .bouton-pas {
    min-height: 3.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fond-rayons,
  .badge,
  .pulse {
    animation: none;
  }
  .prix-bulle {
    transition: none;
  }
}

/* le seul lien sortant du titre : plein, aux couleurs de Mantan, pour qu'on le voie */
a.pastille-lien {
  background: var(--vert);
  color: var(--creme);
  text-decoration: none;
}
a.pastille-lien::after {
  content: " ↗";
}
a.pastille-lien:hover,
a.pastille-lien:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}
