:root {
  --color-primary: #e10600;
  --color-secondary: #f4f4f4;
  --color-dark: #050505;
  --color-mid: #101010;
  --color-light: #f7f7f7;
  --color-muted: #9ca3af;
  --color-success: #28e0a2;
  --shadow-elevated: 0 20px 40px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 12px 28px rgba(0, 0, 0, 0.35);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --layout-max-width: 1200px;
}

* {
  box-sizing: border-box;
}

/* Responsive media defaults */
img,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Roboto", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top, #1a1a1a 0%, #050505 70%);
  color: var(--color-light);
  min-height: 100%;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

a {
  color: inherit;
}

/* Mobile-first base improvements */
@media (max-width: 768px) {
  body {
    font-size: 16px; /* Prevent iOS zoom on input focus */
    line-height: 1.65;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  /* Ensure all text is readable */
  p, span, div, li {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* Improve touch interactions */
  a, button, select, input {
    -webkit-tap-highlight-color: rgba(225, 6, 0, 0.15);
    touch-action: manipulation;
  }
}

/* Dynamic Navigation Menu */
.nav-menu {
  position: fixed;
  z-index: 9998;
  background: linear-gradient(135deg, rgba(10, 10, 10, 0.95), rgba(20, 20, 20, 0.95));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: all 500ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, top, right, bottom, left;
}

/* Top Position (default) */
.nav-menu--top {
  top: calc(env(safe-area-inset-top) + 1rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(95%, 1200px);
  border-radius: 999px;
  border-left: 3px solid var(--color-primary);
}

.race-day-alert {
  position: relative;
  z-index: 9997;
  margin: calc(env(safe-area-inset-top) + 6rem) auto 1.5rem;
  width: min(95%, 1200px);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 4px solid var(--color-primary);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
  color: #ffffff;
  overflow: hidden;
  transition: transform 200ms ease, opacity 200ms ease;
}

.race-day-alert__content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
}

.race-day-alert__icon {
  font-size: 1.75rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.race-day-alert__message {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.4;
}

.race-day-alert__message strong {
  display: block;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.race-day-alert__close {
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.race-day-alert__close:hover,
.race-day-alert__close:focus {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.05);
}

.race-day-alert--closing {
  opacity: 0;
  transform: translateY(-12px);
}

@media (max-width: 768px) {
  .race-day-alert {
    margin: calc(env(safe-area-inset-top) + 5rem) 1rem 1.25rem;
    width: auto;
  }

  .race-day-alert__content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .race-day-alert__close {
    align-self: flex-end;
  }
}

/* Side Position (middle of page) */
.nav-menu--side {
  top: 50% !important;
  right: 1.5rem !important;
  left: auto !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  width: auto !important;
  max-width: 180px !important;
  border-radius: var(--radius-lg) !important;
  border-left: 4px solid var(--color-primary) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  pointer-events: auto;
}

.nav-menu--side .nav-menu__container {
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  padding: 1rem 0.85rem;
}

.nav-menu--side .nav-menu__brand {
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-menu--side .nav-menu__logo {
  font-size: 1.75rem;
}

.nav-menu--side .nav-menu__title {
  font-size: 0.65rem;
  writing-mode: horizontal-tb;
  letter-spacing: 0.08rem;
  text-align: center;
}

.nav-menu--side .nav-menu__links {
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.nav-menu--side .nav-menu__link {
  font-size: 0.8rem;
  padding: 0.6rem 0.75rem;
  text-align: center;
  width: 100%;
  border-radius: var(--radius-sm);
}

.nav-menu--side .nav-menu__link::before {
  display: none;
}

/* Bottom Position (near footer) */
.nav-menu--bottom {
  bottom: calc(env(safe-area-inset-bottom) + 1rem);
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  width: min(95%, 1200px);
  border-radius: 999px;
  border-left: 3px solid var(--color-primary);
}

.nav-menu__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.75rem 1.5rem;
  padding-left: calc(1.5rem + env(safe-area-inset-left));
  padding-right: calc(1.5rem + env(safe-area-inset-right));
}

/* Consistent heading typography */
h1,
h2,
h3,
h4 {
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.06rem;
}

.nav-menu__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-menu__logo {
  font-size: 1.5rem;
  line-height: 1;
}

.nav-menu__title {
  font-family: "Orbitron", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  color: var(--color-light);
}

.nav-menu__links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu__links--collapsible {
  display: flex;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: var(--color-light);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 200ms ease, transform 200ms ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: rgba(225, 6, 0, 0.25);
  transform: translateY(-1px);
}

.nav-toggle__icon {
  position: relative;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}

.nav-toggle__label {
  font-family: 'Orbitron', sans-serif;
}

.nav-menu__link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 999px;
  transition: all 200ms ease;
  position: relative;
  min-height: 44px; /* Touch target */
  min-width: 44px; /* Touch target */
}

.nav-menu__link::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 200ms ease;
}

.nav-menu__link:hover {
  color: var(--color-light);
  background: rgba(225, 6, 0, 0.1);
}

.nav-menu__link:hover::before {
  width: 80%;
}

/* Scroll Progress Indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), #ff4a1f);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease-out;
  box-shadow: 0 2px 8px rgba(225, 6, 0, 0.5);
}

.hero {
  position: relative;
  height: auto;
  min-height: 480px;
  padding: clamp(4rem, 10vw, 7rem) clamp(1.5rem, 4vw, 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
  overflow: visible;
  background: url("https://images.unsplash.com/photo-1518640467707-6811f4a6ab73?auto=format&fit=crop&w=1600&q=80")
      center / cover no-repeat,
    linear-gradient(135deg, #111 0%, #050505 60%);
  z-index: 1;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.05) 0,
    rgba(255, 255, 255, 0.05) 12px,
    transparent 12px,
    transparent 24px
  );
  mix-blend-mode: screen;
  opacity: 0.15;
  pointer-events: none;
  animation: slidePattern 20s linear infinite;
  z-index: 0;
}

@keyframes slidePattern {
  0% {
    transform: translateX(0) translateY(0);
  }
  100% {
    transform: translateX(24px) translateY(24px);
  }
}

@media (max-width: 768px) {
  .nav-menu--persistent .nav-menu__container {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .nav-toggle {
    display: inline-flex;
    order: 2;
  }

  .nav-menu__links--collapsible {
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    display: none;
    gap: 0.75rem;
  }

  .nav-menu__links--collapsible.is-open {
    display: flex;
  }

  .nav-menu__links--collapsible li {
    width: 100%;
  }

  .nav-menu__links--collapsible .nav-menu__link {
    width: 100%;
  }
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(5, 5, 5, 0.9) 10%, rgba(225, 6, 0, 0.65) 100%);
  z-index: 1;
}

.hero__content {
  position: relative;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(2rem, 4vw, 3.5rem);
  max-width: 800px;
  width: min(800px, 100%);
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  z-index: 2;
  border-left: 4px solid var(--color-primary);
  background: rgba(10, 10, 10, 0.5);
  backdrop-filter: blur(10px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.hero__eyebrow {
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.45rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin: 0;
}

.hero__title {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  text-transform: uppercase;
  letter-spacing: 0.18rem;
  margin: 0;
}

.hero__subtitle {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: rgba(255, 255, 255, 0.78);
}

.hero__cta {
  justify-self: flex-start;
  padding: 0.9rem 2.25rem;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12rem;
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1), 
              background 300ms ease;
  box-shadow: 0 18px 36px rgba(225, 6, 0, 0.35);
  position: relative;
  overflow: hidden;
  min-height: 48px; /* Touch target */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
}

.hero__cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

.hero__cta:hover::before {
  left: 100%;
}

.hero__cta:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 26px 48px rgba(225, 6, 0, 0.5);
  background: #ff2a1f;
}

.hero__cta:active {
  transform: translateY(-2px) scale(0.98);
}

.dashboard {
  position: relative;
  z-index: 3;
  margin: clamp(-3rem, -6vw, -4rem) auto 0;
  padding: 0 clamp(1.25rem, 4vw, 3rem) clamp(3rem, 6vw, 4.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 3vw, 2.5rem);
  max-width: 1400px;
  width: 100%;
}

@media (min-width: 1201px) {
  .dashboard {
    padding-right: clamp(1.25rem, 4vw, 3rem);
  }
}

.dashboard__left,
.dashboard__right {
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 3vw, 2.5rem);
  width: 100%;
}

