*,
*::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.55rem;
  --cell-gap: 0.28rem;
  --reel-h: calc(var(--cell-h) * 7 + var(--cell-gap) * 6);
  --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: 1200px;
  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);
}

.inspired-by {
  margin: 0 0 0.15rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.subtitle {
  margin: 0.25rem 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;
  flex-shrink: 0;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}

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(32rem, 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-symbol-rtp {
  list-style: none;
  margin: 0.2rem 0 0.55rem 1.25rem;
  padding: 0;
}

.mc-symbol-rtp li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.68rem;
  color: var(--muted);
  padding: 0.12rem 0;
}

.mc-symbol-rtp strong {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.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;
  flex-shrink: 0;
}

.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;
}

.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);
  flex-shrink: 0;
}

.mode-banner.fs {
  border-color: var(--scatter);
  color: var(--scatter);
}

.board-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 0.25rem;
}

.board-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  width: 100%;
}

.board-hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0.55rem;
  width: min(100%, 42rem);
  margin: 0 0 0.55rem;
  flex-shrink: 0;
}

.board-meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  min-width: 7.25rem;
  padding: 0.35rem 0.85rem 0.4rem;
  border-radius: 0.55rem;
}

.round-win-meter {
  justify-self: end;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
}

.fs-meter {
  justify-self: start;
  border: 1px solid rgba(56, 189, 248, 0.5);
  background: linear-gradient(180deg, rgba(12, 74, 110, 0.55), rgba(15, 23, 42, 0.95));
}

.fs-meter[hidden] {
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
}

.board-meter-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.round-win-meter .board-meter-label {
  color: #cbd5e1;
}

.fs-meter .board-meter-label {
  color: var(--scatter);
}

.board-meter-value {
  font-size: clamp(0.95rem, 2.6vw, 1.25rem);
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.round-win-meter .board-meter-value {
  color: #e2e8f0;
}

.fs-meter .board-meter-value {
  color: #7dd3fc;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.tumble-win {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 10rem;
  margin: 0;
  padding: 0.4rem 1.25rem 0.5rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: linear-gradient(180deg, rgba(69, 26, 3, 0.55), rgba(15, 23, 42, 0.95));
  box-shadow: inset 0 0 20px rgba(251, 191, 36, 0.08);
}

.tumble-win-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fbbf24;
}

.tumble-win-value {
  font-size: clamp(1.15rem, 3.5vw, 1.65rem);
  font-weight: 800;
  color: #fde68a;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
  text-align: center;
  transition: transform 180ms var(--anim-ease);
}

.tumble-win.settle-pulse .tumble-win-value {
  animation: tumble-win-pulse 480ms var(--anim-ease);
}

@keyframes tumble-win-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.collect-token.mult-fly {
  min-width: 2.4rem;
  height: 2.1rem;
  padding: 0 0.45rem;
  border-radius: 0.55rem;
  background: radial-gradient(circle at 35% 30%, #a7f3d0 0%, #34d399 50%, #047857 100%);
  border: 2px solid #d1fae5;
  color: #022c22;
  font-size: 0.95rem;
  box-shadow:
    0 0 14px rgba(52, 211, 153, 0.65),
    0 4px 10px rgba(0, 0, 0, 0.35);
}

.grid-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.35rem 0 0.75rem;
  width: 100%;
  container-type: size;
}

.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;
}

.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 - 6 * var(--cell-gap)) / 7);
  --reel-h: calc(var(--cell-h) * 7 + var(--cell-gap) * 6);
  padding: var(--frame-pad);
  background: #0b1220;
  border-radius: 0.65rem;
  border: 2px solid #475569;
}

.grid,
.grid-reels {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: var(--cell-gap);
  z-index: 1;
}

.spot-layer {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(7, var(--cell-h));
  grid-template-rows: repeat(7, var(--cell-h));
  gap: var(--cell-gap);
  pointer-events: none;
  z-index: 4;
}

.spot-cell {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0.12rem;
  border-radius: 0.45rem;
}

.spot-cell.marked {
  box-shadow: inset 0 0 0 2px rgba(251, 191, 36, 0.85);
}

.spot-cell.has-mult {
  box-shadow: inset 0 0 0 2px rgba(52, 211, 153, 0.95), 0 0 10px rgba(52, 211, 153, 0.35);
}

