/* ==========================================================================
   F1 RACE ARCHIVE — STANDALONE DESIGN SYSTEM (f1-theme.css)
   Zero CDN CSS runtime required. Built around Official Formula1.com
   editorial layouts + Era-Specific Broadcast Themes (1950s–2020s).
   ========================================================================== */

:root {
  --f1-red: #E10600;
  --f1-red-dark: #B30500;
  --f1-carbon: #15151E;
  --f1-charcoal: #1F1F2C;
  --f1-slate: #38384F;
  --f1-bg: #F3F4F8;
  --f1-surface: #FFFFFF;
  --f1-surface-alt: #F7F8FB;
  --f1-border: #DDE1EB;
  --f1-border-strong: #C4CAD8;
  --f1-text: #15151E;
  --f1-text-muted: #52566A;
  --f1-text-subtle: #787D94;
  --f1-gold: #D4AF37;
  --f1-tag-yellow: #FFD700;
  --f1-purple: #7C3AED;
  --f1-emerald: #059669;
  --era-accent: #E10600;
  --era-badge-bg: #E10600;
  --era-badge-fg: #FFFFFF;
}

/* Era Theme Variables */
[data-era-theme="vintage"] {
  /* 1950s-1960s FIA Classic Championship Gold & British Racing Green/Crimson */
  --era-accent: #B48A1E;
  --era-badge-bg: #FEF3C7;
  --era-badge-fg: #78350F;
}
[data-era-theme="retro"] {
  /* 1970s-1980s FOCA / Heuer Striped Royal Blue & Racing Red */
  --era-accent: #0055A4;
  --era-badge-bg: #DBEAFE;
  --era-badge-fg: #1E3A8A;
}
[data-era-theme="speed"] {
  /* 1990s-2017 Iconic F1 Speed-Mark & TAG Heuer Yellow-on-Carbon */
  --era-accent: #E10600;
  --era-badge-bg: #15151E;
  --era-badge-fg: #FFD700;
}
[data-era-theme="modern"] {
  /* 2018-Present Modern F1 Twin-Arc Red */
  --era-accent: #E10600;
  --era-badge-bg: #E10600;
  --era-badge-fg: #FFFFFF;
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[x-cloak] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--f1-bg);
  color: var(--f1-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--f1-bg);
  color: var(--f1-text);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font-family: inherit;
}

.font-display {
  font-family: 'Titillium Web', 'Inter', sans-serif;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Layout Containers */
.f1-container {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==========================================================================
   OFFICIAL F1 HEADER & NAVIGATION BAR
   ========================================================================== */
.f1-header {
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(21, 21, 30, 0.16);
}

.f1-topbar {
  background: linear-gradient(90deg, #E10600 0%, #C80500 100%);
  color: #FFFFFF;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.f1-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  flex-wrap: wrap;
}

.f1-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  cursor: pointer;
}

.f1-logo-box {
  background: #FFFFFF;
  padding: 0.35rem 0.7rem;
  border-top-right-radius: 12px;
  border-bottom-left-radius: 6px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease;
}

.f1-brand:hover .f1-logo-box {
  transform: scale(1.04);
}

.f1-brand-title {
  font-family: 'Titillium Web', sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #FFFFFF;
  line-height: 1.1;
}

.f1-brand-pill {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--f1-carbon);
  color: #FFD700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.f1-brand-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}

.f1-header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Custom Switch Pill */
.f1-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(21, 21, 30, 0.88);
  color: #FFFFFF;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  user-select: none;
  font-size: 0.76rem;
  font-weight: 700;
  transition: background 0.15s ease;
}

.f1-switch-label:hover {
  background: #15151E;
}

.f1-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.f1-switch-track {
  width: 36px;
  height: 20px;
  background: #4B5563;
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}

.f1-switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.f1-switch-input:checked + .f1-switch-track {
  background: #F59E0B;
}

.f1-switch-input:checked + .f1-switch-track::after {
  transform: translateX(16px);
}

/* Decade Navigation Sub-Bar */
.f1-subnav {
  background: var(--f1-carbon);
  color: #FFFFFF;
  border-bottom: 1px solid #2A2A3C;
}

.f1-subnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  overflow-x: auto;
}

