/* ─────────────────────────────────────────────
   NHRA 2026 — PWA Stylesheet
   Art direction: motorsport dark, red + white
   ───────────────────────────────────────────── */

/* ── TOKENS ── */
:root {
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body:    'Barlow', 'Helvetica Neue', sans-serif;

  --text-xs:   clamp(0.7rem,  0.65rem + 0.25vw, 0.8rem);
  --text-sm:   clamp(0.8rem,  0.75rem + 0.3vw,  0.9rem);
  --text-base: clamp(0.9rem,  0.85rem + 0.3vw,  1rem);
  --text-lg:   clamp(1rem,    0.9rem  + 0.5vw,  1.2rem);
  --text-xl:   clamp(1.2rem,  1rem    + 0.8vw,  1.5rem);
  --text-2xl:  clamp(1.5rem,  1.2rem  + 1.2vw,  2rem);
  --text-3xl:  clamp(1.8rem,  1.4rem  + 1.8vw,  2.6rem);

  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── DARK MODE (default) ── */
:root, [data-theme="dark"] {
  --bg:           #0d0d0d;
  --surface:      #161616;
  --surface-2:    #1e1e1e;
  --surface-3:    #262626;
  --border:       #2e2e2e;
  --divider:      #222;

  --text:         #f0f0f0;
  --text-muted:   #888;
  --text-faint:   #555;

  --accent:       #E8161A;
  --accent-hover: #c91215;
  --accent-dim:   rgba(232, 22, 26, 0.12);

  --gold:         #F5A623;
  --gold-dim:     rgba(245, 166, 35, 0.15);

  --green:        #34C759;
  --green-dim:    rgba(52, 199, 89, 0.12);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.7);
}

/* ── LIGHT MODE ── */
[data-theme="light"] {
  --bg:           #f2f2f2;
  --surface:      #ffffff;
  --surface-2:    #f8f8f8;
  --surface-3:    #efefef;
  --border:       #e0e0e0;
  --divider:      #eaeaea;

  --text:         #111111;
  --text-muted:   #666666;
  --text-faint:   #aaaaaa;

  --accent:       #C8121A;
  --accent-hover: #a10d13;
  --accent-dim:   rgba(200, 18, 26, 0.08);

  --gold:         #D4890A;
  --gold-dim:     rgba(212, 137, 10, 0.1);

  --green:        #28A745;
  --green-dim:    rgba(40, 167, 69, 0.1);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.14);
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0d0d0d; --surface: #161616; --surface-2: #1e1e1e; --surface-3: #262626;
    --border: #2e2e2e; --divider: #222;
    --text: #f0f0f0; --text-muted: #888; --text-faint: #555;
    --accent: #E8161A; --accent-hover: #c91215; --accent-dim: rgba(232,22,26,0.12);
    --gold: #F5A623; --gold-dim: rgba(245,166,35,0.15);
    --green: #34C759; --green-dim: rgba(52,199,89,0.12);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4); --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.7);
  }
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg);
  overscroll-behavior-y: none;
}
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-top: max(var(--space-3), var(--safe-top));
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4) var(--space-3);
  max-width: 680px;
  margin: 0 auto;
  gap: var(--space-3);
}
.logo-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.logo-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
}
.logo-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: 0.02em;
}
.logo-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.2;
  font-weight: 400;
}
.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
.badge-anni {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-dim);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  border: 1px solid var(--gold);
}
.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--surface-3);
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.btn-icon:hover { color: var(--text); background: var(--border); }

/* ── STATS BAR ── */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.next-race-stat {
  flex: 2;
}
.stat-val {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
}
.stat-lbl {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 var(--space-2);
}