/* Scroll Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.panel {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

.panel:nth-child(1) {
  animation-delay: 0.1s;
}

.panel:nth-child(2) {
  animation-delay: 0.2s;
}

.panel:nth-child(3) {
  animation-delay: 0.3s;
}

.panel:nth-child(4) {
  animation-delay: 0.4s;
}

.hero__content {
  animation: fadeInUp 0.8s ease-out 0.2s forwards;
  opacity: 0;
}

.panel {
  position: relative;
  background: linear-gradient(165deg, rgba(24, 24, 24, 0.92), rgba(10, 10, 10, 0.88));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: 4px solid rgba(225, 6, 0, 0.75);
  box-shadow: var(--shadow-elevated);
  backdrop-filter: blur(12px);
  padding: clamp(1.75rem, 2.3vw, 2.35rem);
  overflow: visible;
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 300ms ease;
}

.panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.55);
  border-top-color: var(--color-primary);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(225, 6, 0, 0.08), transparent 55%);
  pointer-events: none;
}

.panel > * {
  position: relative;
  z-index: 1;
}

.panel__header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  z-index: 1;
}

.panel__header h2 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  letter-spacing: 0.06rem;
}

.panel__controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.select {
  display: inline-flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.select select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-light);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.75rem 2.5rem 0.75rem 0.75rem;
  font-size: 0.95rem;
  min-width: 0;
  min-height: 48px; /* Touch target */
  width: min(200px, 100%);
  cursor: pointer;
  transition: all 200ms ease;
  font-family: inherit;
}

