/* ForceMetric Drag Racing — arcade motorsport overlay */

.race-page {
  --you: #b8ff3c;
  --you-glow: rgba(184, 255, 60, 0.45);
  --opp: #22d3ee;
  --opp-glow: rgba(34, 211, 238, 0.45);
  --neon-pink: #ff2d95;
}

.race-app {
  max-width: 1480px;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: var(--panel-2);
  color: #e8ecf1;
  border: 1px solid var(--panel-border-strong);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-weight: 650;
  font-size: 13px;
}

.btn-back:hover {
  background: #1c222b;
  border-color: rgba(255, 255, 255, 0.18);
}

.hidden {
  display: none !important;
}

/* Setup */
.weather-strip {
  margin-bottom: 4px;
}

.weather-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.6fr) repeat(4, minmax(110px, 1fr));
  gap: 10px;
  align-items: end;
}

.lanes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.lane-card {
  position: relative;
  overflow: visible;
  min-width: 0;
}

.lane-card.lane-you {
  border-color: rgba(184, 255, 60, 0.28);
  box-shadow: 0 0 0 1px rgba(184, 255, 60, 0.08), var(--shadow-card);
}

.lane-card.lane-opp {
  border-color: rgba(34, 211, 238, 0.28);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.08), var(--shadow-card);
}

.lane-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.lane-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 4px 10px;
  border-radius: 999px;
}

.lane-tag.you {
  background: rgba(184, 255, 60, 0.15);
  color: var(--you);
  border: 1px solid rgba(184, 255, 60, 0.35);
}

