/*
 * Public website (home, calendar, events, races, legal pages). Plain CSS, no
 * build step. Fonts vendored in app/assets/fonts (OFL): Inter (text),
 * Barlow Condensed (display). Tokens on :root; dark mode via prefers-color-scheme.
 */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/inter-latin-wght-normal-5e6b0c47.woff2") format("woff2");
  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: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/inter-latin-ext-wght-normal-a4181629.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, 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: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/assets/barlow-condensed-latin-700-normal-d35473be.woff2") format("woff2");
  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: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/assets/barlow-condensed-latin-ext-700-normal-bdecd0e6.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, 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: "Barlow Condensed"; font-style: italic; font-weight: 800; font-display: swap;
  src: url("/assets/barlow-condensed-latin-800-italic-89713d99.woff2") format("woff2");
  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: "Barlow Condensed"; font-style: italic; font-weight: 800; font-display: swap;
  src: url("/assets/barlow-condensed-latin-ext-800-italic-1dcc3eba.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --navy-950: #040a1c;
  --navy-900: #081330;
  --navy-800: #0f1f4a;
  --navy-700: #1a2f66;
  --brand: #2563ff;
  --brand-strong: #1747d6;
  --cyan: #19c2ff;
  --live: #ff2e4d;
  --gold: #f5b300;
  --silver: #9aa6bd;
  --bronze: #cd7f3e;

  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #eef2f9;
  --text: #0c1530;
  --text-2: #3c4766;
  --muted: #6a7594;
  --line: #e2e8f2;
  --link: var(--brand-strong);
  --chip: #e8efff;
  --chip-text: #1747d6;
  --hover: #f5f8ff;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(8, 19, 48, .05), 0 8px 28px rgba(8, 19, 48, .07);
  --shadow-lg: 0 24px 60px rgba(4, 10, 28, .35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", var(--font);
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #050b1d;
    --surface: #0b1631;
    --surface-2: #112048;
    --text: #eef2fb;
    --text-2: #c3cbe0;
    --muted: #8d98b6;
    --line: #1b2a54;
    --link: #7ea6ff;
    --chip: #15275a;
    --chip-text: #a9c2ff;
    --hover: #0f1c40;
    --shadow: 0 1px 0 rgba(255, 255, 255, .02);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 16px/1.55 var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.1; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }
.main { flex: 1; padding-bottom: 64px; }
.section { margin-top: 48px; }
.display { font-family: var(--display); font-weight: 700; letter-spacing: .01em; text-transform: uppercase; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  background: rgba(4, 10, 28, .88); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .06); color: #fff;
}
.site-header__inner { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 10px; }
.brand__name { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 1.45rem; letter-spacing: .02em; text-transform: uppercase; line-height: 1; }
.brand__name b { color: var(--cyan); font-weight: 800; }
.nav { display: flex; gap: 2px; }
.nav__link { white-space: nowrap; position: relative; color: rgba(255, 255, 255, .78); padding: 8px 12px; font-weight: 600; font-size: .93rem; border-radius: 8px; }
.nav__link:hover { color: #fff; text-decoration: none; background: rgba(255, 255, 255, .07); }
.nav__link--active { color: #fff; }
.nav__link--active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -12px; height: 3px; border-radius: 3px; background: var(--cyan); }
.header-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.btn-app { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: #fff; color: var(--navy-900); font-weight: 700; font-size: .88rem; }
.btn-app:hover { text-decoration: none; background: var(--cyan); }
.langs { position: relative; }
.langs > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 4px; padding: 7px 10px; border-radius: 8px; color: rgba(255, 255, 255, .85); font-weight: 700; font-size: .82rem; border: 1px solid rgba(255, 255, 255, .15); }
.langs > summary::-webkit-details-marker { display: none; }
.langs > summary::after { content: "▾"; font-size: .7rem; opacity: .7; }
.langs[open] > summary { background: rgba(255, 255, 255, .08); }
.langs__menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--navy-900); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: 6px; display: grid; min-width: 140px; box-shadow: var(--shadow-lg); }
.lang { color: rgba(255, 255, 255, .85); padding: 8px 10px; border-radius: 8px; font-size: .9rem; font-weight: 600; }
.lang:hover { background: rgba(255, 255, 255, .08); text-decoration: none; color: #fff; }
.lang--active { color: var(--cyan); }
@media (max-width: 720px) {
  .brand__name { display: none; }
  .countdown b { font-size: 1.5rem; }
  .feature { padding: 16px; }
  .section-head { flex-wrap: wrap; }
  .site-header__inner { gap: 6px; }
  .nav__link { padding: 8px 8px; font-size: .88rem; }
  .btn-app span { display: none; }
  .btn-app { padding: 8px 10px; }
}
@media (max-width: 420px) { .nav__link--extra { display: none; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-950); color: rgba(255, 255, 255, .72); font-size: .9rem; }
.site-footer a { color: rgba(255, 255, 255, .85); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; padding: 48px 0 28px; }
.footer-grid h2 { font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; font-size: .95rem; color: #fff; margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; margin-bottom: 10px; }
.footer-brand img { border-radius: 10px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .08); padding: 18px 0 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: .8rem; color: rgba(255, 255, 255, .5); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Hero (home) ---------- */
.hero { position: relative; color: #fff; background: var(--navy-950); overflow: hidden; isolation: isolate; }
.hero__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(4, 10, 28, .96) 0%, rgba(4, 10, 28, .82) 38%, rgba(4, 10, 28, .25) 70%, rgba(4, 10, 28, .1) 100%),
    linear-gradient(0deg, rgba(4, 10, 28, .9) 0%, rgba(4, 10, 28, 0) 35%); }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 40px; align-items: end; padding-top: 88px; padding-bottom: 56px; min-height: min(78vh, 720px); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .16em; font-size: .76rem; font-weight: 700; color: var(--cyan); margin-bottom: 14px; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
.hero h1 { font-family: var(--display); font-style: italic; font-weight: 800; text-transform: uppercase; font-size: clamp(3rem, 8.5vw, 6.4rem); line-height: .9; letter-spacing: -.005em; margin-bottom: 18px; }
.hero h1 em { font-style: italic; color: var(--cyan); }
.hero__lead { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: rgba(255, 255, 255, .82); max-width: 560px; margin-bottom: 24px; }
.hero .stores { margin-top: 0; }
.hero__credit { position: absolute; right: 12px; bottom: 8px; margin: 0; font-size: .68rem; color: rgba(255, 255, 255, .55); }
.hero__credit a { color: rgba(255, 255, 255, .7); }
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 56px; padding-bottom: 44px; gap: 28px; }
  .hero::before { background: linear-gradient(0deg, rgba(4, 10, 28, .98) 0%, rgba(4, 10, 28, .82) 55%, rgba(4, 10, 28, .45) 100%); }
}

