/* AGL Racing — standalone stylesheet for the racing subdomain.
   The racing site is served from its own subdomain root (racing/), so it
   can't reach the main site's /styles.css by relative path. This file copies
   the main theme's tokens and core components (header, nav, hero, panels,
   buttons, footer) and layers racing accents on top: checkered flags, speed
   streaks, start-light countdown, and the red/blue pit-lane stripes. Keep
   the :root tokens in sync with ../styles.css when the main theme changes. */

:root {
  color-scheme: dark;
  --bg: #02050a;
  --panel: rgba(var(--surface-panel-rgb), 0.86);
  --panel-strong: rgba(var(--surface-mid-rgb), 0.96);
  --text: #f8fbff;
  --muted: #8fa0b2;
  --line: rgba(154, 204, 255, 0.22);
  --blue: #096dff;
  --blue-soft: #17a5ff;
  --blue-rgb: 9, 109, 255;
  --blue-soft-rgb: 23, 165, 255;
  /* Racing runs on black surfaces instead of the main site's navy. */
  --surface-deep-rgb: 0, 0, 0;
  --surface-panel-rgb: 10, 10, 11;
  --surface-mid-rgb: 18, 18, 20;
  --accent-strong-rgb: 88, 166, 255;
  --accent-bright-rgb: 0, 217, 255;
  --line-rgb: 154, 204, 255;
  --fg-rgb: 255, 255, 255;
  --text-soft: #dce9f7;
  --red: #ff3048;
  --red-rgb: 255, 48, 72;
  /* Neutral gray used for accents inside containers (panels, race band). */
  --gray: #9aa3ad;
  --gray-rgb: 154, 163, 173;
  /* AGL logo teal (sampled from the puck in agl-logo.png). */
  --agl-teal: #00b8d8;
  --agl-teal-rgb: 0, 184, 216;
  --orange: #ff9800;
  --green: #26d67c;
  --gold: #efc84a;
  --cyan: #15d8ff;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  /* Racing additions */
  --checker: repeating-conic-gradient(#f8fbff 0 25%, #05080d 0 50%) 0 0 / 12px 12px;
  /* The racing site's font. Saira Condensed is loaded from Google Fonts by
     each public page (index, results, racer); a page that doesn't load it —
     the racing admin — falls back to Segoe UI. */
  --font-racing: "Saira Condensed", "Segoe UI", Arial, sans-serif;
  --speed-italic: skewX(-8deg);
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  scroll-behavior: smooth;
  /* Keeps nav anchor jumps clear of the sticky header. */
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(var(--surface-deep-rgb), 0.76), rgba(var(--surface-deep-rgb), 0.92)),
    radial-gradient(circle at 18% 34%, rgba(var(--gray-rgb), 0.12), transparent 23rem),
    #000;
  color: var(--text);
  font-family: var(--font-racing);
}

/* Main site draws rink lines here; racing swaps them for diagonal speed
   streaks and a faint track-lane grid. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    repeating-linear-gradient(115deg, transparent 0 140px, rgba(var(--gray-rgb), 0.08) 140px 142px, transparent 142px 300px),
    repeating-linear-gradient(115deg, transparent 0 220px, rgba(var(--blue-soft-rgb), 0.08) 220px 221px, transparent 221px 420px),
    repeating-linear-gradient(0deg, rgba(var(--fg-rgb), 0.035) 0 1px, transparent 1px 88px);
  opacity: 0.6;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(rgba(var(--fg-rgb), 0.1) 1px, transparent 1px);
  background-size: 4px 4px;
  opacity: 0.22;
  pointer-events: none;
}

.arena-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 8% 18%, rgba(var(--gray-rgb), 0.14), transparent 16rem),
    radial-gradient(ellipse at 86% 18%, rgba(18, 127, 255, 0.22), transparent 18rem),
    linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.96));
  pointer-events: none;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

/* ── Header / nav (mirrors main site) ── */
.site-chrome {
  position: sticky;
  top: 0;
  z-index: 120;
  width: 100%;
}

.site-header {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  width: min(1500px, calc(100% - 1rem));
  margin: 0 auto;
  min-height: 66px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line);
  border-top: 0;
  background: rgba(var(--surface-deep-rgb), 0.86);
  box-shadow: 0 0 45px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(18px);
}

