/* ═══════════════════════════════════════════════════════════════════════
   CADILLAC F1 DASHBOARD  –  style.css
   Palette: black · white · TH Red · TH Navy — Cadillac America
   TV-lobby first, responsive down to mobile
   ═══════════════════════════════════════════════════════════════════════ */

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

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  /* Tommy Hilfiger / Cadillac America — Redwood Red · Cool Navy · Macadamia */
  --th-red:          #b02028;
  --th-red-light:    #d42a34;
  --th-red-dim:      #861006;
  --th-red-glow:     rgba(176,32,40,0.5);
  --th-red-subtle:   rgba(176,32,40,0.09);

  --th-blue:         #113047;
  --th-blue-light:   #739db9;
  --th-blue-glow:    rgba(115,157,185,0.3);
  --th-blue-subtle:  rgba(17,48,71,0.18);

  /* Primary accent aliases */
  --gold:          var(--th-red);
  --gold-light:    var(--th-red-light);
  --gold-dark:     var(--th-red-dim);
  --gold-glow:     var(--th-red-glow);
  --gold-subtle:   var(--th-red-subtle);

  --silver:        #b8b8b8;
  --silver-dark:   #607080;

  /* Backgrounds — deep navy ramp */
  --bg:            #090e12;
  --bg-2:          #0d141a;
  --bg-3:          #131d26;
  --bg-4:          #1a2633;
  --bg-hover:      #1f2e3d;

  /* Text — Macadamia cream primary, cool-blue midtones */
  --text:          #f1ede8;
  --text-2:        #c8bfb6;
  --text-3:        #607a8e;
  --text-4:        #344d5e;

  /* Borders */
  --border:        rgba(241,237,232,0.08);
  --border-gold:   rgba(176,32,40,0.35);
  --border-gold-h: rgba(176,32,40,0.7);
  --border-blue:   rgba(115,157,185,0.2);

  /* Cadillac highlight */
  --cadillac-row:  rgba(176,32,40,0.12);

  /* Medal */
  --p1-color: var(--th-red);
  --p2-color: #a8a9ad;
  --p3-color: #9E6B3A;

  /* Type */
  --font-d:   'Bebas Neue', sans-serif;
  --font-ui:  'Barlow Condensed', sans-serif;
  --font-b:   'Barlow', sans-serif;
  --font-m:   'Share Tech Mono', monospace;

  /* Layout */
  --col-side:  300px;
  --col-right: 300px;
  --radius:    3px;
  --trans:     0.18s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Atmosphere ──────────────────────────────────────────────────────── */
#bg-canvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; opacity: 0.65;
}
#scanlines {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, transparent 0px, transparent 2px,
    rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 4px
  );
  opacity: 0.035;
}
#vignette {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.85) 100%);
}
#app { position: relative; z-index: 2; min-height: 100vh; display: flex; flex-direction: column; }

/* ── Header ──────────────────────────────────────────────────────────── */
.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 0 2rem;
  height: 76px;
  border-bottom: 1px solid var(--border-gold);
  background: rgba(9,14,18,0.99);
  position: sticky; top: 0; z-index: 200;
}

/* Cadillac wordmark area */
.brand {
  display: flex; align-items: center; gap: 1rem;
  text-decoration: none;
}
.brand-crest {
  width: 44px; height: 44px;
  border: 1.5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  transform: rotate(45deg);
  flex-shrink: 0;
}
.brand-crest-inner {
  width: 22px; height: 22px;
  background: var(--gold);
  transform: rotate(0deg);
  display: flex; align-items: center; justify-content: center;
}
.brand-crest-inner::after {
  content: '';
  display: block;
  width: 11px; height: 11px;
  background: var(--bg);
}
.brand-name {
  font-family: var(--font-d);
  font-size: 2rem;
  letter-spacing: 0.18em;
  color: var(--text);
  line-height: 1;
}
.brand-name em {
  color: var(--gold);
  font-style: normal;
}
.brand-sub {
  font-family: var(--font-m);
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-top: 0.1rem;
}

/* Header center — season strip */
.header-center {
  display: flex; align-items: center; justify-content: center; gap: 2rem;
}
.header-tag {
  font-family: var(--font-m);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--text-3);
  text-transform: uppercase;
}
.header-tag strong {
  color: var(--gold);
  display: block;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  font-family: var(--font-ui);
  font-weight: 900;
}

/* Header right */
.header-right {
  display: flex; align-items: center; gap: 1.2rem;
}
.status-pill {
  display: flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-m);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-3);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-4);
  box-shadow: 0 0 6px var(--text-4);
  transition: var(--trans);
}
.status-dot.live {
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74,222,128,0.8);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1; box-shadow: 0 0 10px rgba(74,222,128,0.8);} 50%{opacity:0.35; box-shadow: 0 0 4px rgba(74,222,128,0.3);} }

/* ── Gold rule divider ───────────────────────────────────────────────── */
.gold-rule {
  height: 3px;
  background: linear-gradient(90deg,
    var(--th-red)   0%,   var(--th-red)   33.3%,
    #ffffff         33.3%, #ffffff         66.6%,
    var(--th-blue)  66.6%, var(--th-blue)  100%);
  opacity: 0.75;
}

