/* ==========================================================================
   Choix Cash — design system
   Identité propre : violet profond + jaune soleil sur fond crème.
   L'inspiration assumée est la grammaire des apps d'apprentissage grand public
   (boutons épais avec relief, feedback immédiat, gros chiffres, mascotte),
   pas leur palette ni leurs formes.
   ========================================================================== */

/* --------------------------------------------------------------- police --
   Nunito est servie par le site lui-même, et non par les serveurs de Google :
   une requête à fonts.gstatic.com transmettrait l'adresse IP de chaque joueur
   à un tiers, ce qu'un établissement scolaire n'a pas à accepter pour lire une
   police de caractères. C'est aussi ce qui rend vraie la phrase des mentions
   légales : rien ne quitte le navigateur.

   Un seul fichier par sous-ensemble : Nunito est une police variable, l'axe
   `wght` couvre 400 à 900 d'un coup. Le `unicode-range` fait le reste — le
   navigateur ne télécharge latin-ext que s'il rencontre un caractère qui en
   relève. Les deux fichiers viennent de Google Fonts (SIL Open Font License).

   Fichiers à régénérer si Nunito change de version : voir README, « La police ».
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/nunito-latin.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: 400 900;
  font-display: swap;
  src: url('../fonts/nunito-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Couleurs de marque */
  --violet: #6C3BF4;
  --violet-fonce: #4A22B8;
  --violet-clair: #EFE8FF;
  --soleil: #FFC530;
  --soleil-fonce: #D99A00;
  --soleil-clair: #FFF4D6;
  /* Les teintes `-fonce` servent de couleur de TEXTE : à 15,5 px sur leur fond
     clair, #0A8F64 tombait à 3,6:1 et #C8383D à 4,3:1. Assombries, elles passent
     le seuil AA sans changer la famille de couleur. */
  --menthe: #12BE86;
  --menthe-fonce: #06704D;
  --menthe-clair: #DFF7ED;
  --corail: #FF5A5F;
  --corail-fonce: #9F292E;
  --corail-clair: #FFE6E7;
  /* L'ambre n'est pas un verdict : il signale un risque objectif, pas une faute. */
  --ambre: #E8A317;
  --ambre-fonce: #7E5300;
  /* Un cran plus saturé que --soleil-clair : le risque doit se lire comme un
     signal à lui, pas comme le fond d'un encart commercial. */
  --ambre-clair: #FFF1C9;
  --ciel: #2E9BFF;
  --ciel-fonce: #1E6FC4;
  --ciel-clair: #E3F1FF;
  --or: #E8A317;

  /* Neutres */
  --creme: #FFFCF5;
  --papier: #FFFFFF;
  --encre: #1D1730;
  --encre-douce: #6B6383;
  --trait: #E7E2F0;
  --trait-fort: #D5CEE6;

  /* Formes */
  --r-s: 12px;
  --r-m: 18px;
  --r-l: 26px;
  --relief: 4px;

  --pile: 0 6px 0 0 var(--trait-fort);
  --ombre-carte: 0 2px 0 0 var(--trait), 0 12px 28px -18px rgba(29, 23, 48, 0.5);

  --police: 'Nunito', 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--police);
  background: #17102E;
  color: var(--encre);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  /* La page elle-même ne scrolle jamais : seul le corps d'un écran scrolle.
     Sans ça, le pied collant d'un écran long sort du champ et les boutons
     d'action deviennent inatteignables sur mobile. */
  overflow: hidden;
}

/* Cadre : plein écran sur mobile, colonne centrée sur desktop. */
#app {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--creme);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 520px) {
  body {
    background:
      radial-gradient(1200px 600px at 50% -10%, #3A2570 0%, transparent 60%),
      #17102E;
    padding: 24px 0;
  }
  #app {
    min-height: min(880px, calc(100dvh - 48px));
    height: min(880px, calc(100dvh - 48px));
    border-radius: 32px;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7);
  }
}

/* ---------------------------------------------------------------- écrans -- */

