/* ==========================================================================
   USA Karting — FIA USA National Karting Championship
   Theme: deep navy / gold / red-white-blue motorsport
   ========================================================================== */

:root {
  --navy-900: #070d1f;
  --navy-800: #0a1330;
  --navy-700: #101c42;
  --navy-600: #17264f;
  --navy-500: #22335f;
  --gold: #f0a51e;
  --gold-bright: #ffbe3d;
  --red: #c8102e;
  --blue: #2f6fed;
  --green: #2fbf71;
  --white: #ffffff;
  --ink: #eef2fb;
  --muted: #9aa7c7;
  --line: rgba(255, 255, 255, 0.09);
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.07);
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font-display: "Teko", "Saira Condensed", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(47, 111, 237, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(200, 16, 46, 0.12), transparent 55%),
    var(--navy-900);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: min(1180px, 92%);
  margin: 0 auto;
}

/* Wide variant for filter + list layouts — comfortable equal buffer on each side */
.container.wide {
  width: calc(100% - 128px);
  max-width: none;
}

@media (max-width: 960px) {
  .container.wide { width: 92%; }
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 13, 31, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

/* Header spans nearly the full window — logo hugs the left edge and the
   sign-in/profile hugs the right, with just a small buffer */
.site-header .container {
  width: calc(100% - 48px);
  max-width: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}

/* The shield sits directly on the dark header — no white tile */
.brand-logo {
  height: 58px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

/* Header logo only: red glow so the badge pops */
.site-header .brand-logo {
  filter:
    drop-shadow(0 0 10px rgba(200, 16, 46, 0.65))
    drop-shadow(0 0 24px rgba(200, 16, 46, 0.3))
    drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.brand-text { line-height: 1.15; }

.brand-text .brand-title {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1.05;
}

/* racing red — brighter than the flag red so it stays legible on the dark navy */
.brand-text .brand-title .accent { color: #e8283f; }

.brand-text .brand-sub {
  font-size: 11.5px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: center;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover { color: var(--white); background: var(--card-hover); }

/* current section: plain box, red→blue gradient underline */
.nav-links a.active {
  position: relative;
  color: var(--white);
  background: var(--navy-600);
}

/* full-width underline with rounded ends so it wraps the box corners slightly */
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, var(--red) 0%, #7d0a1d 45%, var(--blue) 100%);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 20px;
  padding: 6px 12px;
  cursor: pointer;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 46px 0 40px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

/* hero sits over the full-page racing background; just a soft radial to
   keep the headline crisp (per the background brief) */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 64% 76% at 50% 46%,
    rgba(5,11,29,0.72) 0%, rgba(5,11,29,0.32) 46%, rgba(5,11,29,0) 76%);
  z-index: 0;
}

.hero .container { position: relative; z-index: 2; }

/* hero splits: copy left, the national shield large on the right */
.hero-main {
  display: flex;
  align-items: center;
  gap: 56px;
}

.hero-copy { flex: 1; min-width: 0; }

.hero-logo {
  width: min(430px, 32vw);
  height: auto;
  flex-shrink: 0;
  filter:
    drop-shadow(0 0 34px rgba(200, 16, 46, 0.5))
    drop-shadow(0 0 80px rgba(47, 111, 237, 0.32))
    drop-shadow(0 16px 32px rgba(0, 0, 0, 0.55));
}

@media (max-width: 960px) {
  .hero-main { flex-direction: column-reverse; gap: 30px; }
  .hero-logo { width: min(220px, 55vw); }
  .hero-copy { text-align: left; width: 100%; }
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(240, 165, 30, 0.4);
  border-radius: 999px;
  padding: 7px 16px;
  margin-bottom: 22px;
  background: rgba(240, 165, 30, 0.08);
}

/* Hero endorsement lockup: FIA × ACCUS */
.hero-endorse {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 9px 16px 9px 10px;
  margin-bottom: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 19, 48, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.he-fia { height: 48px; width: auto; display: block; }
.he-x {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1;
}
.he-accus { height: 34px; width: auto; display: block; }
.he-caption {
  margin-left: 4px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(44px, 7vw, 84px);
  font-weight: 800;
  line-height: 0.98;
  text-transform: uppercase;
  letter-spacing: 1px;
  max-width: 850px;
}

.hero h1 .gold { color: var(--gold); }
.hero h1 .stroke {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.55);
}
/* red/blue matched to the racing streaks in the landing background image
   (its red ≈ #e51029, blue ≈ #0d6fd7), brightened just enough for text on navy */
.hero h1 .red-w { color: #ee1a30; }
.hero h1 .blue-w { color: #2f8cf5; }

.hero-tagline {
  margin-top: 20px;
  font-size: clamp(16px, 2vw, 19px);
  color: var(--muted);
  max-width: 640px;
}

.hero-tagline strong { color: var(--ink); }

.hero-actions { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1.6px;
  line-height: 1.35;
  text-transform: uppercase;
  padding: 13px 26px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

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

.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #201200;
  box-shadow: 0 10px 26px rgba(240, 165, 30, 0.3);
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }

/* one continuous dark panel, five stat cells divided by hairlines */
.hero-stats {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(7, 13, 31, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(3px);
  overflow: hidden;
}

/* recognized-series logos — one line spread across the entire bottom.
   (named .hero-series to avoid the calendar page's .series-strip grid) */
.hero-series {
  margin-top: 26px;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0 80px;
  box-sizing: border-box;
}
.hero-series-logos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: nowrap;
}
.hero-series-logos img {
  height: 66px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  /* two-layer glow in the logo's own primary color (set per-logo via --glow):
     a small sharp glow tight to the shape + a soft outer halo, so each logo
     reads bright and clean on the dark bg (follows the PNG's transparent shape,
     not a box) — consistent with the WKA look. */
  filter:
    drop-shadow(0 0 2px var(--glow, rgba(255, 255, 255, 0.9)))
    drop-shadow(0 0 8px var(--glow, rgba(255, 255, 255, 0.5)));
}
/* white outline that hugs the actual logo shape (traces the marks/letters,
   not a box) + subtle glow, so the darker logos read on the navy */
.hero-series-logos img.chip {
  filter:
    drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff)
    drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff)
    drop-shadow(1px 1px 0 #fff) drop-shadow(-1px -1px 0 #fff)
    drop-shadow(-1px 1px 0 #fff) drop-shadow(1px -1px 0 #fff)
    drop-shadow(0 0 5px var(--glow, rgba(255, 255, 255, 0.35)));
}
/* WKA: the provided logo (white mark + red keylines), sized to match the row,
   with a red neon glow so the red reads bright and glowing. */
.hero-series-logos img.wka-logo {
  height: 90px;
  filter:
    drop-shadow(0 0 3px rgba(255, 45, 61, 0.95))
    drop-shadow(0 0 11px rgba(255, 45, 61, 0.6));
}
/* stacked two-line "+ Local / & Club Racing" — centered to read like a logo */
.series-plus {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.05;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #ee1a30;
  font-weight: 800;
  white-space: nowrap;
  /* white outline hugging the letters + blue glow so it stands out over the flag */
  text-shadow:
    -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff,
    0 0 10px rgba(47, 140, 245, 0.95), 0 0 18px rgba(47, 140, 245, 0.7);
}
.series-plus .sp-top { font-size: 17px; }
.series-plus .sp-bot { font-size: 14px; }
@media (max-width: 820px) {
  .hero-series { padding: 0 18px; }
  .hero-series-logos { flex-wrap: wrap; justify-content: center; gap: 18px 24px; }
}

.stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: none; }

.stat-ic { flex-shrink: 0; }
.stat-ic svg { width: 34px; height: 34px; display: block; }

.stat .num {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.stat .label {
  margin-top: 4px;
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
}

/* tile corner icons */
.h-tile { position: relative; }
.t-ic {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--t-accent, var(--gold));
  opacity: 0.9;
}
.t-ic svg { width: 22px; height: 22px; display: block; }
.h-tile .t-k { max-width: calc(100% - 30px); }

/* ---------- Sections ---------- */

.section { padding: 72px 0; border-bottom: 1px solid var(--line); }
.section.alt { background: rgba(255, 255, 255, 0.015); }

.section-head { margin-bottom: 38px; max-width: 720px; }

.section-kicker {
  font-size: 11.5px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
  margin-bottom: 10px;
}

.section-kicker.gold-k { color: var(--gold); }
.section-kicker.blue-k { color: var(--blue); }

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  line-height: 1.04;
}

.section-head p { margin-top: 12px; color: var(--muted); font-size: 16px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}

.card:hover { background: var(--card-hover); border-color: rgba(255, 255, 255, 0.16); }

.card .icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  margin-bottom: 16px;
  background: var(--navy-600);
  border: 1px solid var(--line);
}

.card h3 {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.card p { color: var(--muted); font-size: 14.5px; }

/* ---------- Points formula ---------- */

.formula-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  background: linear-gradient(180deg, var(--navy-700), var(--navy-800));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 26px;
  margin-bottom: 18px;
}

.formula-item { text-align: center; min-width: 120px; }

.formula-item .sym {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
}

.formula-item.p .sym { color: var(--gold); }
.formula-item.f .sym { color: var(--blue); }
.formula-item.w .sym { color: var(--red); }
.formula-item.pts .sym { color: var(--white); }

.formula-item .lbl {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.formula-op {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  color: var(--muted);
}

.calc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.calc h3 {
  font-family: var(--font-display);
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 18px;
}

.calc-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.calc label {
  display: block;
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.calc select, .calc input {
  width: 100%;
  background: var(--navy-800);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 11px 12px;
}

.calc-result {
  margin-top: 22px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.calc-result .math { color: var(--muted); font-size: 15px; }

.calc-result .total {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

/* ---------- Tiers ---------- */

.tier-card { position: relative; overflow: hidden; }

.tier-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 2px;
  padding: 5px 14px;
  border-radius: 7px;
  margin-bottom: 14px;
  color: var(--navy-900);
}

.tier-1 .tier-badge { background: var(--gold); }
.tier-2 .tier-badge { background: var(--blue); color: var(--white); }
.tier-3 .tier-badge { background: var(--green); }
.tier-4 .tier-badge { background: #8d99b8; }

.tier-card .weight {
  position: absolute;
  top: 20px;
  right: 22px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.28);
}

.tier-card .examples { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* ---------- Tables (rankings) ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

table { width: 100%; border-collapse: collapse; min-width: 760px; }

thead th {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14.5px;
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s; cursor: pointer; }
tbody tr:hover { background: rgba(255, 255, 255, 0.045); }

.rank-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
}

.rank-top3 { color: var(--white); }

.driver-cell { display: flex; align-items: center; gap: 12px; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--white);
  background: var(--navy-500);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.driver-cell .d-name { font-weight: 600; }
.driver-cell .d-home { font-size: 12px; color: var(--muted); }

.pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.8px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--navy-600);
  color: var(--ink);
  text-transform: uppercase;
}

.trend-up { color: var(--green); font-weight: 700; }
.trend-down { color: #ff6b7a; font-weight: 700; }
.trend-flat { color: var(--muted); }

.points-cell { font-family: var(--font-display); font-size: 19px; font-weight: 800; }

/* ---------- Rankings filter sidebar ---------- */

.rank-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

/* Locked in place at the top of its column — full contents always visible,
   no internal scrolling */
.filter-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.filter-panel .fp-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.filter-panel .fp-hint { font-size: 12px; color: var(--muted); margin-bottom: 16px; }

.filter-panel input[type="search"] {
  width: 100%;
  background: var(--navy-800);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font-size: 13.5px;
  padding: 9px 12px;
  margin-bottom: 18px;
}

.fgroup { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.fgroup:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

.fgroup h4 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.fopt {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--muted);
  padding: 4px 0;
  cursor: pointer;
  user-select: none;
}

.fopt:hover { color: var(--ink); }

.fopt input {
  accent-color: var(--gold);
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

.fopt input:checked + span { color: var(--ink); font-weight: 600; }

.fopt.all { padding-bottom: 8px; }
.fopt.all span { letter-spacing: 0.4px; }

.rank-count {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.rank-count strong { color: var(--gold); font-weight: 700; }

/* Mobile: the filter panel folds behind a toggle button so the driver list leads */
.filter-toggle { display: none; }

@media (max-width: 960px) {
  .rank-layout { grid-template-columns: 1fr; }

  .filter-toggle {
    display: inline-flex;
    margin-bottom: 16px;
  }

  .rank-layout .filter-panel { display: none; }
  .rank-layout .filter-panel.open { display: block; }
}

/* ---------- Filters ---------- */

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  align-items: flex-end;
}

.filter-group label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.filters select, .filters input[type="search"] {
  background: var(--navy-700);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font-size: 14px;
  padding: 10px 14px;
  min-width: 160px;
}

/* ---------- Event cards ---------- */

.event-card { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }

.event-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 24px 0;
}

.event-date {
  text-align: center;
  background: var(--navy-600);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  min-width: 64px;
}

.event-date .mon {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
}

.event-date .day {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.05;
}

/* flex column so the register CTA pins to the bottom of every card,
   keeping the button in the same spot regardless of content length */
.event-body {
  padding: 16px 24px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.event-body h3 {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  line-height: 1.1;
}

.event-meta { margin-top: 8px; font-size: 13.5px; color: var(--muted); }

.event-tags { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
}

.tag-tier1 { background: rgba(240, 165, 30, 0.16); color: var(--gold-bright); border: 1px solid rgba(240, 165, 30, 0.4); }
.tag-tier2 { background: rgba(47, 111, 237, 0.16); color: #7ea6ff; border: 1px solid rgba(47, 111, 237, 0.45); }
.tag-tier3 { background: rgba(47, 191, 113, 0.14); color: #67dfa0; border: 1px solid rgba(47, 191, 113, 0.4); }
.tag-tier4 { background: rgba(141, 153, 184, 0.14); color: #aeb9d6; border: 1px solid rgba(141, 153, 184, 0.4); }
.tag-series { background: var(--navy-600); color: var(--ink); border: 1px solid var(--line); }

/* ---------- Event list (all events) ---------- */

.event-list { display: flex; flex-direction: column; gap: 12px; }

.event-row {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 20px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  transition: background 0.15s, border-color 0.15s;
}

.event-row:hover { background: var(--card-hover); border-color: rgba(255, 255, 255, 0.16); }

.event-row h3 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  line-height: 1.1;
}

.event-row .er-meta { margin-top: 5px; font-size: 13px; color: var(--muted); }
.event-row .er-tags { margin-top: 9px; display: flex; gap: 8px; flex-wrap: wrap; }

.event-row .er-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
}

.event-row .er-side .reg-note { font-size: 11px; color: var(--muted); max-width: 210px; }

/* ---------- Driver cards ---------- */

.driver-card { text-align: center; }

.driver-card .avatar { width: 74px; height: 74px; font-size: 26px; margin: 0 auto 14px; }

.driver-card .d-rank {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.driver-card .d-rank small { font-size: 18px; color: var(--muted); }

.driver-card h3 { margin-top: 6px; }
.driver-card .d-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.driver-card .d-points { margin-top: 12px; }

.driver-card .d-points .pv {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
}

.driver-card .d-points .pl {
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Calendar view ---------- */

.modal.cal-modal {
  width: min(1200px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
}

.cal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.cal-head h3 { margin-bottom: 0; }

.cal-nav { display: flex; gap: 8px; }

.cal-btn {
  width: 36px;
  height: 36px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 17px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.cal-btn:hover { background: var(--card-hover); }

.cal-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.cal-key {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 5px;
}

/* Tier colors — Tier 1 gold, Tier 2 blue, Tier 3 green, Tier 4 grey */
.ct1 { background: var(--gold); color: #201200; }
.ct2 { background: var(--blue); color: var(--white); }
.ct3 { background: var(--green); color: #04240f; }
.ct4 { background: #8d99b8; color: #10182e; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-dow {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: 6px 0;
}

.cal-day {
  min-height: 112px;
  background: var(--navy-800);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px;
  overflow: hidden;
}

.cal-day.empty { background: transparent; border-style: dashed; opacity: 0.3; }

.cal-day .dnum { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }

/* Event days stay dark like the rest of the site, with a glow around the box
   in the series' color. The series logo sits ghosted-dark behind the white
   event text and reveals in full color on hover. Clicking registers. */
.cal-day.has-ev {
  position: relative;
  isolation: isolate;
  cursor: pointer;
  background: linear-gradient(180deg, var(--navy-600), var(--navy-800));
  border: 1px solid var(--ev-glow);
  box-shadow:
    0 0 14px color-mix(in srgb, var(--ev-glow) 55%, transparent),
    0 0 30px color-mix(in srgb, var(--ev-glow) 22%, transparent);
  transition: transform 0.12s, box-shadow 0.12s;
}

.cal-day.has-ev:hover {
  transform: scale(1.04);
  z-index: 2;
  box-shadow:
    0 0 18px color-mix(in srgb, var(--ev-glow) 80%, transparent),
    0 0 40px color-mix(in srgb, var(--ev-glow) 35%, transparent);
}

.cal-day.has-ev .dnum { color: var(--ink); position: relative; z-index: 1; }

.cal-day.has-ev .cal-event {
  color: var(--white);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.75);
  position: relative;
  z-index: 1;
}

/* transparent logo ghosted behind the text — the cleaned logos sit straight on
   the dark box; hovering brings them to full strength with a glow in the
   series color (--ev-logo-glow lets USAC glow red while its box stays orange) */
.cal-day.has-ev::before {
  content: "";
  position: absolute;
  inset: 8px;
  background-image: var(--ev-logo);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.4;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ev-logo-glow, var(--ev-glow)) 45%, transparent));
  border-radius: 7px;
  pointer-events: none;
  transition: opacity 0.15s, filter 0.15s;
}

.cal-day.has-ev:hover::before {
  opacity: 1;
  filter:
    drop-shadow(0 0 8px color-mix(in srgb, var(--ev-logo-glow, var(--ev-glow)) 70%, transparent))
    drop-shadow(0 0 20px color-mix(in srgb, var(--ev-logo-glow, var(--ev-glow)) 30%, transparent));
}

.cal-day.has-ev:hover .dnum,
.cal-day.has-ev:hover .cal-event { opacity: 0; transition: opacity 0.15s; }

.cal-event {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  line-height: 1.2;
  margin-bottom: 4px;
  cursor: default;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 680px) {
  .cal-day { min-height: 62px; padding: 5px; }
  .cal-day .dnum { font-size: 11px; }
  .cal-event { font-size: 0; }
}

/* ---------- Driver player card ---------- */

.modal.driver-modal {
  width: min(780px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

/* header region that holds the faded action-photo backdrop — the photo fills
   this box exactly, so it always fades out right above the ranking sparkline
   regardless of how the header wraps */
.dm-hero { position: relative; z-index: 1; }

/* faded action-photo backdrop — full-bleeds to the card edges (negative insets
   cancel the modal's 30px padding) and fades to nothing before the sparkline */
.dm-hero .dm-photo-bg {
  position: absolute;
  top: -30px;
  left: -30px;
  right: -30px;
  bottom: 0;
  z-index: 0;
  background-size: cover;
  background-position: center 20%;
  opacity: 0.32;
  pointer-events: none;
  border-radius: var(--radius) var(--radius) 0 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 100%);
}

/* keep the header content above the backdrop */
.dm-hero > .dm-top,
.dm-hero > .profile-stats {
  position: relative;
  z-index: 1;
}

/* card body below the photo — faint scattered-stars texture behind the
   sparkline and results */
.dm-body { position: relative; z-index: 1; }
.dm-body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../assets/images/driver-stars.svg") center top / 450px auto repeat;
  opacity: 0.16;
  pointer-events: none;
}

/* Checkered-flag band across the very bottom of the card — same flag as the
   main-page backdrop; full-bleeds to the edges and emerges out of the card as
   you reach the bottom */
.dm-flag {
  position: relative;
  height: 120px;
  margin: 20px -30px -30px;
  background-size: cover;
  background-position: center 60%;
  border-radius: 0 0 var(--radius) var(--radius);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 24%, #000 88%);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 24%, #000 88%);
}

/* real headshot fills the card's photo slot */
.dm-headshot .dm-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.dm-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 5;
}
.dm-close:hover { background: var(--card-hover); }

.dm-top {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  margin-bottom: 22px;
  padding-right: 44px;
  flex-wrap: wrap;
}

/* headshot slot — initials now, official photos drop in later.
   The border color signals the driver's license status:
   green = approved · yellow = pending · white = fan / no license */
.dm-headshot {
  position: relative;
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--navy-500), var(--navy-700));
  border: 3px solid #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  color: var(--white);
}

.dm-headshot.approved { border-color: var(--green); }
.dm-headshot.pending { border-color: var(--gold-bright); }
.dm-headshot.none { border-color: #fff; }

.dm-headshot .photo-hint {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.55);
  font-family: var(--font-body);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: 4px 2px;
}

.dm-id { flex: 1; min-width: 220px; }

.dm-id h3 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
  margin-bottom: 0;
}

.dm-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

.dm-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(240, 165, 30, 0.12);
  color: var(--gold-bright);
  border: 1px solid rgba(240, 165, 30, 0.35);
}

.dm-rank { text-align: right; }

.dm-section-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--gold);
  margin: 26px 0 12px;
}

.driver-modal .profile-stats { margin-top: 4px; }
.driver-modal .spark { margin-top: 20px; }

/* anything tagged as a driver is clickable */
[data-driver] { cursor: pointer; }

/* ---------- Calendar page: series filter tiles ---------- */

/* 3×3 grid — All Series plus the eight recognized series, spanning the same
   width as the calendar below so the two line up */
.series-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}