/* ── Ticker ──────────────────────────────────────────────────────────── */
.ticker-bar {
  height: 40px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; overflow: hidden;
}
.ticker-label {
  font-family: var(--font-m);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--bg);
  background: var(--gold);
  padding: 0 0.9rem;
  height: 100%;
  display: flex; align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}
.ticker-track-wrap { overflow: hidden; flex: 1; }
#ticker-track {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--font-m);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  color: var(--text-3);
  will-change: transform;
}

/* ── Three-column dashboard ──────────────────────────────────────────── */
.dashboard {
  flex: 1;
  display: grid;
  grid-template-columns: var(--col-side) 1fr var(--col-right);
  grid-template-rows: 1fr auto;
  min-height: 0;
}

/* Shared panel base */
.panel {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.panel:last-child { border-right: none; }
.panel.panel-center { border-right: 1px solid var(--border); }
.panel-right { display: flex; }

/* Panel heading */
.panel-head {
  padding: 1rem 1.2rem 0.6rem;
  border-bottom: 1px solid var(--border-gold);
  flex-shrink: 0;
}
.panel-title {
  font-family: var(--font-d);
  font-size: 1.8rem;
  letter-spacing: 0.15em;
  color: var(--text);
}
.panel-title span { color: var(--gold); }
.panel-meta {
  font-family: var(--font-m);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-top: 0.15rem;
}

/* Panel scroll body */
.panel-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  min-height: 0;
}
.panel-body::-webkit-scrollbar { display: none; }

/* Center panel: track map on top, timing table below */
.panel-center {
  display: flex;
  flex-direction: column;
}
.panel-center-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Map row: driver card | track map | driver card */
.map-with-drivers {
  display: grid;
  grid-template-columns: 350px 1fr 350px;
  height: 350px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-gold);
}

.map-driver-card {
  background: var(--bg-2);
  border-top: 3px solid var(--gold);
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.4rem 1.2rem;
  overflow: hidden;
  position: relative;
  gap: 0;
}
.map-driver-card:first-child { border-right: 1px solid var(--border-gold); }
.map-driver-card:last-child  { border-left:  1px solid var(--border-gold); }

/* Large faint driver number watermark */
.map-driver-card-number {
  position: absolute;
  right: -0.05em; top: -0.1em;
  font-family: var(--font-d);
  font-size: 6rem;
  line-height: 1;
  color: var(--gold);
  opacity: 0.08;
  pointer-events: none;
  user-select: none;
}

/* Speed block pinned to bottom of flanking card */
/* ── Map driver card interior (mdc-*) ────────────────────────────────── */
.mdc-number-bg {
  position: absolute;
  right: -0.05em; top: -0.08em;
  font-family: var(--font-d);
  font-size: 11rem;
  line-height: 1;
  color: var(--gold);
  opacity: 0.07;
  pointer-events: none;
  user-select: none;
}

/* Top: photo + identity + big position */
.mdc-top {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-blue);
  flex-shrink: 0;
  position: relative;
}
.mdc-photo {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  background: var(--bg-3);
  border: 2px solid var(--border-blue);
  flex-shrink: 0;
}
.mdc-identity { flex: 1; min-width: 0; }
.mdc-code {
  font-family: var(--font-m);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 0.1rem;
}
.mdc-surname {
  font-family: var(--font-d);
  font-size: 2.8rem;
  letter-spacing: 0.04em;
  color: var(--text);
  text-transform: uppercase;
  line-height: 0.95;
}
.mdc-given {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-top: 0.15rem;
}
.mdc-pos {
  font-family: var(--font-d);
  font-size: 3.8rem;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 30px var(--gold-glow);
  flex-shrink: 0;
  align-self: center;
}
.mdc-pos--none { color: var(--text-4); text-shadow: none; }

/* Stats row */
.mdc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 0.8rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mdc-stat-label {
  font-family: var(--font-m);
  font-size: 0.54rem;
  letter-spacing: 0.2em;
  color: var(--text-4);
  text-transform: uppercase;
}
.mdc-stat-val {
  font-family: var(--font-d);
  font-size: 1.5rem;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: 0.04em;
}
.mdc-stat-val--sm {
  font-family: var(--font-m);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-2);
}
.mdc-stat--full { grid-column: 1 / -1; }

/* Lap counter + progress bar */
.mdc-lap {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mdc-lap-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.mdc-lap-label {
  font-family: var(--font-m);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--text-4);
  text-transform: uppercase;
}
.mdc-lap-count {
  font-family: var(--font-d);
  font-size: 2rem;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 16px var(--gold-glow);
}
.mdc-lap-bar-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.mdc-lap-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--th-red), #f1ede8 50%, var(--th-blue-light));
  border-radius: 2px;
  width: 0%;
  transition: width 0.12s linear;
}

/* Live speed */
.mdc-speed {
  margin-top: auto;
  padding-top: 0.65rem;
  flex-shrink: 0;
}
.mdc-speed-label {
  font-family: var(--font-m);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--text-4);
  text-transform: uppercase;
}
.mdc-speed-val {
  font-family: var(--font-d);
  font-size: 3rem;
  color: var(--gold);
  line-height: 1;
  letter-spacing: 0.04em;
  text-shadow: 0 0 24px var(--gold-glow);
}
.mdc-speed-max {
  font-family: var(--font-m);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  color: var(--text-4);
  text-transform: uppercase;
  margin-top: 0.1rem;
}