.select select:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.select select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.leaderboard {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.leaderboard__scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.leaderboard__scroll::-webkit-scrollbar {
  height: 6px;
}

.leaderboard__scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.leaderboard thead {
  font-family: "Orbitron", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.leaderboard th,
.leaderboard td {
  padding: clamp(0.65rem, 1.4vw, 0.85rem) clamp(0.75rem, 1.6vw, 1rem);
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.leaderboard thead tr {
  background: rgba(255, 255, 255, 0.04);
}

.leaderboard tbody tr {
  transition: background 200ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 200ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 200ms cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid transparent;
}

.leaderboard tbody tr.leaderboard__row {
  border-left-color: var(--driver-accent, rgba(225, 6, 0, 0.6));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.leaderboard tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

.leaderboard tbody tr:hover {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0));
  transform: translateX(6px) scale(1.01);
}

.leaderboard__driver {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.leaderboard__driver-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.leaderboard__empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.leaderboard__driver span {
  display: block;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.team-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  font-size: 0.85rem;
}

.team-badge__color {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--team-color, #666);
  box-shadow: 0 0 8px var(--team-color, #666);
}

.team-badge__name {
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.05rem;
  text-transform: uppercase;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.badge:hover {
  transform: scale(1.05);
}

.badge--leader {
  background: rgba(225, 6, 0, 0.18);
  color: var(--color-secondary);
  border: 1px solid rgba(225, 6, 0, 0.45);
}

.badge--fastest {
  background: rgba(40, 224, 162, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(40, 224, 162, 0.4);
}

.insights {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

/* Season Calendar */
.calendar {
  display: grid;
  gap: 0.75rem;
}

.calendar__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 64px; /* Better touch target on mobile */
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(225, 6, 0, 0.1);
}

.calendar__item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(8px) scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.calendar__item--completed {
  border-left-color: var(--color-success);
}

.calendar__item--upcoming {
  border-left-color: var(--color-primary);
  background: rgba(225, 6, 0, 0.08);
}

.calendar__item--future {
  border-left-color: rgba(255, 255, 255, 0.3);
  opacity: 0.7;
}

.calendar__date {
  font-family: "Orbitron", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  min-width: 60px;
}

.calendar__track {
  font-size: 0.95rem;
  color: var(--color-light);
}

/* Details container for track + date/time */
.calendar__details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.calendar__time {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.calendar__status {
  font-size: 1.2rem;
}

.card {
  position: relative;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0))
      border-box,
    rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  padding: clamp(1.25rem, 2vw, 1.75rem);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid var(--color-primary);
  overflow: hidden;
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1),
              border-left-color 300ms ease;
  min-height: 120px; /* Better mobile presence */
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
  border-left-color: #ff2a1f;
}

.card__label {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
  font-weight: 600;
}

.card__value {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  text-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.card__meta {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
}

.sessions__intro {
  margin-bottom: 1.5rem;
}

.sessions__hint {
  margin: 0;
  padding: 1rem 1.25rem;
  background: rgba(225, 6, 0, 0.08);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-primary);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

.session-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

.sessions__empty {
  margin: 0;
  padding: 1.5rem 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  text-align: center;
}

/* Session Card */
.session {
  position: relative;
  background: linear-gradient(165deg, rgba(30, 30, 30, 0.95), rgba(10, 10, 10, 0.95));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 400ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 400ms ease;
}

.session:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(225, 6, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.5);
  border-color: rgba(225, 6, 0, 0.3);
}

/* Session Track Image */
.session__track-image {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(10, 10, 10, 0.95), rgba(30, 30, 30, 0.95));
}

.session__track-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 400ms ease;
}

.session:hover .session__track-image img {
  transform: scale(1.05);
}

.session__track-overlay {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.session__track-label {
  font-family: "Orbitron", sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

/* Session Banner */
.session__banner {
  position: relative;
  background: linear-gradient(135deg, rgba(225, 6, 0, 0.85) 0%, rgba(180, 5, 0, 0.75) 100%);
  padding: 1.5rem 1.75rem;
  border-bottom: 2px solid rgba(225, 6, 0, 0.5);
}

.session__banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
  pointer-events: none;
}

.session__banner-content {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.session__banner-left {
  display: grid;
  gap: 0.35rem;
}

.session__banner-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.session__banner-title {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.session__banner-date {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.session__banner-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.session__banner-winner-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  color: rgba(255, 255, 255, 0.8);
}

.session__banner-winner-name {
  font-family: "Orbitron", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--driver-accent, #FFD700);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Highlights */
.session__highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.75rem;
  background: rgba(255, 255, 255, 0.02);
}

.session__highlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  background: rgba(225, 6, 0, 0.15);
  border: 1px solid rgba(225, 6, 0, 0.4);
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.05rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

/* Results Container */
.session__results-container {
  padding: 1.75rem;
}

/* Podium */
.session__podium {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.session__podium-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.15));
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid var(--driver-accent, rgba(225, 6, 0, 0.7));
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 300ms cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 72px; /* Better touch target */
}

.session__podium-item:hover {
  transform: translateX(8px) scale(1.02);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.1));
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  border-left-color: var(--driver-accent, var(--color-primary));
}

.session__podium-item--gold {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.session__podium-item--silver {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.session__podium-item--bronze {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
}

.session__podium-position {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 100px;
}

.session__podium-medal {
  font-size: 1.75rem;
}

.session__podium-p {
  font-family: "Orbitron", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-light);
}

.session__podium-driver {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.session__podium-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--driver-accent, var(--color-light));
}

.session__podium-points {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

/* Other Results */
.session__other-results {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.session__other-header {
  font-family: "Orbitron", sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.session__other-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0.85rem;
  border-left: 3px solid var(--driver-accent, rgba(225, 6, 0, 0.45));
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  transition: background 200ms ease, transform 200ms ease, border-color 200ms ease;
}

.session__other-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
  border-left-color: var(--driver-accent, var(--color-primary));
}

.session__other-position {
  font-family: "Orbitron", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  min-width: 40px;
}

.session__other-driver {
  font-size: 0.95rem;
  color: var(--driver-accent, var(--color-light));
}

.session__other-points {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: right;
}

.session__empty {
  margin: 0;
  padding: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
}

.btn {
  font-family: "Orbitron", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  border-radius: 999px;
  padding: 0.6rem 1.5rem;
  cursor: pointer;
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1), 
              background 300ms ease;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  border: none;
  box-shadow: 0 14px 28px rgba(225, 6, 0, 0.32);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 36px rgba(225, 6, 0, 0.4);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-light);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

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

.btn--toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
}

.btn--toggle-active {
  background: linear-gradient(135deg, rgba(225, 6, 0, 0.85), rgba(225, 6, 0, 0.65));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 16px 32px rgba(225, 6, 0, 0.35);
}

.sessions__hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.sessions__status {
  margin-top: 1rem;
  min-height: 1.25rem;
  font-size: 0.85rem;
  color: var(--color-success);
}

.footer {
  padding: 2rem 1.5rem 3rem;
  padding-bottom: calc(3rem + env(safe-area-inset-bottom));
  padding-left: calc(1.5rem + env(safe-area-inset-left));
  padding-right: calc(1.5rem + env(safe-area-inset-right));
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  line-height: 1.6;
  margin-top: 4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(to top, rgba(5, 5, 5, 0.8), transparent);
}

