/* ========================================
   PITCORNER — Design System
   Premium dark carbon-fiber themed F1 dashboard
   ======================================== */

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

/* ── CSS Variables ── */
:root {
  /* Core palette */
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-tertiary: #1a1a25;
  --bg-card: rgba(20, 20, 32, 0.7);
  --bg-card-hover: rgba(28, 28, 45, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);

  /* Text */
  --text-primary: #f0f0f5;
  --text-secondary: #9898ad;
  --text-muted: #5a5a72;
  --text-accent: #e10600;

  /* F1 Red accent */
  --f1-red: #e10600;
  --f1-red-glow: rgba(225, 6, 0, 0.35);
  --f1-red-soft: rgba(225, 6, 0, 0.12);

  /* Tyre compounds */
  --tyre-soft: #ff3333;
  --tyre-medium: #ffd000;
  --tyre-hard: #e0e0e0;
  --tyre-inter: #39b54a;
  --tyre-wet: #2b7bcd;

  /* Borders & surfaces */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(225, 6, 0, 0.3);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px var(--f1-red-glow);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-base: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Carbon fiber background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(225, 6, 0, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(30, 30, 80, 0.15) 0%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.008) 2px,
      rgba(255, 255, 255, 0.008) 4px
    );
  pointer-events: none;
  z-index: 0;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: var(--space-sm);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: var(--space-2xl);
  font-weight: 400;
}

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

/* ── Layout ── */
.app-container {
  position: relative;
  z-index: 1;
}

.section {
  padding: var(--space-3xl) var(--space-lg);
  max-width: 1400px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .section {
    padding: var(--space-3xl) var(--space-2xl);
  }
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: transform var(--transition-base);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  height: 60px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--text-primary);
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--f1-red);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 14px;
  color: white;
}

.nav-logo-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.nav-logo-text span {
  color: var(--f1-red);
}

.nav-links {
  display: none;
  list-style: none;
  gap: var(--space-xs);
}

@media (min-width: 900px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

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

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.year-selector {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.year-selector label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.year-selector select {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239898ad' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.year-selector select:hover {
  border-color: var(--f1-red);
}

/* Mobile nav toggle */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: all var(--transition-fast);
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-md);
  z-index: 999;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu a {
  display: block;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px var(--space-md);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.mobile-menu a:hover,
.mobile-menu a.active {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

/* ── Hero Section ── */
.hero {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 100px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(ellipse at center, var(--f1-red-soft) 0%, transparent 60%);
  animation: heroPulse 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes heroPulse {
  0% { opacity: 0.3; transform: scale(1); }
  100% { opacity: 0.6; transform: scale(1.1); }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 16px;
  background: var(--f1-red-soft);
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--f1-red);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-lg);
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--f1-red);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--space-md);
}

