/* kartdelta.app — black, yellow and white like a timing screen and a marshal's board; green and
   purple only where they mean something (a gain, the fastest lap). A timing screen, not a brochure: black ground, white condensed digits, marshal
   flag colours that mean what they mean on the app's board (green gain, red loss, purple best,
   yellow caution/live). Phone first; read in a grandstand in the sun. Driver colours are the
   validated dark categorical palette (slots 1–8), assigned by join order. */
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("/static/fonts/barlow_condensed_semibold.ttf") format("truetype"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("/static/fonts/barlow_condensed_bold.ttf") format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("/static/fonts/barlow_regular.ttf") format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/static/fonts/barlow_semibold.ttf") format("truetype"); }

:root {
  color-scheme: dark;
  --ground: #000;
  --panel: #111214;
  --rule: #26282c;
  --ink: #f4f4f4;
  --ink-2: #a9adb3;
  --ink-3: #6f747b;
  --gain: #00e05a;
  --loss: #ff3b30;
  --best: #c77dff;
  --flag: #ffd60a;
  --s1: #338ced; --s2: #e76624; --s3: #00a888; --s4: #d28e05; --s5: #e24d8b; --s6: #0aac23; --s7: #9887ef; --s8: #eb6263; --s-other: #8a8f96;
  --cond: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; }
a { color: var(--ink); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--flag); outline-offset: 2px; }
.num { font-family: var(--cond); font-variant-numeric: tabular-nums; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px 56px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.brand { font-family: var(--cond); font-weight: 700; font-size: 22px; letter-spacing: .02em; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.mark { width: 28px; height: 25px; flex: none; }
.topnav { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; justify-content: flex-end; }
.topnav a { color: var(--ink-2); text-decoration: none; font-size: 15px; min-height: 40px; display: inline-flex; align-items: center; }
.topnav a.signin { color: var(--flag); border: 1px solid var(--flag); padding: 0 12px; min-height: 34px; font-family: var(--cond); font-weight: 700; font-size: 17px; }
.brand b { color: var(--flag); }
.lang { font-size: 14px; color: var(--ink-2); text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }
h1, h2, h3 { font-family: var(--cond); font-weight: 700; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(34px, 9vw, 56px); }
h2 { font-size: 24px; }
p { margin: 0; color: var(--ink-2); max-width: 64ch; }
.muted { color: var(--ink-3); font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.panel { background: var(--panel); border: 1px solid var(--rule); padding: 16px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 18px; background: var(--flag); color: #000; font-family: var(--cond); font-weight: 700; font-size: 20px; text-decoration: none; border: 0; cursor: pointer; }
.button.secondary, .button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink-3); }
button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 18px; background: var(--flag); color: #000; font-family: var(--cond); font-weight: 700; font-size: 20px; border: 0; cursor: pointer; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink-3); }
button.danger { background: var(--loss); color: #fff; }
button.armed { outline: 3px solid var(--ink); outline-offset: 2px; }
.kicker { font-family: var(--cond); font-weight: 600; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--flag); }
.error { color: #ff8a80; background: #2a0f0d; border-left: 3px solid var(--loss); padding: 10px 12px; }
input { font: inherit; font-size: 20px; color: var(--ink); background: #000; border: 1px solid var(--ink-3); padding: 10px 12px; min-height: 48px; width: 100%; }
input:focus-visible { outline: 2px solid var(--flag); outline-offset: 1px; }
label { font-size: 14px; color: var(--ink-2); }
footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; }
footer a { color: var(--ink-2); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.prose { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.prose h2 { margin-top: 18px; }
.prose li { color: var(--ink-2); margin: 4px 0; }

/* ---------- landing ---------- */
.hero { padding: 36px 0 20px; display: grid; gap: 18px; }
.hero p { font-size: 18px; }
.features { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
.features .panel h3 { font-size: 22px; margin-bottom: 4px; }
@media (min-width: 720px) { .features { grid-template-columns: 1fr 1fr; } }
.hero-chart svg { display: block; width: 100%; height: auto; max-height: 220px; }

/* ---------- spectator ---------- */
.live-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding: 16px 0 8px; }
.live-head h1 { font-size: clamp(30px, 8vw, 44px); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; font-family: var(--cond); font-weight: 700; font-size: 18px; letter-spacing: .04em; }
.chip.live { background: var(--flag); color: #000; }
.chip.red, .chip.live.red { background: var(--loss); color: #fff; }
.chip.live::before { content: ""; width: 8px; height: 8px; background: #000; border-radius: 50%; animation: blink 1.2s steps(2) infinite; }
.chip.lobby { border: 1px solid var(--ink-3); color: var(--ink-2); }
.chip.done { background: var(--ink); color: #000; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .chip.live::before { animation: none; } }
.clock { font-family: var(--cond); font-weight: 700; font-size: 26px; }
.sub { color: var(--ink-2); font-size: 15px; }
.live-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 880px) { .live-grid { grid-template-columns: 1fr 1.1fr; align-items: start; } }
.map { background: var(--panel); border: 1px solid var(--rule); }
.map svg { display: block; width: 100%; height: auto; max-height: 62vh; }
.map .kart { transition: opacity .8s; }
.map .map-note { margin: 0; padding: 6px 10px 8px; font-size: 12px; color: var(--ink-3); }
.order { width: 100%; border-collapse: collapse; }
.order th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 0 6px 6px; }
.order td { padding: 10px 6px; border-top: 1px solid var(--rule); vertical-align: middle; }
.order .pos { font-family: var(--cond); font-weight: 700; font-size: 28px; width: 2.2em; }
.order .who { font-family: var(--cond); font-weight: 600; font-size: 22px; line-height: 1.1; }
.order .who small { display: block; font-family: var(--body); font-size: 13px; color: var(--ink-3); font-weight: 400; }
.order .gap, .order .lap { font-family: var(--cond); font-weight: 600; font-size: 20px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.order .lap small { display: block; font-family: var(--body); font-size: 12px; color: var(--ink-3); font-weight: 400; }
.order tr.stale .who, .order tr.stale .gap { opacity: .5; }
.order .best { color: var(--best); }
.swatch { display: inline-block; width: 10px; height: 22px; vertical-align: middle; margin-right: 8px; }
.empty { padding: 20px 0; color: var(--ink-2); }

/* ---------- results ---------- */
.summary p { color: var(--ink); font-size: 18px; max-width: 70ch; }
.summary p + p { margin-top: 6px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; transition: opacity .15s; }
.chart.focus .line:not(.on), .chart.focus .tag:not(.on), .chart.focus .dot:not(.on) { opacity: .15; }
.chart text { font-family: var(--cond); fill: var(--ink-2); }
.chart .tag { font-family: var(--cond); font-weight: 600; fill: var(--ink); }
.classif tr { cursor: pointer; }
.classif tr:hover td, .classif tr.on td { background: #191a1d; }
.fastest { color: var(--best); }

/* ---------- join ---------- */
.code { font-family: var(--cond); font-weight: 700; font-size: clamp(48px, 16vw, 88px); letter-spacing: .12em; color: var(--flag); }

/* ---------- landing ---------- */
.land-hero { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: center; padding: 28px 0 8px; }
.land-hero-text { display: grid; gap: 16px; }
.land-hero h1 { font-size: clamp(38px, 7.5vw, 66px); text-wrap: balance; max-width: 18ch; }
.land-hero p { font-size: 18px; max-width: 62ch; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.land-block { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: center; padding: 40px 0; border-top: 1px solid var(--rule); }
@media (min-width: 800px) { .land-block { grid-template-columns: 1fr 1fr; gap: 36px; } .land-block.flip > :first-child { order: 2; } }
.land-copy { display: grid; gap: 10px; align-content: start; min-width: 0; }
.land-copy h2 { font-size: clamp(30px, 5vw, 42px); text-wrap: balance; }
.notes { display: grid; gap: 12px; margin: 8px 0 0; }
.notes dt { font-family: var(--cond); font-weight: 700; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.notes dd { margin: 2px 0 0; color: var(--ink-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.g { background: var(--gain); } .dot.y { background: var(--flag); } .dot.w { background: var(--ink); } .dot.p { background: var(--best); }
@media (min-width: 800px) { .land-block.wide { grid-template-columns: 1fr; } }
/* Real screenshots of the app and the site (never imitations: Eric, 2026-12-01). */
.shot { margin: 0; display: grid; gap: 8px; min-width: 0; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 10px; background: #000; }
.shot figcaption { color: var(--ink-2); font-size: 14px; }
.shot.phone { max-width: 340px; margin: 0 auto; }
.shot.phone img { border-radius: 22px; }
.shots-board { display: grid; gap: 14px; max-width: 1100px; width: 100%; margin: 0 auto; }
.shots-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.land-feats { padding: 40px 0; border-top: 1px solid var(--rule); display: grid; gap: 18px; }
.land-feats h2 { font-size: clamp(30px, 5vw, 42px); }
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 24px; }
.feat { border-left: 3px solid var(--flag); padding-left: 12px; display: grid; gap: 4px; }
.feat h3 { font-size: 21px; }
.dir-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--cond); font-size: 22px; }
.dir-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.land-cta { padding: 44px 0 10px; border-top: 1px solid var(--rule); display: grid; gap: 12px; justify-items: start; }
.land-cta h2 { font-size: clamp(30px, 5vw, 44px); }

/* ---------- sign in, account ---------- */
.login { display: grid; gap: 18px; padding: 24px 0; }
.login-doors { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .login-doors { grid-template-columns: 1fr 1fr; } }
.door { display: grid; gap: 10px; align-content: start; }
.door h2 { font-size: 30px; }
.me { padding-top: 20px; }
.me-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.me .panel h2 { margin-bottom: 6px; }
.order .who a { color: var(--ink); text-decoration: none; }
.order .who a:hover { color: var(--flag); }

/* ---------- race director ---------- */
.dir-console { display: grid; gap: 10px; margin-bottom: 14px; }
.dir-clock { font-family: var(--cond); font-weight: 700; font-size: clamp(48px, 14vw, 80px); line-height: 1; color: var(--flag); }
.dir-links { margin-top: 12px; }
.dir-links a { color: var(--ink-2); }

/* The map alone, inside the app's race room screen (?embed=1). */
body.embed { background: var(--panel); }
body.embed .wrap { max-width: none; padding: 0; }
body.embed .live-head, body.embed #order, body.embed #results, body.embed .map-note { display: none; }
body.embed .live-grid { display: block; }
body.embed .map { border: 0; }
/* Sized from the frame, not the window: a web view sized by its content reports no window height. */
html.embed, body.embed, body.embed .wrap, body.embed main, body.embed #live, body.embed .map { height: 100%; }
body.embed .map svg { height: 100%; max-height: none; margin: 0 auto; }
.dir-map iframe { display: block; width: 100%; height: min(62vw, 340px); border: 1px solid var(--rule); background: var(--panel); margin: 14px 0; }
.door form { display: grid; gap: 10px; align-content: start; }
.door details { border-top: 1px solid var(--rule); padding-top: 10px; }
.door details summary { cursor: pointer; color: var(--ink-2); }
.door details form { margin-top: 10px; }
/* League classes: a small chip with the place in the class. */
.cls { display: inline-block; font: 700 12px/1 var(--cond); letter-spacing: .04em; text-transform: uppercase; padding: 3px 5px 2px; border: 1px solid currentColor; margin-left: 6px; vertical-align: 2px; white-space: nowrap; }
.cls1 { color: #ffd60a; } .cls2 { color: #7cc8ff; } .cls3 { color: #c77dff; } .cls4 { color: #00e05a; }
.cls5 { color: #ff9f43; } .cls6 { color: #ff6b9a; } .cls7 { color: #c8c8c8; } .cls8 { color: #ffffff; }