.footer p {
  margin: 0 auto;
  max-width: min(var(--layout-max-width), calc(100% - 2rem));
  line-height: 1.5;
}

@media (max-width: 1400px) {
  /* Adjust side menu for smaller desktop screens */
  .nav-menu--side {
    right: 1rem;
    max-width: 160px;
  }
  
  .nav-menu--side .nav-menu__container {
    padding: 0.85rem 0.65rem;
  }
  
  .nav-menu--side .nav-menu__title {
    font-size: 0.6rem;
  }
  
  .nav-menu--side .nav-menu__link {
    font-size: 0.75rem;
    padding: 0.5rem 0.65rem;
  }
}

@media (max-width: 1200px) {
  .dashboard {
    grid-template-columns: 1fr;
    max-width: 900px;
  }
  
  /* Keep menu at top/bottom only on tablets */
  .nav-menu--side {
    top: 1rem;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    width: min(95%, 700px);
    max-width: none;
    border-radius: 999px;
  }
  
  .nav-menu--side .nav-menu__container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
  }
  
  .nav-menu--side .nav-menu__brand {
    flex-direction: row;
    gap: 0.75rem;
    border-bottom: none;
    padding-bottom: 0;
  }
  
  .nav-menu--side .nav-menu__logo {
    font-size: 1.5rem;
  }
  
  .nav-menu--side .nav-menu__title {
    writing-mode: horizontal-tb;
    font-size: 0.85rem;
    text-align: left;
  }
  
  .nav-menu--side .nav-menu__links {
    flex-direction: row;
    gap: 0.5rem;
    width: auto;
  }
  
  .nav-menu--side .nav-menu__link {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    width: auto;
    border-radius: 999px;
    text-align: left;
  }
  
  .nav-menu--side .nav-menu__link::before {
    display: block;
  }
}