@media (max-width: 680px) {
  .series-strip { grid-template-columns: 1fr; }
}

.series-tile {
  position: relative;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--s-glow, #ffffff) 45%, transparent);
  border-radius: var(--radius);
  padding: 12px 10px 10px;
  text-align: center;
  cursor: pointer;
  color: var(--ink);
  font-family: var(--font-body);
  box-shadow: 0 0 12px color-mix(in srgb, var(--s-glow, #ffffff) 22%, transparent);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.series-tile:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 16px color-mix(in srgb, var(--s-glow, #ffffff) 45%, transparent);
}

/* selected: green glow + checked box in the corner */
.series-tile.active {
  border-color: var(--green);
  background: var(--card-hover);
  box-shadow:
    0 0 14px rgba(47, 191, 113, 0.55),
    0 0 32px rgba(47, 191, 113, 0.22);
}

.tile-check {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.series-tile.active .tile-check {
  background: var(--green);
  border-color: var(--green);
  color: #04240f;
}

/* dashed placeholder box — real series logos drop in here later */
.series-tile .logo-slot {
  width: 94px;
  height: 60px;
  margin: 0 auto 10px;
  border: 1.5px dashed rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 1.2px;
  color: var(--muted);
}

.series-tile.active .logo-slot { border-color: rgba(240, 165, 30, 0.6); color: var(--gold-bright); }

/* clean transparent logos straight on the dark tile, glowing in the series color
   (--s-logo-glow lets a logo glow differently from its tile/calendar color, e.g. USAC red) */
.series-tile .tile-logo-img {
  height: 72px;
  width: auto;
  max-width: 92%;
  object-fit: contain;
  margin: 0 auto 10px;
  display: block;
  filter:
    drop-shadow(0 0 8px color-mix(in srgb, var(--s-logo-glow, var(--s-glow, #ffffff)) 65%, transparent))
    drop-shadow(0 0 22px color-mix(in srgb, var(--s-logo-glow, var(--s-glow, #ffffff)) 28%, transparent));
}

.series-tile .t-name { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.series-tile.active .t-name { color: var(--ink); }

.series-tile .t-count {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Calendar page: inline calendar ---------- */

.cal-page {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.cal-page .cal-head h3 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ---------- Main Driver of the Week hero ---------- */

.dow-hero {
  background: linear-gradient(135deg, var(--navy-700), var(--navy-800));
  border: 1px solid rgba(240, 165, 30, 0.45);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.dh-banner {
  background: linear-gradient(90deg, var(--gold-bright), var(--gold));
  color: #201200;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  text-align: center;
  padding: 10px 14px;
}

.dh-body {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 30px 36px;
  flex-wrap: wrap;
}

.dh-avatar { width: 92px; height: 92px; font-size: 32px; flex-shrink: 0; }

.dh-info { flex: 1; min-width: 220px; }

.dh-info h3 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
}

.dh-info .d-meta { margin-top: 6px; font-size: 14px; color: var(--muted); }

.dh-rank { text-align: right; }
.dh-rank .d-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }

@media (max-width: 680px) {
  .dh-body { flex-direction: column; text-align: center; gap: 16px; }
  .dh-rank { text-align: center; }
}

/* ---------- Driver of the Week (per class) ---------- */

.dow-card {
  position: relative;
  overflow: hidden;
  padding-top: 58px;
}

.dow-card .dow-class {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--navy-600);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  padding: 9px 6px;
}

.dow-card .d-move { margin-top: 10px; font-size: 12.5px; }

/* ---------- No-results profile panel ---------- */

.profile-empty {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 34px;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.profile-empty .avatar { width: 74px; height: 74px; font-size: 26px; margin: 0 auto 16px; }

.profile-empty h3 {
  font-family: var(--font-display);
  font-size: 26px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.profile-empty p { color: var(--muted); font-size: 14.5px; margin-top: 10px; }

/* ---------- Full driver list ---------- */

.class-block { margin-bottom: 34px; }

.class-block h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 14px;
}

.class-block h3 .count { color: var(--muted); font-size: 16px; letter-spacing: 1px; }

/* ---------- Featured profile ---------- */

.profile-feature {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 0;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-800));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.profile-side {
  background: rgba(0, 0, 0, 0.25);
  padding: 34px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-right: 1px solid var(--line);
}

.profile-side .avatar { width: 96px; height: 96px; font-size: 34px; margin-bottom: 16px; }

.profile-side h3 {
  font-family: var(--font-display);
  font-size: 30px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.profile-side .loc { color: var(--muted); font-size: 13px; margin-top: 4px; }

.profile-main { padding: 34px; }

.profile-rank-row { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }

.big-rank {
  font-family: var(--font-display);
  font-size: 86px;
  font-weight: 800;
  color: var(--gold);
  line-height: 0.9;
}

.big-rank small { font-size: 30px; color: var(--muted); }

.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 28px; }

.pstat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
}

.pstat .v { font-family: var(--font-display); font-size: 26px; font-weight: 800; }
.pstat .k { font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }

/* ---------- Sparkline ---------- */

.spark { margin-top: 26px; }
.spark svg { width: 100%; height: 90px; }
.spark .spark-label { font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

/* ---------- Roadmap ---------- */

.roadmap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.phase {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
}

.phase .ph-num {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--navy-900);
  background: var(--gold);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
}

.phase .ph-year {
  position: absolute;
  top: 24px;
  right: 22px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.3);
}

.phase h3 { margin-top: 16px; font-family: var(--font-display); font-size: 21px; text-transform: uppercase; letter-spacing: 0.8px; }
.phase p { margin-top: 6px; font-size: 13.5px; color: var(--muted); }

/* ---------- CTA band ---------- */

.cta-band {
  background: linear-gradient(120deg, var(--red) 0%, #7d0a1d 55%, var(--navy-800) 100%);
  border-radius: var(--radius);
  padding: 46px 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

.cta-band h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 40px);
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.05;
}

.cta-band p { color: rgba(255, 255, 255, 0.75); margin-top: 6px; max-width: 520px; }

/* ---------- Footer ---------- */

.site-footer { padding: 54px 0 40px; }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 30px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.footer-grid h4 {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
  color: var(--gold);
}

.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 9px; }
.footer-grid a { color: var(--muted); font-size: 14px; transition: color 0.15s; }
.footer-grid a:hover { color: var(--white); }
.footer-about p { color: var(--muted); font-size: 13.5px; max-width: 320px; margin-top: 10px; }

.footer-bottom {
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12.5px;
}

.footer-motto {
  font-family: var(--font-display);
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

/* ---------- Page hero (subpages) ---------- */

.page-hero { padding: 58px 0 44px; border-bottom: 1px solid var(--line); }

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
}

.page-hero p { margin-top: 12px; color: var(--muted); max-width: 640px; }

/* FIA logo standing in for the word "FIA" in a heading */
.title-fia {
  display: inline-block;
  height: 0.86em;
  width: auto;
  vertical-align: middle;
  position: relative;
  top: -0.08em;
  margin-right: 0.18em;
}

/* ---------- Safety list ---------- */

.check-list { list-style: none; display: grid; gap: 12px; }

.check-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14.5px;
  color: var(--ink);
}

.check-list li::before {
  content: "✓";
  color: var(--green);
  font-weight: 800;
  flex-shrink: 0;
}

/* ---------- Board ---------- */

.board-card { text-align: center; padding: 28px 20px; }
.board-card .avatar { width: 64px; height: 64px; font-size: 22px; margin: 0 auto 12px; }
.board-card h3 { font-size: 20px; }
.board-card p { font-size: 13px; }

/* ---------- Auth ---------- */

.auth-slot { display: flex; align-items: center; gap: 10px; }

.btn-blue {
  background: linear-gradient(180deg, #4a83f5, var(--blue));
  color: var(--white);
  box-shadow: 0 10px 26px rgba(47, 111, 237, 0.3);
}

/* Single compact sign-in button (signed-out state) — red→blue gradient, sized
   to stay shorter than the header logo so it never grows the header height */
.btn-auth {
  padding: 9px 18px;
  font-size: 14px;
  letter-spacing: 1.2px;
  line-height: 1.2;
  white-space: nowrap;
  border: none;
  color: var(--white);
  background: linear-gradient(120deg, #e8283f 0%, #7d3ba8 52%, #2f6fed 100%);
  box-shadow: 0 8px 22px rgba(47, 111, 237, 0.28);
}
.btn-auth:hover { transform: translateY(-2px); }

/* Sign In / Sign Up match sizes exactly */
.auth-slot .btn-sm {
  min-width: 98px;
  justify-content: center;
}

.btn-sm {
  font-size: 15px;
  padding: 8px 16px;
  letter-spacing: 1.2px;
}

/* Signed-in state: a single initials circle whose ring color = driver status.
   Green + check = ACCUS approved · yellow = approval pending · grey = no driver license */
.avatar-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #6b7794;
  background: var(--navy-500);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-btn.approved { border-color: var(--green); }
.avatar-btn.pending { border-color: var(--gold-bright); }

.avatar-btn.has-photo { background: var(--navy-700); }
.avatar-btn .avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
}

.avatar-btn .status-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1;
  border: 1.5px solid var(--navy-900);
}

.avatar-btn.approved .status-badge { background: var(--green); color: #04240f; }
.avatar-btn.pending .status-badge { background: var(--gold-bright); color: #241700; }

.auth-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 230px;
  background: linear-gradient(180deg, var(--navy-700), var(--navy-800));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  z-index: 300;
}

.auth-menu .m-name { font-weight: 700; font-size: 14.5px; }
.auth-menu .m-license { font-size: 12px; color: var(--muted); margin-top: 2px; }

.auth-menu .m-status {
  display: inline-block;
  margin-top: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.auth-menu .m-status.ok { background: rgba(47, 191, 113, 0.15); color: var(--green); border: 1px solid rgba(47, 191, 113, 0.4); }
.auth-menu .m-status.pending { background: rgba(255, 190, 61, 0.12); color: var(--gold-bright); border: 1px solid rgba(255, 190, 61, 0.4); }
.auth-menu .m-status.none { background: rgba(141, 153, 184, 0.12); color: #aeb9d6; border: 1px solid rgba(141, 153, 184, 0.4); }

.auth-menu .m-card {
  margin-top: 14px;
  width: 100%;
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: var(--navy-900);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 9px;
  cursor: pointer;
}
.auth-menu .m-card:hover { filter: brightness(1.06); }
.auth-menu .m-signout {
  margin-top: 10px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 9px;
  cursor: pointer;
}
.auth-menu .m-signout:hover { background: var(--card-hover); }

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 20, 0.78);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 500;
  padding: 20px;
}

.modal {
  width: min(460px, 100%);
  background: linear-gradient(180deg, var(--navy-700), var(--navy-800));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 26px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.modal p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

.demo-account {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  margin-bottom: 10px;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s, border-color 0.15s;
}

.demo-account:hover { background: var(--card-hover); border-color: rgba(255, 255, 255, 0.25); }

.demo-account .da-name { font-weight: 600; font-size: 14.5px; }
.demo-account .da-sub { font-size: 12px; color: var(--muted); }

.modal .modal-close {
  margin-top: 8px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 0;
}
.modal .modal-close:hover { color: var(--white); }

/* ---------- Event card CTA ---------- */

.event-cta { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.event-card .event-tags { margin-bottom: 16px; }
.event-cta .reg-note { margin-top: 8px; font-size: 11px; color: var(--muted); letter-spacing: 0.4px; }
.event-cta .btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- Registration page ---------- */

.reg-layout { display: grid; grid-template-columns: 1fr 360px; gap: 22px; align-items: start; }

.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
}

.form-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 18px;
  color: var(--gold);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.field { display: flex; flex-direction: column; }
.field.full { grid-column: 1 / -1; }

.field label {
  font-size: 10.5px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input, .field select, .field textarea {
  background: var(--navy-800);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 11px 12px;
}

.field input[readonly] { color: var(--muted); background: rgba(255, 255, 255, 0.03); }

.field input:focus, .field select:focus { outline: none; border-color: var(--gold); }

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted);
  margin-top: 18px;
}

.consent input { margin-top: 3px; accent-color: var(--gold); }

.summary-card {
  background: linear-gradient(180deg, var(--navy-700), var(--navy-800));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  position: sticky;
  top: 90px;
}

.summary-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.1;
}

.summary-card .s-meta { font-size: 13px; color: var(--muted); margin-top: 8px; }

.fee-rows { margin-top: 18px; border-top: 1px solid var(--line); }

.fee-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.fee-row .fr-label { color: var(--muted); }

.fee-row.total { border-bottom: none; padding-top: 14px; }
.fee-row.total .fr-label { color: var(--ink); font-weight: 700; }
.fee-row.total .fr-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--gold);
}

.locked-banner {
  background: var(--card);
  border: 1px solid rgba(240, 165, 30, 0.35);
  border-radius: var(--radius);
  padding: 42px 34px;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.locked-banner .lock-icon { font-size: 40px; margin-bottom: 14px; }

.locked-banner h3 {
  font-family: var(--font-display);
  font-size: 28px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.locked-banner p { color: var(--muted); font-size: 14.5px; margin-bottom: 20px; }

.confirm-panel {
  background: var(--card);
  border: 1px solid rgba(47, 191, 113, 0.4);
  border-radius: var(--radius);
  padding: 46px 38px;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.confirm-panel .ok-icon {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: rgba(47, 191, 113, 0.15);
  border: 2px solid var(--green);
  color: var(--green);
  font-size: 30px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
}

.confirm-panel h2 {
  font-family: var(--font-display);
  font-size: 34px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.confirm-panel .entry-code {
  display: inline-block;
  margin: 18px 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--gold);
  background: var(--navy-800);
  border: 1px dashed rgba(240, 165, 30, 0.5);
  border-radius: 10px;
  padding: 12px 26px;
}

.confirm-panel p { color: var(--muted); font-size: 14.5px; }

/* ---------- sign-in / create-profile modal ---------- */

.modal-signup { width: min(600px, 96vw); max-height: 90vh; overflow-y: auto; }

.signin-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.3px;
}
.signin-divider::before,
.signin-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* softer inline hint next to a field label */
.field label .opt,
.signup-form label .opt {
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
}

/* series multi-select chips */
.series-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.series-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.series-opt:hover { background: var(--card-hover); }
.series-opt input { accent-color: var(--gold); }
.series-opt:has(input:checked) { border-color: var(--gold); background: rgba(240, 165, 30, 0.1); }

/* success view reuses the confirmation look inside the modal */
.modal .ok-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(47, 191, 113, 0.15);
  border: 2px solid var(--green);
  color: var(--green);
  font-size: 28px;
  display: grid;
  place-items: center;
}
.modal .entry-code {
  display: block;
  width: max-content;
  margin: 14px auto;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--gold);
  background: var(--navy-800);
  border: 1px dashed rgba(240, 165, 30, 0.5);
  border-radius: 10px;
  padding: 10px 22px;
}

/* ---------- Start Karting page ---------- */

.step-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }

.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy-900);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 14px;
}

.step h3 {
  font-family: var(--font-display);
  font-size: 21px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.step p { font-size: 13.5px; color: var(--muted); }

.cost-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.cost-table { width: 100%; border-collapse: collapse; min-width: 520px; }

.cost-table th {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.cost-table td {
  padding: 12px 18px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cost-table tr:last-child td { border-bottom: none; }

.cost-table .cost-val {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--gold-bright);
  white-space: nowrap;
}

.cost-table .cost-note { color: var(--muted); font-size: 12.5px; }

.budget-card { text-align: center; }

.budget-card .b-level {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.budget-card .b-amount {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1.1;
  margin: 8px 0;
}

.budget-card p { font-size: 13px; }

.disclaimer {
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--muted);
  border-left: 3px solid var(--gold);
  padding-left: 14px;
}

/* ---------- Responsive ---------- */

/* Tighten the header when the signed-in chip competes for space */
@media (max-width: 1360px) {
  .nav { gap: 16px; }
  .nav-links { gap: 2px; }
  .nav-links a { font-size: 16px; padding: 8px 9px; letter-spacing: 1.1px; }
  .brand-text .brand-sub { font-size: 9.5px; letter-spacing: 1.6px; }
  .user-chip { padding: 4px 10px 4px 5px; gap: 8px; }
}

@media (max-width: 960px) {
  .grid-4, .roadmap { grid-template-columns: repeat(2, 1fr); }
  .reg-layout { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .step-row { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stats .stat { border-left: none; border-top: 1px solid var(--line); }
  .hero-stats .stat:nth-child(-n+2) { border-top: none; }
  .hero-stats .stat:nth-child(odd) { border-right: 1px solid var(--line); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .profile-feature { grid-template-columns: 1fr; }
  .profile-side { border-right: none; border-bottom: 1px solid var(--line); }
  .id-wrap { border-right: none; border-bottom: 1px solid var(--line); }
}

/* Collapse to the hamburger menu before the link row can collide with the
   brand + signed-in chip */
@media (max-width: 1120px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--navy-800);
    border-bottom: 1px solid var(--line);
    padding: 10px 4%;
  }
  .nav-links a { text-align: left; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}

@media (max-width: 680px) {
  .grid-2, .grid-3, .grid-4, .roadmap, .step-row { grid-template-columns: 1fr; }
  .calc-row, .form-grid { grid-template-columns: 1fr; }
  .event-row { grid-template-columns: 70px 1fr; }
  .event-row .er-side { grid-column: 1 / -1; align-items: flex-start; text-align: left; }

  /* phones show the full picture with no sideways scrolling: secondary
     columns hide, leaving rank · driver · class · points sized to fit */
  .hide-m { display: none; }
  table { min-width: 0; width: 100%; }
  tbody td { padding: 16px 9px; font-size: 13.5px; white-space: normal; }
  thead th { padding: 13px 9px; font-size: 12px; letter-spacing: 1.2px; white-space: normal; }
  tbody td:first-child, thead th:first-child { padding-left: 14px; }
  tbody td:last-child, thead th:last-child { padding-right: 14px; }
  .rank-num { font-size: 18px; }
  .driver-cell { gap: 10px; }
  .driver-cell .d-name { font-size: 14.5px; }
  .driver-cell .avatar { width: 38px; height: 38px; font-size: 14px; }
  .pill { font-size: 10px; padding: 3px 8px; letter-spacing: 0.5px; }
  .points-cell { font-size: 16px; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 60px 0 50px; }

  /* compact header so brand + menu + auth buttons fit a phone */
  .nav { gap: 10px; }
  .brand-logo { height: 40px; }
  .brand-text .brand-sub { display: none; }
  .brand-title { font-size: 20px; }
  .auth-slot { display: flex; gap: 6px; }
  .auth-slot .btn-sm { min-width: 0; padding: 8px 11px; font-size: 12px; }
}

/* ==========================================================================
   Licensing page (Step 2)
   ========================================================================== */

.lic-card {
  border-top: 3px solid var(--l-color, var(--gold));
  display: flex;
  flex-direction: column;
}

.lic-card .l-grade {
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--l-color, var(--gold));
  border: 1px solid color-mix(in srgb, var(--l-color, var(--gold)) 55%, transparent);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 12px;
}

.lic-card .l-ages {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 2px;
}

.lic-card .l-classes {
  font-size: 12.5px;
  color: var(--muted);
  margin: 4px 0 10px;
}

.lic-card p { flex: 1; }

.lic-card .l-fee {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  color: var(--ink);
  margin-top: 14px;
}

.lic-card .l-fee small {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 2px;
}

.lic-card .l-req {
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
}

/* ==========================================================================
   Rules library (Step 3)
   ========================================================================== */

.rules-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.rule-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.rule-chip {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.rule-chip:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.25); }

.rule-chip.active {
  color: var(--navy-900);
  background: var(--gold);
  border-color: var(--gold);
}

.rules-search {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  min-width: 240px;
}

.rules-search:focus { outline: none; border-color: var(--gold); }

.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.doc-card {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}

.doc-card:hover {
  background: var(--card-hover);
  border-color: rgba(240, 165, 30, 0.45);
  transform: translateY(-2px);
}

.doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.doc-code {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gold);
}

.doc-status {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 50%, transparent);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

.doc-status.draft {
  color: var(--gold-bright);
  border-color: color-mix(in srgb, var(--gold) 55%, transparent);
}

.doc-card h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ink);
}

.doc-meta { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

.modal.rules-modal { width: min(640px, calc(100vw - 40px)); }

.doc-points {
  margin: 10px 0 0 18px;
  display: grid;
  gap: 8px;
}

.doc-points li { color: var(--muted); font-size: 14px; line-height: 1.5; }
.doc-points li::marker { color: var(--gold); }

/* roadmap phases that link out to live previews */
.phase .ph-link {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
}

.phase .ph-link:hover { color: var(--gold-bright); }

@media (max-width: 860px) {
  .doc-grid { grid-template-columns: 1fr; }
  .rules-search { min-width: 0; width: 100%; }
}

/* ==========================================================================
   Driver ID card — the signed-in driver's license as a physical card,
   floating in the profile panel with breathing room around it
   ========================================================================== */

.id-wrap {
  padding: 30px 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
}

.id-card {
  width: 100%;
  max-width: 330px;
  background: linear-gradient(155deg, var(--navy-600), var(--navy-800));
  border: 1px solid rgba(240, 165, 30, 0.4);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.id-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(232, 40, 63, 0.28), rgba(47, 111, 237, 0.28));
  border-bottom: 1px solid var(--line);
}

.id-head img { height: 36px; filter: drop-shadow(0 0 6px rgba(232, 40, 63, 0.5)); }
.id-title { font-family: var(--font-display); font-size: 17px; font-weight: 800; letter-spacing: 1.5px; line-height: 1; }
.id-sub { font-size: 9.5px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.id-season { margin-left: auto; font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--gold); }

.id-body { display: flex; gap: 14px; padding: 16px; }

.id-photo {
  width: 92px;
  height: 110px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--navy-700);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px;
}
.id-photo .id-initials { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--gold); }
.id-photo .id-photo-hint { font-size: 8px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); text-align: center; }