/* ── FILTER TABS ── */
.filter-bar {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 73px;
  z-index: 90;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-btn {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.filter-btn:not(.active):hover {
  background: var(--surface-3);
  color: var(--text);
}

/* ── SCHEDULE LIST ── */
.schedule-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-bottom: calc(var(--space-20) + var(--safe-bottom));
}

/* Section header for Regular / Countdown */
.phase-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
}
.phase-label {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  white-space: nowrap;
}
.phase-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.phase-header.countdown .phase-label { color: var(--gold); }
.phase-header.countdown .phase-line  { background: var(--gold); opacity: 0.4; }

/* Race card */
.race-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.race-card:hover, .race-card:focus-visible {
  background: var(--surface-2);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.race-card:active { transform: scale(0.98); }

/* accent strip on left */
.race-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--border);
  transition: background var(--transition);
}
.race-card.upcoming::before   { background: var(--accent); }
.race-card.next-race::before  { background: var(--gold); }
.race-card.completed::before  { background: var(--green); }
.race-card.countdown-race::before { background: var(--gold); }

/* Date column */
.card-date-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
  flex-shrink: 0;
  text-align: center;
}
.card-month {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.race-card.completed .card-month { color: var(--green); }
.race-card.next-race .card-month { color: var(--gold); }
.card-day {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin: 1px 0;
}
.card-day-end {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Card content */
.card-content {
  flex: 1;
  min-width: 0;
}
.card-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}
.card-event-num {
  font-size: var(--text-xs);
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.card-status {
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.status-upcoming  { background: var(--accent-dim);  color: var(--accent); }
.status-next      { background: var(--gold-dim);     color: var(--gold); }
.status-completed { background: var(--green-dim);    color: var(--green); }
.status-countdown { background: var(--gold-dim);     color: var(--gold); }

.card-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: var(--space-1);
}
.card-venue {
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-footer-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}
.card-tv {
  font-size: var(--text-xs);
  color: var(--text-faint);
  font-weight: 600;
}
.card-tag {
  font-size: var(--text-xs);
  background: var(--surface-3);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 500;
}
.tag-4wide  { background: var(--accent-dim); color: var(--accent); }
.tag-biggo  { background: var(--gold-dim);   color: var(--gold); }

/* Arrow */
.card-arrow {
  display: flex;
  align-items: center;
  align-self: center;
  color: var(--text-faint);
  flex-shrink: 0;
  transition: color var(--transition), transform var(--transition);
}
.race-card:hover .card-arrow { color: var(--accent); transform: translateX(2px); }

/* Next race highlight */
.race-card.next-race {
  border-color: var(--gold);
  background: var(--surface-2);
}
.next-race-banner {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.next-race-banner::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 1.4s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  color: var(--text-muted);
}
.empty-state svg { margin: 0 auto var(--space-4); opacity: 0.3; }
.empty-state p { font-size: var(--text-base); }

/* ── MODAL SHEET ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.modal-backdrop.visible { opacity: 1; }

.modal-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 201;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 680px;
  margin: 0 auto;
}
.modal-sheet.open { transform: translateY(0); }

.modal-handle {
  width: 36px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--border);
  margin: var(--space-3) auto var(--space-2);
  flex-shrink: 0;
}
.modal-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding-bottom: calc(var(--space-8) + var(--safe-bottom));
}

/* Modal hero */
.modal-hero {
  padding: var(--space-4) var(--space-5) var(--space-5);
  position: relative;
  border-bottom: 1px solid var(--divider);
}
.modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-4);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-event-num {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-1);
}
.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: var(--space-2);
}
.modal-location {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}
.modal-meta-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.meta-chip {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.dates-chip {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.tv-chip {
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Modal body */
.modal-body {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.section-block {}
.section-label {
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.tz-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* Classes pills */
.classes-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.class-pill {
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.class-pill.pro {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* Itinerary day block */
.itin-day {
  margin-bottom: var(--space-4);
}
.itin-day:last-child { margin-bottom: 0; }
.itin-day-label {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--divider);
  margin-bottom: var(--space-3);
}
.itin-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--divider);
}
.itin-row:last-child { border-bottom: none; }
.itin-time {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--accent);
  min-width: 72px;
  flex-shrink: 0;
}
.itin-event {
  font-size: var(--text-base);
  color: var(--text);
  line-height: 1.4;
}
.itin-event.muted { color: var(--text-muted); }
.itin-row.key-session .itin-event { font-weight: 600; }
.itin-row.key-session .itin-time { color: var(--gold); }

/* Tickets button */
.btn-tickets {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  transition: background var(--transition), transform var(--transition);
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.btn-tickets:hover { background: var(--accent-hover); }
.btn-tickets:active { transform: scale(0.98); }

/* ── INSTALL BANNER ── */
.install-banner {
  position: fixed;
  bottom: calc(var(--space-4) + var(--safe-bottom));
  left: var(--space-4);
  right: var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  max-width: 480px;
  margin: 0 auto;
}
.install-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.install-text strong {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
}
.install-text span {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.install-btn {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.install-dismiss {
  color: var(--text-faint);
  font-size: 14px;
  padding: var(--space-1);
  flex-shrink: 0;
}

/* ── TRANSITIONS & UTILITIES ── */
[hidden] { display: none !important; }
a, button, [role="button"] {
  transition: color var(--transition), background var(--transition),
              border-color var(--transition), box-shadow var(--transition);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Desktop: center and constrain */
@media (min-width: 680px) {
  .filter-bar { max-width: 680px; margin: 0 auto; }
  .stats-bar { max-width: 680px; margin: 0 auto; }
  .modal-sheet { left: 50%; right: auto; transform: translateX(-50%) translateY(100%); width: 100%; }
  .modal-sheet.open { transform: translateX(-50%) translateY(0); }
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: var(--safe-bottom);
  max-width: 680px;
  margin: 0 auto;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: var(--space-2) var(--space-2) var(--space-3);
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.nav-btn.active { color: var(--accent); }
.nav-btn:not(.active):hover { color: var(--text-muted); }
.nav-btn svg { transition: transform var(--transition); }
.nav-btn.active svg { transform: scale(1.1); }

/* ── VIEW CONTAINER ── */
.view { display: none; }
.view.active-view { display: block; }

/* Adjust schedule bottom padding for nav */
.schedule-wrap {
  padding-bottom: calc(var(--space-20) + var(--safe-bottom)) !important;
}

/* ── WINNERS CIRCLE ── */
.wc-header, .standings-header {
  padding: var(--space-5) var(--space-5) var(--space-3);
  max-width: 680px;
  margin: 0 auto;
}
.wc-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.wc-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}
.wc-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--space-4) calc(var(--space-20) + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Winner race card */
.wc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.wc-card-header {
  background: var(--surface-2);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--divider);
  gap: var(--space-3);
}
.wc-race-info { min-width: 0; flex: 1; }
.wc-race-num {
  font-size: var(--text-xs);
  color: var(--text-faint);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.wc-race-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wc-race-venue {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.wc-race-date {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}
.wc-trophy {
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* Winner rows */
.wc-winners-grid {
  padding: var(--space-2) 0;
}
.wc-winner-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--divider);
}
.wc-winner-row:last-child { border-bottom: none; }
.wc-class-pill {
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  min-width: 90px;
  text-align: center;
  flex-shrink: 0;
}
.pill-tf  { background: rgba(232,22,26,0.15);  color: #E8161A; border: 1px solid rgba(232,22,26,0.4); }
.pill-fc  { background: rgba(245,166,35,0.15); color: var(--gold); border: 1px solid rgba(245,166,35,0.4); }
.pill-ps  { background: rgba(52,199,89,0.12);  color: var(--green); border: 1px solid rgba(52,199,89,0.4); }
.pill-psm { background: rgba(85,145,199,0.15); color: #5591c7; border: 1px solid rgba(85,145,199,0.4); }
.pill-pm  { background: rgba(168,111,223,0.15); color: #a86fdf; border: 1px solid rgba(168,111,223,0.4); }

.wc-winner-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.wc-winner-et {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
}
.wc-winner-et span {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--accent);
}

/* Upcoming placeholder */
.wc-pending {
  padding: var(--space-5) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-faint);
  font-size: var(--text-sm);
  font-style: italic;
}

/* ── POINTS STANDINGS ── */
.class-tabs {
  display: flex;
  gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-3);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  max-width: 680px;
  margin: 0 auto;
}
.class-tabs::-webkit-scrollbar { display: none; }
.class-tab {
  font-size: var(--text-sm);
  font-weight: 700;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.class-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.standings-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--space-4) calc(var(--space-20) + var(--safe-bottom));
}

/* Leader card */
.standings-leader {
  background: linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 60%, #000) 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  position: relative;
  overflow: hidden;
}
.standings-leader::before {
  content: '🏆';
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  opacity: 0.2;
}
.leader-pos {
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.7);
  margin-bottom: var(--space-1);
}
.leader-name {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: var(--space-2);
}
.leader-pts {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}
.leader-pts span {
  font-size: var(--text-sm);
  font-weight: 500;
  margin-left: 4px;
  opacity: 0.7;
}

/* Standing rows */
.standing-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  transition: background var(--transition), border-color var(--transition);
}
.standing-row:hover { background: var(--surface-2); border-color: var(--accent); }

.standing-pos {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text-faint);
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.standing-pos.top3 { color: var(--gold); }

.standing-bar-wrap { flex: 1; min-width: 0; }
.standing-name {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.standing-bar-track {
  height: 5px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.standing-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.standing-pts-col {
  text-align: right;
  flex-shrink: 0;
}
.standing-pts {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.standing-behind {
  font-size: var(--text-xs);
  color: var(--text-faint);
  font-weight: 600;
}

/* Modal winners grid */
.modal-winners-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.modal-winner-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.modal-winner-class {
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  min-width: 80px;
  text-align: center;
  flex-shrink: 0;
}
.modal-winner-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.modal-winner-et {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
  line-height: 1.4;
}
.modal-winner-et strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--accent);
  font-weight: 700;
}

/* Data source note */
.data-note {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-faint);
  padding: var(--space-3) var(--space-4);
  max-width: 680px;
  margin: 0 auto;
}
.data-note a { color: var(--text-faint); text-decoration: underline; }

/* Fix filter-bar sticky with bottom nav */
.filter-bar {
  position: sticky;
  top: 73px;
  z-index: 90;
  background: var(--bg);
}

/* ═══════════════════════════════════════════════════════
   WINNERS CIRCLE, STANDINGS, ENTRIES, NAV — v2
   ═══════════════════════════════════════════════════════ */

/* ── BOTTOM NAV (4 tabs) ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: var(--safe-bottom);
}
/* Center nav on wide screens */
@media (min-width: 680px) {
  .bottom-nav { max-width: 680px; margin: 0 auto; left: 50%; right: auto;
    transform: translateX(-50%); width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) var(--space-1) var(--space-3);
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.nav-btn.active { color: var(--accent); }
.nav-btn:not(.active):hover { color: var(--text-muted); }

/* ── VIEWS ── */
.view { display: none; }
.view.active-view { display: block; }

/* ── SHARED VIEW HEADER ── */
.view-header {
  padding: var(--space-5) var(--space-5) var(--space-2);
  max-width: 680px;
  margin: 0 auto;
}
.entry-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.view-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.view-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── REFRESH STATUS ── */
.refresh-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
.refresh-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
}
.refresh-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}
.refresh-dot.fresh   { background: var(--green); box-shadow: 0 0 6px var(--green); }
.refresh-dot.fetching { background: var(--gold); animation: pulse 1s ease infinite; }
.refresh-dot.stale   { background: var(--text-faint); }
.btn-refresh {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}
.btn-refresh:hover { color: var(--accent); background: var(--accent-dim); }
@keyframes spin { to { transform: rotate(360deg); } }
.spinning { animation: spin 0.8s linear infinite; }

/* ── WINNERS CIRCLE ── */
.wc-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--space-4) calc(var(--space-20) + var(--safe-bottom));
  display: flex; flex-direction: column; gap: var(--space-3);
}
.wc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.wc-card-header {
  background: var(--surface-2);
  padding: var(--space-3) var(--space-4);
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-3);
  border-bottom: 1px solid var(--divider);
}
.wc-race-num {
  font-size: var(--text-xs); font-weight: 700;
  color: var(--text-faint); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 2px;
}
.wc-race-name {
  font-family: var(--font-display); font-size: var(--text-lg);
  font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wc-race-venue { font-size: var(--text-xs); color: var(--text-muted); }
.wc-race-info { min-width: 0; flex: 1; }
.wc-race-date {
  font-family: var(--font-display); font-size: var(--text-base);
  font-weight: 800; color: var(--accent); white-space: nowrap; text-align: right;
}
.wc-winners-grid { padding: var(--space-1) 0; }
.wc-winner-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--divider);
}
.wc-winner-row:last-child { border-bottom: none; }
.wc-class-pill {
  font-size: var(--text-xs); font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: var(--radius-full);
  min-width: 88px; text-align: center; flex-shrink: 0;
}
.pill-tf  { background: rgba(232,22,26,0.15);  color: #E8161A; border: 1px solid rgba(232,22,26,0.35); }
.pill-fc  { background: rgba(245,166,35,0.15); color: var(--gold);  border: 1px solid rgba(245,166,35,0.35); }
.pill-ps  { background: rgba(52,199,89,0.12);  color: var(--green); border: 1px solid rgba(52,199,89,0.35); }
.pill-psm { background: rgba(85,145,199,0.15); color: #5591c7; border: 1px solid rgba(85,145,199,0.35); }
.pill-pm  { background: rgba(168,111,223,0.15);color: #a86fdf; border: 1px solid rgba(168,111,223,0.35); }
.wc-winner-name {
  font-family: var(--font-display); font-size: var(--text-lg);
  font-weight: 700; color: var(--text); flex: 1; min-width: 0;
}
.wc-winner-et {
  font-size: var(--text-xs); color: var(--text-muted);
  font-weight: 600; text-align: right; flex-shrink: 0; line-height: 1.5;
}
.wc-winner-et span {
  display: block; font-family: var(--font-display);
  font-size: var(--text-base); font-weight: 700; color: var(--accent);
}
.wc-pending {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-4) var(--space-4);
  color: var(--text-faint); font-size: var(--text-sm); font-style: italic;
}
/* Winner badge on schedule cards */
.winner-tag { background: rgba(245,166,35,0.12) !important; color: var(--gold) !important; }

/* ── STANDINGS ── */
.class-tabs {
  display: flex; gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-3);
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  max-width: 680px; margin: 0 auto;
}
.class-tabs::-webkit-scrollbar { display: none; }
.class-tab {
  font-size: var(--text-sm); font-weight: 700;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border); white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.class-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.standings-wrap {
  max-width: 680px; margin: 0 auto;
  padding: 0 var(--space-4) calc(var(--space-20) + var(--safe-bottom));
}
.standings-leader {
  background: linear-gradient(135deg, var(--accent) 0%, #900c10 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-5); margin-bottom: var(--space-4);
  position: relative; overflow: hidden;
}
.standings-leader::after {
  content: '🏆'; position: absolute;
  right: var(--space-4); top: 50%; transform: translateY(-50%);
  font-size: 3.5rem; opacity: 0.18; pointer-events: none;
}
.leader-pos {
  font-size: var(--text-xs); font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.65); margin-bottom: var(--space-1);
}
.leader-name {
  font-family: var(--font-display); font-size: var(--text-3xl);
  font-weight: 800; color: #fff; line-height: 1; margin-bottom: var(--space-2);
}
.leader-pts {
  font-family: var(--font-display); font-size: var(--text-xl);
  font-weight: 700; color: rgba(255,255,255,0.9);
}
.leader-pts span { font-size: var(--text-sm); font-weight: 500; margin-left: 4px; opacity: 0.7; }
.standing-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: var(--space-2);
  transition: background var(--transition), border-color var(--transition);
}
.standing-row:hover { background: var(--surface-2); border-color: var(--accent); }
.standing-pos {
  font-family: var(--font-display); font-size: var(--text-lg);
  font-weight: 800; color: var(--text-faint);
  min-width: 26px; text-align: center; flex-shrink: 0;
}
.standing-pos.top3 { color: var(--gold); }
.standing-bar-wrap { flex: 1; min-width: 0; }
.standing-name {
  font-family: var(--font-display); font-size: var(--text-base);
  font-weight: 700; color: var(--text); margin-bottom: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.standing-bar-track { height: 5px; background: var(--surface-3); border-radius: var(--radius-full); overflow: hidden; }
.standing-bar-fill { height: 100%; border-radius: var(--radius-full); background: var(--accent); transition: width 0.6s cubic-bezier(0.16,1,0.3,1); }
.standing-pts-col { text-align: right; flex-shrink: 0; }
.standing-pts { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 800; color: var(--text); line-height: 1; }
.standing-behind { font-size: var(--text-xs); color: var(--text-faint); font-weight: 600; }

/* ── ENTRY LIST ── */
.entry-class-tabs {
  display: flex; gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-3);
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  max-width: 680px; margin: 0 auto;
}
.entry-class-tabs::-webkit-scrollbar { display: none; }
.entry-tab {
  font-size: var(--text-sm); font-weight: 700;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border); white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.entry-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.entry-wrap {
  max-width: 680px; margin: 0 auto;
  padding: 0 var(--space-4) var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.entry-row {
  display: flex; align-items: center; gap: var(--space-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--space-3) var(--space-4);
  transition: background var(--transition), border-color var(--transition);
}
.entry-row:hover { background: var(--surface-2); }
.entry-row.entry-new { border-color: var(--green); }
.entry-num {
  font-family: var(--font-display); font-size: var(--text-2xl);
  font-weight: 800; color: var(--accent); min-width: 48px;
  text-align: center; flex-shrink: 0; line-height: 1;
}
.entry-info { flex: 1; min-width: 0; }
.entry-name {
  font-family: var(--font-display); font-size: var(--text-lg);
  font-weight: 700; color: var(--text); line-height: 1.2;
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
}
.new-badge {
  font-size: var(--text-xs); font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--green); color: #fff;
  padding: 2px 6px; border-radius: var(--radius-full);
  flex-shrink: 0;
}
.entry-team {
  font-size: var(--text-sm); color: var(--text-muted);
  font-weight: 600; margin-top: 1px;
}
.entry-sponsor {
  font-size: var(--text-xs); color: var(--text-faint);
  margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── SHARED DATA NOTE ── */
.data-note {
  text-align: center; font-size: var(--text-xs); color: var(--text-faint);
  padding: var(--space-3) var(--space-4) calc(var(--space-20) + var(--safe-bottom));
  max-width: 680px; margin: 0 auto;
}
.data-note a { color: var(--text-faint); text-decoration: underline; }

/* ── MODAL WINNERS ── */
.modal-winner-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3); background: var(--surface-2);
  border-radius: var(--radius-md); border: 1px solid var(--border);
  margin-bottom: var(--space-2);
}
.modal-winner-name {
  font-family: var(--font-display); font-size: var(--text-lg);
  font-weight: 700; color: var(--text); flex: 1;
}
.modal-winner-et {
  font-size: var(--text-xs); color: var(--text-muted);
  text-align: right; flex-shrink: 0; line-height: 1.5;
}
.modal-winner-et strong {
  display: block; font-family: var(--font-display);
  font-size: var(--text-base); color: var(--accent); font-weight: 700;
}