.lane-tag.opp {
  background: rgba(34, 211, 238, 0.12);
  color: var(--opp);
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.lane-name {
  font-size: 16px;
  font-weight: 750;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.opp-garage {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--panel-border);
}

.race-car-list {
  max-height: 160px;
  margin: 8px 0;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  overflow-y: auto;
}

.race-car-list li {
  padding: 7px 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.race-car-list li:hover,
.race-car-list li.selected {
  background: rgba(34, 211, 238, 0.12);
  color: var(--opp);
}

.launch-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 0 8px;
}

.setup-hint {
  color: var(--text-muted);
  font-size: 12px;
  min-height: 1.2em;
}

.btn-launch {
  /* Phase 33 — brass primary CTA with crimson gem accent (not flat neon slab) */
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 16px 52px;
  border-radius: 12px;
  color: #ffe8ec;
  border: 1px solid rgba(255, 80, 110, 0.55);
  background:
    linear-gradient(90deg, rgba(255, 51, 85, 0.7) 0 4px, transparent 4px),
    radial-gradient(ellipse at 50% 0%, rgba(255, 100, 130, 0.28), transparent 55%),
    linear-gradient(180deg, rgba(255, 246, 224, 0.18) 0%, transparent 42%),
    var(--btn-brass-face-strong, var(--brass-face));
  box-shadow:
    var(--btn-brass-rim, inset 0 0 0 1px var(--brass-strong), inset 0 0 0 2px var(--brass-inset)),
    0 0 22px rgba(225, 29, 72, 0.22),
    0 8px 24px rgba(0, 0, 0, 0.4);
  animation: launchPulse 1.8s ease-in-out infinite;
}

.btn-launch:hover {
  color: #fff;
  border-color: rgba(255, 120, 140, 0.75);
  background:
    linear-gradient(90deg, rgba(255, 85, 110, 0.85) 0 4px, transparent 4px),
    radial-gradient(ellipse at 50% 0%, rgba(255, 120, 150, 0.34), transparent 55%),
    var(--btn-brass-face-strong, var(--brass-face));
}

@keyframes launchPulse {
  0%, 100% {
    box-shadow:
      var(--btn-brass-rim, inset 0 0 0 1px var(--brass-strong), inset 0 0 0 2px var(--brass-inset)),
      0 0 18px rgba(225, 29, 72, 0.18),
      0 8px 24px rgba(0, 0, 0, 0.4);
  }
  50% {
    box-shadow:
      var(--btn-brass-rim, inset 0 0 0 1px var(--brass-strong), inset 0 0 0 2px var(--brass-inset)),
      0 0 28px rgba(225, 29, 72, 0.32),
      0 8px 28px rgba(0, 0, 0, 0.45);
  }
}

/* Race view */
.race-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.winner-banner {
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  background: var(--surface);
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.winner-banner.show {
  opacity: 1;
  transform: scale(1);
}

.winner-banner.win-you {
  color: var(--you);
  border-color: rgba(184, 255, 60, 0.45);
  box-shadow: 0 0 40px var(--you-glow);
  text-shadow: 0 0 18px var(--you-glow);
}

.winner-banner.win-opp {
  color: var(--opp);
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 40px var(--opp-glow);
  text-shadow: 0 0 18px var(--opp-glow);
}

.winner-banner.win-tie {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 0 36px rgba(251, 191, 36, 0.35);
}

.race-names {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}

.race-name {
  font-size: 18px;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.race-name.you {
  color: var(--you);
  border-color: rgba(184, 255, 60, 0.3);
  text-align: right;
}

.race-name.opp {
  color: var(--opp);
  border-color: rgba(34, 211, 238, 0.3);
}

.race-vs {
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  font-size: 12px;
}

.track-board {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%),
    var(--surface);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 16px 18px 12px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lane-strip {
  display: grid;
  grid-template-columns: 72px 1fr 140px;
  gap: 10px;
  align-items: center;
}

.strip-label {
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.you-strip .strip-label { color: var(--you); }
.opp-strip .strip-label { color: var(--opp); }

.strip-track {
  position: relative;
  height: 28px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.04) 0,
      rgba(255,255,255,0.04) 2px,
      transparent 2px,
      transparent 12.5%
    ),
    #0a0c0f;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
}

.strip-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: 999px;
  transition: width 0.05s linear;
}

.you-strip .strip-fill {
  background: linear-gradient(90deg, rgba(184,255,60,0.15), rgba(184,255,60,0.75));
  box-shadow: 0 0 16px var(--you-glow);
}

.opp-strip .strip-fill {
  background: linear-gradient(90deg, rgba(34,211,238,0.15), rgba(34,211,238,0.75));
  box-shadow: 0 0 16px var(--opp-glow);
}

.strip-marker {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 10px;
  margin-left: -5px;
  left: 0%;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 0 10px rgba(255,255,255,0.8);
  transition: left 0.05s linear;
}

.you-strip .strip-marker { background: var(--you); }
.opp-strip .strip-marker { background: var(--opp); }

.strip-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  gap: 2px;
}

.lead-callout {
  text-align: center;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: var(--text);
  padding: 8px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--panel-border);
  min-height: 2.4em;
}

.track-scale {
  position: relative;
  height: 14px;
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--mono);
  margin: 0 72px;
}

