/* HYPER RED — hr.css
   Identity: daylight pit wall. Concrete surfaces, navy ink, one red,
   and the endurance class colours used as information, never decoration.
   Type: Archivo variable. Expanded italic for livery headlines, normal
   width for everything people read. */

@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-latin-wdth-italic.woff2") format("woff2-variations");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: italic; font-display: swap;
}

:root {
  color-scheme: dark;
  /* night pit wall: deep blue-slate, never pure black */
  --slate: #10151D;       /* page */
  --slate-2: #161C25;     /* alternate bands */
  --line: #2A3340;
  --line-strong: #6B7789;
  --ink: #EDF0F4;         /* primary text */
  --graphite: #9DA7B4;    /* secondary text */
  --red: #D8261C;
  --red-deep: #FF6A5F;    /* red used as text on dark */
  --good: #4CC47F;

  /* semantic surfaces */
  --bg: var(--slate);
  --bg-alt: var(--slate-2);
  --card: #1C2330;
  --chip: #252E3B;
  --inv-bg: #EDF0F4;      /* selected states */
  --inv-fg: #10151D;
  --head-bg: #0A0E14;     /* timing-tower heads, footer, toasts */
  --head-fg: #EDF0F4;

  /* class system: ACO/FIA number-panel colours */
  --c-hypercar: #DA291C;   /* Pantone 485 red */
  --c-lmp2: #1F5FD6;       /* blue (WEC and ELMS LMP2) */
  --c-lmp3: #7B3FC4;       /* purple */
  --c-lmgt3: #15803F;      /* green */
  --c-gte: #D4A72C;        /* gold */

  --font: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.6875rem;
  --step-3: 2.125rem;
  --step-4: clamp(2.25rem, 4.6vw, 3.25rem);
  --display: clamp(3.4rem, 10.5vw, 10rem);

  --gutter: clamp(1.1rem, 4vw, 3rem);
  --measure: 68ch;
  --wide: 1320px;
  --r-plate: 4px;
  --r-panel: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--step-0); line-height: 1.5;
  font-stretch: 100%; font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--red-deep); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--inv-bg); color: var(--inv-fg); padding: .6rem 1rem; border-radius: 6px; }
.skip:focus { top: 1rem; }