.ecran {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  animation: entree 260ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.ecran--sortie { animation: sortie 180ms ease-in forwards; }

@keyframes entree {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes sortie {
  to { opacity: 0; transform: translateY(-10px) scale(0.99); }
}

.corps {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 20px 8px;
  -webkit-overflow-scrolling: touch;
}

.pied {
  position: relative;
  flex: none;
  padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
  background: var(--creme);
  border-top: 2px solid var(--trait);
  display: grid;
  gap: 10px;
}
/* Un contenu qui passe sous un bord collant doit s'estomper, pas se faire
   trancher net au milieu d'un chiffre. */
.pied::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 26px;
  background: linear-gradient(rgba(255, 252, 245, 0), var(--creme));
  pointer-events: none;
}
.pied--nu { border-top: none; background: transparent; }
.pied--nu::before { display: none; }
.pied--succes { background: var(--menthe-clair); border-color: #A9E7CE; }
.pied--succes::before { background: linear-gradient(rgba(223, 247, 237, 0), var(--menthe-clair)); }
.pied--echec { background: var(--corail-clair); border-color: #F7C2C4; }
.pied--echec::before { background: linear-gradient(rgba(255, 230, 231, 0), var(--corail-clair)); }

.pied__verdict {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.pied__verdict h3 {
  margin: 0 0 2px;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.4px;
}
.pied__verdict p { margin: 0; font-size: 13.5px; font-weight: 700; line-height: 1.4; }
.pied__verdict--juste h3 { color: var(--menthe-fonce); }
.pied__verdict--faux h3 { color: var(--corail-fonce); }

/* ---------------------------------------------------------------- boutons -- */

.btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.2px;
  border: none;
  border-radius: var(--r-m);
  padding: 15px 20px;
  cursor: pointer;
  color: #fff;
  background: var(--violet);
  box-shadow: 0 var(--relief) 0 0 var(--violet-fonce);
  transition: transform 60ms ease, box-shadow 60ms ease, filter 120ms ease;
  width: 100%;
  text-align: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) {
  transform: translateY(var(--relief));
  box-shadow: 0 0 0 0 var(--violet-fonce);
}
/* Un bouton inactif doit être gris, pas une version fanée du bouton actif :
   sinon il se lit comme un bouton enfoncé ou cassé. */
.btn:disabled {
  background: var(--trait);
  color: var(--encre-douce);
  box-shadow: 0 var(--relief) 0 0 var(--trait-fort);
  cursor: not-allowed;
}
.btn:focus-visible { outline: 3px solid var(--encre); outline-offset: 3px; }

.btn--succes { background: var(--menthe); box-shadow: 0 var(--relief) 0 0 var(--menthe-fonce); }
.btn--succes:active:not(:disabled) { box-shadow: none; }
.btn--soleil { background: var(--soleil); color: #3A2A00; box-shadow: 0 var(--relief) 0 0 var(--soleil-fonce); }
.btn--soleil:active:not(:disabled) { box-shadow: none; }
.btn--danger { background: var(--corail); box-shadow: 0 var(--relief) 0 0 var(--corail-fonce); }
.btn--danger:active:not(:disabled) { box-shadow: none; }

.btn--fantome {
  background: transparent;
  color: var(--encre-douce);
  box-shadow: none;
  border: 2px solid var(--trait);
  padding: 13px 20px;
}
.btn--fantome:active:not(:disabled) { transform: translateY(2px); }

.btn--texte {
  font-family: inherit;
  font-weight: 800;
  background: none;
  border: none;
  box-shadow: none;
  color: var(--encre-douce);
  font-size: 14px;
  padding: 10px;
  width: auto;
  cursor: pointer;
  border-radius: var(--r-s);
}
.btn--texte:active { transform: translateY(1px); }

/* ------------------------------------------------------------------ hud -- */

.hud {
  flex: none;
  padding: calc(8px + env(safe-area-inset-top)) 14px 9px;
  display: grid;
  gap: 7px;
  background: var(--creme);
  border-bottom: 2px solid var(--trait);
}

.hud__ligne {
  display: flex;
  align-items: center;
  gap: 9px;
}

.hud__quitter {
  border: none;
  background: none;
  font-size: 19px;
  line-height: 1;
  color: var(--encre-douce);
  cursor: pointer;
  padding: 11px;
  margin: -11px -6px -11px -11px; /* cible de 44 px sans décaler la mise en page */
  border-radius: var(--r-s);
}

.barre {
  flex: 1;
  height: 14px;
  background: var(--trait);
  border-radius: 999px;
  overflow: hidden;
}
.barre__jauge {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--violet), #9B6BFF);
  transition: width 700ms cubic-bezier(0.2, 0.9, 0.3, 1);
  position: relative;
}
.barre__jauge::after {
  content: '';
  position: absolute;
  inset: 3px 6px auto 6px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.age-pastille {
  font-weight: 900;
  font-size: 13px;
  background: var(--violet-clair);
  color: var(--violet-fonce);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
}

/* Le patrimoine vit dans la première ligne du HUD : il n'a pas besoin d'une
   ligne à lui, et l'écran de décision a besoin de ces 40 px. */
.patrimoine {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-left: auto;
  white-space: nowrap;
}
.patrimoine__val {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
}
.patrimoine__lib {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--encre-douce);
}
.patrimoine__delta {
  position: absolute;
  right: 12px;
  top: calc(30px + env(safe-area-inset-top));
  z-index: 2;
  background: var(--creme);
  border-radius: 8px;
  padding: 1px 5px;
  font-size: 15px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}
.patrimoine__delta--actif { animation: flotte 1400ms ease-out; }
.patrimoine__delta--pos { color: var(--menthe-fonce); }
.patrimoine__delta--neg { color: var(--corail-fonce); }

@keyframes flotte {
  0% { opacity: 0; transform: translateY(8px); }
  25% { opacity: 1; transform: translateY(0); }
  75% { opacity: 1; transform: translateY(-2px); }
  100% { opacity: 0; transform: translateY(-12px); }
}

/* --------------------------------------------------------------- jauges -- */

.jauges { display: flex; gap: 10px; }

.jauge { flex: 1; min-width: 0; }
/* Libellé au-dessus, valeur en dessous alignée à gauche : en ligne, à 390 px,
   les trois jauges se lisaient comme une seule phrase. */
.jauge__tete {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: var(--encre-douce);
  margin-bottom: 2px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jauge__val {
  display: block;
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--encre);
  line-height: 1.1;
  margin-bottom: 3px;
}
.jauge__piste {
  height: 7px;
  background: var(--trait);
  border-radius: 999px;
  overflow: hidden;
}
/* Quand il n'y a qu'une ou deux jauges, l'empilement libellé/valeur gaspille
   de la hauteur : à cette largeur, la ligne se lit très bien. */
.jauges--peu .jauge__tete { display: inline; }
.jauges--peu .jauge__val { display: inline; margin-left: 5px; font-size: 12.5px; }
.jauges--peu .jauge__piste { margin-top: 4px; }

.jauge--neuve { animation: jaugeArrive 700ms cubic-bezier(0.2, 0.9, 0.3, 1.3); }
@keyframes jaugeArrive {
  from { opacity: 0; transform: translateY(-8px) scale(0.9); }
  to { opacity: 1; transform: none; }
}
.jauge__remplissage {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 800ms cubic-bezier(0.2, 0.9, 0.3, 1), background 300ms;
}
.jauge--qualiteVie .jauge__remplissage { background: var(--soleil); }
.jauge--risque .jauge__remplissage { background: var(--corail); }
.jauge--liberte .jauge__remplissage { background: var(--ciel); }
.jauge--pulse { animation: pulse 600ms ease; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.06); }
}

/* --------------------------------------------------------------- cartes -- */

.carte {
  background: var(--papier);
  border: 2px solid var(--trait);
  border-radius: var(--r-l);
  padding: 18px;
  box-shadow: var(--ombre-carte);
}

.carte__emoji {
  font-size: 36px;
  line-height: 1;
  display: block;
  margin-bottom: 6px;
}
.carte__titre {
  font-size: 21px;
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.5px;
  margin: 0 0 8px;
}
.carte__texte {
  font-size: 15px;
  line-height: 1.5;
  color: #3E3557;
  margin: 0;
  max-width: 36ch; /* au-delà, la ligne devient inconfortable à lire */
}

/* Appel vers la micro-leçon : une seule ligne, pour ne pas repousser les
   options hors de l'écran. C'est une invitation, pas un mur. */
.lecon-cta {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  font-family: inherit;
  background: var(--soleil-clair);
  border: 2px solid #F3DFA6;
  border-radius: var(--r-m);
  padding: 10px 13px;
  margin-top: 12px;
  cursor: pointer;
  transition: transform 80ms ease;
}
.lecon-cta:active { transform: translateY(2px); }
.lecon-cta__emoji { font-size: 23px; line-height: 1; }
.lecon-cta__titre {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 900;
  font-size: 14px;
  line-height: 1.25;
}
.lecon-cta__cta {
  display: block;
  font-weight: 900;
  font-size: 11.5px;
  color: var(--soleil-fonce);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 2px;
}
.lecon-cta__fleche { margin-left: auto; font-size: 20px; font-weight: 900; color: var(--soleil-fonce); }

.etiquette {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.etiquette--imprevu { background: var(--corail-clair); color: var(--corail-fonce); }
.etiquette--decision { background: var(--violet-clair); color: var(--violet-fonce); }
.etiquette--lecon { background: var(--soleil-clair); color: var(--soleil-fonce); }

/* -------------------------------------------------------------- options -- */

.options { display: grid; gap: 10px; margin-top: 14px; }

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  font-family: inherit;
  background: var(--papier);
  border: 2px solid var(--trait);
  border-bottom-width: 4px;
  border-radius: var(--r-m);
  padding: 12px 14px;
  cursor: pointer;
  transition: transform 80ms ease, border-color 120ms ease, background 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
.option:hover { border-color: var(--trait-fort); }
.option:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
  margin-bottom: 2px;
  background: var(--violet-clair);
  border-color: var(--violet);
}
.option:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
/* Dans le parcours, une option retenue n'est ni juste ni fausse : elle est
   simplement la tienne. Violet, et le mot est écrit. */
.option--choisie { border-color: var(--violet); background: var(--violet-clair); }
/* Réservé au transitoire (les options écartées après un choix). Pour du contenu
   permanent, une teinte plutôt qu'une opacité : à 0,4 le texte devient illisible. */
.option--fanee { opacity: 0.4; }
.option--terne { background: #FAF7FF; border-color: var(--trait); }
.option--terne .option__libelle { color: var(--encre-douce); }

.picto { width: 38px; height: 38px; flex: none; }
.option__corps { display: block; flex: 1; min-width: 0; }
.option__libelle { display: block; font-size: 15.5px; font-weight: 800; line-height: 1.28; }
.option__detail {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--encre-douce);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.option__revele {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 2px dashed var(--trait);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
}
.option__revele--su { color: var(--menthe-fonce); }
.option__revele--verrou { color: var(--encre-douce); opacity: 0.75; }

/* ------------------------------------------------------------ mascotte -- */

.mascotte { display: block; width: 92px; height: 92px; flex: none; }
.mascotte--petite { width: 56px; height: 56px; }
.mascotte--grande { width: 132px; height: 132px; }
.mascotte--saute { animation: saute 900ms cubic-bezier(0.3, 0.9, 0.4, 1.4); }
.mascotte--tremble { animation: tremble 500ms ease; }

@keyframes saute {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-18px) rotate(-6deg); }
  55% { transform: translateY(0) scaleY(0.92); }
  75% { transform: translateY(-6px) rotate(3deg); }
}
@keyframes tremble {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px) rotate(-4deg); }
  45% { transform: translateX(6px) rotate(3deg); }
  70% { transform: translateX(-3px); }
}

