/* =====================================================================================
   BEF Racing Arena — thème « Télémétrie Lightning »
   Fond carbone, angles chanfreinés, chiffres de télémétrie. Orange Bitcoin = action,
   bleu éclair = information en direct. Polices auto-hébergées (static/polices, OFL).
   ===================================================================================== */
@font-face { font-family: "Chakra Petch"; font-weight: 600; font-display: swap; src: url("/static/polices/chakra-petch-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 700; font-display: swap; src: url("/static/polices/chakra-petch-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/static/polices/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/static/polices/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/static/polices/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("/static/polices/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("/static/polices/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 600; font-display: swap; src: url("/static/polices/jetbrains-mono-latin-600-normal.woff2") format("woff2"); }

:root {
  --carbone: #06070a; --graphite: #12151c; --graphite2: #0b0d12; --acier: #98a1b0; --givre: #e9edf3;
  --or: #F7931A; --or-clair: #ffb24d; --eclair: #3ee6ff; --ok: #3fb950; --feu: #ff3b30; --err: #ff6b5e;
  --trait: rgba(170, 185, 210, .14);
  /* anciens noms, gardés pour les gabarits du panneau */
  --noir: var(--carbone); --noir2: var(--graphite); --gris: #262b35; --blanc: var(--givre); --muted: var(--acier);
  --titre: "Chakra Petch", "Arial Narrow", system-ui, sans-serif;
  --texte: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --chf: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  --chf-s: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  --chf-xs: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
* { box-sizing: border-box; }
html { overflow-x: clip; }
html, body { margin: 0; background: var(--carbone); color: var(--givre); font: 16px/1.55 var(--texte); }
body {
  min-height: 100vh;
  background:
    radial-gradient(60% 40% at 85% -5%, rgba(62, 230, 255, .07), transparent 70%),
    radial-gradient(55% 45% at 5% 10%, rgba(247, 147, 26, .07), transparent 70%),
    linear-gradient(rgba(140, 160, 190, .05) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(140, 160, 190, .05) 1px, transparent 1px) 0 0 / 56px 56px,
    var(--carbone);
  background-attachment: fixed;
}
a { color: var(--or-clair); text-underline-offset: 3px; }
a:hover { color: #ffd08a; }
::selection { background: var(--or); color: #120a00; }
:focus-visible { outline: 2px solid var(--eclair); outline-offset: 2px; }
code { background: #1a1e27; padding: 1px 6px; font-family: var(--mono); font-size: .9em; }
.wrap { word-break: break-all; display: block; }
.num, .chrono-temps { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ bandeau, en-tête, pied */
.demo-banner { background: var(--or); color: #140b00; font: 600 12px/1.2 var(--mono); text-align: center; padding: 7px; letter-spacing: .18em; text-transform: uppercase; }
header.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px max(24px, calc((100% - 1240px) / 2)); flex-wrap: wrap;
  background: rgba(6, 7, 10, .78); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 1px 0 var(--trait); }
header.top .brand img { height: 52px; width: auto; display: block; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .6)); }
header.top nav { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
header.top nav a { position: relative; color: #c3cad6; text-decoration: none; font-weight: 500; padding: 8px 0; }
header.top nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--or);
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
header.top nav a:hover, header.top nav a[aria-current="page"] { color: #fff; }
header.top nav a:hover::after, header.top nav a[aria-current="page"]::after { transform: scaleX(1); }
header.top nav a.adm { color: var(--or-clair); }
main { max-width: 1240px; margin: 0 auto; padding: 22px 24px 56px; }
footer { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; max-width: 1240px; margin: 0 auto;
  padding: 26px 24px 40px; color: var(--acier); font-size: 13px; border-top: 1px solid var(--trait); }

/* ------------------------------------------------------------------ titres et texte */
h1 { font: 700 clamp(2rem, 4.4vw, 3.4rem)/1 var(--titre); text-transform: uppercase; letter-spacing: -.005em; margin: .3em 0 .5em; text-wrap: balance; }
h2 { font: 700 clamp(1.25rem, 2.2vw, 1.7rem)/1.1 var(--titre); text-transform: uppercase; letter-spacing: .02em; color: var(--givre); margin: 1.1em 0 .6em; }
.card h2 { margin-top: .1em; }
h3 { font: 600 1.05rem/1.2 var(--titre); text-transform: uppercase; letter-spacing: .03em; }
.muted { color: var(--acier); }
.small { font-size: .86rem; }
.surtitre { font: 600 12px/1.2 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--or); }
.surtitre.eclair { color: var(--eclair); }

/* ------------------------------------------------------------------ boutons */
.btn { position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 10px 20px; background: rgba(255, 255, 255, .03); color: var(--givre); border: 0;
  box-shadow: 0 0 0 1px rgba(233, 237, 243, .24) inset; clip-path: var(--chf-s);
  font: 600 .95rem/1.1 var(--titre); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; text-decoration: none;
  transition: box-shadow .25s, background .25s, color .25s; }
.btn:hover { color: #fff; background: rgba(62, 230, 255, .06); box-shadow: 0 0 0 1px var(--eclair) inset; }
.btn.primary { overflow: hidden; color: #120a00; background: var(--or); box-shadow: none; }
/* liseré de lumière qui tourne autour du bouton principal */
.btn.primary::before { content: ""; position: absolute; inset: -70%; z-index: -2;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(255, 255, 255, .25) 78%, rgba(255, 255, 255, .85) 82%, rgba(255, 255, 255, .25) 86%, transparent 92%);
  animation: tourne 3.2s linear infinite; }
.btn.primary::after { content: ""; position: absolute; inset: 2px; z-index: -1; background: linear-gradient(180deg, #ffa63a, #f28a0c); clip-path: var(--chf-s); }
.btn.primary:hover::after { background: linear-gradient(180deg, #ffb455, var(--or)); }
.btn.grand { min-height: 60px; padding: 16px 30px; font-size: 1.1rem; clip-path: var(--chf); }
.btn.grand.primary::after { clip-path: var(--chf); }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: .78rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
@keyframes tourne { to { transform: rotate(1turn); } }
button.link { background: none; border: none; color: #c3cad6; font: inherit; font-weight: 500; cursor: pointer; padding: 8px 0; }
button.link:hover { color: #fff; }
form.inline { display: inline; }

/* ------------------------------------------------------------------ cartes et formulaires */
.card { position: relative; margin: 16px 0; padding: 22px 24px; clip-path: var(--chf);
  background: linear-gradient(180deg, rgba(20, 24, 31, .94), rgba(10, 12, 16, .94)); box-shadow: 0 0 0 1px var(--trait) inset; }
.card.narrow { max-width: 440px; }
.hero { position: relative; padding: 26px 28px; clip-path: var(--chf);
  background: linear-gradient(135deg, rgba(247, 147, 26, .14), rgba(18, 21, 28, .9) 55%); box-shadow: 0 0 0 1px rgba(247, 147, 26, .35) inset; }
.grid { display: grid; gap: 12px; max-width: 640px; }
label { display: grid; gap: 5px; font-size: .92rem; color: #c9d0db; }
label.radio { display: flex; gap: 8px; align-items: center; }
fieldset { border: 1px solid var(--trait); padding: 12px 16px; }
legend { font: 600 .8rem var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--or); padding: 0 6px; }
input, select, textarea { background: #0a0c10; color: var(--givre); border: 0; box-shadow: 0 0 0 1px rgba(170, 185, 210, .26) inset;
  padding: 10px 12px; font: inherit; min-height: 42px; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 1.5px var(--or) inset; }

/* ------------------------------------------------------------------ tableaux */
table { border-collapse: separate; border-spacing: 0 3px; width: 100%; }
th, td { text-align: left; padding: 10px 12px; vertical-align: middle; }
th { color: var(--acier); font: 600 .72rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .14em; }
tbody tr { background: rgba(18, 21, 28, .78); transition: background .2s; }
tbody tr:nth-child(even) { background: rgba(12, 14, 19, .78); }
tbody tr:hover { background: rgba(28, 33, 43, .9); }
tr.warn td { background: #3a1d12; }
.table-defile { overflow-x: auto; }
.standings td.name { font-weight: 600; }
.standings td.pts { font: 600 1.05rem var(--mono); color: var(--or); }
.standings td.prize { font-family: var(--mono); font-weight: 600; }
.standings tr.p1 td:first-child, .standings tr.p2 td:first-child, .standings tr.p3 td:first-child { font: 700 1.1rem var(--mono); }
.standings tr.p1 td:first-child { color: var(--or); }
.standings tr.p1 { background: linear-gradient(90deg, rgba(247, 147, 26, .18), rgba(18, 21, 28, .78) 60%); }
.standings td small { color: var(--acier); font-family: var(--mono); }
tr.moi td { color: var(--or-clair); font-weight: 700; }
tr.moi { background: rgba(247, 147, 26, .12) !important; box-shadow: 0 0 0 1px rgba(247, 147, 26, .5) inset; }

/* ------------------------------------------------------------------ pastilles, messages */
.badge { display: inline-block; clip-path: var(--chf-xs); padding: 3px 10px; font: 600 .7rem/1.4 var(--mono); letter-spacing: .1em;
  text-transform: uppercase; background: #262b35; color: var(--givre); vertical-align: middle; }
.badge.mode-paid { background: var(--or); color: #140b00; }
.badge.mode-free { background: var(--givre); color: #0b0d12; }
.badge.demo { background: #5b3b00; }
.badge.st-open { background: var(--eclair); color: #071114; }
.badge.st-running { background: #1e6b34; }
.badge.st-validated, .badge.st-paid { background: #3a404c; }
.badge.po-paid, .badge.po-simulated, .badge.po-manual { background: #1e6b34; }
.badge.po-failed { background: #7a1f1f; }
.badge.po-unknown { background: #8a5a00; }
.flash { padding: 10px 14px; clip-path: var(--chf-s); }
.flash.ok { background: rgba(63, 185, 80, .14); box-shadow: 0 0 0 1px var(--ok) inset; }
.flash.err { background: rgba(255, 107, 94, .12); box-shadow: 0 0 0 1px var(--err) inset; }
.legal { background: rgba(247, 147, 26, .08); box-shadow: 0 0 0 1px rgba(247, 147, 26, .35) inset; padding: 10px 14px; margin: 8px 0; clip-path: var(--chf-s); }
.confirm { box-shadow: 0 0 0 1px var(--or) inset; }

/* ------------------------------------------------------------------ connexion, divers */
.login { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.qr { background: #fff; padding: 12px; width: 300px; height: 300px; clip-path: var(--chf); box-shadow: 0 0 60px -10px rgba(247, 147, 26, .5); }
.qr svg { width: 100%; height: 100%; }
.demo-box { box-shadow: 0 0 0 1px rgba(247, 147, 26, .6) inset; padding: 10px 18px; margin-top: 24px; clip-path: var(--chf-s); }
.evrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--trait); }
.adminnav { display: flex; gap: 18px; padding: 10px 14px; background: var(--graphite); box-shadow: 0 0 0 1px var(--trait) inset; flex-wrap: wrap; clip-path: var(--chf-s); }
.adminnav a { color: var(--givre); font-weight: 600; text-decoration: none; }
.adminnav a:hover { color: var(--or); }
pre.log { background: #000; color: #ddd; padding: 10px; font: 12px/1.45 var(--mono); max-height: 360px; overflow: auto; white-space: pre-wrap; }
.evlist li { margin: 6px 0; }
.salon { margin: 10px 0; }
body.ecran header.top nav, body.ecran footer { display: none; }
body.ecran main { max-width: none; }
body.ecran h1 { font-size: 3rem; }
body.ecran .standings { font-size: 1.9rem; }
body.ecran .standings th { font-size: 1.1rem; }

/* ------------------------------------------------------------------ effets */
.pouls { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--eclair); box-shadow: 0 0 14px var(--eclair); animation: pouls 1.4s ease-in-out infinite; }
.pouls.rouge { background: var(--feu); box-shadow: 0 0 14px var(--feu); }
@keyframes pouls { 50% { opacity: .25; } }
.revele { display: block; animation: revele 1.1s cubic-bezier(.2, .8, .1, 1) both; }
.revele.d2 { animation-delay: .16s; } .revele.d3 { animation-delay: .32s; }
@keyframes revele { from { clip-path: inset(0 100% 0 0); transform: translateX(-24px); } to { clip-path: inset(0 0 0 0); transform: none; } }
.monte { animation: monte .9s cubic-bezier(.2, .9, .2, 1) both; }
@keyframes monte { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.lueur-or { color: var(--or); text-shadow: 0 0 28px rgba(247, 147, 26, .55); }
/* équerres de viseur aux quatre coins */
.viseur { position: relative; }
.viseur > .eq { position: absolute; width: 20px; height: 20px; border: 0 solid var(--or); pointer-events: none; z-index: 2; }
.eq.hg { left: -1px; top: -1px; border-width: 2px 0 0 2px; } .eq.hd { right: -1px; top: -1px; border-width: 2px 2px 0 0; }
.eq.bg { left: -1px; bottom: -1px; border-width: 0 0 2px 2px; } .eq.bd { right: -1px; bottom: -1px; border-width: 0 2px 2px 0; }

/* ------------------------------------------------------------------ accueil : héros */
.accueil main { padding-top: 0; }
.heros { position: relative; margin: 0 calc(50% - 50vw); min-height: 660px; overflow: hidden; display: flex; align-items: center; }
.heros-fond { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: kb 22s ease-in-out infinite alternate; }
@keyframes kb { from { transform: scale(1.04); } to { transform: scale(1.16) translate(-2%, -1.5%); } }
.heros::before { content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(6, 7, 10, .96) 0%, rgba(6, 7, 10, .82) 36%, rgba(6, 7, 10, .25) 72%, rgba(6, 7, 10, .6) 100%),
              linear-gradient(0deg, var(--carbone) 0%, rgba(6, 7, 10, 0) 32%); }
.heros::after { content: ""; position: absolute; inset: 0; z-index: 1; mix-blend-mode: screen; pointer-events: none;
  background: repeating-linear-gradient(100deg, transparent 0 46px, rgba(255, 255, 255, .07) 46px 47px, transparent 47px 140px);
  animation: vitesse .9s linear infinite; }
@keyframes vitesse { to { background-position: -280px 0; } }
.heros-faisceau { position: absolute; top: 0; bottom: 0; left: 0; width: 14%; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(62, 230, 255, .10), transparent); animation: faisceau 5s cubic-bezier(.6, 0, .2, 1) infinite; }
@keyframes faisceau { 0% { transform: translateX(-30%) skewX(-18deg); opacity: 0 } 15% { opacity: 1 } 55%, 100% { transform: translateX(760%) skewX(-18deg); opacity: 0 } }
.heros-contenu { position: relative; z-index: 2; width: 100%; max-width: 1240px; margin: 0 auto; padding: 64px 24px; display: flex; flex-wrap: wrap; gap: 44px; align-items: center; }
.heros-texte { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.heros h1 { margin: 0; font-size: clamp(2.6rem, 7vw, 5.6rem); line-height: .9; }
.heros p.chapo { margin: 0; font-size: 1.2rem; color: #c1c8d3; max-width: 560px; }
.heros .actions { display: flex; gap: 14px; flex-wrap: wrap; }
.direct { display: inline-flex; gap: 12px; align-items: center; font: 600 13px var(--mono); letter-spacing: .22em; color: #9eeefa; text-transform: uppercase; }

/* console de télémétrie */
.console { flex: 1 1 380px; max-width: 460px; padding: 22px; display: flex; flex-direction: column; gap: 16px;
  background: linear-gradient(180deg, rgba(18, 21, 28, .78), rgba(8, 10, 14, .85)); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 0 0 1px rgba(170, 185, 210, .14) inset, 0 30px 80px -30px rgba(0, 0, 0, .8); }
.console-tete { display: flex; justify-content: space-between; align-items: center; font: 600 12px var(--mono); letter-spacing: .2em; color: var(--acier); }
.console-tete .rouge-direct { display: inline-flex; gap: 8px; align-items: center; color: var(--givre); }
.circuit { position: relative; width: 300px; height: 200px; align-self: center; }
.circuit svg { position: absolute; inset: 0; }
.circuit .kart-point { position: absolute; left: 0; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--or); box-shadow: 0 0 0 4px rgba(247, 147, 26, .25), 0 0 22px var(--or);
  offset-path: path("M40 150 C 28 92 70 40 132 44 S 236 30 262 78 S 252 160 196 158 S 128 184 88 176 S 46 168 40 150 Z");
  animation: circuit 7s linear infinite; }
.circuit .kart-point.p2 { background: var(--eclair); box-shadow: 0 0 0 4px rgba(62, 230, 255, .22), 0 0 18px var(--eclair); animation-delay: -1.4s; }
.circuit .kart-point.p3 { background: #c9d0db; box-shadow: 0 0 12px rgba(255, 255, 255, .5); width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; animation-delay: -2.6s; }
@keyframes circuit { from { offset-distance: 0%; } to { offset-distance: 100%; } }
.trace-tirets { stroke-dasharray: 6 10; animation: tirets 1.2s linear infinite; }
@keyframes tirets { to { stroke-dashoffset: -32; } }
.console-ligne { display: flex; justify-content: space-between; align-items: end; gap: 14px; }
.console .valeur { font: 600 2.4rem/1 var(--mono); color: #fff; }
.console .legende { font: 600 12px var(--mono); letter-spacing: .14em; color: var(--acier); text-transform: uppercase; }
.grille-salon { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.grille-salon span { height: 18px; clip-path: var(--chf-xs); box-shadow: 0 0 0 1px rgba(170, 185, 210, .3) inset; }
.grille-salon span.pris { background: var(--or); box-shadow: 0 0 16px -4px rgba(247, 147, 26, .8); }

/* chiffres clés sous le héros */
.chiffres { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 1px;
  background: linear-gradient(90deg, rgba(170, 185, 210, .18), rgba(170, 185, 210, .04)); margin: 0 0 8px; }
.chiffres div { background: var(--carbone); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.chiffres b { font: 600 1.8rem/1.1 var(--mono); }
.chiffres b small { font-size: .85rem; color: #8a93a3; }
.chiffres span { font-size: .84rem; color: var(--acier); }

/* bandeau défilant */
.defilant { position: relative; overflow: hidden; margin: 0 calc(50% - 50vw); background: var(--or); color: #130a00; padding: 12px 0; }
.defilant-piste { display: flex; gap: 56px; width: max-content; white-space: nowrap; font: 700 1rem var(--titre); letter-spacing: .06em; text-transform: uppercase;
  animation: defile 40s linear infinite; }
@keyframes defile { to { transform: translateX(-50%); } }

/* sections de l'accueil */
.section { padding: 48px 0 8px; }
.section-tete { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-tete h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); line-height: .95; }
.ecuries { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 18px; }
.ecurie { position: relative; display: block; min-height: 360px; overflow: hidden; color: var(--givre); text-decoration: none; clip-path: var(--chf); background: #0e1116; }
.ecurie img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2, .8, .2, 1); }
.ecurie:hover img { transform: scale(1.07); }
.ecurie::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(6, 7, 10, .95) 0%, rgba(6, 7, 10, .1) 58%); }
.ecurie .numero { position: absolute; right: 22px; top: 0; z-index: 1; font: 700 128px/1 var(--titre); color: transparent; -webkit-text-stroke: 1.5px rgba(247, 147, 26, .7); }
.ecurie.eclair .numero { -webkit-text-stroke-color: rgba(62, 230, 255, .7); }
.ecurie .infos { position: absolute; left: 28px; bottom: 24px; right: 28px; z-index: 1; display: flex; flex-direction: column; gap: 6px; }
.ecurie .infos b { font: 700 2.4rem/1 var(--titre); text-transform: uppercase; }
.ecurie .infos span { color: #c3cad5; }
.etapes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 1px; background: var(--trait); }
.etapes > div { background: var(--carbone); padding: 28px 24px; display: flex; flex-direction: column; gap: 10px; }
.etapes h3 { margin: 0; font-size: 1.4rem; }
.etapes p { margin: 0; color: #a9b2c0; }
.epreuves { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 16px; }
.epreuve { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.epreuve .ligne-infos { display: flex; gap: 28px; flex-wrap: wrap; }
.epreuve .ligne-infos div { display: flex; flex-direction: column; gap: 2px; }
.epreuve .ligne-infos span { font-size: .8rem; color: var(--acier); }
.epreuve .ligne-infos b { font: 600 1.05rem var(--mono); }

.pastilles { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.titre-epreuve { font-size: 1.6rem; margin: 0; }
.btn-debut { align-self: flex-start; }
.legende.espace { margin-bottom: 8px; }
.surtitre.gris { color: var(--acier); }
.note { margin-top: 22px; }

/* ------------------------------------------------------------------ garage 3D (page /jouer) */
.garage .garage-scene { position: relative; height: min(52vh, 440px); overflow: hidden; clip-path: var(--chf);
  background: radial-gradient(60% 40% at 50% 92%, rgba(247, 147, 26, .30), transparent 70%), radial-gradient(80% 70% at 50% 35%, #171c25, #07080b 75%);
  box-shadow: 0 0 0 1px var(--trait) inset; perspective: 900px; }
.garage .garage-scene::before { content: ""; position: absolute; left: 50%; top: 0; width: 70%; height: 90%; transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255, 236, 210, .18), rgba(255, 236, 210, 0) 80%); clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%); filter: blur(6px); pointer-events: none; }
.garage .garage-scene::after { content: ""; position: absolute; left: 50%; top: 76%; width: 640px; height: 640px; margin: -320px 0 0 -320px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(rgba(247, 147, 26, .5) 0 1deg, transparent 1deg 6deg);
  -webkit-mask-image: radial-gradient(circle, transparent 58%, #000 60%, #000 68%, transparent 70%); mask-image: radial-gradient(circle, transparent 58%, #000 60%, #000 68%, transparent 70%);
  transform: rotateX(76deg); animation: plateau 18s linear infinite; }
@keyframes plateau { to { transform: rotateX(76deg) rotate(1turn); } }
.garage .garage-scene canvas { position: relative; z-index: 1; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.garage .garage-scene canvas:active { cursor: grabbing; }
.garage .garage-indice { position: absolute; left: 18px; top: 14px; z-index: 2; display: inline-flex; gap: 10px; align-items: center; font: 600 11px var(--mono); letter-spacing: .2em; color: #9eeefa; pointer-events: none; }
.garage.sans-3d .garage-scene { display: none; }
.garage-choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.kart-carte { display: grid; grid-template-columns: 120px 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px; align-items: center; text-align: left;
  background: #0d1016; color: var(--givre); border: 0; padding: 10px; cursor: pointer; font: inherit; clip-path: var(--chf-s);
  box-shadow: 0 0 0 1px rgba(170, 185, 210, .18) inset; transition: box-shadow .25s, transform .25s; }
.kart-carte img { grid-row: 1 / 3; width: 120px; aspect-ratio: 14 / 9; object-fit: cover; }
.kart-carte .kart-nom { font: 700 1.2rem/1.1 var(--titre); text-transform: uppercase; align-self: end; }
.kart-carte .kart-info { color: var(--acier); font-size: .82rem; align-self: start; }
.kart-carte:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(247, 147, 26, .5) inset; }
.kart-carte.choisi { box-shadow: 0 0 0 2px var(--or) inset, 0 18px 50px -18px rgba(247, 147, 26, .7); background: rgba(247, 147, 26, .08); }
.kart-carte.choisi .kart-nom::after { content: " ✓"; color: var(--or); }

/* ------------------------------------------------------------------ chrono du jour */
.chrono-temps { font-weight: 600; }
.record { display: flex; flex-wrap: wrap; gap: 32px; align-items: end; justify-content: space-between; }
.record-tableau { display: flex; gap: 6px; align-items: center; perspective: 600px; }
.record-tableau .c { display: grid; place-items: center; width: clamp(40px, 7vw, 78px); height: clamp(58px, 10vw, 112px); position: relative;
  font: 600 clamp(2rem, 6vw, 4.4rem)/1 var(--mono); color: #fff;
  background: linear-gradient(180deg, #1a1f28 0 49.5%, #0c0f14 50.5% 100%); box-shadow: 0 0 0 1px rgba(170, 185, 210, .16) inset, 0 18px 40px -16px rgba(0, 0, 0, .8);
  animation: bascule 1s cubic-bezier(.3, 1.4, .4, 1) both; }
.record-tableau .c::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, .8); }
.record-tableau .s { font: 600 clamp(1.6rem, 5vw, 3.6rem)/1 var(--mono); color: var(--or); }
@keyframes bascule { from { transform: rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.prime { min-width: 300px; display: flex; flex-direction: column; gap: 10px; }
.prime .montant { font: 600 2.8rem/1 var(--mono); }
.ecart { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.ecart .barre { flex: 1; height: 6px; display: block; }
.ecart .barre-fond { fill: rgba(170, 185, 210, .12); }
.ecart .barre-val { fill: var(--eclair); transform-origin: left; animation: barre 1.4s cubic-bezier(.2, .8, .2, 1) both; }
.vainqueurs b { font: 700 1.3rem var(--titre); text-transform: uppercase; }
.ecart .val { font: 500 .85rem var(--mono); color: #9eeefa; min-width: 62px; text-align: right; }
@keyframes barre { from { transform: scaleX(0); } }
.vainqueurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 1px; background: var(--trait); }
.vainqueurs > div { background: var(--carbone); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.grand-ecran-video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; clip-path: var(--chf); }
@media (max-width: 560px) { .col-secondaire { display: none; } }

/* ---- garage compact sur téléphone ----
   Mesuré en 393×786 : le garage faisait 1 098 px de haut (scène 359 px + deux cartes empilées) et
   repoussait le bouton « Jouer dans le navigateur » à y = 1 757, soit plus de deux écrans plus bas.
   Deux colonnes et une scène plus courte suffisent à le faire tenir sur le premier écran. */
@media (max-width: 560px) {
  .garage .garage-scene { height: min(30vh, 220px); }
  .garage-choix { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .kart-carte { padding: 6px; gap: 2px; grid-template-columns: 1fr; }
  .kart-carte img { aspect-ratio: 1 / 1; grid-row: auto; width: 100%; }
  .kart-carte .kart-nom { font-size: .92rem; }
  .kart-carte .kart-info { font-size: .72rem; line-height: 1.25; }
}
@media (max-width: 700px) {
  header.top { padding: 8px 16px; }
  header.top .brand img { height: 40px; }
  header.top nav { gap: 14px; font-size: .92rem; }
  main { padding: 16px 16px 40px; }
  .heros { min-height: 0; }
  .heros-contenu { padding: 36px 16px; gap: 28px; }
  .circuit { transform: scale(.9); }
  .card { padding: 18px; }
}
/* mouvement réduit : les animations décoratives s'arrêtent */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition: none !important; }
}
@media (max-width: 700px) {
  .chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chiffres b { font-size: 1.4rem; }
  .ecurie { min-height: 300px; }
  .ecurie .numero { font-size: 84px; }
  .ecurie .infos b { font-size: 1.9rem; }
}
/* Tableaux sur petit écran : ils défilent dans leur carte au lieu d'élargir la page (ou d'être
   coupés par le chanfrein de la carte). Mesuré en 390 px : les tableaux du panneau débordaient de 348 px. */
@media (max-width: 860px) {
  main table { display: block; max-width: 100%; overflow-x: auto; }
}
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 18px; height: 18px; padding: 0; box-shadow: none; accent-color: var(--or); }
.adminnav { align-items: center; }
.adminnav button.link { padding: 0; }

/* ---------------------------------------------------------------- paris Lightning (/paris) */
.paris { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 16px; }
.paris .pot { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.paris .pot .montant { font: 600 2.6rem/1 var(--mono); }
.paris .pot .montant small { font-size: .9rem; color: var(--acier); }
.paris-etat { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 6px 0 14px; }
.paris-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.paris-liste li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; background: rgba(255, 255, 255, .03);
                  border: 1px solid var(--trait); }
.paris-liste b { font: 600 .9rem var(--mono); }
.paris-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.paris-form label:not(.radio) { flex: 1 1 160px; }
.paris-form .radio { flex-basis: 100%; }
.paris-cotes td.num, .paris-cotes th:not(:first-child) { text-align: right; }
.ok-txt { color: var(--ok); }
.eclair-txt { color: var(--eclair); }
.badge.pa-ouvert { background: var(--eclair); color: #071114; }
.badge.pa-en_course { background: var(--or); color: #140b00; }
.badge.pa-clos { background: #8a5a00; }
.badge.pa-regle { background: #1e6b34; }
.badge.pa-annule { background: #3a404c; }