/* ── SCHEDULE bottom pad for 4-tab nav ── */
.schedule-wrap { padding-bottom: calc(var(--space-20) + var(--safe-bottom)) !important; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: var(--space-12) var(--space-4);
  color: var(--text-muted);
}
.empty-state svg { margin: 0 auto var(--space-4); opacity: 0.3; }

/* ── ENTRY COUNT CARDS (in modal) ── */
.entry-count-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.entry-count-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.entry-count-nums {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}
.ecount-main {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.ecount-main span {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ecount-sub {
  font-size: var(--text-sm);
  color: var(--text-faint);
  font-weight: 500;
}

/* ── MODAL ENTRY LIST (named drivers) ── */
.modal-entry-tabs {
  padding: 0 0 var(--space-3) 0;
  margin-bottom: var(--space-2);
  max-width: 100%;
}
#modal-entry-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.modal-entry-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: background var(--transition);
}
.modal-entry-row:hover { background: var(--surface-3); }
.modal-entry-num {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--accent);
  min-width: 44px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}
.modal-entry-info { flex: 1; min-width: 0; }
.modal-entry-name {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.modal-entry-sponsor {
  font-size: var(--text-xs);
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Count-only display */
.modal-entry-count-only {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.ecount-big {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.ecount-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: var(--space-1);
}
.ecount-entered {
  font-size: var(--text-xs);
  color: var(--text-faint);
  margin-top: 4px;
}
.modal-entry-tbd {
  padding: var(--space-4);
  color: var(--text-faint);
  font-style: italic;
  font-size: var(--text-sm);
  text-align: center;
}

/* ── DRIVER HEADSHOTS in entry list ── */
.modal-entry-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  flex-shrink: 0;
  background: var(--surface-3);
  border: 2px solid var(--border);
}
.modal-entry-photo-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surface-3);
  border: 2px solid var(--border);
}
.modal-entry-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: background var(--transition);
}