.track-mark {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.track-mark[style="left:0%"] {
  transform: none;
}

.track-mark-end {
  transform: translateX(-100%);
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.race-chart-wrap {
  height: 220px;
  position: relative;
}

.race-chart-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.results-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.result-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
}

.result-card.you {
  border-color: rgba(184, 255, 60, 0.28);
}

.result-card.opp {
  border-color: rgba(34, 211, 238, 0.28);
}

.result-card h3 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.result-card.you h3 { color: var(--you); }
.result-card.opp h3 { color: var(--opp); }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-pill {
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.stat-pill .lbl {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.stat-pill .val {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.gap-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--panel-border);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.race-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 6px 0 4px;
}

.race-actions .btn-ctrl {
  width: auto;
  min-width: 140px;
}

/* .btn-drag neon slab removed — Phase 33 brass treatment lives in styles.css */

.controls-col .btn-drag {
  width: 100%;
}

@media (max-width: 980px) {
  .lanes-grid,
  .charts-row,
  .results-board,
  .weather-row {
    grid-template-columns: 1fr;
  }

  .lane-strip {
    grid-template-columns: 56px 1fr;
  }

  .strip-stats {
    grid-column: 2;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .track-scale {
    margin: 0 56px;
  }
}

/* Phase 14/15 — race chrome parity with main brass instrument cluster */
.btn-back {
  border: 1px solid var(--brass);
  color: var(--brass-text);
  background: var(--btn-brass-face, linear-gradient(180deg, rgba(240, 226, 196, 0.06), transparent 55%), var(--panel-2));
  box-shadow: var(--btn-brass-rim, inset 0 0 0 1px var(--brass-inset));
}
.btn-back:hover {
  border-color: rgba(240, 226, 196, 0.65);
  color: #fff6e0;
  background: var(--btn-brass-face-strong, var(--panel-2));
  box-shadow: var(--btn-brass-rim-hover, inset 0 0 0 1px var(--brass-inset));
}
.btn-back:focus-visible {
  outline: none;
  border-color: var(--brass-text);
  box-shadow:
    var(--btn-brass-rim, inset 0 0 0 1px var(--brass-inset)),
    0 0 0 2px var(--bg),
    0 0 0 4px rgba(215, 196, 160, 0.4);
}
.lane-card, .weather-strip.card, .chart-panel.card {
  border: 1px solid var(--brass);
  background: var(--brass-face);
  box-shadow: var(--brass-shadow);
}
.weather-strip.card,
.race-opts.card {
  overflow: visible;
}
.lane-card.lane-you {
  border-color: rgba(184, 255, 60, 0.35);
  box-shadow: 0 0 0 1px rgba(184, 255, 60, 0.10), var(--brass-shadow);
}
.lane-card.lane-opp {
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.10), var(--brass-shadow);
}

.lane-card .field span, .weather-strip .field span, .drive-label, .card-title { color: var(--brass-text); }
.lane-card input[type="number"], .lane-card input[type="text"], .lane-card select,
.weather-strip input, .weather-strip select {
  border: 1px solid var(--brass);
  background: var(--input-bg);
  box-shadow: inset 0 0 0 1px var(--brass-inset);
  color: var(--text);
}
.lane-card input:focus, .lane-card select:focus, .weather-strip input:focus, .weather-strip select:focus {
  outline: 2px solid var(--brass-text);
  outline-offset: 1px;
}
.lane-card .drive-seg, .lane-card .drive-opt span { border-color: var(--brass); }
.race-car-list { border: 1px solid var(--brass); box-shadow: inset 0 0 0 1px var(--brass-inset); }
.btn-load {
  /* Race lane Load inherits Phase 33 brass + green gem from styles.css */
  border: 1px solid rgba(74, 222, 128, 0.48);
  color: #c6f5d4;
  background:
    linear-gradient(90deg, rgba(34, 197, 94, 0.55) 0 3px, transparent 3px),
    var(--btn-brass-face-strong, var(--panel-2));
  box-shadow: var(--btn-brass-rim, inset 0 0 0 1px var(--brass-inset));
}
.btn-load:hover {
  border-color: rgba(74, 222, 128, 0.72);
  color: #e6ffe0;
  box-shadow: var(--btn-brass-rim-hover, inset 0 0 0 1px var(--brass-inset));
}
.track-board, .results-board .result-card, .winner-banner, .race-chart-wrap, .race-name, .lead-callout {
  border-color: var(--brass);
}
.track-board, .results-board .result-card {
  background: var(--brass-face);
  box-shadow: var(--brass-shadow);
}
.race-chart-wrap {
  background: #07090c;
  border: 1px solid var(--brass);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px var(--brass-inset);
  overflow: hidden;
}

.stat-pill {
  border: 1px solid var(--brass);
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 0 1px var(--brass-inset);
}
.stat-pill .lbl, .lane-header, .setup-hint, .meta-pill .lbl { color: var(--brass-text); }
.stat-pill .val, .meta-pill .val { font-family: var(--mono); color: var(--text); }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.meta-pill {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brass);
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 0 1px var(--brass-inset);
  min-width: 72px;
}
.meta-pill .lbl { font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; }
.meta-pill .val { font-size: 12px; font-weight: 700; }
.race-actions .btn-ctrl {
  border: 1px solid var(--brass);
  color: var(--brass-text);
  background: var(--btn-brass-face, var(--panel-2));
  box-shadow: var(--btn-brass-rim, inset 0 0 0 1px var(--brass-inset));
}
.race-actions .btn-ctrl:hover {
  border-color: rgba(240, 226, 196, 0.65);
  color: #fff6e0;
  background: var(--btn-brass-face-strong, var(--panel-2));
  box-shadow: var(--btn-brass-rim-hover, inset 0 0 0 1px var(--brass-inset));
}
.strip-track { border: 1px solid var(--brass); box-shadow: inset 0 0 0 1px var(--brass-inset); }
.check-row label { color: var(--brass-text); }
.lane-card, .track-board, .chart-panel.card { position: relative; }
@media (max-width: 980px) {
  .lane-card .drive-seg-4 { grid-template-columns: 1fr 1fr; }
}


/* ── Phase 16: setup-compare chrome ── */
.race-opts {
  margin-bottom: 4px;
}
.race-hard-rule {
  font-size: 12px;
  color: var(--brass-text);
  margin: 0 0 10px;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brass);
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 0 1px var(--brass-inset);
}
.race-opts-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) minmax(140px, 1.2fr) repeat(2, minmax(110px, 1fr));
  gap: 10px;
  align-items: end;
}
.race-opts .check-field .inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brass);
  background: var(--input-bg);
  box-shadow: inset 0 0 0 1px var(--brass-inset);
  color: var(--brass-text);
  font-size: 13px;
  min-width: 0;
  box-sizing: border-box;
  width: 100%;
}
/* Phase 18: custom roll start/end — keep weather-row hotfix untouched */
.roll-speed-panel {
  margin-top: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brass);
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 0 0 1px var(--brass-inset);
}
.roll-speed-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 10px;
  align-items: end;
}
.roll-speed-row .field {
  min-width: 0;
  grid-template-columns: 1fr;
}
.roll-speed-row .field > span { white-space: normal; }
.roll-speed-row .field input,
.roll-speed-row .field select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.roll-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.roll-preset {
  border: 1px solid var(--brass);
  color: var(--brass-text);
  background: var(--btn-brass-face, var(--panel-2));
  box-shadow: var(--btn-brass-rim, inset 0 0 0 1px var(--brass-inset));
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.roll-preset:hover {
  border-color: rgba(240, 226, 196, 0.65);
  color: #fff6e0;
  background: var(--btn-brass-face-strong, var(--panel-2));
  box-shadow: var(--btn-brass-rim-hover, inset 0 0 0 1px var(--brass-inset));
}
.roll-preset:focus-visible {
  outline: none;
  border-color: var(--brass-text);
  box-shadow:
    var(--btn-brass-rim, inset 0 0 0 1px var(--brass-inset)),
    0 0 0 2px var(--bg),
    0 0 0 4px rgba(215, 196, 160, 0.4);
}

/* Hotfix: fit Preset + Temp + Humidity + Pressure + DA without right-edge clip */
.weather-row {
  grid-template-columns: minmax(160px, 1.6fr) repeat(4, minmax(110px, 1fr));
}
.weather-row .field,
.race-opts-row .field {
  min-width: 0;
  grid-template-columns: 1fr;
}
.weather-row .field > span,
.race-opts-row .field > span {
  white-space: normal;
}
.weather-row .field input,
.weather-row .field select,
.race-opts-row .field input,
.race-opts-row .field select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.race-air-hp {
  margin-top: 10px;
}
.setup-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 8px 0 0;
}
.setup-tools .btn-ctrl {
  border: 1px solid var(--brass);
  color: var(--brass-text);
  background: var(--btn-brass-face, var(--panel-2));
  box-shadow: var(--btn-brass-rim, inset 0 0 0 1px var(--brass-inset));
}
.setup-tools .btn-ctrl:hover {
  border-color: rgba(240, 226, 196, 0.65);
  color: #fff6e0;
  background: var(--btn-brass-face-strong, var(--panel-2));
  box-shadow: var(--btn-brass-rim-hover, inset 0 0 0 1px var(--brass-inset));
}