.f1-decade-list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.f1-decade-label {
  font-family: 'Titillium Web', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9CA3AF;
  margin-right: 0.4rem;
  white-space: nowrap;
}

.f1-decade-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #E5E7EB;
  font-family: 'Titillium Web', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.f1-decade-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.f1-decade-btn.active {
  background: var(--f1-red);
  color: #FFFFFF;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(225, 6, 0, 0.35);
}

/* ==========================================================================
   MOBILE COMPACT TOP BAR (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .f1-container {
    padding: 0 0.85rem;
  }

  .f1-topbar-inner {
    min-height: 46px;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }

  .f1-brand {
    gap: 0.55rem;
    min-width: 0;
  }

  .f1-logo-box {
    padding: 0.22rem 0.45rem;
    border-top-right-radius: 8px;
    border-bottom-left-radius: 4px;
    flex-shrink: 0;
  }

  .f1-logo-box svg {
    width: 34px;
    height: 18px;
  }

  .f1-brand-title {
    font-size: 1.05rem;
    white-space: nowrap;
  }

  .f1-brand-pill,
  .f1-brand-sub {
    display: none !important;
  }

  .f1-header-controls {
    gap: 0.4rem;
    flex-shrink: 0;
  }

  .f1-hamburger-btn {
    padding: 0.38rem 0.65rem;
    font-size: 0.74rem;
    gap: 0.35rem;
  }

  .f1-hamburger-label-extra {
    display: none;
  }

  .f1-star-btn-header {
    width: 32px;
    height: 32px;
  }

  .f1-subnav-inner {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    gap: 0.4rem;
  }

  .f1-decade-label {
    display: none;
  }

  .f1-decade-btn {
    padding: 0.24rem 0.55rem;
    font-size: 0.72rem;
  }

  .f1-hero {
    padding: 1.15rem;
    margin-top: 0.85rem;
    margin-bottom: 1rem;
  }
}

/* ==========================================================================
   HERO BANNER & WEIGHTED RACE ROULETTE
   ========================================================================== */
.f1-hero {
  background-color: var(--f1-carbon);
  background-image:
    linear-gradient(125deg, rgba(225, 6, 0, 0.22) 0%, rgba(21, 21, 30, 0) 50%),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 0px, rgba(255, 255, 255, 0.025) 2px, transparent 2px, transparent 10px);
  color: #FFFFFF;
  border-radius: 18px;
  border-top: 5px solid var(--era-accent);
  padding: 2rem;
  margin-top: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 14px 34px rgba(21, 21, 30, 0.16);
}

.f1-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .f1-hero-grid {
    grid-template-columns: 1.55fr 1fr;
  }
}

.f1-eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-family: 'Titillium Web', sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #FFFFFF;
  margin-bottom: 0.9rem;
}

.f1-hero-title {
  font-family: 'Titillium Web', sans-serif;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  font-size: clamp(1.85rem, 3.4vw, 2.85rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  margin-bottom: 0.85rem;
}

.f1-hero-subtitle {
  font-size: 0.98rem;
  color: #E2E8F0;
  line-height: 1.6;
  margin-bottom: 1.15rem;
}

.f1-feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.f1-feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #F8FAFC;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
}

/* Roulette Control Box */
.f1-roulette-box {
  background: #FFFFFF;
  color: var(--f1-text);
  border-radius: 14px;
  border-top: 4px solid var(--f1-red);
  padding: 1.35rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.f1-roulette-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--f1-border);
}

.f1-roulette-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  background: #EEF1F6;
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--f1-border);
  margin-bottom: 0.75rem;
}

