/* ═══════════════════════════════════════════════
   CIRCUIT DESIGN SYSTEM — F1 2026 Fan Portal
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,400;0,600;0,700;0,900;1,900&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ── Backgrounds ── */
  --bg-deep: #080a0d;
  --bg: #0d1014;
  --bg-elevated: #151a20;
  --bg-surface: #1c222a;
  --bg-hover: #242b35;

  /* ── Accent ── */
  --red: #e10600;
  --red-hover: #ff1a0e;
  --red-dim: rgba(225, 6, 0, 0.08);
  --red-glow: rgba(225, 6, 0, 0.18);

  /* ── Data Accent (timing screen teal) ── */
  --teal: #00d2be;
  --teal-hover: #00f0d8;
  --teal-dim: rgba(0, 210, 190, 0.08);
  --teal-glow: rgba(0, 210, 190, 0.15);

  /* ── Podium ── */
  --gold: #ffd700;
  --silver: #a8b0bc;
  --bronze: #cd7f32;

  /* ── Text ── */
  --text: #eef0f4;
  --text-secondary: #8892a4;
  --text-tertiary: #7e8a9e;
  --text-muted: #4d5666;

  /* ── Borders ── */
  --border: #252b33;
  --border-light: #303740;
  --border-subtle: #1e232b;

  /* ── Typography ── */
  --display: 'Barlow Condensed', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;

  /* ── Radii ── */
  --r-sm: 2px;
  --r: 4px;
  --r-lg: 8px;
  --r-full: 9999px;

  /* ── Spacing ── */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;

  /* ── Layout ── */
  --nav-h: 56px;
  --timing-h: 40px;
  --max-w: 1280px;
}

/* ═══ RESET ═══ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--timing-h) + 8px);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--red-dim);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }

/* ── Skip-to-content link ── */
.skip-link {
  position: fixed;
  top: -100%;
  left: var(--s-3);
  z-index: 10000;
  padding: 8px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--teal);
  border-radius: var(--r-sm);
  color: var(--teal);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  transition: top 0.15s;
}
.skip-link:focus {
  top: var(--s-3);
}

/* ── SVG icon base ── */
svg.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  flex-shrink: 0;
}
.icon-lg { width: 1.4em; height: 1.4em; }
.icon-sm { width: 0.8em; height: 0.8em; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

/* ═══ TYPOGRAPHY ═══ */
.display { font-family: var(--display); }
.mono { font-family: var(--mono); }
.body { font-family: var(--body); }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
}

/* ═══ NAVIGATION ═══ */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(8, 10, 13, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--s-6);
  gap: var(--s-4);
  z-index: 1000;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-shrink: 0;
}

.nav-logo svg {
  height: 24px;
  width: auto;
}

.nav-logo-text {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text);
}

.nav-logo-text em {
  color: var(--red);
  font-style: normal;
}

.nav-links {
  display: flex;
  gap: 2px;
  margin-left: var(--s-2);
}

.nav-links a {
  display: block;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  border-radius: var(--r-sm);
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.nav-links a.active {
  color: var(--red);
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.nav-round {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.4px;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--red);
  padding: 4px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--red-dim);
  background: var(--red-dim);
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
  animation: pulse-dot 1.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* ═══ TIMING STRIP (signature element) ═══ */
.timing-strip {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  height: var(--timing-h);
  background: rgba(8, 10, 13, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 var(--s-6);
  z-index: 999;
  overflow: hidden;
}

.timing-strip-inner {
  display: flex;
  gap: 0;
  align-items: center;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
}

.strip-label {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--teal);
  flex-shrink: 0;
  margin-right: var(--s-4);
  width: 44px;
}

.strip-entries {
  display: flex;
  gap: 0;
  flex: 1;
  overflow: hidden;
}

.strip-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 2px;
  border-right: 1px solid var(--border-subtle);
  flex: 1;
  font-family: var(--mono);
  font-size: 9px;
  height: var(--timing-h);
  cursor: default;
  min-width: 0;
}

.strip-pos {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 9px;
  width: 12px;
  text-align: right;
  flex-shrink: 0;
}