.tree-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--brass);
  background: var(--brass-face);
  box-shadow: var(--brass-shadow);
}
.tree-lane {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.tree-bulb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: #1a1d22;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.6);
  opacity: 0.35;
}
.tree-bulb.amber.on {
  opacity: 1;
  background: radial-gradient(circle at 35% 30%, #ffe08a, #f59e0b 55%, #b45309);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.75);
}
.tree-bulb.green.on {
  opacity: 1;
  background: radial-gradient(circle at 35% 30%, #e8ff9a, #b8ff3c 55%, #65a30d);
  box-shadow: 0 0 16px rgba(184, 255, 60, 0.8);
}
.tree-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  color: var(--brass-text);
  font-family: var(--mono);
}

.lead-delta-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.delta-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brass);
  background: rgba(0, 0, 0, 0.32);
  box-shadow: inset 0 0 0 1px var(--brass-inset);
  min-width: 0;
}
.delta-mark {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass-text);
}
.delta-val {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.delta-val.delta-locked { color: var(--text); }
.delta-val.delta-you { color: var(--you); }
.delta-val.delta-opp { color: var(--opp); }

.photo-finish {
  padding: 12px 14px;
}
.photo-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
}
.photo-lane {
  border: 1px solid var(--brass);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 0 1px var(--brass-inset);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.photo-lane.you { border-color: rgba(184, 255, 60, 0.35); }
.photo-lane.opp { border-color: rgba(34, 211, 238, 0.35); }
.photo-name {
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 2px;
}
.photo-lane.you .photo-name { color: var(--you); }
.photo-lane.opp .photo-name { color: var(--opp); }
.photo-stat {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
}
.photo-stat .lbl { color: var(--brass-text); text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px; }
.photo-stat .val { color: var(--text); font-weight: 700; }
.photo-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--brass-text);
  line-height: 1.3;
}