.wrap { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- type ---------- */
.livery {
  font-style: italic; font-stretch: 125%; font-weight: 860;
  text-transform: uppercase; letter-spacing: -0.02em; line-height: .86;
}
h1, h2, h3 { margin: 0; line-height: 1.1; text-wrap: balance; }
.section-title { font-size: var(--step-4); font-weight: 780; font-stretch: 112%; letter-spacing: -0.015em; }
.lede { color: var(--graphite); max-width: 56ch; margin: .6rem 0 0; }
.small { font-size: var(--step--1); }
.muted { color: var(--graphite); }
p { max-width: var(--measure); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.9rem; padding: .7rem 1.25rem; border-radius: 999px;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font-weight: 650; font-stretch: 105%; text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--inv-bg); border-color: var(--inv-bg); color: var(--inv-fg); }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: #B81D14; border-color: #B81D14; color: #fff; }
.btn-quiet { border-color: transparent; padding-inline: .8rem; text-decoration: underline; text-underline-offset: .2em; }
.btn-quiet:hover { background: transparent; color: var(--red-deep); }
.btn-sm { min-height: 2.25rem; padding: .35rem .9rem; font-size: var(--step--1); }
.btn-danger { border-color: var(--red-deep); color: var(--red-deep); }
.btn-danger:hover { background: #B81D14; border-color: #B81D14; color: #fff; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; }

/* ---------- class plates ---------- */
.plate {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .18em .55em .16em; border-radius: var(--r-plate);
  background: var(--plate, var(--ink)); color: #fff;
  font-size: var(--step--1); font-weight: 720; font-stretch: 110%; line-height: 1.3; white-space: nowrap;
}
[data-class="hypercar"] { --plate: var(--c-hypercar); }
[data-class="wec-lmp2"], [data-class="elms-lmp2"], [data-class="lmp2"] { --plate: var(--c-lmp2); }
[data-class="lmp3"] { --plate: var(--c-lmp3); }
[data-class="lmgt3"], [data-class="gt3"] { --plate: var(--c-lmgt3); }
[data-class="lmgte"], [data-class="gte"], [data-class="lmgte-am"], [data-class="lmgte-pro"] { --plate: var(--c-gte); --plate-fg: #1A1405; }
.plate { color: var(--plate-fg, #fff); }
.plates { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.is-stuck { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; margin-right: auto; }
.brand img { width: 2.25rem; height: auto; }
.brand span { font-style: italic; font-stretch: 125%; font-weight: 850; font-size: 1.15rem; letter-spacing: -.01em; }
.nav { display: flex; gap: .25rem; }
.nav a { text-decoration: none; font-weight: 600; padding: .45rem .75rem; border-radius: 999px; }
.nav a:hover { background: var(--chip); color: var(--ink); }
.link-state { display: inline-flex; align-items: center; gap: .45rem; font-size: var(--step--1); color: var(--graphite); }
.link-state::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--line-strong); }
.link-state[data-state="live"]::before { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); }
.link-state[data-state="offline"]::before { background: var(--red); }
@media (max-width: 760px) { .nav { display: none; } }

/* ---------- hero ---------- */
.hero { padding-block: clamp(1.5rem, 4vw, 3.5rem) clamp(2.5rem, 6vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: end; }
.hero-week { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--graphite); margin: 0 0 1rem; }
.hero-week .flag-dot { margin: 0; vertical-align: 0; }
.hero-week strong { color: var(--ink); }
.hero-title { font-size: var(--display); margin: 0 0 1.25rem; }
.hero-title .h-dur { display: block; font-size: .42em; letter-spacing: -.01em; color: var(--red); margin-bottom: .08em; }
.hero-where { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 1.75rem; color: var(--graphite); }
.clock { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem 1.25rem; margin-bottom: 1.75rem; }
.clock-label { width: 100%; font-weight: 600; color: var(--graphite); }
.clock-seg { display: inline-flex; align-items: baseline; gap: .2rem; }
.clock-seg b { font-style: italic; font-stretch: 125%; font-weight: 820; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -.02em; }
.clock-seg i { font-style: normal; font-weight: 600; color: var(--graphite); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

.onboard { margin: 0; position: relative; border-radius: var(--r-panel); overflow: hidden; background: var(--ink); aspect-ratio: 4 / 5; }
.onboard video, .onboard img { width: 100%; height: 100%; object-fit: cover; }
.onboard-caption { position: absolute; left: .75rem; right: .75rem; bottom: .75rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; color: #fff; font-size: var(--step--1); font-weight: 600; }
.onboard-caption span { background: rgb(10 14 20 / .75); padding: .3rem .6rem; border-radius: 999px; }
.onboard-toggle { background: rgb(10 14 20 / .75); color: #fff; border: 0; border-radius: 999px; padding: .35rem .8rem; cursor: pointer; font-weight: 650; }
.onboard-toggle:focus-visible { outline-color: #fff; }


@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .onboard { aspect-ratio: 16 / 10; }
    }

/* ---------- sections ---------- */
.band { padding-block: clamp(3rem, 7vw, 5.5rem); border-top: 1px solid var(--line); }
.band-sheet { background: var(--bg-alt); }
.band-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 2rem; }

/* ---------- entry form ---------- */
.enter-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
@media (max-width: 900px) { .enter-grid { grid-template-columns: 1fr; } }
.form { display: grid; gap: 1.75rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .label { font-weight: 700; margin-bottom: .55rem; padding: 0; display: block; }
.hint { font-size: var(--step--1); color: var(--graphite); margin: .35rem 0 0; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .fields { grid-template-columns: 1fr; } }
.input, select.input {
  width: 100%; min-height: 3rem; padding: .65rem .85rem; border-radius: 8px;
  border: 1.5px solid var(--line-strong); background: var(--card); color: var(--ink);
}
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 18%, transparent); }
.input[aria-invalid="true"] { border-color: var(--red-deep); }
.error { color: var(--red-deep); font-size: var(--step--1); font-weight: 600; margin: .35rem 0 0; min-height: 0; }
.error:empty { display: none; }

.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: inline-flex; flex-direction: column; justify-content: center; min-height: 3rem; padding: .5rem 1rem;
  border: 1.5px solid var(--line-strong); border-radius: 8px; background: var(--card); font-weight: 650; cursor: pointer;
  transition: border-color .12s, background-color .12s;
}
.choice span small { font-weight: 500; color: var(--graphite); font-size: var(--step--1); }
.choice input:hover + span { border-color: var(--ink); }
.choice input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.choice input:checked + span { background: var(--inv-bg); border-color: var(--inv-bg); color: var(--inv-fg); }
.choice input:checked + span small { color: color-mix(in srgb, var(--inv-fg) 75%, transparent); }
.choice[data-class] input:checked + span { background: var(--plate); border-color: var(--plate); color: #fff; }
.choice[data-class] input:checked + span { color: var(--plate-fg, #fff); }
.choice[data-class] span { border-left: 6px solid var(--plate); }
.choice input:disabled + span { opacity: .5; cursor: not-allowed; background: transparent; }
.choice[data-state="notrun"] span, .choice[data-state="started"] span { border-style: dashed; }
.choice input:disabled { cursor: not-allowed; }
.toggle-line { display: flex; align-items: center; gap: .55rem; font-weight: 600; cursor: pointer; }
.toggle-line input { width: 1.15rem; height: 1.15rem; accent-color: var(--ink); }
.recall { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .75rem 1rem; border-radius: 10px; background: var(--chip); }
.recall p { margin: 0; }
.agree { font-size: var(--step--1); color: var(--graphite); margin: 0; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* the entry card: a car door number panel */
.door { position: sticky; top: 5.5rem; }
.door-panel {
  position: relative; background: var(--card); border-radius: var(--r-panel); overflow: hidden;
  border: 1.5px solid var(--line); min-height: 15rem;
}
.door-panel:not([data-class]) { --plate: var(--line-strong); }
.door-stripe { height: .9rem; background: var(--plate); transition: background-color .2s; }
.door-body { padding: 1.25rem 1.4rem 1.4rem; display: grid; gap: 1rem; }
.door-name { font-size: clamp(1.8rem, 3.2vw, 2.6rem); overflow-wrap: anywhere; min-height: 1em; }
.door-name.is-empty { color: #3A4556; }
.door-meta { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: .2rem 1.75rem; margin: 0; }
.door-meta dt { font-size: var(--step--1); color: var(--graphite); }
.door-meta dd { margin: 0; font-weight: 700; }
.door-event { font-weight: 650; }
.door-note { font-size: var(--step--1); color: var(--graphite); margin: .8rem 0 0; }

.closed-note { background: var(--card); border-radius: var(--r-panel); padding: clamp(1.25rem, 3vw, 2rem); border: 1.5px solid var(--line); }
.closed-note h3 { font-size: var(--step-2); font-weight: 760; font-stretch: 110%; margin-bottom: .4rem; }

.confirmed { background: var(--head-bg); color: var(--head-fg); border-radius: var(--r-panel); padding: clamp(1.4rem, 3vw, 2.2rem); }
.confirmed h3 { font-size: var(--step-3); margin: .4rem 0 .6rem; }
.confirmed .muted { color: color-mix(in srgb, var(--head-fg) 72%, transparent); }
.confirmed .btn { border-color: var(--head-fg); color: var(--head-fg); }
.confirmed .btn:hover { background: var(--head-fg); color: var(--head-bg); }
.confirmed .btn-red { border-color: var(--red); background: var(--red); color: #fff; }
.confirmed .actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }

/* ---------- my entries ---------- */
.mine { margin-top: clamp(2.5rem, 5vw, 4rem); }
.mine h3 { font-size: var(--step-2); font-weight: 760; font-stretch: 110%; margin-bottom: 1rem; }
.mine-list { display: grid; gap: .75rem; }
.mine-item { background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; }
.mine-item.is-next { border-color: var(--ink); }
.mine-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; }
.mine-row strong { font-size: var(--step-1); font-weight: 720; margin-right: auto; }
.mine-when { font-weight: 650; }
.mine-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.mine-edit { margin-top: 1rem; display: grid; gap: 1rem; }
.mine-edit .fields { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) { .mine-edit .fields { grid-template-columns: 1fr; } }
.tag { font-size: var(--step--1); font-weight: 650; padding: .15rem .5rem; border-radius: 999px; background: var(--chip); }

/* ---------- grid (timing tower) ---------- */
.grid-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-bottom: 1.5rem; }
.daytabs { display: inline-flex; background: var(--chip); border-radius: 999px; padding: .25rem; }
.daytabs button { border: 0; background: transparent; padding: .5rem 1rem; border-radius: 999px; font-weight: 650; cursor: pointer; }
.daytabs button[aria-selected="true"] { background: var(--inv-bg); color: var(--inv-fg); }
.daytabs button small { font-weight: 500; opacity: .75; margin-left: .25rem; }
.filter { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
.filter button { border: 1.5px solid var(--line-strong); background: transparent; border-radius: 999px; padding: .3rem .75rem; font-size: var(--step--1); font-weight: 650; cursor: pointer; }
.filter button[aria-pressed="true"] { background: var(--plate, var(--inv-bg)); border-color: var(--plate, var(--inv-bg)); color: #fff; }
.filter button[data-class][aria-pressed="true"] { color: var(--plate-fg, #fff); }
.grid-tools .spacer { margin-left: auto; display: flex; gap: .4rem; }

.session-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; margin-bottom: 1rem; }
.session-head h3 { font-size: var(--step-2); font-weight: 760; font-stretch: 110%; }
.towers { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1rem; align-items: start; }
.tower { background: var(--card); border-radius: 10px; border: 1.5px solid var(--line); overflow: hidden; }
.tower-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding: .7rem .9rem; background: var(--head-bg); color: var(--head-fg); }
.tower-head b { font-style: italic; font-stretch: 125%; font-weight: 820; font-size: 1.5rem; line-height: 1; }
.tower-head span { font-size: var(--step--1); opacity: .8; }
.tower ol { list-style: none; margin: 0; padding: .3rem 0; counter-reset: pos; }
.tower li { counter-increment: pos; display: grid; grid-template-columns: 1.8rem 3.4rem 1fr; align-items: center; gap: .5rem; padding: .38rem .9rem; border-top: 1px solid var(--chip); }
.tower li:first-child { border-top: 0; }
.tower li::before { content: counter(pos); font-weight: 700; color: var(--graphite); font-size: var(--step--1); text-align: right; }
.tower li .plate { justify-content: center; padding-inline: .3em; font-size: .72rem; }
.tower li .who { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tower li.is-you .who::after { content: "You"; margin-left: .45rem; font-size: .7rem; font-weight: 700; background: var(--chip); padding: .05rem .4rem; border-radius: 999px; }
.tower-empty { padding: .9rem; color: var(--graphite); font-size: var(--step--1); margin: 0; }
.empty { background: var(--card); border: 1.5px dashed var(--line-strong); border-radius: var(--r-panel); padding: 2rem; text-align: left; }
.empty h3 { font-size: var(--step-1); margin-bottom: .3rem; }
.empty p { margin: 0 0 1rem; color: var(--graphite); }

/* ---------- season ---------- */
.season-progress { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.season-bar { flex: 1; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; max-width: 28rem; }
.season-bar i { display: block; height: 100%; width: 0; background: var(--ink); }
.season-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.race { display: grid; grid-template-columns: 7.5rem 5.5rem minmax(0, 1fr) auto; gap: 1rem 1.5rem; align-items: center; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.race-date { font-weight: 700; line-height: 1.25; }
.race-date small { display: block; font-weight: 500; color: var(--graphite); }
.trk { width: 5.5rem; height: 3.6rem; color: var(--ink); }
.trk svg { width: 100%; height: 100%; }
.trk path { stroke: currentColor !important; stroke-width: 2.4px !important; vector-effect: non-scaling-stroke; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.trk text { fill: currentColor; }
.race-name { font-size: var(--step-2); font-weight: 780; font-stretch: 112%; letter-spacing: -.01em; }
.race-where { color: var(--graphite); margin: .1rem 0 .5rem; }
.race-sessions { font-size: var(--step--1); color: var(--graphite); margin: .5rem 0 0; }
.race-status { font-weight: 700; font-size: var(--step--1); text-align: right; white-space: nowrap; }
.race[data-state="done"] .race-status { color: var(--good); }
.race[data-state="done"] .race-name, .race[data-state="past"] .race-name { color: var(--graphite); }
.race[data-state="done"] .trk, .race[data-state="past"] .trk { color: var(--line-strong); }
.race[data-state="next"] { background: var(--card); margin-inline: calc(var(--gutter) * -0.5); padding-inline: calc(var(--gutter) * 0.5); border-radius: 10px; border-bottom-color: transparent; }
.race[data-state="next"] .race-status { color: var(--red-deep); }
.race[data-highlight] .race-name { color: var(--red-deep); }
.race-results { grid-column: 3 / -1; }
.race-results summary { cursor: pointer; font-weight: 650; }
.results { width: 100%; border-collapse: collapse; margin-top: .6rem; font-size: var(--step--1); }
.results th { text-align: left; font-weight: 650; color: var(--graphite); padding: .35rem .5rem; border-bottom: 1px solid var(--line); }
.results td { padding: .4rem .5rem; border-bottom: 1px solid var(--chip); vertical-align: top; }
.results td:first-child { font-weight: 800; font-style: italic; font-stretch: 120%; }
@media (max-width: 760px) {
  .race { grid-template-columns: 4.5rem minmax(0, 1fr); }
  .race .trk { grid-row: span 2; width: 4.5rem; order: -1; }
  .race-date { grid-column: 2; }
  .race-status { text-align: left; grid-column: 2; }
  .race-results { grid-column: 1 / -1; }
}

/* ---------- footer ---------- */
.site-footer { padding-block: 3rem 4rem; background: var(--head-bg); color: color-mix(in srgb, var(--head-fg) 78%, transparent); font-size: var(--step--1); }
.site-footer a { color: var(--head-fg); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2rem; }
.foot-grid p { margin: 0 0 .8rem; max-width: 60ch; }
.foot-links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; list-style: none; padding: 0; margin: 0; align-content: start; }
.foot-links button { background: none; border: 0; padding: 0; color: var(--head-fg); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; font-size: inherit; }
.foot-brand { display: flex; align-items: center; gap: .55rem; color: var(--head-fg); font-style: italic; font-stretch: 125%; font-weight: 850; font-size: 1.4rem; margin-bottom: .8rem; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- dialogs / toasts / cookie ---------- */
dialog { border: 0; border-radius: var(--r-panel); padding: 0; max-width: min(34rem, calc(100vw - 2rem)); width: 100%; color: var(--ink); background: var(--card); }
dialog::backdrop { background: rgb(5 8 12 / .7); }
.dlg { padding: 1.5rem; display: grid; gap: 1rem; }
.dlg h2 { font-size: var(--step-2); font-weight: 760; font-stretch: 110%; }
.dlg p { margin: 0; }
.dlg-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; }
.toasts { position: fixed; z-index: 90; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; max-width: min(26rem, calc(100vw - 2rem)); }
.toast { background: var(--head-bg); color: var(--head-fg); padding: .8rem 1rem; border-radius: 10px; font-weight: 550; border-left: 5px solid var(--line-strong); }
.toast[data-kind="error"] { border-left-color: var(--red); }
.toast[data-kind="success"] { border-left-color: var(--good); }
.hr-cookie-banner { position: fixed; z-index: 80; left: 1rem; bottom: 1rem; max-width: 30rem; background: var(--card); border: 1.5px solid var(--line-strong); border-radius: var(--r-panel); padding: 1rem 1.1rem; font-size: var(--step--1); }
.hr-cookie-text { margin: 0 0 .8rem; }
.hr-cookie-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.hr-cookie-banner .btn-primary { background: var(--inv-bg); color: var(--inv-fg); border-color: var(--inv-bg); }
.hr-cookie-banner .btn-secondary, .hr-cookie-banner .btn-primary { display: inline-flex; min-height: 2.25rem; padding: .35rem .9rem; border-radius: 999px; border: 1.5px solid var(--ink); color: var(--ink); font-weight: 650; cursor: pointer; background: transparent; }
.hr-cookie-banner .btn-primary { background: var(--inv-bg); color: var(--inv-fg); border-color: var(--inv-bg); }

/* ---------- plain pages (legal, faq, 404) ---------- */
.page { padding-block: clamp(2.5rem, 6vw, 5rem); }
.page h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); margin-bottom: .6rem; }
.page .updated { color: var(--graphite); margin: 0 0 2.5rem; }
.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--step-2); font-weight: 760; font-stretch: 110%; margin: 2.4rem 0 .6rem; }
.prose h3 { font-size: var(--step-1); font-weight: 700; margin: 1.6rem 0 .4rem; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin-bottom: .35rem; }
.faq details { border-top: 1px solid var(--line); padding: 1rem 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; font-size: var(--step-1); }
.faq details p { margin: .6rem 0 0; }

/* ---------- Race Command (admin) ---------- */
.admin-top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 2rem; }
.stats div { background: var(--card); padding: 1rem; }
.stats dt { font-size: var(--step--1); color: var(--graphite); }
.stats dd { margin: .2rem 0 0; font-weight: 760; font-size: var(--step-1); }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.admin-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
@media (max-width: 1000px) { .admin-cols { grid-template-columns: 1fr; } }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.toolbar .input { width: auto; min-height: 2.5rem; padding: .4rem .7rem; }
.toolbar .grow { flex: 1 1 12rem; }
.table-scroll { overflow-x: auto; background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; }
.table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.table th { text-align: left; padding: .6rem .7rem; color: var(--graphite); font-weight: 650; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .55rem .7rem; border-bottom: 1px solid var(--chip); vertical-align: middle; }
.table td.acts { white-space: nowrap; text-align: right; }
.table td.acts .btn { min-height: 2rem; padding: .2rem .7rem; }
.side-panel { background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: 1.1rem; margin-bottom: 1rem; }
.side-panel h3 { font-size: var(--step-1); font-weight: 720; margin-bottom: .6rem; }
.feed { list-style: none; margin: 0; padding: 0; font-size: var(--step--1); }
.feed li { padding: .45rem 0; border-top: 1px solid var(--chip); }
.feed li:first-child { border-top: 0; }
.feed b { display: block; }
.danger-zone { border-color: var(--red-deep); }
.result-edit { display: grid; gap: .4rem; margin-top: .8rem; }
.result-edit-row { display: grid; grid-template-columns: 3.5rem 3.5rem 8rem 1fr 1fr 1fr auto; gap: .35rem; }
.result-edit-row .input { min-height: 2.3rem; padding: .3rem .5rem; font-size: var(--step--1); }
@media (max-width: 900px) { .result-edit-row { grid-template-columns: 1fr 1fr; } }
.signin { max-width: 26rem; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-panel); padding: 1.5rem; display: grid; gap: 1rem; }
.page h1 { font-weight: 780; font-stretch: 112%; letter-spacing: -0.015em; }
.page h1.livery { font-weight: 860; font-stretch: 125%; }
.filter button[data-class] { border-left: 5px solid var(--plate); }

.trk[data-circuit="tba"] path { stroke-dasharray: 6 7; }
.admin-page .lede { margin-bottom: 2rem; }
.admin-page .section-title { font-size: var(--step-3); margin-bottom: 1rem; }
#seasonAdminTitle { margin-top: 3rem; }
@media (max-width: 900px) { .door { display: none; } }
@media (max-width: 600px) {
  .clock { gap: .25rem .9rem; }
  .clock-seg b { font-size: 2rem; }
  .hr-cookie-banner { right: 1rem; max-width: none; }
  .onboard { aspect-ratio: 16 / 11; }
}
@media (max-width: 420px) { .clock-seg:last-child { display: none; } }
.foot-brand img { width: 1.9rem; height: auto; }

/* ================= motorsport layer ================= */
/* flags: green open, yellow closing, red racing, chequered finished */
:root { --flag-open: #2FBF63; --flag-closing: #F5C518; --flag-live: #E5322D; }
.flag-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .4rem; vertical-align: -.05em; background: var(--line-strong); flex: none; }
.flag-dot[data-status="open"] { background: var(--flag-open); }
.flag-dot[data-status="closing"] { background: var(--flag-closing); }
.flag-dot[data-status="live"] { background: var(--flag-live); animation: pulse 1.6s ease-in-out infinite; }
.flag-dot[data-status="done"] { background: conic-gradient(#fff 0 25%, #111 0 50%, #fff 0 75%, #111 0) 0 0 / .35rem .35rem; }
@keyframes pulse { 50% { opacity: .35; } }

/* hero circuit card */
.hero-facts { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1.25rem; align-items: center; margin: -0.5rem 0 1.75rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); max-width: 40rem; }
.hero-facts:empty { display: none; }
.trk-hero { width: 6.5rem; height: 4.5rem; grid-row: span 2; color: var(--ink); }
.facts { display: flex; flex-wrap: wrap; gap: .3rem 1.6rem; margin: 0; }
.facts dt { font-size: var(--step--1); color: var(--graphite); }
.facts dd { margin: 0; font-weight: 700; }
.facts dd .muted { font-weight: 500; font-size: var(--step--1); }
.facts-note { margin: 0; font-size: var(--step--1); color: var(--graphite); grid-column: 2; }
@media (max-width: 600px) { .hero-facts { grid-template-columns: 1fr; } .trk-hero { grid-row: auto; } .facts-note { grid-column: 1; } }

/* weekend timeline */
.weekend { margin-top: clamp(2rem, 4vw, 3rem); border-top: 2px solid var(--ink); padding-top: 1rem; }
.tl-head, .tl-row { display: grid; grid-template-columns: 14rem 1fr; gap: 1rem; align-items: start; }
.tl-title { font-weight: 700; }
.tl-axis { position: relative; height: 1.2rem; font-size: .72rem; color: var(--graphite); }
.tl-axis span { position: absolute; transform: translateX(-50%); }
.tl-axis span:first-child { transform: none; }
.tl-axis span:last-child { transform: translateX(-100%); }
.tl-row { padding: .7rem 0; border-top: 1px solid var(--line); }
.tl-day { display: grid; line-height: 1.3; }
.tl-day span { font-weight: 650; }
.tl-day small { color: var(--graphite); font-size: var(--step--1); }
.tl-track { position: relative; background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 25%); border-radius: 4px; }
.tl-track ol { list-style: none; margin: 0; padding: 0; }
.tl-block { position: absolute; height: 1.85rem; display: flex; align-items: center; padding: 0 .45rem; overflow: hidden; white-space: nowrap;
  background: var(--card); border: 1px solid var(--line-strong); border-left: 4px solid var(--line-strong); border-radius: 4px; font-size: var(--step--1); font-weight: 700; }
.tl-block[data-status="open"] { border-left-color: var(--flag-open); }
.tl-block[data-status="closing"] { border-left-color: var(--flag-closing); }
.tl-block[data-status="live"] { border-left-color: var(--flag-live); background: color-mix(in srgb, var(--flag-live) 16%, var(--card)); }
.tl-block[data-status="done"] { opacity: .5; }
.tl-block.tl-cont { border-right: 2px dashed var(--line-strong); }
.tl-row[data-kind="test"] .tl-block { border-style: dashed; border-left-style: solid; }
.tl-now { position: absolute; top: -.3rem; bottom: -.3rem; width: 2px; background: var(--flag-live); }
.tl-now::before { content: "Now"; position: absolute; top: -1.1rem; left: 50%; transform: translateX(-50%); font-size: .68rem; font-weight: 700; color: var(--red-deep); font-style: normal; }
.tl-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; font-size: var(--step--1); margin: .9rem 0 0; max-width: none; }
.tl-legend .lg { white-space: nowrap; display: inline-flex; align-items: center; }
@media (max-width: 760px) {
  .tl-head, .tl-row { grid-template-columns: 1fr; gap: .5rem; }
  .tl-title { display: none; }
  .tl-head { grid-template-columns: 1fr; }
}

/* race control bar */
.rc { border-top: 1px solid var(--line); background: var(--head-bg); }
.rc-inner { display: flex; align-items: center; gap: .5rem 1.25rem; min-height: 3rem; font-size: var(--step--1); }
.rc-event { font-style: italic; font-stretch: 120%; font-weight: 820; text-transform: uppercase; letter-spacing: -.01em; font-size: .95rem; }
.rc-next { color: var(--graphite); margin-left: auto; }
.rc-clock { font-weight: 800; font-size: 1.05rem; font-style: italic; font-stretch: 115%; min-width: 7.5ch; }
.rc .btn { min-height: 2rem; }
@media (max-width: 600px) { .rc-event { display: none; } .rc-next { margin-left: 0; } .rc .btn { margin-left: auto; } }

/* timing towers: status + class mix */
.tower { border-top: 4px solid var(--line-strong); }
.tower[data-status="open"] { border-top-color: var(--flag-open); }
.tower[data-status="closing"] { border-top-color: var(--flag-closing); }
.tower[data-status="live"] { border-top-color: var(--flag-live); }
.tower[data-status="done"] { border-top-color: var(--line-strong); }
.tower[data-status="done"] .tower-head { opacity: .7; }
.tower-status { display: flex; align-items: center; padding: .45rem .9rem; font-size: var(--step--1); font-weight: 650; border-bottom: 1px solid var(--chip); }
.tower-count { margin-left: auto; color: var(--graphite); font-weight: 600; }
.mix { display: flex; height: 5px; gap: 2px; }
.mix i { flex: 1 1 0; background: var(--plate); min-width: 4px; }
.mix-lg { height: 10px; border-radius: 3px; overflow: hidden; }
.grid-mix { margin-bottom: 1.75rem; }
.mix-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; padding: 0; margin: .6rem 0 0; font-size: var(--step--1); }
.mix-legend b { margin-left: .2rem; }
.race-facts { margin-left: .75rem; padding-left: .75rem; border-left: 1px solid var(--line); }

/* class guide under each class choice */
#classChoices .choice span { max-width: 17rem; }
#classChoices .choice small { white-space: normal; line-height: 1.35; margin-top: .15rem; }
.rc-next, .rc-clock { white-space: nowrap; }
@media (max-width: 600px) {
  .rc-pre { display: none; }
  .rc-clock { font-size: .95rem; min-width: 0; }
  .tl-block { padding: 0 .2rem; font-size: .66rem; border-left-width: 3px; }
}

/* ================= season editor ================= */
.season-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin: -0.5rem 0 1.25rem; }
.source-note { margin: 0; font-size: var(--step--1); color: var(--graphite); display: flex; align-items: center; gap: .5rem; }
dialog.dlg-wide { max-width: min(54rem, calc(100vw - 2rem)); }
dialog.dlg-wide .fields { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { dialog.dlg-wide .fields { grid-template-columns: 1fr; } }
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.checks label { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; cursor: pointer; }
.checks input { width: 1.05rem; height: 1.05rem; accent-color: var(--ink); }
.sessions-edit { display: grid; gap: .75rem; margin: .75rem 0; }
.session-card { border: 1px solid var(--line); border-radius: 10px; padding: .9rem; display: grid; gap: .7rem; background: var(--bg-alt); }
.session-card .fields { grid-template-columns: 7rem 1fr 6rem !important; }
@media (max-width: 760px) { .session-card .fields { grid-template-columns: 1fr !important; } }
.session-card .row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; }
.session-card .row > b { font-size: var(--step--1); min-width: 4.5rem; }
.dlg-actions .spacer-auto { flex: 1; }
.race .row-actions { display: flex; gap: .35rem; }
.session-card .row .input { width: auto; flex: 1 1 12rem; min-height: 2.5rem; padding: .4rem .7rem; }

/* ================= intro: night start ================= */
/* ~3 s, once per browser session (js/intro.js). Pure CSS timing, so the
   overlay still clears itself if the script never runs. */
.intro {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: #0A0E14; overflow: hidden; color: #EDF0F4;
  animation: intro-out .7s cubic-bezier(.7, 0, .2, 1) 2.55s forwards;
}
html.intro-on { overflow: hidden; }
html.intro-done .intro, html.intro-done .intro-skip { display: none; }
.intro-stage { position: relative; display: grid; justify-items: center; gap: 1.1rem; }

/* light streak: a car passing in the dark */
.intro-streak {
  position: absolute; top: 50%; left: -55%; width: 55%; height: 4px; transform: translateY(-50%); border-radius: 4px;
  background: linear-gradient(90deg, transparent, rgb(218 41 28 / .35) 35%, rgb(255 255 255 / .75) 80%, #fff 96%, #fff);
  box-shadow: 0 0 22px 6px rgb(218 41 28 / .6), 0 0 60px 18px rgb(218 41 28 / .25);
  animation: intro-streak .75s cubic-bezier(.5, 0, .2, 1) .1s forwards;
}
.intro-streak.b { top: calc(50% + 18px); height: 2px; opacity: .55; animation-delay: .2s; }

.intro-star {
  width: clamp(5rem, 14vw, 8.5rem); height: auto; opacity: 0; transform: scale(.55) rotate(-18deg);
  filter: blur(6px) drop-shadow(0 0 0 rgb(218 41 28 / 0));
  animation: intro-star .75s cubic-bezier(.2, .9, .2, 1.15) .55s forwards, intro-glow 1.2s ease-in-out 1.2s forwards;
}
.intro-word {
  margin: 0; font-size: clamp(3rem, 11vw, 8rem); line-height: .9;
  clip-path: inset(0 100% 0 0); transform: skewX(-8deg) translateX(-.3em);
  animation: intro-wipe .6s cubic-bezier(.7, 0, .2, 1) 1s forwards;
}
.intro-stripe { display: flex; gap: .35rem; width: clamp(14rem, 44vw, 34rem); height: .45rem; }
.intro-stripe i { flex: 1; background: var(--plate); transform: scaleX(0); transform-origin: left; border-radius: 2px;
  animation: intro-bar .35s cubic-bezier(.3, 0, .2, 1) forwards; }
.intro-stripe i:nth-child(1) { animation-delay: 1.45s; }
.intro-stripe i:nth-child(2) { animation-delay: 1.52s; }
.intro-stripe i:nth-child(3) { animation-delay: 1.59s; }
.intro-stripe i:nth-child(4) { animation-delay: 1.66s; }
.intro-stripe i:nth-child(5) { animation-delay: 1.73s; }
.intro-tag { margin: 0; font-weight: 650; letter-spacing: .02em; color: #9DA7B4; opacity: 0; transform: translateY(.4rem);
  animation: intro-fade .45s ease-out 1.85s forwards; }

/* the reveal: overlay lifts away on a red leading edge */
.intro::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--red);
  box-shadow: 0 0 24px 6px rgb(218 41 28 / .6); opacity: 0; animation: intro-fade .1s linear 2.5s forwards; }