@media (max-width: 768px) {
  .hero {
    height: auto;
    min-height: 420px;
    padding: clamp(3.5rem, 12vw, 5rem) 1.5rem;
    padding-top: calc(clamp(3.5rem, 12vw, 5rem) + env(safe-area-inset-top));
  }

  .hero__content {
    max-width: 560px;
    padding: 2.5rem 1.75rem;
    gap: 1.25rem;
    border-left-width: 3px;
  }

  .hero__eyebrow {
    letter-spacing: 0.3rem;
    font-size: clamp(0.7rem, 2vw, 0.75rem);
  }

  .dashboard {
    margin: -2.5rem auto 0;
    padding: 0 clamp(1.25rem, 4vw, 1.5rem) clamp(2.5rem, 8vw, 4rem);
    padding-left: calc(clamp(1.25rem, 4vw, 1.5rem) + env(safe-area-inset-left));
    padding-right: calc(clamp(1.25rem, 4vw, 1.5rem) + env(safe-area-inset-right));
    gap: 1.75rem;
    grid-template-columns: 1fr;
  }
  
  /* Mobile menu adjustments */
  .nav-menu__title {
    font-size: 0.8rem;
  }
  
  .nav-menu__logo {
    font-size: 1.25rem;
  }
  
  .nav-menu__links {
    gap: 0.5rem;
  }
  
  .nav-menu__link {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
    min-height: 44px;
    min-width: 44px;
  }
  
  .nav-menu--top,
  .nav-menu--bottom {
    width: min(95%, 600px);
    left: 50%;
    transform: translateX(-50%);
    margin-left: calc(env(safe-area-inset-left));
    margin-right: calc(env(safe-area-inset-right));
  }
  
  .nav-menu__container {
    padding: 0.75rem 1.25rem;
    padding-left: calc(1.25rem + env(safe-area-inset-left));
    padding-right: calc(1.25rem + env(safe-area-inset-right));
    gap: 1rem;
  }

  .panel {
    padding: 1.5rem;
    padding-left: calc(1.5rem + env(safe-area-inset-left));
    padding-right: calc(1.5rem + env(safe-area-inset-right));
  }

  .panel__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .panel__header h2 {
    font-size: clamp(1.35rem, 4vw, 1.7rem);
    line-height: 1.3;
  }

  .select {
    width: 100%;
  }

  .select select {
    min-width: 0;
    width: 100%;
    min-height: 48px;
    font-size: 1rem; /* Prevent iOS zoom */
    padding: 0.75rem 2.75rem 0.75rem 1rem;
  }

  .leaderboard__scroll {
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
  }

  .leaderboard {
    font-size: 0.9rem;
  }

  .leaderboard th,
  .leaderboard td {
    padding: 0.85rem 0.75rem;
  }

  .insights {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .calendar__item {
    padding: 1.25rem 1.25rem;
    min-height: 76px;
    gap: 1.25rem;
  }

  .calendar__date {
    font-size: 0.9rem;
    min-width: 65px;
  }

  .calendar__track {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .calendar__time {
    font-size: 0.85rem;
  }

  .card {
    padding: 1.5rem;
    min-height: 130px;
  }

  .card__label {
    font-size: 0.8rem;
  }

  .card__value {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
  }

  .card__meta {
    font-size: 0.9rem;
  }

  .session__track-image {
    height: 220px;
  }

  .session__banner {
    padding: 1.5rem;
  }

  .session__banner-title {
    font-size: 1.3rem;
  }

  .session__podium-item {
    padding: 1.25rem;
    min-height: 80px;
  }

  .session__other-item {
    padding: 0.85rem;
    min-height: 48px;
  }
}

@media (max-width: 560px) {
  .panel {
    padding: 1.2rem;
  }

  .panel__header {
    gap: 0.75rem;
  }

  /* Hide table header on mobile */
  .leaderboard thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  /* Make table body a flex container for cards */
  .leaderboard tbody {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  /* Transform each row into a card */
  .leaderboard tbody tr {
    display: block;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--color-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 200ms ease;
  }

  .leaderboard tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  }

  /* Reset table cell styling */
  .leaderboard tbody td {
    display: block;
    padding: 0;
    border: none;
  }

  /* Position number at top */
  .leaderboard tbody td:first-child {
    font-family: "Orbitron", sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
    text-align: center;
  }

  .leaderboard tbody td:first-child::before {
    content: "#";
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    margin-right: 0.25rem;
  }

  /* Driver name prominently displayed */
  .leaderboard tbody td:nth-child(2) {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Stats in a grid */
  .leaderboard tbody td:nth-child(3),
  .leaderboard tbody td:nth-child(4),
  .leaderboard tbody td:nth-child(5),
  .leaderboard tbody td:nth-child(6) {
    display: inline-block;
    width: calc(50% - 0.5rem);
    margin: 0.5rem 0;
    vertical-align: top;
  }

  .leaderboard tbody td:nth-child(3),
  .leaderboard tbody td:nth-child(5) {
    margin-right: 1rem;
  }

  .leaderboard tbody td:nth-child(3)::before,
  .leaderboard tbody td:nth-child(4)::before,
  .leaderboard tbody td:nth-child(5)::before,
  .leaderboard tbody td:nth-child(6)::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    margin-bottom: 0.35rem;
  }

  .leaderboard tbody td:nth-child(3),
  .leaderboard tbody td:nth-child(4),
  .leaderboard tbody td:nth-child(5),
  .leaderboard tbody td:nth-child(6) {
    font-family: "Orbitron", sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--color-light);
  }

  /* Actions button */
  .leaderboard tbody td:last-child {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .leaderboard tbody td:last-child .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  /* Driver name styling */
  .leaderboard__driver {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
  }

  .leaderboard__driver strong {
    font-size: 1.1rem;
    font-weight: 700;
  }

  .leaderboard__driver > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
  }

  .badge {
    margin-top: 0.25rem;
  }
  
  .team-badge {
    font-size: 0.8rem;
  }

  .sessions__hint {
    font-size: 0.8rem;
  }

  .card__value {
    font-size: 1.6rem;
  }
  
  .session__track-image {
    height: 200px;
  }
  
  .session__banner {
    padding: 1.25rem 1.25rem;
  }
  
  .session__banner-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .session__banner-right {
    align-items: flex-start;
    width: 100%;
  }
  
  .session__banner-winner-name {
    font-size: 1rem;
  }
  
  .session__results-container {
    padding: 1.25rem;
  }
  
  .session__podium-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
  }
  
  .session__podium-position {
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: 400px;
    padding: 3.5rem 1rem;
  }

  .hero__content {
    width: 100%;
    padding: 2.5rem 1.25rem;
    gap: 1rem;
    border-left-width: 3px;
  }

  .hero__eyebrow {
    font-size: 0.65rem;
    letter-spacing: 0.28rem;
  }
  
  /* Compact mobile menu */
  .nav-menu__brand {
    gap: 0.5rem;
  }
  
  .nav-menu__title {
    display: none;
  }
  
  .nav-menu__logo {
    font-size: 1.5rem;
  }
  
  .nav-menu__link {
    font-size: 0.75rem;
    padding: 0.4rem 0.65rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  .nav-menu--top,
  .nav-menu--bottom {
    width: min(98%, 500px);
  }
  
  .nav-menu__container {
    padding: 0.5rem 0.75rem;
    gap: 1rem;
  }

  .hero__title {
    font-size: clamp(2rem, 8vw, 2.85rem);
    letter-spacing: 0.12rem;
  }

  .hero__subtitle {
    font-size: 0.95rem;
  }

  .hero__cta {
    width: 100%;
    padding: 1rem 1.5rem;
    min-height: 52px;
    font-size: 0.9rem;
  }

  .dashboard {
    margin: -3.5rem auto 0;
    padding: 0 clamp(1rem, 3vw, 1.25rem) 2.75rem;
    padding-left: calc(clamp(1rem, 3vw, 1.25rem) + env(safe-area-inset-left));
    padding-right: calc(clamp(1rem, 3vw, 1.25rem) + env(safe-area-inset-right));
    gap: 1.75rem;
  }

  .panel {
    padding: 1.5rem;
    padding-left: calc(1.5rem + env(safe-area-inset-left));
    padding-right: calc(1.5rem + env(safe-area-inset-right));
  }

  .panel__header {
    align-items: stretch;
    gap: 1.25rem;
  }

  .panel__header h2 {
    font-size: 1.4rem;
    line-height: 1.3;
  }

  .panel__controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .panel__controls .btn {
    width: 100%;
  }

  .panel__controls .select {
    width: 100%;
    font-size: 0.8rem;
  }

  .panel__controls   .select select {
    width: 100%;
    font-size: 1rem; /* Prevent iOS zoom */
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    min-height: 48px;
  }

  .card {
    padding: 1.5rem;
    gap: 0.75rem;
    min-height: 140px;
  }

  .card__label {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .card__value {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  .card__meta {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  .sessions__hint {
    font-size: 0.75rem;
    padding: 0.85rem 1rem;
  }

  .session__track-image {
    height: 180px;
  }
  
  .session__banner {
    padding: 1rem;
  }
  
  .session__banner-title {
    font-size: 1.15rem;
  }
  
  .session__banner-date {
    font-size: 0.8rem;
  }
  
  .session__banner-winner-name {
    font-size: 0.95rem;
  }

  .session__results-container {
    padding: 1rem;
  }
  
  .session__podium-item {
    padding: 0.85rem;
  }
  
  .session__podium-medal {
    font-size: 1.5rem;
  }
  
  .session__podium-p {
    font-size: 0.95rem;
  }
  
  .session__podium-name {
    font-size: 0.95rem;
  }
  
  .session__podium-points {
    font-size: 0.8rem;
  }
  
  .session__other-results {
    padding: 1rem;
  }
  
  .session__other-item {
    padding: 0.85rem;
    gap: 1rem;
    min-height: 52px;
  }
  
  .session__other-position {
    font-size: 0.85rem;
  }
  
  .session__other-driver {
    font-size: 0.9rem;
  }
  
  .session__other-points {
    font-size: 0.8rem;
  }

  .btn {
    width: 100%;
    text-align: center;
    padding: 0.65rem 1rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 360px) {
  .hero {
    padding: 3rem 0.75rem;
  }

  .hero__title {
    font-size: clamp(1.85rem, 9vw, 2.5rem);
  }

  .hero__subtitle {
    font-size: 0.9rem;
  }

  /* Adjust card-based leaderboard for very small screens */
  .leaderboard tbody tr {
    padding: 1rem;
  }

  .leaderboard tbody td:first-child {
    font-size: 1.5rem;
  }

  .leaderboard tbody td:nth-child(3),
  .leaderboard tbody td:nth-child(4),
  .leaderboard tbody td:nth-child(5),
  .leaderboard tbody td:nth-child(6) {
    font-size: 1.2rem;
  }

  .leaderboard tbody td:nth-child(3)::before,
  .leaderboard tbody td:nth-child(4)::before,
  .leaderboard tbody td:nth-child(5)::before,
  .leaderboard tbody td:nth-child(6)::before {
    font-size: 0.65rem;
  }

  .leaderboard__driver strong {
    font-size: 1rem;
  }

  .badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
  }

  .footer {
    font-size: 0.75rem;
  }
}

/* ============================================
   NEW MULTI-PAGE COMPONENTS
   ============================================ */

/* Persistent Navigation */
.nav-menu--persistent {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: linear-gradient(135deg, rgba(10, 10, 10, 0.98), rgba(20, 20, 20, 0.98));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.nav-menu__link--active {
  background: rgba(225, 6, 0, 0.15);
  color: var(--color-light);
  border-bottom: 2px solid var(--color-primary);
}

.nav-menu__link--cta {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

.nav-menu__link--cta:hover {
  background: #ff2a1f;
  color: #fff;
}

/* Page Header */
.page-header {
  padding: clamp(5rem, 12vw, 8rem) clamp(1.5rem, 4vw, 3rem) clamp(2rem, 5vw, 3rem);
  background: linear-gradient(135deg, rgba(225, 6, 0, 0.15) 0%, rgba(10, 10, 10, 0.95) 70%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.page-header__content {
  max-width: 800px;
  margin: 0 auto;
}

.page-header__title {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
}

.page-header__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

/* Page Content */
.page-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 3vw, 2.5rem);
}

/* Home Page Components */
.home-dashboard {
  max-width: 1400px;
  margin: -3rem auto 0;
  padding: 0 clamp(1.5rem, 4vw, 3rem) clamp(3rem, 6vw, 4.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 5vw, 4rem);
}

.section-title {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  margin: 0 0 2rem;
  text-align: center;
  letter-spacing: 0.08rem;
}

/* Quick Stats Grid */
.quick-stats {
  position: relative;
  z-index: 3;
}

.quick-stats__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.75rem;
  background: linear-gradient(165deg, rgba(24, 24, 24, 0.92), rgba(10, 10, 10, 0.88));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 4px solid var(--color-primary);
  box-shadow: var(--shadow-elevated);
  cursor: pointer;
  transition: transform 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.55);
  border-left-color: #ff2a1f;
}

.stat-card--full {
  grid-column: span 2;
}

.stat-card__icon {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.stat-card__content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.stat-card__label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 0.5rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card__value {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin: 0 0 0.25rem;
  color: var(--color-light);
  overflow-wrap: break-word;
  word-break: keep-all;
  hyphens: none;
}

.stat-card__meta {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Feature Cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: linear-gradient(165deg, rgba(24, 24, 24, 0.92), rgba(10, 10, 10, 0.88));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: 4px solid rgba(225, 6, 0, 0.75);
  box-shadow: var(--shadow-elevated);
  padding: 2rem;
  cursor: pointer;
  transition: transform 300ms ease, box-shadow 300ms ease, border-top-color 300ms ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6);
  border-top-color: var(--color-primary);
}

.feature-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.feature-card__title {
  font-family: "Orbitron", sans-serif;
  font-size: 1.4rem;
  margin: 0;
  letter-spacing: 0.05rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  flex: 1;
  min-width: 0;
}

.feature-card__badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  padding: 0.4rem 0.75rem;
  background: rgba(225, 6, 0, 0.2);
  border: 1px solid rgba(225, 6, 0, 0.5);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}

.feature-card__description {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin: 0;
  flex: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.feature-card__footer {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.feature-card__link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap 200ms ease;
}

.feature-card:hover .feature-card__link {
  gap: 0.75rem;
}

/* Recent Activity / Highlights */
.highlights-list {
  display: grid;
  gap: 1rem;
}

.highlight-item {
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-primary);
  transition: all 300ms ease;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.highlight-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(8px);
}

/* Modal Components */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.is-active {
  display: flex;
}

.modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.modal__content {
  position: relative;
  background: linear-gradient(165deg, rgba(30, 30, 30, 0.98), rgba(10, 10, 10, 0.98));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
}

.modal__content--wide {
  max-width: 900px;
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--color-light);
  font-size: 1.75rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease;
  line-height: 1;
  padding: 0;
}

.modal__close:hover {
  background: rgba(225, 6, 0, 0.8);
  border-color: var(--color-primary);
  transform: rotate(90deg);
}

/* Driver Detail */
.driver-detail {
  padding: 1rem 0;
}

.driver-detail__header {
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.5rem;
}

.driver-detail__name {
  font-family: "Orbitron", sans-serif;
  font-size: 2rem;
  margin: 0 0 0.5rem;
}

.driver-detail__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.driver-detail__stat {
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
}

.driver-detail__stat-value {
  font-family: "Orbitron", sans-serif;
  font-size: 2rem;
  color: var(--color-primary);
  margin: 0;
}

.driver-detail__stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin: 0.25rem 0 0;
}

/* Session Detail */
.session-detail {
  padding: 1rem 0;
}

.session-detail__header {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.5rem;
}

/* Top Three Spotlight */
.top-three-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}


