*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #f97316;
  --win: #22c55e;
  --scatter: #38bdf8;
  --jp: #eab308;
  --cell-h: 3.65rem;
  --cell-gap: 0.3rem;
  --reel-h: calc(var(--cell-h) * 5 + var(--cell-gap) * 4);
  --anim-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(circle at top, #1e293b 0%, var(--bg) 55%);
  color: var(--text);
}

.app {
  max-width: 75rem;
  width: 100%;
  height: 100dvh;
  margin: auto;
  padding: 1.25rem;
  padding-bottom: 5.5rem;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.92);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.inspired-by {
  margin: 0 0 0.15rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
}

header h1 span {
  color: var(--accent);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.info-btn {
  white-space: nowrap;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
  border-radius: 0.5rem;
  padding: 0.65rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #eab308;
  color: #111;
}

.contact-btn:hover {
  filter: brightness(1.08);
}

.stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.info-dialog {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  max-width: min(40rem, calc(100vw - 2rem));
  width: 100%;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.45);
}

.info-dialog::backdrop {
  background: rgba(2, 6, 23, 0.72);
}

.info-panel {
  margin: 0;
  display: flex;
  flex-direction: column;
  max-height: min(85vh, 40rem);
}

.info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.info-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.info-body {
  overflow: auto;
  padding: 0.85rem 1.1rem 0.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}

.info-lead {
  margin: 0 0 0.85rem;
  color: var(--muted);
}

.info-body ul {
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.info-body li strong {
  color: var(--accent);
}

.info-note {
  margin: 1rem 0 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.info-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}

.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.85rem;
  min-width: 7rem;
}

.stat label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.stat strong {
  font-size: 1.1rem;
}

.mc-panel {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
}

.mc-header h2 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.mc-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}

.mc-progress-wrap {
  margin-top: 0.75rem;
  height: 0.45rem;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.mc-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ea580c, #f97316);
  transition: width 0.15s ease-out;
}

.mc-progress-text,
.mc-status {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.mc-results {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text);
}

.mc-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.mc-metric {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  padding: 0.45rem 0.55rem;
}

.mc-metric label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.mc-metric strong {
  font-size: 0.95rem;
}

.mc-metric-highlight strong {
  color: var(--accent);
}

.mc-breakdown p {
  margin: 0.35rem 0;
  line-height: 1.4;
}

.mc-sub {
  margin-left: 0.75rem !important;
  color: var(--muted);
  font-size: 0.72rem;
}

.mc-tiers {
  margin: 0.25rem 0 0.5rem 1.25rem;
}

.mc-tier {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.68rem;
  color: var(--muted);
  padding: 0.15rem 0;
}

.live-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
}

.live-stats .stat {
  min-width: 6.5rem;
  flex: 1 1 6.5rem;
}

.live-stats .stat-rtp strong {
  color: var(--accent);
}

.layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  grid-template-rows: minmax(0, 1fr);
  gap: 1rem;
}

@media (max-width: 860px) {
  .app {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .layout {
    flex: none;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
}

.game-panel,
.side-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  min-height: 0;
}

.game-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.side-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.side-panel > h2,
.side-panel > .paytable-note,
.side-panel > .paytable-wrap {
  flex-shrink: 0;
}

.mode-banner {
  text-align: center;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
  background: #0f172a;
  border: 1px dashed var(--border);
}

.mode-banner.fs {
  border-color: var(--scatter);
  color: var(--scatter);
}

.grid-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.35rem 0 0.75rem;
  container-type: size;
}

.grid-wrap.dead-active > #grid {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  container-type: size;
}

.grid-wrap.dead-active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.4rem;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: 0.35rem 0.55rem;
}

.grid-wrap.dead-active.dead-showdown {
  grid-template-columns: minmax(0, 1fr);
}

.dead-chrome {
  display: contents;
}

.dead-chrome[hidden] {
  display: none !important;
}

