/* ¡AFUERA! V2 — charte « bleu de Prusse » :
   fond bleu de Prusse (tirant vers le vert), craie pour les fiches, glacier pour les repères,
   corail pour l'action, rouge vif réservé à la rage. Aucun doré.
   Typographies : Bodoni Moda (titres, montants, citations), Work Sans (texte, interface), Anton (logo, tampons).
   Toute la palette et les durées sont pilotées par les variables ci-dessous. */
:root {
  --encre: #0D2633;
  --nuit: #0A2029;
  --ardoise: #163C4C;
  --ardoise-2: #2A5465;
  --papier: #EEF2EC;
  --papier-2: #DDE6E2;
  --papier-trait: #C5D2D2;
  --texte: #0D2633;
  --texte-doux: #4D6670;
  --clair: #EEF2EC;
  --clair-doux: #B7C9CC;
  --rouge: #C9452B;
  --rouge-vif: #FF7A5C;
  --or: #9CCFDD;
  --vert: #2FA57D;
  --action: #FF7A5C;     /* corail : boutons d'action */
  --menthe: #5FD9B0;     /* garder, sur fond sombre */
  --alerte: #E5243F;     /* rouge vif : réservé à la rage */
  --abysse: #081B25;
  --bleu: #4C6FA8;
  --ff-titre: 'Bodoni Moda', 'Didot', Georgia, serif;
  --ff-texte: 'Work Sans', system-ui, -apple-system, sans-serif;
  --ff-mono: 'Work Sans', system-ui, sans-serif; /* chiffres alignés : tabular-nums */
  --ff-tampon: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --ombre: 0 10px 30px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .25);
  --ombre-douce: 0 4px 14px rgba(0, 0, 0, .18);
  --rayon: 10px;
  --hud-h: clamp(46px, 12vh, 62px);
  --fs: clamp(12px, 1.8vh + 0.45vw, 16px);
  --lent: .9s;
  --tres-lent: 1.6s;
  --rage: 0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--encre); }
body { font-family: var(--ff-texte); font-size: var(--fs); color: var(--clair); -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; line-height: 1.45; font-variant-numeric: tabular-nums; }
button { font: inherit; cursor: pointer; color: inherit; background: none; border: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.mono { font-family: var(--ff-mono); font-weight: 600; }

#app {
  position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 0%, var(--ardoise) 0%, var(--encre) 55%, var(--abysse) 100%);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#stage { position: relative; flex: 1; min-height: 0; z-index: 1; }

/* Teinte selon le moment de la journée, vignette de rage, grain papier */
#teinte, #vignette, #grain { position: absolute; inset: 0; pointer-events: none; }
#teinte { z-index: 20; mix-blend-mode: multiply; transition: background-color 2.4s ease; background-color: transparent; }
#app[data-phase="aprem"] #teinte { background-color: rgba(255, 214, 160, .10); }
#app[data-phase="soir"] #teinte { background-color: rgba(255, 140, 80, .22); }
#app[data-phase="nuit"] #teinte { background-color: rgba(30, 50, 140, .50); }
#app[data-phase="conseil"] #teinte { background-color: transparent; }
/* La rage se ressent : un voile hachuré rouge gagne les bords de l'écran à chaque reculade. */
#vignette { z-index: 21; opacity: var(--rage); transition: opacity 2s;
  background: repeating-linear-gradient(-45deg, rgba(200, 16, 46, .5) 0 2px, transparent 2px 10px);
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 58%, #000 100%); mask-image: radial-gradient(ellipse at center, transparent 58%, #000 100%); }
#vignette.bat { animation: battement 1.1s ease-in-out infinite; }
@keyframes battement { 0%, 100% { filter: brightness(1); } 15% { filter: brightness(1.6); } 30% { filter: brightness(1.1); } 45% { filter: brightness(1.4); } }
#grain { z-index: 22; opacity: .06; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ===== Boutons ===== */
.btn {
  border-radius: 999px; padding: .62em 1.5em; font-weight: 800; letter-spacing: .02em; font-size: .95em;
  transition: transform .15s, background-color .2s, box-shadow .2s; box-shadow: var(--ombre-douce); white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn-primaire { background: var(--action); color: var(--encre); }
.btn-primaire:hover { filter: brightness(1.08); }
.btn-rouge { background: var(--action); color: var(--encre); font-family: var(--ff-tampon); font-weight: 400; letter-spacing: .08em; font-size: 1.15em; padding: .5em 1.6em; }
.btn-rouge:hover { filter: brightness(1.08); }
.btn-choix { flex: 1 1 0; max-width: 22em; min-width: 0; white-space: normal; line-height: 1.2; background: transparent; color: inherit;
  border: 1.5px solid currentColor; box-shadow: none; }
.btn-choix:hover { background: rgba(255,255,255,.08); }
#tel-choix { justify-content: center; flex-wrap: nowrap; }
.bilan-choix { display: flex; flex-wrap: wrap; justify-content: center; gap: .3em .9em; margin: 0; font-weight: 700; font-size: .85em; width: 100%; }
.bilan-neutre { opacity: .7; font-weight: 400; }
.btn-ghost { border: 1.5px solid currentColor; box-shadow: none; }
/* Antichambre : transiger = bouton au trait craie ; ¡AFUERA! reste l'action en corail. */
#btn-transiger { background: transparent; color: var(--clair); border: 2px solid var(--clair); box-shadow: none; }
.btn-rond { width: 2.2em; height: 2.2em; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); color: var(--clair); font-size: 1em; }
.rangee { display: flex; gap: .9em; flex-wrap: wrap; align-items: center; }
.surtitre { font-size: .72em; letter-spacing: .22em; text-transform: uppercase; color: var(--or); font-weight: 700; }
.note { font-size: .75em; color: var(--clair-doux); }