.spotlight-card {
  position: relative;
  padding: 2rem;
  background: linear-gradient(165deg, rgba(30, 30, 30, 0.95), rgba(10, 10, 10, 0.95));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 4px solid var(--driver-accent, rgba(225, 6, 0, 0.65));
  text-align: center;
  transition: transform 300ms ease, box-shadow 300ms ease;
  overflow: hidden;
}

.spotlight-card::before {
  content: "";
  position: absolute;
  inset: -40% 0 40% 0;
  background: radial-gradient(circle at top, var(--driver-accent, rgba(225, 6, 0, 0.6)) 0%, transparent 65%);
  opacity: 0.2;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.spotlight-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.14);
}

.spotlight-card:hover::before {
  opacity: 0.32;
}

.spotlight-card--first {
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.spotlight-card--second {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.spotlight-card--third {
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.38);
}

/* Season Progress */
.season-progress {
  padding: 1rem 0;
}

.season-progress__bar {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.season-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #ff4a1f);
  border-radius: 999px;
  transition: width 600ms ease;
}

.season-progress__stats {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

/* Enhanced Calendar Items */
.calendar__item--clickable {
  cursor: pointer;
  transition: all 300ms ease;
}

.calendar__item--clickable:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(8px) scale(1.02);
}

.calendar__circuit {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  display: block;
  margin-top: 0.25rem;
}

/* Interactive Leaderboard */
.leaderboard--interactive tbody tr {
  cursor: pointer;
}

.leaderboard--interactive tbody tr:hover {
  background: linear-gradient(90deg, rgba(225, 6, 0, 0.15), rgba(255, 255, 255, 0.1));
}

/* Hero Enhancements */
.hero--home {
  min-height: 500px;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.hero__cta--secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: var(--color-light);
}

.hero__cta--secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   MOBILE RESPONSIVE STYLES FOR NEW COMPONENTS
   ============================================ */

@media (max-width: 768px) {
  /* Persistent Navigation */
  .nav-menu--persistent {
    padding: 0;
  }

  .nav-menu--persistent .nav-menu__container {
    padding: 0.75rem 1rem;
    gap: 1rem;
  }

  .nav-menu--persistent .nav-menu__links {
    gap: 0.25rem;
  }

  .nav-menu--persistent .nav-menu__link {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }

  /* Page Header */
  .page-header {
    padding: clamp(4.5rem, 10vw, 6rem) 1.5rem clamp(1.5rem, 4vw, 2rem);
  }

  .page-header__title {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
  }

  .page-header__subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  }

  /* Page Content */
  .page-content {
    padding: 1.5rem 1rem;
  }

  /* Home Dashboard */
  .home-dashboard {
    margin: -2rem auto 0;
    padding: 0 1rem 2rem;
    gap: 2rem;
  }

  /* Quick Stats */
  .quick-stats__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stat-card--full {
    grid-column: span 1;
  }

  .stat-card {
    padding: 1.5rem;
    gap: 1rem;
    min-height: 80px;
  }

  .stat-card__icon {
    font-size: 2rem;
  }

  .stat-card__value {
    font-size: 1.5rem;
  }

  /* Feature Cards */
  .feature-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .feature-card {
    padding: 1.5rem;
  }

  .feature-card__title {
    font-size: 1.2rem;
  }

  /* Session List */
  .session-list {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  /* Modal */
  .modal {
    padding: 0.5rem;
  }

  .modal__content {
    padding: 1.5rem;
    max-height: 90vh;
  }

  .modal__close {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    top: 0.5rem;
    right: 0.5rem;
  }

  /* Driver Detail */
  .driver-detail__name {
    font-size: 1.5rem;
  }

  .driver-detail__stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .driver-detail__stat {
    padding: 0.75rem;
  }

  .driver-detail__stat-value {
    font-size: 1.5rem;
  }

  /* Top Three Spotlight */
  .top-three-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .spotlight-card {
    padding: 1.5rem;
  }

  /* Hero Actions */
  .hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .hero__cta {
    width: 100%;
  }
}

@media (max-width: 480px) {
  /* Compact Mobile Navigation */
  .nav-menu--persistent .nav-menu__title {
    display: none;
  }

  .nav-menu--persistent .nav-menu__container {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }

  .nav-menu--persistent .nav-menu__links {
    flex-wrap: wrap;
  }

  .nav-menu--persistent .nav-menu__link {
    font-size: 0.7rem;
    padding: 0.4rem 0.6rem;
  }

  .nav-menu__link--cta {
    flex: 1 0 100%;
    text-align: center;
  }

  /* Page Header */
  .page-header {
    padding: 4rem 1rem 1.5rem;
  }

  .page-header__title {
    font-size: 1.5rem;
    letter-spacing: 0.05rem;
  }

  .page-header__subtitle {
    font-size: 0.85rem;
  }

  /* Home Dashboard */
  .home-dashboard {
    padding: 0 0.75rem 1.5rem;
    gap: 1.5rem;
  }

  .section-title {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
  }

  /* Stat Cards */
  .stat-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem;
  }

  .stat-card__icon {
    font-size: 2.5rem;
  }

  /* Feature Cards */
  .feature-card {
    padding: 1.25rem;
  }

  .feature-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .feature-card__title {
    font-size: 1.1rem;
  }

  .feature-card__badge {
    font-size: 0.65rem;
    padding: 0.35rem 0.65rem;
  }

  .feature-card__description {
    font-size: 0.9rem;
  }

  /* Modal */
  .modal__content {
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }

  .modal__content--wide {
    max-width: 100%;
  }

  /* Driver Detail */
  .driver-detail__header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }

  .driver-detail__name {
    font-size: 1.3rem;
  }

  .driver-detail__stats {
    gap: 0.5rem;
  }

  .driver-detail__stat {
    padding: 0.75rem 0.5rem;
  }

  .driver-detail__stat-value {
    font-size: 1.25rem;
  }

  .driver-detail__stat-label {
    font-size: 0.7rem;
  }
}