.spot-badge {
  min-width: 1.35rem;
  text-align: center;
  background: #f59e0b;
  color: #111827;
  font-weight: 800;
  font-size: 0.62rem;
  line-height: 1.2;
  border-radius: 0.28rem;
  padding: 0.05rem 0.2rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.spot-cell.has-mult .spot-badge {
  background: #34d399;
}

.reel-col {
  position: relative;
  width: var(--cell-h);
  height: var(--reel-h);
  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: #111827;
  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 .sym-img {
  width: 85%;
  height: 85%;
  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.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.multiplier {
  border-color: #6ee7b7;
  background: linear-gradient(145deg, #0c1222, #162032);
}

.symbol-tile.multiplier .idx,
.symbol-tile.multiplier .name,
.symbol-tile.multiplier .sym-img,
.symbol-tile.multiplier .mult-badge {
  display: none !important;
}

.symbol-tile.multiplier .sym.mult-center {
  font-size: clamp(1rem, 4.5vw, 1.45rem);
  font-weight: 800;
  color: #6ee7b7;
  text-shadow: 0 0 10px rgba(110, 231, 183, 0.55);
  line-height: 1;
  letter-spacing: -0.02em;
}

.symbol-tile.mult-pulse {
  animation: mult-pulse 420ms var(--anim-ease);
}

@keyframes mult-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); box-shadow: 0 0 12px rgba(110, 231, 183, 0.8); }
  100% { transform: scale(1); }
}

.symbol-tile.special {
  border-color: var(--jp);
  background: #422006;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

html.ui-compact .controls {
  flex-wrap: nowrap;
  gap: 0.35rem 0.55rem;
}

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.active {
  background: linear-gradient(180deg, #b45309, #92400e);
  border-color: #fbbf24;
}

.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;
  flex-shrink: 0;
}

.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);
  flex-shrink: 0;
}

.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;
}

.mode-banner.ante {
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.35), rgba(146, 64, 14, 0.2));
  border-color: rgba(251, 191, 36, 0.45);
}

.counter.mult-meter {
  border-color: rgba(110, 231, 183, 0.45);
  background: rgba(6, 78, 59, 0.25);
}

.counter.ready {
  border-color: var(--jp);
  color: #fde68a;
}

.counter.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-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.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;
  max-height: 160px;
  overflow-y: auto;
  font-size: 0.78rem;
}

.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;
}

@media (max-width: 860px) {
  .side-panel {
    overflow: visible;
  }

  .board-hud {
    width: 100%;
    gap: 0.35rem;
  }

  .board-meter,
  .tumble-win {
    min-width: 0;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  .board-stage,
  .board-main {
    flex: none;
    width: 100%;
  }

  .grid-wrap {
    flex: none;
    width: min(100%, 56dvh);
    max-width: 100%;
    aspect-ratio: 1;
    height: auto;
    min-height: 0;
    margin-inline: auto;
    container-type: size;
  }

  .grid-host {
    width: 100%;
    height: 100%;
  }

  .reels-stage {
    width: min(100cqw, 100cqh);
    height: min(100cqw, 100cqh);
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1;
    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) - 6 * var(--cell-gap)) / 7);
    --reel-h: calc(var(--cell-h) * 7 + var(--cell-gap) * 6);
  }

  .log {
    flex: none;
    max-height: 10rem;
  }
}

@media (max-height: 900px) {
  .app {
    padding: 0.7rem 0.9rem 4.35rem;
  }

  header {
    margin-bottom: 0.5rem;
    gap: 0.5rem;
  }

  header h1 {
    font-size: 1.2rem;
  }

  .live-stats {
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.6rem;
    gap: 0.45rem;
  }

  .stat {
    padding: 0.32rem 0.55rem;
    min-width: 5.25rem;
  }

  .stat strong {
    font-size: 0.98rem;
  }

  .layout {
    gap: 0.6rem;
  }

  .game-panel,
  .side-panel {
    padding: 0.7rem;
  }

  .mode-banner {
    margin-bottom: 0.4rem;
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
  }

  .board-hud {
    margin-bottom: 0.35rem;
  }

  .grid-wrap {
    margin: 0.15rem 0 0.4rem;
  }

  .controls {
    flex-wrap: nowrap;
    gap: 0.35rem;
  }

  button {
    padding: 0.48rem 0.85rem;
    font-size: 0.85rem;
  }

  .message {
    margin-top: 0.35rem;
    min-height: 1.15rem;
    font-size: 0.8rem;
  }

  .bottom-bar {
    padding: 0.4rem 0.75rem;
  }
}

@media (max-height: 760px) {
  .app {
    padding: 0.45rem 0.65rem 3.55rem;
  }

  .live-stats {
    margin-bottom: 0.35rem;
    padding: 0.28rem 0.45rem;
  }

  .live-stats .stat {
    min-width: 4.4rem;
    flex-basis: 4.4rem;
  }

  .layout {
    gap: 0.45rem;
  }

  .game-panel,
  .side-panel {
    padding: 0.5rem;
  }

  header .stats .stat {
    min-width: 5rem;
  }

  .side-panel h2 {
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
  }
}