.race-opts.card, .photo-finish.card, .tree-board {
  border-color: var(--brass);
}

@media (max-width: 980px) {
  .weather-row { grid-template-columns: 1fr 1fr; }
  .race-opts-row { grid-template-columns: 1fr 1fr; }
  .roll-speed-row { grid-template-columns: 1fr 1fr; }
  .lead-delta-strip { grid-template-columns: 1fr 1fr; }
  .photo-grid { grid-template-columns: 1fr; }
  .photo-vs { padding: 6px 0; }
  .tree-board { grid-template-columns: 1fr; }
}


/* Phase 19 — side-view dual-lane playback stage (physics-true positions) */
.stage-wrap {
  position: relative;
  border: 1px solid var(--brass);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px var(--brass-inset), var(--brass-shadow);
  background:
    linear-gradient(180deg, rgba(240, 226, 196, 0.05), transparent 40%),
    #07090e;
  overflow: hidden;
}

.stage-wrap canvas {
  display: block;
  width: 100%;
  height: 300px;
  vertical-align: top;
}

.stage-hud.brass-hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid rgba(196, 165, 116, 0.35);
  background:
    linear-gradient(180deg, rgba(240, 226, 196, 0.07), transparent 70%),
    var(--brass-face);
}

.stage-hud-lane {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 12px;
}

.stage-hud-lane.you { justify-content: flex-start; }
.stage-hud-lane.opp { justify-content: flex-end; }

.stage-hud-lane .strip-label {
  font-size: 11px;
  letter-spacing: 0.1em;
}

.stage-hud-lane.you .strip-label { color: var(--you); }
.stage-hud-lane.opp .strip-label { color: var(--opp); }

.stage-hud-stat {
  color: var(--brass-text);
  font-variant-numeric: tabular-nums;
}

.stage-hud-mid {
  text-align: center;
}

.stage-hud-cam {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass-text);
  border: 1px solid var(--brass);
  box-shadow: inset 0 0 0 1px var(--brass-inset);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.legacy-strip-hooks {
  display: none !important;
}

.track-board {
  gap: 10px;
}

.track-scale {
  margin: 0 4px;
}