/* Timing table: fills remaining space, scrolls */
.panel-center-body .timing-table-wrap {
  border-left: none;
  border-top: 1px solid var(--border-blue);
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-blue) transparent;
}
.panel-center-body .timing-team  { display: block; }
.panel-center-body .timing-row td { padding: 0.55rem 1rem; font-size: 1rem; }
.panel-center-body .timing-pos    { font-size: 1.7rem; width: 42px; }
.panel-center-body .timing-time   { font-size: 1rem; }
.panel-center-body .timing-gap    { font-size: 0.85rem; }
.panel-center-body .timing-photo  { width: 38px; height: 38px; }
.panel-center-body .timing-table thead th { padding: 0.5rem 1rem; font-size: 0.68rem; }

/* ═══════════════════════════════════════════════════════════════════════
   LEFT COLUMN — Cadillac Team
   ═══════════════════════════════════════════════════════════════════════ */

/* Flex ordering: hero → standings → driver cards */
.team-hero-block   { order: 1; }
#left-standings-body { order: 2; flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; min-height: 0; }
#left-standings-body::-webkit-scrollbar { display: none; }
.driver-cards-block  { order: 3; }

/* SESSION PERFORMANCE visual separator */
.driver-cards-block {
  border-top: 1px solid var(--border-blue);
  padding-top: 0;
}
.driver-cards-block::before {
  content: 'SESSION PERFORMANCE';
  display: block;
  font-family: var(--font-m);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: var(--text-4);
  padding: 0.55rem 0 0.35rem;
  text-transform: uppercase;
}

/* ── Team hero block ─────────────────────────────────────────────────── */
.team-hero-block {
  flex-shrink: 0;
  background: #000;
  border-bottom: 1px solid var(--border-gold);
  border-left: 4px solid var(--th-red);
  height: 180px;
  overflow: hidden;
}

.team-hero-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: invert(1);
}

/* Constructor standing block */
.constructor-badge {
  margin: 0.65rem 1.2rem;
  background: linear-gradient(135deg, var(--bg-3) 0%, rgba(17,48,71,0.2) 100%);
  border: 1px solid var(--border-blue);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 0 80px rgba(17,48,71,0.35), inset 0 0 0 1px var(--border-blue);
  position: relative;
  overflow: hidden;
}
.constructor-badge::after {
  content: 'CONSTRUCTORS';
  position: absolute;
  right: -0.1em; bottom: -0.2em;
  font-family: var(--font-d);
  font-size: 3.5rem;
  color: var(--gold);
  opacity: 0.04;
  pointer-events: none;
  letter-spacing: 0.05em;
  line-height: 1;
  white-space: nowrap;
}
.constructor-pos-num {
  font-family: var(--font-d);
  font-size: 5rem;
  line-height: 0.9;
  color: var(--gold);
  text-shadow: 0 0 40px var(--gold-glow);
  flex-shrink: 0;
}
.constructor-pos-detail { min-width: 0; }
.constructor-pos-label {
  font-family: var(--font-m);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--text-3);
  text-transform: uppercase;
}
.constructor-pos-pts {
  font-family: var(--font-d);
  font-size: 2.2rem;
  letter-spacing: 0.08em;
  color: var(--text);
  line-height: 1.1;
}
.constructor-pos-gap {
  font-family: var(--font-m);
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 0.2rem;
  letter-spacing: 0.12em;
}

/* ── Driver Cards ─────────────────────────────────────────────────────── */
.driver-cards-block {
  padding: 0 0.8rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex-shrink: 0;
}

.driver-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 0.8rem;
  position: relative;
  overflow: hidden;
  transition: var(--trans);
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.driver-card:hover {
  background: var(--bg-4);
  border-color: var(--border-gold-h);
  border-top-color: var(--th-red-light);
  box-shadow: 0 0 32px rgba(191,27,35,0.2);
}

/* Large driver number watermark */
.driver-card-number {
  position: absolute;
  right: -0.1em; top: -0.1em;
  font-family: var(--font-d);
  font-size: 5rem;
  line-height: 1;
  color: var(--gold);
  opacity: 0.12;
  pointer-events: none;
  user-select: none;
}

.driver-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}
.driver-card-photo {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  background: var(--bg-2);
  border: 1.5px solid var(--border-gold);
  flex-shrink: 0;
}
.driver-card-identity { min-width: 0; flex: 1; }
.driver-card-code {
  font-family: var(--font-m);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
}
.driver-card-surname {
  font-family: var(--font-d);
  font-size: 2.2rem;
  letter-spacing: 0.06em;
  color: var(--text);
  text-transform: uppercase;
  line-height: 1;
}
.driver-card-given {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-3);
  text-transform: uppercase;
}

/* Session result pill on driver card */
.driver-session-result {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.driver-session-pos {
  font-family: var(--font-d);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--gold);
}
.driver-session-meta { min-width: 0; }
.driver-session-label {
  font-family: var(--font-m);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-4);
  text-transform: uppercase;
}
.driver-session-time {
  font-family: var(--font-m);
  font-size: 0.8rem;
  color: var(--text-2);
}
.driver-session-gap {
  font-family: var(--font-m);
  font-size: 0.7rem;
  color: var(--text-3);
  text-align: right;
}