.intro-skip {
  position: fixed; z-index: 201; right: 1.25rem; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  background: rgb(255 255 255 / .08); color: #EDF0F4; border: 1px solid rgb(255 255 255 / .25); border-radius: 999px;
  padding: .45rem 1rem; font-weight: 650; font-size: var(--step--1); cursor: pointer;
  animation: intro-fade .3s ease-out .3s both, intro-hide .01s linear 3.2s forwards;
}
.intro-skip:hover { background: rgb(255 255 255 / .16); }
.intro-skip:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

@keyframes intro-streak { to { left: 110%; } }
@keyframes intro-star { to { opacity: 1; transform: none; filter: blur(0) drop-shadow(0 0 0 rgb(218 41 28 / 0)); } }
@keyframes intro-glow { 40% { filter: drop-shadow(0 0 28px rgb(218 41 28 / .85)); } to { filter: drop-shadow(0 0 10px rgb(218 41 28 / .35)); } }
@keyframes intro-wipe { to { clip-path: inset(0 0 0 0); transform: skewX(0) translateX(0); } }
@keyframes intro-bar { to { transform: scaleX(1); } }
@keyframes intro-fade { to { opacity: 1; transform: none; } }
@keyframes intro-hide { to { visibility: hidden; } }
@keyframes intro-out { to { clip-path: inset(0 0 100% 0); visibility: hidden; } }

