/* ==========================================================================
   RACE HOUSE COMMUNITY — v3 "Forza update" HUD theme
   Need-For-Speed-style digital dash aesthetic: near-black cockpit,
   teal primary neon + amber secondary, angular clipped panels,
   digital-readout numerals. No imagery — all CSS/SVG drawn in code.
   RESKIN: every Phase-1/v2 class name keeps working unchanged.
   ========================================================================== */

:root {
  --bg: #0a0e12;
  --bg-soft: #0e1419;
  --card: #11181f;
  --card-edge: #223039;
  --ink: #eef3f4;
  --ink-dim: #a9b6bd;
  --ink-faint: #8a979e;
  --teal: #00e5cc;
  --teal-hi: #5ff7e3;
  --teal-deep: #00b39b;
  --teal-dim: rgba(0, 229, 204, 0.12);
  --amber: #ffb300;
  --amber-deep: #c78a00;
  --green: #2ecc71;
  --red: #ff5147;
  --red-deep: #b02a22;
  --radius: 10px;
  --cut: 10px; /* angular corner cut for clipped panels */
  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-body: 'Archivo', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--bg);
  /* Very subtle cockpit texture: faint teal grid + top glow. Keep it quiet. */
  background-image:
    radial-gradient(1100px 480px at 50% -8%, rgba(0, 229, 204, 0.055), transparent 62%),
    linear-gradient(rgba(0, 229, 204, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 204, 0.028) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 400;
  margin: 0 0 0.5em;
  line-height: 1.05;
}

h1 { font-size: clamp(2rem, 6vw, 3.25rem); }
h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }
a { color: var(--ink); }

/* Digital-readout numerals (times, stats, HUD values). */
.time, .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.jp { font-family: var(--font-body); font-weight: 600; }

/* HUD divider strip: dark teal checks, pure CSS — no imagery */
.checker {
  height: 14px;
  background:
    repeating-conic-gradient(#0c211d 0% 25%, #070b0e 0% 50%) 0 0 / 28px 28px;
  opacity: 0.9;
  border-top: 1px solid rgba(0, 229, 204, 0.12);
  border-bottom: 1px solid rgba(0, 229, 204, 0.12);
}

/* Visible keyboard focus everywhere — HUD must stay operable. */
a:focus-visible, button:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- header */
.site-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.25rem;
  background: rgba(8, 11, 14, 0.96);
  border-bottom: 1px solid var(--card-edge);
  box-shadow: inset 0 -2px 0 rgba(0, 229, 204, 0.14);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand { text-decoration: none; display: flex; align-items: baseline; gap: 0.6rem; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.brand-name::after {
  content: "";
  display: inline-block;
  width: 0.55em; height: 0.55em;
  background: var(--teal);
  margin-left: 0.35em;
  transform: skewX(-12deg);
  box-shadow: 0 0 10px rgba(0, 229, 204, 0.55);
}
.brand-jp { color: var(--ink-faint); font-size: 0.8rem; letter-spacing: 0.35em; }

.main-nav { display: flex; gap: 0.25rem; margin-left: auto; flex-wrap: wrap; }
.main-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: var(--ink-dim);
}
.main-nav a:hover { color: var(--ink); background: var(--bg-soft); }
.main-nav a.active {
  color: #04211c;
  background: var(--teal);
  box-shadow: 0 0 12px rgba(0, 229, 204, 0.35);
}

.auth-area { display: flex; align-items: center; gap: 0.6rem; }
.auth-area .who {
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none; font-weight: 600; font-size: 0.9rem;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; background: var(--card-edge);
  border: 1px solid var(--card-edge);
}
.avatar-fallback {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal); color: #04211c; font-weight: 700;
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------- layout */
.view {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  min-height: 60vh;
}

.page-head { margin-bottom: 1.75rem; }
.page-head .kicker {
  color: var(--teal); font-weight: 700; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.18em;
  margin-bottom: 0.4rem;
}
.lede { color: var(--ink-dim); max-width: 46rem; }

.section { margin: 2.5rem 0; }
.section > h2 {
  display: flex; align-items: center; gap: 0.75rem;
}
.section > h2::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--card-edge), transparent);
}

