:root {
  --bg: #140a22;
  --bg-2: #24143a;
  --card: #2a1648;
  --ink: #f4f1ea;
  --muted: #c9bfd4;
  --pink: #ff4f9a;
  --crimson: #e31b3c;
  --silver: #d5dbe8;
  --gold: #ffd84a;
  --gold-ink: #24143a;
  --line: rgba(255, 79, 154, 0.32);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(120% 40% at 50% -10%, rgba(255, 79, 154, 0.18), transparent 55%),
    var(--bg);
}
.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px 4px;
  min-height: 52px;
}
.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}
.brand-name { display: flex; flex-direction: column; line-height: 0.86; min-width: 0; }
.brand-name strong {
  font-family: Impact, "Arial Black", sans-serif;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.06em;
}
.brand-name em {
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-style: normal;
  color: var(--pink);
  font-size: 22px;
  margin-top: -2px;
}
.sound {
  flex: 0 0 auto;
  border: 1px solid rgba(213, 219, 232, 0.45);
  background: rgba(20, 10, 34, 0.4);
  border-radius: 999px;
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
}
#rail {
  position: relative;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 10px 8px;
  scrollbar-width: none;
  max-width: 100%;
}
#rail::-webkit-scrollbar { display: none; }
#rail:before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 36px;
  border-top: 2px dashed rgba(213, 219, 232, 0.4);
  pointer-events: none;
}
.dial {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 74px;
  border: 0;
  background: none;
  color: var(--muted);
  padding: 0;
  text-align: center;
}
.dial .orb {
  width: 58px;
  height: 58px;
  margin: 0 auto 4px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #4a2d68;
  background: #1a1028;
  display: block;
}
.dial .orb img { width: 100%; height: 100%; object-fit: cover; }
.dial span:last-child {
  display: block;
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.dial.on { color: var(--ink); }
.dial.on .orb {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(255, 79, 154, 0.75);
}
#view {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}
#view::-webkit-scrollbar { display: none; }
#view.play {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 6px 12px 28px;
}
.kicker {
  margin: 0 0 4px;
  color: var(--pink);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
h2, h3, p { overflow-wrap: anywhere; }
.hero {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #1a1028;
}
.hero-photo {
  width: 100%;
  height: clamp(300px, 78vw, 460px);
  object-fit: cover;
  object-position: center 45%;
}
.hero-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 48px 14px 14px;
  background: linear-gradient(180deg, rgba(20, 10, 34, 0) 0%, rgba(20, 10, 34, 0.94) 48%);
}
.hero-copy h2 {
  margin: 0;
  font-family: Impact, "Arial Black", sans-serif;
  font-weight: 400;
  font-size: clamp(46px, 13vw, 78px);
  line-height: 0.82;
  letter-spacing: 0.02em;
}
.hero-copy h2 em {
  display: block;
  margin-top: -2px;
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-style: normal;
  font-size: 0.78em;
  color: var(--pink);
  letter-spacing: 0;
}
.hero-copy p { margin: 8px 0 0; font-size: 14px; line-height: 1.35; max-width: 38em; }
.gold, .ghost, .pad {
  border-radius: 999px;
  min-height: 46px;
  padding: 10px 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.gold {
  border: 0;
  background: var(--gold);
  color: var(--gold-ink);
}
.ghost {
  border: 1px solid rgba(213, 219, 232, 0.5);
  background: transparent;
  color: var(--ink);
}
.gold:active, .ghost:active, .pad:active { transform: translateY(1px); }
.hero-copy .gold { margin-top: 12px; }
.block {
  margin: 18px 0 8px;
  font-family: Impact, "Arial Black", sans-serif;
  font-weight: 400;
  letter-spacing: 0.04em;
  font-size: clamp(26px, 6vw, 34px);
}
.row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.row::-webkit-scrollbar { display: none; }
.tile, .panel {
  background: linear-gradient(180deg, #321a52 0%, #1a0e30 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: inset 3px 0 0 var(--crimson);
  overflow: hidden;
}
.tile {
  flex: 0 0 176px;
  width: 176px;
  max-width: 70vw;
}
.tile img, .panel img.wide {
  width: 100%;
  height: 112px;
  object-fit: cover;
}
.tile div, .pad-copy { padding: 10px 10px 12px; }
.tile h3, .panel h3 { margin: 0 0 4px; font-size: 16px; }
.tile p, .panel p, .note p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.tile .gold, .panel .gold, .panel .ghost { margin-top: 10px; width: 100%; }
.stack { display: grid; gap: 10px; }
.step {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(213, 219, 232, 0.16);
}
.step b {
  display: block;
  margin-bottom: 4px;
  color: var(--silver);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.trialbar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  max-width: 100%;
  padding: 4px;
  border-radius: 999px;
  background: #120816;
  border: 1px solid rgba(213, 219, 232, 0.28);
  scrollbar-width: none;
}
.trialbar::-webkit-scrollbar { display: none; }
.trialbar button {
  flex: 1 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  min-height: 40px;
  padding: 6px 10px;
  font-size: clamp(11px, 2.8vw, 13px);
  white-space: nowrap;
}
.trialbar button.on { background: var(--gold); color: var(--gold-ink); font-weight: 800; }
.lead, .muted { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.road {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 0;
  margin-bottom: 10px;
}
.road img { width: 108px; height: 100%; min-height: 108px; object-fit: cover; }
.road .pad-copy { min-width: 0; }
.road h3 { margin: 0 0 4px; font-size: 17px; }
.meta { margin: 6px 0 0; color: var(--silver); font-size: 12px; letter-spacing: 0.04em; }
.lock { color: var(--pink); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  padding: 0;
}
.swatch.on { box-shadow: 0 0 0 2px var(--gold); }
.swatch[disabled] { opacity: 0.35; }
.car-card img { width: 100%; height: 160px; object-fit: cover; }
.car-card.on { outline: 2px solid var(--gold); }
.locked img { filter: grayscale(1) brightness(0.55); }
.bars { display: grid; gap: 8px; margin-top: 8px; }
.bars div {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.bars i { display: block; height: 100%; background: linear-gradient(90deg, var(--silver), var(--pink)); }
.note { margin-bottom: 10px; }
.note h3 { margin: 0 0 6px; font-size: 18px; }
.split-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.split-actions .gold, .split-actions .ghost { flex: 1 1 120px; }
.stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 8px 8px;
}
.frame {
  position: relative;
  flex: 1;
  min-height: 140px;
  border-radius: 18px;
  overflow: hidden;
  background: #120814;
  border: 1px solid var(--line);
}
.frame canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.hud {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  z-index: 2;
  display: grid;
  gap: 4px;
  pointer-events: none;
}
.hud-row, .hud-actions { display: flex; align-items: center; gap: 8px; }
.hud-row { justify-content: space-between; }
.hud b { font-size: 16px; text-shadow: 0 1px 2px #000; }
.hud-name {
  flex: 1;
  min-width: 0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--silver);
  text-shadow: 0 1px 2px #000;
}
.combo {
  min-height: 26px;
  text-align: center;
  font-family: "Segoe Script", "Brush Script MT", cursive;
  color: var(--pink);
  font-size: 28px;
  line-height: 1;
  text-shadow: 0 2px 0 #000;
}
.meter {
  height: 8px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.meter i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--silver), var(--pink));
}
.hud-actions { pointer-events: auto; }
.hud-actions button {
  border: 1px solid rgba(213, 219, 232, 0.45);
  background: rgba(16, 8, 28, 0.72);
  color: var(--ink);
  border-radius: 999px;
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
}
.pads {
  display: grid;
  grid-template-columns: 1fr 0.78fr 1fr;
  gap: 8px;
  height: 74px;
}
.pad {
  border: 0;
  background: #2a1848;
  color: #fff;
  min-width: 0;
  touch-action: none;
  display: grid;
  place-items: center;
}
.pad.hot { background: var(--gold); color: var(--gold-ink); }
.pad:disabled { opacity: 0.45; }
.chev {
  width: 16px;
  height: 16px;
  border-left: 4px solid currentColor;
  border-bottom: 4px solid currentColor;
  display: block;
}
.chev.l { transform: rotate(45deg); }
.chev.r { transform: rotate(-135deg); }
.sheet {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  max-height: 52%;
  overflow: auto;
  z-index: 3;
  padding: 12px;
  border-radius: 16px;
  background: rgba(14, 6, 24, 0.94);
  border: 1px solid var(--line);
}
.sheet h3 { margin: 0 0 6px; font-family: Impact, "Arial Black", sans-serif; font-weight: 400; letter-spacing: 0.04em; font-size: 26px; }
.sheet p { margin: 0 0 4px; font-size: 14px; }
.sheet .muted { color: var(--muted); }
.statline { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0; color: var(--silver); font-size: 13px; }
.noscript { padding: 24px; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (min-width: 700px) {
  .stack.three { grid-template-columns: 1fr 1fr 1fr; }
  .stack.two { grid-template-columns: 1fr 1fr; }
  .tile { flex-basis: 220px; width: 220px; }
  .dial { width: 92px; }
  .dial .orb { width: 64px; height: 64px; }
  #rail:before { top: 40px; }
}
@media (max-height: 520px) {
  .appbar { min-height: 40px; padding-top: 4px; }
  .brand-name strong, .brand-name em { font-size: 16px; }
  .dial { width: 58px; }
  .dial .orb { width: 36px; height: 36px; }
  .dial span:last-child { font-size: 10px; }
  #rail:before { top: 24px; }
  .pads { height: 56px; }
  .hero-photo { height: 220px; }
}
@media (max-width: 360px) {
  .road { grid-template-columns: 84px minmax(0, 1fr); }
  .road img { width: 84px; }
  .pads { gap: 6px; height: 68px; }
}