/* ===== HUD ===== */
#hud {
  position: relative; z-index: 5; height: var(--hud-h); display: flex; align-items: center; gap: 2.2vw; padding: 0 max(2.4vw, env(safe-area-inset-right)) 0 max(2.4vw, env(safe-area-inset-left));
  background: rgba(8, 27, 37, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(156, 207, 221, .35);
}
.hud-label { display: block; font-size: .62em; letter-spacing: .18em; text-transform: uppercase; color: var(--clair-doux); font-weight: 700; }
.hud-temps { display: grid; grid-template-columns: auto auto; column-gap: .6em; align-items: baseline; line-height: 1.05; }
.hud-temps .hud-label { grid-column: 1 / 3; }
.hud-semaine b { font-family: var(--ff-titre); font-size: 1.7em; font-weight: 900; color: #fff; }
.hud-semaine small { font-size: .78em; color: var(--clair-doux); margin-left: .25em; }
.hud-mois { font-size: .72em; color: var(--or); font-weight: 700; white-space: nowrap; }
.hud-deficit { flex: 0 1 30vw; min-width: 0; margin-right: auto; }
.hud-ligne { display: flex; justify-content: space-between; align-items: baseline; gap: .6em; }
.hud-ligne b { font-size: 1.05em; color: #fff; }
.barre { position: relative; height: 7px; border-radius: 7px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: .3em; }
.barre i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--rouge), var(--rouge-vif)); transition: width var(--tres-lent) cubic-bezier(.2,.8,.2,1); }
.barre-cible { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--or); box-shadow: 0 0 0 1px rgba(0,0,0,.5); transition: left var(--tres-lent); }
.hud-deficit .barre { overflow: visible; }
.hud-deficit .barre i { border-radius: 7px; }
[data-aide] { cursor: help; }
[data-aide] .hud-label::after { content: ' ⓘ'; color: var(--or); letter-spacing: 0; }
.hud-aide { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: min(560px, 92vw); z-index: 45;
  background: var(--papier); color: var(--texte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: .8em 1.1em; font-size: .85em; line-height: 1.5; animation: entree .4s; }
.hud-aide b { color: var(--rouge); }
.barre-fine { height: 5px; width: 7em; }
.barre-fine i { background: var(--or); }
.hud-indic { display: flex; flex-direction: column; gap: .1em; min-width: 6.5em; }
.hud-valeur { font-size: .78em; font-weight: 700; color: #fff; }
.hud-valeur em { font-style: normal; display: inline-block; transition: transform .6s; }
.hud-btns { display: flex; gap: .5em; }
.hud-indic.pulse { animation: pulse 1s; }
@keyframes pulse { 30% { transform: scale(1.08); filter: brightness(1.5); } }

/* ===== Écrans ===== */
.screen { position: absolute; inset: 0; display: none; padding: 3vh max(3.2vw, env(safe-area-inset-right)) 3vh max(3.2vw, env(safe-area-inset-left)); overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.screen.active { display: flex; animation: entree var(--lent) cubic-bezier(.2,.8,.2,1); }
#screen-noir { background: var(--encre); }
/* Écrans avec décor fourni (JPG) : l'image en fond, assombrie pour garder le texte lisible */
.screen.fond-ok { background: linear-gradient(rgba(8,27,37,.62), rgba(8,27,37,.78)), var(--fond) center / cover no-repeat; }
.tw-reste { visibility: hidden; }
@keyframes entree { from { opacity: 0; transform: translateY(14px); } }

/* Accueil */
.accueil { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 4vw; padding: 0 3vw; }
.accueil-texte { max-width: 56%; display: flex; flex-direction: column; gap: 1.6vh; }
.logo { font-family: var(--ff-tampon); font-weight: 400; font-size: clamp(54px, 21vh, 140px); line-height: .9; color: var(--papier); letter-spacing: .02em; }
.logo::after { content: ''; display: block; width: 32%; height: 6px; background: var(--action); margin-top: 1.4vh; }
.tagline { font-family: var(--ff-titre); font-size: 1.25em; color: var(--clair); font-weight: 500; }
.accueil-visuel { flex: 1; display: grid; place-items: center; }
.accueil-visuel img { width: min(40vw, 75vh); transform: rotate(-14deg); filter: drop-shadow(0 20px 30px rgba(0,0,0,.5)); animation: flotte 5s ease-in-out infinite; }
@keyframes flotte { 50% { transform: rotate(-11deg) translateY(-8px); } }

/* Duo portrait + contenu */
.duo { display: flex; gap: 3.5vw; width: 100%; align-items: center; }
.duo-gauche { flex: 0 0 26%; display: flex; flex-direction: column; align-items: center; gap: 2vh; }
.duo-droite { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2vh; max-height: 100%; overflow-y: auto; padding-right: .4em; }
.portrait {
  width: min(100%, 36vh); aspect-ratio: 1; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 40% 30%, var(--ardoise-2), var(--encre)); border: 4px solid var(--papier); box-shadow: 0 0 0 3px var(--encre), 0 0 0 5px var(--action), var(--ombre);
  font-family: var(--ff-titre); font-size: clamp(28px, 9vh, 60px); font-weight: 700; color: var(--or);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait.agite { animation: agite .35s ease-in-out infinite; }
@keyframes agite { 25% { transform: translateX(-2px) rotate(-1deg); } 75% { transform: translateX(2px) rotate(1deg); } }
.plaque { text-align: center; }
/* Changement de chargé de plaidoyer : sortie, pièce vide, entrée */
#screen-plaidoyer .duo { transition: opacity .5s; }
#screen-plaidoyer .duo.sortie { opacity: 0; }
#screen-plaidoyer .duo.arrivee .duo-gauche { animation: entre-g 1s cubic-bezier(.2,.8,.2,1); }
#screen-plaidoyer .duo.arrivee .duo-droite { animation: entree 1s .5s both; }
.plaque b { display: block; font-family: var(--ff-titre); font-size: 1.15em; color: #fff; }
.plaque small { font-size: .75em; color: var(--clair-doux); }
.bulle { background: var(--papier); color: var(--texte); border-radius: var(--rayon); padding: 1.1em 1.3em; box-shadow: var(--ombre); line-height: 1.55; }
.bulle p + p { margin-top: .7em; }
/* Mise en garde du cabinet : bulle qui arrive par la droite */
.bulle-conseil { align-self: flex-end; max-width: 88%; position: relative; border-left: 5px solid var(--rouge); background: #F7F9F5;
  animation: depuis-droite .55s cubic-bezier(.2,.9,.3,1.15) both; font-size: .92em; }
.bulle-conseil[hidden] { display: none; }
.bulle-conseil-nom { display: block; font-size: .7em; letter-spacing: .16em; text-transform: uppercase; color: var(--rouge); font-weight: 800; margin-bottom: .3em; }
.bulle-conseil p { color: var(--rouge); font-weight: 700; }
@keyframes depuis-droite { from { transform: translateX(70vw); opacity: 0; } }
.bulle-plaid p:first-child { font-family: var(--ff-titre); font-size: 1.12em; font-style: italic; min-height: 3em; }
.plaid-menace { font-weight: 700; font-style: italic; }
/* Menace du chargé : bulle à part, sous son plaidoyer */
.bulle-menace { align-self: flex-start; max-width: 88%; border-left: 5px solid var(--encre); font-size: .92em; animation: entree .5s both; }
.bulle-menace[hidden] { display: none; }
.regles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1vw; }
.regle { border-top: 2px solid var(--or); padding-top: .5em; font-size: .8em; color: var(--clair-doux); }
.regle b { display: block; font-family: var(--ff-titre); color: #fff; font-size: 1.2em; margin-bottom: .15em; }

/* ===== Matin ===== */
.matin { display: flex; gap: 2.6vw; width: 100%; }
.pile { flex: 0 0 52%; display: flex; flex-direction: column; gap: 1vh; min-width: 0; }
.pile-entete { display: flex; justify-content: space-between; align-items: center; font-size: .72em; letter-spacing: .14em; text-transform: uppercase; color: var(--or); font-weight: 700; }
.pile-progress { display: flex; gap: 5px; }
.pile-progress span { width: 18px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.18); transition: background .4s; }
.pile-progress span.f-garder { background: var(--clair-doux); }
.pile-progress span.f-afuera { background: var(--rouge-vif); }
.pile-progress span.courant { background: var(--action); }
.carte-zone { position: relative; flex: 1; min-height: 0; }
.carte {
  position: absolute; inset: 0; background: var(--papier); color: var(--texte); border-radius: var(--rayon); box-shadow: var(--ombre);
  padding: 2.4vh 1.6vw; display: flex; flex-direction: column; gap: .7vh; touch-action: pan-y; cursor: grab; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  transition: transform .6s cubic-bezier(.2,.8,.2,1), opacity .6s; will-change: transform;
  background-image: linear-gradient(transparent 0 calc(100% - 1px), rgba(0,0,0,.04) 0); background-size: 100% 1.6em;
  animation: arrive .7s cubic-bezier(.2,.8,.2,1);
}
.carte::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--rouge); }
@keyframes arrive { from { transform: translateY(30px) rotate(1.5deg); opacity: 0; } }
.carte.drag { transition: none; cursor: grabbing; }
.carte.sort-g { transform: translateX(-120%) rotate(-12deg) !important; opacity: 0; transition: transform .8s ease-in, opacity .8s; }
.carte.sort-d { transform: translateX(120%) rotate(12deg) !important; opacity: 0; transition: transform .8s ease-in, opacity .8s; }
.carte-entete { display: flex; justify-content: space-between; gap: 1em; font-size: .64em; letter-spacing: .12em; text-transform: uppercase; color: var(--texte-doux); font-weight: 700; }
.carte-nom { font-family: var(--ff-titre); font-weight: 700; font-size: clamp(16px, 4.2vh, 26px); line-height: 1.12; color: var(--encre); display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex-shrink: 0; }
.carte-chiffres { display: flex; align-items: baseline; gap: .7em; flex-wrap: wrap; border-bottom: 1px solid var(--papier-trait); padding-bottom: .6vh; }
.carte-montant { font-family: var(--ff-mono); font-weight: 700; font-size: clamp(22px, 7vh, 40px); color: var(--rouge); line-height: 1; }
.carte-meta { font-size: .76em; color: var(--texte-doux); }
.carte-meta b { color: var(--texte); }
.carte-programme { font-size: .72em; color: var(--texte-doux); }
.carte-programme b { color: var(--texte); font-weight: 700; }
.carte-desc { flex: none; font-size: 1.02em; line-height: 1.55; margin-top: 1vh; padding-top: 1.2vh; border-top: 2px solid var(--papier-trait); color: var(--encre); }
.carte-note { font-size: .78em; background: var(--papier-2); border-left: 3px solid var(--or); padding: .45em .7em; margin-top: .4em; }
.carte-bas { display: flex; flex-wrap: wrap; gap: .45em; align-items: center; font-size: .68em; }
.badge { border-radius: 4px; padding: .15em .55em; font-weight: 700; letter-spacing: .04em; border: 1px solid var(--papier-trait); color: var(--texte-doux); }
.sens-eleve { color: #A0522D; border-color: #D9A27A; }
.sens-critique { color: #fff; background: var(--rouge); border-color: var(--rouge); }
.badge-piege { background: var(--encre); color: var(--or); border-color: var(--encre); }
.carte-domaines { font-size: 1.2em; letter-spacing: .15em; margin-left: auto; filter: grayscale(.4); }
.carte .indic { pointer-events: none; position: absolute; top: 40%; font-family: var(--ff-tampon); font-size: 2.6em; padding: 0 .3em; border: 4px solid; border-radius: 6px; opacity: 0; letter-spacing: .05em; }
.indic-g { left: 8%; color: var(--texte-doux); transform: rotate(-10deg); }
.indic-d { right: 8%; color: var(--rouge); transform: rotate(10deg); }
.btn-partage { font: 700 .74rem var(--ff-texte); letter-spacing: .03em; color: var(--papier); background: var(--encre); border: 0; border-radius: 999px;
  padding: .45em .9em; min-height: 32px; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.25); white-space: nowrap; }
.btn-partage:active, .btn-partage.appuye { transform: scale(.92); filter: brightness(.9); }
.btn-partage.occupe { opacity: .6; pointer-events: none; }
.carte .btn-partage { flex-shrink: 0; position: relative; z-index: 1; }
.chrono { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--rouge); transform-origin: left; }
.arguments { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1.4vh; overflow-y: auto; overscroll-behavior: contain; }
.argument { flex: none; border-radius: var(--rayon); padding: .9em 1.1em; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); }
.argument h4 { font-size: .66em; letter-spacing: .2em; text-transform: uppercase; margin-bottom: .4em; }
.argument p { font-family: var(--ff-titre); font-style: italic; font-size: .98em; line-height: 1.45; }
.argument-charge h4 { color: var(--rouge-vif); }
.argument-defense h4 { color: var(--menthe); }
.choix-matin { display: flex; gap: 1em; justify-content: center; margin-top: auto; position: sticky; bottom: 0; padding-top: 1vh; background: var(--encre); }
.choix-matin + .aide { flex: none; }
.aide { text-align: center; font-size: .66em; color: var(--clair-doux); letter-spacing: .05em; }