/* ---------------------------------------------------------------- cards */
.card {
  background: linear-gradient(165deg, #131b23 0%, var(--card) 55%);
  border: 1px solid var(--card-edge);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  padding: 1.25rem 1.4rem;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.build-card {
  display: block;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.build-card:hover {
  transform: translateY(-3px);
  border-color: var(--teal-deep);
  box-shadow: 0 6px 24px rgba(0, 229, 204, 0.12);
}
.build-card .thumb {
  height: 170px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--card-edge);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint); font-size: 0.85rem; text-align: center;
  padding: 1rem;
}
.build-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.build-card .thumb.no-photo {
  background:
    repeating-linear-gradient(45deg, #10171d 0 14px, #0c1217 14px 28px);
}
.build-card .body { padding: 1rem 1.1rem 1.15rem; }
.build-card .owner { font-size: 0.8rem; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.build-card h3 { margin: 0.25rem 0 0.5rem; font-size: 1.35rem; }
.spec-line { color: var(--ink-dim); font-size: 0.9rem; margin: 0; }
.follow-count { color: var(--ink-faint); font-size: 0.8rem; margin-top: 0.5rem; }

/* ---------------------------------------------------------------- spec sheet */
.spec-sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.spec-sheet th, .spec-sheet td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--card-edge);
  vertical-align: top;
}
.spec-sheet th {
  color: var(--ink-faint);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  width: 11rem;
  font-weight: 600;
}
.badge-test {
  display: inline-block;
  background: var(--amber); color: #231600;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
  margin-left: 0.6rem; vertical-align: middle;
}
.badge-guest {
  display: inline-block;
  background: transparent; color: var(--amber);
  border: 1px solid var(--amber);
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.1rem 0.45rem;
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
  margin-left: 0.5rem; vertical-align: middle;
}
.badge-legend {
  display: inline-block;
  background: var(--teal); color: #04211c;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
  margin-left: 0.5rem; vertical-align: middle;
}

/* ---------------------------------------------------------------- timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--card-edge), rgba(0, 229, 204, 0.25), var(--card-edge));
}
.timeline li { position: relative; padding: 0 0 1.5rem 2.25rem; }
.timeline li::before {
  content: ""; position: absolute; left: 3px; top: 5px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--teal);
  box-shadow: 0 0 8px rgba(0, 229, 204, 0.4);
}
.timeline .mod-date { color: var(--ink-faint); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.timeline .mod-part { font-weight: 700; font-size: 1.05rem; margin: 0.15rem 0; }
.timeline .mod-cost { color: var(--green); font-weight: 600; font-family: var(--font-mono); }
.timeline .mod-notes { color: var(--ink-dim); margin: 0.35rem 0 0; }
.mod-photos { display: flex; gap: 0.5rem; margin-top: 0.6rem; flex-wrap: wrap; }
.mod-photos img {
  width: 120px; height: 90px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--card-edge);
}

/* ---------------------------------------------------------------- gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.gallery figure { margin: 0; }
.gallery img {
  width: 100%; height: 150px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--card-edge);
  display: block;
}
.gallery figcaption { font-size: 0.8rem; color: var(--ink-dim); padding: 0.3rem 0.1rem; }
.empty-note {
  border: 1px dashed var(--card-edge);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  padding: 1.5rem;
  text-align: center;
  color: var(--ink-faint);
}

/* ---------------------------------------------------------------- goals */
.goal-list { list-style: none; margin: 0; padding: 0; }
.goal-list li {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.25rem;
  border-bottom: 1px solid var(--card-edge);
}
.goal-list li.done .goal-text { text-decoration: line-through; color: var(--ink-faint); }
.goal-text { flex: 1; }
.goal-actions { display: flex; gap: 0.4rem; }

/* ---------------------------------------------------------------- leaderboard */
.board { width: 100%; border-collapse: collapse; }
.board th, .board td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--card-edge);
  text-align: left;
}
.board th {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-faint); font-weight: 600;
}
.board td.time { font-size: 1.3rem; letter-spacing: 0.03em; color: var(--teal); }
.board tr.me td { background: rgba(0, 229, 204, 0.07); }
.rank { font-family: var(--font-mono); color: var(--ink-faint); width: 3rem; }