/* Featured race card (glass) */
.feature { display: block; color: #fff; background: rgba(10, 22, 56, .55); border: 1px solid rgba(255, 255, 255, .14); border-radius: 22px; padding: 22px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow-lg); transition: transform .2s ease, border-color .2s ease; }
.feature:hover { text-decoration: none; transform: translateY(-2px); border-color: rgba(25, 194, 255, .6); }
.feature__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.feature__label { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 800; color: var(--cyan); display: flex; align-items: center; gap: 8px; }
.feature__label--live { color: #fff; background: var(--live); padding: 4px 10px; border-radius: 999px; }
.feature__series { font-size: .78rem; color: rgba(255, 255, 255, .7); font-weight: 600; }
.feature__name { display: block; font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 1.9rem; line-height: 1; margin-bottom: 6px; }
.feature__where { color: rgba(255, 255, 255, .8); display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.countdown__cell { display: block; background: rgba(255, 255, 255, .08); border-radius: 12px; padding: 10px 4px; text-align: center; }
.countdown b { display: block; font-family: var(--display); font-weight: 700; font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown__cell > span { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255, 255, 255, .6); }
.feature__when { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 600; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 14px; }
.feature__go { color: var(--cyan); font-weight: 700; white-space: nowrap; }

/* ---------- Page banner (calendar, event, race) ---------- */
.banner { position: relative; color: #fff; background: var(--navy-900); overflow: hidden; isolation: isolate; }
.banner__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.banner::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(4, 10, 28, .95) 0%, rgba(4, 10, 28, .78) 55%, rgba(4, 10, 28, .45) 100%); }
.banner--plain { background: radial-gradient(1200px 400px at 85% -10%, rgba(37, 99, 255, .55), transparent 60%), linear-gradient(135deg, var(--navy-950), var(--navy-800)); }
.banner--plain::before { display: none; }
.banner__inner { padding-top: 22px; padding-bottom: 36px; }
.banner h1 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(2.1rem, 5.5vw, 3.6rem); line-height: .95; margin: 8px 0 12px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.banner .eyebrow { margin-bottom: 0; }
.banner__lead { color: rgba(255, 255, 255, .78); max-width: 760px; margin: 0; }
.banner__facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.fact { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .12); color: #fff; font-size: .86rem; font-weight: 600; }
a.fact:hover { text-decoration: none; background: rgba(255, 255, 255, .18); }
.fact--tour { background: rgba(245, 179, 0, .2); border-color: rgba(245, 179, 0, .5); }
.banner__credit { position: absolute; right: 12px; bottom: 6px; margin: 0; font-size: .66rem; color: rgba(255, 255, 255, .5); }
.banner__credit a { color: rgba(255, 255, 255, .65); }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 10px; padding: 0; font-size: .8rem; }
.crumbs li { color: rgba(255, 255, 255, .55); }
.crumbs li + li::before { content: "/"; margin-right: 4px; opacity: .5; }
.crumbs a { color: rgba(255, 255, 255, .75); }
.crumbs [aria-current] { color: rgba(255, 255, 255, .55); }

/* ---------- Section headings ---------- */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 16px; }
.section-head h2, .h2 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(1.6rem, 3.2vw, 2.15rem); letter-spacing: .01em; line-height: 1; }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.more { font-weight: 700; font-size: .9rem; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.more::after { content: "→"; transition: transform .15s; }
.more:hover { text-decoration: none; }
.more:hover::after { transform: translateX(3px); }

/* ---------- Cards / layout ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 20px; }
.card--flush { padding: 0; overflow: hidden; }
.card__title { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 1.35rem; line-height: 1.05; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card--flush > .card__title, .card--flush > .card__pad { padding: 18px 20px 0; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; margin-top: 28px; }
.layout > aside { display: grid; gap: 20px; position: sticky; top: calc(var(--header-h) + 16px); }
@media (max-width: 980px) { .layout { grid-template-columns: minmax(0, 1fr); } .layout > aside { position: static; } }
.grid-home { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 980px) { .grid-home { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge--live { background: var(--live); color: #fff; }
.badge--finished { background: #def7e7; color: #12703a; }
.badge--cancelled { background: #fde3e6; color: #b3132e; }
.badge--startlist, .badge--tour { background: #fff1c9; color: #8a5a00; }
.badge--series { background: var(--chip); color: var(--chip-text); }
@media (prefers-color-scheme: dark) {
  .badge--finished { background: #0f3a24; color: #7fe3a5; }
  .badge--cancelled { background: #44111c; color: #ff9aac; }
  .badge--startlist, .badge--tour { background: #3d2e05; color: #ffd36b; }
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex-shrink: 0; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--live); display: inline-block; flex-shrink: 0; animation: pulse 1.4s infinite; }
.feature__label--live .pulse, .badge--live .pulse { background: #fff; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 46, 77, .65); } 100% { box-shadow: 0 0 0 10px rgba(255, 46, 77, 0); } }

/* Flags */
.flag { width: 1.2em; height: 1.2em; vertical-align: -.22em; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.flag--lg { width: .9em; height: .9em; vertical-align: -.08em; }
.flag--text { font-size: .7rem; width: auto; box-shadow: none; color: var(--muted); }
.nation-code { font-size: .8rem; color: var(--muted); font-weight: 700; letter-spacing: .03em; }

/* ---------- Clickable rows (schedule) ---------- */
.day { display: flex; align-items: center; gap: 10px; font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; margin: 22px 0 8px; }
.day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day:first-child { margin-top: 0; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row {
  display: grid; grid-template-columns: 74px minmax(0, 1fr) auto 18px; gap: 14px; align-items: center;
  padding: 12px 14px 12px 0; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line);
  color: var(--text); position: relative; transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
}
.row::before { content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); opacity: 0; transition: opacity .15s; }
.row:hover { text-decoration: none; border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow); background: var(--hover); }
.row:hover::before { opacity: 1; }
.row::after { content: "›"; grid-column: 4; font-size: 1.5rem; line-height: 1; color: var(--muted); transition: transform .15s, color .15s; }
.row:hover::after { color: var(--brand); transform: translateX(2px); }
.row--live { border-color: rgba(255, 46, 77, .5); }
.row--live::before { background: var(--live); opacity: 1; }
.row--qual .row__name { font-weight: 550; color: var(--text-2); }
.row--cancelled .row__name { text-decoration: line-through; color: var(--muted); }
.row__time { text-align: center; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; border-right: 1px solid var(--line); padding: 2px 0; }
.row__time time { font-family: var(--display); font-weight: 700; font-size: 1.45rem; line-height: 1; }
.row__time .tz, .row__time .row__date { font-size: .66rem; color: var(--muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-top: 3px; }
.row__main { min-width: 0; }
.row__name { font-weight: 700; display: block; }
.row__meta { font-size: .84rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 2px; }
.row__side { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.podium { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .86rem; color: var(--text-2); }
.podium li { display: inline-flex; align-items: center; gap: 6px; }
.medal { display: inline-grid; place-items: center; width: 1.45em; height: 1.45em; border-radius: 50%; font-size: .7rem; font-weight: 800; color: #fff; background: var(--silver); flex-shrink: 0; }
.medal--1 { background: var(--gold); }
.medal--3 { background: var(--bronze); }
@media (max-width: 560px) {
  .row { grid-template-columns: 60px minmax(0, 1fr) 14px; gap: 10px; }
  .row__side { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .row::after { grid-column: 3; grid-row: 1 / span 2; }
  .row__time time { font-size: 1.2rem; }
}

/* ---------- Event cards (home: next events) ---------- */
.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.scroller > * { scroll-snap-align: start; }
.ecard { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 300px; border-radius: var(--radius); overflow: hidden; color: #fff; isolation: isolate; background: linear-gradient(135deg, var(--navy-800), var(--brand)); box-shadow: var(--shadow); }
.ecard:hover { text-decoration: none; }
.ecard > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.ecard:hover > img { transform: scale(1.06); }
.ecard::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(4, 10, 28, .95) 0%, rgba(4, 10, 28, .55) 45%, rgba(4, 10, 28, .05) 100%); }
.ecard__date { position: absolute; top: 14px; left: 14px; background: #fff; color: var(--navy-900); border-radius: 12px; padding: 6px 10px; text-align: center; line-height: 1; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.ecard__date b { display: block; font-family: var(--display); font-size: 1.5rem; font-weight: 700; }
.ecard__date span { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--brand-strong); }
.ecard__tag { position: absolute; top: 14px; right: 14px; }
.ecard__body { padding: 18px; }
.ecard__series { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: var(--cyan); }
.ecard__name { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 1.75rem; line-height: 1; margin: 4px 0 6px; display: flex; align-items: center; gap: 8px; }
.ecard__hill { font-size: .85rem; color: rgba(255, 255, 255, .75); }

/* ---------- Winners (home) ---------- */
.winners { display: grid; gap: 10px; }
.winner { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); color: var(--text); transition: border-color .15s, box-shadow .15s; }
.winner:hover { text-decoration: none; border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow); }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 1.3rem; color: var(--muted); border: 2px solid var(--gold); overflow: hidden; }
.avatar .flag { width: 30px; height: 30px; }
.winner__race { display: block; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.winner__who { font-weight: 800; font-size: 1.02rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.winner__where { display: block; font-size: .84rem; color: var(--muted); }

/* ---------- Tour band ---------- */
.tour-band { position: relative; border-radius: 24px; overflow: hidden; color: #fff; isolation: isolate; padding: 34px; background: linear-gradient(120deg, #1a1300, #4a3400 40%, #8a6200); }
.tour-band::after { content: ""; position: absolute; right: -60px; top: -60px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(245, 179, 0, .45), transparent 70%); z-index: -1; }
.tour-band h2 { font-family: var(--display); font-style: italic; font-weight: 800; text-transform: uppercase; font-size: clamp(2rem, 5vw, 3.2rem); line-height: .95; margin: 6px 0 8px; }
.tour-band .eyebrow { color: var(--gold); }
.tour-band__text { max-width: 640px; color: rgba(255, 255, 255, .8); }
.more--light { color: #fff; }
.tour-stops { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; counter-reset: stop; }
.tour-stops a { display: block; padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #fff; height: 100%; }
.tour-stops a:hover { text-decoration: none; background: rgba(255, 255, 255, .16); }
.tour-stops b { display: block; font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 1.25rem; line-height: 1.05; }
.tour-stops span { font-size: .82rem; color: rgba(255, 255, 255, .72); }
.tour-stops__n { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 2.2rem; color: var(--gold); line-height: 1; }
@media (max-width: 760px) { .tour-stops { grid-template-columns: 1fr 1fr; } .tour-band { padding: 24px; } }

/* ---------- App band ---------- */
.app-band { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); border-radius: 24px; overflow: hidden; background: var(--navy-900); color: #fff; isolation: isolate; }
.app-band__text { padding: 40px; }
.app-band__text h2 { font-family: var(--display); font-style: italic; font-weight: 800; text-transform: uppercase; font-size: clamp(2rem, 4.5vw, 3rem); line-height: .95; margin: 6px 0 12px; }
.app-band__text > p { color: rgba(255, 255, 255, .78); max-width: 520px; }
.app-band__photo { position: relative; min-height: 280px; }
.app-band__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.app-band__photo::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, var(--navy-900), transparent 45%); }
.app-band__credit { position: absolute; right: 8px; bottom: 6px; z-index: 2; margin: 0; font-size: .66rem; color: rgba(255, 255, 255, .8); background: rgba(4, 10, 28, .55); padding: 2px 8px; border-radius: 6px; }
.app-band__credit a { color: rgba(255, 255, 255, .75); }
.features { list-style: none; padding: 0; margin: 20px 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.features li { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: rgba(255, 255, 255, .88); }
.features li::before { content: ""; flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--cyan) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23081330'%3E%3Cpath d='M8.1 13.6 4.5 10l1.2-1.2 2.4 2.4 6.2-6.2 1.2 1.2z'/%3E%3C/svg%3E") center/14px no-repeat; }
@media (max-width: 860px) { .app-band { grid-template-columns: minmax(0, 1fr); } .app-band__photo { min-height: 220px; order: -1; } .app-band__photo::before { background: linear-gradient(0deg, var(--navy-900), transparent 60%); } .app-band__text { padding: 26px; } .features { grid-template-columns: minmax(0, 1fr); } }

/* Compact app call to action (event/race pages) */
.app-cta { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; padding: 20px; border-radius: var(--radius); background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); color: #fff; }
.app-cta img { border-radius: 14px; }
.app-cta strong { font-family: var(--display); text-transform: uppercase; font-size: 1.3rem; line-height: 1; }
.app-cta p { margin: 4px 0 0; color: rgba(255, 255, 255, .75); font-size: .9rem; }
.app-cta .stores { grid-column: 1 / -1; margin-top: 4px; }

/* Store badges */
.stores { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.store { display: inline-flex; align-items: center; gap: 10px; min-width: 160px; padding: 8px 16px; border-radius: 12px; background: #000; color: #fff; border: 1px solid rgba(255, 255, 255, .22); transition: transform .15s, border-color .15s; }
.store:hover { transform: translateY(-2px); text-decoration: none; border-color: rgba(255, 255, 255, .5); }
.store svg { width: 24px; height: 24px; flex-shrink: 0; }
.store__txt { display: flex; flex-direction: column; line-height: 1.1; }
.store__small { font-size: .66rem; opacity: .8; }
.store__big { font-size: 1.1rem; font-weight: 700; }
.store-soon { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); color: #fff; font-weight: 600; font-size: .9rem; }

/* ---------- Calendar ---------- */
.filters { position: sticky; top: var(--header-h); z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.filters__inner { display: flex; gap: 12px; align-items: center; padding-top: 10px; padding-bottom: 10px; }
.pills { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex-shrink: 0; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-weight: 650; font-size: .86rem; white-space: nowrap; }
.pill:hover { text-decoration: none; border-color: var(--brand); color: var(--text); }
.pill--active, .pill--active:hover { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
@media (prefers-color-scheme: dark) { .pill--active, .pill--active:hover { background: #fff; border-color: #fff; color: var(--navy-900); } }
.season-select { flex-shrink: 0; }
.season-select select { font: inherit; font-weight: 650; font-size: .86rem; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.month { margin-top: 36px; }
.month__title { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 1.6rem; margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; }
.month__title span { font-family: var(--font); font-size: .82rem; color: var(--muted); font-weight: 600; text-transform: none; }
.erow { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto 18px; gap: 16px; align-items: center; padding: 12px 16px 12px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s; }
.erow:hover { text-decoration: none; border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow); background: var(--hover); }
.erow::after { content: "›"; font-size: 1.5rem; line-height: 1; color: var(--muted); }
.erow:hover::after { color: var(--brand); }
.erow--cancelled { opacity: .65; }
.erow--cancelled .erow__name { text-decoration: line-through; }
.erow--tour { background: linear-gradient(90deg, rgba(245, 179, 0, .14), var(--surface) 60%); border-color: rgba(245, 179, 0, .45); }
.erow--live { border-color: rgba(255, 46, 77, .55); }
.datebox { text-align: center; border-radius: 12px; background: var(--surface-2); padding: 8px 4px; line-height: 1; }
.datebox b { display: block; font-family: var(--display); font-weight: 700; font-size: 1.45rem; white-space: nowrap; }
.datebox span { display: block; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--brand-strong); margin-top: 3px; }
@media (prefers-color-scheme: dark) { .datebox span { color: var(--cyan); } }
.erow__name { font-weight: 750; font-size: 1.06rem; display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; min-width: 0; }
.erow__hill { font-size: .84rem; font-weight: 600; color: var(--muted); }
.erow__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 5px; font-size: .82rem; color: var(--muted); }
.erow__thumb { width: 96px; height: 60px; border-radius: 10px; object-fit: cover; }
.erow__side { display: flex; align-items: center; gap: 12px; }
@media (max-width: 640px) {
  .erow { grid-template-columns: 64px minmax(0, 1fr) 14px; gap: 12px; }
  .erow__side { grid-column: 2; grid-row: 2; }
  .erow::after { grid-column: 3; grid-row: 1 / span 2; }
  .erow__thumb, .erow__hill { display: none; }
  .datebox b { font-size: 1.15rem; }
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; padding: 12px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; background: var(--surface); }
.table td { padding: 11px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover td { background: var(--hover); }
.table th a { color: inherit; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table .rank { font-family: var(--display); font-weight: 700; font-size: 1.15rem; width: 3.2em; }
.table .total { font-weight: 800; font-size: 1rem; }
.table .athlete { font-weight: 650; white-space: nowrap; }
.table .athlete__in { display: inline-flex; align-items: center; gap: 10px; }
.table .mini { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--surface-2); display: inline-grid; place-items: center; flex-shrink: 0; }
.table tr.rank-1 .rank { color: var(--gold); }
.table tr.rank-2 .rank { color: var(--silver); }
.table tr.rank-3 .rank { color: var(--bronze); }
.table .dist { font-weight: 600; }
.qmark { font-size: .66rem; font-weight: 800; color: #12703a; background: #def7e7; border-radius: 4px; padding: 1px 5px; }
.team__row td { background: var(--surface-2); font-weight: 750; }
.table tbody.team:hover .team__row td { background: var(--surface-2); }
.team__member td { font-size: .86rem; color: var(--text-2); }
.team__member td:nth-child(2) { white-space: nowrap; }
.table--program td { vertical-align: top; }
.table--program .program--competition td, .table--program .program--qualification td { font-weight: 650; }
.table--program td:first-child { width: 5em; font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
.table--program .day-row td { background: var(--surface-2); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding-top: 8px; padding-bottom: 8px; }

/* Podium cards (race page) */
.podium-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; margin-bottom: 20px; }
.pcard { position: relative; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 12px 16px; box-shadow: var(--shadow); }
.pcard--1 { order: 2; padding-top: 26px; border-top: 4px solid var(--gold); }
.pcard--2 { order: 1; border-top: 4px solid var(--silver); }
.pcard--3 { order: 3; border-top: 4px solid var(--bronze); }
.pcard .avatar { width: 84px; height: 84px; margin: 0 auto 10px; font-size: 1.6rem; }
.pcard--1 .avatar { width: 104px; height: 104px; }
.pcard--2 .avatar { border-color: var(--silver); }
.pcard--3 .avatar { border-color: var(--bronze); }
.pcard__rank { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 2rem; line-height: 1; }
.pcard--1 .pcard__rank { color: var(--gold); }
.pcard--2 .pcard__rank { color: var(--silver); }
.pcard--3 .pcard__rank { color: var(--bronze); }
.pcard__name { font-weight: 800; margin: 4px 0 2px; display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; }
.pcard__pts { font-family: var(--display); font-weight: 700; font-size: 1.3rem; }
.pcard__pts small { font-family: var(--font); font-size: .72rem; color: var(--muted); font-weight: 600; }
@media (max-width: 600px) { .podium-cards { gap: 8px; } .pcard { padding: 12px 6px; } .pcard .avatar { width: 56px; height: 56px; } .pcard--1 .avatar { width: 68px; height: 68px; } .pcard__name { font-size: .85rem; } }

.notice { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid rgba(255, 46, 77, .5); margin-bottom: 20px; font-weight: 600; }

/* Tour stages (tour event) */
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

/* Venue */
.venue__figure { margin: -22px -22px 16px; position: relative; }
.venue__figure img { width: 100%; display: block; aspect-ratio: 16 / 10; object-fit: cover; }
.venue__figure figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 6px; font-size: .66rem; color: rgba(255, 255, 255, .75); background: linear-gradient(0deg, rgba(0, 0, 0, .6), transparent); }
.venue__figure figcaption a { color: #fff; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0 0 14px; }
.facts dt { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; }
.facts dd { margin: 2px 0 0; font-weight: 700; }
.facts .big { font-family: var(--display); font-size: 1.6rem; line-height: 1; }
.venue__text { font-size: .92rem; color: var(--text-2); }

.runs { margin: 8px 0 0; padding-left: 1.2em; }
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }

/* Prev/next */
.neighbours { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.neighbour { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); }
.neighbour:hover { text-decoration: none; border-color: var(--brand); }
.neighbour small { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--muted); }
.neighbour b { font-family: var(--display); text-transform: uppercase; font-size: 1.3rem; line-height: 1.05; }
.neighbour--next { text-align: right; grid-column: 2; }

.prose { max-width: 820px; color: var(--text-2); }
.prose h2 { margin-bottom: 10px; }

/* Legal pages */
.doc { max-width: 780px; margin: 36px auto 0; padding: 36px 32px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); line-height: 1.7; }
.doc h1 { font-family: var(--display); text-transform: uppercase; font-size: 2.4rem; margin: 0 0 6px; }
.doc h2 { margin: 28px 0 8px; font-size: 1.15rem; }
@media (max-width: 760px) { .doc { padding: 24px 18px; margin-top: 20px; } }

/* Header app buttons (→ /app) */
.btn-app svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-app + .btn-app { margin-left: -2px; }
.btn-app--active { background: var(--cyan); }

/* App page: one card per store with its QR code */
.stores-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 760px) { .stores-grid { grid-template-columns: minmax(0, 1fr); } }
.store-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; align-items: center; text-align: center; scroll-margin-top: calc(var(--header-h) + 16px); }
.store-card:target { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent), var(--shadow); }
.store-card__head { display: flex; align-items: center; gap: 14px; align-self: stretch; text-align: left; margin-bottom: 22px; }
.store-card__head h2 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 1.9rem; line-height: 1; }
.store-card__head p { margin: 4px 0 0; }
.store-card__icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.store-card__icon svg { width: 30px; height: 30px; }
.store-card__icon--android { background: #3ddc84; color: #0b2e1a; }
.store-card__icon--ios { background: #111; }
.qr { background: #fff; padding: 14px; border-radius: 18px; border: 1px solid var(--line); width: min(240px, 100%); }
.qr__svg { display: block; width: 100%; height: auto; }
.qr__hint { margin: 14px 0 18px; color: var(--muted); font-size: .9rem; }
.stores--center { justify-content: center; }

/* Race page, live: the latest jump + who jumps next */
.live-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
@media (max-width: 640px) { .live-card { grid-template-columns: minmax(0, 1fr); } }
.live-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.live-tile--last { border-left: 4px solid #22c55e; }
.live-tile--next { border-left: 4px solid var(--brand); }
.live-tile__label { margin: 0; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.live-tile__who { display: flex; align-items: center; gap: 12px; }
.live-tile__who > div { display: flex; flex-direction: column; min-width: 0; }
.live-tile__who b { font-size: 1.05rem; }
.live-tile__nums { display: flex; gap: 18px; flex-wrap: wrap; }
.live-tile__nums span { color: var(--muted); font-size: .9rem; }
.live-tile__nums b { font-family: var(--display); font-weight: 700; font-size: 1.8rem; color: var(--text); line-height: 1; }
.avatar--sm { width: 44px; height: 44px; font-size: 1rem; border-width: 2px; border-color: var(--line); }

/* Result tables: the athlete's name links to the jump page and covers the whole row */
.linkrow { position: relative; }
.rowlink { color: inherit; }
.rowlink::after { content: ""; position: absolute; inset: 0; }
.rowlink:hover { text-decoration: none; }
.table tbody tr.linkrow:hover .rowlink { color: var(--link); }
.rowlink:focus-visible { outline: none; }
.linkrow:focus-within td { box-shadow: inset 0 0 0 2px var(--brand); }
a.pcard { display: block; color: inherit; }
a.pcard:hover { text-decoration: none; border-color: var(--brand); }
.fact--strong { background: #fff; color: var(--navy-900); border-color: #fff; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--chip); color: var(--chip-text); font-size: .78rem; font-weight: 700; }
.btn { display: inline-flex; align-items: center; padding: 9px 16px; border-radius: 999px; border: 0; background: var(--navy-900); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.btn--small { padding: 7px 14px; font-size: .86rem; }

/* Jump page */
.compare { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 20px; }
.compare__label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.compare__select { flex: 1; min-width: 0; max-width: 100%; font: inherit; font-weight: 650; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.card + .jcard, .compare + .jcard, .compare + .card { margin-top: 20px; }
.jcard__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.jcard__top { display: flex; align-items: baseline; gap: 22px; flex-wrap: wrap; margin: 4px 0 16px; }
.jcard__big, .jcard__pts, .jcard__status { margin: 0; }
.jcard__big b { font-family: var(--display); font-weight: 800; font-size: 3.2rem; line-height: 1; color: var(--brand); }
.jcard__big { color: var(--muted); font-weight: 700; }
.jcard__pts b { font-family: var(--display); font-weight: 700; font-size: 1.9rem; line-height: 1; }
.jcard__pts { color: var(--muted); font-weight: 650; }
.jcard__status { font-family: var(--display); font-weight: 800; font-size: 1.8rem; color: var(--live); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border-left: 3px solid var(--line); }
.tile--head { border-left-color: #16a34a; }
.tile--tail { border-left-color: #ea580c; }
.tile__label { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.tile__value { font-family: var(--display); font-weight: 700; font-size: 1.6rem; line-height: 1.05; }
.tile__value small { font-family: var(--font); font-size: .78rem; font-weight: 600; color: var(--muted); }
.tile__sub { font-size: .8rem; font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; }
.breakdown { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.breakdown__part { display: flex; flex-direction: column; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.breakdown__part b { font-size: 1.05rem; }
.breakdown__label { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.breakdown__part--sum { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.breakdown__part--sum .breakdown__label { color: rgba(255, 255, 255, .7); }
.judges__label { margin: 0 0 8px; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.judges__row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.judge { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: var(--radius-sm); background: var(--chip); color: var(--chip-text); font-variant-numeric: tabular-nums; }
.judge b { font-size: 1.05rem; }
.judge--out { background: var(--surface-2); color: var(--muted); }
.judge--out b { text-decoration: line-through; font-weight: 600; }
.judge--out .flag { opacity: .5; }
.judge--sum { background: var(--navy-900); color: #fff; }
.judge__n { font-weight: 800; font-size: .8rem; line-height: 20px; }
.table--compare th[scope="row"] { font-size: .86rem; text-transform: none; letter-spacing: 0; color: var(--text-2); font-weight: 600; border-bottom: 0; border-top: 1px solid var(--line); padding: 9px 10px 9px 20px; background: transparent; }
.table--compare .group-row td { background: var(--surface-2); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding-top: 7px; padding-bottom: 7px; }
.table--compare .total-row td, .table--compare .total-row th[scope="row"] { font-weight: 800; color: var(--text); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.swatch--a { background: var(--brand); }
.swatch--b { background: #eb6834; }
.diff { font-weight: 700; }
.diff--good { color: #15803d; }
.diff--bad { color: #c2410c; }
.athlete-card__head { display: flex; align-items: center; gap: 14px; }
.athlete-card__name { margin: 0; font-weight: 800; font-size: 1.1rem; }
.athlete-card__head p { margin: 2px 0 0; }
.athlete-card__links { display: flex; gap: 16px; flex-wrap: wrap; margin: 14px 0 0; }
.table--mini { font-size: .88rem; }
.table--mini td { padding-top: 8px; padding-bottom: 8px; }
.table--mini .rank { font-size: 1rem; width: 2.4em; }
.table--mini tr.is-current td { background: var(--chip); font-weight: 800; }
.table--mini .gap-row td { text-align: center; color: var(--muted); padding: 2px; }

/* Athlete page */
.profile { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: start; }
.avatar--xl { width: 132px; height: 132px; border-width: 3px; }
.avatar--xl .flag { width: 64px; height: 64px; }
.profile .facts { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
@media (max-width: 640px) { .profile { grid-template-columns: minmax(0, 1fr); } .avatar--xl { width: 96px; height: 96px; } }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.stat__label { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.stat__value { font-family: var(--display); font-weight: 700; font-size: 1.75rem; line-height: 1.05; }
.stat__sub { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-main { display: block; font-weight: 650; }
.cell-sub { display: block; font-size: .8rem; color: var(--muted); }
.table--athlete td { vertical-align: middle; }

@media (prefers-color-scheme: dark) {
  .fact--strong { background: var(--cyan); border-color: var(--cyan); color: var(--navy-950); }
  .btn, .breakdown__part--sum, .judge--sum { background: var(--brand); border-color: var(--brand); }
  .diff--good { color: #4ade80; }
  .diff--bad { color: #fb923c; }
  .swatch--b { background: #f0803f; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .compare__select { flex-basis: 100%; }
  .table--compare { font-size: .82rem; }
  .table--compare th, .table--compare td { padding: 8px 6px; }
  .table--compare th[scope="row"] { padding-left: 14px; font-size: .8rem; }
  .table--compare th:last-child, .table--compare td:last-child { padding-right: 14px; }
  .table--athlete td, .table--athlete th { padding-left: 8px; padding-right: 8px; }
  .table--athlete th:first-child, .table--athlete td:first-child { padding-left: 14px; }
  .jcard__big b { font-size: 2.6rem; }
}
a.athlete-card__head { color: inherit; border-radius: var(--radius-sm); }
a.athlete-card__head:hover { text-decoration: none; }
a.athlete-card__head:hover .athlete-card__name { color: var(--link); }
a.athlete-card__head:hover .avatar { border-color: var(--brand); }

/* Result tables: nation under the name (no own column), names may wrap, gap to the leader under the total.
   Phones: only rank · athlete · total — round columns hidden (.hide-sm), distances under the name (.only-sm). */
.table--results .athlete { white-space: normal; min-width: 11em; }
.table--results .athlete__in { display: flex; }
.athlete__text { display: flex; flex-direction: column; min-width: 0; }
.athlete__name { display: block; line-height: 1.25; }
.athlete__sub { display: block; margin-top: 2px; font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.athlete__sub .nation-code { font-size: .76rem; }
.athlete__sub .flag:not(.flag--text) { width: 14px; height: 14px; }
.behind { display: block; font-size: .74rem; font-weight: 600; color: var(--muted); }
.only-sm { display: none; }
@media (max-width: 640px) {
  .only-sm { display: inline; }
  .athlete__sub.only-sm { display: block; }
  .table--results { font-size: .88rem; }
  .table--results th, .table--results td { padding-left: 6px; padding-right: 6px; }
  .table--results th:first-child, .table--results td:first-child { padding-left: 12px; }
  .table--results th:last-child, .table--results td:last-child { padding-right: 14px; }
  .table--results .rank { width: 2.2em; }
  .table--results .athlete { min-width: 0; }
  .table--results .athlete__in { gap: 8px; }
  .table--results .mini { width: 26px; height: 26px; }
  .team__member td:nth-child(2) { white-space: normal; }
}

/* Race videos: facade (preview image served by us + "accept cookies and play") until clicked, then the YouTube player — both 16:9 */
.videos__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.video__facade, .video__frame { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-sm); overflow: hidden; }
.video__facade { background: linear-gradient(180deg, rgba(6, 18, 40, .55), rgba(6, 18, 40, .15) 40%, rgba(6, 18, 40, .7)), var(--video-bg, none) center / cover, var(--navy-900); color: #fff; }
.video__facade:hover { text-decoration: none; }
.video__title { position: absolute; left: 14px; right: 14px; top: 12px; font-weight: 700; line-height: 1.25; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video__accept { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; max-width: calc(100% - 28px); padding: 9px 18px 9px 10px; border-radius: 999px; background: rgba(255, 255, 255, .95); color: var(--navy-900); font-weight: 800; font-size: .9rem; line-height: 1.2; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); transition: transform .15s ease; }
.video__play { position: relative; flex: none; width: 34px; height: 24px; border-radius: 7px; background: #e62117; }
.video__play::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%); border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent #fff; }
.video__facade:hover .video__accept, .video__facade:focus-visible .video__accept { transform: translateX(-50%) scale(1.04); }
.video__note { margin: 10px 0 0; }
@media (max-width: 640px) {
  .video__title { -webkit-line-clamp: 1; font-size: .9rem; left: 12px; right: 12px; top: 10px; }
  .video__accept { bottom: 10px; gap: 8px; padding: 6px 12px 6px 7px; font-size: .76rem; }
  .video__play { width: 28px; height: 20px; border-radius: 6px; }
  .video__play::after { border-width: 5px 0 5px 8px; }
}
