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

:root {
  --red: #e10600;
  --dark: #0f0f0f;
  --card: #1a1a1a;
  --card2: #222;
  --border: #2e2e2e;
  --text: #f0f0f0;
  --muted: #888;
  --accent: #e10600;
}

body {
  background: var(--dark);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

/* ---- SITE HEADER ---- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 400;
  padding: 0 24px;
  background: rgba(15,15,15,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}
/* When nav is open, header goes transparent (red overlay is behind it) */
.site-header.nav-is-open {
  background: transparent;
  border-bottom-color: transparent;
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 26px; height: 26px;
  flex-shrink: 0;
  color: var(--red);
  transition: color 0.3s ease;
}
.site-logo__text {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #fff;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

/* Season filter */
.season-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  position: relative;
}

/* Season tooltip */
.season-tip {
  position: absolute;
  top: 44px;
  right: 0;
  background: #fff;
  color: #111;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transform: translateY(6px);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 500;
}
.season-tip::before {
  content: '';
  position: absolute;
  top: -5px; right: 18px;
  width: 10px; height: 10px;
  background: #fff;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
.season-tip.visible { opacity: 1; transform: translateY(0); }

/* When nav overlay is open, flip header elements to dark */
.site-header.nav-is-open .season-filter-label { color: #111; }
.site-header.nav-is-open .season-pills { background: transparent; }
.site-header.nav-is-open .season-pill { color: #111; border-color: rgba(0,0,0,0.25); background: rgba(0,0,0,0.08); }
.site-header.nav-is-open .season-pill.active { background: #111; border-color: #111; color: #fff; }
.site-header.nav-is-open .site-logo__text { color: #111; }
.site-header.nav-is-open .logo-icon { color: #111; }
.site-header.nav-is-open .hamburger span { background: #111; }

/* ---- HAMBURGER ---- */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  z-index: 500;
  position: relative;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.6s cubic-bezier(.17,.67,0,1), opacity 0.3s ease;
  transform-origin: center;
}
/* X state */
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { transform: translateY(-8px) rotate(-45deg); }

/* Tooltip bubble */
.hamburger-tip {
  position: absolute;
  top: 52px;
  left: 16px;
  background: #fff;
  color: #111;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  /* arrow */
  transform: translateY(6px);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 500;
}
.hamburger-tip::before {
  content: '';
  position: absolute;
  top: -5px; left: 14px;
  width: 10px; height: 10px;
  background: #fff;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
.hamburger-tip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- FULLSCREEN NAV OVERLAY ---- */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 350;
  background-color: var(--red);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 10vw;
  overflow: hidden;

  /* Curtain wipe via clip-path panels */
  --p1: 0%; --p2: 0%; --p3: 0%; --p4: 0%;
  clip-path: polygon(
    0 0,     0 var(--p1),   25% var(--p1),  25% 0,
    25% 0,   25% var(--p2), 50% var(--p2),  50% 0,
    50% 0,   50% var(--p3), 75% var(--p3),  75% 0,
    75% 0,   75% var(--p4), 100% var(--p4), 100% 0
  );

  pointer-events: none;
  /* when closed, sit above viewport so it's invisible */
  transform: translateY(-101%);
  transition: transform 0s 0.85s; /* delay removal until animation done */
}
.nav-overlay.open {
  pointer-events: all;
  transform: translateY(0);
  transition: transform 0s; /* snap into position immediately, clip-path does the reveal */
}

/* Nav inner layout — side by side groups on desktop */
.nav-inner {
  display: flex;
  gap: 6vw;
  align-items: flex-start;
  flex-wrap: wrap;
}
.nav-group { display: flex; flex-direction: column; gap: 8px; }
.nav-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 4px;
}

/* Nav list */
.nav-list {
  list-style: none;
  padding: 0;
}
.nav-item + .nav-item { margin-top: 0.1em; }

.nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.55);
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  padding: 0;
  text-align: left;
  transition: color 0.2s ease, letter-spacing 0.4s cubic-bezier(.17,.67,0,1);
  width: 100%;
}
.nav-btn:hover { color: #fff; letter-spacing: 0.02em; }
.nav-btn.active { color: #fff; }

/* Season label bottom-right */
.nav-season-label {
  position: absolute;
  bottom: 40px; right: 10vw;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
}

.nav-credit {
  position: absolute;
  bottom: 28px; left: 10vw;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: letter-spacing 0.3s cubic-bezier(.17,.67,0,1), opacity 0.2s ease;
}
.nav-credit:hover {
  letter-spacing: 1.5px;
  opacity: 0.75;
}

/* ---- MAIN (offset for fixed header) ---- */
main { max-width: 100%; margin: 0; padding: 88px 40px 40px; }

/* VIEWS */
.view { display: none; }
.view.active {
  display: block;
  animation: viewEnter 0.25s ease both;
}
@keyframes viewEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* PAGE LOAD PROGRESS BAR — hidden, replaced by skeletons */
.progress-bar { display: none; }

/* LOADER — hidden, replaced by skeletons */
.loader { display: none !important; }

/* ---- SKELETON LOADER ---- */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.skel {
  background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
}
.skel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skel-img  { height: 160px; border-radius: 6px; }
.skel-h    { height: 16px; width: 70%; }
.skel-h-sm { height: 12px; width: 45%; }
.skel-h-xs { height: 10px; width: 30%; }
.skel-bar  { height: 8px; width: 100%; border-radius: 4px; }
.skel-row  {
  display: grid;
  grid-template-columns: 40px 1fr 80px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.skel-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.skel-lines  { display: flex; flex-direction: column; gap: 6px; }
.skel-grid   { display: grid; gap: 16px; }
.skel-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* HERO */
.hero {
  background: linear-gradient(135deg, #1a0000 0%, #1a1a1a 60%, #111 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: 12px;
  padding: 48px 40px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(225,6,0,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-f1-logo {
  margin-bottom: 20px;
}
.hero-f1-logo svg {
  width: 160px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 12px rgba(225,6,0,0.5));
}
.hero h1 { font-size: 42px; font-weight: 700; line-height: 1.2; margin-bottom: 12px; }
.hero p { color: var(--muted); font-size: 16px; }
.red { color: var(--red); }

/* HOME CARDS */
.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--red); }
.stat-card .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--red); }
.stat-card .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* LAST RACE */
.last-race-section h2 { font-size: 20px; margin-bottom: 16px; }
.race-result-table { width: 100%; border-collapse: collapse; }
.race-result-table th, .race-result-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.race-result-table th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.race-result-table tr:hover td { background: var(--card2); }
.pos-1 { color: #ffd700; font-weight: 700; }
.pos-2 { color: #c0c0c0; font-weight: 700; }
.pos-3 { color: #cd7f32; font-weight: 700; }

/* SECTION TITLE */
.section-title { font-size: 22px; font-weight: 700; margin-bottom: 24px; }

/* RACES GRID */
.races-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.race-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.race-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transition: transform 0.2s;
}
.race-card:hover { border-color: var(--red); transform: translateY(-2px); }
.race-card:hover::before { transform: scaleX(1); }
.race-card.past { opacity: 0.7; }
.race-card.next { border-color: var(--red); }
.race-card.next::before { transform: scaleX(1); }
.race-round { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.race-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.race-circuit { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.race-date { font-size: 13px; color: var(--red); font-weight: 500; }
.race-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.badge-next { background: rgba(225,6,0,0.15); color: var(--red); border: 1px solid var(--red); }
.badge-done { background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid var(--border); }
.badge-upcoming { background: rgba(255,255,255,0.05); color: #aaa; border: 1px solid var(--border); }

/* STANDINGS */
.tabs { display: flex; gap: 8px; margin-bottom: 24px; }
.tab-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}
.tab-btn.active { background: var(--red); border-color: var(--red); color: #fff; }
.tab-content { display: none; }
.tab-content.active { display: block; }

.standings-table { width: 100%; border-collapse: collapse; }
.standings-table th {
  padding: 10px 16px;
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
}
.standings-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.standings-table tr:hover td { background: var(--card2); }
.standings-table .pos { font-weight: 700; color: var(--muted); }
.standings-table .pts { font-weight: 700; color: var(--red); font-size: 16px; }
.standings-table .driver-name { font-weight: 600; }
.team-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

/* DRIVERS GRID */
.drivers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.driver-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.driver-card:hover { border-color: var(--red); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(225,6,0,0.15); }
.driver-card-photo {
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: top center;
  background: #1a1a1a;
  display: block;
}
.driver-card-photo-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 700;
  color: var(--border);
}
.driver-card-team-bar {
  height: 3px;
  width: 100%;
}
.driver-card-body { padding: 14px; }
.driver-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
  margin-bottom: 6px;
}
.driver-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.driver-team { font-size: 12px; color: var(--muted); }
.driver-nat { font-size: 12px; color: var(--muted); margin-top: 2px; }
.driver-code {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

/* DRIVER DETAIL MODAL */
.driver-modal { display: flex; gap: 24px; align-items: flex-start; }
.driver-modal-photo {
  width: 160px;
  min-width: 160px;
  height: 200px;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;
  background: #1a1a1a;
}
.driver-modal-photo-placeholder {
  width: 160px;
  min-width: 160px;
  height: 200px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 700;
  color: var(--border);
}
.driver-modal-info { flex: 1; }
.driver-modal-number { font-size: 52px; font-weight: 700; color: var(--red); line-height: 1; margin-bottom: 4px; }
.driver-modal-name { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.driver-modal-team { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.driver-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.driver-stat { background: var(--card2); border-radius: 8px; padding: 10px 14px; }
.driver-stat .s-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.driver-stat .s-value { font-size: 18px; font-weight: 700; }
.driver-season-results { margin-top: 16px; }
.driver-season-results h4 { font-size: 14px; color: var(--muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }

/* 2024 SEASON */
.season-hero {
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a1a 60%);
  border: 1px solid var(--border);
  border-left: 4px solid #3671C6;
  border-radius: 12px;
  padding: 28px 32px;
}
.season-hero h2 { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.season-hero p { color: var(--muted); font-size: 14px; }
/* SEASON FILTER */
.season-filter {
  display: flex;
  align-items: center;
  gap: 10px;
}
.season-filter-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  transition: color 0.3s ease;
}
.season-pills {
  display: flex;
  gap: 6px;
}
.season-pill {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.season-pill:hover { color: var(--text); border-color: var(--muted); }
.season-pill.active { background: var(--red); border-color: var(--red); color: #fff; }

.section-header { margin-bottom: 24px; }

@media (max-width: 600px) {
  .driver-modal { flex-direction: column; gap: 16px; }
  .driver-modal-photo,
  .driver-modal-photo-placeholder {
    width: 100%;
    min-width: unset;
    height: 300px;
    border-radius: 10px;
    object-position: top center;
  }
  .driver-modal-number { font-size: 38px; }
  .driver-modal-name   { font-size: 20px; }
  .driver-stats-grid   { grid-template-columns: 1fr 1fr; }
}

/* CIRCUITS GRID */
.circuits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.circuit-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}
.circuit-card:hover { border-color: var(--red); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(225,6,0,0.1); }
.circuit-card-map {
  position: relative;
  height: 160px;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  padding: 12px;
}
.circuit-card-map img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.25s;
}
.circuit-card:hover .circuit-card-map img { transform: scale(1.06); }
.circuit-country-badge {
  position: absolute;
  bottom: 8px; left: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
}
.circuit-svg-missing { background: linear-gradient(135deg, #111, #1a1a1a); }
.circuit-svg-fallback {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  padding: 8px;
}
.circuit-card-body { padding: 14px 16px; }
.circuit-name { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.circuit-location { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.circuit-quick-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.circuit-quick-stats span {
  font-size: 12px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cqs-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* CIRCUIT MODAL */
.circuit-modal-svg {
  background: #111;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  margin-bottom: 16px;
  height: 240px;
}
.circuit-modal-svg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* CIRCUIT MODAL */
.circuit-modal-header { margin-bottom: 16px; }
.circuit-modal-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.circuit-modal-location { font-size: 13px; color: var(--muted); }
.circuit-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}
.circuit-overview-stat {
  background: var(--card2);
  border-radius: 8px;
  padding: 12px 14px;
}
.cos-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.cos-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--red);
}


/* CIRCUIT CHAMPIONS */
.circuit-champions-section { margin-top: 20px; }
.circuit-champions-title {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.circuit-champions-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.circuit-champ-loading { color: var(--muted); font-size: 13px; grid-column: span 3; }
.circuit-champ-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  transition: border-color 0.2s;
}
.circuit-champ-card:hover { border-color: var(--red); }
.circuit-champ-year {
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 1px;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.circuit-champ-photo-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--border);
  overflow: hidden;
  margin: 0 auto 10px;
  background: #111;
}
.circuit-champ-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.circuit-champ-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--border);
}
.circuit-champ-name {
  font-size: 13px;
  line-height: 1.3;
  margin-bottom: 4px;
}
.circuit-champ-team {
  font-size: 11px;
  margin-bottom: 4px;
}
.circuit-champ-time {
  font-size: 11px;
  color: var(--muted);
}
@media (max-width: 480px) {
  .circuit-champions-list { grid-template-columns: 1fr; }
  .circuit-champ-loading { grid-column: span 1; }
}

/* MODAL */
.modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-box {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: 12px;
  padding: 32px;
  max-width: 700px;
  width: 90%;
  max-height: 75vh;
  overflow-y: auto;
  z-index: 1;
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.modal-close:hover {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
  transform: rotate(90deg);
}
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* WIN PROBABILITY */
.prob-section { margin-top: 20px; }
.prob-header { margin-bottom: 14px; }
.prob-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: 3px;
}
.prob-subtitle { font-size: 11px; color: var(--muted); }
.prob-list { display: flex; flex-direction: column; gap: 8px; }
.prob-row {
  display: grid;
  grid-template-columns: 24px 40px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card2);
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: border-color 0.15s;
  animation: viewEnter 0.2s ease both;
}
.prob-row:hover { border-color: var(--red); }
.prob-rank { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; }
.prob-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  overflow: hidden;
  background: #111;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--muted);
}
.prob-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.prob-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.prob-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prob-team { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prob-bar-wrap {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 2px;
}
.prob-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
  min-width: 2px;
}
/* Right side: pct + tags stacked */
.prob-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 56px;
}
.prob-pct { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; }
.prob-meta { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.prob-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.prob-tag.wins { background: rgba(255,215,0,0.15); color: #ffd700; }
.prob-tag.pods { background: rgba(255,255,255,0.07); color: var(--muted); }
.prob-tag.form { background: rgba(255,100,0,0.15); font-size: 12px; }
.prob-tag.car  { background: rgba(100,200,255,0.12); font-size: 12px; }

/* TEAMS GRID */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.team-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom: 3px solid var(--team-color, var(--red));
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}
.team-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  border-color: var(--team-color, var(--red));
}

/* Top 3/4 — car image */
.team-card-car {
  position: relative;
  flex: 3;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  min-height: 180px;
  overflow: hidden;
}
.team-card-car::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.03) 0%, transparent 70%);
  pointer-events: none;
}
.team-card-car img {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.7));
  transition: transform 0.3s ease;
}
.team-card:hover .team-card-car img { transform: scale(1.04); }
.team-card-car.no-car { background: linear-gradient(135deg, #111, #1a1a1a); }
.team-card-pos {
  position: absolute;
  top: 10px; left: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--team-color, var(--red));
  background: rgba(0,0,0,0.6);
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--team-color, var(--red));
  backdrop-filter: blur(4px);
}
.team-card-pts {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,0.6);
  padding: 3px 8px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* Bottom 1/4 — logo + name */
.team-card-foot {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border-top: 1px solid var(--border);
  min-height: 64px;
}
.team-card-logo {
  height: 32px;
  width: auto;
  max-width: 80px;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(1.1);
}
.team-card-foot-info { flex: 1; min-width: 0; }
.team-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--team-color, var(--text));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-card-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* Shared team meta styles (used in modal) */
.team-meta-item {
  background: var(--card2);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tm-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }
.tm-value  { font-size: 13px; font-weight: 600; color: var(--text); }

/* TEAM MODAL */
.team-modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 4px;
}
.team-modal-logo { height: 44px; width: auto; max-width: 130px; object-fit: contain; filter: brightness(1.1); }
.team-modal-name { font-size: 22px; font-weight: 800; letter-spacing: 0.5px; }
.team-modal-fullname { font-size: 12px; color: var(--muted); margin-top: 2px; }