.dead-plaque {
  grid-row: 1;
  min-width: 5.6rem;
  padding: 0.35rem 0.7rem 0.45rem;
  text-align: center;
  color: #f6e7c1;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 220, 150, 0.18), transparent 28%),
    linear-gradient(180deg, #6b4a2a 0%, #3a2414 42%, #2a180e 100%);
  border: 2px solid #1a100a;
  border-radius: 0.35rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 160, 0.35),
    inset 0 -8px 12px rgba(0, 0, 0, 0.35),
    0 4px 0 #140c08;
}

.dead-plaque[data-collect-target="WILD"] { grid-column: 1; justify-self: start; }
.dead-plaque[data-collect-target="PLUS"] { grid-column: 1; justify-self: end; }

.plaque-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #e7c27a;
}

.dead-plaque strong {
  display: block;
  margin-top: 0.05rem;
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 900;
  color: #fff6df;
  text-shadow: 0 2px 0 #1a100a;
}

.dead-plaque strong small {
  margin-left: 0.12rem;
  font-size: 0.85rem;
  color: #e7c27a;
}

.bullet-rack {
  grid-column: 2;
  grid-row: 2;
  align-self: stretch;
  justify-self: center;
  width: 2.7rem;
  min-height: 8rem;
  padding: 0.4rem 0.35rem;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  gap: 0.4rem;
  background:
    linear-gradient(90deg, #4a301c 0%, #2a1a10 18%, #1a120c 50%, #2a1a10 82%, #4a301c 100%);
  border: 3px solid #120c08;
  border-radius: 0.45rem 0.45rem 0.7rem 0.7rem;
  box-shadow:
    inset 0 0 0 2px #6a4a2c,
    inset 8px 0 10px rgba(0, 0, 0, 0.45),
    inset -8px 0 10px rgba(0, 0, 0, 0.45);
}

.bullet-rack[hidden] {
  display: none !important;
}

.bullet {
  display: block;
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  border-radius: 0.7rem 0.7rem 0.25rem 0.25rem;
  background: #120e0c;
  box-shadow: inset 0 0 0 1px #3a2a1c;
  opacity: 0.35;
}

.bullet.loaded {
  opacity: 1;
  background:
    linear-gradient(#f4e27a, #f4e27a) top / 100% 28% no-repeat,
    linear-gradient(180deg, #ffe56a 0%, #f5c400 46%, #c49200 100%);
  box-shadow:
    inset 0 0 0 1px #8a6a10,
    0 0 10px rgba(245, 196, 0, 0.45);
}

.grid-wanted {
  display: grid;
  grid-template-columns: repeat(var(--reels, 5), var(--cell-h));
  grid-template-rows: repeat(var(--rows, 5), var(--cell-h));
  gap: var(--cell-gap);
  padding: 0.75rem;
  background: #0b1220;
  border-radius: 0.65rem;
  border: 2px solid #475569;
}

/* ——— Wanted 5×5 reel stage ——— */
.grid-host {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reels-stage {
  position: relative;
  display: block;
  width: min(100cqw, 100cqh);
  aspect-ratio: 1;
  max-width: 100%;
  max-height: 100%;
  container-type: inline-size;
}

.grid-wrap.dead-active .reels-stage {
  /* Size from the grid cell (#grid), not the full wrap (which includes plaques). */
  width: min(100cqw, 100cqh);
  max-width: 100%;
  max-height: 100%;
}

.reels-frame {
  position: relative;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  --frame-pad: 2.8cqi;
  --cell-gap: 1.15cqi;
  --cell-h: calc((100cqi - 2 * var(--frame-pad) - 4px - 4 * var(--cell-gap)) / 5);
  --reel-h: calc(var(--cell-h) * 5 + var(--cell-gap) * 4);
  padding: var(--frame-pad);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(249, 115, 22, 0.12), transparent 55%),
    #0b1220;
  border-radius: 0.65rem;
  border: 2px solid #a16207;
  box-shadow:
    0 0 0 1px rgba(234, 179, 8, 0.25),
    inset 0 0 24px rgba(0, 0, 0, 0.45);
}

.grid-reels {
  display: flex;
  flex-direction: row;
  gap: var(--cell-gap);
  position: relative;
  z-index: 1;
}

.reel-col {
  position: relative;
  width: var(--cell-h);
  height: var(--reel-h);
  overflow: hidden;
  border-radius: 0.35rem;
  background: #070b14;
}

.reel-col.spinning {
  box-shadow: inset 0 0 12px rgba(249, 115, 22, 0.25);
}

.reel-strip {
  display: flex;
  flex-direction: column;
  gap: var(--cell-gap);
  will-change: transform;
}

.reel-strip .symbol-tile {
  position: relative;
  top: auto;
  left: auto;
  flex: 0 0 var(--cell-h);
  height: var(--cell-h);
  min-height: 0;
  overflow: hidden;
}

.symbol-tile {
  position: absolute;
  left: 0;
  width: 100%;
  height: var(--cell-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 0.45rem;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #1a2438 0%, #111827 100%);
  font-size: 0.72rem;
  line-height: 1.1;
  user-select: none;
  will-change: transform, opacity, top;
  z-index: 1;
}

.symbol-tile .sym {
  font-size: calc(var(--cell-h) * 0.32);
  font-weight: 700;
}

.symbol-tile .name {
  font-size: 0.52rem;
  color: var(--muted);
  margin-top: 0.08rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.symbol-tile.win {
  background: #14532d;
  border-color: var(--win);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
  z-index: 2;
}

.sticky-hold {
  position: absolute;
  inset: var(--frame-pad, 0.75rem);
  width: auto;
  height: auto;
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
}

.sticky-hold[hidden] {
  display: none !important;
}

.sticky-hold .symbol-tile {
  width: var(--cell-h);
  z-index: 6;
}

.symbol-tile.sticky {
  box-shadow: inset 0 0 0 2px #eab308;
  z-index: 3;
}

.symbol-tile.sticky-land {
  animation: sticky-pop 420ms var(--anim-ease);
}

@keyframes sticky-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); box-shadow: inset 0 0 0 2px #fde68a, 0 0 16px rgba(234, 179, 8, 0.55); }
  100% { transform: scale(1); }
}

.symbol-tile.vs-reel,
.symbol-tile.vs-expanding {
  border-color: #f97316;
  background: #431407;
}

.symbol-tile.vs-expanding {
  animation: vs-expand-pulse 380ms var(--anim-ease);
}

@keyframes vs-expand-pulse {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.08); filter: brightness(1.35); }
  100% { transform: scale(1); filter: brightness(1.1); }
}

.vs-expand-layer {
  position: absolute;
  inset: var(--frame-pad, 0.75rem);
  pointer-events: none;
  z-index: 6;
}

.vs-expand-banner {
  position: absolute;
  top: 0;
  left: calc(var(--reel, 0) * (var(--cell-h) + var(--cell-gap)));
  width: var(--cell-h);
  height: var(--reel-h);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.45rem;
  overflow: hidden;
  background:
    #e8d7b8 url("./symbols/vs-expand.png?v=2") center / 100% 100% no-repeat;
  box-shadow: 0 0 0 1px #2a1a10;
  transform: scaleY(0.16);
  transform-origin: center center;
  transition: transform 380ms var(--anim-ease);
}

.vs-expand-banner.grown {
  transform: scaleY(1);
}

.vs-expand-mult {
  font-size: calc(var(--cell-h) * 0.4);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #3a2418;
  text-shadow: 0 1px 0 rgba(255, 248, 235, 0.45);
}

.vs-expand-banner.has-mult .vs-expand-mult {
  animation: vs-mult-pop 360ms var(--anim-ease);
}

@keyframes vs-mult-pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); }
}