.hero-title .accent {
  background: linear-gradient(135deg, var(--f1-red) 0%, #ff4444 50%, var(--f1-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
  line-height: 1.7;
}

/* Hero stats grid */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

@media (min-width: 640px) {
  .hero-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  transition: all var(--transition-base);
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: var(--space-xs);
}

.stat-value.accent {
  color: var(--f1-red);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* ── Glass Card ── */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

/* ── Standings Table ── */
.standings-toggle {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-xl);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 4px;
  width: fit-content;
}

.standings-toggle button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.standings-toggle button.active {
  background: var(--f1-red);
  color: white;
}

.standings-toggle button:hover:not(.active) {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

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

.standings-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.standings-table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  vertical-align: middle;
}

.standings-table tr {
  transition: background var(--transition-fast);
}

.standings-table tbody tr:hover {
  background: var(--bg-glass-hover);
}

.driver-cell {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.driver-headshot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.driver-info {
  display: flex;
  flex-direction: column;
}

.driver-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.driver-team {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.team-color-bar {
  width: 4px;
  height: 36px;
  border-radius: 2px;
  flex-shrink: 0;
}

.position-badge {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  width: 32px;
  text-align: center;
  color: var(--text-secondary);
}

.position-badge.p1 { color: #ffd700; }
.position-badge.p2 { color: #c0c0c0; }
.position-badge.p3 { color: #cd7f32; }

.points-cell {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.95rem;
}

.points-bar-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.points-bar {
  height: 6px;
  border-radius: 3px;
  transition: width 800ms var(--ease-out);
  min-width: 2px;
}

.sparkline-cell canvas {
  display: block;
}

/* ── Calendar ── */
.calendar-scroll {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-md);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.race-card {
  flex: 0 0 240px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}

.race-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.race-card.active {
  border-color: var(--f1-red);
  box-shadow: var(--shadow-glow);
}

.race-card.current {
  border-color: var(--f1-red);
}

.race-card.current::before {
  content: 'THIS WEEKEND';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--f1-red);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  padding: 3px;
  letter-spacing: 0.12em;
  z-index: 2;
}

.race-card-header {
  height: 80px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.race-card-circuit {
  height: 50px;
  opacity: 0.7;
  filter: invert(1);
  object-fit: contain;
}

.race-card-flag {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 16px;
  border-radius: 2px;
  object-fit: cover;
  filter: none;
}

.race-card-body {
  padding: var(--space-md);
}

.race-card-round {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.race-card-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
  line-height: 1.3;
}

.race-card-location {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.race-card-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.race-card-winner {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.78rem;
}

.race-card-winner .trophy {
  font-size: 0.9rem;
}

.race-card-winner .winner-name {
  font-weight: 600;
  color: var(--text-primary);
}

.race-card.upcoming {
  opacity: 0.6;
}

.race-card.upcoming:hover {
  opacity: 0.85;
}

/* ── Race Detail ── */
.race-detail-header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.race-detail-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
}

.race-detail-tabs {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 4px;
  width: fit-content;
}

.race-detail-tabs button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.race-detail-tabs button.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.race-detail-tabs button:hover:not(.active) {
  color: var(--text-primary);
}

/* Results table */
.results-table {
  width: 100%;
  border-collapse: collapse;
}

.results-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.results-table td {
  padding: 10px var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  vertical-align: middle;
}

.results-table tbody tr:hover {
  background: var(--bg-glass-hover);
}

/* Charts */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.chart-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.chart-canvas {
  width: 100%;
  height: 350px;
  display: block;
}

/* Strategy timeline */
.strategy-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.strategy-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.8rem;
}

.strategy-driver {
  width: 45px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.strategy-bar-container {
  flex: 1;
  display: flex;
  height: 24px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  gap: 1px;
}

.strategy-stint {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.7);
  min-width: 20px;
  transition: opacity var(--transition-fast);
}

.strategy-stint:hover {
  opacity: 0.85;
}

.strategy-stint.soft { background: var(--tyre-soft); }
.strategy-stint.medium { background: var(--tyre-medium); }
.strategy-stint.hard { background: var(--tyre-hard); }
.strategy-stint.intermediate { background: var(--tyre-inter); }
.strategy-stint.wet { background: var(--tyre-wet); }

/* Overtakes feed */
.overtakes-feed {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.overtake-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  border-left: 3px solid var(--f1-red);
}

.overtake-position {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  width: 30px;
  flex-shrink: 0;
}

.overtake-text {
  flex: 1;
}

.overtake-text strong {
  color: var(--text-primary);
}

.overtake-lap {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── H2H Section ── */
.h2h-selectors {
  display: flex;
  gap: var(--space-xl);
  justify-content: center;
  align-items: center;
  margin-bottom: var(--space-2xl);
  flex-wrap: wrap;
}

.h2h-driver-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.h2h-headshot {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-tertiary);
  border: 3px solid var(--border-subtle);
  transition: border-color var(--transition-base);
}

.h2h-vs {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 1.8rem;
  color: var(--text-muted);
}

.h2h-select {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
  min-width: 180px;
  transition: border-color var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239898ad' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.h2h-select:hover,
.h2h-select:focus {
  border-color: var(--f1-red);
}

/* H2H comparison bars */
.h2h-comparison {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  max-width: 700px;
  margin: 0 auto;
}

.h2h-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.h2h-stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.h2h-stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.h2h-stat-values {
  display: flex;
  gap: var(--space-lg);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.9rem;
}

.h2h-bar-container {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-tertiary);
  gap: 2px;
}

.h2h-bar-left,
.h2h-bar-right {
  height: 100%;
  border-radius: 4px;
  transition: width 600ms var(--ease-out);
}

/* ── Loading States ── */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-tertiary) 25%,
    rgba(255, 255, 255, 0.05) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-sm);
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: var(--space-md);
}

.skeleton-card {
  height: 200px;
  border-radius: var(--radius-lg);
}

.skeleton-row {
  height: 52px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

/* ── Reveal Animation ── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Lap time formatting ── */
.lap-time {
  font-family: 'JetBrains Mono', monospace;
}

.fastest-lap {
  color: #a855f7;
  font-weight: 600;
}

.gap-positive {
  color: var(--f1-red);
}

.gap-negative {
  color: #22c55e;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .standings-table th:nth-child(n+5),
  .standings-table td:nth-child(n+5) {
    display: none;
  }

  .results-table th:nth-child(n+6),
  .results-table td:nth-child(n+6) {
    display: none;
  }

  .h2h-selectors {
    gap: var(--space-md);
  }

  .h2h-headshot {
    width: 60px;
    height: 60px;
  }

  .race-card {
    flex: 0 0 200px;
  }
}

/* ── No Data State ── */
.no-data {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-muted);
}

.no-data-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.no-data-text {
  font-size: 1rem;
  margin-bottom: var(--space-sm);
}

.no-data-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-3xl);
}