/* skipped or reduced motion: never shown */
@media (prefers-reduced-motion: reduce) { .intro, .intro-skip { display: none; } html.intro-on { overflow: auto; } }

/* ================= feel layer (js/fx.js) ================= */

/* hero handoff: red line lands, letters settle */
.hero-title .word { display: inline-block; white-space: nowrap; }
.hero-title .ch { display: inline-block; opacity: 0; transform: translateY(.3em) skewX(-12deg); }
.hero-go .hero-title .ch { animation: ch-in .55s cubic-bezier(.2, .9, .25, 1) calc(.18s + var(--i) * 45ms) forwards; }
.hero-still .hero-title .ch { opacity: 1; transform: none; animation: none; }
.hero-line { display: block; height: 4px; width: min(22rem, 60%); margin: -.55rem 0 1.4rem; border-radius: 2px;
  background: var(--red); box-shadow: 0 0 18px 2px rgb(218 41 28 / .5); transform: scaleX(0); transform-origin: left; }
.hero-go .hero-line { animation: line-land .6s cubic-bezier(.6, 0, .2, 1) forwards, line-cool 1.4s ease-out .6s forwards; }
.hero-still .hero-line { transform: none; animation: none; box-shadow: none; }
@keyframes ch-in { to { opacity: 1; transform: none; } }
@keyframes line-land { from { transform: scaleX(0) translateY(-40vh); opacity: .4; } 60% { transform: scaleX(1.02); opacity: 1; } to { transform: scaleX(1); opacity: 1; } }
@keyframes line-cool { to { box-shadow: 0 0 0 0 rgb(218 41 28 / 0); } }

