:root {
  color-scheme: light;
  --bg: #F4F4F2;
  --surface: #FFFFFF;
  --ink: #16161A;
  --ink-2: #45454D;
  --muted: #76767E;
  --line: #E2E2DE;
  --line-2: #CFCFCA;
  --red: #C8302C;
  --blue: #2A5BD7;
  --good: #1E7B4F;
  --seq: #2a78d6;
  --card: #FFFFFF;
  --card-line: #D3D3CE;
  --card-ink: #16161A;
  --card-red: #C8302C;
  --p0: #2a78d6; --p1: #eb6834; --p2: #1baf7a; --p3: #eda100;
  --p4: #e87ba4; --p5: #008300; --p6: #4a3aa7; --p7: #e34948;
  --display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101114; --surface: #1A1B20; --ink: #F1F1EE; --ink-2: #C8C8C3; --muted: #8D8D95;
    --line: #2A2B31; --line-2: #3B3C43; --red: #F0605A; --blue: #7C9BFF; --good: #4CC38A; --seq: #3987e5;
    --card: #F3F3F0; --card-line: #3B3C43;
    --p0: #3987e5; --p1: #d95926; --p2: #199e70; --p3: #c98500;
    --p4: #d55181; --p5: #008300; --p6: #9085e9; --p7: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101114; --surface: #1A1B20; --ink: #F1F1EE; --ink-2: #C8C8C3; --muted: #8D8D95;
  --line: #2A2B31; --line-2: #3B3C43; --red: #F0605A; --blue: #7C9BFF; --good: #4CC38A; --seq: #3987e5;
  --card: #F3F3F0; --card-line: #3B3C43;
  --p0: #3987e5; --p1: #d95926; --p2: #199e70; --p3: #c98500;
  --p4: #d55181; --p5: #008300; --p6: #9085e9; --p7: #e66767;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--body); }
body { min-height: 100vh; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 12px; width: 100%; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
input:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: transparent; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: .01em; line-height: 1.05; margin: 0; text-wrap: balance; }
h1 { font-size: 44px; text-transform: uppercase; }
h2 { font-size: 26px; text-transform: uppercase; }
h3 { font-size: 19px; text-transform: uppercase; }
table, .num, .stepper .v { font-variant-numeric: tabular-nums; }

.wrap { max-width: 640px; margin: 0 auto; padding-inline: 16px; }
main.wrap { padding-block: 16px 120px; display: grid; gap: 28px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.wraprow { display: flex; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.red { color: var(--red); }
.good { color: var(--good); }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.block { width: 100%; }
.btn.big { min-height: 58px; font-size: 18px; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.btn:active { transform: translateY(1px); }
.link { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.link.danger { color: var(--red); }
.seg { display: flex; border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; gap: 3px; background: var(--surface); }
.seg button { flex: 1; min-height: 38px; border-radius: 7px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--ink); color: var(--bg); }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); font-weight: 500; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.stepper button { width: 42px; height: 42px; font-size: 20px; font-weight: 600; color: var(--ink-2); }
.stepper .v { min-width: 36px; text-align: center; font-family: var(--display); font-weight: 800; font-size: 22px; }
.stepper .v.warn { color: var(--red); }
.stepper.wide button { width: 52px; font-size: 15px; }
.stepper input { border: 0; width: 84px; text-align: center; font-family: var(--display); font-weight: 800; font-size: 30px; padding: 4px; background: transparent; }

/* En-tête et onglets */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.top .title { font-family: var(--display); font-weight: 800; font-size: 26px; text-transform: uppercase; line-height: 1; }
.code { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: .14em; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; background: var(--surface); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar .wrap { display: grid; grid-template-columns: 1fr 1fr; }
.tabbar button { min-height: 58px; font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-top: 2px solid transparent; margin-top: -1px; }
.tabbar button.on { color: var(--ink); border-top-color: var(--ink); }

.givebar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--ink); color: var(--bg); }
.givebar b { font-family: var(--display); font-size: 26px; }
.givebar .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); }

