/* ============================================================
   Charte « rebours » · Compte à rebours (piste 5 d'Arnaud) · créée en v2.35
   Salle de crise sombre, une couleur par phase du récit :
     avant l'attaque  #3D9BFF   (épisodes 1 à 5)
     la nuit          #FF4141   (questions et suspense, jour J, épisodes 6 et 7)
     la reprise       #1FD68E   (épisodes 8 et 9, bilan, conclusion)
   La phase est posée par le journal sur <html data-phase="…"> selon le chapitre affiché.
   Photos provisoires (basse définition) dans assets/chartes/rebours/ : avant.jpg, nuit.jpg, reprise.jpg.
   Pour les remplacer : mêmes noms, format 16/9 (1920 x 1080 conseillé).
   Tout est préfixé par html[data-charte=rebours].
   ============================================================ */
@import url("https://cdn.jsdelivr.net/npm/@fontsource-variable/archivo@5/wdth.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/inter@5/latin-400.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/inter@5/latin-700.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/jetbrains-mono@5/latin-700.css");

html[data-charte=rebours]{
  --ph:#3D9BFF; --ph-soft:rgba(61,155,255,.18); --ph-photo:url(/assets/chartes/rebours/avant.jpg);
  --rb-bg:#0F131A; --rb-surface:#141922; --rb-raise:#1B212C; --rb-ink:#EEF1F6; --rb-soft:#B7BFCC; --rb-muted:#7D8696; --rb-line:#2A303B; --rb-warn:#FF8A3D;
  --rb-display:"Archivo Variable","Archivo","Arial Black",system-ui,sans-serif;
  --rb-body:"Inter",system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
  --rb-mono:"JetBrains Mono",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  --navy:#0F131A; --navy-2:#1B2A44; --green:var(--ph); --green-ink:#0F131A;
}
html[data-charte=rebours][data-phase=nuit]{--ph:#FF4141;--ph-soft:rgba(255,65,65,.18);--ph-photo:url(/assets/chartes/rebours/nuit.jpg)}
html[data-charte=rebours][data-phase=reprise]{--ph:#1FD68E;--ph-soft:rgba(31,214,142,.18);--ph-photo:url(/assets/chartes/rebours/reprise.jpg)}
html[data-charte=rebours] body{font-family:var(--rb-body)}
html[data-charte=rebours] h1,html[data-charte=rebours] h2,html[data-charte=rebours] .stline b,html[data-charte=rebours] .icard .ih .title,html[data-charte=rebours] .qtext{font-family:var(--rb-display);font-stretch:112%}
html[data-charte=rebours] .clk,html[data-charte=rebours] .ver,html[data-charte=rebours] .kora,html[data-charte=rebours] .timer .sec,html[data-charte=rebours] .opt .pct,html[data-charte=rebours] .icard .ih .kind,html[data-charte=rebours] .tag{font-family:var(--rb-mono)}

/* ---------- commun : barre du haut, boutons ---------- */
html[data-charte=rebours] .top,html[data-charte=rebours] header.site{background:var(--rb-bg);box-shadow:inset 0 -3px 0 var(--ph);transition:box-shadow .6s}
html[data-charte=rebours] .brand .mark{background:var(--ph);color:var(--rb-bg)}
html[data-charte=rebours] .btn.go{background:var(--ph);border-color:var(--ph);color:var(--rb-bg)}
html[data-charte=rebours] .chip.live{background:var(--ph);color:var(--rb-bg)}
html[data-charte=rebours] .intro,html[data-charte=rebours] .hero-card,html[data-charte=rebours] .hero{background:radial-gradient(700px 320px at 100% 0%,var(--ph-soft),transparent 62%),var(--rb-bg)}
html[data-charte=rebours] .kick{color:var(--ph);font-family:var(--rb-mono);letter-spacing:2px}
html[data-charte=rebours] .cta{background:var(--ph);color:var(--rb-bg) !important}
html[data-charte=rebours] footer.site{background:var(--rb-bg);color:var(--rb-soft);border-top:3px solid var(--ph)}
html[data-charte=rebours] footer.site a{color:var(--ph)}
html[data-charte=rebours] .steps .n{background:var(--ph);color:var(--rb-bg)}

/* ---------- journal : écrans de session (régie, écran animateur, participants) en salle de crise ---------- */
html[data-charte=rebours] body.stage-mode{background:var(--rb-bg);color:var(--rb-ink)}
html[data-charte=rebours] body.stage-mode .note,html[data-charte=rebours] body.stage-mode .stbar .msg{color:#9AA3B5}
html[data-charte=rebours] .stline{color:var(--rb-ink)}
html[data-charte=rebours] .stline .kora{background:var(--ph);color:var(--rb-bg);border-radius:0}
html[data-charte=rebours] .stline .n{color:var(--rb-muted)}
html[data-charte=rebours] body.stage-mode .btn.ghost{background:transparent;color:var(--rb-ink);border-color:var(--rb-line)}
html[data-charte=rebours] body.stage-mode .btn.ghost:hover{background:var(--rb-raise)}
html[data-charte=rebours] body.stage-mode .btn.ghost[aria-pressed="true"]{border-color:var(--ph);color:var(--ph)}
html[data-charte=rebours] body.stage-mode .btn.warn{background:transparent;color:#FF8A8A;border-color:#FF4141}
html[data-charte=rebours] .pcol{background:var(--rb-surface);border-color:var(--rb-line);color:var(--rb-ink)}
html[data-charte=rebours] .pcol h2{color:var(--rb-muted)}
html[data-charte=rebours] .ptime{color:var(--rb-ink)}
html[data-charte=rebours] body.stage-mode select{background:var(--rb-bg);color:var(--rb-ink);border-color:var(--rb-line)}
html[data-charte=rebours] .stp{background:var(--rb-raise);color:var(--rb-ink)}
html[data-charte=rebours] .stp.cur,html[data-charte=rebours] .stp.cur.clk:hover{background:var(--ph);color:var(--rb-bg)}
html[data-charte=rebours] .stp.run{background:var(--ph-soft);box-shadow:inset 0 0 0 2px var(--ph)}
html[data-charte=rebours] .stp.clk:hover{background:#242B37}
html[data-charte=rebours] .pitem{background:var(--rb-surface);border-color:var(--rb-line)}
html[data-charte=rebours] body.stage-mode .icard{background:var(--rb-surface);border-color:var(--ph);border-radius:0}
html[data-charte=rebours] body.stage-mode .icard .ih{background:var(--rb-bg);border-bottom:1px solid var(--rb-line)}
html[data-charte=rebours] body.stage-mode .icard .ih .kind{color:var(--ph)}
html[data-charte=rebours] body.stage-mode .icard.locked .ih{background:var(--rb-raise);color:var(--rb-soft)}
html[data-charte=rebours] body.stage-mode .qtext,html[data-charte=rebours] body.stage-mode .recap .rq h3,html[data-charte=rebours] body.stage-mode .counter{color:var(--rb-ink)}
html[data-charte=rebours] body.stage-mode .qnum,html[data-charte=rebours] body.stage-mode .status-line{color:var(--rb-soft)}
html[data-charte=rebours] body.stage-mode .recap .rq{border-top-color:var(--rb-line)}
html[data-charte=rebours] body.stage-mode .opt{background:var(--rb-bg);border-color:var(--rb-line);color:var(--rb-ink);border-radius:0}
html[data-charte=rebours] body.stage-mode .opt:hover:not([disabled]){border-color:var(--ph)}
html[data-charte=rebours] body.stage-mode .opt .letter{background:var(--rb-line);color:var(--rb-ink);border-radius:0;font-family:var(--rb-mono)}
html[data-charte=rebours] body.stage-mode .opt .fill{background:repeating-linear-gradient(90deg,var(--ph-soft) 0 10px,transparent 10px 13px),var(--ph-soft)}
html[data-charte=rebours] body.stage-mode .opt.mine{border-color:var(--ph);box-shadow:inset 0 0 0 1px var(--ph)}
html[data-charte=rebours] body.stage-mode .opt.correct{border-color:#1FD68E;background:var(--rb-bg)}
html[data-charte=rebours] body.stage-mode .opt.correct .fill{background:repeating-linear-gradient(90deg,rgba(31,214,142,.34) 0 10px,transparent 10px 13px),rgba(31,214,142,.18)}
html[data-charte=rebours] body.stage-mode .opt.correct .letter,html[data-charte=rebours] body.stage-mode .badge-c{background:#1FD68E;color:var(--rb-bg)}
html[data-charte=rebours] body.stage-mode .opt.wrong .fill{background:rgba(255,65,65,.24)}
html[data-charte=rebours] body.stage-mode .badge-m{background:var(--ph);color:var(--rb-bg)}
html[data-charte=rebours] body.stage-mode .timer .track{background:var(--rb-line);border-radius:0}
html[data-charte=rebours] body.stage-mode .timer .track i{background:var(--ph);border-radius:0}
html[data-charte=rebours] body.stage-mode .timer .sec{color:var(--ph)}
html[data-charte=rebours] body.stage-mode .explain{background:var(--rb-raise);border-left-color:var(--ph);color:var(--rb-ink)}
html[data-charte=rebours] body.stage-mode .pctrl{background:var(--rb-bg);border-top-color:var(--rb-line)}
html[data-charte=rebours] body.stage-mode .pctrl .lab{color:var(--rb-ink)}
html[data-charte=rebours] body.stage-mode .gain.ok{background:rgba(31,214,142,.15);color:#1FD68E}
html[data-charte=rebours] body.stage-mode .gain.ko{background:rgba(255,65,65,.15);color:#FF8A8A}
html[data-charte=rebours] body.stage-mode .score-pill{background:var(--ph);color:var(--rb-bg);font-family:var(--rb-mono)}
html[data-charte=rebours] body.stage-mode .banner.end{background:var(--rb-surface);border:1px solid var(--ph)}
/* les bonnes réponses restent vertes */
html[data-charte=rebours] .dist i.ok{background:#1FD68E}

/* ---------- écran d'attente : photo, horloge de 24 h ---------- */
html[data-charte=rebours] .waitscr{position:relative;isolation:isolate;justify-content:flex-start}
html[data-charte=rebours] .waitscr::before{content:"";position:absolute;inset:0;z-index:-2;background:var(--ph-photo) center/cover no-repeat;filter:saturate(.9) brightness(.7) contrast(1.06)}
html[data-charte=rebours] .waitscr::after{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,rgba(15,19,26,.94) 0%,rgba(15,19,26,.78) 45%,rgba(15,19,26,.2) 85%),linear-gradient(0deg,rgba(15,19,26,.85) 0%,rgba(15,19,26,0) 40%)}
html[data-charte=rebours] .waitscr .note{color:var(--rb-soft)}
html[data-charte=rebours] .waitscr h1{color:var(--rb-ink);font-weight:800}
html[data-charte=rebours] .waitscr .url{color:var(--ph);font-family:var(--rb-mono)}
html[data-charte=rebours] .waitscr .big{color:var(--rb-soft)}
html[data-charte=rebours] .waitscr .qr{margin-left:auto;border-radius:0}
.wclock{display:none}
html[data-charte=rebours] .wclock{display:block;margin:0 0 10px}
html[data-charte=rebours] .wclock small{display:block;color:var(--ph);font:700 clamp(11px,1.1vw,16px)/1 var(--rb-mono);letter-spacing:.16em;text-transform:uppercase;margin-bottom:8px}
html[data-charte=rebours] .wclock b{display:block;color:var(--rb-ink);font:700 clamp(48px,8vw,132px)/1 var(--rb-mono);letter-spacing:-.04em;font-variant-numeric:tabular-nums}
html[data-charte=rebours] .wbar{display:flex;gap:4px;margin-top:14px}
html[data-charte=rebours] .wbar i{flex:1;height:6px;background:var(--rb-line)}
html[data-charte=rebours] .wbar i.on{background:var(--ph);box-shadow:0 0 12px var(--ph)}
.wbar{display:none}

/* ---------- ouverture d'épisode (écran animateur, 6 s au changement de chapitre) ---------- */
html[data-charte=rebours] .epopen{position:relative;isolation:isolate;flex:1;min-height:0;display:flex;flex-direction:column;justify-content:flex-end;padding:5vh 5vw;overflow:hidden;animation:rb-in .5s ease}
html[data-charte=rebours] .epopen::before{content:"";position:absolute;inset:0;z-index:-3;background:var(--ph-photo) center/cover no-repeat;filter:saturate(.9) brightness(.7) contrast(1.06)}
html[data-charte=rebours] .epopen .tint{position:absolute;inset:0;z-index:-2;background:var(--ph);mix-blend-mode:color;opacity:.16}
html[data-charte=rebours] .epopen::after{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,rgba(15,19,26,.94) 0%,rgba(15,19,26,.72) 38%,rgba(15,19,26,.12) 75%),linear-gradient(0deg,rgba(15,19,26,.85) 0%,rgba(15,19,26,0) 38%)}
html[data-charte=rebours] .epopen .epn{position:absolute;top:4vh;left:5vw;color:var(--rb-soft);font:700 clamp(12px,1.2vw,18px)/1 var(--rb-mono);letter-spacing:.14em;text-transform:uppercase}
html[data-charte=rebours] .epopen .when{color:var(--ph);font:700 clamp(16px,1.8vw,28px)/1 var(--rb-mono);letter-spacing:.06em}
html[data-charte=rebours] .epopen h1{margin:10px 0 0;color:var(--rb-ink);font:800 clamp(36px,6vw,96px)/1.02 var(--rb-display);font-stretch:118%;max-width:60%}
html[data-charte=rebours] .epopen .wbar{display:flex;margin-top:3vh;max-width:60%}
@keyframes rb-in{from{opacity:0}to{opacity:1}}

/* ---------- rappel QR pendant les quiz (écran animateur) ---------- */
.qrmini{position:absolute;right:16px;bottom:14px;display:flex;align-items:center;gap:10px;background:#fff;color:#0F131A;padding:8px 10px;border-radius:8px;box-shadow:0 4px 18px #0004;font-size:13px;line-height:1.3;z-index:5}
.qrmini .qr{line-height:0}
.qrmini .qr svg{width:84px;height:84px;display:block}
html[data-charte=rebours] .qrmini{border-radius:0;box-shadow:0 0 0 2px var(--ph),0 4px 18px #0006}

@media (prefers-reduced-motion:reduce){html[data-charte=rebours] .epopen{animation:none}}

/* ---------- v2.37 : tout le journal en « salle de crise » (accueil, profils, régie, participants, fenêtres) ----------
   Généré à partir des styles du journal : les fonds blancs passent en surface sombre, les titres bleu nuit en clair.
   Ne concerne que l'écran ; l'impression garde le fond blanc. */
@media screen{
html[data-charte=rebours] body:has(#app){background:var(--rb-bg);color:var(--rb-ink)}
html[data-charte=rebours] #app{--ink:#EEF1F6;--muted:#9AA3B5;--line:#2A303B;--bg:#0F131A;--soft:#1B212C;--paper:#141922;--red:#FF6B6B;--amber:#FFB020;--hd:#EEF1F6;--alert-bg:rgba(255,65,65,.14);color:var(--ink)}
html[data-charte=rebours] :where(#app) .chip.final,
html[data-charte=rebours] :where(#app) .chip.plan,
html[data-charte=rebours] :where(#app) .score-pill,
html[data-charte=rebours] :where(#app) .btn.ghost,
html[data-charte=rebours] :where(#app) .btn.warn,
html[data-charte=rebours] :where(#app) .field input,
html[data-charte=rebours] :where(#app) .field select,
html[data-charte=rebours] :where(#app) .hero-img,
html[data-charte=rebours] :where(#app) .scard,
html[data-charte=rebours] :where(#app) .empty,
html[data-charte=rebours] :where(#app) .panel,
html[data-charte=rebours] :where(#app) .rail,
html[data-charte=rebours] :where(#app) .tag.done,
html[data-charte=rebours] :where(#app) .entry,
html[data-charte=rebours] :where(#app) .viewer .ctl,
html[data-charte=rebours] :where(#app) .tl,
html[data-charte=rebours] :where(#app) .tl-seg,
html[data-charte=rebours] :where(#app) .vcard,
html[data-charte=rebours] :where(#app) .icard,
html[data-charte=rebours] :where(#app) .opt,
html[data-charte=rebours] :where(#app) .opt.correct,
html[data-charte=rebours] :where(#app) .timer .track,
html[data-charte=rebours] :where(#app) .pctrl select,
html[data-charte=rebours] :where(#app) .mapslot .mapmsg,
html[data-charte=rebours] :where(#app) .dock,
html[data-charte=rebours] :where(#app) .gallery button,
html[data-charte=rebours] :where(#app) .mtabs,
html[data-charte=rebours] :where(#app) .skpis div,
html[data-charte=rebours] :where(#app) .stbl,
html[data-charte=rebours] :where(#app) .parts .pt:has(input:checked),
html[data-charte=rebours] :where(#app) .game,
html[data-charte=rebours] :where(#app) .xbox,
html[data-charte=rebours] :where(#app) .doc,
html[data-charte=rebours] :where(#app) .podium,
html[data-charte=rebours] :where(#app) .pcol,
html[data-charte=rebours] :where(#app) .pcol select,
html[data-charte=rebours] :where(#app) .pitem,
html[data-charte=rebours] :where(#app) .modlist li,
html[data-charte=rebours] :where(#app) .banned{background:var(--rb-surface)}
html[data-charte=rebours] :where(#app) .brand .mark,
html[data-charte=rebours] :where(#app) .chip.final,
html[data-charte=rebours] :where(#app) .chip.plan,
html[data-charte=rebours] :where(#app) .score-pill,
html[data-charte=rebours] :where(#app) .btn.ghost,
html[data-charte=rebours] :where(#app) .field label,
html[data-charte=rebours] :where(#app) h2.sec,
html[data-charte=rebours] :where(#app) .scard .name,
html[data-charte=rebours] :where(#app) .profile .panel h2,
html[data-charte=rebours] :where(#app) .ses-head .name,
html[data-charte=rebours] :where(#app) .tag,
html[data-charte=rebours] :where(#app) .entry h1,
html[data-charte=rebours] :where(#app) .tl-head b,
html[data-charte=rebours] :where(#app) .tl-st,
html[data-charte=rebours] :where(#app) .vids h2,
html[data-charte=rebours] :where(#app) .vcard figcaption,
html[data-charte=rebours] :where(#app) .qtext,
html[data-charte=rebours] :where(#app) .timer .sec,
html[data-charte=rebours] :where(#app) .recap .rq h3,
html[data-charte=rebours] :where(#app) .pctrl .lab,
html[data-charte=rebours] :where(#app) .counter,
html[data-charte=rebours] :where(#app) .geo-kpis b,
html[data-charte=rebours] :where(#app) .lb caption,
html[data-charte=rebours] :where(#app) .dock h2,
html[data-charte=rebours] :where(#app) .sumch h3,
html[data-charte=rebours] :where(#app) .mtabs button[aria-selected="true"],
html[data-charte=rebours] :where(#app) .skpis b,
html[data-charte=rebours] :where(#app) .stbl th,
html[data-charte=rebours] :where(#app) .adm-head h1,
html[data-charte=rebours] :where(#app) .adm-h2,
html[data-charte=rebours] :where(#app) .parts legend,
html[data-charte=rebours] :where(#app) .adm-main .name,
html[data-charte=rebours] :where(#app) .rolehints summary,
html[data-charte=rebours] :where(#app) .game h2,
html[data-charte=rebours] :where(#app) .gauge b,
html[data-charte=rebours] :where(#app) .ending h3,
html[data-charte=rebours] :where(#app) .xbox h3,
html[data-charte=rebours] :where(#app) .doc .rl .tm,
html[data-charte=rebours] :where(#app) .doc.f-chat .msg b,
html[data-charte=rebours] :where(#app) .diagq legend,
html[data-charte=rebours] :where(#app) .dscore .big,
html[data-charte=rebours] :where(#app) .podium h3,
html[data-charte=rebours] :where(#app) .pod b,
html[data-charte=rebours] :where(#app) .pod .pts,
html[data-charte=rebours] :where(#app) .stline,
html[data-charte=rebours] :where(#app) .waitscr h1,
html[data-charte=rebours] :where(#app) .waitscr .url{color:var(--rb-ink)}
html[data-charte=rebours] :where(#app) .field input,
html[data-charte=rebours] :where(#app) .field select,
html[data-charte=rebours] :where(#app) .empty,
html[data-charte=rebours] :where(#app) .icard.locked,
html[data-charte=rebours] :where(#app) .opt,
html[data-charte=rebours] :where(#app) .pctrl select,
html[data-charte=rebours] :where(#app) .pcol select{border-color:var(--rb-line)}
html[data-charte=rebours] :where(#app) a{color:var(--ph)}
html[data-charte=rebours] :where(#app) .entry .log{color:var(--ph)}
html[data-charte=rebours] :where(#app) .btn.ghost{color:var(--rb-ink);border-color:var(--rb-line)}
html[data-charte=rebours] :where(#app) .btn.ghost:hover{background:var(--rb-raise)}
html[data-charte=rebours] :where(#app) .btn.warn{background:transparent;color:#FF8A8A;border-color:#FF4141}
html[data-charte=rebours] :where(#app) .scard:hover,html[data-charte=rebours] :where(#app) .opt:hover:not([disabled]){border-color:var(--ph)}
html[data-charte=rebours] :where(#app) .opt.mine{border-color:var(--ph);box-shadow:inset 0 0 0 1px var(--ph)}
html[data-charte=rebours] :where(#app) .mtabs button[aria-selected="true"]{color:var(--ph);border-bottom-color:var(--ph)}
html[data-charte=rebours] :where(#app) .parts .pt:has(input:checked){border-color:var(--ph);background:var(--ph-soft)}
html[data-charte=rebours] :where(#app) .field input::placeholder{color:#7D8696}
html[data-charte=rebours] :where(#app) .modal{border:1px solid var(--rb-line)}
html[data-charte=rebours] :where(#app) .modal-h,html[data-charte=rebours] :where(#app) .doc .dh,html[data-charte=rebours] :where(#app) .sumhead,html[data-charte=rebours] :where(#app) .alert{box-shadow:inset 0 -3px 0 var(--ph)}
html[data-charte=rebours] :where(#app) .slwrap .sl,html[data-charte=rebours] :where(#app) .gallery img{box-shadow:0 0 0 1px var(--rb-line)}
}

/* ---------- v2.37 : ouverture d'épisode chez les participants (plein écran, toucher pour fermer) ---------- */
.epfix{display:none}
html[data-charte=rebours] .epfix{position:fixed;inset:0;z-index:60;display:flex;flex-direction:column;background:var(--rb-bg);cursor:pointer}
@media (max-width:640px){html[data-charte=rebours] .epopen h1,html[data-charte=rebours] .epopen .wbar{max-width:100%} html[data-charte=rebours] .epopen{padding:8vh 6vw}}

/* v2.37 : pastilles d'état (vert, ambre, rouge) en teintes sur fond sombre */
@media screen{
html[data-charte=rebours] :where(#app) .follow,
html[data-charte=rebours] :where(#app) .tl-st.ok,
html[data-charte=rebours] :where(#app) .gain.ok,
html[data-charte=rebours] :where(#app) .lb tr.me td,
html[data-charte=rebours] :where(#app) .flash,
html[data-charte=rebours] :where(#app) .gchip.good,
html[data-charte=rebours] :where(#app) .gauge.good,
html[data-charte=rebours] :where(#app) .lvl.l2,
html[data-charte=rebours] :where(#app) .pod li.me b{background:rgba(31,214,142,.14);color:#7FE8B9;border-color:#7FE8B955}
html[data-charte=rebours] :where(#app) .follow :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .tl-st.ok :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .gain.ok :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .lb tr.me td :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .flash :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .gchip.good :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .gauge.good :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .lvl.l2 :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .pod li.me b :is(b,strong,small,em):not(.btn){color:inherit}
html[data-charte=rebours] :where(#app) .follow.off,
html[data-charte=rebours] :where(#app) .tl-st.pause,
html[data-charte=rebours] :where(#app) .pausebar,
html[data-charte=rebours] :where(#app) .rolehint,
html[data-charte=rebours] :where(#app) .gauge.mid,
html[data-charte=rebours] :where(#app) .lvl.l1{background:rgba(255,176,32,.14);color:#FFD27A;border-color:#FFD27A55}
html[data-charte=rebours] :where(#app) .follow.off :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .tl-st.pause :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .pausebar :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .rolehint :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .gauge.mid :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .lvl.l1 :is(b,strong,small,em):not(.btn){color:inherit}
html[data-charte=rebours] :where(#app) .tl-st.late,
html[data-charte=rebours] :where(#app) .gain.ko,
html[data-charte=rebours] :where(#app) .gchip.bad,
html[data-charte=rebours] :where(#app) .gauge.bad,
html[data-charte=rebours] :where(#app) .lvl.l0,
html[data-charte=rebours] :where(#app) .modlist li.ban{background:rgba(255,65,65,.14);color:#FF9B9B;border-color:#FF9B9B55}
html[data-charte=rebours] :where(#app) .tl-st.late :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .gain.ko :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .gchip.bad :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .gauge.bad :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .lvl.l0 :is(b,strong,small,em):not(.btn),
html[data-charte=rebours] :where(#app) .modlist li.ban :is(b,strong,small,em):not(.btn){color:inherit}
}

/* v2.46 : boutons sans variante (ni ghost, ni go, ni warn). Leur fond « navy » vaut ici la couleur du fond de page :
   ils devenaient invisibles (choix du rôle, « Valider », « Se connecter », « Enregistrer »…).
   Action principale = couleur de la phase ; choix du rôle = cartes en relief. */
@media screen{
html[data-charte=rebours] .btn:not(.ghost):not(.go):not(.warn){background:var(--ph);border-color:var(--ph);color:var(--rb-bg)}
html[data-charte=rebours] .btn:not(.ghost):not(.go):not(.warn):hover{filter:brightness(1.08)}
html[data-charte=rebours] .rolegrid .btn:not(.ghost):not(.go):not(.warn){background:var(--rb-raise);border:1px solid #3A4250;color:var(--rb-ink)}
html[data-charte=rebours] .rolegrid .btn:not(.ghost):not(.go):not(.warn):hover,html[data-charte=rebours] .rolegrid .btn:not(.ghost):not(.go):not(.warn):focus-visible{border-color:var(--ph);background:var(--ph-soft);filter:none}
}

/* v2.47 : site vitrine (accueil, événements, blog, confidentialité, 404) entièrement en charte « rebours ».
   Seules les pages qui ont header.site sont concernées (le journal live a ses propres règles plus haut).
   Le site n'a pas de récit : la couleur de phase reste le bleu « avant ». */
@media screen{
html[data-charte=rebours] body:has(> header.site){background:var(--rb-bg);color:var(--rb-ink);
  --ink:var(--rb-ink);--muted:var(--rb-soft);--line:var(--rb-line);--bg:var(--rb-bg);--soft-acc:var(--ph-soft);--green-ink:var(--ph)}
html[data-charte=rebours] body:has(> header.site) a{color:var(--ph)}
html[data-charte=rebours] body:has(> header.site) :is(h1,h2,h3){font-family:var(--rb-display);font-stretch:112%}
html[data-charte=rebours] body:has(> header.site) :is(h2,.card h3,article.post h1){color:var(--rb-ink)}
html[data-charte=rebours] body:has(> header.site) .nav .logo{color:var(--rb-ink)}
html[data-charte=rebours] body:has(> header.site) .nav .logo span,html[data-charte=rebours] body:has(> header.site) .nav nav a[aria-current="page"],html[data-charte=rebours] body:has(> header.site) .nav nav a:hover{color:var(--ph)}
html[data-charte=rebours] body:has(> header.site) .nav nav a{color:var(--rb-ink)}
html[data-charte=rebours] body:has(> header.site) .ghost{border-color:var(--rb-ink);color:var(--rb-ink)}
html[data-charte=rebours] body:has(> header.site) :is(.card,article.post){background:var(--rb-surface);border-color:var(--rb-line);color:var(--rb-ink)}
html[data-charte=rebours] body:has(> header.site) a.card:hover,html[data-charte=rebours] body:has(> header.site) .card:has(a):hover{border-color:var(--ph)}
html[data-charte=rebours] body:has(> header.site) .card p,html[data-charte=rebours] body:has(> header.site) .muted{color:var(--rb-soft)}
html[data-charte=rebours] body:has(> header.site) .tag{background:var(--ph-soft);color:var(--ph);font-family:var(--rb-mono)}
html[data-charte=rebours] body:has(> header.site) :is(.lab,.chip){background:var(--rb-raise);border-color:var(--rb-line);color:var(--rb-soft)}
html[data-charte=rebours] body:has(> header.site) .lab-fmt{border-color:var(--ph);color:var(--ph)}
html[data-charte=rebours] body:has(> header.site) :is(.lab-terrain,.lab-src){background:var(--ph-soft);color:var(--rb-ink);border-color:transparent}
html[data-charte=rebours] body:has(> header.site) .chip.on{background:var(--ph);border-color:var(--ph);color:var(--rb-bg)}
html[data-charte=rebours] body:has(> header.site) article.post :is(td,th){border-color:var(--rb-line)}
html[data-charte=rebours] body:has(> header.site) article.post th{background:var(--rb-raise)}
html[data-charte=rebours] body:has(> header.site) article.post code{background:var(--rb-raise);color:var(--rb-ink)}
html[data-charte=rebours] body:has(> header.site) article.post .takeaway{background:var(--ph-soft);border-left-color:var(--ph)}
html[data-charte=rebours] body:has(> header.site) .skip:focus{background:var(--rb-surface);color:var(--rb-ink)}
html[data-charte=rebours] body:has(> header.site) :is(a,button):focus-visible{outline-color:var(--ph)}
}

/* ============================================================
   v2.49 : touche « salle de contrôle » sur tout le site, le journal et les sessions.
   Fond quadrillé très discret qui s'efface vers le bas, lueur de la couleur de phase,
   barre du haut vitrée avec un balayage lumineux, cartes à coins de visée (HUD),
   titres de section numérotés en mono, boutons à reflet.
   Tout est désactivé à l'impression et les animations respectent prefers-reduced-motion.
   ============================================================ */
.hud{display:none}
@media screen{
html[data-charte=rebours]{--rb-grid:rgba(160,190,230,.055);--rb-glass:rgba(15,19,26,.72);scrollbar-color:#2E3644 var(--rb-bg)}
html[data-charte=rebours] ::selection{background:var(--ph);color:var(--rb-bg)}

/* fond : quadrillage + lueur de phase (site vitrine et journal, sauf écrans projetés) */
html[data-charte=rebours] body:is(:has(> header.site),:has(#app)):not(.stage-mode)::before{content:"";position:fixed;inset:0;z-index:0;pointer-events:none;
  background-image:linear-gradient(var(--rb-grid) 1px,transparent 1px),linear-gradient(90deg,var(--rb-grid) 1px,transparent 1px);background-size:56px 56px;background-position:-1px -1px;
  -webkit-mask-image:radial-gradient(ellipse 85% 70% at 50% 0%,#000 25%,transparent 78%);mask-image:radial-gradient(ellipse 85% 70% at 50% 0%,#000 25%,transparent 78%)}
html[data-charte=rebours] body:is(:has(> header.site),:has(#app)):not(.stage-mode)::after{content:"";position:fixed;z-index:0;pointer-events:none;width:70vmax;height:70vmax;right:-22vmax;top:-34vmax;border-radius:50%;
  background:radial-gradient(circle,color-mix(in srgb,var(--ph) 22%,transparent),transparent 62%);filter:blur(10px);animation:rb-drift 18s ease-in-out infinite alternate}
html[data-charte=rebours] body:has(> header.site)>:is(header,main,footer),html[data-charte=rebours] #app{position:relative;z-index:1}
html[data-charte=rebours] body:has(> header.site)>header.site{position:sticky;top:0;z-index:30}
@keyframes rb-drift{from{transform:translate3d(0,0,0) scale(1)}to{transform:translate3d(-6vmax,4vmax,0) scale(1.08)}}

/* barre du haut vitrée, filet de phase avec balayage */
html[data-charte=rebours] :is(header.site,.top){background:var(--rb-glass);-webkit-backdrop-filter:blur(14px) saturate(140%);backdrop-filter:blur(14px) saturate(140%);
  box-shadow:none;border-bottom:1px solid var(--rb-line);
  background-image:linear-gradient(90deg,transparent,var(--ph) 30%,var(--ph) 70%,transparent),linear-gradient(90deg,transparent 0 40%,rgba(255,255,255,.9) 50%,transparent 60% 100%);
  background-size:100% 2px,40% 2px;background-position:0 100%,-60% 100%;background-repeat:no-repeat;animation:rb-scan 7s linear infinite}
@keyframes rb-scan{to{background-position:0 100%,260% 100%}}
html[data-charte=rebours] body.stage-mode .top{background-color:var(--rb-bg);-webkit-backdrop-filter:none;backdrop-filter:none}
html[data-charte=rebours] :is(.nav .logo,.brand .btitle){letter-spacing:-.01em}
html[data-charte=rebours] .nav .logo span{text-shadow:0 0 18px color-mix(in srgb,var(--ph) 70%,transparent)}
html[data-charte=rebours] .brand .mark{font-family:var(--rb-mono);text-transform:uppercase;letter-spacing:1px;border-radius:3px;box-shadow:0 0 16px color-mix(in srgb,var(--ph) 55%,transparent)}
html[data-charte=rebours] .nav nav a{position:relative}
html[data-charte=rebours] .nav nav a[aria-current="page"]::after{content:"";position:absolute;left:0;right:0;bottom:-6px;height:2px;background:var(--ph);box-shadow:0 0 10px var(--ph)}

/* accroche : titre dégradé, curseur clignotant après le surtitre */
html[data-charte=rebours] body:has(> header.site) .hero{background:transparent;padding-top:76px}
html[data-charte=rebours] :is(.hero,.intro) h1{background:linear-gradient(100deg,var(--rb-ink) 30%,color-mix(in srgb,var(--ph) 70%,var(--rb-ink)) 70%,var(--ph));-webkit-background-clip:text;background-clip:text;color:transparent}
html[data-charte=rebours] .hero .kick::after,html[data-charte=rebours] body:has(> header.site) .post .kick::after{content:"";display:inline-block;width:.55em;height:1.05em;margin-left:.35em;vertical-align:-.15em;background:var(--ph);animation:rb-blink 1.1s steps(1) infinite}
@keyframes rb-blink{50%{opacity:0}}

/* panneau HUD 3-2-1-1-0 de l'accueil (décoratif) */
html[data-charte=rebours] .hero .in:has(.hud){display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:48px;align-items:center}
html[data-charte=rebours] .hero .hud{display:block;position:relative;font-family:var(--rb-mono);font-size:12px;color:var(--rb-soft);background:linear-gradient(180deg,color-mix(in srgb,var(--ph) 9%,transparent),transparent 60%),rgba(20,25,34,.7);
  border:1px solid color-mix(in srgb,var(--ph) 40%,var(--rb-line));padding:16px 18px 14px;overflow:hidden;clip-path:polygon(0 0,calc(100% - 18px) 0,100% 18px,100% 100%,18px 100%,0 calc(100% - 18px))}
html[data-charte=rebours] .hud-h{display:flex;justify-content:space-between;align-items:center;letter-spacing:2px;text-transform:uppercase;color:var(--ph);font-weight:700;margin-bottom:12px}
html[data-charte=rebours] .hud-h i{width:8px;height:8px;border-radius:50%;background:#1FD68E;box-shadow:0 0 0 4px rgba(31,214,142,.18);animation:rb-pulse 2s ease-in-out infinite}
html[data-charte=rebours] .hud ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:7px}
html[data-charte=rebours] .hud li{display:grid;grid-template-columns:30px 1fr auto;align-items:center;gap:10px}
html[data-charte=rebours] .hud li b{font-family:var(--rb-display);font-stretch:112%;font-size:22px;color:var(--rb-ink);line-height:1}
html[data-charte=rebours] .hud li em{font-style:normal;color:#1FD68E;font-size:11px;letter-spacing:1px}
html[data-charte=rebours] .hud li s{grid-column:2/4;display:block;height:3px;background:var(--rb-line);text-decoration:none;position:relative;margin-top:-3px}
html[data-charte=rebours] .hud li s::after{content:"";position:absolute;inset:0;width:var(--w,100%);background:linear-gradient(90deg,var(--ph),#1FD68E);animation:rb-fill 1.6s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--d,0s)}
html[data-charte=rebours] .hud-f{margin-top:12px;padding-top:10px;border-top:1px dashed var(--rb-line);display:flex;justify-content:space-between;letter-spacing:1px;text-transform:uppercase;font-size:11px}
html[data-charte=rebours] .hud-f b{color:#1FD68E}
html[data-charte=rebours] .hud::after{content:"";position:absolute;left:0;right:0;height:40px;top:-40px;background:linear-gradient(180deg,transparent,color-mix(in srgb,var(--ph) 14%,transparent));animation:rb-sweep 5s linear infinite}
@keyframes rb-fill{from{width:0}}
@keyframes rb-sweep{to{top:110%}}
@keyframes rb-pulse{50%{box-shadow:0 0 0 7px rgba(31,214,142,0)}}
@media (max-width:860px){html[data-charte=rebours] .hero .in:has(.hud){grid-template-columns:1fr} html[data-charte=rebours] .hero .hud{display:none}}
@media (max-width:760px){html[data-charte=rebours] :where(#app) .intro::after{display:none}}

/* titres de section numérotés : 01 / Événements */
html[data-charte=rebours] body:has(> header.site) main{counter-reset:rb-sec}
html[data-charte=rebours] body:has(> header.site) main>section>h2{counter-increment:rb-sec;display:flex;align-items:baseline;gap:14px}
html[data-charte=rebours] body:has(> header.site) main>section>h2::before{content:counter(rb-sec,decimal-leading-zero) " /";font-family:var(--rb-mono);font-size:.55em;font-weight:700;color:var(--ph);letter-spacing:1px}
html[data-charte=rebours] body:has(> header.site) main>section>h2::after{content:"";flex:1;height:1px;align-self:center;background:linear-gradient(90deg,var(--rb-line),transparent)}
html[data-charte=rebours] :where(#app) h2.sec::before{content:"//";font-family:var(--rb-mono);font-size:.8em;color:var(--ph)}

/* cartes : filet dégradé, coins de visée, relief au survol */
html[data-charte=rebours] body:has(> header.site) :is(.card,article.post),html[data-charte=rebours] :where(#app) :is(.scard,.intro .steps li){position:relative;border-radius:4px;
  background:linear-gradient(180deg,rgba(255,255,255,.025),transparent 40%),var(--rb-surface);transition:transform .25s cubic-bezier(.2,.7,.2,1),border-color .25s,box-shadow .25s}
html[data-charte=rebours] body:has(> header.site) :is(.card,article.post)::before,html[data-charte=rebours] :where(#app) .scard::before{content:"";position:absolute;inset:-1px;pointer-events:none;
  background:linear-gradient(var(--ph),var(--ph)) left top/12px 2px,linear-gradient(var(--ph),var(--ph)) left top/2px 12px,linear-gradient(var(--ph),var(--ph)) right bottom/12px 2px,linear-gradient(var(--ph),var(--ph)) right bottom/2px 12px;
  background-repeat:no-repeat;opacity:.55;transition:opacity .25s,inset .25s}
html[data-charte=rebours] body:has(> header.site) :is(a.card,.card:has(a)):hover,html[data-charte=rebours] :where(#app) .scard:hover{transform:translateY(-3px);border-color:color-mix(in srgb,var(--ph) 60%,var(--rb-line));
  box-shadow:0 12px 34px -14px color-mix(in srgb,var(--ph) 55%,transparent),0 0 0 1px color-mix(in srgb,var(--ph) 30%,transparent)}
html[data-charte=rebours] body:has(> header.site) :is(a.card,.card:has(a)):hover::before,html[data-charte=rebours] :where(#app) .scard:hover::before{opacity:1;inset:-5px}
html[data-charte=rebours] body:has(> header.site) .tag,html[data-charte=rebours] :where(#app) .scard .date{font-family:var(--rb-mono);text-transform:uppercase;letter-spacing:1.2px;font-size:11px}
html[data-charte=rebours] body:has(> header.site) .tag{border-radius:2px;align-self:flex-start;width:max-content;max-width:100%}
html[data-charte=rebours] body:has(> header.site) .tag::before{content:"";display:inline-block;width:6px;height:6px;margin-right:7px;vertical-align:1px;background:var(--ph);box-shadow:0 0 8px var(--ph)}

/* boutons : lueur et reflet qui traverse au survol */
html[data-charte=rebours] :is(.cta,.btn.go,.btn:not(.ghost):not(.go):not(.warn)){position:relative;overflow:hidden;box-shadow:0 0 0 1px color-mix(in srgb,var(--ph) 60%,transparent),0 8px 26px -10px var(--ph)}
html[data-charte=rebours] :is(.cta,.btn.go)::after{content:"";position:absolute;top:0;bottom:0;width:40%;left:-60%;transform:skewX(-20deg);background:linear-gradient(90deg,transparent,rgba(255,255,255,.45),transparent);transition:left .6s}
html[data-charte=rebours] :is(.cta,.btn.go):hover::after{left:130%}
html[data-charte=rebours] body:has(> header.site) .ghost{border-radius:10px;transition:border-color .2s,color .2s,box-shadow .2s}
html[data-charte=rebours] body:has(> header.site) .ghost:hover{border-color:var(--ph);color:var(--ph);box-shadow:0 0 18px -6px var(--ph)}

/* journal : accueil, puces d'état, intro */
html[data-charte=rebours] :where(#app) .intro{border:1px solid var(--rb-line);border-radius:6px;position:relative;overflow:hidden;
  background:radial-gradient(600px 260px at 100% 0%,var(--ph-soft),transparent 65%),linear-gradient(180deg,rgba(255,255,255,.02),transparent),var(--rb-surface)}
html[data-charte=rebours] :where(#app) .intro::after{content:"LIVE // SALLE DE CONTRÔLE";position:absolute;right:18px;top:14px;font-family:var(--rb-mono);font-size:10px;letter-spacing:2px;color:var(--rb-muted)}
html[data-charte=rebours] :where(#app) .steps .n{border-radius:3px;font-family:var(--rb-mono);box-shadow:0 0 14px color-mix(in srgb,var(--ph) 60%,transparent)}
html[data-charte=rebours] :where(#app) .chip.live::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor;animation:rb-blink 1.2s steps(1) infinite}
html[data-charte=rebours] .clk{letter-spacing:.5px}
html[data-charte=rebours] :where(#app) .field :is(input,select):focus{outline:none;border-color:var(--ph);box-shadow:0 0 0 3px var(--ph-soft)}
html[data-charte=rebours] :where(#app) .icard,html[data-charte=rebours] :where(#app) .panel{border-radius:4px}

/* pied de page */
html[data-charte=rebours] footer.site{background:rgba(10,13,18,.85);border-top:1px solid var(--rb-line);box-shadow:inset 0 1px 0 color-mix(in srgb,var(--ph) 35%,transparent);font-family:var(--rb-body)}
html[data-charte=rebours] footer.site [title^="Version du site"]{font-family:var(--rb-mono);font-size:12px;color:var(--ph);border:1px solid var(--rb-line);padding:1px 7px;border-radius:2px}
}
@media (prefers-reduced-motion:reduce){
  html[data-charte=rebours] *,html[data-charte=rebours] *::before,html[data-charte=rebours] *::after{animation:none !important;transition:none !important}
}