.footer-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.footer-text a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* ── Tooltip ── */
.chart-tooltip {
  position: absolute;
  background: rgba(10, 10, 15, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.75rem;
  color: var(--text-primary);
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.chart-tooltip.visible {
  opacity: 1;
}

/* Key stats mini grid */
.key-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.key-stat {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
}

.key-stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.key-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* Race detail sub-grid */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

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

/* Constructor table specific */
.constructor-drivers {
  display: flex;
  gap: var(--space-xs);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.constructor-bar-container {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-tertiary);
  gap: 1px;
  margin-top: var(--space-xs);
}

/* Season progress */
.season-progress {
  max-width: 500px;
  margin: var(--space-xl) auto 0;
  position: relative;
  z-index: 1;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  font-weight: 500;
}

.progress-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--f1-red), #ff4444);
  border-radius: 3px;
  transition: width 1s var(--ease-out);
}

/* Select with team colors */
.h2h-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 8px;
}

/* Teammates quick-pick */
.teammates-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: var(--space-xl);
}

.teammate-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: 'Inter', sans-serif;
}

.teammate-btn:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.teammate-btn.active {
  border-color: var(--f1-red);
  color: var(--f1-red);
}

/* ── Driver Profile Modal ── */
.driver-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms var(--ease-out);
}

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

.driver-modal {
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 400ms var(--ease-spring);
}

.driver-modal-overlay.open .driver-modal {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .driver-modal {
    align-self: center;
    border-radius: var(--radius-xl);
    max-height: 80vh;
  }
}

.driver-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 10;
}

.driver-modal-close:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

/* Header */
.dm-header {
  position: relative;
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.dm-header::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  opacity: 0.08;
  pointer-events: none;
}

.dm-headshot {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid currentColor;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

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

.dm-driver-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.dm-driver-team {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.dm-driver-number {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  opacity: 0.12;
  position: absolute;
  right: var(--space-xl);
  bottom: var(--space-md);
}

/* Body */
.dm-body {
  padding: var(--space-lg) var(--space-xl) var(--space-xl);
}

/* Stat tiles */
.dm-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

@media (max-width: 500px) {
  .dm-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dm-stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-sm);
  text-align: center;
}

.dm-stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 2px;
}

.dm-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

/* Section titles */
.dm-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  margin-top: var(--space-xl);
}