.strip-pos.p1 { color: var(--gold); }
.strip-pos.p2 { color: var(--silver); }
.strip-pos.p3 { color: var(--bronze); }

.strip-driver {
  font-weight: 600;
  font-size: 11px;
  color: var(--text);
  letter-spacing: 0.3px;
}

.strip-team-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.strip-gap {
  font-size: 9px;
  color: var(--text-tertiary);
  text-align: right;
  flex-shrink: 0;
}

.strip-gap.leader {
  color: var(--teal);
}

.strip-status {
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 1px 4px;
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ═══ PAGE CONTENT WRAPPER ═══ */
.page-wrap {
  padding-top: calc(var(--nav-h) + var(--timing-h));
}

/* ═══ HERO ═══ */
.hero {
  min-height: 420px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 30% 50%, rgba(225, 6, 0, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 70% 30%, rgba(0, 210, 190, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--s-16) var(--s-6);
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.hero-eyebrow::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--red);
}

.hero-round {
  font-family: var(--display);
  font-size: clamp(80px, 15vw, 180px);
  font-weight: 900;
  line-height: 0.85;
  color: transparent;
  -webkit-text-stroke: 2px var(--text-muted);
  text-stroke: 2px var(--text-muted);
  opacity: 0.3;
  position: absolute;
  right: var(--s-6);
  bottom: var(--s-4);
  pointer-events: none;
  user-select: none;
}

.hero-title {
  font-family: var(--display);
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: -0.5px;
  max-width: 700px;
  margin-bottom: var(--s-3);
}

.hero-title em {
  font-style: normal;
  color: var(--red);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-bottom: var(--s-6);
}

.hero-circuit {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-secondary);
}

.hero-dates {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.hero-status {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: var(--r-sm);
}

.hero-status.live {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(225, 6, 0, 0.2);
}

.hero-status.upcoming {
  background: var(--teal-dim);
  color: var(--teal);
  border: 1px solid rgba(0, 210, 190, 0.2);
}

.hero-ctas {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 10px 22px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border-radius: var(--r);
  transition: all 0.15s;
}

.btn-primary {
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
}

.btn-primary:hover {
  background: var(--red-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--text-tertiary);
}

/* ═══ SECTION LAYOUT ═══ */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--s-12) var(--s-6);
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.section-header {
  display: flex;
  align-items: flex-end;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}

.section-eyebrow {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red);
  flex-shrink: 0;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.3px;
  line-height: 1;
}

.section-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-tertiary);
  margin-left: auto;
  flex-shrink: 0;
}

/* ═══ STREAM SECTION ═══ */
.stream-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.stream-sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

.stream-sb-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.stream-sb-count {
  font-size: 10px;
  color: var(--text-tertiary);
}

.stream-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-deep);
}

.stream-tab {
  flex: 1;
  padding: 6px 2px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.stream-tab:hover {
  color: var(--text-secondary);
}

.stream-tab.active {
  color: var(--red);
  border-bottom-color: var(--red);
}

.stream-scroll {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
}

.stream-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.12s;
}

.stream-row:hover {
  background: var(--bg-surface);
}

.stream-row.active {
  background: var(--red-dim);
  border-left: 3px solid var(--red);
}

.stream-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.stream-cat {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--red);
  background: var(--red-dim);
  padding: 2px 5px;
  border-radius: var(--r-sm);
}

.stream-time {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-tertiary);
}

.stream-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 3px;
}

.stream-chips {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.stream-chip {
  font-family: var(--mono);
  font-size: 7px;
  padding: 1px 5px;
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
}

.stream-chip.hd {
  color: var(--teal);
  border-color: var(--teal-dim);
  background: var(--teal-dim);
}

.stream-player {
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
}

.stream-video {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  flex-shrink: 0;
  overflow: hidden;
}

.stream-video iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: none;
}

.stream-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  background: linear-gradient(135deg, var(--bg-deep), var(--bg-elevated));
}

.stream-placeholder-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
}

.stream-placeholder-title {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.stream-placeholder-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
}

.stream-controls {
  padding: var(--s-4);
  border-top: 1px solid var(--border);
}

.stream-match-name {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
}