.id-fields { flex: 1; min-width: 0; }
.id-name { font-family: var(--font-display); font-size: 23px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; line-height: 1.05; }
.id-loc { font-size: 12px; color: var(--muted); margin: 3px 0 10px; }

.id-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}
.id-row:last-child { border-bottom: none; }
.id-row .ik { font-size: 9.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.id-row .iv { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.id-row .iv.gold { color: var(--gold-bright); }

.id-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
}

.id-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--green);
  border: 1px solid rgba(47, 191, 113, 0.5);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.id-chk {
  flex: 1;
  height: 8px;
  border-radius: 2px;
  background:
    repeating-linear-gradient(90deg, rgba(245, 247, 255, 0.85) 0 6px, transparent 6px 12px),
    repeating-linear-gradient(90deg, transparent 0 6px, rgba(245, 247, 255, 0.85) 6px 12px);
  background-size: 100% 4px, 100% 4px;
  background-position: 0 0, 0 4px;
  background-repeat: no-repeat;
}

/* ==========================================================================
   Simpler landing — shield + short pitch, then karter quick tiles
   ========================================================================== */

.hero-land {
  position: relative;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.hero-land .hero-tagline { margin-left: auto; margin-right: auto; }

.hero-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 42px;
  position: relative;
}

.h-tile {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 18px 18px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--t-accent, var(--gold));
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.12s, transform 0.12s;
}