/* Plain white divider along the bottom edge of the header. */
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: rgba(var(--fg-rgb), 0.85);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.brand-mark img {
  width: 119px;
  height: auto;
}

.brand-tag {
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  background: linear-gradient(180deg, #2ad3ee, #0096b8);
  color: #02121a;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: var(--speed-italic);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(0.75rem, 2.2vw, 2.1rem);
  color: #d9e7f7;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.site-nav a {
  position: relative;
  padding: 1.1rem 0;
  text-decoration: none;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.45rem;
  height: 2px;
  background: var(--gold);
  box-shadow: 0 0 16px var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
}

.header-button-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.signin-button {
  display: grid;
  min-width: 78px;
  min-height: 38px;
  place-items: center;
  padding: 0.4rem 0.9rem;
  white-space: nowrap;
  border: 1px solid rgba(var(--accent-strong-rgb), 0.68);
  border-radius: 6px;
  background: rgba(var(--surface-mid-rgb), 0.86);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, background 160ms ease;
}

.signin-button:hover,
.signin-button:focus-visible {
  border-color: var(--cyan);
  background: rgba(var(--blue-soft-rgb), 0.14);
  color: #ffffff;
  box-shadow: 0 0 22px rgba(var(--blue-soft-rgb), 0.28);
}

/* Hidden for signed-in AGL members (racing.js); display:grid above beats [hidden]. */
.signin-button[hidden] {
  display: none;
}

/* Racing admin shortcut (racing.js) — yellow version of the header pill. */
.signin-button.racing-admin-button {
  border-color: rgba(239, 200, 74, 0.75);
  color: var(--gold);
}

.signin-button.racing-admin-button:hover,
.signin-button.racing-admin-button:focus-visible {
  border-color: var(--gold);
  background: rgba(239, 200, 74, 0.14);
  color: #fff3c4;
  box-shadow: 0 0 22px rgba(239, 200, 74, 0.3);
}

/* Signed-in AGL member avatar (racing.js) — same look as the main site's header. */
.header-member-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-strong-rgb), 0.68);
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.header-member-avatar:hover,
.header-member-avatar:focus-visible {
  border-color: var(--cyan);
  box-shadow: 0 0 22px rgba(var(--blue-soft-rgb), 0.28);
}

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

.header-member-avatar.role-glow-admin {
  border: 2px solid #ffe1b4;
  box-shadow: 0 0 10px rgba(255, 225, 180, 0.45), 0 0 22px rgba(255, 225, 180, 0.2);
}

.header-member-avatar.role-glow-admin:hover,
.header-member-avatar.role-glow-admin:focus-visible {
  border-color: #ffe1b4;
  box-shadow: 0 0 14px rgba(255, 225, 180, 0.6), 0 0 30px rgba(255, 225, 180, 0.3);
}

.header-member-avatar.role-glow-host {
  border: 2px solid #ff9064;
  box-shadow: 0 0 10px rgba(255, 144, 100, 0.45), 0 0 22px rgba(255, 144, 100, 0.2);
}

.header-member-avatar.role-glow-host:hover,
.header-member-avatar.role-glow-host:focus-visible {
  border-color: #ff9064;
  box-shadow: 0 0 14px rgba(255, 144, 100, 0.6), 0 0 30px rgba(255, 144, 100, 0.3);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(var(--fg-rgb), 0.04);
  color: var(--text);
  padding: 0.55rem;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: currentColor;
}

/* ── Page shell ── */
.page-shell {
  width: min(1500px, calc(100% - 1rem));
  margin: 0 auto;
  border-inline: 1px solid var(--line);
  background: rgba(var(--surface-deep-rgb), 0.38);
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-racing);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: 0.98;
  text-shadow: 0 0 24px rgba(var(--blue-soft-rgb), 0.28);
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 2.25rem);
  line-height: 1.08;
}

h3 {
  font-size: 1.28rem;
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 460px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(3.2rem, 7vw, 5.5rem) 1rem 3rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(var(--surface-deep-rgb), 0.08), rgba(var(--surface-deep-rgb), 0.96)),
    radial-gradient(ellipse at 20% 20%, rgba(var(--gray-rgb), 0.18), transparent 21rem);
}