.stream-session-type {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.stream-source-btns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: var(--s-3);
}

.stream-src-btn {
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
}

.stream-src-btn:hover {
  border-color: var(--text-tertiary);
  color: var(--text);
}

.stream-src-btn.active {
  background: var(--red-dim);
  border-color: rgba(225, 6, 0, 0.3);
  color: var(--red);
}

.stream-note {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-muted);
  margin-top: var(--s-3);
}

.stream-error {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  padding: var(--s-10);
  text-align: center;
}

.stream-error.show {
  display: flex;
}

.stream-err-title {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.stream-err-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 320px;
}

.stream-alt-links {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-top: var(--s-2);
}

.stream-alt-link {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 8px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-secondary);
  transition: all 0.12s;
}

.stream-alt-link:hover {
  border-color: var(--red-dim);
  color: var(--red);
  background: var(--red-dim);
}

/* ═══ STANDINGS TABLE ═══ */
.standings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}

.standings-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.standings-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elevated);
}

.standings-header-title {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.standings-row {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-subtle);
  gap: var(--s-2);
  transition: background 0.12s;
  cursor: pointer;
}

.standings-row:hover {
  background: var(--bg-elevated);
}

.standings-row:last-child {
  border-bottom: none;
}

.st-pos {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.st-pos.p1 { color: var(--gold); }
.st-pos.p2 { color: var(--silver); }
.st-pos.p3 { color: var(--bronze); }
.st-pos.px { color: var(--text-tertiary); }

.st-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 7px;
}

.st-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.st-team-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.st-name {
  font-size: 12px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.st-team {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-tertiary);
  margin-top: 1px;
}

.st-bar-wrap {
  width: 48px;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  flex-shrink: 0;
}

.st-bar-fill {
  height: 100%;
  border-radius: 1px;
  transition: width 0.6s ease;
}

.st-pts {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
}

.st-pts-label {
  font-family: var(--mono);
  font-size: 7px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  text-align: right;
}

/* ═══ DRIVER GRID ═══ */
.driver-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-3);
}

.driver-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
  cursor: pointer;
  background: var(--bg-elevated);
}

.driver-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.driver-card-bar {
  height: 3px;
  width: 100%;
}

.driver-card-body {
  padding: var(--s-4);
}

.driver-card-top {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}

.driver-photo-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  background: var(--bg-surface);
}

.driver-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.driver-photo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 900;
}

.driver-info {
  flex: 1;
  min-width: 0;
}

.driver-abbr {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-tertiary);
}

.driver-name {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  line-height: 1.1;
  margin-top: 1px;
}

.driver-team {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.driver-number {
  font-family: var(--display);
  font-size: 38px;
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -2px;
  opacity: 0.08;
  position: absolute;
  top: 6px;
  right: 8px;
  pointer-events: none;
}

.driver-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border-subtle);
}

.driver-pts {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
}

.driver-pts small {
  font-size: 9px;
  color: var(--text-tertiary);
  margin-left: 2px;
}

.driver-pos-badge {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pos-gold {
  background: rgba(255, 215, 0, 0.12);
  color: var(--gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.pos-silver {
  background: rgba(168, 176, 188, 0.1);
  color: var(--silver);
  border: 1px solid rgba(168, 176, 188, 0.25);
}

.pos-bronze {
  background: rgba(205, 127, 50, 0.1);
  color: var(--bronze);
  border: 1px solid rgba(205, 127, 50, 0.25);
}

.pos-other {
  background: var(--bg-surface);
  color: var(--text-tertiary);
  border: 1px solid var(--border);
}

.driver-extra {
  display: flex;
  gap: var(--s-2);
  padding-top: var(--s-2);
  margin-top: var(--s-2);
  border-top: 1px solid var(--border-subtle);
}

.driver-stat {
  flex: 1;
  text-align: center;
}

.driver-stat-val {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.driver-stat-label {
  font-family: var(--mono);
  font-size: 7px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

/* ═══ CALENDAR ═══ */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-3);
}

.race-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s-4);
  transition: border-color 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
  background: var(--bg-elevated);
}

.race-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.race-card.past {
  opacity: 0.4;
}

.race-card.current {
  border-color: rgba(225, 6, 0, 0.3);
}

.race-card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.race-card:hover .race-card-accent,
.race-card.current .race-card-accent {
  transform: scaleX(1);
}

.race-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--s-2);
}