/* Season driver standings in left col */
.driver-standing-mini {
  margin: 0 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex-shrink: 0;
}
.driver-standing-mini-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.9rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}
.dsm-pos {
  font-family: var(--font-d);
  font-size: 1.6rem;
  color: var(--text-3);
  min-width: 28px;
  line-height: 1;
}
.dsm-name { flex: 1; font-weight: 700; letter-spacing: 0.06em; color: var(--text); font-size: 1rem; }
.dsm-pts {
  font-family: var(--font-m);
  font-size: 0.78rem;
  color: var(--gold);
  letter-spacing: 0.1em;
}

/* ═══════════════════════════════════════════════════════════════════════
   CENTER COLUMN — Session Timing
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Race meeting selector ───────────────────────────────────────────────── */
.race-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1.2rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 0.8rem;
}

.race-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-3);
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--trans), border-color var(--trans), color var(--trans);
  flex-shrink: 0;
}
.race-nav-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--th-red);
  color: var(--text);
}
.race-nav-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.race-selector-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}

.race-sel-round {
  font-family: var(--font-m);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--th-red);
}

.race-sel-sep {
  color: var(--text-4);
  font-size: 0.7rem;
}

.race-sel-name {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
}

.race-sel-country {
  font-family: var(--font-m);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--text-3);
}

/* Session tab strip */
.session-tabs {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  flex-wrap: wrap;
  flex-shrink: 0;
}
.session-tab {
  font-family: var(--font-m);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: var(--trans);
  white-space: nowrap;
}
.session-tab:hover {
  color: var(--text-2);
  border-color: var(--border-gold);
}
.session-tab.active {
  color: var(--bg);
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 700;
}
.session-tab.upcoming {
  opacity: 0.35;
  cursor: default;
}
.session-meeting-label {
  font-family: var(--font-m);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  color: var(--text-4);
  margin-left: auto;
  text-transform: uppercase;
}

/* Timing table */
.timing-table-wrap {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-gold) transparent;
  min-height: 0;
}
.timing-table-wrap::-webkit-scrollbar { width: 3px; }
.timing-table-wrap::-webkit-scrollbar-thumb { background: var(--border-gold); }

.timing-table {
  width: 100%;
  border-collapse: collapse;
}

.timing-table thead th {
  font-family: var(--font-m);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--text-4);
  text-transform: uppercase;
  text-align: left;
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  position: sticky; top: 0; z-index: 10;
  white-space: nowrap;
}

.timing-row {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background var(--trans);
  cursor: default;
}
.timing-row:hover { background: var(--bg-hover); }

/* Cadillac highlight */
.timing-row.is-cadillac {
  background: var(--cadillac-row);
  border-left: 2px solid var(--th-red);
  border-bottom: 1px solid rgba(191,27,35,0.12);
}
.timing-row.is-cadillac:hover { background: rgba(176,32,40,0.2); }

.timing-row td {
  padding: 0.55rem 0.8rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-2);
  white-space: nowrap;
}

.timing-pos {
  font-family: var(--font-d);
  font-size: 1.3rem;
  color: var(--text-3);
  width: 36px;
  text-align: center;
}
.timing-row.is-cadillac .timing-pos { color: var(--gold); }
.p1-row .timing-pos { color: var(--p1-color); }
.p2-row .timing-pos { color: var(--p2-color); }
.p3-row .timing-pos { color: var(--p3-color); }

.timing-photo {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  background: var(--bg-3);
  border: 1px solid transparent;
  vertical-align: middle;
}
.timing-row.is-cadillac .timing-photo { border-color: var(--gold); }

.timing-name {
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}
.timing-row.is-cadillac .timing-name { color: #ffffff; }

.timing-team {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
.timing-row.is-cadillac .timing-team { color: var(--th-blue-light); }

.timing-time {
  font-family: var(--font-m);
  font-size: 0.88rem;
  color: var(--text);
  letter-spacing: 0.05em;
}
.timing-row.is-cadillac .timing-time { color: #ffffff; }

.timing-gap {
  font-family: var(--font-m);
  font-size: 0.78rem;
  color: var(--text-4);
}

.timing-laps {
  font-family: var(--font-m);
  font-size: 0.72rem;
  color: var(--text-4);
  text-align: right;
}

/* Section divider rows */
.timing-section-header td {
  font-family: var(--font-m);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-4);
  padding: 0.55rem 0.8rem 0.3rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

/* TH Blue tint for the Cadillac section header */
.timing-section-header:first-child td {
  color: #ffffff;
  border-bottom-color: var(--border-blue);
  background: rgba(17,48,71,0.5);
  letter-spacing: 0.3em;
  font-size: 0.68rem;
}

/* Cadillac star marker */
.cadillac-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
  margin-left: 0.3rem;
  flex-shrink: 0;
}
.cadillac-marker::after {
  content: '';
  display: block;
  width: 6px; height: 6px;
  background: var(--gold);
}

/* Loading shimmer */
.timing-loading td { padding: 0.7rem 0.8rem; }
.shimmer {
  display: inline-block;
  height: 12px;
  border-radius: 2px;
  background: var(--bg-3);
  position: relative;
  overflow: hidden;
}
.shimmer::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%);
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }

/* ═══════════════════════════════════════════════════════════════════════
   RIGHT COLUMN — Championship Context
   ═══════════════════════════════════════════════════════════════════════ */

.standings-section {
  padding: 0.65rem 1.2rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.standings-section:last-child { border-bottom: none; }

.standings-section-title {
  font-family: var(--font-m);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  color: var(--text-4);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.standings-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Right panel: divider label before the full carousel */
.right-carousel-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.2rem;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.right-carousel-label span {
  font-family: var(--font-m);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: var(--text-4);
  text-transform: uppercase;
}
.right-carousel-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Standings carousel ──────────────────────────────────────────────── */
.standings-carousel-wrap {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.standings-track {
  display: flex;
  width: 300%;       /* 3 slides */
  flex: 1;
  min-height: 0;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.standings-slide {
  width: calc(100% / 3);
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  padding: 0.8rem 1.2rem;
}
.standings-slide::-webkit-scrollbar { display: none; }
.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0 0.6rem;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}
.carousel-dot {
  height: 5px;
  width: 5px;
  border-radius: 3px;
  background: var(--text-4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.35s ease, width 0.35s ease;
}
.carousel-dot.active {
  background: var(--gold);
  width: 18px;
}

.standing-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius);
  margin-bottom: 0.25rem;
  transition: background var(--trans);
  cursor: pointer;
  border: 1px solid transparent;
}
.standing-item:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

/* Highlight Cadillac's row in standings */
.standing-item.is-cadillac {
  background: var(--cadillac-row);
  border-color: var(--border-gold);
}
.standing-item.is-cadillac:hover {
  background: rgba(176,32,40,0.18);
}

.si-pos {
  font-family: var(--font-d);
  font-size: 1.1rem;
  color: var(--text-3);
  text-align: center;
  line-height: 1;
}
.standing-item.is-cadillac .si-pos { color: var(--gold); }
.p1-item .si-pos { color: var(--p1-color); }
.p2-item .si-pos { color: var(--p2-color); }
.p3-item .si-pos { color: var(--p3-color); }

.si-info { min-width: 0; }
.si-name {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}
.standing-item.is-cadillac .si-name { color: #ffffff; }
.si-sub {
  font-size: 0.68rem;
  color: var(--text-4);
  letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 0.3rem;
}
.si-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.si-pts {
  font-family: var(--font-m);
  font-size: 0.85rem;
  color: var(--text-3);
  text-align: right;
  white-space: nowrap;
}
.standing-item.is-cadillac .si-pts { color: var(--th-blue-light); }

/* Season label pill */
.season-label-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  background: var(--bg-3);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  font-family: var(--font-m);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--gold-dark);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   LEFT PANEL — Tech Specs / Personnel / Milestones
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Spec Grid ───────────────────────────────────────────────────────── */
.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.6rem;
}
.spec-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.4rem 0.5rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--trans);
}
.spec-item:hover { border-color: var(--border-blue); }
.spec-label {
  font-family: var(--font-m);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-4);
}
.spec-value {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.03em;
}

/* ── Personnel List ──────────────────────────────────────────────────── */
.personnel-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.personnel-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.personnel-item:last-child { border-bottom: none; }
.personnel-role {
  font-family: var(--font-m);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-4);
  white-space: nowrap;
  flex-shrink: 0;
}
.personnel-name {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  text-align: right;
}

/* ── Driver Pedigree Stats ───────────────────────────────────────────── */
.pedigree-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.pedigree-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.6rem 0.3rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-top: 2px solid var(--th-red);
  border-radius: var(--radius);
  text-align: center;
}
.pedigree-num {
  font-family: var(--font-d);
  font-size: 2rem;
  line-height: 1;
  color: var(--th-red);
  letter-spacing: 0.02em;
}
.pedigree-plus {
  font-size: 1.2rem;
  color: var(--th-red-light);
}
.pedigree-label {
  font-family: var(--font-m);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-4);
}

/* ── Milestones ──────────────────────────────────────────────────────── */
.milestone-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
/* vertical spine */
.milestone-list::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--th-red), var(--th-blue-light));
}
.milestone-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0.5rem;
  padding: 0.45rem 0;
  align-items: start;
  position: relative;
}
.milestone-year {
  font-family: var(--font-d);
  font-size: 1.1rem;
  line-height: 1.1;
  color: var(--text-3);
  letter-spacing: 0.04em;
  text-align: right;
  padding-right: 0.6rem;
}
/* dot on spine */
.milestone-item::before {
  content: '';
  position: absolute;
  left: 25px;
  top: 10px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-4);
  border: 1px solid var(--bg-3);
}
.milestone-item--active .milestone-year { color: var(--th-red); }
.milestone-item--active::before { background: var(--th-red); box-shadow: 0 0 6px var(--th-red-glow); }
.milestone-item--future .milestone-year { color: var(--th-blue-light); }
.milestone-item--future::before { background: var(--th-blue-light); }