/* ── COUNTDOWN TIMER ── */
.countdown-bar {
  background: linear-gradient(135deg, #1a0a0a 0%, #0d0d0d 100%);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) var(--space-4);
}
[data-theme="light"] .countdown-bar {
  background: linear-gradient(135deg, #2a0608 0%, #3d0a0d 100%);
}
.countdown-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.countdown-label {
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.countdown-race-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.1;
}
[data-theme="light"] .countdown-race-name { color: #fff; }
.countdown-units {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
}
.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 52px;
}
.cdu-val {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
  /* subtle flip animation on change */
  transition: opacity 0.15s ease;
}
.cdu-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.45);
}
.cdu-sep {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 14px;
  opacity: 0.8;
}

/* ── ACCORDION (entry list in modal) ── */
.acc-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-2);
}
.acc-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition);
}
.acc-header:hover, .acc-header.open { background: var(--surface-3); }
.acc-count {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 600;
}
.acc-chevron {
  color: var(--text-faint);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.acc-header.open .acc-chevron { transform: rotate(180deg); }
.acc-body {
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
}

/* ── DRIVER PHOTOS — HD large size ── */
/* In modal entry list */
.modal-entry-photo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  flex-shrink: 0;
  background: var(--surface-3);
  border: 2px solid var(--border);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.modal-entry-photo-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surface-3);
  border: 2px solid var(--border);
}