.race-round {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.race-flag {
  font-size: 22px;
  line-height: 1;
}

.race-name {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.15;
}

.race-circuit-name {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.race-dates {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: var(--s-2);
}

.race-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border-subtle);
}

.race-status {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--r-sm);
}

.race-status.done {
  background: var(--bg-surface);
  color: var(--text-tertiary);
}

.race-status.live {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(225, 6, 0, 0.2);
  animation: stat-pulse 2s infinite;
}

.race-status.upcoming {
  background: var(--teal-dim);
  color: var(--teal);
  border: 1px solid rgba(0, 210, 190, 0.2);
}

.race-status.cancelled {
  background: var(--bg-deep);
  color: var(--text-muted);
}

@keyframes stat-pulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 8px rgba(225, 6, 0, 0.15); }
}

.race-tag {
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: var(--r-sm);
  background: rgba(255, 215, 0, 0.1);
  color: var(--gold);
  border: 1px solid rgba(255, 215, 0, 0.2);
  display: inline-block;
}

.race-schedule {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: var(--s-3);
  margin-top: var(--s-3);
  border-top: 1px solid var(--border-subtle);
}

.race-sched-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-tertiary);
}

.race-sched-row.race {
  color: var(--text);
  font-weight: 600;
}

/* ═══ TRACKS GRID ═══ */
.tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--s-3);
}

.track-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
  cursor: pointer;
  background: var(--bg-elevated);
}

.track-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.track-img-wrap {
  height: 100px;
  overflow: hidden;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.track-img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  filter: brightness(0.85) contrast(1.1) saturate(0.7) hue-rotate(200deg);
  transition: transform 0.3s;
}

.track-card:hover .track-img {
  transform: scale(1.06);
}

.track-country {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 16px;
}

.track-type-badge {
  position: absolute;
  top: 6px;
  right: 8px;
}

.track-info {
  padding: var(--s-3);
}

.track-name {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.track-city {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--text-tertiary);
  margin-top: 1px;
}

.track-stats {
  display: flex;
  justify-content: space-between;
  margin-top: var(--s-2);
  padding-top: var(--s-2);
  border-top: 1px solid var(--border-subtle);
}

.track-stat {
  text-align: center;
  flex: 1;
}

.track-stat-value {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.track-stat-label {
  font-family: var(--mono);
  font-size: 7px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

/* ═══ TEAMS GRID ═══ */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s-3);
}

.team-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
  background: var(--bg-elevated);
}

.team-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.team-card-top {
  padding: var(--s-4);
}

.team-header {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}

.team-bar {
  width: 4px;
  height: 32px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.team-logo-wrap {
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.team-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
  filter: brightness(1.1);
}

.team-name {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  flex: 1;
}

.team-pts {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  text-align: right;
}

.team-pts-bar {
  height: 2px;
  background: var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.team-pts-fill {
  height: 100%;
  border-radius: var(--r-sm);
  transition: width 0.8s ease;
}

.team-drivers {
  display: flex;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.team-driver {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg-surface);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
}

.team-driver-num {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.team-driver-name {
  font-size: 10px;
  font-weight: 600;
  margin-top: 2px;
}

.team-driver-pts {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--text-tertiary);
  margin-top: 1px;
}

/* ═══ HIGHLIGHTS GRID ═══ */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s-3);
}

.highlight-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
  cursor: pointer;
  background: var(--bg-elevated);
}

.highlight-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.highlight-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--bg-surface);
  overflow: hidden;
}

.highlight-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.highlight-card:hover .highlight-thumb img {
  transform: scale(1.06);
}

.highlight-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 20%, transparent 70%);
  opacity: 0;
  transition: opacity 0.2s;
}

.highlight-card:hover .highlight-overlay {
  opacity: 1;
}

.highlight-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.highlight-card:hover .highlight-play {
  opacity: 1;
}