/* local time + sky that follows the circuit's clock (race weeks) */
.local-time { display: inline-flex; align-items: center; gap: .45rem; font-size: var(--step--1); color: var(--graphite); }
.local-time::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: #F2C14E; box-shadow: 0 0 8px #F2C14E; }
.local-time[data-sky="night"]::before { background: #C9D4F2; box-shadow: 0 0 8px #8FA6E8; }
.local-time[data-sky="dusk"]::before, .local-time[data-sky="dawn"]::before { background: #FF8A5C; box-shadow: 0 0 8px #FF8A5C; }
.hero { transition: background-color 1s; }
.hero[data-sky="night"] { background: radial-gradient(70% 60% at 85% -10%, rgb(70 100 190 / .20), transparent 70%); }
.hero[data-sky="dawn"]  { background: radial-gradient(70% 60% at 85% -10%, rgb(255 150 90 / .16), transparent 70%), radial-gradient(50% 50% at 10% 0%, rgb(90 120 200 / .12), transparent 70%); }
.hero[data-sky="day"]   { background: radial-gradient(75% 65% at 85% -10%, rgb(130 180 255 / .18), transparent 70%); }
.hero[data-sky="dusk"]  { background: radial-gradient(70% 60% at 85% -10%, rgb(218 41 28 / .20), transparent 70%), radial-gradient(50% 50% at 15% 0%, rgb(120 70 170 / .14), transparent 70%); }

/* pit-board countdown */
.clock-seg b { position: relative; display: inline-block; min-width: 1.35em; text-align: center; padding: .06em .14em .02em;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px; transform-origin: 50% 50%; }
.clock-seg b::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgb(0 0 0 / .45); }
.clock-seg b.flip { animation: flip .38s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes flip { from { transform: perspective(300px) rotateX(-80deg); filter: brightness(1.8); } to { transform: none; filter: none; } }

/* lapping car + drawn outlines */
.trk { position: relative; }
.trk.can-draw path { transition: stroke-dashoffset 1.2s cubic-bezier(.55, 0, .2, 1); }
.lap-car { fill: #fff; }
.lap-glow { fill: var(--red); opacity: .45; }
.race[data-state="done"] .trk::after {
  content: ""; position: absolute; right: -.35rem; bottom: -.3rem; width: 1.35rem; height: 1.35rem; border-radius: 50%;
  background: conic-gradient(#fff 0 25%, #111 0 50%, #fff 0 75%, #111 0) 0 0 / .45rem .45rem;
  border: 2px solid var(--bg-alt); transform: scale(0) rotate(-40deg);
}
.race[data-state="done"] .trk.is-drawn::after { animation: stamp .35s cubic-bezier(.3, 1.6, .5, 1) .9s forwards; }
@keyframes stamp { to { transform: scale(1) rotate(-12deg); } }

/* race pass */
.confirmed.pass { background: none; padding: 0; color: var(--ink); }
.pass-card { position: relative; overflow: hidden; max-width: 34rem; border-radius: 16px; color: #EDF0F4;
  background: linear-gradient(135deg, #1E2738, #0C1118 70%); border: 1px solid rgb(255 255 255 / .08);
  box-shadow: 0 24px 50px -24px rgb(0 0 0 / .85);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .18s ease-out; }
.pass-stripe { height: 12px; background: var(--plate, var(--red)); transform-origin: left; }
.pass-flag { position: absolute; right: 0; top: 12px; width: 8rem; height: 5rem; opacity: .14; transform-origin: right top;
  background: conic-gradient(#fff 0 25%, #000 0 50%, #fff 0 75%, #000 0) 0 0 / .8rem .8rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); mask-image: linear-gradient(90deg, transparent, #000 60%); }
.pass-body { position: relative; padding: 1.3rem 1.6rem 1.6rem; }
.pass-kicker { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; font-weight: 700; font-size: var(--step--1); color: #9DA7B4; }
.pass-kicker img { width: 1.5rem; height: auto; }
.pass-card .muted { color: #9DA7B4; margin: 0; }
.pass-card h3 { font-size: clamp(2rem, 5vw, 3.1rem); margin: .35rem 0 .5rem; overflow-wrap: anywhere; }
.pass-detail { margin: 0; font-weight: 650; }
.pass-shine { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle at var(--mx, 25%) var(--my, 15%), color-mix(in srgb, var(--plate, var(--red)) 42%, transparent), transparent 55%),
              linear-gradient(115deg, transparent 32%, rgb(255 255 255 / .07) 46%, transparent 60%); }
.pass .actions { margin-top: 1.1rem; }
.pass.is-stamping .pass-card { animation: slam .55s cubic-bezier(.2, .9, .3, 1.2) backwards; }
.pass.is-stamping .pass-stripe { animation: flood .5s cubic-bezier(.7, 0, .2, 1) .28s backwards; }
.pass.is-stamping .pass-card h3 { animation: lock .55s cubic-bezier(.2, .9, .2, 1) .42s backwards; }
.pass.is-stamping .pass-flag { animation: ripple 1.1s ease-out .75s; }
.pass.is-stamping .actions { animation: fade-up .4s ease-out 1s backwards; }
@keyframes slam { from { transform: perspective(900px) translateY(-26px) scale(1.07) rotateX(14deg); opacity: 0; } 60% { transform: perspective(900px) translateY(3px) scale(.99); opacity: 1; } }
@keyframes flood { from { transform: scaleX(0); } }
@keyframes lock { from { opacity: 0; letter-spacing: .35em; filter: blur(8px); } }
@keyframes ripple { 0% { opacity: .9; transform: skewY(0); } 20% { transform: skewY(-7deg) scaleY(1.05); } 40% { transform: skewY(5deg); } 60% { transform: skewY(-3deg); } 80% { transform: skewY(1.5deg); opacity: .5; } 100% { opacity: .14; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(.5rem); } }

/* live grid arrivals */
.tower li.is-arrival { animation: arrive .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes arrive {
  0% { transform: translateX(28px); opacity: 0; background: rgb(255 255 255 / .16); box-shadow: inset 3px 0 0 var(--red); }
  35% { transform: none; opacity: 1; background: rgb(255 255 255 / .16); box-shadow: inset 3px 0 0 var(--red); }
  100% { background: transparent; box-shadow: inset 3px 0 0 transparent; }
}

/* marquee week (events with highlight: true, e.g. 24 Hours Le Mans) */
html[data-marquee] { --bg: #0A0F1F; --bg-alt: #0E1530; --card: #141D3A; --chip: #1D2850; --line: #26336A; --head-bg: #070B17; }
html[data-marquee] body { background: var(--bg); }
html[data-marquee] .hero, html[data-marquee] .hero[data-sky] {
  background: radial-gradient(55% 55% at 82% -8%, rgb(110 140 255 / .24), transparent 70%),
              radial-gradient(40% 45% at 8% 5%, rgb(218 41 28 / .16), transparent 70%); }
.marquee-badge { display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px; font-size: var(--step--1); font-weight: 750;
  color: #fff; background: linear-gradient(90deg, #DA291C, #7B3FC4); margin-right: .25rem; }

/* personal welcome */
.hero-welcome { display: flex; align-items: center; gap: .7rem; margin: -0.6rem 0 1.4rem; padding: .7rem 1rem; max-width: 40rem;
  border-radius: 10px; background: color-mix(in srgb, var(--card) 70%, transparent); border: 1px solid var(--line); font-size: var(--step-0); }
.hero-welcome strong { color: var(--ink); font-weight: 750; }
.hero-welcome .plate { flex: none; }
.hero-welcome.is-new { animation: fade-up .5s cubic-bezier(.2, .8, .2, 1) backwards; }

/* page transitions (js/transition.js) */
.wipe { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: #0A0E14; pointer-events: none; }
.wipe::before { content: ""; position: absolute; top: 0; bottom: 0; width: 3px; background: var(--red, #DA291C);
  box-shadow: 0 0 24px 6px rgb(218 41 28 / .6); }
.wipe img { width: 4rem; height: auto; opacity: 0; filter: drop-shadow(0 0 16px rgb(218 41 28 / .7)); }
.wipe-out { animation: wipe-out .42s cubic-bezier(.7, 0, .3, 1) forwards; }
.wipe-out::before { left: 0; }
.wipe-out img { animation: fade-in .2s ease-out .22s forwards; }
.wipe-in { animation: wipe-in .6s cubic-bezier(.6, 0, .2, 1) .08s forwards; }
.wipe-in::before { right: 0; }
.wipe-in img { opacity: 1; animation: fade-out .18s ease-in forwards; }
@keyframes wipe-out { from { transform: translateX(100%); } to { transform: none; } }
@keyframes wipe-in { from { transform: none; } to { transform: translateX(-100%); } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wipe { display: none; } }

/* circuit spotlight (rounds without onboard footage) */
.stage { margin: 0; position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-panel); overflow: hidden;
  display: grid; grid-template-rows: 1fr auto; border: 1px solid var(--line);
  background: radial-gradient(70% 55% at 50% 42%, color-mix(in srgb, var(--red) 14%, transparent), transparent 70%),
              repeating-linear-gradient(0deg, transparent 0 39px, rgb(255 255 255 / .03) 39px 40px),
              repeating-linear-gradient(90deg, transparent 0 39px, rgb(255 255 255 / .03) 39px 40px), var(--card); }
.trk-stage { width: 84%; height: 100%; margin: 0 auto; color: var(--ink); }
.trk-stage path { stroke-width: 4px !important; }
.stage figcaption { display: grid; gap: .15rem; padding: 1rem 1.2rem 1.2rem; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--card) 80%, transparent); }
.stage figcaption strong { font-size: var(--step-1); font-weight: 760; }
.stage figcaption span { color: var(--graphite); font-size: var(--step--1); }
.hero-facts.no-trk { grid-template-columns: 1fr; }
.hero-facts.no-trk .facts-note { grid-column: 1; }
@media (max-width: 900px) { .stage { aspect-ratio: 4 / 3; } }

/* 404: off track */
.offtrack .crash { width: 100%; max-width: 46rem; height: auto; display: block; margin: 0 0 1.5rem; border-radius: var(--r-panel); background: #1B222C; }
.offtrack .car-still { display: none; }
@media (prefers-reduced-motion: reduce) {
  .offtrack .car-anim, .offtrack .dust { display: none; }
  .offtrack .car-still { display: inline; }
  .offtrack .skid { opacity: .75; }
}