.milestone-desc {
  font-family: var(--font-b);
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-3);
  padding-top: 0.05rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   BOTTOM BAR — Race Schedule
   ═══════════════════════════════════════════════════════════════════════ */
.schedule-bar {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border-gold);
  background: var(--bg-2);
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.schedule-bar::-webkit-scrollbar { display: none; }

.schedule-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.3rem 1.2rem;
  border-right: 1px solid var(--border);
  min-width: 130px;
  text-align: center;
  flex-shrink: 0;
  transition: background var(--trans);
  cursor: default;
}
.schedule-item:last-child { border-right: none; }
.schedule-item.next {
  background: var(--th-blue-subtle);
  border-right-color: var(--border-blue);
  border-left: 3px solid var(--th-blue-light);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.schedule-item-round {
  font-family: var(--font-m);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--text-4);
  text-transform: uppercase;
}
.schedule-item-name {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
  text-transform: uppercase;
  white-space: nowrap;
}
.schedule-item.next .schedule-item-name { color: var(--th-blue-light); }

.schedule-item-date {
  font-family: var(--font-m);
  font-size: 0.62rem;
  color: var(--text-4);
  letter-spacing: 0.05em;
}

.schedule-label {
  font-family: var(--font-m);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--text-4);
  text-transform: uppercase;
  padding-right: 1.2rem;
  border-right: 1px solid var(--border);
  margin-right: 0;
  flex-shrink: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

/* ── Track Map ───────────────────────────────────────────────────────── */
.track-map-wrap {
  height: 100%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
/* Radial vignette frames the map */
.track-map-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 58%, var(--bg-2) 100%);
  pointer-events: none;
  z-index: 1;
}
.track-map-svg {
  width: 100%; height: 100%;
}

/* Two-layer glow: wide soft glow underneath + crisp line on top */
.track-map-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 0.7s ease;
}
.track-map-path--glow {
  stroke: #aaaaaa;
  stroke-width: 10;
  opacity: 0;
  filter: blur(5px);
  transition: opacity 0.7s ease;
}
.track-map-path--line {
  stroke: #cccccc;
  stroke-width: 2.5;
  opacity: 0;
  transition: opacity 0.7s ease;
}
.track-map-path--glow.visible { opacity: 0.22; }
.track-map-path--line.visible { opacity: 0.65; }

/* Start/finish marker */
.track-map-sf-line {
  stroke: var(--gold-light);
  stroke-width: 2;
  stroke-linecap: round;
}
/* Circuit name — large, bottom-center of SVG */
.track-map-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  fill: var(--text);
  opacity: 0.22;
  letter-spacing: 0.1em;
}

/* Driver legend */
.track-map-legend-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
}

/* Top meta tag */
.track-map-meta-tag {
  font-family: 'Share Tech Mono', monospace;
  font-size: 8.5px;
  fill: var(--text-4);
  letter-spacing: 0.16em;
}

/* S/F label */
.track-map-sf-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  fill: var(--gold-light);
  letter-spacing: 0.1em;
}

.track-map-label {
  position: absolute;
  bottom: 7px; right: 10px;
  font-family: var(--font-m);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: var(--text-4);
  text-transform: uppercase;
  z-index: 2;
}
.track-map-none {
  font-family: var(--font-m);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--text-4);
  text-transform: uppercase;
}