.play-btn-circle {
  width: 46px;
  height: 46px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 20px var(--red-glow);
  transition: transform 0.12s;
}

.highlight-card:hover .play-btn-circle {
  transform: scale(1.08);
}

.highlight-duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  background: rgba(0,0,0,0.85);
  padding: 2px 6px;
  border-radius: var(--r-sm);
}

.highlight-info {
  padding: var(--s-3);
}

.highlight-tag {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--red);
}

.highlight-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2px;
}

.highlight-meta {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ═══ VIDEO MODAL ═══ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 8, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  padding: var(--s-6);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  width: 100%;
  max-width: 800px;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.2s;
}

.modal-overlay.open .modal-box {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4);
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.modal-close {
  width: 28px;
  height: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-tertiary);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--border-light);
}

.modal-video {
  aspect-ratio: 16/9;
  background: #000;
}

.modal-video video,
.modal-video iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ═══ DRIVER & TRACK DETAIL PAGES ═══ */
.detail-page {
  min-height: calc(100vh - var(--nav-h) - var(--timing-h));
  padding: var(--s-8) var(--s-6);
  display: none;
}

.detail-page.active {
  display: block;
}

.detail-container {
  max-width: var(--max-w);
  margin: 0 auto;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: all 0.12s;
  margin-bottom: var(--s-6);
}

.back-btn:hover {
  color: var(--text);
  border-color: var(--border-light);
}

.detail-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  min-height: 520px;
}

.detail-left {
  padding: var(--s-8) var(--s-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
  position: relative;
}

.detail-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.detail-photo-wrap {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.06);
  margin-bottom: var(--s-5);
}

.detail-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.detail-name {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
  line-height: 1;
}

.detail-team-label {
  font-family: var(--mono);
  font-size: 11px;
  margin-top: var(--s-2);
}

.detail-number {
  font-family: var(--display);
  font-size: 64px;
  font-weight: 900;
  opacity: 0.08;
  position: absolute;
  bottom: var(--s-4);
  right: var(--s-4);
  pointer-events: none;
  user-select: none;
}

.detail-stats {
  display: flex;
  gap: var(--s-3);
  margin-top: var(--s-6);
  width: 100%;
}

.detail-stat-box {
  flex: 1;
  text-align: center;
  background: var(--bg-surface);
  padding: var(--s-3);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
}

.detail-stat-value {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
}

.detail-stat-label {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.detail-right {
  display: flex;
  flex-direction: column;
}

.detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.detail-tab {
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s;
}

.detail-tab:hover {
  color: var(--text-secondary);
}

.detail-tab.active {
  color: var(--text);
  border-bottom-color: var(--red);
}

.detail-pane {
  padding: var(--s-8);
  flex: 1;
  overflow-y: auto;
  display: none;
}

.detail-pane.active {
  display: block;
}

.detail-pane-title {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 1.5px;
  margin-bottom: var(--s-4);
}

.detail-pane-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--s-6);
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
  background: var(--bg-surface);
  padding: var(--s-4);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
  max-width: 480px;
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.detail-meta-label {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 10px;
}

.detail-meta-value {
  font-weight: 600;
  font-size: 13px;
}

/* ── Detail: career stats grid ── */
.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--s-3);
}

.detail-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: var(--s-4);
  border-radius: var(--r-sm);
  text-align: center;
}

.detail-stat-card-value {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
}

.detail-stat-card-value.gold { color: var(--gold); }

.detail-stat-card-label {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: var(--s-1);
}

/* ── Detail: races grid ── */
.detail-races-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--s-2);
}

.detail-race-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-2) var(--s-3);
  background: var(--bg-surface);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
}

.detail-race-name {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

.detail-race-pos {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
}

/* ── Detail: videos grid ── */
.detail-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-3);
}

.detail-video-item {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-3);
  background: var(--bg-surface);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color 0.12s;
}

.detail-video-item:hover {
  border-color: var(--border-light);
}

.detail-video-thumb {
  width: 90px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.detail-video-title {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-video-meta {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-tertiary);
  margin-top: var(--s-1);
}

/* ═══ TELEMETRY GRID ═══ */
.telem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--s-3);
}