/* Race results bar chart */
.dm-races-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  padding-top: var(--space-sm);
}

.dm-race-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}

.dm-race-bar {
  width: 100%;
  max-width: 28px;
  min-height: 4px;
  border-radius: 3px 3px 0 0;
  transition: all 600ms var(--ease-out);
  position: relative;
  cursor: default;
}

.dm-race-bar:hover {
  opacity: 0.8;
  transform: scaleY(1.05);
  transform-origin: bottom;
}

.dm-race-bar-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
}

.dm-race-pos {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

/* Points progression */
.dm-chart-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: var(--space-md);
}

.dm-chart-canvas {
  width: 100%;
  height: 100px;
}

/* Teammate comparison */
.dm-teammate-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.dm-tm-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  width: 100px;
  flex-shrink: 0;
}

.dm-tm-bar {
  flex: 1;
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.dm-tm-bar-left {
  height: 100%;
  border-radius: 4px 0 0 4px;
  transition: width 600ms var(--ease-out);
}

.dm-tm-bar-right {
  height: 100%;
  border-radius: 0 4px 4px 0;
  transition: width 600ms var(--ease-out);
}

.dm-tm-values {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  min-width: 60px;
}

.dm-tm-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Consistency gauge */
.dm-consistency-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-top: var(--space-md);
}

.dm-consistency-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.dm-consistency-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 800ms var(--ease-out);
}

.dm-consistency-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.dm-consistency-score {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  white-space: nowrap;
}

/* Clickable rows */
.standings-table tbody tr {
  cursor: pointer;
}

.standings-table tbody tr:active {
  background: rgba(225, 6, 0, 0.06);
}

/* ── Custom Dropdown Styling ── */
.custom-select-container {
  position: relative;
  min-width: 220px;
}

.custom-select-trigger {
  width: 100%;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.custom-select-trigger:hover,
.custom-select-trigger:focus {
  border-color: var(--f1-red);
  box-shadow: 0 0 15px rgba(225, 6, 0, 0.15);
}

.custom-select-team-line {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--text-muted);
  transition: background var(--transition-fast);
}

.custom-select-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 6px;
  padding-right: 8px;
}

.custom-select-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.custom-select-container.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(17, 17, 24, 0.95);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 200ms var(--ease-out);
}

.custom-select-container.open .custom-select-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-option-group-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 10px 14px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-option-group-title:first-child {
  border-top: none;
}

.custom-option-group-color-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.custom-option {
  padding: 8px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-option:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.custom-option.selected {
  color: var(--f1-red);
  background: var(--f1-red-soft);
  font-weight: 600;
}

/* ── Race Weather & Environmental Bar ── */
.race-weather-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 0.76rem;
  color: var(--text-secondary);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  align-items: center;
}

@media (max-width: 768px) {
  .race-weather-bar {
    border-radius: var(--radius-md);
    width: 100%;
    justify-content: space-around;
    padding: 10px;
  }
}

.weather-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.weather-item span {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Incidents Feed Timeline ── */
.incidents-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  position: relative;
  padding: var(--space-md) var(--space-sm);
  max-height: 480px;
  overflow-y: auto;
}

.incidents-feed::before {
  content: '';
  position: absolute;
  left: 21px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--bg-tertiary);
  z-index: 1;
}