@media (max-width: 980px) {
  .stage-wrap canvas {
    height: 240px;
  }
  .stage-hud.brass-hud {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .stage-hud-lane.you,
  .stage-hud-lane.opp {
    justify-content: space-between;
  }
  .stage-hud-mid { order: -1; }
}

/* ============================================================
   Phase 27/28 — brass stage chrome
   Outer frame, header brand / Replay·Rematch / TELEMETRY LIVE, bottom plaques.
   Family Brass tokens (--brass*) where they fit; plaques read bronze.
   Phase 28: snip Option 3 plaque; Replay + Rematch live in header center.
   ============================================================ */

.vb-stage-chrome {
  --vb-bronze: #a68d5d;
  --vb-bronze-hi: #d4c09a;
  --vb-bronze-lo: #6a5538;
  --vb-bronze-face: linear-gradient(160deg, #3a3224 0%, #1a1610 45%, #2a2418 100%);
  position: relative;
  border-radius: 14px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(166, 141, 93, 0.18), transparent 40%),
    #0f0f0f;
  border: 3px solid var(--vb-bronze);
  box-shadow:
    0 0 0 1px rgba(212, 192, 154, 0.55),
    inset 0 0 0 1px rgba(106, 85, 56, 0.65),
    inset 0 0 0 3px rgba(15, 15, 15, 0.95),
    0 8px 28px rgba(0, 0, 0, 0.55);
}

.vb-stage-header {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(180px, 1.2fr) minmax(150px, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.vb-stage-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.vb-stage-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 30%, #e8d7b0, #a68d5d 45%, #4a3a22 78%, #1a1610 100%);
  border: 2px solid var(--vb-bronze-hi);
  box-shadow:
    inset 0 0 0 2px rgba(20, 16, 10, 0.7),
    0 0 10px rgba(166, 141, 93, 0.35);
  color: #1a1610;
  font-weight: 900;
  font-size: 18px;
  font-family: Georgia, "Times New Roman", serif;
}

.vb-stage-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  letter-spacing: 0.12em;
  color: var(--vb-bronze-hi);
  font-weight: 700;
  line-height: 1.1;
}

.vb-stage-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--brass-text);
  text-transform: uppercase;
}
.vb-stage-sub span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--vb-bronze), transparent);
  max-width: 36px;
}