.h-tile:hover { background: var(--card-hover); transform: translateY(-2px); }

.h-tile .t-k {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--t-accent, var(--gold));
}

.h-tile .t-v {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.12;
}

.h-tile .t-sub { font-size: 12px; color: var(--muted); line-height: 1.45; }

@media (max-width: 960px) {
  .hero-tiles { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .hero-tiles { grid-template-columns: 1fr; }
}


/* ==========================================================================
   Rules & Safety — in-page jump buttons
   ========================================================================== */
.hero-jump { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

/* ==========================================================================
   News — rotating featured carousel + headline grid
   ========================================================================== */

.carousel {
  position: relative;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-800));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.carousel-track {
  display: grid;
  grid-template-areas: "slide";
  min-height: 300px;
}

.c-slide {
  grid-area: slide;
  padding: 46px 76px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.4s, transform 0.4s;
  align-self: center;
}

.c-slide.on { opacity: 1; visibility: visible; transform: none; }

.c-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--navy-900);
  background: var(--gold);
  border-radius: 999px;
  padding: 3px 12px;
}

.c-date { color: var(--muted); font-size: 12.5px; margin-left: 12px; letter-spacing: 0.5px; }

.c-slide h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 40px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.05;
  margin: 14px 0 12px;
  max-width: 780px;
}