/* Light mode */
[data-theme="light"] .track-map-wrap { background: var(--bg-3); }
[data-theme="light"] .track-map-wrap::after { background: radial-gradient(ellipse at center, transparent 50%, var(--bg-3) 100%); }
[data-theme="light"] .track-map-name { fill: #000; }
[data-theme="light"] .track-map-meta-tag { fill: var(--text-3); }

/* ── Flash ───────────────────────────────────────────────────────────── */
@keyframes flash-gold {
  0%   { color: var(--gold-light); }
  100% { color: inherit; }
}
.flash { animation: flash-gold 0.8s ease-out; }

/* ── Reveal animation ───────────────────────────────────────────────── */
.timing-row {
  opacity: 0;
  transform: translateX(6px);
}
.timing-row.revealed {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.timing-row.is-cadillac.revealed {
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════ */

/* Schedule past items fade to make "next" pop */
.schedule-item.past { opacity: 0.45; }

/* Large TV (≥1920) */
@media (min-width: 1920px) {
  :root { --col-side: 360px; --col-right: 360px; }
  html { font-size: 18px; }
  .team-hero-block { height: 210px; }
  .team-hero-logo { max-width: none; }
  .driver-card-surname { font-size: 2.6rem; }
  .constructor-pos-num { font-size: 6rem; }
  .map-with-drivers { height: 420px; grid-template-columns: 370px 1fr 370px; }
  .mdc-speed-val { font-size: 2.8rem; }
  .mdc-surname { font-size: 2.8rem; }
  .mdc-pos { font-size: 3.5rem; }
  /* Bigger timing rows for TV legibility */
  .panel-center-body .timing-row td { padding: 0.65rem 1.1rem; font-size: 1.05rem; }
  .panel-center-body .timing-pos    { font-size: 1.8rem; }
  .panel-center-body .timing-time   { font-size: 1.05rem; }
}

/* Tablet (≤1400) — drop to 2-col, hide right standings */
@media (max-width: 1400px) {
  .dashboard { grid-template-columns: var(--col-side) 1fr; }
  .panel-right { display: none; }
}

/* Compact (≤1280) */
@media (max-width: 1280px) {
  :root { --col-side: 260px; }
  .timing-table td { padding: 0.4rem 0.5rem; }
}

/* Compact (≤1024) */
@media (max-width: 1024px) {
  .dashboard { grid-template-columns: 1fr; grid-template-rows: auto; }
  .panel-center { grid-column: 1; order: -1; }
  .schedule-bar { grid-column: 1 / -1; }
  .panel-right { display: none; }
}

/* Mobile (≤640) */
@media (max-width: 640px) {
  .dashboard { grid-template-columns: 1fr; }
  .panel-center { grid-column: 1; }
  .site-header { grid-template-columns: 1fr auto; height: auto; padding: 0.6rem 1rem; }
  .header-center { display: none; }
  html { font-size: 14px; }
}


/* ══════════════════════════════════════════════════════════════════════════
   THEME SYSTEM
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Global theme transition ─────────────────────────────────────────── */
body, .site-header, .ticker-bar, .panel, .dashboard,
.driver-card, .constructor-badge, .standing-item,
.timing-row, .timing-table thead th, .session-tabs, .session-tab,
.schedule-bar, .schedule-item, .team-hero-block, .panel-head,
.standings-section, .driver-cards-block, .driver-session-result,
.timing-section-header td, #bg-canvas, #scanlines {
  transition:
    background-color 0.4s ease,
    color 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease,
    opacity 0.4s ease;
}

/* ── LIGHT THEME variables ───────────────────────────────────────────── */
[data-theme="light"] {
  --th-red:          #961520;
  --th-red-light:    #b02028;
  --th-red-dim:      #6e0e16;
  --th-red-glow:     rgba(150,21,32,0.25);
  --th-red-subtle:   rgba(150,21,32,0.06);

  --th-blue:         #0d253a;
  --th-blue-light:   #2d6080;
  --th-blue-glow:    rgba(13,37,58,0.2);
  --th-blue-subtle:  rgba(13,37,58,0.06);

  --gold:          var(--th-red);
  --gold-light:    var(--th-red-light);
  --gold-dark:     var(--th-red-dim);
  --gold-glow:     var(--th-red-glow);
  --gold-subtle:   var(--th-red-subtle);
  --silver:        #404040;
  --silver-dark:   #607080;

  --bg:            #ffffff;
  --bg-2:          #f2f2f2;
  --bg-3:          #e6e6e6;
  --bg-4:          #d8d8d8;
  --bg-hover:      #ebebeb;

  --text:          #000000;
  --text-2:        #1c1c1c;
  --text-3:        #5a5a5a;
  --text-4:        #aaaaaa;

  --border:        rgba(0,0,0,0.09);
  --border-gold:   rgba(165,18,25,0.35);
  --border-gold-h: rgba(165,18,25,0.7);
  --border-blue:   rgba(0,36,112,0.25);

  --cadillac-row:  rgba(165,18,25,0.05);

  --p1-color: var(--th-red);
  --p2-color: #505050;
  --p3-color: #7A5030;
}

/* ── Light mode: particles very faint ───────────────────────────────── */
[data-theme="light"] #bg-canvas {
  opacity: 0.06;
  mix-blend-mode: multiply;
}

/* ── Light mode: subtle grid overlay instead of scan lines ──────────── */
[data-theme="light"] #scanlines {
  background:
    linear-gradient(rgba(0,0,0,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 1;
}
[data-theme="light"] #vignette {
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.06) 100%);
}

/* ── Light mode: header ──────────────────────────────────────────────── */
[data-theme="light"] .site-header {
  border-bottom: 2px solid #000000;
  background: rgba(255,255,255,0.98);
}
[data-theme="light"] .gold-rule { opacity: 0.25; }