/* In main Drivers tab */
.driver-tab-photo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  flex-shrink: 0;
  background: var(--surface-3);
  border: 2px solid var(--border);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.driver-tab-photo-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surface-3);
  border: 2px solid var(--border);
}

/* Make entry rows slightly taller to accommodate photos */
.entry-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: background var(--transition), border-color var(--transition);
}
.entry-row:hover { background: var(--surface-2); }
.entry-row.entry-new { border-color: var(--green); }

/* Modal entry rows with photos */
.modal-entry-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: background var(--transition);
}
.modal-entry-row:hover { background: var(--surface-3); }

/* ── CLASS PILL TIERS ── */
.class-pill.alcohol {
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  color: var(--gold);
}
.class-pill.factory {
  background: rgba(85,145,199,0.12);
  border: 1px solid rgba(85,145,199,0.4);
  color: #5591c7;
}

/* ── ADDITIONAL CLASS PILL STYLES ── */
.pill-tad, .pill-tafc {
  background: rgba(245,166,35,0.15);
  color: var(--gold);
  border: 1px solid rgba(245,166,35,0.4);
}
.pill-fss {
  background: rgba(85,145,199,0.15);
  color: #5591c7;
  border: 1px solid rgba(85,145,199,0.4);
}
.pill-sport {
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ── CLASS PILL COLOR SYSTEM (overrides all previous) ── */
/* Nitro: Top Fuel + Funny Car — RED */
.pill-nitro, .wc-class-pill.pill-nitro {
  background: rgba(232,22,26,0.18) !important;
  color: #E8161A !important;
  border: 1px solid rgba(232,22,26,0.5) !important;
}
/* Pro Stock + Pro Stock Moto — GREEN */
.pill-prostock, .wc-class-pill.pill-prostock {
  background: rgba(52,199,89,0.15) !important;
  color: #34C759 !important;
  border: 1px solid rgba(52,199,89,0.45) !important;
}
/* Pro Mod — PURPLE */
.pill-promod, .wc-class-pill.pill-promod {
  background: rgba(168,111,223,0.18) !important;
  color: #a86fdf !important;
  border: 1px solid rgba(168,111,223,0.5) !important;
}
/* Top Alcohol — ORANGE/GOLD */
.pill-alcohol, .wc-class-pill.pill-alcohol {
  background: rgba(245,166,35,0.18) !important;
  color: #F5A623 !important;
  border: 1px solid rgba(245,166,35,0.5) !important;
}
/* Factory Stock + Factory X — BLUE */
.pill-factory, .wc-class-pill.pill-factory {
  background: rgba(85,145,199,0.18) !important;
  color: #5591c7 !important;
  border: 1px solid rgba(85,145,199,0.5) !important;
}
/* Sportsman — GRAY */
.pill-sport, .wc-class-pill.pill-sport {
  background: var(--surface-3) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border) !important;
}