.c-slide p { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 640px; margin-bottom: 20px; }

.c-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(10, 19, 48, 0.7);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.c-nav:hover { background: var(--navy-600); border-color: rgba(255, 255, 255, 0.25); }
.c-nav.prev { left: 16px; }
.c-nav.next { right: 16px; }

.c-dots { position: absolute; bottom: 18px; left: 76px; display: flex; gap: 8px; }
.c-dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.25); cursor: pointer;
  transition: background 0.12s, transform 0.12s;
}
.c-dot.on { background: var(--gold); transform: scale(1.2); }

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

.news-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.12s, transform 0.12s, border-color 0.12s;
}
.news-card:hover { background: var(--card-hover); transform: translateY(-2px); border-color: rgba(240, 165, 30, 0.4); }

.nc-head { display: flex; align-items: center; gap: 4px; }
.news-card h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.15;
  color: var(--ink);
  margin-top: 2px;
}
.news-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }

@media (max-width: 960px) {
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-slide { padding: 38px 56px; }
  .c-dots { left: 56px; }
}

@media (max-width: 680px) {
  .news-grid { grid-template-columns: 1fr; }
  .c-slide { padding: 30px 24px 46px; }
  .c-nav { display: none; }
  .c-dots { left: 24px; }
}

/* ==========================================================================
   Full-page racing background — homepage (main + footer in one wrapper)
   The tall alternating image stretches to the full page height so its
   stars ⇄ checkered-flag alternation stays intact top to bottom.
   No cover (would crop the alternation), no fixed attachment.
   ========================================================================== */