/* ── Light mode: ticker — inverted strip ─────────────────────────────── */
[data-theme="light"] .ticker-bar   { background: #000000; }
[data-theme="light"] .ticker-label { background: var(--gold-light); color: #000; }
[data-theme="light"] #ticker-track { color: rgba(255,255,255,0.55); }

/* ── Light mode: brand name ──────────────────────────────────────────── */
[data-theme="light"] .brand-name { color: #000000; }
[data-theme="light"] .brand-name em { color: var(--gold); }
[data-theme="light"] .brand-crest { border-color: var(--gold); }
[data-theme="light"] .brand-crest-inner { background: var(--gold); }
[data-theme="light"] .brand-crest-inner::after { background: #ffffff; }

/* ── Light mode: constructor badge — jet black island ────────────────── */
[data-theme="light"] .constructor-badge {
  background: #000000;
  border-color: var(--gold-light);
}
[data-theme="light"] .constructor-pos-num   { color: var(--gold-light); text-shadow: 0 0 20px var(--th-red-glow); }
[data-theme="light"] .constructor-pos-label { color: rgba(255,255,255,0.4); }
[data-theme="light"] .constructor-pos-pts   { color: #ffffff; }
[data-theme="light"] .constructor-pos-gap   { color: rgba(255,255,255,0.35); }

/* ── Light mode: driver cards — white with bold shadow ───────────────── */
[data-theme="light"] .driver-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.12);
  border-top-color: var(--gold);
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}
[data-theme="light"] .driver-card:hover {
  border-color: var(--gold);
  border-top-color: var(--gold-light);
  box-shadow: 0 6px 32px rgba(0,0,0,0.15), 0 0 0 1px var(--gold);
}
[data-theme="light"] .driver-card-number  { color: #000000; opacity: 0.05; }
[data-theme="light"] .driver-session-result { background: var(--bg-2); border-color: var(--border); }

/* ── Light mode: timing table ────────────────────────────────────────── */
[data-theme="light"] .timing-table thead th {
  background: #000000;
  color: rgba(255,255,255,0.5);
  border-bottom-color: #000000;
}
[data-theme="light"] .timing-row:hover { background: var(--bg-2); }

/* CADILLAC rows in light mode: TH red block */
[data-theme="light"] .timing-section-header:first-child td {
  background: var(--th-blue);
  color: #ffffff;
  border-bottom-color: var(--th-blue-light);
  letter-spacing: 0.28em;
}
[data-theme="light"] .timing-row.is-cadillac {
  background: rgba(165,18,25,0.08);
  border-left-color: var(--th-red);
  border-bottom-color: rgba(165,18,25,0.15);
}
[data-theme="light"] .timing-row.is-cadillac td { color: #000000; }
[data-theme="light"] .timing-row.is-cadillac .timing-pos  { color: var(--th-red); }
[data-theme="light"] .timing-row.is-cadillac .timing-name { color: #000000; }
[data-theme="light"] .timing-row.is-cadillac .timing-time { color: #000000; }
[data-theme="light"] .timing-row.is-cadillac .timing-gap  { color: var(--th-blue); }
[data-theme="light"] .timing-row.is-cadillac .timing-team { color: var(--th-blue); }
[data-theme="light"] .timing-row.is-cadillac .timing-photo { border-color: var(--th-red); }
[data-theme="light"] .timing-row.is-cadillac:hover { background: rgba(165,18,25,0.14); }

/* ── Light mode: standings ───────────────────────────────────────────── */
[data-theme="light"] .standing-item.is-cadillac {
  background: #000000;
  border-color: var(--th-red);
}
[data-theme="light"] .standing-item.is-cadillac .si-name  { color: #ffffff; }
[data-theme="light"] .standing-item.is-cadillac .si-pts   { color: var(--th-blue-light); }
[data-theme="light"] .standing-item.is-cadillac .si-pos   { color: var(--th-red); }
[data-theme="light"] .standing-item.is-cadillac .si-sub   { color: rgba(255,255,255,0.4); }

/* ── Light mode: session tabs ────────────────────────────────────────── */
[data-theme="light"] .session-tab.active {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
}

/* ── Light mode: schedule bar ────────────────────────────────────────── */
[data-theme="light"] .schedule-bar { border-top-color: #000000; }
[data-theme="light"] .schedule-item.next {
  background: #000000;
  border-right-color: rgba(255,255,255,0.1);
}
[data-theme="light"] .schedule-item.next .schedule-item-name { color: var(--gold-light); }
[data-theme="light"] .schedule-item.next .schedule-item-round { color: rgba(255,255,255,0.4); }
[data-theme="light"] .schedule-item.next .schedule-item-date  { color: rgba(255,255,255,0.4); }

/* ── Light mode: keep hero black so logo always reads correctly ──────── */
[data-theme="light"] .team-hero-block { background: #000; border-bottom-color: rgba(176,32,40,0.4); }

/* ── Light mode: panel heads ─────────────────────────────────────────── */
[data-theme="light"] .panel-head {
  border-bottom-color: #000000;
  border-bottom-width: 2px;
}
[data-theme="light"] .panel { border-right-color: rgba(0,0,0,0.1); }

/* ── HUD controls — flex child inside ticker bar ─────────────────────── */
.hud-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
  padding: 0 1rem;
  border-left: 1px solid var(--border);
  height: 100%;
}

/* ── Theme toggle button ─────────────────────────────────────────────── */
.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  color: var(--text-3);
  font-family: var(--font-m);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 0.2s;
  overflow: hidden;
}
.theme-toggle:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.theme-toggle:active { transform: scale(0.97); }

/* The half-circle icon */
.toggle-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  position: relative;
  flex-shrink: 0;
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.toggle-icon::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 50%; height: 100%;
  background: currentColor;
  border-radius: 9px 0 0 9px;
}
.theme-toggle:hover .toggle-icon { transform: rotate(180deg); }

[data-theme="light"] .theme-toggle { color: var(--text-3); }
[data-theme="light"] .theme-toggle:hover { color: #000; }

/* ── Theme wipe overlay ──────────────────────────────────────────────── */
#theme-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

/* ── Light mode: driver standings mini ───────────────────────────────── */
[data-theme="light"] .driver-standing-mini-row {
  background: #ffffff;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
[data-theme="light"] .dsm-pos { color: var(--text-3); }

/* ── Shimmer light mode ──────────────────────────────────────────────── */
[data-theme="light"] .shimmer {
  background: var(--bg-3);
}
[data-theme="light"] .shimmer::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}