.incident-item {
  display: flex;
  gap: var(--space-md);
  position: relative;
  z-index: 2;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(15px);
  animation: slideInUp 350ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.incident-badge {
  flex: 0 0 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.incident-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.incident-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.incident-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.incident-lap {
  color: var(--f1-red);
  font-family: 'JetBrains Mono', monospace;
}

.incident-time {
  color: var(--text-muted);
}

.incident-msg {
  font-size: 0.84rem;
  color: var(--text-primary);
  line-height: 1.4;
  font-family: 'Inter', sans-serif;
}

/* Incident Category Specifics */
.incident-sc .incident-badge {
  border-color: #ffb703;
  background: rgba(255, 183, 3, 0.1);
  color: #ffb703;
  box-shadow: 0 0 10px rgba(255, 183, 3, 0.2);
}
.incident-sc .incident-lap {
  color: #ffb703;
}

.incident-flag-red .incident-badge {
  border-color: #ff3333;
  background: rgba(255, 51, 51, 0.15);
  color: #ff3333;
  box-shadow: 0 0 10px rgba(255, 51, 51, 0.3);
}
.incident-flag-red .incident-lap {
  color: #ff3333;
}

.incident-flag-yellow .incident-badge {
  border-color: #ffd166;
  background: rgba(255, 209, 102, 0.1);
  color: #ffd166;
}

.incident-flag-green .incident-badge {
  border-color: #06d6a0;
  background: rgba(6, 214, 160, 0.1);
  color: #06d6a0;
}

.incident-stewards .incident-badge {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.2);
}
.incident-stewards .incident-lap {
  color: #a855f7;
}

/* ── Driver Profile Modal Additions ── */
.dm-tyre-bar-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  width: 55px;
  font-weight: 600;
}

.dm-tyre-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.dm-tyre-track {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.dm-tyre-fill {
  height: 100%;
  border-radius: 4px;
}

.dm-tyre-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-secondary);
  width: 45px;
  text-align: right;
  font-weight: 600;
}

.dm-milestone-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.dm-milestone-icon {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
}

.dm-milestone-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.dm-milestone-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Points Tracker Card Responsive Styles ── */
.points-tracker-card {
  margin: 32px auto 0 auto;
  width: 100%;
  max-width: 900px;
  padding: 28px;
  text-align: left;
  box-sizing: border-box;
}

.points-tracker-chart-container {
  height: 360px;
  margin-bottom: 8px;
  position: relative;
  width: 100%;
}

@media (max-width: 768px) {
  .points-tracker-card {
    padding: 16px 12px;
    margin-top: 24px;
  }
  .points-tracker-chart-container {
    height: 280px;
  }
}

@media (max-width: 480px) {
  .points-tracker-chart-container {
    height: 240px;
  }
}

/* ── Grand Prix Telemetry Modal Responsive Layouts ── */
.dm-header-banner {
  background: linear-gradient(135deg, var(--dm-team-color-alpha) 0%, rgba(25,25,40,0.98) 100%);
  padding: 32px 24px 24px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  position: relative;
}

.dm-header-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--dm-team-color);
}

.dm-header-avatar {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  border: 2px solid var(--dm-team-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dm-header-avatar img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.dm-grid-stats {
  padding: 16px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  background: rgba(0,0,0,0.12);
  border-bottom: 1px solid var(--border-subtle);
}

.dm-grid-sector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

@media (max-width: 480px) {
  .dm-header-banner {
    padding: 24px 16px 16px 16px;
    gap: 12px;
  }
  .dm-header-avatar {
    width: 68px;
    height: 68px;
  }
  .dm-grid-stats {
    padding: 12px 16px;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .dm-grid-sector {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

/* ── Footer Action Buttons ── */
.footer-action-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.footer-action-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.footer-action-btn i {
  font-size: 0.8rem;
  transition: transform var(--transition-fast);
}

.footer-action-btn:hover i {
  transform: scale(1.1);
}

/* ── Support Cards ── */
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.support-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: all 300ms var(--ease-out);
  position: relative;
  overflow: hidden;
}

.support-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--brand-color-alpha) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 300ms var(--ease-out);
}

.support-card:hover::before {
  opacity: 1;
}

.support-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-color);
  box-shadow: 0 8px 30px var(--brand-color-glow);
}

.support-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--brand-color);
  transition: all 300ms var(--ease-out);
  z-index: 1;
}

.support-card:hover .support-card-icon {
  background: var(--brand-color);
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 15px var(--brand-color-glow);
}

.support-card-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  z-index: 1;
}

.support-card-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  z-index: 1;
}