/* Touch-friendly enhancements */
@media (hover: none) and (pointer: coarse) {
  .stat-card,
  .feature-card,
  .calendar__item--clickable,
  .leaderboard--interactive tbody tr {
    -webkit-tap-highlight-color: rgba(225, 6, 0, 0.15);
  }

  .nav-menu__link,
  .modal__close,
  .hero__cta {
    min-height: 48px;
    min-width: 48px;
  }

  .stat-card,
  .feature-card {
    min-height: 100px;
  }
}

/* Accessibility - Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .scroll-progress {
    transition: none !important;
  }
}

/* Panel subtitle helper */
.panel__subtitle {
  margin-top: -0.35rem;
  margin-bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
  font-weight: 400;
  max-width: 60ch;
}

/* Analytics Page */
.analytics-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.analytics-grid--teams {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.analytics-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 100%;
  border-top: 4px solid var(--driver-accent, rgba(225, 6, 0, 0.6));
  position: relative;
  overflow: hidden;
}

.analytics-card--team {
  border-top: 4px solid var(--team-color, var(--color-primary));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4);
}

.analytics-card--team::before {
  display: none;
}

.analytics-card::before {
  content: "";
  position: absolute;
  inset: -20% 0 40% 0;
  background: radial-gradient(circle at top, var(--driver-accent, rgba(225, 6, 0, 0.45)) 0%, transparent 70%);
  opacity: 0.18;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.analytics-card:hover::before {
  opacity: 0.28;
}

.analytics-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.analytics-card__title {
  margin: 0;
  font-size: 1.3rem;
}

.analytics-card__subtitle {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
}

.analytics-card__metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: "Orbitron", sans-serif;
  color: var(--color-primary);
}