/* Speed streaks racing across the hero. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(100deg, transparent 0 14%, rgba(var(--gray-rgb), 0.35) 14.2%, transparent 15.4%),
    linear-gradient(100deg, transparent 0 18%, rgba(var(--fg-rgb), 0.14) 18.1%, transparent 18.6%),
    linear-gradient(280deg, transparent 0 14%, rgba(var(--blue-soft-rgb), 0.35) 14.2%, transparent 15.4%),
    linear-gradient(280deg, transparent 0 18%, rgba(var(--fg-rgb), 0.14) 18.1%, transparent 18.6%);
  opacity: 0.8;
}

/* Perspective track receding toward the logo, with dashed center line. */
.hero::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 0;
  height: 48%;
  z-index: 1;
  border-inline: 3px solid rgba(var(--fg-rgb), 0.2);
  transform: perspective(500px) rotateX(62deg);
  transform-origin: bottom;
  background:
    repeating-linear-gradient(180deg, rgba(239, 200, 74, 0.7) 0 22px, transparent 22px 48px) center / 6px 100% no-repeat,
    linear-gradient(180deg, rgba(20, 26, 36, 0.2), rgba(20, 26, 36, 0.85));
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(860px, 100%);
  text-align: center;
}

.hero-logo {
  width: min(540px, 86vw);
  height: auto;
  margin: 0 auto 0.6rem;
  filter: drop-shadow(0 22px 38px rgba(0, 0, 0, 0.78));
}

.hero-copy {
  max-width: 620px;
  margin: 0.9rem auto 0;
  color: #d7e4f3;
  font-size: 1rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

/* Checkered flag corners on the hero. */
.hero-flag {
  position: absolute;
  top: 0;
  z-index: 1;
  width: 120px;
  height: 72px;
  background: var(--checker);
  opacity: 0.16;
  mask-image: linear-gradient(135deg, #000 30%, transparent 75%);
  -webkit-mask-image: linear-gradient(135deg, #000 30%, transparent 75%);
}

.hero-flag.left {
  left: 0;
}

.hero-flag.right {
  right: 0;
  transform: scaleX(-1);
}

/* ── Buttons ── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.75rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

/* .button sets display, which beats the hidden attribute; JS hides buttons
   with .hidden (e.g. Join the Grid for signed-in members). */
.button[hidden] {
  display: none;
}

.button.primary {
  background: linear-gradient(180deg, #1178ff, #0754df);
  color: white;
  box-shadow: 0 0 22px rgba(var(--blue-rgb), 0.56);
}

/* Hero "Join the Grid": Orbitron on a gunmetal button with a white edge. */
.button.join-gunmetal {
  border-color: rgba(255, 255, 255, 0.7);
  background: linear-gradient(180deg, #3a4048, #15181c);
  color: white;
  font-family: "Orbitron", var(--font-racing);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 10px 24px rgba(0, 0, 0, 0.6);
}

.button.join-gunmetal:hover {
  border-color: white;
}

.button.utility-button {
  min-height: 38px;
  padding: 0.55rem 0.85rem;
  border-color: rgba(var(--accent-strong-rgb), 0.7);
  background: rgba(var(--surface-mid-rgb), 0.8);
  color: white;
  font-size: 0.78rem;
}

.button.utility-button:hover {
  box-shadow: 0 0 20px rgba(var(--blue-rgb), 0.28);
}

/* ── Stat strip ── */
/* Hidden on the landing page for now (hidden attribute); remove it to bring
   the strip back. Needed because display:grid below beats [hidden]. */
.stat-strip[hidden] {
  display: none;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  background: rgba(var(--surface-deep-rgb), 0.92);
}

.stat-strip article {
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: 1rem;
  text-align: center;
  border-right: 1px solid var(--line);
}

.stat-strip article:last-child {
  border-right: 0;
}

.stat-strip strong {
  font-weight: 800;
  font-size: clamp(1.35rem, 2.5vw, 2.4rem);
  line-height: 0.95;
  transform: var(--speed-italic);
}

.stat-strip span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* ── Next race band with start-light countdown ── */
.race-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  margin: 1rem;
  padding: clamp(1.3rem, 4vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(100deg, rgba(var(--gray-rgb), 0.18), rgba(var(--blue-rgb), 0.12)),
    var(--panel-strong);
  box-shadow: var(--shadow);
}

.race-meta {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
  color: var(--muted);
}

.race-meta p {
  margin: 0;
}

.race-meta strong {
  color: white;
}

.start-lights {
  display: grid;
  gap: 0.8rem;
  justify-items: center;
}

.light-gantry {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: #05080d;
  border: 1px solid rgba(var(--fg-rgb), 0.12);
}

.light-gantry span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2a0b10;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.8);
  transition: background 200ms ease, box-shadow 200ms ease;
}

.light-gantry span.is-lit {
  background: var(--red);
  box-shadow: 0 0 14px var(--red), inset 0 0 4px rgba(255, 255, 255, 0.4);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 0.55rem;
}

.countdown div {
  display: grid;
  place-items: center;
  min-height: 92px;
  padding: 0.7rem;
  border: 1px solid rgba(var(--gray-rgb), 0.42);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 0 24px rgba(var(--gray-rgb), 0.13);
}

.countdown strong {
  font-weight: 800;
  font-size: clamp(1.8rem, 3.4vw, 3.2rem);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.countdown span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* ── Dashboard panels ── */
/* Driver Standings | Last Race Podium (50/50), Race Calendar full width below. */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.dashboard-grid > .calendar-panel {
  grid-column: 1 / -1;
}

/* The full-width calendar lays its rounds out in columns. */
.calendar-panel .calendar-list {
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
}

.panel,
.format-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(var(--fg-rgb), 0.055), rgba(var(--fg-rgb), 0.012)),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(var(--fg-rgb), 0.07);
}

.panel {
  position: relative;
  padding: 1rem;
  overflow: hidden;
}

/* Thin gray/blue pit-lane stripe across the top of every panel. */
.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--gray), var(--blue-soft));
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.panel-heading h2 {
  font-size: 1.24rem;
}