.telem-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s-4);
  position: relative;
  overflow: hidden;
  transition: border-color 0.12s;
  background: var(--bg-elevated);
}

.telem-card:hover {
  border-color: var(--border-light);
}

.telem-card-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.telem-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: var(--s-3);
}

.telem-value {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.5px;
}

.telem-unit {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.telem-label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: var(--s-2);
}

.telem-progress {
  height: 2px;
  background: var(--border);
  border-radius: var(--r-sm);
  margin-top: var(--s-2);
}

.telem-progress-fill {
  height: 100%;
  border-radius: var(--r-sm);
  transition: width 0.8s ease;
}

/* ═══ INFO PANELS ═══ */
.info-panels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--s-3);
  margin-top: var(--s-4);
}

.info-panel {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s-4);
  background: var(--bg-elevated);
}

.info-panel-title {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--s-3);
}

/* Tyre circles */
.tyre-row {
  display: flex;
  gap: var(--s-3);
}

.tyre {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 900;
  border: 3px solid;
  transition: transform 0.12s;
  cursor: default;
}

.tyre:hover { transform: scale(1.1); }
.tyre-soft { background: rgba(255,255,255,0.08); border-color: #fff; color: #fff; }
.tyre-medium { background: rgba(255,215,0,0.12); border-color: var(--gold); color: var(--gold); }
.tyre-hard { background: rgba(136,136,136,0.1); border-color: #888; color: #888; }
.tyre-inter { background: rgba(0,210,190,0.12); border-color: var(--teal); color: var(--teal); }
.tyre-wet { background: rgba(0,210,190,0.08); border-color: var(--teal); color: var(--teal); opacity: 0.6; }

.tyre-label {
  font-family: var(--mono);
  font-size: 7px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 2px;
}

/* DRS badges */
.drs-badge {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: 1px solid;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.drs-on {
  background: rgba(0, 210, 190, 0.08);
  border-color: rgba(0, 210, 190, 0.3);
  color: var(--teal);
}

.drs-off {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-muted);
}

/* ═══ FOOTER ═══ */
footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--s-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-4);
  border-top: 1px solid var(--border);
}

.footer-logo {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.footer-logo em { color: var(--red); font-style: normal; }

.footer-note {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: var(--s-4);
}

.footer-links a {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-tertiary);
  transition: color 0.12s;
}

.footer-links a:hover {
  color: var(--red);
}

/* ═══ UTILITIES ═══ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-10);
  color: var(--text-tertiary);
  font-family: var(--mono);
  font-size: 11px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  padding: var(--s-10);
  text-align: center;
  color: var(--text-tertiary);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.8;
}

/* ── Fade in on scroll ── */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Badge system ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
}

.badge-red { background: var(--red-dim); color: var(--red); border-color: rgba(225,6,0,0.2); }
.badge-teal { background: var(--teal-dim); color: var(--teal); border-color: rgba(0,210,190,0.2); }
.badge-muted { background: var(--bg-surface); color: var(--text-tertiary); border-color: var(--border); }
.badge-gold { background: rgba(255,215,0,0.1); color: var(--gold); border-color: rgba(255,215,0,0.25); }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
  .standings-grid { grid-template-columns: 1fr; }
  .info-panels { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-left { border-right: none; border-bottom: 1px solid var(--border); }
}