/* ---------------------------------------------------------------- game */
.game-pad {
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  border: 1px solid var(--card-edge);
  min-height: 320px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
  text-align: center;
  padding: 2rem;
  transition: background 0.12s ease;
}
.game-pad .big { font-family: var(--font-display); font-size: clamp(2rem, 8vw, 4rem); text-transform: uppercase; }
.game-pad .sub { color: var(--ink-dim); max-width: 30rem; }
.game-pad[data-state="idle"] { background: var(--card); }
.game-pad[data-state="waiting"] { background: #2a0d08; border-color: var(--red-deep); cursor: wait; }
.game-pad[data-state="waiting"] .big { color: #ff8a80; }
.game-pad[data-state="go"] { background: #0b2a1e; border-color: var(--green); }
.game-pad[data-state="go"] .big { color: #7bf0a4; }
.game-pad[data-state="redlight"] { background: #230503; }
.game-pad[data-state="result"] { background: var(--card); cursor: default; }
.game-result-time { font-size: 4rem; color: var(--teal); }

/* ---------------------------------------------------------------- forms */
form .field { margin-bottom: 1rem; }
label {
  display: block;
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-dim);
  margin-bottom: 0.35rem;
}
input[type="text"], input[type="email"], input[type="number"],
input[type="date"], input[type="file"], textarea, select {
  width: 100%;
  background: #0b1116;
  border: 1px solid var(--card-edge);
  color: var(--ink);
  border-radius: 6px;
  padding: 0.65rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 229, 204, 0.16);
}
textarea { min-height: 5.5rem; resize: vertical; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.hint { font-size: 0.82rem; color: var(--ink-faint); margin-top: 0.3rem; }
.form-error {
  background: rgba(255, 81, 71, 0.1);
  border: 1px solid var(--red);
  color: #ffb3ab;
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.form-ok {
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid var(--green);
  color: #a9e8c3;
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.7rem 1.45rem;
  border: 1px solid transparent;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  cursor: pointer;
  text-decoration: none;
  background: var(--teal);
  color: #04211c;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover {
  background: var(--teal-hi);
  box-shadow: 0 0 16px rgba(0, 229, 204, 0.35);
}
.btn:active { background: var(--teal-deep); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  background: rgba(0, 229, 204, 0.04);
  border: 1px solid var(--card-edge);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--teal);
  background: rgba(0, 229, 204, 0.08);
  color: var(--ink);
  box-shadow: none;
}
.btn-small { padding: 0.45rem 0.9rem; font-size: 0.75rem; }
.btn-danger {
  background: transparent;
  border: 1px solid var(--red-deep);
  color: #ff8a80;
}
.btn-danger:hover { background: rgba(255, 81, 71, 0.14); box-shadow: none; }
.btn-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }

/* ---------------------------------------------------------------- footer */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.25rem 3rem;
  color: var(--ink-dim);
}
.site-footer .motto {
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.site-footer .footer-sub { font-size: 0.85rem; color: var(--ink-faint); margin: 0; }

/* ---------------------------------------------------------------- misc */
.muted { color: var(--ink-dim); }
.small { font-size: 0.85rem; }
.mt { margin-top: 1.5rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.divider-jp {
  text-align: center; color: var(--ink-faint);
  letter-spacing: 0.6em; margin: 2.5rem 0;
  font-size: 0.9rem;
}
.notice {
  background: var(--bg-soft);
  border: 1px solid var(--card-edge);
  border-left: 4px solid var(--amber);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
}
.notice strong { color: var(--amber); }

@media (max-width: 640px) {
  .site-header { flex-wrap: wrap; gap: 0.75rem; }
  .main-nav { margin-left: 0; order: 3; width: 100%; }
  .main-nav a { padding: 0.45rem 0.55rem; font-size: 0.78rem; }
  .view { padding: 1.5rem 1rem 2.5rem; }
}

/* ---------------------------------------------------------------- engagement (migration 2) */
.bell {
  position: relative;
  display: inline-flex; align-items: center;
  color: var(--ink-dim); text-decoration: none;
  padding: 0.4rem; border-radius: 6px;
}
.bell:hover { color: var(--teal); background: var(--bg-soft); }
.bell-badge {
  position: absolute; top: 0; right: 0;
  background: var(--teal); color: #04211c;
  font-size: 0.65rem; font-weight: 700;
  min-width: 1.1rem; height: 1.1rem; line-height: 1.1rem;
  border-radius: 999px; text-align: center; padding: 0 0.2rem;
}

.like-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: transparent; border: 1px solid var(--card-edge);
  color: var(--ink-dim); border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer; font-family: var(--font-body);
}
.like-btn:hover { border-color: var(--teal); color: var(--ink); }
.like-btn .heart { color: var(--ink-faint); font-size: 0.95rem; line-height: 1; }
.like-btn.liked { border-color: var(--red); color: #fff; background: rgba(255, 81, 71, 0.14); }
.like-btn.liked .heart { color: var(--red); }
.like-btn:disabled { opacity: 0.5; cursor: wait; }
.like-small { font-size: 0.75rem; padding: 0.2rem 0.55rem; }
.card-actions { margin-top: 0.6rem; display: flex; gap: 0.5rem; }
.mod-actions { margin-top: 0.6rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.comment-toggle:disabled { opacity: 0.5; cursor: wait; }

.spotlight {
  background: linear-gradient(135deg, #0d1d1a, var(--card));
  border: 1px solid var(--teal-deep);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
}
.spotlight .kicker {
  color: var(--teal); font-weight: 700; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.18em;
  margin-bottom: 0.25rem;
}
.spotlight-title {
  font-family: var(--font-display);
  font-size: 1.6rem; text-transform: uppercase; letter-spacing: 0.04em;
  line-height: 1.1;
}
.spotlight-title a { color: var(--ink); text-decoration: none; }
.spotlight-title a:hover { color: var(--teal); }

.badge-champ {
  display: inline-block;
  background: var(--amber); color: #231600;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
  margin-left: 0.5rem; vertical-align: middle;
}

.season-bar {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.season-bar label { margin: 0; }
.season-bar select { width: auto; min-width: 14rem; }

.notif-list { display: flex; flex-direction: column; gap: 0.75rem; }
.notif {
  background: var(--card); border: 1px solid var(--card-edge);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  padding: 1rem 1.25rem;
}
.notif.unread { border-left: 4px solid var(--teal); }
.notif-title { font-weight: 700; }
.notif-body { color: var(--ink-dim); margin: 0.25rem 0 0; }
.notif-time { margin-top: 0.35rem; }

.comments { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }
.comment {
  background: var(--bg-soft); border: 1px solid var(--card-edge);
  border-radius: 8px; padding: 0.75rem 1rem;
}
.comment-head {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.25rem; font-size: 0.85rem;
}
.comment-head .link-del {
  margin-left: auto; background: none; border: none;
  color: var(--ink-faint); font-size: 0.75rem;
  cursor: pointer; text-decoration: underline; padding: 0;
}
.comment-head .link-del:hover { color: var(--red); }
.comment p { margin: 0; }
.comment-form textarea { min-height: 3.5rem; }
.mod-comments { margin-top: 0.75rem; }

/* ==========================================================================
   HUD DASH — live digital dash component (rendered by js/hud.js).
   Sibling-agent contract: mount with RH.hud.renderDash(containerEl, car).
   Classes below are the public surface of the component.
   ========================================================================== */
.hud-dash {
  position: relative;
  background: linear-gradient(160deg, #101922 0%, #0a0e12 72%);
  border: 1px solid var(--card-edge);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  padding: 1.5rem 1.6rem;
  margin: 1.5rem 0;
}
.hud-dash::before {
  content: "";
  position: absolute;
  top: 0; left: 14px; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--teal), rgba(0, 229, 204, 0));
  opacity: 0.7;
  pointer-events: none;
}
.hud-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1.5rem; flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.hud-kicker {
  color: var(--teal);
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.24em;
  margin-bottom: 0.3rem;
}
.hud-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.3rem);
  text-transform: uppercase; letter-spacing: 0.03em;
  margin: 0;
  line-height: 1.05;
}
.hud-title .hud-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-dim);
  margin-top: 0.25rem;
}
.hud-stage { text-align: right; }
.hud-stage-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  color: var(--amber);
  text-shadow: 0 0 14px rgba(255, 179, 0, 0.35);
}
.hud-meter-label {
  font-size: 0.7rem; color: var(--ink-dim);
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-top: 0.4rem;
}

/* Segmented NFS-style bars (stage meter + stat bars). */
.hud-segs { display: flex; gap: 4px; margin-top: 0.5rem; }
.hud-seg {
  flex: 1 1 0;
  height: 14px;
  background: #1a242c;
  transform: skewX(-14deg);
  min-width: 0;
}
.hud-meter .hud-seg { flex: none; width: 24px; height: 16px; }
.hud-seg.on {
  background: var(--teal);
  box-shadow: 0 0 8px rgba(0, 229, 204, 0.45);
}
.hud-seg.on.hot {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(255, 179, 0, 0.45);
}

.hud-car { margin: 0.5rem 0 0.25rem; }
.hud-car svg { width: 100%; height: auto; display: block; }

.hud-readouts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin: 1.1rem 0 0.25rem;
}
.hud-ro {
  background: rgba(0, 229, 204, 0.045);
  border: 1px solid var(--card-edge);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  padding: 0.65rem 0.9rem 0.7rem;
}
.hud-ro-label {
  display: block;
  font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.15rem;
}
.hud-ro-value {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.1;
}
.hud-ro-value small {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--teal);
  margin-left: 0.3rem;
}

