@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,500;0,600;0,700;0,800;0,900;1,700&family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --bg: #07090c;
  --bg-elevated: #0c1015;
  --panel: #11161d;
  --panel-strong: #151b23;
  --line: #252d37;
  --line-bright: #3a4552;
  --text: #f4f7fa;
  --muted: #8d98a7;
  --subtle: #5f6b79;
  --red: #ff334b;
  --red-dark: #b7142b;
  --lime: #c8ff3d;
  --cyan: #37d7ff;
  --violet: #a77bff;
  --orange: #ff9a3d;
  --green: #42e59e;
  --white: #ffffff;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Inter", Arial, sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 51, 75, 0.08), transparent 30rem),
    radial-gradient(circle at 90% 18%, rgba(55, 215, 255, 0.05), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.023) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.023) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
  pointer-events: none;
}

.site-header,
main,
footer {
  width: min(1440px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-block;
  transform: skewX(-9deg);
  border: 3px solid var(--text);
  background: var(--red);
  overflow: hidden;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark__cut {
  content: "";
  position: absolute;
  background: var(--bg);
}

.brand-mark::before {
  width: 19px;
  height: 8px;
  top: 5px;
  right: -3px;
}

.brand-mark::after {
  width: 17px;
  height: 8px;
  right: 4px;
  bottom: 4px;
}

.brand-mark__cut {
  width: 7px;
  height: 31px;
  top: -2px;
  left: 11px;
  transform: rotate(34deg);
}

.brand-word {
  font-family: var(--display);
  font-size: 28px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.brand-word span {
  color: var(--red);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  display: inline-block;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(66, 229, 158, 0.65);
}

.header-meta__divider {
  width: 1px;
  height: 16px;
  background: var(--line);
}

main {
  padding-block: 82px 70px;
}

.view {
  animation: view-in 420ms ease both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  max-width: 1120px;
}

.eyebrow,
.panel-kicker {
  margin: 0;
  color: var(--red);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1,
.race-topbar h1,
.results-hero h1 {
  margin: 14px 0 0;
  font-family: var(--display);
  font-size: clamp(58px, 7.4vw, 112px);
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.84;
  text-transform: uppercase;
}

.hero h1 span {
  display: block;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(244, 247, 250, 0.54);
}

.hero-copy {
  max-width: 760px;
  margin: 28px 0 0;
  color: #b4beca;
  font-size: 17px;
  line-height: 1.72;
}

.hero-specs {
  max-width: 870px;
  margin-top: 38px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-specs > div {
  min-height: 86px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 24px 20px;
  border-right: 1px solid var(--line);
}

.hero-specs > div:first-child {
  padding-left: 0;
}

.hero-specs > div:last-child {
  border-right: 0;
}

.hero-specs strong {
  font-family: var(--display);
  font-size: 37px;
  font-style: italic;
  font-weight: 800;
  line-height: 1;
}

.hero-specs span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.setup-grid {
  margin-top: 68px;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(420px, 0.94fr);
  gap: 18px;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.018), transparent 35%),
    var(--panel);
}

.panel::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: -1px;
  right: -1px;
  border-top: 2px solid var(--red);
  border-right: 2px solid var(--red);
}

.driver-panel,
.grid-panel,
.podium-panel,
.result-meta-panel {
  padding: 30px;
}

.panel-heading,
.manifest-heading,
.sidebar-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.panel-heading h2,
.manifest-heading h2,
.sidebar-heading h2 {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: 30px;
  font-style: italic;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.garage-prompt {
  max-width: 560px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.pill {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--line-bright);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill--ready {
  border-color: rgba(66, 229, 158, 0.38);
  color: var(--green);
}

.pill--checking {
  color: var(--orange);
}

.pill--live {
  color: var(--green);
}

.field-grid {
  margin-top: 30px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 14px;
  background: #090d12;
  color: var(--text);
}

.field input::placeholder {
  color: #53606d;
}

.field input:focus {
  border-color: var(--cyan);
  outline: 0;
}

.drive-selector {
  min-width: 0;
  margin: 22px 0 0;
  border: 0;
  padding: 0;
}

.drive-selector legend {
  margin-bottom: 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drive-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.drive-option {
  min-height: 96px;
  position: relative;
  display: grid;
  align-content: start;
  gap: 5px;
  border: 1px solid var(--line);
  padding: 13px;
  background: #090d12;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.drive-option:hover {
  border-color: var(--line-bright);
  transform: translateY(-2px);
}

.drive-option:has(input:checked) {
  border-color: var(--red);
  background: rgba(255, 51, 75, 0.07);
}

.drive-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.drive-option:focus-within {
  outline: 1px solid var(--cyan);
  outline-offset: 2px;
}

.drive-option__percentage {
  color: var(--text);
  font-family: var(--display);
  font-size: 25px;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
}

.drive-option__label,
.drive-option__lanes {
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.35;
  text-transform: uppercase;
}

.drive-option__label {
  color: var(--muted);
}

.drive-option__lanes {
  margin-top: auto;
  color: var(--subtle);
}

.system-scan {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.scan-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.scan-row span {
  color: var(--muted);
}

.scan-row strong {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
}

.run-advice {
  margin-top: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-left: 2px solid var(--orange);
  background: rgba(255, 154, 61, 0.06);
}

.run-advice__icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--orange);
  color: var(--orange);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.run-advice p {
  margin: 0;
  color: #a6b0bd;
  font-size: 11px;
  line-height: 1.65;
}

.primary-button,
.secondary-button,
.stop-button {
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
}

.primary-button {
  width: 100%;
  min-height: 58px;
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  padding: 0 18px 0 22px;
  background: var(--red);
  color: var(--white);
  font-family: var(--display);
  font-size: 18px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.primary-button:not(:disabled):hover {
  background: #ff4960;
  transform: translateY(-2px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.45;
}

.button-arrow {
  font-family: var(--body);
  font-size: 25px;
  font-style: normal;
  font-weight: 400;
}

.persistence-note {
  min-height: 17px;
  margin: 11px 0 0;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.ghost-grid {
  margin-top: 30px;
  display: grid;
  gap: 10px;
}

.ghost-card {
  min-height: 88px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  background: #0b0f14;
}

.ghost-card::before {
  content: "";
  width: 4px;
  align-self: stretch;
  grid-column: 1;
  grid-row: 1;
  background: var(--racer-color, var(--muted));
}

.ghost-position {
  grid-column: 1;
  grid-row: 1;
  color: var(--subtle);
  font-family: var(--display);
  font-size: 24px;
  font-style: italic;
  font-weight: 800;
  text-align: right;
}

.ghost-card > div {
  min-width: 0;
  grid-column: 2;
}

.ghost-card strong,
.ghost-card span {
  display: block;
}

.ghost-card strong {
  overflow: hidden;
  font-family: var(--display);
  font-size: 19px;
  font-style: italic;
  font-weight: 700;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.racer-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-style: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.racer-link:hover,
.racer-link:focus-visible {
  color: var(--cyan);
  outline: 0;
}

.ghost-card div span {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.ghost-card div .ghost-card__detected {
  color: var(--subtle);
  font-size: 8px;
}

.ghost-card__score {
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.ghost-card__score--hidden {
  color: var(--subtle);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.ghost-card--loading {
  opacity: 0.48;
}

.hall-of-fame,
.stage-manifest,
.segment-results {
  margin-top: 76px;
}

.hall-table-wrap {
  border-bottom: 1px solid var(--line);
}

.hall-table td {
  vertical-align: middle;
}

.hall-table td:nth-child(3) {
  color: var(--text);
}

.hall-rank {
  width: 68px;
  color: var(--red);
}

.hall-racer,
.hall-date {
  display: block;
}

.hall-racer {
  color: var(--text);
  font-family: var(--display);
  font-size: 16px;
  font-style: italic;
  text-transform: uppercase;
}

.hall-date {
  margin-top: 3px;
  color: var(--subtle);
  font-size: 8px;
  text-transform: uppercase;
}

.hall-spec {
  max-width: 440px;
  color: var(--muted);
  white-space: normal;
}

.manifest-heading {
  align-items: flex-end;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.manifest-heading h2 {
  font-size: clamp(30px, 4vw, 52px);
}

.manifest-heading > p {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.manifest-list {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  list-style: none;
}

.manifest-item {
  min-height: 170px;
  position: relative;
  padding: 24px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.manifest-item:nth-child(5n) {
  border-right: 0;
}

.manifest-item__number {
  color: var(--red);
  font-family: var(--mono);
  font-size: 9px;
}

.manifest-item h3 {
  margin: 25px 0 7px;
  font-family: var(--display);
  font-size: 20px;
  font-style: italic;
  font-weight: 700;
  text-transform: uppercase;
}

.manifest-item p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.manifest-item__mode {
  position: absolute;
  right: 16px;
  bottom: 16px;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.race-view {
  margin-top: -22px;
}

.race-topbar {
  min-height: 135px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.race-topbar h1 {
  margin-top: 8px;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 0.92;
}

.race-stage-copy {
  max-width: 760px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.race-clock {
  display: grid;
  justify-items: end;
  gap: 5px;
  font-family: var(--mono);
  white-space: nowrap;
}

.race-clock span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.race-clock strong {
  color: var(--lime);
  font-size: 21px;
  font-weight: 500;
}

.race-layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 318px;
  gap: 18px;
}

.track-panel,
.standings-panel,
.timeline-panel {
  border: 1px solid var(--line);
  background: var(--panel);
}

.track-telemetry {
  min-height: 70px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.track-telemetry > div {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 0 18px;
  border-right: 1px solid var(--line);
}

.track-telemetry > div:last-child {
  border-right: 0;
}

.track-telemetry span {
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.track-telemetry strong {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
}

.track {
  min-height: 520px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    #0a0e13;
  background-size: 30px 30px;
}

.track::before,
.track::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 50%;
}

.track::before {
  width: 300px;
  height: 300px;
  left: -100px;
  bottom: -120px;
}

.track::after {
  width: 430px;
  height: 430px;
  top: -210px;
  right: -150px;
}

.track-svg {
  width: 100%;
  height: auto;
  position: relative;
  z-index: 2;
  display: block;
}

.track-curbs,
.track-shadow,
.track-asphalt,
.track-racing-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.track-infield {
  fill: rgba(22, 35, 28, 0.42);
  stroke: rgba(200, 255, 61, 0.08);
  stroke-width: 1;
}

.track-shadow {
  stroke: #020304;
  stroke-width: 92;
}

.track-curbs {
  stroke: #e9edf1;
  stroke-width: 82;
  stroke-dasharray: 18 18;
}

.track-curbs--red {
  stroke: var(--red);
  stroke-dashoffset: 18;
}

.track-asphalt {
  stroke: #242b33;
  stroke-width: 68;
}

.track-racing-line {
  stroke: #697480;
  stroke-width: 2;
  stroke-dasharray: 10 12;
}

.checkpoint {
  fill: #0b0f14;
  stroke: #596574;
  stroke-width: 2;
}

.checkpoint--active {
  fill: var(--red);
  stroke: var(--white);
  filter: url("#softGlow");
}

.checkpoint--complete {
  fill: var(--lime);
  stroke: #0b0f14;
}

.checkpoint-number {
  fill: #c4ccd5;
  font-family: var(--mono);
  font-size: 11px;
  text-anchor: middle;
  dominant-baseline: middle;
}

.checkpoint-number--active,
.checkpoint-number--complete {
  fill: #080a0d;
  font-weight: 700;
}

.start-finish line {
  stroke: var(--white);
  stroke-width: 7;
  stroke-dasharray: 7 7;
}

.checkpoint-winner-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.checkpoint-winner {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  padding: 3px 6px;
  transform: translate(-50%, -50%);
  border: 1px solid color-mix(in srgb, var(--winner-color) 72%, #ffffff);
  background: rgba(7, 9, 12, 0.92);
  color: var(--text);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 0 12px color-mix(in srgb, var(--winner-color) 24%, transparent);
}

.checkpoint-winner__dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--winner-color);
}

.car-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.race-car {
  width: 31px;
  height: 16px;
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: center;
  will-change: transform;
}

.race-car__body {
  width: 100%;
  height: 100%;
  position: relative;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: var(--racer-color);
  box-shadow: 0 0 15px color-mix(in srgb, var(--racer-color) 65%, transparent);
  clip-path: polygon(12% 0, 78% 0, 100% 28%, 91% 100%, 12% 100%, 0 66%, 0 25%);
}

.race-car__body::before {
  content: "";
  width: 9px;
  height: 10px;
  position: absolute;
  left: 9px;
  top: 2px;
  border-left: 1px solid rgba(255, 255, 255, 0.75);
  border-right: 1px solid rgba(255, 255, 255, 0.75);
  background: #18202a;
}

.race-car--you .race-car__body {
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 18px rgba(255, 51, 75, 0.9);
}

.countdown {
  width: 140px;
  height: 140px;
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%) skewX(-7deg);
  border: 2px solid var(--white);
  background: rgba(7, 9, 12, 0.9);
  color: var(--red);
  font-family: var(--display);
  font-size: 90px;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  box-shadow: 12px 12px 0 var(--red);
}

.track-label {
  position: absolute;
  z-index: 4;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.track-label--start {
  left: 14%;
  bottom: 11%;
}

.race-sidebar {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.standings-panel,
.timeline-panel {
  padding: 20px;
}

.sidebar-heading h2 {
  font-size: 24px;
}

.standings-caption {
  margin: 7px 0 0;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  line-height: 1.45;
  text-transform: uppercase;
}

.live-standings {
  margin-top: 12px;
  display: grid;
  gap: 7px;
}

.standing-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 24px 7px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  background: #0b0f14;
}

.standing-row--you {
  border-color: rgba(255, 51, 75, 0.5);
}

.standing-row__rank {
  color: var(--subtle);
  font-family: var(--display);
  font-size: 18px;
  font-style: italic;
  font-weight: 800;
}

.standing-row__color {
  width: 7px;
  height: 26px;
  background: var(--racer-color);
}

.standing-row__identity {
  min-width: 0;
}

.standing-row__identity strong,
.standing-row__identity span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standing-row__identity strong {
  font-family: var(--display);
  font-size: 15px;
  font-style: italic;
  text-transform: uppercase;
}

.standing-row__identity span {
  margin-top: 2px;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 7px;
  text-transform: uppercase;
}

.standing-row__score {
  font-family: var(--mono);
  font-size: 11px;
}

.timeline-panel {
  max-height: 384px;
  overflow: hidden;
}

.race-timeline {
  max-height: 307px;
  margin: 16px 0 0;
  padding: 0;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-bright) transparent;
  list-style: none;
}

.timeline-item {
  min-height: 43px;
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.timeline-item__number {
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 8px;
}

.timeline-item strong {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--display);
  font-size: 12px;
  font-style: italic;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.timeline-item__score {
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 9px;
}

.timeline-item--active strong,
.timeline-item--active .timeline-item__number {
  color: var(--text);
}

.timeline-item--active .timeline-item__number {
  color: var(--red);
}

.timeline-item--complete .timeline-item__score {
  color: var(--lime);
}

.stop-button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stop-button:hover {
  border-color: var(--red);
  color: var(--red);
}

.results-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 50px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
}

.results-hero h1 {
  font-size: clamp(52px, 6.2vw, 90px);
}

.result-score {
  min-width: 300px;
  display: grid;
  justify-items: end;
  padding-left: 36px;
  border-left: 1px solid var(--line);
}

.result-score span,
.result-score small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-score strong {
  margin: 6px 0;
  color: var(--lime);
  font-family: var(--display);
  font-size: 84px;
  font-style: italic;
  font-weight: 900;
  line-height: 0.9;
}

.results-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
}

.final-standings {
  margin-top: 25px;
}

.final-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 45px 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.final-row:first-child {
  background: rgba(200, 255, 61, 0.035);
}

.final-row__rank {
  font-family: var(--display);
  font-size: 32px;
  font-style: italic;
  font-weight: 900;
  text-align: center;
}

.final-row__color {
  width: 8px;
  height: 38px;
  background: var(--racer-color);
}

.final-row__identity strong,
.final-row__identity span {
  display: block;
}

.final-row__identity strong {
  font-family: var(--display);
  font-size: 19px;
  font-style: italic;
  text-transform: uppercase;
}

.final-row__identity span {
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.final-row__score {
  font-family: var(--mono);
  font-size: 15px;
}

.final-row__bonus {
  display: block;
  margin-top: 4px;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 8px;
  text-align: right;
  text-transform: uppercase;
}

.race-again-button {
  margin-top: 24px;
}

.run-meta {
  margin: 25px 0 0;
}

.run-meta > div {
  min-height: 49px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
}

.run-meta dt {
  color: var(--muted);
  font-size: 11px;
}

.run-meta dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  text-align: right;
  text-transform: uppercase;
}

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

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

th,
td {
  padding: 17px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: #bdc6d0;
  font-family: var(--mono);
  font-size: 10px;
}

td:first-child {
  color: var(--text);
  font-family: var(--display);
  font-size: 15px;
  font-style: italic;
  font-weight: 700;
  text-transform: uppercase;
}

.score-cell {
  color: var(--lime);
  font-size: 12px;
  font-weight: 600;
}

.result-actions {
  margin-top: 30px;
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.result-actions .primary-button {
  max-width: 360px;
  margin-top: 0;
}

.profile-dialog {
  width: min(900px, calc(100% - 32px));
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--line-bright);
  padding: 28px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.72);
}

.profile-dialog::backdrop {
  background: rgba(2, 4, 7, 0.82);
  backdrop-filter: blur(6px);
}

.profile-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.profile-dialog__header h2 {
  margin: 7px 0 0;
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 58px);
  font-style: italic;
  text-transform: uppercase;
}

.profile-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-bright);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 24px;
}

.profile-close:hover,
.profile-close:focus-visible {
  border-color: var(--red);
  color: var(--red);
  outline: 0;
}

.profile-status {
  margin: 30px 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.profile-stats {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--line);
}

.profile-stat {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 6px;
  border-right: 1px solid var(--line);
  padding: 14px;
}

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

.profile-stat strong {
  font-family: var(--display);
  font-size: 30px;
  font-style: italic;
}

.profile-stat span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.profile-runs-wrap {
  margin-top: 24px;
}

.secondary-button {
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-bright);
  padding: 0 22px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.secondary-button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

footer {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

footer span:last-child {
  max-width: 720px;
  text-align: right;
}

.toast {
  min-width: min(430px, calc(100% - 32px));
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  border: 1px solid var(--line-bright);
  padding: 13px 17px;
  background: #11161d;
  color: var(--text);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

@media (max-width: 1100px) {
  .setup-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

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

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

  .race-sidebar .stop-button {
    grid-column: 1 / -1;
  }

  .manifest-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .manifest-item:nth-child(5n) {
    border-right: 1px solid var(--line);
  }

  .manifest-item:nth-child(2n) {
    border-right: 0;
  }

  .drive-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header,
  main,
  footer {
    width: min(100% - 28px, 1440px);
  }

  .header-meta span:not(.status-dot):not(:first-of-type) {
    display: none;
  }

  main {
    padding-top: 54px;
  }

  .hero h1 {
    font-size: clamp(50px, 16vw, 78px);
  }

  .hero-specs {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-specs > div:nth-child(2) {
    border-right: 0;
  }

  .hero-specs > div:first-child {
    padding-left: 20px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-stat:nth-child(2n) {
    border-right: 0;
  }

  .profile-stat {
    border-bottom: 1px solid var(--line);
  }

  .profile-stat:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
  }

  .driver-panel,
  .grid-panel,
  .podium-panel,
  .result-meta-panel {
    padding: 22px 18px;
  }

  .setup-grid {
    margin-top: 44px;
  }

  .manifest-heading,
  .results-hero,
  .race-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .race-clock {
    justify-items: start;
  }

  .track-telemetry {
    grid-template-columns: repeat(2, 1fr);
  }

  .track-telemetry > div {
    min-height: 58px;
    border-bottom: 1px solid var(--line);
  }

  .track {
    min-height: 360px;
  }

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

  .race-sidebar .stop-button {
    grid-column: auto;
  }

  .result-score {
    width: 100%;
    min-width: 0;
    justify-items: start;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 24px 0 0;
  }

  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .result-actions .primary-button {
    max-width: none;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-block: 20px;
  }

  footer span:last-child {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .brand-word {
    font-size: 23px;
  }

  .hero-copy {
    font-size: 14px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .drive-options,
  .profile-stats {
    grid-template-columns: 1fr;
  }

  .drive-option {
    min-height: 82px;
  }

  .profile-dialog {
    padding: 22px 16px;
  }

  .profile-stat,
  .profile-stat:nth-child(2n) {
    border-right: 0;
  }

  .profile-stat:last-child {
    grid-column: auto;
  }

  .ghost-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .ghost-card__score {
    display: none;
  }

  .manifest-list {
    grid-template-columns: 1fr;
  }

  .manifest-item,
  .manifest-item:nth-child(5n),
  .manifest-item:nth-child(2n) {
    min-height: 138px;
    border-right: 0;
  }

  .race-topbar h1 {
    font-size: 43px;
  }

  .track {
    margin-inline: -1px;
  }

  .countdown {
    width: 100px;
    height: 100px;
    font-size: 62px;
  }
}

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