/* ── UNIQUE COLOR PER CLASS ── */
/* Factory X — cyan */
.pill-factoryx { background: rgba(0,210,210,0.15) !important; color: #00d2d2 !important; border: 1px solid rgba(0,210,210,0.45) !important; }
/* Top Dragster — lime green */
.pill-td { background: rgba(100,220,60,0.15) !important; color: #64dc3c !important; border: 1px solid rgba(100,220,60,0.45) !important; }
/* Top Sportsman — teal */
.pill-ts { background: rgba(20,180,160,0.15) !important; color: #14b4a0 !important; border: 1px solid rgba(20,180,160,0.45) !important; }
/* Super Comp — pink */
.pill-sc { background: rgba(255,80,160,0.15) !important; color: #ff50a0 !important; border: 1px solid rgba(255,80,160,0.45) !important; }
/* Super Gas — yellow */
.pill-sg { background: rgba(255,220,0,0.15) !important; color: #e8c800 !important; border: 1px solid rgba(255,220,0,0.45) !important; }
/* Super Stock — sky blue */
.pill-ss { background: rgba(30,160,255,0.15) !important; color: #1ea0ff !important; border: 1px solid rgba(30,160,255,0.45) !important; }
/* Stock Eliminator — coral/salmon */
.pill-st { background: rgba(255,120,80,0.15) !important; color: #ff7850 !important; border: 1px solid rgba(255,120,80,0.45) !important; }
/* Competition Eliminator — lavender */
.pill-ce { background: rgba(180,130,255,0.15) !important; color: #b482ff !important; border: 1px solid rgba(180,130,255,0.45) !important; }
/* Super Street — mint */
.pill-sst { background: rgba(0,230,130,0.15) !important; color: #00e682 !important; border: 1px solid rgba(0,230,130,0.45) !important; }