html, body { margin: 0; }
body { background-color: #050b1d; }

.page-background {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  background-color: #050b1d;
  /* TRYING the sub-page backdrop (stars/checker) as the landing bg.
     To revert, point --page-bg back at the usa-karting-landing webp. */
  --page-bg: url("../assets/images/usa-karting-subpage-bg.jpg");
}

/* locked full-viewport landing backdrop (home only) */
.page-background::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(5,11,29,0.16) 0%, rgba(5,11,29,0.24) 100%),
    linear-gradient(90deg, rgba(5,11,29,0.30) 0%, rgba(5,11,29,0.02) 22%, rgba(5,11,29,0.02) 78%, rgba(5,11,29,0.30) 100%),
    var(--page-bg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* ==========================================================================
   Interior pages — per-page top background that fades into solid navy.
   Each page shows its own 16:9 image across the top, then the page settles
   into #050b1d for the content below. Not stretched, not fixed, not repeated.
   ========================================================================== */
.page-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  background-color: #050b1d;
  /* sub pages share the same stars/checker backdrop as the landing page, but
     dimmed way down (see .bg-locked::after opacity) so it's a faint texture. */
  --page-background: url("../assets/images/usa-karting-subpage-bg.jpg");
}

/* the image lives in a top band and is chosen per page via --page-background */
.page-shell::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: min(1100px, 100vh);
  z-index: -2;
  pointer-events: none;
  background-image: var(--page-background);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
}