.bulle {
  position: relative;
  background: var(--papier);
  border: 2px solid var(--trait);
  border-radius: var(--r-m);
  padding: 12px 14px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
  flex: 1;
}
.bulle::before,
.bulle::after {
  content: '';
  position: absolute;
  left: -9px;
  top: 22px;
  border: 9px solid transparent;
  border-right-color: var(--trait);
  border-left: 0;
}
.bulle::after {
  left: -6px;
  border-right-color: var(--papier);
}

.duo { display: flex; align-items: flex-start; gap: 10px; }

/* --------------------------------------------------- écran conséquence -- */

.consequence {
  width: 100%;
  background: var(--papier);
  border-top: 3px solid var(--trait);
  border-radius: 26px 26px 0 0;
  padding: 18px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 40px -24px rgba(29, 23, 48, 0.55);
  animation: monte 300ms cubic-bezier(0.2, 0.9, 0.3, 1.15);
  z-index: 20;
}
/* Un choix de vie n'a pas de couleur de résultat : le panneau reste crème, même
   quand la décision coûte cher. Acheter un logement fait fondre le compte
   courant — ce n'est pas une erreur, c'est un actif qui apparaît. Seules deux
   choses sortent du ton neutre, et ni l'une ni l'autre ne juge le joueur :
   l'ambre pour un risque objectivement pris, le corail pour un préjudice subi
   (fraude, crédit refusé). */
