:root {
  --bg: #070b1a;
  --bg2: #0b1126;
  --panel: #0e1430;
  --panel2: #151d42;
  --line: #242f5e;
  --text: #e8ecff;
  --muted: #8a92bd;
  --ink: #070b1a;
  --lime: #c6ff3d;
  --lime-deep: #6f9a10;
  --coral: #ff3b5c;
  --coral-deep: #8f1229;
  --gold: #ffcf3f;
  --gold-deep: #a87b00;
  --cyan: #3ee0ff;
  --pink: #ff5fa2;
  --mom: #b28cff;
  --heat: 0;
  --display: "Bungee", Impact, sans-serif;
  --shade: "Bungee Shade", "Bungee", Impact, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --body: "Chakra Petch", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(110% 60% at 50% 115%, rgba(255, 95, 162, calc(0.05 + var(--heat) * 0.3)) 0%, transparent 70%),
    radial-gradient(80% 50% at 85% -10%, rgba(62, 224, 255, 0.1) 0%, transparent 60%),
    radial-gradient(70% 50% at 0% 0%, rgba(178, 140, 255, 0.1) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  /* tiny star dust */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 38% 62%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 78%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 35%, #cfe 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 88%, #fff 50%, transparent 51%);
  background-size: 420px 420px;
}
body::after {
  /* scanlines */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
}
body.bust { animation: bustFlash 0.7s ease-out; }
body.bust #app { animation: quake 0.5s; }
@keyframes bustFlash { 0% { box-shadow: inset 0 0 0 100vmax rgba(255, 59, 92, 0.28); } 100% { box-shadow: inset 0 0 0 100vmax rgba(255, 59, 92, 0); } }
@keyframes quake {
  10%, 50%, 90% { transform: translate(-6px, 2px); }
  30%, 70% { transform: translate(6px, -3px); }
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
::selection { background: var(--lime); color: var(--ink); }

#app { max-width: 1240px; margin: 0 auto; padding: 16px 16px 28px; }

.eyebrow {
  font-family: var(--mono);
  font-weight: 500;
  line-height: 1.4;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; text-transform: uppercase; }
em { font-style: normal; font-family: var(--mono); font-size: 0.7em; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* ── Buttons & inputs ───────────────────────────────────────────── */
.btn {
  border: 2px solid var(--line);
  background: var(--panel2);
  border-radius: 12px;
  padding: 12px 18px;
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: transform 0.08s, background 0.15s, border-color 0.15s, box-shadow 0.08s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.go { background: var(--lime); border-color: var(--lime); color: var(--ink); box-shadow: 0 5px 0 var(--lime-deep), 0 0 30px rgba(198, 255, 61, 0.25); }
.btn.go:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--lime-deep); }
.btn.small { font-size: 13px; padding: 7px 12px; border-radius: 9px; }
.btn.ghost { background: transparent; }
.link {
  font-family: var(--mono);
  background: none; border: 0; padding: 0;
  color: var(--muted); text-decoration: underline; text-underline-offset: 3px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
}
.link:hover { color: var(--text); }
.icon-btn { background: var(--panel); border: 1.5px solid var(--line); border-radius: 10px; width: 36px; height: 36px; font-size: 16px; }

.field {
  width: 100%;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(62, 224, 255, 0.12); }

/* ── Top bar ────────────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; gap: 16px; padding: 2px 0 14px; }
.brand { font-family: var(--display); font-size: 22px; letter-spacing: 0.02em; }
.brand span { color: var(--lime); }
.topbar .mid { flex: 1; display: flex; gap: 14px; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.round-no { color: var(--text); font-weight: 700; }
.topbar .right { display: flex; align-items: center; gap: 14px; }
@media (max-width: 560px) {
  .room-tag { display: none; }
  .brand { font-size: 18px; }
}

/* ── Home ───────────────────────────────────────────────────────── */
.home { min-height: calc(100svh - 60px); display: grid; align-items: center; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
}
.hero-copy { display: grid; gap: 16px; align-content: start; }
.wordmark {
  font-family: var(--shade);
  font-size: clamp(76px, 12vw, 150px);
  line-height: 0.86;
  margin: 4px 0 4px -0.03em;
  color: var(--text);
}
.wordmark span { color: var(--lime); text-shadow: 0 0 40px rgba(198, 255, 61, 0.35); }
.lede { margin: 0; max-width: 42ch; font-size: 17px; color: #c6cbef; }
.entry { display: grid; gap: 10px; margin-top: 8px; max-width: 460px; padding-top: 20px; border-top: 1px dashed var(--line); }
.lbl { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.field.big { font-size: 20px; padding: 14px 16px; font-weight: 600; }
.entry-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 4px; }
.code-join { display: flex; gap: 8px; }
.field.code { width: 110px; text-align: center; font-family: var(--display); font-size: 18px; letter-spacing: 0.15em; text-transform: uppercase; }
@media (max-width: 480px) {
  .entry-actions { grid-template-columns: 1fr; }
  .field.code { flex: 1; width: auto; }
}

.monitor {
  background: linear-gradient(180deg, #121a3c, #0a0f24);
  border: 2px solid var(--line);
  border-radius: 22px;
  padding: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: rotate(0.6deg);
}
.monitor header, .monitor footer { display: flex; justify-content: space-between; padding: 4px 8px 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.monitor footer { padding: 10px 8px 4px; }
.rec { color: var(--coral); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* ── Stage ──────────────────────────────────────────────────────── */
.stage {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #0b1030;
  border: 2px solid var(--line);
  height: clamp(340px, 62vh, 620px);
  isolation: isolate;
}
.stage.demo { height: clamp(300px, 46vh, 420px); border-radius: 14px; }
.stage canvas { position: absolute; inset: 0; display: block; }
.hud { position: absolute; top: 12px; left: 0; right: 0; text-align: center; pointer-events: none; z-index: 2; }
.hud-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: rgba(232, 236, 255, 0.7); min-height: 16px; }
.mult {
  font-family: var(--mono);
  font-weight: 800;
  font-size: clamp(46px, 8.5vw, 100px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-shadow: 0 0 28px currentColor, 0 4px 0 rgba(0, 0, 0, 0.4);
}
.stage.demo .mult { font-size: clamp(40px, 6vw, 68px); }
.mult.crashed { color: var(--coral) !important; animation: crashIn 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes crashIn { from { transform: scale(1.5) rotate(-3deg); } }
.hud-sub { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: rgba(232, 236, 255, 0.65); margin-top: 6px; min-height: 16px; }
.launchbar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.05); z-index: 2; }
.launchbar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--coral), var(--gold), var(--lime)); box-shadow: 0 0 12px var(--gold); }

.callouts { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 3; }
.callout {
  display: grid;
  justify-items: center;
  color: var(--c);
  animation: callout 1.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  text-shadow: 0 0 30px var(--c), 0 4px 0 rgba(0, 0, 0, 0.5);
  margin-top: 40px;
}
.callout b { font-family: var(--shade); font-weight: 400; font-size: clamp(54px, 10vw, 120px); line-height: 1; }
.callout span { font-family: var(--display); font-size: clamp(16px, 2.6vw, 26px); text-transform: uppercase; letter-spacing: 0.06em; }
@keyframes callout {
  0% { transform: scale(0.3) rotate(-8deg); opacity: 0; }
  18% { transform: scale(1.08) rotate(2deg); opacity: 1; }
  70% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.3) translateY(-30px); opacity: 0; }
}