/* fade the top image smoothly down into the solid navy page */
.page-shell::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: min(1200px, 120vh);
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(5,11,29,0) 0%,
    rgba(5,11,29,0.02) 55%,
    rgba(5,11,29,0.62) 82%,
    #050b1d 100%);
}

/* .bg-locked pages keep their image fixed, dim, and MIRRORED (stars top-right,
   checkered flag bottom-left) so it reads differently from the landing page. */
.page-shell.bg-locked::after {
  position: fixed;
  inset: 0;
  height: auto;
  background-position: center;
  background-size: cover;
  transform: scaleX(-1);
  opacity: 0.22;
}
/* light, even veil just to guarantee text legibility over the faint corners */
.page-shell.bg-locked::before {
  position: fixed;
  inset: 0;
  height: auto;
  background: rgba(5,11,29,0.35);
}

/* every interior page now shares the single locked interior backdrop set on
   .page-shell above — no per-page images */

/* sections & page heroes stay transparent so the artwork shows through (both systems) */
:is(.page-background, .page-shell) .section,
:is(.page-background, .page-shell) .page-hero { background: transparent; }
/* no alternating tint — sections are fully transparent so no faint "band"
   of the old section slides over the locked background as you scroll */
:is(.page-background, .page-shell) .section.alt {
  background: transparent;
  backdrop-filter: none;
}