.team-modal-car-wrap {
  background: #0a0a0a;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  margin: 16px 0;
  min-height: 140px;
}
.team-modal-car-wrap img {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.6));
}

.team-modal-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 16px 0 10px;
}

.team-modal-drivers {
  display: flex;
  gap: 16px;
  margin-bottom: 4px;
}
.team-modal-driver {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  background: var(--card2);
  border-radius: 10px;
  padding: 14px 10px;
  border: 1px solid var(--border);
}
.team-modal-driver-name { font-size: 14px; font-weight: 600; text-align: center; }

.team-modal-principal {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--card2);
  border-radius: 10px;
  padding: 14px;
  border: 1px solid var(--border);
}
.team-modal-principal-photo {
  width: 72px;
  min-width: 72px;
  height: 88px;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}
.team-modal-principal-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.tmp-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--border);
}
.team-modal-principal-name { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.team-modal-principal-bio { font-size: 12px; color: var(--muted); line-height: 1.6; }

.team-modal-tech-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ---- HIGHLIGHTS ---- */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.highlight-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  display: block;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.highlight-card:hover {
  transform: translateY(-3px);
  border-color: var(--red);
  box-shadow: 0 8px 28px rgba(225,6,0,0.15);
}
.highlight-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #0a0a0a;
  overflow: hidden;
}
.highlight-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.highlight-card:hover .highlight-thumb img { transform: scale(1.04); }
.highlight-thumb-bg {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1a0000 0%, #2a0a0a 50%, #111 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.highlight-thumb-inner {
  text-align: center;
}
.highlight-thumb-flag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
}
.highlight-thumb-round {
  font-size: 28px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: -1px;
}
.highlight-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  transition: background 0.2s;
}
.highlight-card:hover .highlight-play { background: rgba(225,6,0,0.45); }
.highlight-play svg {
  width: 48px; height: 48px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}