.floats { position: absolute; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.float { position: absolute; bottom: 0; display: grid; justify-items: center; animation: floatUp 2.4s cubic-bezier(0.3, 0.6, 0.4, 1) forwards; }
.float .e { font-size: 38px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)); }
.float .n { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--c); background: rgba(5, 6, 20, 0.7); padding: 1px 6px; border-radius: 6px; }
@keyframes floatUp {
  0% { transform: translate(0, 20px) scale(0.4); opacity: 0; }
  15% { transform: translate(calc(var(--dx) * 0.2), -40px) scale(1.1); opacity: 1; }
  100% { transform: translate(var(--dx), -300px) scale(0.9); opacity: 0; }
}

/* ── Play layout ────────────────────────────────────────────────── */
.play {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  grid-template-areas: "tape tape" "main side";
  gap: 14px;
  align-items: start;
}
.tape { grid-area: tape; }
.col-main { grid-area: main; display: grid; gap: 14px; }
.col-side { grid-area: side; display: grid; gap: 14px; }
@media (max-width: 960px) {
  .play { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; gap: 10px; }
  .col-main, .col-side { display: contents; }
  .tape, .play .stage, .deck, .reacts, .crew { grid-area: auto; }
  .tape { order: 0; }
  .play .stage { order: 1; height: clamp(250px, 44svh, 440px); }
  .deck { order: 2; }
  .reacts { order: 3; }
  .crew { order: 4; }
}

