:root {
  --ink: #0b0f14;
  --panel: #121821;
  --tile: #1a2330;
  --blue: #2a6cf0;
  --blue2: #4d8aff;
  --mint: #3dffe8;
  --gold: #f0c14a;
  --cream: #f2f5f8;
  --mute: #8a97a8;
  --line: #2a3544;
  --safe: env(safe-area-inset-bottom, 0px);
  --top: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%;
  height: 100svh;
  overflow: hidden;
}
body {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  background: var(--ink);
  color: var(--cream);
}
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.off, [hidden] { display: none !important; }
.pane.off, .pane[hidden] { display: none !important; }

#wire {
  height: 100%;
  height: 100svh;
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(48% 26% at 92% -4%, rgba(42, 108, 240, 0.28), transparent 55%),
    radial-gradient(42% 22% at 4% 8%, rgba(61, 255, 232, 0.08), transparent 50%),
    linear-gradient(180deg, #10151c, var(--ink) 48%);
  padding: var(--top) 0 0;
}
.mast, .slash, .stubs { flex-shrink: 0; }
.mast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 6px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.brand em { display: block; font-size: 10px; color: var(--mint); font-style: normal; letter-spacing: 0.02em; }
.brand strong { display: block; font-size: 17px; color: var(--cream); line-height: 1.15; font-weight: 700; }
.chip-lamp {
  min-width: 62px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  color: var(--gold);
  font-size: 13px;
}
.chip-lamp img { width: 18px; height: 18px; }
.slash {
  height: 2px;
  margin: 4px 20px 10px;
  background: linear-gradient(90deg, var(--blue), var(--mint), transparent);
  border-radius: 2px;
}

/* Unique: overlapping ticket stubs, not equal tabs */
.stubs {
  display: flex;
  align-items: flex-end;
  gap: 0;
  padding: 0 12px 12px;
  overflow-x: auto;
}
.stubs button {
  flex: 0 0 auto;
  border: 0;
  cursor: pointer;
  min-width: 68px;
  height: 38px;
  padding: 0 14px;
  margin-left: -6px;
  background: var(--tile);
  color: var(--mute);
  font-size: 11px;
  font-weight: 600;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  transform: skewX(-8deg);
}
.stubs button:first-child { margin-left: 0; }
.stubs button:nth-child(2) { height: 44px; }
.stubs button:nth-child(3) { height: 36px; }
.stubs button:nth-child(4) { height: 42px; }
.stubs button:last-child { height: 40px; }
.stubs button.on {
  background: linear-gradient(135deg, var(--blue), #1a4fc4);
  color: #fff;
  z-index: 2;
}

#scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 16px calc(22px + var(--safe));
}
.eyebrow {
  font-size: 11px;
  color: var(--mint);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}
h1 { font-size: 24px; line-height: 1.15; margin-bottom: 8px; font-weight: 750; }
.lede { color: var(--mute); font-size: 14px; line-height: 1.45; margin-bottom: 14px; }
.tallyline, .chime { color: var(--gold); font-size: 13px; margin: 8px 0 10px; min-height: 1.2em; }
.fig { width: 48%; margin: 6px auto 12px; }
.fig.slim { width: 32%; }

.slates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.slate-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 4px 16px 4px 16px;
  padding: 12px 10px;
  cursor: pointer;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.slate-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--mint));
}
.slate-card img { width: 48px; height: 48px; margin: 4px auto 8px; }
.slate-card small { display: block; color: var(--mint); font-size: 10px; }
.slate-card b { display: block; font-size: 14px; margin: 2px 0; }
.slate-card em { display: block; color: var(--mute); font-style: normal; font-size: 11px; }