.symbol-tile.scatter-pulse {
  animation: scatter-pulse 600ms ease-in-out infinite;
  border-color: var(--scatter);
}

@keyframes scatter-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(56, 189, 248, 0); }
}

.symbol-tile.wild-drop {
  animation: wild-drop 400ms var(--anim-ease);
}

@keyframes wild-drop {
  0% { transform: translateY(-40%) scale(0.7); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.symbol-tile.sym-low .sym { color: #94a3b8; }
.symbol-tile.sym-mid .sym { color: #fbbf24; }
.symbol-tile.sym-high .sym { color: #34d399; }
.symbol-tile.sym-premium .sym { color: #f87171; }
.symbol-tile.sym-wild .sym { color: #fde68a; font-size: 1.35rem; }
.symbol-tile.sym-vs .sym { color: #fdba74; font-size: 1.05rem; letter-spacing: 0.06em; }
.symbol-tile.sym-scatter .sym { color: #38bdf8; }
.symbol-tile.sym-plus {
  background: #064e3b;
  border-color: #34d399;
}
.symbol-tile.sym-plus .sym { color: #4ade80; font-size: 1.4rem; }
.symbol-tile.sym-blank,
.symbol-tile.blank {
  background: #0b1220;
  border-color: #1e293b;
  opacity: 0.55;
}
.symbol-tile.collect-wild {
  background: #422006;
  border-color: #eab308;
}
.symbol-tile.collect-plus {
  background: #064e3b;
  border-color: #34d399;
}

.vs-mult-badge {
  position: absolute;
  top: 0.1rem;
  right: 0.1rem;
  min-width: 1.35rem;
  padding: 0.05rem 0.2rem;
  border-radius: 0.25rem;
  font-size: 0.62rem;
  font-weight: 800;
  color: #111;
  background: #fbbf24;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  z-index: 3;
}

/* Payline SVG overlay */
.payline-svg {
  position: absolute;
  inset: var(--frame-pad, 0.75rem);
  width: auto;
  height: auto;
  pointer-events: none;
  z-index: 7;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.payline-svg.active {
  opacity: 1;
}

.payline-path {
  fill: none;
  stroke: #4ade80;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(74, 222, 128, 0.85));
}

.line-toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--cell-h) * 0.06);
  transform: translateX(-50%);
  z-index: 8;
  padding: calc(var(--cell-h) * 0.07) calc(var(--cell-h) * 0.16);
  border-radius: calc(var(--cell-h) * 0.08);
  background: rgba(6, 78, 59, 0.92);
  border: 2px solid #4ade80;
  color: #ecfdf5;
  font-size: calc(var(--cell-h) * 0.2);
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

/* VS duel overlay */
.vs-duel-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(2, 6, 23, 0.72);
  border-radius: 0.65rem;
  backdrop-filter: blur(2px);
}

.vs-duel-overlay[hidden] {
  display: none !important;
}

.vs-duel-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 5.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.55rem;
  background: linear-gradient(165deg, #7c2d12, #431407);
  border: 2px solid #fb923c;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.35s var(--anim-ease), opacity 0.35s ease, filter 0.35s ease;
}

.vs-duel-label {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: #fdba74;
  font-weight: 700;
}

.vs-duel-mult {
  font-size: 1.75rem;
  font-weight: 900;
  color: #fff7ed;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.vs-duel-vs {
  font-size: 1.25rem;
  font-weight: 900;
  color: #f97316;
  text-shadow: 0 0 12px rgba(249, 115, 22, 0.8);
  animation: vs-clash 0.6s ease-in-out infinite alternate;
}

@keyframes vs-clash {
  from { transform: scale(1); }
  to { transform: scale(1.18); }
}

.vs-duel-card.winner {
  border-color: #4ade80;
  background: linear-gradient(165deg, #14532d, #052e16);
  transform: scale(1.08);
  filter: brightness(1.15);
}

.vs-duel-card.loser {
  opacity: 0.35;
  transform: scale(0.88) translateY(8px);
  filter: grayscale(0.6);
}

.feature-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.65rem;
  padding: 0.45rem 0.55rem;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.feature-hud[hidden] {
  display: none !important;
}

.fh-stat {
  flex: 1 1 4.5rem;
  min-width: 4.2rem;
  padding: 0.3rem 0.45rem;
  border-radius: 0.35rem;
  background: #111827;
  border: 1px solid #334155;
}

.fh-stat label {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.fh-stat strong {
  font-size: 0.95rem;
  color: #fde68a;
}

.grid-wanted .cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.45rem;
  border: 1px solid var(--border);
  background: #111827;
  font-size: 1rem;
  font-weight: 700;
  user-select: none;
  transition: background 0.2s, box-shadow 0.2s, transform 0.25s var(--anim-ease);
}

.grid-wanted .cell.win {
  background: #14532d;
  border-color: var(--win);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

.grid-wanted .cell.sticky {
  box-shadow: inset 0 0 0 2px #eab308;
}

.grid-wanted .cell.vs-reel,
.grid-wanted .cell.vs-expanding {
  border-color: #f97316;
  background: #431407;
}

.grid-wanted .cell.sym-wild { color: #fde68a; }
.grid-wanted .cell.sym-vs { color: #fb923c; }
.grid-wanted .cell.sym-scatter { color: #38bdf8; }
.grid-wanted .cell.sym-premium { color: #f87171; }
.grid-wanted .cell.sym-plus { color: #4ade80; }
.grid-wanted .cell.sym-blank { color: #64748b; }
.grid-wanted .cell.collect-wild { background: #422006; border-color: #eab308; }
.grid-wanted .cell.collect-plus { background: #064e3b; border-color: #34d399; }
.grid-wanted .cell.collect-blank { opacity: 0.45; }

.feature-panel {
  margin: 0 0 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.45rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid var(--scatter);
  color: var(--scatter);
  font-size: 0.85rem;
  font-weight: 600;
}

.buy-duel-btn {
  background: linear-gradient(135deg, #6b3fa0, #9b5de5);
}

.buy-dead-btn {
  background: linear-gradient(135deg, #7f1d1d, #dc2626);
}

/* Legacy JB grid helpers kept for non-Wanted leftovers; Wanted uses .reels-frame */
.grid:not(.grid-reels) {
  display: flex;
  flex-direction: row;
  gap: var(--cell-gap);
  padding: 0.75rem;
  background: #0b1220;
  border-radius: 0.65rem;
  border: 2px solid #475569;
}

.symbol-tile .sym {
  font-size: calc(var(--cell-h) * 0.32);
  font-weight: 700;
}

.symbol-tile .sym-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.symbol-tile.has-image {
  background: linear-gradient(180deg, #1a2438 0%, #111827 100%);
  padding: 0;
  overflow: hidden;
}

.symbol-tile[data-sym="SKULL"] {
  overflow: hidden;
  padding: 0;
}

.symbol-tile[data-sym="SKULL"] .sym-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.symbol-tile.has-image .name {
  display: none;
}

.symbol-tile .name {
  font-size: 0.58rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.symbol-tile .idx {
  position: absolute;
  top: 0.15rem;
  left: 0.25rem;
  font-size: 0.5rem;
  color: #64748b;
}

.symbol-tile.win {
  background: #14532d;
  border-color: var(--win);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
  z-index: 2;
}

.symbol-tile.scatter {
  border-color: var(--scatter);
}

.symbol-tile.special {
  border-color: var(--jp);
  background: #422006;
}

.symbol-tile.prize {
  border-color: #34d399;
  background: #064e3b;
}

.symbol-tile.blank {
  background: #0b1220;
  border-color: #1e293b;
}

.symbol-tile .prize-val {
  position: absolute;
  bottom: 0.08rem;
  font-size: 0.55rem;
  font-weight: 700;
  color: #fde68a;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.symbol-tile .jp-step {
  position: absolute;
  top: 0.08rem;
  right: 0.1rem;
  min-width: 1.15rem;
  padding: 0.04rem 0.18rem;
  border-radius: 0.25rem;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.15;
  color: #111;
  background: #fbbf24;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  z-index: 3;
}

.mode-banner.money {
  border-color: #34d399;
  color: #6ee7b7;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

button {
  border: none;
  border-radius: 0.5rem;
  padding: 0.65rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #111;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.secondary {
  background: #334155;
  color: var(--text);
}

.buy-btn {
  background: linear-gradient(135deg, #c9a227, #e8c547);
  color: #1a1205;
  min-width: 9.5rem;
}

.buy-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.ante-btn {
  background: linear-gradient(135deg, #1d4e6b, #2a7a9b);
  color: #e8f6fc;
  min-width: 8.5rem;
}

.ante-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.ante-btn.ante-on {
  outline: 2px solid #7dd3fc;
  outline-offset: 2px;
  filter: brightness(1.12);
}

.buy-super-btn {
  background: linear-gradient(135deg, #6b3fa0, #9b5de5);
  color: #f8f0ff;
  min-width: 10rem;
}

.bet-control {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bet-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-right: 0.15rem;
}

.speed-control,
.autoplay-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 12rem;
}

.speed-control label,
.autoplay-control label {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.speed-control input[type="range"],
.autoplay-control input[type="range"] {
  flex: 1;
  min-width: 5rem;
  accent-color: var(--accent);
}

#anim-speed-label,
#autoplay-label {
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 2.75rem;
  text-align: right;
  color: var(--text);
}

.autoplay-control {
  min-width: 16rem;
}

.speed-control {
  min-width: 18rem;
}

#autoplay-btn.active {
  background: #dc2626;
  color: #fff;
}

.bet-control input {
  width: 4.5rem;
  text-align: center;
  padding: 0.45rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border);
  background: #0f172a;
  color: var(--text);
}

.message {
  min-height: 1.5rem;
  text-align: center;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.message.win-text {
  color: var(--win);
  font-weight: 600;
}

.side-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.counters {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.55rem;
  border-radius: 0.4rem;
  background: #0f172a;
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.counter.ready {
  border-color: var(--jp);
  color: #fde68a;
}

.counter.collect-pulse,
.dead-plaque.collect-pulse {
  animation: counter-collect-pulse 420ms var(--anim-ease);
}

@keyframes counter-collect-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.45);
  }
  45% {
    transform: scale(1.04);
    box-shadow: 0 0 0 6px rgba(234, 179, 8, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: none;
  }
}

#collect-fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.win-float {
  --win-u: 16px;
  position: fixed;
  z-index: 10001;
  pointer-events: none;
  transform: translate(-50%, -50%) translateY(14px) scale(0.88);
  opacity: 0;
  transition:
    transform 0.4s var(--anim-ease),
    opacity 0.28s ease-out;
  will-change: transform, opacity;
}

.win-float.show {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(-18px) scale(1);
}

.win-float.hide {
  opacity: 0;
  transform: translate(-50%, -50%) translateY(-42px) scale(1.04);
  transition:
    transform 0.28s ease-in,
    opacity 0.28s ease-in;
}

.win-float-card {
  display: flex;
  align-items: center;
  gap: calc(var(--win-u) * 0.38);
  min-width: calc(var(--win-u) * 6.4);
  padding: calc(var(--win-u) * 0.32) calc(var(--win-u) * 0.55) calc(var(--win-u) * 0.32) calc(var(--win-u) * 0.32);
  border-radius: calc(var(--win-u) * 0.38);
  background:
    linear-gradient(165deg, rgba(20, 83, 45, 0.96) 0%, rgba(6, 28, 16, 0.97) 100%);
  border: 2px solid #4ade80;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 8px 22px rgba(0, 0, 0, 0.55),
    0 0 18px rgba(34, 197, 94, 0.35);
}

.win-float-icon,
.win-float-icon-fallback {
  width: calc(var(--win-u) * 2.35);
  height: calc(var(--win-u) * 2.35);
  flex-shrink: 0;
  border-radius: calc(var(--win-u) * 0.22);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(134, 239, 172, 0.35);
  object-fit: contain;
}

.win-float-icon-fallback {
  display: grid;
  place-items: center;
  font-size: calc(var(--win-u) * 0.95);
  font-weight: 800;
  color: #bbf7d0;
}

.win-float-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: calc(var(--win-u) * 0.06);
  line-height: 1;
}

.win-float-count {
  font-size: calc(var(--win-u) * 0.72);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #bbf7d0;
}

.win-float-amount {
  font-size: calc(var(--win-u) * 1.45);
  font-weight: 800;
  line-height: 1.05;
  color: #f0fdf4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.win-float-mult {
  font-size: calc(var(--win-u) * 0.58);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #86efac;
  margin-top: calc(var(--win-u) * 0.06);
}

.collect-token {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fde68a 0%, #eab308 55%, #a16207 100%);
  border: 2px solid #fef3c7;
  color: #422006;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow:
    0 0 12px rgba(234, 179, 8, 0.55),
    0 4px 10px rgba(0, 0, 0, 0.35);
  will-change: transform, opacity;
  z-index: 10000;
}

.symbol-tile.collecting {
  animation: tile-collect-flash 420ms var(--anim-ease);
}

@keyframes tile-collect-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.6);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(234, 179, 8, 0);
  }
}

.paytable-note {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.paytable-wrap {
  overflow-x: auto;
  margin-bottom: 0.45rem;
}

.paytable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.68rem;
}

.paytable th,
.paytable td {
  padding: 0.25rem 0.3rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.paytable th:first-child,
.paytable td:first-child,
.paytable th:nth-child(2),
.paytable td:nth-child(2) {
  text-align: left;
}

.paytable th {
  color: var(--muted);
  font-weight: 600;
}

.paytable-symbol {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.paytable-symbol img {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  flex-shrink: 0;
}

.paytable-symbol--text .paytable-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.25rem;
  background: #111827;
  border: 1px solid var(--border);
  font-size: 0.62rem;
  font-weight: 700;
  flex-shrink: 0;
}

.log {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  font-size: 0.78rem;
}

@media (max-width: 860px) {
  .side-panel {
    overflow: visible;
  }

  .grid-wrap {
    flex: none;
    width: 100%;
    min-height: auto;
    container-type: inline-size;
  }

  .grid-host {
    height: auto;
  }

  .reels-stage {
    width: 100%;
    height: auto;
    max-height: none;
    container-type: inline-size;
  }

  .reels-frame {
    --frame-pad: 2.8cqi;
    --cell-gap: 1.15cqi;
    --inner: calc(100cqi - 2 * var(--frame-pad) - 4px);
    --cell-h: calc((var(--inner) - 4 * var(--cell-gap)) / 5);
    --reel-h: calc(var(--cell-h) * 5 + var(--cell-gap) * 4);
  }

  .log {
    flex: none;
    max-height: 10rem;
  }
}

.log li {
  padding: 0.35rem 0;
  border-bottom: 1px solid #33415555;
  color: var(--muted);
}

.log-win {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.log-symbol {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
  flex-shrink: 0;
}

.log-symbol--text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.25rem;
  background: #111827;
  border: 1px solid var(--border);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text);
}

.log li:last-child {
  border-bottom: none;
}

.cheats-btn {
  border: 1px dashed #fbbf24;
  color: #fbbf24;
  background: #422006;
}

.cheats-btn.armed {
  background: #854d0e;
  border-style: solid;
  color: #fef3c7;
}

.cheat-armed {
  margin: 0;
  flex-basis: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: #fbbf24;
}

.cheats-dialog {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  max-width: min(28rem, calc(100vw - 2rem));
  width: 100%;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.45);
}

.cheats-dialog::backdrop {
  background: rgba(2, 6, 23, 0.65);
}

.cheats-panel {
  margin: 0;
  display: flex;
  flex-direction: column;
  max-height: min(80vh, 36rem);
}

.cheats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.cheats-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.cheats-desc {
  margin: 0;
  padding: 0.65rem 1rem 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.cheats-list {
  overflow: auto;
  padding: 0.65rem 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cheat-group h3 {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.cheat-group-btns {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cheat-option {
  text-align: left;
  background: #0f172a;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.cheat-option:hover {
  border-color: #fbbf24;
}

.cheat-option.active {
  border-color: #fbbf24;
  background: #422006;
  color: #fef3c7;
}

.cheat-option small {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 400;
}

.cheat-option.active small {
  color: #fde68a;
}

.cheats-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}