.panel-heading span,
.panel-heading a {
  color: #b9c8d7;
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.standings-table th {
  padding: 0.45rem 0.5rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.standings-table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid rgba(var(--fg-rgb), 0.06);
}

.standings-table td:last-child,
.standings-table th:last-child {
  text-align: right;
}

.standings-table .pos {
  width: 2.2rem;
  font-weight: 900;
  transform: var(--speed-italic);
}

.standings-table tr:nth-child(1) .pos { color: var(--gold); }
.standings-table tr:nth-child(2) .pos { color: #d5dde6; }
.standings-table tr:nth-child(3) .pos { color: #d08a4b; }

.calendar-list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.calendar-list li {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(var(--fg-rgb), 0.12);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.26);
}

.calendar-list .round {
  color: var(--gray);
  font-weight: 900;
  font-size: 0.82rem;
  text-transform: uppercase;
  transform: var(--speed-italic);
}

.calendar-list strong {
  display: block;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.calendar-list small {
  color: var(--muted);
}

.race-status {
  display: inline-flex;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.race-status.next {
  background: rgba(var(--gray-rgb), 0.18);
  color: #d3d9e0;
}

.race-status.done {
  background: rgba(var(--fg-rgb), 0.06);
  color: var(--muted);
}

.standings-table td.empty-cell,
.calendar-list .calendar-empty {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: left;
}

.calendar-list .calendar-empty {
  display: block;
}

.race-status.upcoming {
  background: rgba(var(--blue-soft-rgb), 0.16);
  color: #8fd3ff;
}

.podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  align-items: end;
  gap: 0.5rem;
  min-height: 210px;
  padding-top: 0.5rem;
}

.podium div {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.4rem;
  border-radius: 7px 7px 0 0;
  border: 1px solid rgba(var(--fg-rgb), 0.12);
  border-bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  text-align: center;
}

.podium .p1 { min-height: 180px; border-color: rgba(239, 200, 74, 0.5); box-shadow: inset 0 0 26px rgba(239, 200, 74, 0.14); }
.podium .p2 { min-height: 140px; }
.podium .p3 { min-height: 110px; }

.podium b {
  font-size: 1.6rem;
  font-weight: 900;
  transform: var(--speed-italic);
}

.podium .p1 b { color: var(--gold); }
.podium .p2 b { color: #d5dde6; }
.podium .p3 b { color: #d08a4b; }

.podium span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* Race points under each podium name (racing.js renderPodium). */
.podium .podium-pts {
  font-style: normal;
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--text);
}

.podium .p1 .podium-pts { color: var(--gold); }

.podium .podium-pts[hidden] {
  display: none;
}

/* Finished races with results: the status badge is a Results button. */
.race-results-btn {
  border: 1px solid rgba(var(--red-rgb), 0.55);
  background: rgba(var(--red-rgb), 0.14);
  color: #ffd6db;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.race-results-btn:hover,
.race-results-btn:focus-visible {
  background: rgba(var(--red-rgb), 0.28);
  border-color: var(--red);
  outline: none;
}

/* Race results pop-up (racing.js openRaceResults, inside .rn-modal-card). */
.rr-body {
  display: grid;
  gap: 1rem;
}

.rr-body h3 {
  margin: 0;
  font-size: 1.35rem;
  text-transform: uppercase;
}

.rr-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem 1rem;
}

.rr-facts strong {
  display: block;
  font-size: 1rem;
}

.rr-label {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rr-notes {
  margin: 0;
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--red);
  background: rgba(255, 255, 255, 0.04);
}

.rr-table-wrap {
  overflow-x: auto;
}

.rr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.rr-table th,
.rr-table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid rgba(var(--fg-rgb), 0.08);
  text-align: left;
  white-space: nowrap;
}

.rr-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rr-table .num {
  text-align: right;
}

.rr-table .pos,
.rr-table .total {
  font-weight: 900;
}

.rr-table .top-1 .pos { color: var(--gold); }
.rr-table .top-2 .pos { color: #d5dde6; }
.rr-table .top-3 .pos { color: #d08a4b; }

.rr-fl {
  display: inline-block;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  background: #8b3dff;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  vertical-align: middle;
}

.rr-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .rr-table {
    font-size: 0.88rem;
  }

  .rr-table th,
  .rr-table td {
    padding: 0.5rem 0.35rem;
  }
}

/* ── Sections ── */
.section {
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 4vw, 3rem);
  border-top: 1px solid rgba(var(--line-rgb), 0.12);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 1.4rem;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.format-card {
  padding: 1.1rem;
}

.card-number {
  color: var(--gray);
  font-weight: 900;
}

.format-card h3 {
  margin-top: 0.8rem;
  font-size: 1.5rem;
  transform: var(--speed-italic);
  transform-origin: left;
}

.format-card p {
  color: var(--muted);
  line-height: 1.6;
}

/* ── Footer ── */
.site-footer {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(1500px, calc(100% - 1rem));
  margin: 0 auto;
  padding: 1.6rem 1rem 1.5rem;
  color: var(--muted);
  border-inline: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(var(--surface-deep-rgb), 0.76);
  text-transform: uppercase;
  font-size: 0.76rem;
}

/* Plain white divider along the top edge, matching the header's. */
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: rgba(var(--fg-rgb), 0.85);
}

.site-footer a {
  color: var(--text-soft);
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .format-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
  }

  .nav-toggle {
    display: block;
    grid-column: 3;
    grid-row: 1;
  }

  .header-button-group {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .site-nav {
    display: none;
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-top: 1px solid var(--line);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 0.85rem 0.25rem;
    border-bottom: 1px solid rgba(var(--fg-rgb), 0.06);
  }

  .site-nav a::after {
    bottom: 0.3rem;
  }

  .race-band {
    grid-template-columns: 1fr;
  }

  .start-lights {
    justify-items: stretch;
  }

  .light-gantry {
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .brand-tag {
    display: none;
  }

  .brand-mark img {
    width: 94px;
  }

  .header-member-avatar {
    width: 32px;
    height: 32px;
  }

  .stat-strip {
    grid-template-columns: 1fr 1fr;
  }

  .stat-strip article:nth-child(2) {
    border-right: 0;
  }

  .stat-strip article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .dashboard-grid,
  .format-grid {
    grid-template-columns: 1fr;
  }

  .countdown {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .countdown div {
    min-height: 76px;
    padding: 0.5rem 0.2rem;
  }

  .hero::after {
    left: 6%;
    right: 6%;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button,
  .light-gantry span,
  .site-nav a::after {
    transition: none;
  }
}

/* Driver names that open their Racer Card (racer.html) — standings, results. */
.racer-link {
  color: inherit;
  text-decoration: none;
}

.racer-link:hover,
.racer-link:focus-visible {
  color: var(--cyan);
  text-decoration: underline;
}