.vb-stage-header-controls {
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.vb-header-ctrl {
  width: auto;
  min-width: 0;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f0e2c4;
  /* Phase 33 — stage Replay/Rematch share brass bezel language */
  background:
    linear-gradient(180deg, rgba(255, 246, 224, 0.16) 0%, transparent 40%),
    var(--vb-bronze-face);
  border: 2px solid var(--vb-bronze);
  box-shadow:
    inset 0 0 0 1px rgba(212, 192, 154, 0.35),
    inset 0 0 0 3px rgba(106, 85, 56, 0.4),
    inset 0 1px 0 rgba(255, 246, 224, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.vb-header-ctrl:hover {
  color: #fff6e0;
  border-color: var(--vb-bronze-hi);
  box-shadow:
    inset 0 0 0 1px rgba(212, 192, 154, 0.5),
    inset 0 0 0 3px rgba(106, 85, 56, 0.45),
    inset 0 1px 0 rgba(255, 246, 224, 0.18),
    0 2px 10px rgba(166, 141, 93, 0.35);
}
.vb-header-ctrl:active {
  transform: translateY(1px);
}
.vb-header-ctrl:focus-visible {
  outline: none;
  border-color: var(--vb-bronze-hi);
  box-shadow:
    inset 0 0 0 1px rgba(212, 192, 154, 0.5),
    inset 0 0 0 3px rgba(106, 85, 56, 0.45),
    0 0 0 2px #050607,
    0 0 0 4px rgba(215, 196, 160, 0.4);
}

.vb-stage-telemetry {
  justify-self: end;
  text-align: right;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--vb-bronze-face);
  border: 1px solid var(--vb-bronze);
  box-shadow: inset 0 0 0 1px rgba(212, 192, 154, 0.25);
}

.vb-telem-live {
  font-size: 11px;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: var(--vb-bronze-hi);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.vb-telem-live em {
  font-style: normal;
  color: #a4e32d;
  text-shadow: 0 0 8px rgba(164, 227, 45, 0.55);
}
.vb-signal {
  width: 14px;
  height: 10px;
  display: inline-block;
  background:
    linear-gradient(#a4e32d, #a4e32d) 0 100% / 2px 4px no-repeat,
    linear-gradient(#a4e32d, #a4e32d) 4px 100% / 2px 6px no-repeat,
    linear-gradient(#a4e32d, #a4e32d) 8px 100% / 2px 8px no-repeat,
    linear-gradient(#a4e32d, #a4e32d) 12px 100% / 2px 10px no-repeat;
}
.vb-telem-stage {
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--brass-text);
  text-transform: uppercase;
}

.vb-stage-chrome .stage-wrap {
  border: 2px solid var(--vb-bronze);
  border-radius: 10px;
  box-shadow:
    inset 0 0 0 1px rgba(212, 192, 154, 0.35),
    inset 0 0 0 3px rgba(20, 16, 10, 0.85),
    var(--brass-shadow);
  background:
    linear-gradient(180deg, rgba(166, 141, 93, 0.06), transparent 35%),
    #0a0a0c;
}

.stage-lane-tags {
  position: absolute;
  z-index: 2;
  left: 10px;
  top: 10px;
  bottom: 58px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 800;
}
.lane-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lane-tag.you { color: #a4e32d; }
.lane-tag.opp { color: #48cae4; }
.lane-tag i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.vb-stage-plaques {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1.35fr;
  gap: 10px;
  margin-top: 10px;
}

.vb-plaque {
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--vb-bronze-face);
  border: 2px solid var(--vb-bronze);
  box-shadow:
    inset 0 0 0 1px rgba(212, 192, 154, 0.35),
    inset 0 0 0 3px rgba(106, 85, 56, 0.35),
    0 2px 10px rgba(0, 0, 0, 0.45);
  min-width: 0;
}

.vb-plaque-stage {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vb-plaque-ico {
  font-size: 22px;
  filter: grayscale(0.2) sepia(0.6) saturate(1.4);
}
.vb-plaque-kicker,
.vb-plaque-foot {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-text);
  text-align: center;
}
.vb-plaque-value {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--vb-bronze-hi);
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}
.vb-plaque-body { flex: 1; min-width: 0; }

.vb-plaque-split {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.vb-split {
  text-align: center;
  min-width: 0;
}
.vb-split-val {
  display: block;
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.vb-split.you .vb-split-val { color: #a4e32d; }
.vb-split.opp .vb-split-val { color: #48cae4; }
.vb-split-lbl {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--brass-text);
}
.vb-split-div {
  width: 1px;
  align-self: stretch;
  background: linear-gradient(180deg, transparent, rgba(240, 226, 196, 0.55), transparent);
}

@media (max-width: 980px) {
  .vb-stage-header {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .vb-stage-telemetry { justify-self: stretch; text-align: left; }
  .vb-telem-live { justify-content: flex-start; }
  .vb-stage-header-controls { justify-self: stretch; }
  .vb-header-ctrl { flex: 1 1 auto; text-align: center; }
  .vb-stage-plaques { grid-template-columns: 1fr; }
}

/* Phase 33 — race button cohesion notes
   Shared --btn-brass-* tokens from styles.css :root.
   Launch / Back / Load / ctrl / roll-preset / header Replay-Rematch use brass
   bezels with role accents (crimson Launch, green Load). No physics/µ retune.
*/


/* Phase 36 — Sequential TX + Drag Pack on race lanes */
.lane-card .tx-row .drive-seg.drive-seg-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.lane-card .tx-row .drive-opt span {
  font-size: 9px;
  padding: 6px 2px;
}
.lane-card .drag-pack-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--brass, rgba(215, 196, 160, 0.42));
  border-radius: 6px;
  background: rgba(10, 12, 15, 0.55);
}
.lane-card .drag-pack-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brass-text, #e8d7b0);
  cursor: pointer;
}
.lane-card .drag-pack-hint {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 215, 176, 0.7);
}