.highlight-body {
  padding: 14px 16px;
}
.highlight-round {
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.highlight-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.highlight-date {
  font-size: 12px;
  color: var(--muted);
}
.highlight-yt-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,0.7);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
}

/* ---- MERCH ---- */
.merch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.merch-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 32px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  grid-column: 1 / -1;
}
.merch-section-title:first-child { margin-top: 0; }

/* Product card */
.merch-product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.merch-product-card:hover {
  transform: translateY(-3px);
  border-color: var(--team-color, var(--red));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--team-color, #e10600) 40%, transparent);
}
.merch-card--teams:hover {
  background: var(--team-color, var(--red));
}
.merch-product-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #111;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.merch-card--teams .merch-product-img-wrap {
  background: #fff;
}
.merch-product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 24px 32px;
  transition: transform 0.3s ease;
  display: block;
}
.merch-product-card:hover .merch-product-img-wrap img { transform: scale(1.06); }

/* Legacy portraits — cover, face at top */
.merch-img-portrait img {
  object-fit: cover;
  object-position: top center;
  padding: 0;
}
/* LEGO — contain, no padding, white bg so box art shows fully */
.merch-img-lego {
  background: #f5f5f5;
}
.merch-img-lego img {
  padding: 8px;
  object-fit: contain;
}.merch-product-img-fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1px;
}
.merch-product-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.merch-product-team-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border: 1px solid;
  border-radius: 20px;
  padding: 2px 8px;
  display: inline-block;
  width: fit-content;
}
.merch-product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  flex: 1;
}
.merch-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.merch-product-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.merch-product-cta {
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  transition: letter-spacing 0.2s ease;
}
.merch-product-card:hover .merch-product-cta { letter-spacing: 0.5px; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .site-header { padding: 0 16px; }
  main { padding: 80px 16px 40px; }
  .nav-season-label { right: 6vw; bottom: 28px; }

  /* Modal — bottom sheet style on mobile */
  .modal { align-items: flex-end; }
  .modal-box {
    width: 100%;
    max-width: 100%;
    max-height: 82vh;
    border-radius: 16px 16px 0 0;
    padding: 20px 16px 32px;
    border-top: 3px solid var(--red);
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
  /* Drag handle hint */
  .modal-box::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 16px;
  }

  /* Hero */
  .hero { padding: 28px 20px; }
  .hero h1 { font-size: 26px; }
  .hero-f1-logo svg { width: 120px; }

  /* Season pills */
  .season-pill { font-size: 12px; padding: 4px 10px; }

  /* Grids */
  .drivers-grid  { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .races-grid    { grid-template-columns: 1fr; }
  .circuits-grid { grid-template-columns: 1fr; }
  .teams-grid    { grid-template-columns: 1fr; }

  /* Driver modal */
  .driver-modal { flex-direction: column; gap: 16px; }
  .driver-modal-photo,
  .driver-modal-photo-placeholder {
    width: 100%;
    min-width: unset;
    height: 260px;
    border-radius: 10px;
    object-fit: contain;
    object-position: center top;
    background: #1a1a1a;
  }
  .driver-modal-number { font-size: 32px; }
  .driver-modal-name   { font-size: 18px; }
  .driver-stats-grid   { grid-template-columns: 1fr 1fr; }

  /* Circuit modal */
  .circuit-modal-svg { height: 160px; }
  .circuit-overview-grid  { grid-template-columns: repeat(2, 1fr); }
  .circuit-champions-list { grid-template-columns: 1fr 1fr; }
  .circuit-champ-loading  { grid-column: span 2; }

  /* Team modal */
  .team-modal-car-wrap { min-height: 100px; }
  .team-modal-car-wrap img { max-height: 110px; }

  /* Probability rows */
  .prob-row { grid-template-columns: 20px 36px 1fr auto; gap: 8px; padding: 8px 10px; }
  .prob-pct  { font-size: 13px; }
}

/* ---- COMPARE PAGE ---- */
.compare-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.compare-selectors {
  display: grid;
  grid-template-columns: 1fr 56px 1fr;
  align-items: start;
  gap: 12px;
}
.compare-vs {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  padding-top: 30px;
  letter-spacing: 1px;
}
.compare-selector-wrap { display: flex; flex-direction: column; gap: 6px; }
.compare-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.compare-search-wrap { position: relative; }
.compare-search {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.compare-search:focus { border-color: var(--red); }
.compare-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #1e1e1e;
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.compare-dropdown.open { display: block; }
.cmp-drop-item {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.12s;
}
.cmp-drop-item:last-child { border-bottom: none; }
.cmp-drop-item:hover { background: rgba(255,255,255,0.06); }
.cmp-drop-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a2a;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.cmp-drop-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.cmp-drop-name { font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-drop-code { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.05em; }
.compare-selected-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  min-height: 38px;
}
.compare-selected-chip img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: #2a2a2a; }
.compare-selected-name { font-size: 13px; font-weight: 600; color: var(--text); }
.compare-selected-empty { font-size: 13px; color: var(--muted); }
.compare-bottom-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.compare-filter-group { display: flex; flex-direction: column; gap: 6px; }
/* season pills reused from global .season-pill styles */
.compare-btn {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.compare-btn:hover { opacity: 0.85; }
.compare-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.compare-results { display: flex; flex-direction: column; gap: 24px; }
.compare-results.hidden { display: none; }
.compare-empty { text-align: center; color: var(--muted); font-size: 15px; padding: 60px 0; }
.cmp-stats-table {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.cmp-stats-head {
  display: grid;
  grid-template-columns: 1fr 100px 1fr;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
}
.cmp-head-a { font-size: 14px; font-weight: 700; text-align: right; }
.cmp-head-mid { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: 0.07em; align-self: center; }
.cmp-head-b { font-size: 14px; font-weight: 700; text-align: left; }
.cmp-stat-row {
  display: grid;
  grid-template-columns: 1fr 100px 1fr;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  align-items: center;
}
.cmp-stat-row:last-child { border-bottom: none; }
.cmp-val-a { font-size: 16px; font-weight: 700; text-align: right; color: var(--text); }
.cmp-val-b { font-size: 16px; font-weight: 700; text-align: left; color: var(--text); }
.cmp-row-label { font-size: 11px; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: 0.06em; }
.cmp-val-a.cmp-win, .cmp-val-b.cmp-win { color: #4ade80; }
.cmp-val-a.cmp-lose, .cmp-val-b.cmp-lose { color: var(--muted); }
.cmp-bar-row {
  display: grid;
  grid-template-columns: 1fr 100px 1fr;
  padding: 0 20px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  align-items: center;
  gap: 0;
}
.cmp-bar-a-wrap { display: flex; justify-content: flex-end; }
.cmp-bar-b-wrap { display: flex; justify-content: flex-start; }
.cmp-bar { height: 4px; border-radius: 2px; min-width: 2px; transition: width 0.6s ease; }
.cmp-bar-sep { width: 100px; }
.compare-chart-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: relative;
}
.compare-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.compare-chart-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }
.cmp-chart-legend { display: flex; gap: 16px; }
.cmp-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.cmp-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.compare-chart-wrap canvas { width: 100% !important; display: block; cursor: crosshair; }
.cmp-tooltip {
  position: absolute;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  pointer-events: none;
  z-index: 50;
  display: none;
  min-width: 140px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.cmp-tooltip.visible { display: block; }
.cmp-tooltip-race { font-weight: 600; color: var(--text); margin-bottom: 6px; font-size: 13px; }
.cmp-tooltip-row { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.cmp-tooltip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cmp-tooltip-val { font-weight: 600; margin-left: auto; }
@media (max-width: 768px) {
  .compare-selectors { grid-template-columns: 1fr; }
  .compare-vs { display: none; }
  .cmp-stats-head, .cmp-stat-row, .cmp-bar-row { grid-template-columns: 1fr 80px 1fr; padding: 10px 12px; }
  .cmp-bar-sep { width: 80px; }
}