.consequence--neutre { background: var(--creme); border-color: var(--trait); }
.consequence--risque { background: var(--ambre-clair); border-color: #F3DFA6; }
.consequence--prejudice { background: var(--corail-clair); border-color: #F7C2C4; }

.consequence__etiquette {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--encre-douce);
}
.consequence--neutre .consequence__etiquette { background: var(--violet-clair); color: var(--violet-fonce); }
.consequence--risque .consequence__etiquette { color: var(--ambre-fonce); }
.consequence--prejudice .consequence__etiquette { color: var(--corail-fonce); }

@keyframes monte {
  from { transform: translateY(100%); }
  to { transform: none; }
}

.consequence__titre {
  font-size: 17px;
  font-weight: 900;
  margin: 0 0 6px;
}
.consequence__texte {
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0 0 14px;
  color: #3E3557;
}
.consequence__chiffres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.puce {
  font-size: 12.5px;
  font-weight: 900;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  font-variant-numeric: tabular-nums;
}
/* Le chiffre garde sa couleur — il dit un sens de variation, pas un verdict.
   C'est la carte entière qui ne doit plus se colorer. */
.puce--pos { color: var(--menthe-fonce); }
.puce--neg { color: var(--corail-fonce); }
.puce--alerte { color: var(--ambre-fonce); }

/* ----------------------------------------------------- passage du temps -- */

.temps {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 30px;
  text-align: center;
  background: linear-gradient(180deg, #3A2570 0%, #17102E 100%);
  color: #fff;
}
.temps__annees {
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--soleil);
}
.temps__age {
  font-size: 68px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}
.temps__faits { display: grid; gap: 8px; width: 100%; max-width: 300px; }
.temps__fait {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--r-s);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  opacity: 0;
  animation: apparait 400ms ease forwards;
}
@keyframes apparait {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------- leçon -- */

.lecon__progres { display: flex; gap: 5px; padding: 0 0 16px; }
.lecon__segment {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: var(--trait);
}
.lecon__segment--fait { background: var(--soleil); }

/* Un écran de leçon court se centre : suspendu sous le HUD avec 400 px de vide
   dessous, il se lit comme inachevé. */
.corps--centre {
  display: flex;
  flex-direction: column;
  justify-content: safe center;
}

.curseur-bloc {
  background: var(--violet-clair);
  border-radius: var(--r-m);
  padding: 18px 20px;
  margin-top: 16px;
  text-align: center;
}
.curseur-bloc__valeur {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.curseur-bloc__valeur--alerte { color: var(--corail-fonce); }
.curseur-bloc__valeur--bon { color: var(--menthe-fonce); }
.curseur-bloc__legende { font-size: 13.5px; font-weight: 800; color: var(--violet-fonce); margin-top: 2px; }
.curseur-bloc__detail { font-size: 13.5px; line-height: 1.45; color: #4A4166; margin-top: 10px; min-height: 38px; }

/* La mesure est une grille de pastilles, pas une seconde piste horizontale :
   deux barres identiques empilées, on ne sait plus laquelle on manipule. */
.curseur-bloc__mesure {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin: 12px 0 14px;
}
.curseur-bloc__mesure i {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.75);
  transition: background 180ms ease, transform 180ms ease;
}
.curseur-bloc__mesure i.pleine { background: var(--violet); transform: scale(1.08); }

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: calc(100% - 30px); /* le pouce ne doit pas déborder du rail */
  height: 38px;
  background: transparent;
  margin: 6px auto 0;
  display: block;
  cursor: pointer;
}
input[type='range']::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--trait-fort);
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  margin-top: -11px;
  border-radius: 50%;
  background: var(--violet);
  border: 4px solid #fff;
  box-shadow: 0 3px 0 0 var(--violet-fonce);
}
input[type='range']::-moz-range-track {
  height: 12px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--trait-fort);
}
input[type='range']::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--violet);
  border: 4px solid #fff;
}