html.ui-compact .app {
  padding: 0.5rem 0.7rem 3.7rem;
}

html.ui-compact header {
  margin-bottom: 0.4rem;
}

html.ui-compact .live-stats {
  margin-bottom: 0.4rem;
  padding: 0.3rem 0.5rem;
}

html.ui-compact .layout {
  gap: 0.5rem;
}

html.ui-compact .game-panel,
html.ui-compact .side-panel {
  padding: 0.55rem;
}

html.ui-compact .grid-wrap {
  margin: 0.1rem 0 0.35rem;
}

html.ui-compact .message {
  margin-top: 0.3rem;
}

.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);
}

.fs-award-dialog {
  --fs-candy-pink: #f472b6;
  --fs-cream: #fff7ed;
  --fs-gold: #fbbf24;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--fs-cream);
  position: fixed;
  inset: auto;
  width: min(20rem, calc(100vw - 2rem));
  max-width: none;
  transform: translate(-50%, -50%);
  z-index: 50;
}

.fs-award-dialog::backdrop {
  background: rgba(15, 23, 42, 0.86);
}

.fs-award-panel {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 1.75rem 1.5rem 1.4rem;
  background: var(--panel);
  border: 1px solid var(--fs-candy-pink);
  border-radius: 1.1rem;
  box-shadow:
    0 1.25rem 2.75rem rgba(15, 23, 42, 0.55),
    inset 0 1px 0 rgba(255, 247, 237, 0.08);
}

.fs-award-panel h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--fs-cream);
}

.fs-award-lead {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.fs-award-count-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0.35rem 0 0.1rem;
}

.fs-award-scatter {
  width: 3.1rem;
  height: 3.1rem;
  object-fit: contain;
  flex-shrink: 0;
}

.fs-award-count {
  font-size: clamp(3.4rem, 12vw, 4.75rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--fs-gold);
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.28);
}

.fs-award-label {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--scatter);
}

.fs-award-cta {
  min-width: 8.5rem;
  background: var(--accent);
  color: #111;
}

.fs-award-cta:focus-visible {
  outline: 2px solid var(--fs-cream);
  outline-offset: 3px;
}

.fs-award-dialog--summary .fs-award-count {
  font-size: clamp(1.85rem, 7vw, 3.1rem);
  letter-spacing: -0.03em;
}

@media (prefers-reduced-motion: no-preference) {
  .fs-award-dialog[open] .fs-award-panel {
    animation: fs-award-in 0.42s var(--anim-ease) both;
  }

  .fs-award-dialog[open] .fs-award-count {
    animation: fs-award-count-in 0.5s var(--anim-ease) 0.06s both;
  }
}

@keyframes fs-award-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fs-award-count-in {
  from {
    opacity: 0;
    transform: scale(0.72);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 860px) {
  html {
    font-size: 16px;
  }

  body {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app {
    height: auto;
    max-width: 100%;
    min-height: 0;
    overflow: visible;
    padding: 0.75rem 0.75rem 5.5rem;
  }

  header,
  .header-actions,
  .stats {
    width: 100%;
  }

  .layout {
    display: flex;
    flex-direction: column;
    flex: none;
    min-height: 0;
  }

  .game-panel,
  .side-panel {
    overflow: visible;
    min-height: 0;
  }

  header {
    margin-bottom: 0.4rem;
    gap: 0.4rem;
  }

  header h1 {
    font-size: 1.2rem;
  }

  .stats .stat,
  .live-stats .stat {
    min-width: 3.7rem;
    flex-basis: 3.7rem;
    padding: 0.25rem 0.4rem;
  }

  .live-stats {
    margin-bottom: 0.35rem;
    padding: 0.3rem 0.4rem;
    gap: 0.3rem;
  }

  .mode-banner {
    margin-bottom: 0.3rem;
  }

  .board-hud {
    margin-bottom: 0.25rem;
  }

  .grid-wrap {
    margin: 0.1rem auto 0.3rem;
  }

  .controls,
  html.ui-compact .controls {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: stretch;
    gap: 0.4rem 0.5rem;
    flex-wrap: unset;
    flex-direction: unset;
  }

  .bet-control {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    width: auto;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  #spin-btn {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-width: 5.5rem;
  }

  .speed-control,
  .autoplay-control {
    min-width: 0;
    width: auto;
    grid-column: 1 / -1;
    justify-content: stretch;
    flex-wrap: nowrap;
  }

  .speed-control { grid-row: 2; }
  .autoplay-control { grid-row: 3; }

  .bottom-bar {
    justify-content: stretch;
  }

  .buy-btn {
    min-width: 0;
    flex: 1 1 auto;
  }
}