/* glassy, readable panels over the background */
:is(.page-background, .page-shell) .card,
:is(.page-background, .page-shell) .h-tile,
:is(.page-background, .page-shell) .calc,
:is(.page-background, .page-shell) .formula-strip,
:is(.page-background, .page-shell) .roadmap .phase,
:is(.page-background, .page-shell) .table-wrap,
:is(.page-background, .page-shell) .event-card,
:is(.page-background, .page-shell) .event-row,
:is(.page-background, .page-shell) .filter-panel,
:is(.page-background, .page-shell) .doc-card,
:is(.page-background, .page-shell) .news-card,
:is(.page-background, .page-shell) .carousel,
:is(.page-background, .page-shell) .lic-card {
  background: linear-gradient(145deg, rgba(15,27,60,0.9), rgba(7,13,31,0.92));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 18px 44px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(7px);
}
:is(.page-background, .page-shell) .h-tile { border-left: 3px solid var(--t-accent, var(--gold)); }
:is(.page-background, .page-shell) .lic-card { border-top: 3px solid var(--l-color, var(--gold)); }

/* footer stays connected — subtle navy veil, artwork still shows through */
:is(.page-background, .page-shell) .site-footer {
  position: relative;
  background: rgba(4,9,24,0.82);
  backdrop-filter: blur(8px);
}

/* clean & connected: drop the hairline dividers that chopped the page into bands */
.hero { border-bottom: none; }
.section { border-bottom: none; }
.page-hero { border-bottom: none; }
.site-footer { border-top: none; }

@media (max-width: 1100px) {
  .page-shell::after { background-position: center top; background-size: auto 900px; }
}
@media (max-width: 700px) {
  .page-shell::after { height: 760px; background-size: auto 760px; background-position: 58% top; }
  .page-shell::before {
    height: 820px;
    background: linear-gradient(180deg, rgba(5,11,29,0.08) 0%, rgba(5,11,29,0.22) 55%, #050b1d 100%);
  }
}
@media (max-width: 600px) {
  :is(.page-background, .page-shell) .card,
  :is(.page-background, .page-shell) .stat,
  :is(.page-background, .page-shell) .event-card,
  :is(.page-background, .page-shell) .formula-strip,
  :is(.page-background, .page-shell) .table-wrap,
  :is(.page-background, .page-shell) .calc,
  :is(.page-background, .page-shell) .event-row { backdrop-filter: blur(5px); }
}