.point-cle {
  margin-top: 16px;
  background: var(--soleil-clair);
  border-left: 5px solid var(--soleil);
  border-radius: 0 var(--r-s) var(--r-s) 0;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

/* Une option verrouillée après réponse reste PLEINEMENT lisible : c'est le seul
   instant de fierté de la leçon, il ne doit pas être grisé par le navigateur. */
.option--verrouillee { pointer-events: none; }
.quiz__option--juste {
  border-color: var(--menthe);
  background: var(--menthe-clair);
  opacity: 1;
}
.quiz__option--juste .option__libelle { color: var(--menthe-fonce); }
.quiz__option--faux {
  border-color: var(--corail);
  background: var(--corail-clair);
  opacity: 1;
}
.quiz__option--faux .option__libelle { color: var(--corail-fonce); }
.quiz__option--ecartee { opacity: 0.45; }

/* La couleur seule ne dit rien à qui distingue mal le rouge du vert — et sur un
   téléphone au soleil, à peu près personne ne les distingue. Le glyphe porte
   l'information, la couleur ne fait que la répéter. */
.option__marque {
  flex: none;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  margin-left: 4px;
}
.option__marque--juste { color: var(--menthe-fonce); }
.option__marque--faux { color: var(--corail-fonce); }
.option__marque--choix {
  font-size: 11.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--violet-fonce);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  padding: 5px 9px;
}