.cabinet {
  background: linear-gradient(180deg, #1c2736, var(--panel));
  border: 2px solid var(--blue);
  border-radius: 8px;
  padding: 10px 8px;
  margin: 8px 0 12px;
  --cell: 56px;
  box-shadow: 0 0 0 1px rgba(61, 255, 232, 0.15);
}
.cabinet.live {
  box-shadow: 0 0 0 2px rgba(42, 108, 240, 0.55), 0 0 28px rgba(42, 108, 240, 0.28);
}
.tracks {
  --cell: 56px;
  display: grid;
  gap: 4px;
  align-items: stretch;
  position: relative;
}
.tracks[data-n="2"] { grid-template-columns: repeat(2, 1fr); }
.tracks[data-n="3"] { grid-template-columns: repeat(3, 1fr); }
.tracks[data-n="4"] { grid-template-columns: repeat(4, 1fr); --cell: 54px; }
.tracks[data-n="5"] { grid-template-columns: repeat(5, 1fr); --cell: 50px; }
.tracks[data-n="6"] { grid-template-columns: repeat(6, 1fr); --cell: 46px; }
#tracks::before {
  content: "";
  position: absolute;
  left: 1px; right: 1px;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: linear-gradient(90deg, transparent, rgba(61, 255, 232, 0.75), transparent);
  pointer-events: none;
  z-index: 4;
}
.track {
  background: #06090e;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  height: calc(var(--cell) * 3);
  box-shadow: inset 0 0 0 1px #1e2836;
}
.track.landed { animation: land-thump 0.22s ease-out; }
@keyframes land-thump {
  0% { transform: translateY(0); }
  35% { transform: translateY(3px); }
  100% { transform: translateY(0); }
}
.reel-window {
  height: 100%;
  overflow: hidden;
  position: relative;
}
.reel-window::before,
.reel-window::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 18%;
  z-index: 2;
  pointer-events: none;
}
.reel-window::before {
  top: 0;
  background: linear-gradient(180deg, #06090e 10%, transparent);
}
.reel-window::after {
  bottom: 0;
  background: linear-gradient(0deg, #06090e 10%, transparent);
}
.reel-strip {
  will-change: transform;
  backface-visibility: hidden;
}
.reel-strip.whirl .cell img {
  transform: scaleY(1.28);
  opacity: 0.88;
}
.cell {
  height: var(--cell);
  min-height: var(--cell);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #1a2330;
}
.cell:last-child { border-bottom: 0; }
.cell.mid { background: rgba(42, 108, 240, 0.1); }
.cell.hit {
  background: rgba(61, 255, 232, 0.18);
  box-shadow: inset 0 0 0 2px var(--mint);
  animation: hit-glow 0.7s ease-out;
}
@keyframes hit-glow {
  0% { transform: scale(0.92); }
  55% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.cell img { width: 78%; height: 78%; object-fit: contain; }
.tracks.frozen { pointer-events: none; margin: 10px 0; }
.tracks.frozen::before { display: none; }

.console {
  display: grid;
  grid-template-columns: 48px 1fr 48px 1.4fr;
  gap: 8px;
  align-items: center;
  margin: 8px 0 12px;
}
.stake { text-align: center; }
.stake small { display: block; color: var(--mute); font-size: 10px; }
.stake b { color: var(--gold); font-size: 18px; }
.pull {
  border: 0;
  background: linear-gradient(135deg, var(--blue), #1a4fc4);
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
  height: 48px;
  cursor: pointer;
}
.pull:disabled { opacity: 0.5; cursor: default; }

.seal, .ghost {
  border: 0;
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 8px;
  width: 100%;
  margin-top: 6px;
}
.seal {
  background: linear-gradient(135deg, var(--blue), #1a4fc4);
  color: #fff;
  font-weight: 700;
}
.ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--line);
}
.ghost.slim { width: auto; margin-top: 0; height: 44px; padding: 0 12px; }
.slate {
  background: var(--panel);
  border: 1px dashed var(--blue);
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0;
}
.tally {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.tally div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
}
.tally small { display: block; color: var(--mute); font-size: 10px; }
.tally b { display: block; font-size: 15px; margin-top: 2px; color: var(--gold); }
.hollow {
  color: var(--mute);
  text-align: center;
  padding: 28px 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}
.house { margin: 0 0 16px 18px; color: var(--mute); }
.house li { margin: 6px 0; }

.shot {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
}
.shot small { display: block; color: var(--mint); font-size: 11px; }
.shot b { display: block; margin: 2px 0; }
.shot em { display: block; color: var(--mute); font-style: italic; font-size: 13px; }
.minirow {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.minirow img { width: 28px; height: 28px; }