/* Listes */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li.me .name::after { content: "toi"; margin-left: 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.name { font-weight: 600; }
.sub { font-size: 13px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; }
.big-num { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; min-width: 2ch; text-align: right; }
.rank { font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--muted); width: 1.4em; }
.tally { color: var(--ink-2); flex: none; }
.gamelist button { width: 100%; text-align: left; display: flex; gap: 14px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.gamelist .gname { font-family: var(--display); font-weight: 800; font-size: 24px; text-transform: uppercase; line-height: 1.1; }
.gamelist .gdesc { color: var(--muted); font-size: 14px; }
.gamelist .suit { font-size: 26px; width: 30px; text-align: center; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 14px; }
.section { display: grid; gap: 10px; }
.section-head { display: flex; align-items: baseline; gap: 10px; }
.section-head h3 { flex: 1; }
.check { font-size: 13px; font-weight: 600; }
.check.ok { color: var(--good); } .check.ko { color: var(--red); }
.radio { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.radio.on { background: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 5px var(--surface); }
.status-line { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.status-line span { display: inline-flex; gap: 6px; align-items: center; }
details > summary { cursor: pointer; font-weight: 600; list-style: none; }
details > summary::after { content: " +"; color: var(--muted); }
details[open] > summary::after { content: " –"; }

/* Tableaux */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 6px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
tfoot td { font-family: var(--display); font-weight: 800; font-size: 20px; border-bottom: 0; }
td .note { color: var(--muted); font-size: 12px; margin-left: 4px; }
td.heat { background: color-mix(in srgb, var(--seq) calc(var(--h) * 38%), transparent); }

/* Cartes à jouer */
.pc { width: var(--cw, 46px); aspect-ratio: 5 / 7; flex: none; display: inline-grid; grid-template-rows: 1fr 1fr; place-items: center; padding-block: 8%; background: var(--card); border: 1px solid var(--card-line); border-radius: calc(var(--cw, 46px) * .12); color: var(--card-ink); font-family: var(--display); font-weight: 800; line-height: 1; }
.pc b { font-size: calc(var(--cw, 46px) * .42); align-self: end; }
.pc i { font-style: normal; font-size: calc(var(--cw, 46px) * .4); align-self: start; }
.pc.r { color: var(--card-red); }
.pc.back { background: repeating-linear-gradient(45deg, #2A5BD7 0 3px, #1F49B8 3px 6px); border-color: #1A3F9E; }
.pc.ghost { background: transparent; border-style: dashed; border-color: var(--line-2); }
.cards { display: flex; gap: 10px; align-items: center; justify-content: center; }

/* Purple */
.choices { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.choice { min-height: 64px; border-radius: 12px; font-family: var(--display); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: .04em; color: #fff; }
.choice.rouge { background: #C8302C; }
.choice.noir { background: #16161A; border: 1px solid var(--line-2); }
.choice.purple { background: linear-gradient(135deg, #C8302C 0 50%, #16161A 50% 100%); border: 1px solid var(--line-2); }
.streak { display: flex; gap: 6px; justify-content: center; }
.streak span { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--ink); }
.streak span.on { background: var(--ink); }
.verdict { font-family: var(--display); font-weight: 800; font-size: 24px; text-transform: uppercase; text-align: center; }
.order { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; color: var(--muted); }
.order .cur { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* Course */
.track { --steps: 8; --cw: 34px; display: grid; gap: 6px; padding: 10px 0; }
.track .gates, .track .lane { position: relative; height: calc(var(--cw) * 1.4); }
.track .lane { border-bottom: 1px dashed var(--line-2); }
.track .lane::after { content: ""; position: absolute; right: 0; top: 0; bottom: -1px; width: 2px; background: repeating-linear-gradient(180deg, var(--ink) 0 4px, transparent 4px 8px); }
.track .slot { position: absolute; top: 0; left: calc(var(--pos) / var(--steps) * (100% - var(--cw))); }
.track .horse { transition: left .7s cubic-bezier(.3, .7, .3, 1); }
.track .horse.win .pc { box-shadow: 0 0 0 3px var(--ink); }
.suits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.suits button { display: grid; justify-items: center; gap: 6px; padding: 10px 0; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); }
.suits button.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* Feuille modale */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(10, 10, 12, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; background: var(--bg); border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 16px; }
.qr { width: 168px; height: 168px; background: #fff; padding: 10px; border-radius: 10px; }
.qr svg { width: 100%; height: 100%; display: block; }
.urlbox { font-size: 14px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); word-break: break-all; user-select: all; }

/* Graphiques */
.chart { position: relative; width: 100%; min-height: 40px; }
.chart svg { display: block; overflow: visible; }
.chart text { fill: var(--muted); font-family: var(--body); }
.chart .lbl { fill: var(--ink-2); font-weight: 600; }
.tip { position: absolute; top: 0; pointer-events: none; background: var(--ink); color: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 13px; display: grid; gap: 2px; min-width: 120px; z-index: 2; }
.tip .row { gap: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Accueil */
.home { padding-block: 48px 64px; display: grid; gap: 36px; }
.home h1 { font-size: 72px; line-height: .9; }
.home .lead { font-size: 18px; color: var(--ink-2); max-width: 32ch; }
.suitsline { font-size: 22px; letter-spacing: .3em; }
.suitsline .r { color: var(--red); }

/* Toasts */
#toasts { position: fixed; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: grid; justify-items: center; gap: 6px; pointer-events: none; padding-inline: 16px; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 500; max-width: 520px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); animation: tin .25s ease-out; display: flex; gap: 10px; align-items: center; }
.toast .n { font-family: var(--display); font-weight: 800; font-size: 22px; }
.toast.drink .n { color: #FF8A84; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* Écran TV : tout est en em, la base suit la largeur de l'écran */
body.tvmode { overflow: hidden; }
.tv { height: 100vh; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; font-size: clamp(13px, 1.05vw, 34px); }
.tv .dot { width: .6em; height: .6em; }
.tv-head { display: flex; align-items: center; gap: 2.4em; padding: 1em 2.4em .6em; border-bottom: 1px solid var(--line); }
.tv-brand { font-family: var(--display); font-weight: 800; font-size: 2em; text-transform: uppercase; line-height: .95; }
.tv-brand small { display: block; font-family: var(--body); font-weight: 500; font-size: .45em; text-transform: none; color: var(--muted); margin-top: .3em; }
.tv-now { flex: 1; min-width: 0; }
.tv-now .g { font-family: var(--display); font-weight: 800; font-size: 2em; text-transform: uppercase; line-height: 1; }
.tv-now .i { font-size: 1.15em; color: var(--ink-2); margin-top: .2em; }
.tv-join { display: flex; align-items: center; gap: .9em; text-align: right; }
.tv-join b { font-family: var(--display); font-size: 2.2em; letter-spacing: .14em; line-height: 1; }
.tv-join .qr { width: 5.6em; height: 5.6em; padding: .35em; border-radius: .4em; }
.tv-bar { position: relative; display: flex; align-items: center; gap: 1.2em; padding: 1em 2.4em .4em; }
.tv-title { flex: 1; font-family: var(--display); font-weight: 800; font-size: 3.4em; text-transform: uppercase; line-height: 1; }
.tv-dots { display: flex; gap: .5em; }
.tv-dots i { width: .7em; height: .7em; border-radius: 50%; background: var(--line-2); }
.tv-dots i.on { background: var(--ink); }
.tv-progress { position: absolute; left: 2.4em; right: 2.4em; bottom: -.3em; height: 3px; background: var(--ink); transform-origin: left; animation: tvprog linear forwards; }
@keyframes tvprog { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.tv-stage { min-height: 0; overflow: hidden; padding: 1.4em 2.4em; }
.tv-stage .slide { height: 100%; }
.tv-stage .slide.enter { animation: tvin .7s cubic-bezier(.2, .7, .2, 1); }
@keyframes tvin { from { opacity: 0; transform: translateY(1.2em); } }
.tv-strip:empty, .tv-ticker:empty, .tv-flash:empty { display: none; }
.tv-strip { padding: .8em 2.4em 1em; border-top: 1px solid var(--line); }
.tv-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .5em .6em; }
.tv-chips h4 { margin: 0 .6em 0 0; font-family: var(--display); font-weight: 800; font-size: 1.7em; text-transform: uppercase; }
.tv-chips span { display: inline-flex; align-items: center; gap: .45em; padding: .3em .8em; border: 1px dashed var(--line-2); border-radius: 999px; font-size: 1.15em; color: var(--muted); }
.tv-chips span.done { border-style: solid; border-color: var(--ink); color: var(--ink); }
.tv-chips span b { font-family: var(--display); font-size: 1.15em; }
.tv-ticker { display: flex; align-items: stretch; height: 3.8em; background: var(--ink); color: var(--bg); overflow: hidden; }
.tk-title { flex: none; display: flex; align-items: center; padding: 0 1.3em; background: var(--red); color: #fff; font-family: var(--display); font-weight: 800; font-size: 1.6em; text-transform: uppercase; letter-spacing: .05em; }
.tk-track { flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; }
.tk-run { display: inline-flex; align-items: center; white-space: nowrap; animation: tvmarquee linear infinite; }
.tk { display: inline-flex; align-items: center; gap: .45em; font-size: 1.55em; font-weight: 500; padding: 0 .8em; }
.tk b { font-family: var(--display); font-weight: 800; font-size: 1.25em; }
.tk-sep { font-size: 1.2em; opacity: .55; }
.tk-sep.r { color: #FF8A84; opacity: 1; }
@keyframes tvmarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tv-flash { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; pointer-events: none; background: color-mix(in srgb, var(--bg) 55%, transparent); animation: tvfade 2.6s ease forwards; }
.tv-flash div { font-family: var(--display); font-weight: 800; font-size: 8vw; text-transform: uppercase; line-height: 1; background: var(--ink); color: var(--bg); padding: .18em .5em; border-radius: .1em; animation: tvpop 2.6s ease forwards; }
@keyframes tvfade { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tvpop { 0% { transform: scale(.85); opacity: 0; } 12% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.03); } }
.tv-fs { position: fixed; right: 12px; top: 12px; opacity: .35; z-index: 41; }

/* Classement des gorgées : une ou deux colonnes, taille selon le nombre de lignes */
.tvrank { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), auto); column-gap: 3em; }
.tvrank li { display: flex; align-items: center; gap: .55em; padding: .22em 0; border-bottom: 1px solid var(--line); font-size: min(2.6em, calc(56vh / var(--rows) / 1.75)); }
.tvrank .rank { width: 1.5em; font-size: .8em; color: var(--muted); font-family: var(--display); font-weight: 800; }
.tvrank .name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvrank .num { font-family: var(--display); font-weight: 800; font-size: 1.35em; min-width: 1.6em; text-align: right; }
.tvrank li.lead .num { color: var(--red); }

/* Tableaux de scores */
.tvtable { width: 100%; border-collapse: collapse; font-size: min(2.4em, calc(52vh / (var(--rows) + 1) / 1.7)); font-variant-numeric: tabular-nums; }
.tvtable th { font-family: var(--body); font-size: .42em; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: right; padding: 0 .5em .4em; }
.tvtable td { padding: .2em .5em; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tvtable td.rank { width: 1.6em; text-align: left; font-family: var(--display); font-weight: 800; color: var(--muted); font-size: .85em; }
.tvtable td.who { text-align: left; font-weight: 600; width: 40%; }
.tvtable td.who .dot { margin-right: .5em; display: inline-block; vertical-align: middle; }
.tvtable td b { font-family: var(--display); font-weight: 800; font-size: 1.25em; }
.tvtable .heat { display: inline-block; min-width: 2.2em; padding: 0 .3em; border-radius: .2em; text-align: center; background: color-mix(in srgb, var(--seq) calc(var(--h) * 45%), transparent); }

/* Cartes de stats */
.tvgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16em, 1fr)); gap: 1.4em; align-content: start; }
.tvcard { background: var(--surface); border: 1px solid var(--line); border-radius: .8em; padding: 1.2em 1.4em; display: grid; gap: .35em; align-content: start; }
.tvcard .k { font-size: .95em; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tvcard .v { font-family: var(--display); font-weight: 800; font-size: 4.4em; line-height: 1; }
.tvcard .d { font-size: 1.2em; color: var(--ink-2); }
.tvpodium { list-style: none; margin: .4em 0 0; padding: 0; display: grid; gap: .3em; font-size: 1.3em; }
.tvpodium li { display: flex; align-items: center; gap: .5em; }
.tvpodium li span { flex: 1; }
.tvpodium li b { font-family: var(--display); font-size: 1.2em; }
.tvjoin { height: 100%; display: flex; align-items: center; justify-content: center; gap: 3em; font-size: 1.8em; }
.tvjoin .qr { width: min(48vh, 14em); height: min(48vh, 14em); padding: .6em; }
.tvjoin .url { font-family: var(--display); font-weight: 800; font-size: 1.8em; margin: .2em 0; }

/* Jeux sur la télé */
.tv-stage .chart text { font-family: var(--body); }
.tv-stage .track { --cw: min(8vh, 5em); gap: 1vh; }
.tv-purple { height: 100%; display: flex; align-items: center; justify-content: center; gap: 5em; }
.tv-purple .cards { --cw: min(34vh, 13em); gap: 1.2em; }
.tv-pile { display: grid; justify-items: center; gap: .3em; --cw: min(16vh, 6em); }
.tv-pile b { font-family: var(--display); font-size: 3em; line-height: 1; }
.tv-pile span { color: var(--muted); }
.tv-purple-side { display: grid; gap: 1.4em; justify-items: start; max-width: 40%; }
.tv-purple-side .verdict { font-size: 3.4em; text-align: left; }
.tv-purple-side .streak span { width: 1.4em; height: 1.4em; border-width: 3px; }
@media (prefers-reduced-motion: reduce) {
  .tv-stage .slide.enter { animation: none; }
  .track .horse { transition: none; }
  .toast { animation: none; }
}

/* Compléments */
.pc.big { --cw: 72px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.field { display: grid; gap: 4px; }
.field .eyebrow { letter-spacing: .06em; }
.stepper button[disabled] { opacity: .3; pointer-events: none; }
.gamelist .suit.red { color: var(--red); }
.track .pc { width: var(--cw); }

/* Appairage télé */
.pair { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 36px; padding: 32px 16px; text-align: center; }
.pair-code { display: flex; gap: clamp(10px, 2vw, 22px); }
.pair-code span { width: clamp(64px, 11vw, 170px); aspect-ratio: 5 / 7; display: grid; place-items: center; background: var(--card); color: var(--card-ink); border: 1px solid var(--card-line); border-radius: clamp(8px, 1.4vw, 18px); font-family: var(--display); font-weight: 800; font-size: clamp(56px, 9vw, 140px); }
.pair-code span:nth-child(even) { color: var(--card-red); }
.pair .lead { font-size: clamp(18px, 2.4vw, 32px); color: var(--ink-2); max-width: 30ch; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; color: var(--ink-2); }
.pairinput { font-family: var(--display); font-weight: 800; font-size: 32px; letter-spacing: .4em; text-align: center; padding-block: 6px; }
body.tvmode #toasts { bottom: calc(5.5vw + 12px); }
body.tvmode .toast { font-size: max(16px, 1.35vw); padding: .6em 1em; max-width: 60vw; }
body.tvmode .toast .n { font-size: 1.5em; }

/* Règles, ordre de la table, Bus, bonus de la Course */
.rules { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; color: var(--ink-2); line-height: 1.5; }
.rules li::marker { font-family: var(--display); font-weight: 800; color: var(--ink); }
.tvrules { margin: 0; padding-left: 1.4em; display: grid; gap: .7em; font-size: 1.55em; line-height: 1.35; max-width: 62em; color: var(--ink-2); }
.tvrules li::marker { font-family: var(--display); font-weight: 800; color: var(--ink); }
.choices.two { grid-template-columns: 1fr 1fr; }
.choices.four { grid-template-columns: repeat(4, 1fr); }
.choices.four .choice { font-size: 30px; }
.track .lane-tags { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-family: var(--display); font-weight: 800; font-size: calc(var(--cw) * .42); color: var(--muted); letter-spacing: .04em; }
.tv-note { margin: 0; font-size: 1.6em; color: var(--ink-2); }
.sipbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sipbar b { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; }
.sipbar .btn { flex: none; }
main.wrap > .sipbar + .givebar { margin-top: -16px; }
.tvrank .left { min-width: 4.2em; text-align: right; font-size: .62em; font-weight: 600; color: var(--red); white-space: nowrap; }
.tk-left { font-family: var(--body); font-weight: 600; font-size: .62em; color: #FF8A84; margin-left: .3em; }

/* Roulette surprise */
.tv-roulette:empty { display: none; }
.roulette { position: fixed; inset: 0; z-index: 45; display: grid; place-content: center; justify-items: center; gap: 4vh; text-align: center; background: #101114; color: #F1F1EE; animation: rlin .35s ease-out; }
@keyframes rlin { from { opacity: 0; transform: scale(1.04); } }
.roulette h2 { font-size: 9vw; line-height: .9; color: #F1F1EE; animation: rlpulse .5s ease-in-out infinite alternate; }
@keyframes rlpulse { to { transform: scale(1.06); color: #FF5A52; } }
.roulette .siren { position: absolute; left: 0; right: 0; top: 0; height: 2.2vh; background: linear-gradient(90deg, #C8302C 0 50%, #2A5BD7 50% 100%); animation: rlsiren .5s steps(1) infinite; }
.roulette .siren.bottom { top: auto; bottom: 0; animation-delay: .25s; }
@keyframes rlsiren { 50% { transform: scaleX(-1); } }
.roulette .reels { display: flex; gap: 4vw; align-items: flex-end; }
.roulette .eyebrow { color: #8D8D95; font-size: 2.2vh; margin-bottom: 1vh; }
.reel { height: 1.2em; overflow: hidden; background: #F3F3F0; color: #16161A; border-radius: .14em; box-shadow: 0 0 0 .06em #C8302C; font-family: var(--display); font-weight: 800; }
.reel.n { font-size: 13vh; min-width: 4.2em; }
.reel.w { font-size: 11vh; min-width: 5.5em; }
.reel .strip span { display: block; height: 1.2em; line-height: 1.2em; padding: 0 .3em; text-align: center; white-space: nowrap; }
.rl-result { margin: 0; font-family: var(--display); font-weight: 800; font-size: 6vw; text-transform: uppercase; color: #FF5A52; opacity: 0; animation: rlshow .6s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes rlshow { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