.analytics-card__metric span {
  font-size: 1.75rem;
  line-height: 1;
}

.analytics-card__metric small {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.analytics-trend {
  display: grid;
  grid-auto-flow: column;
  align-items: flex-end;
  gap: 0.5rem;
  min-height: 140px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
  border-radius: var(--radius-sm);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.analytics-trend::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, var(--driver-accent, rgba(225, 6, 0, 0.25)) 0%, transparent 60%);
  opacity: 0.6;
  pointer-events: none;
}

.analytics-trend__bar {
  position: relative;
  width: 100%;
  border-radius: 999px 999px 4px 4px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 250ms ease, opacity 250ms ease;
  opacity: 0.75;
}

.analytics-trend__bar:hover {
  transform: translateY(-4px);
  opacity: 1;
}

.analytics-trend__bar--win {
  background: linear-gradient(180deg, var(--driver-accent, var(--color-primary)), rgba(255, 255, 255, 0.25));
}

.analytics-trend__bar--podium {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), var(--driver-accent, rgba(255, 255, 255, 0.25)));
}

.analytics-trend__bar--points {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), var(--driver-accent, rgba(255, 255, 255, 0.2)));
}

.analytics-trend__bar--classified {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
}

.analytics-trend__bar--empty {
  background: rgba(255, 255, 255, 0.08);
  opacity: 0.45;
}

.analytics-trend__labels {
  display: grid;
  grid-auto-flow: column;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.analytics-card__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.analytics-card__meta--columns {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem 1.5rem;
}

.analytics-card__meta dt {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
}

.analytics-card__meta dd {
  margin: 0.25rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.analytics-card__footer {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.analytics-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.analytics-chip--accent {
  background: rgba(225, 6, 0, 0.18);
  border-color: rgba(225, 6, 0, 0.35);
  color: rgba(255, 255, 255, 0.9);
}

.analytics-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.analytics-form__item {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 1.5rem;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(0, 1fr);
}

.analytics-form__info h3 {
  margin: 0;
  font-size: 1.1rem;
}

.analytics-form__info p {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.analytics-form__results {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.form-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 0.35rem 0.6rem;
  border-radius: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.form-chip--win {
  background: linear-gradient(120deg, var(--color-primary), #ff7a45);
  border-color: rgba(255, 122, 69, 0.65);
  color: #fff;
}

.form-chip--podium {
  background: rgba(255, 215, 128, 0.2);
  border-color: rgba(255, 215, 128, 0.4);
  color: rgba(255, 255, 255, 0.9);
}

.form-chip--points {
  background: rgba(40, 224, 162, 0.18);
  border-color: rgba(40, 224, 162, 0.45);
  color: rgba(230, 255, 248, 0.95);
}

.form-chip--classified {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.form-chip--outside {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
}

.form-chip--absent {
  background: transparent;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.45);
}

.analytics-form__summary {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

.analytics-empty {
  text-align: center;
  padding: 2rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.65);
}

@media (max-width: 768px) {
  .analytics-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .analytics-card__metric {
    align-items: flex-start;
  }

  .analytics-trend__labels {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    row-gap: 0.25rem;
  }

  .analytics-form__item {
    padding: 1rem 1.1rem;
  }
}
