/* Undercut: spatial UI.
   Layout: a full-screen intro cycling team-car videos, then floating glass "windows" over a dark environment,
   each section a window with its own ornaments (floating toolbars) below or beside it.
   Single dark look by design: the environment is the stage the windows float in. */
:root {
  --env: #050608;
  --env-glow-a: rgba(240, 74, 60, .16);
  --env-glow-b: rgba(74, 140, 240, .14);
  --glass: rgba(255, 255, 255, .055);
  --glass-hi: rgba(255, 255, 255, .09);
  --glass-solid: #15171D;
  --edge: rgba(255, 255, 255, .13);
  --edge-hi: rgba(255, 255, 255, .28);
  --ink: #F4F5F8;
  --ink-2: rgba(244, 245, 248, .68);
  --ink-3: rgba(244, 245, 248, .56); /* >= 4.5:1 on the dark glass, for small labels */
  --accent: #FF4B3A;
  --accent-ink: #FFFFFF;
  --gold: #FFC72C;
  --series-a: #F04A3C;
  --series-b: #4A8CF0;
  --good: #4CD38A; --good-bg: rgba(76, 211, 138, .14);
  --warn: #F5B851; --warn-bg: rgba(245, 184, 81, .14);
  --bad: #FF6B5E;  --bad-bg: rgba(255, 107, 94, .14);
  --line: rgba(255, 255, 255, .08);

  --f-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --f-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-data: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --r-win: 30px;
  --r-md: 20px;
  --r-sm: 14px;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
img { max-width: 100%; }
html { background: var(--env); }
/* Lenis smooth scrolling (from lenis/dist/lenis.css) */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 12% 120%, var(--env-glow-a), transparent 60%),
    radial-gradient(1000px 700px at 95% 70%, var(--env-glow-b), transparent 60%),
    var(--env);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--f-display); margin: 0; line-height: 1.08; text-wrap: balance; letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; }
button, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 12px; }
.num { font-family: var(--f-data); font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--f-data); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.muted { color: var(--ink-2); }

/* ---------- spatial primitives ---------- */
.window {
  position: relative;
  background: linear-gradient(180deg, var(--glass-hi), var(--glass));
  border: 1px solid var(--edge);
  border-radius: var(--r-win);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    inset 0 0 0 1px rgba(255, 255, 255, .02),
    0 30px 60px -20px rgba(0, 0, 0, .65),
    0 60px 120px -40px rgba(0, 0, 0, .55);
  isolation: isolate;
}
/* light that follows the pointer across glass */
.window::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, -20%), rgba(255, 255, 255, .07), transparent 45%);
}
.tilt { transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0); transition: transform .5s cubic-bezier(.2, .8, .2, 1), border-color .3s; will-change: transform; }
.tilt:hover { border-color: var(--edge-hi); }