.hud-stats { display: grid; gap: 0.55rem; margin: 1.1rem 0 0.25rem; }
.hud-stat {
  display: grid;
  grid-template-columns: 8.5rem 1fr 2.6rem;
  align-items: center;
  gap: 0.75rem;
}
.hud-stat .hud-segs { margin-top: 0; }
.hud-stat-label {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-dim);
}
.hud-stat-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--teal);
  text-align: right;
  font-size: 0.95rem;
}

.hud-sim-note {
  font-size: 0.7rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0.9rem 0 0;
}
.hud-actions { margin-top: 1rem; }
.hud-actions .btn-row { margin-top: 0; }

@media (max-width: 560px) {
  .hud-dash { padding: 1.1rem 1.1rem; }
  .hud-head { align-items: flex-start; flex-direction: column; gap: 0.75rem; }
  .hud-stage { text-align: left; }
  .hud-stat { grid-template-columns: 6.5rem 1fr 2.4rem; gap: 0.5rem; }
  .hud-ro-value { font-size: 1.25rem; }
  .hud-meter .hud-seg { width: 19px; }
}

/* Respect users who prefer reduced motion: kill all transitions/animation. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------------------------------------------------------------- QA batch
   2026-09-27: safe-area (notched iPhones, installed standalone PWA) and
   minimum touch targets on coarse pointers. */
/* Safe-area: keep the sticky header clear of the notch/Dynamic Island and
   the footer clear of the home indicator in standalone mode. */
@supports (padding: env(safe-area-inset-top)) {
  .site-header {
    padding-top: calc(0.85rem + env(safe-area-inset-top));
  }
  .site-footer {
    padding-bottom: calc(3rem + env(safe-area-inset-bottom));
  }
}
/* Undersized tap targets: guarantee a 44px minimum on touch devices. */
@media (pointer: coarse) {
  button, .btn, a.btn, input[type="checkbox"], input[type="radio"] {
    min-height: 44px;
  }
  input[type="checkbox"], input[type="radio"] {
    min-width: 24px;
  }
}