.f1-mode-btn {
  padding: 0.5rem 0.4rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #374151;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.f1-mode-btn.active-balanced {
  background: var(--f1-carbon);
  color: #FFFFFF;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.f1-mode-btn.active-greats {
  background: var(--f1-red);
  color: #FFFFFF;
  box-shadow: 0 2px 5px rgba(225, 6, 0, 0.25);
}

.f1-mode-btn.active-gems {
  background: #D97706;
  color: #FFFFFF;
  box-shadow: 0 2px 5px rgba(217, 119, 6, 0.25);
}

.f1-cta-btn {
  width: 100%;
  padding: 0.85rem 1.2rem;
  border-radius: 8px;
  border: none;
  background: var(--f1-red);
  color: #FFFFFF;
  font-family: 'Titillium Web', sans-serif;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 4px 12px rgba(225, 6, 0, 0.28);
  transition: all 0.15s ease;
}

.f1-cta-btn:hover {
  background: var(--f1-red-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(225, 6, 0, 0.35);
}

/* ==========================================================================
   FILTER BAR & CATALOG CARDS
   ========================================================================== */
.f1-filter-bar {
  background: #FFFFFF;
  border: 1px solid var(--f1-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 2px 8px rgba(21, 21, 30, 0.04);
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .f1-filter-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .f1-filter-bar {
    grid-template-columns: 1.4fr 1.1fr 1fr 0.9fr;
  }
}

.f1-field-label {
  display: block;
  font-family: 'Titillium Web', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--f1-text-muted);
  margin-bottom: 0.3rem;
}

.f1-input, .f1-select {
  width: 100%;
  background: var(--f1-surface-alt);
  border: 1px solid var(--f1-border-strong);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--f1-text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.f1-input:focus, .f1-select:focus {
  outline: none;
  border-color: var(--f1-red);
  background: #FFFFFF;
}

/* Cards Grid */
.f1-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
}

@media (min-width: 768px) {
  .f1-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1120px) {
  .f1-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Official Formula1.com Top-Right Cut Corner Bracket Card */
.f1-race-card {
  background: #FFFFFF;
  border: 1px solid var(--f1-border);
  border-top: 4px solid var(--f1-red);
  border-top-right-radius: 20px;
  border-top-left-radius: 6px;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 3px 12px rgba(21, 21, 30, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}

.f1-race-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(21, 21, 30, 0.12);
  border-color: var(--f1-border-strong);
}

.f1-race-card[data-era-theme="vintage"] { border-top-color: #B48A1E; }
.f1-race-card[data-era-theme="retro"]   { border-top-color: #0055A4; }
.f1-race-card[data-era-theme="speed"]   { border-top-color: #E10600; }
.f1-race-card[data-era-theme="modern"]  { border-top-color: #E10600; }

.f1-card-top {
  padding: 0.75rem 1.15rem;
  background: var(--f1-surface-alt);
  border-bottom: 1px solid var(--f1-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.f1-era-badge {
  font-family: 'Titillium Web', sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  background: var(--era-badge-bg);
  color: var(--era-badge-fg);
}

.f1-rating-badge {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  background: var(--f1-carbon);
  color: #FFD700;
}

.f1-card-body {
  padding: 1.15rem;
}

.f1-card-country {
  font-family: 'Titillium Web', sans-serif;
  font-weight: 800;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--f1-red);
  margin-bottom: 0.2rem;
}

.f1-card-title {
  font-family: 'Titillium Web', sans-serif;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  font-size: 1.3rem;
  line-height: 1.15;
  color: var(--f1-text);
  margin-bottom: 0.25rem;
  transition: color 0.15s ease;
}

.f1-race-card:hover .f1-card-title {
  color: var(--f1-red);
}

.f1-card-circuit {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--f1-text-muted);
  margin-bottom: 0.9rem;
}

.f1-context-box {
  background: #F1F3F8;
  border: 1px solid #E0E4EE;
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.75rem;
}

.f1-context-headline {
  font-family: 'Titillium Web', sans-serif;
  font-weight: 900;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--f1-text);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.f1-why-box {
  background: #FEF2F2;
  border-left: 3.5px solid var(--f1-red);
  border-radius: 0 8px 8px 0;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.75rem;
}

.f1-why-label {
  font-family: 'Titillium Web', sans-serif;
  font-weight: 900;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--f1-red);
  margin-bottom: 0.15rem;
}

.f1-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.f1-tag-pill {
  font-size: 0.7rem;
  font-weight: 600;
  background: #E8ECF4;
  color: #2D3246;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.f1-card-footer {
  padding: 0.75rem 1.15rem;
  background: var(--f1-surface-alt);
  border-top: 1px solid var(--f1-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
}

/* ==========================================================================
   RACE BRIEFING DETAIL PAGE (BENTO GRID, SPOTTER'S GUIDE, TIMING TOWER)
   ========================================================================== */
.f1-bento-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
  .f1-bento-top {
    grid-template-columns: 2fr 1fr;
  }
}

/* Pre-Race Championship Top 3 Contender Podium Cards */
.f1-contenders-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .f1-contenders-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.f1-contender-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.f1-contender-card:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Navigation Tabs on Race Page */
.f1-tabs-bar {
  background: #FFFFFF;
  border: 1px solid var(--f1-border);
  border-radius: 12px;
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(21, 21, 30, 0.04);
}

.f1-tab-btn {
  padding: 0.95rem 1.15rem;
  background: transparent;
  border: none;
  border-bottom: 4px solid transparent;
  font-family: 'Titillium Web', sans-serif;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  color: var(--f1-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.f1-tab-btn:hover {
  color: var(--f1-text);
}

.f1-tab-btn.active {
  color: var(--f1-red);
  border-bottom-color: var(--f1-red);
  font-weight: 900;
}

/* Spotter's Guide Team Cards */
.f1-spotter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
}

@media (min-width: 820px) {
  .f1-spotter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.f1-team-card {
  background: #FFFFFF;
  border: 1px solid var(--f1-border);
  border-top-right-radius: 20px;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(21, 21, 30, 0.06);
  display: flex;
  flex-direction: column;
}

.f1-showroom-stage {
  background: linear-gradient(180deg, #F9FAFC 0%, #EDF0F6 66%, #DFE5F0 100%);
  border-top: 1px solid var(--f1-border);
  border-bottom: 1px solid var(--f1-border);
  padding: 1.1rem 1.5rem 0.85rem;
}

.f1-driver-row {
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--f1-border);
  cursor: pointer;
  transition: background 0.15s ease;
}

.f1-driver-row:hover {
  background: #F4F6FA;
}

.f1-car-number-box {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: var(--f1-carbon);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Titillium Web', sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: 1rem;
  flex-shrink: 0;
}

/* 2-By-2 Staggered Starting Grid Formation */
.f1-grid-formation {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  max-width: 1020px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .f1-grid-formation {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 1.5rem;
  }
  .f1-grid-slot-even {
    margin-top: 1.75rem;
  }
}

.f1-grid-card {
  background: #FFFFFF;
  border: 1px solid var(--f1-border);
  border-top-right-radius: 16px;
  border-bottom-right-radius: 10px;
  border-bottom-left-radius: 8px;
  padding: 0.95rem 1.15rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(21, 21, 30, 0.05);
  transition: all 0.15s ease;
}

.f1-grid-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(21, 21, 30, 0.11);
  border-color: var(--f1-carbon);
}

.f1-pos-box {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--f1-carbon);
  color: var(--f1-tag-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Titillium Web', sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: 1.05rem;
  flex-shrink: 0;
}

/* Official Broadcast Timing Table */
.f1-table-wrap {
  background: #FFFFFF;
  border: 1px solid var(--f1-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(21, 21, 30, 0.06);
}

.f1-table-scroll {
  overflow-x: auto;
}

.f1-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

.f1-table thead tr {
  background: var(--f1-carbon);
  color: #FFFFFF;
  font-family: 'Titillium Web', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
}

.f1-table th {
  padding: 0.85rem 1rem;
  white-space: nowrap;
}

.f1-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--f1-border);
  vertical-align: middle;
}

.f1-table tbody tr {
  transition: background 0.12s ease;
}

.f1-table tbody tr:hover {
  background: #F1F4F9;
}

/* Modal Drawer for Driver Bio, Sync, Replay Guide & Data Attribution */
.f1-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 17, 26, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0.75rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  cursor: pointer;
}

.f1-modal-card {
  background: #FFFFFF;
  color: var(--f1-text);
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 1.5rem);
  max-height: calc(100dvh - 1.5rem);
  margin: auto 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--f1-border);
  cursor: default;
}

.f1-modal-card > div:first-child,
.f1-modal-header {
  position: sticky;
  top: 0;
  z-index: 5;
  flex-shrink: 0;
  background-color: #15151E !important;
  color: #FFFFFF !important;
}

@media (max-width: 480px) {
  .f1-modal-backdrop {
    padding: 0.5rem;
  }
  .f1-modal-card {
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 12px;
  }
  .f1-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.f1-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.f1-stat-box {
  background: var(--f1-surface-alt);
  border: 1px solid var(--f1-border);
  border-radius: 10px;
  padding: 0.65rem 0.35rem;
}

/* Footer */
.f1-footer {
  background: var(--f1-carbon);
  color: #9CA3AF;
  border-top: 4px solid var(--f1-red);
  margin-top: 3.5rem;
  padding: 1.75rem 0;
  font-size: 0.78rem;
}


/* ==========================================================================
   HAMBURGER MENU BUTTON & SLIDE-OUT DRAWER
   ========================================================================== */
.f1-hamburger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(21, 21, 30, 0.92);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font-family: 'Titillium Web', sans-serif;
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.15s ease;
}

.f1-hamburger-btn:hover {
  background: #15151E;
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

.f1-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 17, 26, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
}

.f1-drawer-panel {
  width: 100%;
  max-width: 380px;
  height: 100%;
  background: #15151E;
  color: #FFFFFF;
  border-left: 3px solid var(--f1-red);
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

.f1-drawer-section {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.f1-drawer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.65rem 0;
}

.f1-drawer-row + .f1-drawer-row {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   CLEAN STAR ICON BUTTON (WATCHLIST TOGGLE)
   ========================================================================== */
.f1-star-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--f1-border-strong);
  background: #FFFFFF;
  color: #94A3B8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.f1-star-btn:hover {
  border-color: #F59E0B;
  color: #F59E0B;
  transform: scale(1.07);
}

.f1-star-btn.active {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #D97706;
}

.f1-star-btn-header {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(21, 21, 30, 0.9);
  color: #94A3B8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.f1-star-btn-header:hover {
  border-color: #FFD700;
  color: #FFD700;
  transform: scale(1.06);
}

.f1-star-btn-header.active {
  background: #FFD700;
  border-color: #FFFFFF;
  color: #15151E;
}

/* ==========================================================================
   POST-RACE RESULTS SPOILER VAULT (CLOSED BY DEFAULT)
   ========================================================================== */
.f1-spoiler-vault {
  margin-top: 2.25rem;
  background: #FFFFFF;
  border: 2px solid #15151E;
  border-top: 5px solid var(--f1-red);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(21, 21, 30, 0.08);
}

.f1-spoiler-vault-header {
  background: #15151E;
  color: #FFFFFF;
  padding: 1.15rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.f1-spoiler-vault-header:hover {
  background: #1F1F2D;
}

.f1-podium-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
  .f1-podium-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.f1-podium-card {
  background: var(--f1-surface-alt);
  border: 1px solid var(--f1-border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  position: relative;
  overflow: hidden;
}