.tape {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, #000 85%, transparent);
}
.tape .eyebrow { margin-right: 6px; flex: none; }
.chip {
  flex: none;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--panel);
  border: 1.5px solid var(--line);
}
.chip.lo { color: var(--coral); border-color: rgba(255, 59, 92, 0.35); }
.chip.mid { color: var(--lime); border-color: rgba(198, 255, 61, 0.35); }
.chip.hi { color: var(--ink); background: var(--gold); border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 207, 63, 0.5); }
.chip.ghost { color: var(--muted); }
.chip.new { animation: chipIn 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes chipIn { from { transform: scale(0.2); opacity: 0; } }

.deck {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 12px;
  align-content: start;
}
.wallet { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wallet > div { background: var(--bg); border-radius: 10px; padding: 8px 12px; border: 1.5px solid var(--line); min-width: 0; }
.wallet b { display: block; font-family: var(--mono); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet b.up, .up { color: var(--lime); }
.wallet b.down, .down { color: var(--coral); }

.action {
  --bg-a: var(--panel);
  --fg-a: var(--muted);
  --shadow-a: #050815;
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 84px;
  padding: 10px 14px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--bg-a);
  color: var(--fg-a);
  box-shadow: 0 6px 0 var(--shadow-a);
  transition: transform 0.06s, box-shadow 0.06s, background 0.15s;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.action:not(:disabled):active { transform: translateY(5px); box-shadow: 0 1px 0 var(--shadow-a); }
.action:disabled { cursor: default; }
.a-main { font-family: var(--display); font-size: clamp(22px, 2.4vw, 28px); line-height: 1.05; font-variant-numeric: tabular-nums; }
.a-sub { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; opacity: 0.8; min-height: 14px; }
.action.bet { --bg-a: var(--lime); --fg-a: var(--ink); --shadow-a: var(--lime-deep); }
.action.bet.off { --bg-a: var(--panel); --fg-a: var(--coral); --shadow-a: #050815; border-color: rgba(255, 59, 92, 0.4); }
.action.armed { --bg-a: #12193a; --fg-a: var(--lime); border: 2px dashed rgba(198, 255, 61, 0.6); }
.action.cash {
  --bg-a: var(--gold); --fg-a: var(--ink); --shadow-a: var(--gold-deep);
  animation: throb 0.9s ease-in-out infinite;
}
.action.cash .a-main { font-size: clamp(24px, 2.8vw, 32px); }
@keyframes throb { 50% { box-shadow: 0 6px 0 var(--shadow-a), 0 0 34px rgba(255, 207, 63, 0.7); } }
.action.won { --bg-a: rgba(198, 255, 61, 0.1); --fg-a: var(--lime); border-color: var(--lime); }
.action.won.pop { animation: winPop 0.6s cubic-bezier(0.2, 1.8, 0.4, 1); }
@keyframes winPop { from { transform: scale(1.12); box-shadow: 0 0 60px rgba(198, 255, 61, 0.8); } }
.action.lost { --bg-a: rgba(255, 59, 92, 0.12); --fg-a: var(--coral); border-color: var(--coral); }
.action.mom { --bg-a: var(--mom); --fg-a: var(--ink); --shadow-a: #5a3fa8; }
.action.idle .a-main { font-size: 20px; }

.bet-ctrl { display: grid; gap: 10px; transition: opacity 0.2s; }
.bet-ctrl.locked { opacity: 0.45; }
.amount-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.amount { display: flex; align-items: center; background: var(--bg); border: 2px solid var(--line); border-radius: 10px; padding: 0 12px; }
.amount:focus-within { border-color: var(--cyan); }
.amount span { font-family: var(--mono); font-weight: 800; color: var(--muted); }
.amount input { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 10px 6px; font-family: var(--mono); font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.chips button {
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 7px 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
}
.chips button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.chips button:active:not(:disabled) { transform: scale(0.94); }
.auto-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.auto-x { display: flex; align-items: center; background: var(--bg); border: 2px solid var(--line); border-radius: 10px; padding: 0 10px; width: 100px; }
.auto-x:focus-within { border-color: var(--cyan); }
.auto-x input { width: 100%; background: none; border: 0; outline: none; padding: 7px 2px; font-family: var(--mono); font-weight: 700; font-size: 15px; text-align: right; }
.auto-x span { color: var(--muted); font-family: var(--mono); }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span { flex: none; width: 34px; height: 20px; border-radius: 999px; background: var(--bg); border: 1.5px solid var(--line); position: relative; transition: background 0.15s; }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--muted); transition: transform 0.15s, background 0.15s; }
.toggle input:checked + span { background: rgba(198, 255, 61, 0.15); border-color: var(--lime); }
.toggle input:checked + span::after { transform: translateX(14px); background: var(--lime); }
.toggle input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }

.reacts { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; align-self: start; }
.reacts button {
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  width: 46px;
  height: 42px;
  font-size: 22px;
  transition: transform 0.08s;
}
.reacts button:hover { transform: translateY(-2px); border-color: var(--muted); }
.reacts button:active { transform: scale(0.88); }

.crew { background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; align-self: start; }
.crew ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.crew li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto 64px;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 14px;
}
.crew li .dot, .roster .dot, .ledger .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.crew li .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.crew li .st { font-family: var(--mono); font-size: 12px; font-weight: 700; white-space: nowrap; }
.crew li .st i { font-style: normal; font-weight: 500; opacity: 0.65; }
.crew li .st.dim { color: var(--muted); font-weight: 400; }
.crew li .bal { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; }
.crew li.in { background: rgba(255, 255, 255, 0.03); }
.crew li.riding { background: rgba(255, 207, 63, 0.07); }
.crew li.riding .st { color: var(--gold); }
.crew li.won { background: rgba(198, 255, 61, 0.08); }
.crew li.won .st { color: var(--lime); }
.crew li.lost { background: rgba(255, 59, 92, 0.08); }
.crew li.lost .st { color: var(--coral); }
.crew li.gone { opacity: 0.45; }
.loans { font-size: 11px; }

/* ── Banners & toasts ───────────────────────────────────────────── */
.banners { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(460px, calc(100% - 32px)); pointer-events: none; }
.banner {
  display: flex; align-items: center; gap: 12px;
  background: rgba(14, 20, 48, 0.94);
  border: 2px solid var(--c);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 24px color-mix(in srgb, var(--c) 40%, transparent);
  animation: bannerIn 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both, bannerOut 0.35s ease-in 2.2s forwards;
}
.banner .pip { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--c); }
.banner > div { min-width: 0; }
.banner .txt { font-family: var(--display); font-size: 17px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner .sub { font-family: var(--mono); font-size: 11px; opacity: 0.8; margin-top: 3px; }
.banner.mom { border-color: var(--mom); }
@keyframes bannerIn { from { transform: translateY(-30px) scale(0.9); opacity: 0; } }
@keyframes bannerOut { to { transform: translateY(-20px); opacity: 0; } }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(420px, calc(100% - 32px)); }
.toast { background: var(--text); color: var(--ink); padding: 11px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); animation: bannerIn 0.3s both; }
.conn { font-family: var(--mono); position: fixed; top: 12px; right: 12px; z-index: 70; background: var(--coral); color: #fff; padding: 6px 12px; border-radius: 999px; font-size: 11px; letter-spacing: 0.08em; }
.rise { animation: rise 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) both; animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes rise { from { transform: translateY(18px); opacity: 0; } }

/* ── Lobby ──────────────────────────────────────────────────────── */
.lobby { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; padding-bottom: 100px; }
@media (max-width: 860px) { .lobby { grid-template-columns: minmax(0, 1fr); } }
.pad, .flightplan { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 2px solid var(--line); border-radius: 18px; padding: 18px; }
.code-big { display: flex; gap: 8px; margin: 8px 0 14px; }
.code-big span {
  flex: 1;
  display: grid;
  place-items: center;
  aspect-ratio: 0.8;
  max-width: 70px;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 12px;
  font-family: var(--shade);
  font-size: clamp(34px, 6vw, 46px);
  color: var(--lime);
  text-shadow: 0 0 20px rgba(198, 255, 61, 0.4);
}
.code-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.roster-head { margin: 20px 0 8px; }
.roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.roster li { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; background: var(--bg); border-radius: 10px; border-left: 3px solid var(--c); }
.roster li.away { opacity: 0.5; }
.roster .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster .tags { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.kick { background: none; border: 0; color: var(--muted); font-family: var(--mono); font-size: 10px; text-transform: uppercase; text-decoration: underline; padding: 0; }
.kick:hover { color: var(--coral); }
.fp-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.opts { display: grid; gap: 16px; }
.opt { display: grid; gap: 8px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  flex: 1 1 0;
  min-width: 84px;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px 10px;
  font-family: var(--display);
  font-size: 17px;
  display: grid;
  gap: 2px;
  transition: border-color 0.12s, transform 0.08s;
}
.seg button small { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.04em; }
.seg button:hover { border-color: var(--muted); }
.seg button:active { transform: scale(0.97); }
.seg button.sel { border-color: var(--lime); color: var(--lime); background: rgba(198, 255, 61, 0.07); box-shadow: 0 0 18px rgba(198, 255, 61, 0.15); }
.guest-plan { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.guest-plan > div { background: var(--bg); border: 2px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 4px; }
.guest-plan b { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--lime); }
@media (max-width: 560px) { .guest-plan { grid-template-columns: 1fr 1fr; } }
.guest-note { color: var(--muted); margin: 12px 0 0; }
.rules { margin: 22px 0 0; padding: 18px 0 0 22px; border-top: 1px dashed var(--line); display: grid; gap: 8px; color: #c6cbef; }
.rules b { color: var(--text); font-family: var(--display); font-weight: 400; font-size: 13px; letter-spacing: 0.04em; margin-right: 4px; }
.rules li::marker { font-family: var(--mono); color: var(--lime); }
.start-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: linear-gradient(180deg, transparent, rgba(7, 11, 26, 0.95) 30%); padding: 24px 16px calc(16px + env(safe-area-inset-bottom)); }
.start-bar .inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.start-bar .wait { color: var(--muted); }
.start-bar .wait b { color: var(--text); }
.start-bar .btn { font-size: 20px; padding: 14px 24px; }

/* ── Results ────────────────────────────────────────────────────── */
.results { display: grid; gap: 22px; }
.results-head { text-align: center; }
.final { font-family: var(--shade); font-size: clamp(44px, 8vw, 92px); line-height: 1; margin-top: 6px; color: var(--gold); text-shadow: 0 0 40px rgba(255, 207, 63, 0.3); }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; min-height: 260px; }
.step { width: min(200px, 30vw); display: grid; justify-items: center; gap: 4px; }
.step .who { font-family: var(--display); font-size: clamp(14px, 2.2vw, 20px); text-align: center; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.step .amt { font-family: var(--mono); font-weight: 800; font-size: clamp(14px, 2vw, 20px); }
.step .block {
  width: 100%;
  display: grid;
  place-items: start center;
  padding-top: 12px;
  border-radius: 14px 14px 4px 4px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 80%, #fff 0%), color-mix(in srgb, var(--c) 35%, var(--bg)));
  box-shadow: 0 0 40px color-mix(in srgb, var(--c) 35%, transparent);
  animation: grow 0.8s cubic-bezier(0.2, 1.2, 0.4, 1) both;
  animation-delay: calc(var(--i) * 150ms + 200ms);
  transform-origin: bottom;
}
.step .block span { font-family: var(--shade); font-size: 44px; color: var(--ink); opacity: 0.85; }
.step.p1 .block { height: 170px; }
.step.p2 .block { height: 120px; }
.step.p3 .block { height: 86px; }
@keyframes grow { from { transform: scaleY(0); } }
.results-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .board { grid-template-columns: minmax(0, 1fr); } }
.ledger { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ledger li {
  display: grid;
  grid-template-columns: 22px 10px minmax(0, 1fr);
  grid-template-areas: "rk dot nm" "nums nums nums";
  gap: 6px 10px;
  align-items: center;
  background: var(--panel);
  border: 2px solid var(--line);
  border-left: 4px solid var(--c);
  border-radius: 12px;
  padding: 10px 12px;
}
.ledger .rk { grid-area: rk; font-family: var(--display); color: var(--muted); }
.ledger .dot { grid-area: dot; }
.ledger .nm { grid-area: nm; min-width: 0; }
.ledger .nm b { font-size: 16px; }
.aw { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.aw span { font-family: var(--mono); font-size: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.nums { grid-area: nums; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.nums span { display: grid; background: var(--bg); border-radius: 8px; padding: 4px 8px; }
.nums i { font-style: normal; font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.nums b { font-family: var(--mono); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-box { background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 8px; align-content: start; }
.chart { height: 300px; position: relative; }
.chart canvas { position: absolute; inset: 0; }

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