@media (max-width: 900px) {
  .stream-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .stream-sidebar { max-height: 260px; }
  nav { gap: 0; padding: 0 var(--s-3); }
  .nav-links {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-left: 0;
    flex: 1;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a {
    white-space: nowrap;
    padding: 6px 8px;
    font-size: 10px;
    min-width: auto;
  }
  .nav-logo-text { font-size: 13px; letter-spacing: 1px; }
  .nav-logo svg { height: 20px; }
  .nav-round { display: none; }
  .live-pill { padding: 3px 8px; gap: 4px; }
  .live-pill span:last-child { font-size: 8px; }
  .section { padding: var(--s-8) var(--s-4); }
}

@media (max-width: 680px) {
  :root {
    --s-4: 12px;
    --s-6: 14px;
    --s-8: 20px;
    --s-10: 28px;
    --s-12: 28px;
    --s-16: 36px;
    --s-20: 48px;
  }

  .hero-round { display: none; }
  .timing-strip { display: none; }
  .page-wrap { padding-top: var(--nav-h); }
  html { scroll-padding-top: calc(var(--nav-h) + 8px); }

  .info-panels { grid-template-columns: 1fr; }
  .calendar-grid { grid-template-columns: 1fr; }
  .driver-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s-2); }
  .tracks-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s-2); }
  .teams-grid { gap: var(--s-2); }

  .detail-left { padding: var(--s-6) var(--s-4); }
  .detail-right { padding: var(--s-4); }
  .detail-stats { flex-direction: column; gap: var(--s-2); }
  .detail-pane { padding: var(--s-4); }
  .detail-grid { min-height: auto; }
  .detail-photo-wrap { width: 100px; height: 100px; }
  .detail-name { font-size: 20px; }

  .hero { min-height: auto; }
  .hero-inner { padding: var(--s-10) var(--s-4); }
  .hero-title { font-size: 26px; }
  .hero-eyebrow { font-size: 10px; }
  .hero-circuit { font-size: 11px; }
  .hero-meta { gap: var(--s-2); }
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { padding: 14px 24px; min-height: 48px; justify-content: center; }

  .section { padding: var(--s-8) var(--s-4); }
  .section-title { font-size: 20px; }
  .section-header { flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
  .section-sub { margin-left: 0; width: 100%; }

  .standings-grid { gap: var(--s-3); }

  .stream-tab { padding: 10px 6px; font-size: 8px; }
  .stream-sidebar { min-height: 300px; max-height: 300px; }
  .modal-close { width: 44px; height: 44px; }
  .back-btn { padding: 12px 16px; min-height: 44px; }
  .stream-src-btn { padding: 10px 14px; min-height: 44px; }
  .stream-alt-link { padding: 12px 14px; }
  .detail-tab { padding: 12px 14px; font-size: 9px; letter-spacing: 0.5px; }

  nav { padding: 0 var(--s-2); gap: 2px; }
  .nav-logo-text { font-size: 11px; letter-spacing: 1px; }
  .nav-logo svg { height: 18px; }
  .nav-links a { padding: 8px 6px; font-size: 9px; }
  .live-pill { padding: 2px 6px; }
  .live-pill span:last-child { font-size: 7px; }
  .live-dot { width: 4px; height: 4px; }

  .track-card { min-height: auto; }
  .track-img-wrap { height: 80px; }
  .team-card-top { padding: var(--s-3); }
  .team-drivers { flex-direction: column; gap: var(--s-1); }

  .race-card { padding: var(--s-3); }
  .race-name { font-size: 12px; }
  .race-flag { font-size: 18px; }

  .driver-card-body { padding: var(--s-3); }
  .driver-photo-wrap { width: 48px; height: 48px; }
  .driver-name { font-size: 13px; }
  .driver-number { font-size: 28px; }

  .highlights-grid { grid-template-columns: 1fr; }
  .telem-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-2); }
  .telem-card { padding: var(--s-3); }
  .telem-value { font-size: 22px; }
  .telem-icon { width: 32px; height: 32px; }

  .standings-row { padding: 6px 10px; }
  .st-name { font-size: 11px; }
  .st-pts { font-size: 11px; }
  .st-avatar { width: 20px; height: 20px; }
  .st-bar-wrap { width: 32px; }

  footer { flex-direction: column; text-align: center; gap: var(--s-2); padding: var(--s-4); }
  .footer-links { justify-content: center; }
}

/* ═══ ROUND SELECTOR ═══ */
.rs-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg-elevated);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  font-family: inherit;
  color: var(--text);
  min-width: 64px;
}
.rs-btn:hover {
  border-color: var(--teal);
  background: var(--teal-dim);
}
.rs-btn.active {
  border-color: var(--teal);
  background: var(--teal-dim);
  box-shadow: 0 0 8px var(--teal-dim);
}
.rs-btn.active span:last-child {
  color: var(--teal);
  font-weight: 600;
}
.rs-btn.done {
  opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