/* Specific Brands */
.support-bmc {
  --brand-color: #FFDD00;
  --brand-color-alpha: rgba(255, 221, 0, 0.05);
  --brand-color-glow: rgba(255, 221, 0, 0.15);
}
.support-kofi {
  --brand-color: #FF5E5B;
  --brand-color-alpha: rgba(255, 94, 91, 0.05);
  --brand-color-glow: rgba(255, 94, 91, 0.15);
}
.support-github {
  --brand-color: #EA4AAA;
  --brand-color-alpha: rgba(234, 74, 170, 0.05);
  --brand-color-glow: rgba(234, 74, 170, 0.15);
}
.support-paypal {
  --brand-color: #0079C1;
  --brand-color-alpha: rgba(0, 121, 193, 0.05);
  --brand-color-glow: rgba(0, 121, 193, 0.15);
}

/* ── Feedback Form & Rating ── */
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: var(--space-md);
}

.feedback-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feedback-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.feedback-input,
.feedback-select,
.feedback-textarea {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
}

.feedback-input:focus,
.feedback-select:focus,
.feedback-textarea:focus {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.03);
}

.feedback-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Star Rating Array */
.rating-stars {
  display: flex;
  gap: 8px;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  margin: 4px 0;
}

.rating-star {
  transition: transform 150ms var(--ease-out), color 150ms var(--ease-out);
}

.rating-star:hover {
  transform: scale(1.2);
}

.rating-star.active {
  color: #ffd000;
  text-shadow: 0 0 10px rgba(255, 208, 0, 0.3);
}

.feedback-submit-btn {
  background: var(--f1-red);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 10px 24px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
  margin-top: 10px;
}

.feedback-submit-btn:hover {
  background: #ff1e18;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(225, 6, 0, 0.4);
}

.feedback-submit-btn:active {
  transform: translateY(0);
}

/* Success Animation Screen */
.feedback-success-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  animation: fadeIn 300ms var(--ease-out);
}

.success-checkmark-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(57, 181, 74, 0.1);
  border: 2px solid #39b54a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #39b54a;
  box-shadow: 0 0 25px rgba(57, 181, 74, 0.25);
  margin-bottom: 24px;
  animation: scaleIn 400ms var(--ease-spring);
}

.success-checkmark-circle i {
  animation: rotateCheck 500ms 200ms ease-out both;
}

@keyframes scaleIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes rotateCheck {
  from { transform: rotate(-10deg) scale(0.9); opacity: 0; }
  to { transform: rotate(0deg) scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── API Loading Banner (Fixed Top Overlay) ── */
.api-loading-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 500ms var(--ease-out), opacity 400ms ease;
  pointer-events: none;
  font-family: 'Outfit', sans-serif;
}

.api-loading-banner.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.api-loading-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(15, 15, 26, 0.95), rgba(25, 25, 45, 0.92));
  border-bottom: 1px solid var(--border-accent);
  box-shadow: 0 4px 30px rgba(225, 6, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.5);
  padding: 14px 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.api-loading-spinner {
  font-size: 1.3rem;
  color: var(--f1-red);
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}

.api-loading-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.api-loading-text strong {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.api-loading-text span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.api-loading-dismiss {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 200ms ease;
  font-size: 0.8rem;
}

.api-loading-dismiss:hover {
  background: rgba(225, 6, 0, 0.2);
  border-color: var(--f1-red);
  color: var(--f1-red);
}

/* Progress bar */
.api-loading-progress {
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.api-loading-progress-bar {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--f1-red), #ff4444, var(--f1-red));
  background-size: 200% 100%;
  border-radius: 0 3px 3px 0;
  animation: loadingSlide 1.8s ease-in-out infinite;
}

@keyframes loadingSlide {
  0%   { transform: translateX(-100%); width: 30%; }
  50%  { width: 60%; }
  100% { transform: translateX(400%); width: 30%; }
}

@media (max-width: 600px) {
  .api-loading-inner {
    padding: 12px 16px;
    gap: 10px;
  }
  .api-loading-text strong {
    font-size: 0.78rem;
  }
  .api-loading-text span {
    font-size: 0.68rem;
  }
}