.pill-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--edge); border-radius: 999px; cursor: pointer; text-decoration: none;
  padding: .7rem 1.25rem; font-weight: 700; font-size: .95rem;
  background: var(--glass-hi); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), background .25s, border-color .25s;
}
.pill-btn:hover { transform: translateY(-2px) scale(1.02); background: rgba(255, 255, 255, .14); border-color: var(--edge-hi); }
.pill-btn:active { transform: scale(.97); }
.pill-btn.primary { background: var(--ink); color: #0A0B0F; border-color: transparent; box-shadow: 0 10px 30px -8px rgba(255, 255, 255, .35); }
.pill-btn.primary:hover { background: #FFFFFF; }
.pill-btn:disabled { opacity: .35; cursor: default; transform: none; }
.icon-btn { width: 44px; height: 44px; padding: 0; flex: none; }

.segmented { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); }
.segmented button { border: 0; background: transparent; padding: .5rem 1rem; border-radius: 999px; font-weight: 700; font-size: .88rem; color: var(--ink-2); cursor: pointer; transition: background .25s, color .25s; }
.segmented button[aria-pressed="true"] { background: rgba(255, 255, 255, .14); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16); }
.segmented button:hover { color: var(--ink); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: .28rem .7rem; border-radius: 999px; font-weight: 700; font-size: .78rem; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); }
.chip-live { color: #fff; background: rgba(255, 75, 58, .22); border-color: rgba(255, 75, 58, .5); }
.chip-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.v-good { color: var(--good); background: var(--good-bg); border-color: transparent; }
.v-warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.v-bad { color: var(--bad); background: var(--bad-bg); border-color: transparent; }

.team-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--tc, #888); box-shadow: 0 0 0 2px rgba(0, 0, 0, .4), 0 0 12px -2px var(--tc, #888); }

/* ---------- top navigation ornament ---------- */
.nav {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px;
  width: max-content; max-width: calc(100vw - 24px);
  border-radius: 999px;
  background: rgba(20, 22, 28, .55); border: 1px solid var(--edge);
  backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 20px 40px -12px rgba(0, 0, 0, .6);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-family: var(--f-display); font-weight: 700; letter-spacing: -.01em; margin-right: 8px; }
.brand svg { flex: none; }
.nav a.link { text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: .86rem; padding: .5rem .85rem; border-radius: 999px; transition: background .2s, color .2s; white-space: nowrap; }
.nav a.link:hover, .nav a.link.on { color: var(--ink); background: rgba(255, 255, 255, .1); }
@media (max-width: 760px) { .nav a.link { display: none; } .nav a.link.keep { display: inline-flex; } }

/* ---------- intro: full-screen video of the team cars ---------- */
.intro { position: relative; height: clamp(620px, 100svh, 1000px); overflow: hidden; background: #000; }
.hero-stage { position: absolute; inset: 0; background: #000 center 60% / cover no-repeat; }
.hero-stage video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 60%;
  opacity: 0; transition: opacity .9s ease;
}
.hero-stage video.on { opacity: 1; }
/* keeps the title readable, darkens the corners, and blends the bottom into the page */
.hero-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 115% 95% at 50% 55%, transparent 52%, rgba(0, 0, 0, .7) 100%),
    linear-gradient(to bottom, rgba(5, 6, 8, .82) 0%, rgba(5, 6, 8, .35) 26%, rgba(5, 6, 8, 0) 45%, rgba(5, 6, 8, 0) 62%, rgba(5, 6, 8, .55) 84%, var(--env) 100%);
}
.intro-copy {
  position: relative; z-index: 2; text-align: center;
  padding: calc(env(safe-area-inset-top, 0px) + 104px) var(--gutter) 0;
  display: grid; justify-items: center; gap: 14px;
}
.intro h1 { font-size: clamp(2.2rem, 5.6vw, 4.6rem); font-weight: 600; max-width: 16ch; text-shadow: 0 4px 30px rgba(0, 0, 0, .5); }
.intro h1 .typed { color: var(--ink); }
.intro h1 .ghost { color: rgba(244, 245, 248, .44); } /* untyped part of the title stays dim on purpose */
.caret { display: inline-block; width: .06em; height: .9em; margin-left: .04em; vertical-align: -.08em; background: var(--accent); animation: pulse 1s steps(1) infinite; }

/* bottom bar: text left, buttons centre, current team right */
.hero-bottom {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: clamp(28px, 5vh, 52px);
  padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 20px;
}
.hero-bottom .lede { max-width: 300px; color: var(--ink-2); font-size: .92rem; line-height: 1.55; }
.hero-bottom .ctas { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.now-showing { justify-self: end; padding: 10px 16px; border-radius: 18px; display: grid; gap: 3px; min-width: 230px; }
.ns-team { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-size: .98rem; white-space: nowrap; }
.ns-count { margin-left: auto; padding-left: 12px; font-size: .75rem; color: var(--ink-3); white-space: nowrap; }
/* Live background blur over a playing video makes the browser re-blur every frame, which causes
   stutter. Over the hero, glass elements use a solid tint instead (it looks the same on dark video). */
.intro .window, .intro .pill-btn { backdrop-filter: none; -webkit-backdrop-filter: none; }
.intro .pill-btn:not(.primary) { background: rgba(20, 22, 28, .62); }
.intro .now-showing { background: rgba(14, 15, 19, .66); }
body.at-hero .nav { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(12, 13, 17, .8); }
.hero-stage video.on, .hero-stage video { will-change: opacity; }

@media (max-width: 860px) {
  .hero-bottom { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 14px; }
  .hero-bottom .lede { display: none; }
  .now-showing { justify-self: center; }
}

/* ---------- page shell ---------- */
main { position: relative; z-index: 3; max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter) 40px; display: grid; gap: clamp(72px, 10vw, 130px); }
section { scroll-margin-top: 90px; min-width: 0; }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.sec-head p { max-width: 62ch; margin-top: 10px; color: var(--ink-2); }