/* Tampon */
.tampon { position: absolute; top: 42%; left: 50%; font-family: var(--ff-tampon); font-size: clamp(40px, 12vh, 80px); padding: .05em .35em; letter-spacing: .04em;
  border: 6px double; border-radius: 8px; transform: translate(-50%,-50%) rotate(-12deg) scale(2.4); opacity: 0; animation: tamponne .45s cubic-bezier(.3,1.5,.5,1) forwards; pointer-events: none; mix-blend-mode: multiply; }
.tampon.t-afuera { color: var(--rouge); }
.tampon.t-garder { color: #4A5568; }
@keyframes tamponne { to { transform: translate(-50%,-50%) rotate(-12deg) scale(1); opacity: .9; } }

/* Plaidoyer */
.plaid-fiche { display: flex; justify-content: space-between; align-items: center; gap: 1em; border-bottom: 1px solid rgba(255,255,255,.15); padding-bottom: .6em; }
.plaid-fiche small { font-size: .66em; letter-spacing: .16em; text-transform: uppercase; color: var(--or); }
.plaid-fiche b { display: block; font-family: var(--ff-titre); font-size: 1.1em; color: #fff; }
.plaid-fiche .mono { font-size: 1.6em; color: var(--rouge-vif); font-weight: 700; }
#plaid-choix { opacity: 0; transition: opacity .8s; pointer-events: none; }
#plaid-choix.visible { opacity: 1; pointer-events: auto; }

/* ===== Scène du soir ===== */
#screen-scene { padding: 0; flex-direction: column; }
.scene-root { position: absolute; inset: 0; }
.scene { position: absolute; inset: 0; overflow: hidden; container-type: size; background: #07080F; }
/* Décor 16:9 (format des images) contenu entier dans la fenêtre, centré (bandes sombres si besoin) : ses éléments, en cqw/cqh, suivent l'image à toute taille d'écran */
.decor { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: min(100cqw, 177.78cqh); aspect-ratio: 16 / 9; container-type: size; }
.scene-titre { position: absolute; top: 3vh; left: 50%; transform: translateX(-50%); z-index: 6; font-family: var(--ff-titre); font-weight: 700; font-size: clamp(18px, 5.2vh, 34px);
  color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.6); white-space: nowrap; animation: titre-scene 1.4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes titre-scene { from { opacity: 0; letter-spacing: .3em; } }
.acteurs { position: absolute; left: 0; right: 0; bottom: 18vh; height: 62vh; z-index: 3; display: flex; justify-content: space-around; align-items: flex-end; padding: 0 8vw; }
.acteur { height: 100%; display: flex; align-items: flex-end; animation: entre-g 1.6s cubic-bezier(.25,.8,.3,1) both; }
.acteur-1 { animation-name: entre-d; animation-delay: .5s; }
@keyframes entre-g { from { transform: translateX(-60vw); } }
@keyframes entre-d { from { transform: translateX(60vw); } }

/* Personnages en pied : image fixe, qui marche à l'entrée, s'avance quand il parle, et se déplace latéralement */
.figurine { height: calc(100% * var(--t, 1)); aspect-ratio: 2 / 3; filter: drop-shadow(0 10px 12px rgba(0,0,0,.35));
  transition: transform .7s cubic-bezier(.3,1.3,.5,1); animation: pas .32s ease-in-out 5 alternate, balance 4s 1.6s ease-in-out infinite; animation-delay: 0s, var(--delai); }
.acteur-1 .figurine { animation-delay: .5s, var(--delai); }
.figurine svg { width: 100%; height: 100%; overflow: visible; }
.figurine.cote-g.parle { transform: translateX(5vw); }
.figurine.cote-d.parle { transform: translateX(-5vw); }
.figurine.parle { animation: pas .3s ease-in-out 2 alternate, sautille .9s .6s ease-in-out infinite; }
.f-eclairs { opacity: 0; }
@keyframes pas { to { translate: 0 -2.4vh; } }
@keyframes balance { 50% { translate: 1.2vw 0; } }
@keyframes sautille { 50% { translate: 0 -1vh; } }
/* Émotions : teinte du personnage, éclairs pour la colère, épaules basses pour la tristesse */
/* Traits du visage posés sur les images (style « South Park », version encrée) */
.t-clos { display: none; }
.cligne .t-ouvert { display: none; } .cligne .t-clos { display: inline; }
.t-sourcil { transition: transform .25s; transform-box: fill-box; transform-origin: center; }
.t-bouche > g { display: none; }
.figurine[data-bouche="repos"] .b-repos, .figurine[data-bouche="a"] .b-a, .figurine[data-bouche="o"] .b-o,
.figurine[data-bouche="e"] .b-e, .figurine[data-bouche="m"] .b-m { display: inline; }
.emo-colere[data-bouche="repos"] .b-repos, .emo-triste[data-bouche="repos"] .b-repos { display: none; }
.emo-colere[data-bouche="repos"] .b-colere, .emo-triste[data-bouche="repos"] .b-triste { display: inline; }
.emo-colere.parle[data-bouche="a"] .b-a { display: none; } .emo-colere.parle[data-bouche="a"] .b-cri { display: inline; }
.emo-colere .t-sourcil { transform: translateY(6px) rotate(22deg); }
.emo-triste .t-sourcil { transform: translateY(-4px) rotate(-18deg); }
.parle .t-sourcil { animation: sourcils .6s ease-in-out infinite alternate; }
@keyframes sourcils { to { translate: 0 -3px; } }
.emo-colere .f-corps { filter: url(#teinte-rouge); }
.emo-triste .f-corps { filter: url(#teinte-bleue); }
.emo-colere .f-eclairs { opacity: 1; }
.emo-colere .eclair { animation: eclair .5s steps(2) infinite; } .emo-colere .eclair.e2 { animation-delay: .25s; }
.emo-colere svg { animation: colere .1s 6; }
.emo-triste svg { transform-origin: 50% 100%; animation: abattu 1.2s ease-in-out forwards; }
@keyframes eclair { 50% { opacity: 0; } }
@keyframes colere { 25% { transform: translateX(-1.2vw); } 75% { transform: translateX(1.2vw); } }
@keyframes abattu { to { transform: scaleY(.95) rotate(-1.5deg); } }

/* Décors : image fournie (JPG) ou placeholder CSS (.ph, masqué dès que l'image est là) */
.decor { background-size: cover; background-position: center; }
.decor.avec-image { background-color: #111; background-size: cover; background-position: center; background-repeat: no-repeat; }
/* Bandes laissées par le format 16:9 : remplies par le même décor, flouté et assombri. */
.scene.avec-fond::before { content: ''; position: absolute; inset: -40px; background: var(--fond) center / cover no-repeat; filter: blur(18px) brightness(.55); }
.decor.avec-image .ph { display: none; }
.decor.avec-image .fenetre-bureau { border-color: transparent; background: none; }
.decor-campagne { background: linear-gradient(#9CC3E6 0 52%, #7FA650 52%); }
.champs { position: absolute; left: 0; right: 0; top: 52%; height: 20cqh; background: repeating-linear-gradient(100deg, #6E9443 0 4cqw, #87AD55 4cqw 8cqw); }
.route { position: absolute; left: 0; right: 0; bottom: 18cqh; height: 10cqh; background: #4A4A4A; border-top: 4px solid #DDD; }
.decor-maison { background: linear-gradient(#6D4C41 0 70%, #3E2723 70%); }
.fenetre-nuit { position: absolute; left: 8%; top: 10%; width: 18cqw; height: 30cqh; background: #0B1030; border: 8px solid #D7CCC8; }
.lune { position: absolute; right: 18%; top: 16%; width: 5cqh; height: 5cqh; border-radius: 50%; box-shadow: -1.2cqh .6cqh 0 0 #FFF3B0; }
.lampe { position: absolute; left: 46%; top: 0; width: 10cqw; height: 11cqh; background: #E8C46A; border-radius: 50% 50% 0 0 / 100% 100% 0 0; box-shadow: 0 25cqh 90px 30px rgba(232,196,106,.28); }
.cadre-photo { position: absolute; right: 12%; top: 14%; width: 9cqw; height: 15cqh; background: #546E7A; border: 6px solid #A1887F; transform: rotate(2deg); }
.table { position: absolute; left: 20%; right: 20%; bottom: 21cqh; height: 9cqh; background: #5D2A22; border-radius: 6px; z-index: 4; box-shadow: 0 -2px 0 #7B3A2E inset; }
.assiette { position: absolute; left: 20%; top: -1.6cqh; width: 8cqw; height: 2.4cqh; border-radius: 50%; background: #F5F5F5; }
.assiette.a2 { left: 64%; } .verre { position: absolute; left: 47%; top: -5cqh; width: 2cqw; height: 5cqh; background: rgba(255,255,255,.4); border-radius: 0 0 6px 6px; }
.decor-tele { background: radial-gradient(circle at 50% 30%, #23408E, #0B163F); }
.studio-logo { position: absolute; left: 4%; top: 7%; font-family: var(--ff-tampon); font-size: 5.5cqh; color: #fff; background: var(--rouge); padding: 0 .35em; letter-spacing: .05em; }
.studio-logo b { color: var(--or); margin-left: .15em; font-weight: 400; }
.studio-ecran { position: absolute; right: 6%; top: 10%; width: 24cqw; height: 28cqh; background: repeating-linear-gradient(0deg, #1b1f2e 0 3px, #262b3d 3px 6px); border: 2px solid #3a4160; }
.bandeau { position: absolute; left: 0; right: 0; bottom: 23cqh; height: 6cqh; background: #F3EDE2; color: var(--encre); display: flex; align-items: center; overflow: hidden; z-index: 2; font-weight: 700; font-size: .9em; }
.bandeau-tag { background: var(--rouge); color: #fff; height: 100%; display: flex; align-items: center; padding: 0 1em; font-family: var(--ff-tampon); letter-spacing: .06em; flex-shrink: 0; z-index: 1; }
.bandeau-defile { white-space: nowrap; animation: defile 22s linear infinite; padding-left: 100%; }
@keyframes defile { to { transform: translateX(-100%); } }
.tv-cadre { position: absolute; inset: 0; border: 2vh solid #090A12; border-radius: 18px; box-shadow: inset 0 0 80px rgba(0,0,0,.7); pointer-events: none; z-index: 4; }
.decor-bureau { background: linear-gradient(#3F5B55 0 72%, #2E211B 72%); }
.fenetre-bureau { position: absolute; left: 34%; top: 6%; width: 30cqw; height: 40cqh; border: 10px solid #C8C2B6; background: linear-gradient(#5F7FA8, #9FB8D6); }
.fissure { position: absolute; inset: 0; opacity: 0; background:
  linear-gradient(35deg, transparent 48%, #111 49%, transparent 51%), linear-gradient(-60deg, transparent 48%, #111 49%, transparent 51%), linear-gradient(100deg, transparent 49%, #111 50%, transparent 51%); }
.drapeau { position: absolute; left: 8%; top: 12%; display: flex; width: 9cqw; height: 14cqh; animation: hoche 3s infinite; transform-origin: left; }
.drapeau i { flex: 1; } .drapeau i:nth-child(1) { background: #002654; } .drapeau i:nth-child(2) { background: #F3EDE2; } .drapeau i:nth-child(3) { background: #CE1126; }
.bureau-meuble { position: absolute; left: 15%; right: 15%; bottom: 21cqh; height: 12cqh; background: #4E342E; border-radius: 6px; z-index: 2; }
.tasse { position: absolute; left: 16%; top: -4cqh; width: 3cqw; height: 4cqh; background: #F5F5F5; border-radius: 0 0 8px 8px; }
.pile-dossiers { position: absolute; right: 12%; top: -9cqh; width: 9cqw; height: 9cqh; background: repeating-linear-gradient(#F3EDE2 0 8px, #CDBFA8 8px 10px); }
.pave { position: absolute; width: 5cqh; height: 4cqh; background: #6B6B6B; border-radius: 6px; left: 48%; top: 20%; opacity: 0; z-index: 3; }
.fx-pierre .pave { animation: pave 1.4s ease-in forwards; }
.fx-pierre .fissure { animation: apparait .1s .5s forwards; }
@keyframes pave { 0% { opacity: 1; transform: scale(.2); } 35% { transform: scale(1.2) rotate(200deg); } 100% { opacity: 1; transform: translate(-14cqw, 46cqh) rotate(520deg) scale(1); } }
@keyframes apparait { to { opacity: 1; } }
.decor-rue { background: linear-gradient(#7E93B5 0 60%, #55565E 60%); }
.bercy { position: absolute; left: 5%; right: 5%; top: 14%; height: 36cqh; background: repeating-linear-gradient(90deg, #B9AFA6 0 5cqw, #A0958B 5cqw 5.6cqw); }
.foule { position: absolute; left: 0; right: 0; bottom: 26cqh; display: flex; justify-content: space-between; padding: 0 2cqw; z-index: 1; }
.manif { width: 7cqw; height: 18cqh; background: hsl(calc(var(--i) * 40), 25%, 38%); border-radius: 50% 50% 8px 8px; position: relative; animation: saute .9s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.17s); }
.manif em { position: absolute; top: -8cqh; left: 50%; transform: translateX(-50%); background: #F3EDE2; color: var(--encre); font-style: normal; font-family: var(--ff-tampon); font-size: .7em; padding: .2em .35em; white-space: nowrap; letter-spacing: .04em; }
@keyframes saute { to { transform: translateY(-1.6cqh); } }
.tracteur { display: none; position: absolute; bottom: 20cqh; right: -40cqw; width: 26cqw; height: 20cqh; z-index: 2;
  background: radial-gradient(circle at 25% 80%, #111 0 18%, transparent 19%), radial-gradient(circle at 80% 85%, #111 0 12%, transparent 13%), linear-gradient(#2E7D32, #1B5E20); border-radius: 16px 50px 10px 10px; }
.avec-tracteur .tracteur { display: block; animation: roule 3.5s ease-out forwards; }
@keyframes roule { to { right: 4cqw; } }
.dialogue { position: absolute; left: 4vw; right: 4vw; bottom: 2.5vh; min-height: 17vh; background: rgba(8, 27, 37, .92); border: 1px solid rgba(156,207,221,.5); border-radius: var(--rayon);
  padding: 1.2em 1.4em .9em; z-index: 7; box-shadow: var(--ombre); }
.dialogue-nom { position: absolute; top: -.85em; left: 1.2em; background: var(--action); color: var(--encre); border-radius: 4px; padding: .05em .6em; font-size: .74em; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.dialogue-nom:empty { display: none; }
.dialogue-texte { white-space: pre-line; font-family: var(--ff-titre); font-size: 1.08em; line-height: 1.45; min-height: 2.9em; color: #fff; }
.dialogue.narr .dialogue-texte { font-style: italic; color: var(--clair-doux); }
.dialogue-choix { display: flex; gap: .8em; justify-content: center; margin-top: .7em; }
.dialogue-choix .btn { font-size: .85em; }
.dialogue-suite { position: absolute; right: 1.1em; bottom: .6em; color: var(--or); animation: clignote 1.2s infinite; }
@keyframes clignote { 50% { opacity: .2; } }

/* Smartphone en portrait : invitation à tourner l'écran */
#tourner { position: fixed; inset: 0; z-index: 300; background: rgba(8, 27, 37, .96); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2.2vh; padding: 8vw; text-align: center; color: var(--clair); animation: entree .5s; transition: opacity .6s; }
#tourner[hidden] { display: none; }
#tourner.sortie { opacity: 0; pointer-events: none; }
.tourner-tel { width: 64px; height: 108px; border: 4px solid var(--or); border-radius: 12px; position: relative; animation: pivote 2.2s ease-in-out infinite; }
.tourner-tel i { position: absolute; left: 50%; bottom: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--or); transform: translateX(-50%); }
@keyframes pivote { 0%, 20% { transform: rotate(0); } 55%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
.tourner-titre { font-family: var(--ff-titre); font-weight: 700; font-size: 1.5rem; color: #fff; }
.tourner-texte { font-size: 1rem; max-width: 28em; }
.tourner-astuce { font-size: .9rem; color: var(--or); max-width: 28em; }
.tourner-astuce:empty { display: none; }

/* Prologue du plateau : texte sur fond noir */
.prologue { max-width: min(760px, 88vw); margin: auto; display: flex; flex-direction: column; gap: 1.6vh; text-align: center; }
.prologue[hidden] { display: none; }
.prologue p { font-family: var(--ff-titre); font-size: 1.15em; line-height: 1.45; color: var(--clair); }
.prologue p:first-child { color: #fff; font-weight: 700; }
.prologue p:last-of-type { color: var(--or); font-weight: 700; }
.prologue .btn { align-self: center; margin-top: 1vh; }
#screen-noir { display: flex; }

/* ===== Plateau TV : l'épreuve du « moment de vérité » ===== */
.hud-sursis { display: flex; gap: .3em; padding-top: .15em; }
/* Joker : petite carte à jouer dorée, marquée d'une étoile ; grisée une fois utilisée */
.joker { width: .95em; height: 1.3em; border: 1.5px solid var(--or); border-radius: 3px; display: grid; place-items: center; font-style: normal;
  font-size: .95em; line-height: 1; color: var(--or); background: rgba(156,207,221,.12); }
.joker::before { content: '★'; font-size: .7em; }
.joker.use { border-color: rgba(255,255,255,.2); color: rgba(255,255,255,.2); background: none; }
.plateau-quiz { position: absolute; left: 2vw; right: 2vw; top: 2vh; bottom: 2vh; z-index: 8; display: flex; flex-direction: column; gap: 1vh;
  background: rgba(8, 27, 37, .9); border: 1px solid rgba(156,207,221,.5); border-radius: var(--rayon); padding: 1.2vh 1.4vw; box-shadow: var(--ombre); }
.plateau-quiz[hidden] { display: none; }
.plateau-quiz.pq-resolu { bottom: 23vh; }
.plateau-quiz.pq-resolu .pq-siren { color: var(--texte-doux); opacity: .6; font-size: .8em; font-family: var(--ff-mono); }
.pq-carte-geo { display: none; }
#screen-scene.en-quiz .dialogue { visibility: hidden; }
.pq-entete { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; }
.pq-entete b { font-family: var(--ff-titre); font-size: 1em; color: #fff; }
.pq-entete span { font-size: .74em; color: var(--or); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.pq-chrono { height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); overflow: hidden; flex-shrink: 0; }
.pq-chrono i { display: block; height: 100%; background: linear-gradient(90deg, var(--rouge-vif), var(--or)); transform-origin: left; }
.pq-cartes { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2vw; align-items: start; }
.pq-case { position: relative; min-width: 0; }
.pq-case > .pq-carte { width: 100%; }
.pq-case { padding-top: .5em; }
.pq-partage { position: absolute; top: -.1em; right: .5em; z-index: 2; font-size: .62rem; min-height: 0; padding: .3em .75em; animation: arrive .5s cubic-bezier(.2,.8,.2,1); }
.pq-carte { position: relative; text-align: left; background: var(--papier); color: var(--texte); border-radius: 8px; padding: .55em .7em .7em;
  font-size: .7em; line-height: 1.25; display: flex; flex-direction: column; gap: .4em; border: 3px solid transparent; transition: transform .2s, opacity .4s, border-color .3s; }
.pq-carte:not(:disabled):active { transform: scale(.98); }
.pq-titre { font-family: var(--ff-titre); font-size: 1.12em; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pq-montant { font-family: var(--ff-mono); font-weight: 700; font-size: 1.7em; color: var(--rouge); line-height: 1.05; }
.pq-desc { font-style: italic; color: var(--texte-doux); }
.pq-carte dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15em .5em; }
.pq-carte dt { color: var(--texte-doux); font-size: .92em; }
.pq-carte dd { font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pq-carte-geo { height: 14vh; display: flex; justify-content: center; }
.pq-carte-geo svg { height: 100%; width: auto; max-width: 100%; }
.geo path, .geo rect { fill: #C5D2D2; stroke: #C5D2D2; stroke-width: .6; }
.geo-monde path { stroke: var(--papier); stroke-width: .4; }
.geo text { font-size: 22px; fill: var(--texte-doux); font-family: var(--ff-texte); }
.geo .surbrillance, .geo .surbrillance path, .geo .surbrillance rect { fill: var(--rouge); stroke: var(--rouge); }
.geo .surbrillance text { fill: #fff; }
.geo .repere { fill: none; stroke: var(--rouge); stroke-width: 3; }
.pq-carte.est-fictive { border-color: var(--rouge); }
.pq-carte.est-vraie { opacity: .7; border-color: var(--vert); }
.pq-carte.choisie { box-shadow: 0 0 0 3px #fff; opacity: 1; }
.pq-carte[data-verdict]::after { content: attr(data-verdict); position: absolute; right: .5em; bottom: .4em; font-family: var(--ff-tampon); font-size: 1.5em; letter-spacing: .06em;
  color: var(--vert); border: 3px double; padding: 0 .3em; transform: rotate(-8deg); background: rgba(243,237,226,.9); }
.pq-carte.est-fictive::after { color: var(--rouge); }

/* ===== Rage ===== */
#screen-rage { background: radial-gradient(ellipse at 50% 120%, rgba(200,16,46,.55), transparent 70%), #08060F; }
.rage { width: 100%; display: flex; flex-direction: column; gap: 1.5vh; }
.rage-titre { font-family: var(--ff-tampon); font-weight: 400; font-size: clamp(30px, 10vh, 64px); color: var(--alerte); text-align: center; letter-spacing: .06em; text-transform: uppercase; animation: tremble .12s infinite; }
@keyframes tremble { 25% { transform: translate(1px, -1px); } 75% { transform: translate(-1px, 1px); } }
.rage-sous { text-align: center; color: var(--clair-doux); font-size: .9em; }
.rage-grille { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 1vh 1vw; align-content: start; }
.rage-item { position: relative; overflow: hidden; text-align: left; background: var(--papier); color: var(--texte); border-radius: 8px; padding: .55em .8em; font-size: .78em; transition: transform .3s, background .3s; border-left: 4px solid transparent; }
.rage-item b { display: block; font-family: var(--ff-mono); font-size: 1.4em; color: var(--rouge); }
.rage-item small { color: var(--texte-doux); }
.rage-item.choisi { background: #D9D2C5; border-left-color: #000; transform: scale(1.03) rotate(-.6deg); box-shadow: 0 0 0 2px #000; }
.rage-item.choisi::before { content: ''; position: absolute; left: -4%; right: -4%; top: 48%; height: .35em; background: #000; transform: rotate(-4deg); }
.rage-item.choisi::after { content: attr(data-barre); position: absolute; top: .9em; right: -1.2em; width: 8em; transform: rotate(22deg); background: #000; color: #fff;
  font-family: var(--ff-tampon); letter-spacing: .12em; text-align: center; font-size: .78em; padding: .1em 0; box-shadow: 0 2px 6px rgba(0,0,0,.5); animation: bandeau-noir .25s cubic-bezier(.3,1.6,.5,1); }
.rage-item.choisi b { color: #000; text-decoration: line-through 3px; }
@keyframes bandeau-noir { from { transform: rotate(22deg) scale(2.2); opacity: 0; } }
.rage-item.coupe { animation: decoupe 1s forwards; }
@keyframes decoupe { 40% { clip-path: polygon(0 0, 100% 0, 100% 45%, 0 55%); } 100% { clip-path: polygon(0 0, 100% 0, 100% 45%, 0 55%); transform: translateY(60vh) rotate(20deg); opacity: 0; } }
.rage-bas { display: flex; justify-content: space-between; align-items: center; color: var(--clair); font-size: 1.1em; }

/* Tronçonneuse */
#tronconneuse { position: fixed; inset: 0; z-index: 50; pointer-events: none; display: none; place-items: center; background: #08060F; }
.rage { transition: opacity 1.2s; }
.rage.voile { opacity: 0; }
#tronconneuse.active { display: grid; }
#tronconneuse img { width: min(88vw, 125vh); animation: tronco-entree 3.4s cubic-bezier(.2,.9,.3,1) forwards; filter: drop-shadow(0 20px 30px rgba(0,0,0,.6)); }
#tronconneuse.active img { animation: tronco-entree 3.4s cubic-bezier(.2,.9,.3,1) forwards, vrombit .05s 1s infinite; }
@keyframes tronco-entree { 0% { transform: translateX(-120vw) rotate(-14deg); } 30% { transform: translateX(0) rotate(3deg); } 80% { transform: translateX(0) rotate(-3deg) scale(1.08); } 100% { transform: translateX(130vw) rotate(8deg); } }
@keyframes vrombit { 50% { translate: 2px -2px; } }
.tronco-texte { position: absolute; bottom: 8vh; font-family: var(--ff-tampon); font-size: 16vh; color: var(--papier); letter-spacing: .04em; text-shadow: 0 6px 0 var(--rouge), 0 12px 30px rgba(0,0,0,.6); animation: tamponne-t .6s 1.3s both; }
@keyframes tamponne-t { from { transform: scale(2.4) rotate(-6deg); opacity: 0; } to { transform: rotate(-6deg); opacity: 1; } }

/* ===== Phase transversale ===== */
#screen-transversal { background: linear-gradient(160deg, var(--ardoise), var(--abysse)); }
.transv { width: 100%; display: flex; flex-direction: column; gap: 2vh; }
.transv-entete { text-align: center; }
.transv-entete small { font-size: .7em; letter-spacing: .22em; text-transform: uppercase; color: var(--or); font-weight: 700; }
.transv-entete h2 { font-family: var(--ff-titre); font-weight: 900; font-size: clamp(26px, 8vh, 50px); color: #fff; }
.transv-corps { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.slide { background: var(--papier); color: var(--texte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 1.6em 2.2em; max-width: 760px; text-align: center; animation: entree 1s; }
.slide-chiffre { font-family: var(--ff-mono); font-weight: 700; font-size: clamp(36px, 14vh, 90px); color: var(--rouge); line-height: 1; }
.slide p { margin: 1em 0 1.3em; line-height: 1.55; }
.options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2vw; width: 100%; }
.option { background: var(--papier); color: var(--texte); border-radius: var(--rayon); padding: .9em; text-align: left; display: flex; flex-direction: column; gap: .4em; font-size: .82em; transition: transform .3s, box-shadow .3s; box-shadow: var(--ombre-douce); }
.option:hover { transform: translateY(-4px); box-shadow: var(--ombre); }
.option b { font-family: var(--ff-titre); font-size: 1.25em; line-height: 1.15; }
.option .eco { font-family: var(--ff-mono); font-weight: 700; font-size: 1.35em; color: var(--rouge); margin-top: auto; }
.transv-source { text-align: center; font-size: .68em; color: var(--clair-doux); }

/* ===== Bilan de la semaine ===== */
#screen-recap { justify-content: center; align-items: flex-start; }
.recap { margin: auto 0; width: min(720px, 100%); display: flex; flex-direction: column; gap: 1.4vh; align-items: center; text-align: center; }
.recap h2 { font-family: var(--ff-titre); font-size: clamp(24px, 7vh, 42px); font-weight: 900; }
.recap-liste { width: 100%; display: flex; flex-direction: column; gap: .35em; }
.recap-ligne { display: flex; justify-content: space-between; gap: 1em; font-size: .85em; padding: .35em .2em; border-bottom: 1px solid rgba(255,255,255,.08); opacity: 0; animation: ligne .7s forwards; text-align: left; }
.recap-ligne .mono { color: var(--rouge-vif); white-space: nowrap; }
.recap-ligne.epargnee { color: var(--clair-doux); }
.recap-ligne.epargnee .mono { color: var(--clair-doux); }
@keyframes ligne { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; } }
.recap-total { font-family: var(--ff-mono); font-size: 1.5em; color: var(--or); min-height: 1.5em; }
.recap-rumeur { font-family: var(--ff-titre); font-style: italic; color: var(--clair-doux); min-height: 1.5em; }

/* ===== Conseil ===== */
#screen-conseil { background: radial-gradient(ellipse at 30% 0%, rgba(156,207,221,.15), transparent 60%); }
.conseil-bilan { background: var(--papier); color: var(--texte); border-radius: var(--rayon); padding: .9em 1.2em; display: grid; grid-template-columns: 1fr auto; gap: .45em 1.2em; box-shadow: var(--ombre); font-size: .9em; }
.conseil-bilan > span { opacity: 0; transition: opacity .8s, transform .8s; transform: translateY(6px); }
.conseil-bilan > span.vu { opacity: 1; transform: none; }
.conseil-bilan .val { font-family: var(--ff-mono); font-weight: 700; text-align: right; }
.plus { color: var(--vert); } .moins { color: var(--rouge); }
.bulle-verdict { font-family: var(--ff-titre); font-style: italic; font-size: 1.08em; min-height: 3.2em; }
.bulle-verdict:empty { visibility: hidden; }
.domaines, .conseil-domaines { display: grid; grid-template-columns: 1fr 1fr; gap: .5em 1.6em; }
.dom { display: grid; grid-template-columns: 1.5em 6em 1fr 2.6em; align-items: center; gap: .5em; font-size: .8em; }
.dom .barre { margin: 0; }
.dom .barre i { background: var(--vert); }
.dom.moyen .barre i { background: #C98A2E; }
.dom.bas .barre i { background: var(--rouge-vif); }
.dom .mono { text-align: right; }
#btn-conseil-ok { align-self: flex-start; opacity: 0; transition: opacity 1s; pointer-events: none; }
#btn-conseil-ok.visible { opacity: 1; pointer-events: auto; }

/* ===== Fin ===== */
#screen-fin, #screen-bilan { align-items: flex-start; }
#screen-fin .fin, #screen-bilan .bilan { margin: auto; } /* centré, mais défilant si l'écran est trop petit */
.fin { max-width: 860px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 2.4vh; align-items: center; }
.fin h2 { font-family: var(--ff-tampon); font-weight: 400; font-size: clamp(28px, min(12vh, 7vw), 76px); letter-spacing: .04em; text-transform: uppercase; color: var(--papier); line-height: 1.1; padding: .1em .3em; max-width: 100%; overflow-wrap: break-word; animation: tamponne-t 1s both; }
.fin-texte { font-family: var(--ff-titre); font-size: 1.05em; color: var(--clair); max-width: 680px; }
.fin-style { border: 1px solid var(--or); color: var(--or); border-radius: 999px; padding: .35em 1.2em; font-size: .85em; }
.fin-style b { font-family: var(--ff-titre); font-size: 1.15em; margin-right: .5em; }
.bilan { display: flex; flex-direction: column; gap: 2vh; align-items: center; width: min(620px, 100%); padding-bottom: 2vh; }
.bilan-table { width: 100%; border-collapse: collapse; background: var(--papier); color: var(--texte); border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); font-size: .85em; }
.bilan-table th, .bilan-table td { padding: .32em 1em; border-bottom: 1px solid rgba(0,0,0,.08); text-align: left; }
.bilan-table td { text-align: right; font-family: var(--ff-mono); font-weight: 700; }
.bilan-table tr.trophee th, .bilan-table tr.trophee td { background: var(--encre); color: var(--or); font-family: var(--ff-titre); font-size: 1.1em; }

/* ===== Modales, toasts ===== */
.modale { position: fixed; inset: 0; z-index: 40; background: rgba(6, 7, 16, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 3vh 4vw; animation: entree .6s; }
.modale-boite { position: relative; background: var(--papier); color: var(--texte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 1.3em 1.6em; width: min(760px, 100%); max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 1em; }
.modale-boite h3 { font-family: var(--ff-titre); font-size: 1.45em; }
.pays-sous { margin-top: -.4em; padding-top: .55em; border-top: 2px solid var(--papier-trait); font-size: .8em; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--texte-doux); }
.modale-boite h3 small { font-family: var(--ff-texte); font-size: .5em; color: var(--texte-doux); font-weight: 400; }
.modale-boite .note { color: var(--texte-doux); }
.modale-boite .btn-ghost { color: var(--texte); }
.modale-fermer { position: absolute; top: .6em; right: .8em; font-size: 1.1em; color: var(--texte-doux); }
.tel { width: min(560px, 100%); text-align: center; align-items: center; }
.tel-img { width: 90px; animation: sonne .15s infinite; }
.tel.decroche .tel-img { animation: none; }
@keyframes sonne { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.tel #tel-texte { white-space: pre-line; font-family: var(--ff-titre); font-style: italic; font-size: 1.05em; }
#toasts { position: fixed; top: calc(var(--hud-h) + 1.6vh); left: 50%; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; gap: .4em; align-items: center; pointer-events: none; }
.toast { background: rgba(8,27,37,.94); color: #fff; border: 1px solid rgba(156,207,221,.5); border-radius: 6px; padding: .4em 1em; font-weight: 700; font-size: .85em; animation: toast 4s forwards; white-space: nowrap; }
.toast.bon { border-color: var(--vert); } .toast.mauvais { border-color: var(--rouge-vif); }
.toast.revelation { white-space: normal; max-width: 70vw; text-align: center; font-family: var(--ff-titre); font-weight: 500; font-style: italic; border-color: var(--or); animation-duration: 6.5s; }
@keyframes toast { 0% { transform: translateY(-14px); opacity: 0; } 8%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }
#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.particule { position: absolute; font-size: 22px; animation: eclate 2s cubic-bezier(.2,.8,.4,1) forwards; }
@keyframes eclate { to { transform: translate(var(--dx), calc(var(--dy) + 60vh)) rotate(var(--rot)); opacity: 0; } }

/* Secousses */
.shake-faible { animation: shake .4s; } .shake-moyenne { animation: shake .55s 2; } .shake-forte { animation: shake-fort .6s 3; }
@keyframes shake { 20% { transform: translate(-3px, 2px); } 40% { transform: translate(3px, -2px); } 60% { transform: translate(-2px, -1px); } 80% { transform: translate(2px, 2px); } }
@keyframes shake-fort { 10% { transform: translate(-10px, 5px) rotate(-.6deg); } 30% { transform: translate(10px, -5px) rotate(.6deg); } 50% { transform: translate(-8px, -3px); } 70% { transform: translate(6px, 5px); } 90% { transform: translate(-3px, 2px); } }

/* Rideau : balayage en biais (V2). Un pan bleu de Prusse bordé d'un filet corail traverse l'écran,
   le titre monte mot par mot, puis le pan repart dans le même sens (fx.js : rideau()).
   Variantes : .clair (Conseil des ministres : pan craie, texte Prusse), .rage (filet rouge qui bat),
   .moyen (moments de la journée : titre plus petit). */
#rideau { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; display: grid; place-items: center; }
#rideau.ferme { pointer-events: auto; }
.rideau-pan { position: absolute; top: -40px; bottom: -40px; left: calc(-30vh - 40px); right: calc(-30vh - 40px);
  background: var(--encre); border-left: 3px solid var(--action); border-right: 3px solid var(--action);
  transform: translateX(-130%) skewX(-14deg); transition: transform .8s cubic-bezier(.76,0,.24,1); }
#rideau.ferme .rideau-pan { transform: translateX(0) skewX(-14deg); }
#rideau.sort .rideau-pan { transform: translateX(130%) skewX(-14deg); }
#rideau.instant .rideau-pan, #rideau.instant .r-mot > span, #rideau.instant .rideau-anim, #rideau.instant .frise i, #rideau.instant .frise-jour i { transition: none !important; }
.rideau-contenu { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.4vh; padding: 0 6vw; }
.rideau-sur { font-size: .74em; letter-spacing: .3em; text-transform: uppercase; color: var(--or); font-weight: 600; min-height: 1em; }
.rideau-titre { font-family: var(--ff-titre); font-weight: 800; font-size: clamp(34px, 13vh, 88px); color: var(--clair); line-height: 1.08; display: flex; flex-wrap: wrap; justify-content: center; column-gap: .25em; }
#rideau.moyen .rideau-titre { font-size: clamp(30px, 10vh, 64px); }
.r-mot { display: block; overflow: hidden; padding-bottom: .04em; }
.r-mot > span { display: block; transform: translateY(105%); transition: transform .7s cubic-bezier(.2,.8,.2,1) calc(.5s + var(--i, 0) * .12s); }
#rideau.ferme .r-mot > span { transform: translateY(0); }
#rideau.sort .r-mot > span { transform: translateY(-105%); transition: transform .45s cubic-bezier(.6,0,.8,.4); }
.rideau-anim { opacity: 0; transform: translateY(5px); transition: opacity .6s ease .85s, transform .6s ease .85s; }
#rideau.ferme .rideau-anim { opacity: 1; transform: none; }
#rideau.sort .rideau-anim { opacity: 0; transition: opacity .3s ease; }
.rideau-sous { font-family: var(--ff-titre); font-style: italic; font-weight: 500; color: var(--clair); font-size: 1.15em; max-width: 640px; }
#rideau.clair .rideau-pan { background: var(--papier); }
#rideau.clair .rideau-titre, #rideau.clair .rideau-sous { color: var(--encre); }
#rideau.clair .rideau-sur { color: var(--texte-doux); }
#rideau.rage .rideau-pan { background: var(--abysse); border-color: var(--alerte); }
#rideau.rage.ferme .rideau-pan { animation: rideau-bat .9s ease-out .8s 1; }
@keyframes rideau-bat { 0%, 100% { box-shadow: none; } 15%, 55% { box-shadow: 0 0 22px 4px rgba(229,36,63,.7); } 35% { box-shadow: none; } }
/* Frise des 24 semaines : traits fins ; Conseil (toutes les 4 semaines) plus hauts ; la semaine en cours se remplit. */
.frise { display: flex; gap: 5px; justify-content: center; align-items: flex-end; height: 24px; margin-top: 1vh; }
.frise i { display: block; width: 3px; height: 12px; background: var(--ardoise-2); }
.frise i.conseil { height: 20px; }
.frise i.passe { background: var(--or); }
.frise i.actuel { width: 5px; height: 16px; background: var(--action); transform-origin: bottom; transform: scaleY(.25); opacity: .4;
  transition: transform .5s cubic-bezier(.2,.8,.2,1) 1.15s, opacity .5s ease 1.15s; }
.frise i.conseil.actuel { width: 6px; height: 24px; }
#rideau.ferme .frise i.actuel { transform: none; opacity: 1; }
#rideau.clair .frise i { background: var(--papier-trait); }
#rideau.clair .frise i.passe { background: #7FA3AE; }
#rideau.clair .frise i.mois { background: var(--encre); }
#rideau.clair .frise i.actuel { background: var(--action); }
/* Frise de la journée : matin, après-midi, soir, nuit. */
.frise-jour { display: flex; gap: 18px; justify-content: center; align-items: center; font-size: .78em; color: #7FA3AE; margin-top: 1vh; }
.frise-jour span { display: flex; align-items: center; gap: 6px; }
.frise-jour i { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--ardoise-2); }
.frise-jour .passe i { background: var(--or); }
.frise-jour .actuel { color: var(--clair); }
.frise-jour .actuel i { background: var(--action); transform: scale(.4); transition: transform .5s cubic-bezier(.3,1.6,.5,1) 1.1s; }
#rideau.ferme .frise-jour .actuel i { transform: none; }
#rideau.rage .frise-jour .actuel i { background: var(--alerte); }
@media (prefers-reduced-motion: reduce) {
  #rideau { opacity: 0; transition: opacity .3s ease; }
  #rideau.ferme { opacity: 1; } #rideau.sort { opacity: 0; }
  .rideau-pan, #rideau.ferme .rideau-pan, #rideau.sort .rideau-pan { transform: skewX(-14deg); transition: none; animation: none !important; }
  .r-mot > span, .rideau-anim, .frise i.actuel, .frise-jour .actuel i { transform: none !important; opacity: 1 !important; transition: none !important; }
}

/* Téléphone paysage (écrans bas) */
@media (max-height: 430px) {
  #hud { gap: 1.6vw; }
  .hud-label { letter-spacing: .08em; white-space: nowrap; }
  .hud-semaine { white-space: nowrap; }
  .hud-ligne b { white-space: nowrap; }
  .regles { font-size: .66em; }
  .bulle { padding: .7em 1em; }
  .argument { padding: .55em .8em; }
  .argument p { font-size: .9em; }
  .option { padding: .55em; font-size: .72em; }
  .hud-indic { min-width: 5.5em; }
  .barre-fine { width: 5em; }
  .carte-desc { font-size: .95em; }
}
/* Petits téléphones en paysage (iPhone SE, 667 × 375) : le HUD se resserre */
@media (max-height: 430px) and (max-width: 720px) {
  .hud-mois { display: none; }
  .hud-indic { min-width: 0; }
  .hud-label { font-size: .56em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Accueil : avertissement et crédits */
.rangee-info { margin-top: .4em; }
.btn-petit { font-size: .8em; padding: .45em 1em; }
.modale-texte { gap: .6em; font-size: .92em; line-height: 1.45; }
.modale-texte h4 { font-family: var(--ff-titre); margin-top: .5em; }
.modale-texte a { color: inherit; text-decoration: underline; }

/* Plaidoyer : les annonces (gaspillage trouvé, rage…) arrivent par le bas, à l'écart des bulles. */
#app[data-phase="aprem"] #toasts, #app[data-phase="aprem"] ~ #toasts { top: auto; bottom: 3vh; flex-direction: column-reverse; }
#app[data-phase="aprem"] .toast, #app[data-phase="aprem"] ~ #toasts .toast { animation-name: toast-bas; }
@keyframes toast-bas { 0% { transform: translateY(24px); opacity: 0; } 8%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }

/* Décor pas encore téléchargé (ou hors ligne) : fond sombre uni, sans les dessins provisoires. */
.decor:not(.avec-image) { background: var(--encre); }
.decor:not(.avec-image) .ph { display: none; }