/* Lisible par un lecteur d'écran, invisible à l'œil. */
.hors-vue {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --------------------------------------------------------------- bilan -- */

.bilan__entete {
  text-align: center;
  padding: 24px 20px 18px;
  color: #fff;
  background: linear-gradient(180deg, #3A2570, #2A1A55);
}
.bilan__entete--gagne { background: linear-gradient(180deg, #0F9E70, #0A7350); }
.bilan__verdict {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.85;
}
.bilan__montant {
  font-size: 46px;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin: 6px 0 2px;
}
.bilan__reel { font-size: 13px; font-weight: 700; opacity: 0.8; }

/* Le chemin parcouru avant le mot qui le nomme : cinq barreaux, ceux gravis en
   jaune. Un joueur à 800 000 € doit voir quatre barreaux pleins, pas un échec. */
.echelle { display: flex; justify-content: center; gap: 5px; margin: 12px 0 10px; }
.echelle i {
  width: 28px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
}
.echelle i.echelle__gravi { background: var(--soleil); }
.bilan__palier {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.3px;
  line-height: 1.25;
  margin-bottom: 6px;
}

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.stat {
  background: var(--papier);
  border: 2px solid var(--trait);
  border-radius: var(--r-m);
  padding: 12px 14px;
}
.stat__lib {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--encre-douce);
}
.stat__val {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.stat--large { grid-column: 1 / -1; }

.section-titre {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--encre-douce);
  margin: 22px 0 10px;
}

.courbe { width: 100%; height: 128px; display: block; }

.rang {
  background: var(--soleil-clair);
  border: 2px solid #F3DFA6;
  border-radius: var(--r-m);
  padding: 14px 16px;
  margin-top: 16px;
  text-align: center;
}
.rang__val { font-size: 30px; font-weight: 900; letter-spacing: -1px; }
.rang__lib { font-size: 13px; font-weight: 800; color: #7A5B00; }

/* La révélation de l'inflation : deux sommes qui sont la même, séparées par un
   signe « = » qu'on ne croit pas au premier regard. C'est tout l'effet voulu. */
.reveal {
  background: var(--violet-clair);
  border: 2px solid #DCCEFF;
  border-radius: var(--r-m);
  padding: 16px;
}
.reveal__bascule {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.reveal__somme {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.8px;
  font-variant-numeric: tabular-nums;
  color: var(--violet-fonce);
}
.reveal__somme--reel { color: var(--encre); }
.reveal__annee {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--encre-douce);
  margin-top: 2px;
}
.reveal__signe {
  font-size: 24px;
  font-weight: 900;
  color: var(--violet);
}
.reveal__texte {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px solid #DCCEFF;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}
.reveal__texte p { margin: 0 0 8px; }
.reveal__texte p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------- parcours -- */

.parcours { padding: 6px 0 24px; }

.entete-app {
  padding: calc(20px + env(safe-area-inset-top)) 20px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.entete-app__titre {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.8px;
  margin: 0;
  line-height: 1.1;
}
.entete-app__sous {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--encre-douce);
  margin: 2px 0 0;
}

.noeud {
  display: flex;
  gap: 14px;
  align-items: stretch;
  padding: 0 20px;
  position: relative;
}
.noeud__rail {
  width: 56px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.noeud__pastille {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  flex: none;
  background: var(--violet);
  box-shadow: 0 5px 0 0 var(--violet-fonce);
  color: #fff;
}
.noeud__pastille--vert { background: var(--menthe); box-shadow: 0 5px 0 0 var(--menthe-fonce); }
.noeud__pastille--bleu { background: var(--ciel); box-shadow: 0 5px 0 0 var(--ciel-fonce); }
.noeud__pastille--verrou { background: var(--trait); box-shadow: 0 5px 0 0 var(--trait-fort); }
.noeud--actif .noeud__rail { width: 76px; }
.noeud--actif .noeud__pastille {
  width: 76px;
  height: 76px;
  font-size: 34px;
  animation: respire 2600ms ease-in-out infinite;
}
@keyframes respire {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}
.noeud__fil {
  flex: 1;
  width: 5px;
  background: var(--trait);
  border-radius: 999px;
  margin: 8px 0;
  min-height: 22px;
}
.noeud__fil--fait { background: var(--violet); opacity: 0.55; }
.noeud__carte {
  flex: 1;
  background: var(--papier);
  border: 2px solid var(--trait);
  border-bottom-width: 4px;
  border-radius: var(--r-m);
  padding: 13px 15px;
  margin-bottom: 12px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: transform 80ms ease, border-color 120ms;
}
.noeud__carte:active { transform: translateY(2px); }
.noeud__carte--verrou { cursor: pointer; background: #FAF7FF; }
.noeud--actif .noeud__carte {
  border-color: var(--violet);
  border-width: 3px;
  border-bottom-width: 5px;
}
.noeud__numero {
  font-size: 11px;
  font-weight: 800;
  color: var(--violet);
}
.noeud__carte--verrou .noeud__numero { color: var(--encre-douce); }
.noeud__titre { font-size: 17px; font-weight: 900; letter-spacing: -0.3px; margin-top: 1px; }
.noeud--actif .noeud__titre { font-size: 20px; }
.noeud__sous { font-size: 13px; font-weight: 700; color: var(--encre-douce); margin-top: 2px; }
.noeud__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 9px;
  font-size: 12px;
  font-weight: 800;
  color: var(--encre-douce);
}
.noeud__meta > span { white-space: nowrap; }
.noeud__score {
  background: var(--menthe-clair);
  color: var(--menthe-fonce);
  border-radius: 999px;
  padding: 3px 9px;
  font-weight: 900;
}
.noeud__commencer {
  margin-left: auto;
  background: var(--violet);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 3px 0 0 var(--violet-fonce);
}

/* Compteur de notions : l'équivalent de la série, il doit être en haut. */
.compteur-notions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
}
.compteur-notions__piste {
  width: 56px;
  height: 7px;
  background: var(--trait);
  border-radius: 999px;
  overflow: hidden;
}
.compteur-notions__piste > i { display: block; height: 100%; background: var(--soleil); border-radius: 999px; }
.compteur-notions__val { font-size: 12.5px; font-weight: 900; color: var(--soleil-fonce); }

/* ---------------------------------------------------------------- intro -- */

.intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 30px 26px;
  background: linear-gradient(180deg, #3A2570 0%, #17102E 100%);
  color: #fff;
  text-align: center;
}
.intro__ligne {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.35;
  opacity: 0;
  animation: apparait 500ms ease forwards;
}
.intro__ligne--fort {
  font-size: 27px;
  font-weight: 900;
  color: var(--soleil);
  margin-top: 8px;
}

/* ---------------------------------------------------------------- offre -- */

.offre { display: grid; gap: 10px; }
.offre__item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--papier);
  border: 2px solid var(--trait);
  border-radius: var(--r-m);
  padding: 12px 14px;
  font-weight: 800;
  font-size: 15px;
}
.offre__item span:first-child { font-size: 22px; }

.champ {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 16px;
  border: 2px solid var(--trait-fort);
  border-radius: var(--r-m);
  background: var(--papier);
  color: var(--encre);
}
.champ:focus { outline: none; border-color: var(--violet); }

/* -------------------------------------------------- voile et feuille modale -- */

.voile {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(29, 23, 48, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  animation: fondu 200ms ease;
}
.voile--bas { align-items: flex-end; padding: 0; }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }

.modale {
  background: var(--papier);
  border-radius: var(--r-l);
  padding: 20px;
  width: 100%;
  display: grid;
  gap: 10px;
  animation: entree 240ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modale__titre { margin: 0; font-size: 20px; font-weight: 900; text-align: center; }
.modale__texte { margin: 0 0 6px; font-size: 14.5px; line-height: 1.45; text-align: center; color: #3E3557; }

.btn--icone {
  border: none;
  background: var(--violet-clair);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex: none;
}

.hud__budget {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--encre-douce);
}
.hud__budget b { color: var(--encre); font-variant-numeric: tabular-nums; }

.option__fleche { font-size: 17px; font-weight: 900; color: var(--encre-douce); flex: none; }
.option__revele {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px dashed var(--trait);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
}

.carte--situation { margin-top: 14px; }
.carte--partage {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  border-bottom-width: 4px;
}
.carte--partage:active { transform: translateY(2px); }

.consequence__montant {
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -0.8px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin: 2px 0 4px;
  animation: entree 320ms cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.consequence__montant--pos { color: var(--menthe-fonce); }
.consequence__montant--neg { color: var(--corail-fonce); }
.consequence__alerte {
  background: rgba(255, 255, 255, 0.75);
  border-radius: var(--r-s);
  padding: 9px 11px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--corail-fonce);
}

.pied--sombre { background: #17102E; border-top: none; }
.pied--sombre::before { display: none; }
.pied__liens { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }

.lecon__progres { display: flex; gap: 5px; flex: 1; }
.age-pastille--lecon {
  background: var(--soleil-clair);
  color: var(--soleil-fonce);
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.curseur-bloc__unite { font-size: 12px; font-weight: 900; color: var(--violet-fonce); }

.intro__regles {
  margin-top: 24px;
  font-size: 14px;
  font-weight: 700;
  color: #B9AEDA;
  line-height: 1.75;
  opacity: 0;
  animation: apparait 500ms ease forwards;
}
.intro__graine {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 700;
  color: #9C8FC4;
  opacity: 0;
  animation: apparait 500ms ease forwards;
}

.courbe__pieds {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--encre-douce);
  padding: 2px 4px 4px;
}

/* ------------------------------------------------------------- confettis -- */

.confettis {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 40;
}
.confetti {
  position: absolute;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: tombe linear forwards;
}
@keyframes tombe {
  from { transform: translateY(-40px) rotate(0deg); opacity: 1; }
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.9; }
}

/* ------------------------------------------------------------ divers -- */

.centre { text-align: center; }
.gras { font-weight: 900; }

/* Le seul endroit du jeu qui sort vers une page statique. Discret par
   construction : ces liens ne doivent jamais concurrencer un challenge. */
.liens-legaux {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 4px 0 26px;
  font-size: 13px;
  font-weight: 800;
}
.liens-legaux a { color: var(--encre-douce); text-decoration: none; }
.liens-legaux a:hover { color: var(--violet); text-decoration: underline; }
.liens-legaux span { color: var(--trait-fort); }

/* Information obligatoire au moment de la collecte : elle doit être lisible,
   donc pas en gris clair sur fond jaune. */
.mention-collecte {
  margin: 12px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  color: #6A5320;
}
.mention-collecte a { color: #6A5320; }
.mention-collecte--echec {
  color: var(--corail-fonce);
  font-weight: 800;
}
.pile-verticale { display: grid; gap: 12px; }
.espace-haut { margin-top: 16px; }

.info-ligne {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 2px solid var(--trait);
  font-size: 14.5px;
}
.info-ligne:last-child { border-bottom: none; }
.info-ligne__lib { font-weight: 700; color: var(--encre-douce); }
.info-ligne__val { font-weight: 900; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