/* catalogue of features */
.catalog { margin-top: clamp(40px, 6vw, 72px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 960px) { .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .catalog { grid-template-columns: 1fr; } }
.feat { display: grid; gap: 12px; padding: 22px; text-decoration: none; min-height: 168px; align-content: start; }
.feat .ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.feat h3 { font-size: 1.08rem; }
.feat p { color: var(--ink-2); font-size: .93rem; }
.feat .live { font-family: var(--f-data); font-size: .8rem; color: var(--ink); display: flex; align-items: center; gap: 8px; margin-top: auto; }
.feat .arrow { position: absolute; right: 20px; top: 22px; color: var(--ink-3); transition: transform .3s, color .3s; }
.feat:hover .arrow { transform: translate(3px, -3px); color: var(--ink); }

/* ---------- race window ---------- */
.race-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; }
@media (max-width: 960px) { .race-grid { grid-template-columns: 1fr; } }
.race-card { padding: clamp(22px, 3vw, 32px); display: grid; gap: 20px; align-content: start; min-width: 0; }
.race-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.race-name { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 600; }
.race-meta { display: grid; gap: 3px; color: var(--ink-2); font-weight: 600; font-size: .95rem; }
.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 360px; }
.cd { padding: 10px 0 8px; text-align: center; border-radius: 16px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); }
.cd b { display: block; font-family: var(--f-data); font-size: 1.5rem; line-height: 1.1; font-weight: 500; }
.cd span { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.picker { display: flex; gap: 8px; align-items: center; }
.select-wrap { position: relative; flex: 1; min-width: 0; }
.select-wrap select { appearance: none; -webkit-appearance: none; width: 100%; cursor: pointer; padding: .7rem 2.6rem .7rem 1.1rem; text-overflow: ellipsis; }
.select-wrap select option { background: var(--glass-solid); color: var(--ink); }
.select-wrap::after { content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.winner { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 18px; border-radius: 22px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); }
.ring { width: 100px; height: 100px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255, 255, 255, .08); }
.ring .val { stroke: url(#ringGrad); stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(255, 75, 58, .6)); }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.05; }
.ring-label b { font-family: var(--f-data); font-size: 1.3rem; font-weight: 500; }
.ring-label small { display: block; font-size: .6rem; letter-spacing: .12em; color: var(--ink-3); font-weight: 700; text-transform: uppercase; }
.winner-code { font-family: var(--f-display); font-weight: 700; font-size: clamp(2.2rem, 5vw, 3rem); line-height: 1; display: flex; align-items: center; gap: 12px; letter-spacing: -.03em; }
.winner-name { font-weight: 700; }
.winner-note { font-size: .88rem; color: var(--ink-2); margin-top: 4px; }
.src-note { font-size: .84rem; color: var(--ink-3); }

.stage { position: relative; min-height: 480px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.stage canvas:active { cursor: grabbing; }
.stage-top { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: start; gap: 10px; padding: 20px 22px 0; pointer-events: none; }
.stage-hint { font-size: .78rem; font-weight: 700; color: var(--ink-3); }
.podium-labels { position: relative; z-index: 2; margin-top: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 16px 16px; pointer-events: none; }
.pl { padding: 10px 12px; display: flex; align-items: center; gap: 10px; min-width: 0; border-radius: 16px; background: rgba(10, 11, 15, .55); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.pl .p { font-family: var(--f-display); font-weight: 700; color: var(--ink-3); }
.pl .c { font-family: var(--f-data); font-weight: 700; }
.pl .w { font-size: .72rem; color: var(--ink-3); font-weight: 700; }
.pl > div { min-width: 0; }
.stage-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); padding: 24px; text-align: center; font-weight: 600; }
@media (max-width: 560px) { .stage { min-height: 400px; } .pl .w { display: none; } }

/* ---------- timing tower ---------- */
.tower-win { padding: clamp(10px, 1.6vw, 18px); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .84rem; color: var(--ink-2); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.tower { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.trow, .thead { display: grid; align-items: center; gap: 14px; grid-template-columns: 54px minmax(160px, 1.4fr) 112px minmax(90px, 1fr) minmax(90px, 1fr) 100px; }
.thead { padding: 6px 14px 10px; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); }
.trow { padding: 10px 14px; border-radius: 18px; transition: background .25s, transform .3s cubic-bezier(.2, .8, .2, 1); }
.trow:hover { background: rgba(255, 255, 255, .06); transform: translateZ(0) scale(1.006); }
.trow.top3 { background: rgba(255, 255, 255, .04); }
.pos { font-family: var(--f-display); font-weight: 700; font-size: .98rem; color: var(--ink-2); }
.trow.top3 .pos { color: var(--ink); }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-txt { min-width: 0; }
.who b { font-family: var(--f-data); font-weight: 700; margin-right: 6px; }
.who .nm { font-weight: 600; color: var(--ink-2); }
.who .tm { display: block; font-size: .78rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gridcell { font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.gridcell .mv { display: block; font-size: .74rem; font-weight: 700; }
.mv.up { color: var(--good); } .mv.down { color: var(--bad); } .mv.same { color: var(--ink-3); }
.bar { height: 8px; position: relative; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; width: var(--w); min-width: 3px; background: linear-gradient(90deg, rgba(240, 74, 60, .55), var(--series-a)); box-shadow: 0 0 12px rgba(240, 74, 60, .5); transform-origin: left center; }
.bar.pod i { background: linear-gradient(90deg, rgba(74, 140, 240, .55), var(--series-b)); box-shadow: 0 0 12px rgba(74, 140, 240, .45); }
.barcell { display: grid; gap: 6px; }
.barcell small { font-family: var(--f-data); font-size: .8rem; }
.act { justify-self: end; font-family: var(--f-data); }
.mlabel { display: none; }
@media (max-width: 860px) {
  .thead { display: none; }
  .trow { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "pos who act" "pos grid grid" "w w w" "p p p"; row-gap: 8px; }
  .trow .pos { grid-area: pos; align-self: start; }
  .trow .who { grid-area: who; } .trow .act { grid-area: act; }
  .trow .gridcell { grid-area: grid; display: flex; gap: 10px; }
  .trow .gridcell .mv { display: inline; }
  .trow .bc-w { grid-area: w; } .trow .bc-p { grid-area: p; }
  .mlabel { display: inline; color: var(--ink-3); font-family: var(--f-body); margin-right: 6px; }
  .who .fn { display: none; } /* phones: code + surname only, so names don't wrap */
}

/* ---------- teams & standings ---------- */
.standings-win { padding: clamp(14px, 2vw, 22px); display: grid; gap: 16px; }
.win-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.table-scroll { overflow-x: auto; }
.stand { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: .92rem; }
.stand th { text-align: left; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 4px 10px; white-space: nowrap; }
.stand td { padding: 9px 10px; white-space: nowrap; }
.stand tbody tr { transition: background .2s; }
.stand tbody tr:hover td { background: rgba(255, 255, 255, .05); }
.stand tbody tr td:first-child { border-radius: 14px 0 0 14px; }
.stand tbody tr td:last-child { border-radius: 0 14px 14px 0; }
.stand .r { text-align: right; }
.stand .pts { font-family: var(--f-data); font-weight: 700; color: var(--ink); }
.stand .nm { display: flex; align-items: center; gap: 10px; }
.stand .nm b { font-family: var(--f-data); }
.stand .nm span { color: var(--ink-2); }
.strip { display: flex; gap: 3px; }
.fin { width: 26px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-family: var(--f-data); font-size: .7rem; font-weight: 700; color: var(--ink-2); background: rgba(255, 255, 255, .05); flex: none; }
.fin.p1 { background: var(--gold); color: #1A1404; }
.fin.p2 { background: #D9DEE6; color: #15171D; }
.fin.p3 { background: #D08A52; color: #1A0E04; }
.fin.pts { background: rgba(255, 255, 255, .13); color: var(--ink); }
.fin.dnf { background: transparent; border: 1px solid rgba(255, 107, 94, .55); color: var(--bad); }
.fin.none { background: transparent; color: var(--ink-3); }
.strip-key { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.strip-key span { display: inline-flex; align-items: center; gap: 6px; }
.strip-key .fin { width: 20px; height: 18px; font-size: .62rem; }

.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.team-card { text-align: left; cursor: pointer; padding: 16px; display: grid; gap: 10px; border-radius: 22px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); transition: background .25s, border-color .25s, transform .3s cubic-bezier(.2, .8, .2, 1); }
.team-card:hover { background: rgba(255, 255, 255, .08); transform: translateY(-3px); }
.team-card[aria-pressed="true"] { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent); }
.team-card .tc-top { display: flex; justify-content: space-between; align-items: center; }
.team-card .tc-pos { font-family: var(--f-data); color: var(--ink-3); font-size: .8rem; }
.team-card .tc-name { font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; }
.team-card .tc-pts { font-family: var(--f-data); font-size: 1.4rem; }
.team-card .tc-pts small { font-size: .78rem; color: var(--ink-3); }

.garage { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; margin-top: 20px; }
@media (max-width: 960px) { .garage { grid-template-columns: 1fr; } }
.garage { align-items: start; scroll-margin-top: 90px; }
.garage .stage { min-height: 520px; position: sticky; top: 90px; }
@media (max-width: 960px) { .garage .stage { position: relative; top: 0; min-height: 400px; } }
.garage-info { padding: clamp(20px, 2.6vw, 28px); display: grid; gap: 18px; align-content: start; min-width: 0; }
.garage-title { display: flex; align-items: center; gap: 12px; }
.garage-title h3 { font-size: 1.6rem; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { padding: 12px 14px; border-radius: 16px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); display: grid; gap: 2px; }
.tile b { font-family: var(--f-data); font-size: 1.35rem; font-weight: 500; }
.tile span { font-size: .72rem; color: var(--ink-3); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.drv { display: grid; gap: 8px; padding: 12px 14px; border-radius: 16px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); min-width: 0; }
.drv-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.drv-top b { font-family: var(--f-data); }
.drv .strip { flex-wrap: wrap; }
.livery-note { font-size: .82rem; color: var(--ink-3); }

/* ---------- season ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { padding: 22px 24px; display: grid; gap: 6px; }
.stat .big { font-family: var(--f-display); font-weight: 600; font-size: 2.6rem; line-height: 1; letter-spacing: -.03em; }
.stat .big small { font-size: 1rem; color: var(--ink-3); font-weight: 600; }
.stat .vs { font-size: .9rem; color: var(--ink-2); }
.rounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.rtile { text-align: left; border: 1px solid var(--line); cursor: pointer; padding: 14px; display: grid; gap: 8px; border-radius: 20px; background: rgba(255, 255, 255, .04); transition: background .25s, transform .3s cubic-bezier(.2, .8, .2, 1), border-color .25s; }
.rtile:hover { background: rgba(255, 255, 255, .08); transform: translateY(-3px); }
.rtile.sel { border-color: var(--edge-hi); background: rgba(255, 255, 255, .1); }
.rtile .rt-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.rtile .rn { font-family: var(--f-data); font-size: .74rem; color: var(--ink-3); }
.rtile .rname { font-weight: 700; line-height: 1.2; font-size: .94rem; }
.rtile .rwin { display: flex; align-items: center; gap: 8px; font-family: var(--f-data); font-size: .86rem; }
.dots { display: flex; gap: 5px; align-items: center; font-size: .74rem; color: var(--ink-3); font-weight: 600; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.dots i.on { background: var(--series-b); box-shadow: 0 0 8px var(--series-b); }
.rtile.next { border-color: rgba(255, 75, 58, .55); background: rgba(255, 75, 58, .12); }
.rtile.future { opacity: .45; cursor: default; }
.rtile.future:hover { transform: none; background: rgba(255, 255, 255, .04); }

/* ---------- accuracy ---------- */
.lab { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; }
@media (max-width: 960px) { .lab { grid-template-columns: 1fr; } }
.panel { padding: clamp(18px, 2.4vw, 28px); display: grid; gap: 16px; align-content: start; min-width: 0; }
.panel p.cap { color: var(--ink-2); font-size: .92rem; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--ink-3); font-family: var(--f-body); font-size: 12px; font-weight: 600; }
.chart .val-label { fill: var(--ink); font-family: var(--f-data); font-size: 12px; }
.chart .gridl { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--ink-3); stroke-width: 1; }
.imp { display: grid; gap: 12px; }
.imp-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 48px; gap: 12px; align-items: center; font-size: .9rem; font-weight: 600; }
.imp-row .v { font-family: var(--f-data); text-align: right; }
.tbl { overflow-x: auto; }
.tbl table { border-collapse: collapse; width: 100%; font-size: .88rem; }
.tbl th, .tbl td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td { font-family: var(--f-data); }

/* ---------- method ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.step { padding: 24px; display: grid; gap: 10px; align-content: start; }
.step .n { font-family: var(--f-data); font-size: .8rem; color: var(--ink-3); }
.step p { color: var(--ink-2); font-size: .95rem; }
.fine { margin-top: 18px; padding: 20px 24px; color: var(--ink-2); font-size: .92rem; display: grid; gap: 6px; }
.fine strong { color: var(--ink); }

footer { position: relative; z-index: 3; max-width: 1280px; margin: 40px auto 0; padding: 26px var(--gutter) calc(30px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--ink-3); font-size: .84rem; border-top: 1px solid var(--line); }

#tip { position: fixed; z-index: 50; pointer-events: none; padding: 8px 12px; border-radius: 12px; font-size: .82rem; font-weight: 700; background: rgba(20, 22, 28, .9); border: 1px solid var(--edge); color: var(--ink); max-width: 260px; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; backdrop-filter: blur(12px); }
#tip.show { opacity: 1; transform: none; }
.loading { padding: 40px; text-align: center; color: var(--ink-3); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .tilt { transform: none !important; }
}
