*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 194, 66, 0.14), transparent 65%),
    radial-gradient(ellipse 70% 55% at 50% 100%, rgba(160, 24, 68, 0.18), transparent 70%);
}

.cabinet {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding:
    calc(var(--safe-top) + 12px)
    10px
    calc(var(--safe-bottom) + 8px);
  gap: 6px;
}

/* ==================== TOP BAR ==================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
}

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 2px;
}
.back-link:active { color: var(--text); }

.title-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.brand-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: #ffe89e;
  text-shadow: 0 2px 10px rgba(255, 198, 56, 0.35);
  white-space: nowrap;
}
.brand-title span {
  color: #ff4f79;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font-size: 0.95rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.icon-btn[aria-pressed="true"] {
  border-color: #ffd24a;
  background: rgba(255, 210, 74, 0.18);
  box-shadow: 0 0 12px rgba(255, 210, 74, 0.3);
}

/* ==================== JACKPOTS + CHARGE METER + STREAK BAR ==================== */
.marquee {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.jackpots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.jp-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 3px;
  border-radius: 10px;
  border: 1px solid rgba(255, 218, 112, 0.28);
  background: linear-gradient(180deg, rgba(44, 14, 28, 0.9), rgba(19, 6, 14, 0.94));
  text-align: center;
  line-height: 1.15;
}
.jp-name {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.jp-val {
  font-size: 0.8rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #fff9e6;
}
.jp-mini .jp-name { color: #6bc4ff; }
.jp-minor .jp-name { color: #d696ff; }
.jp-major .jp-name { color: #ff758f; }
.jp-grand {
  border-color: rgba(255, 214, 84, 0.65);
  background: linear-gradient(180deg, rgba(102, 54, 8, 0.85), rgba(38, 16, 4, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 240, 165, 0.3);
}
.jp-grand .jp-name { color: #ffe169; }
.jp-grand .jp-val { color: #fff2a6; }

.jackpots.electrified .jp-card {
  border-color: #5ce1ff;
  box-shadow: 0 0 14px rgba(56, 242, 255, 0.42), inset 0 1px 0 rgba(200, 251, 255, 0.35);
}
.jackpots.electrified .jp-val {
  color: #b8fbff;
}

.meter-bar {
  position: relative;
  border-radius: 11px;
  border: 1px solid rgba(255, 214, 112, 0.34);
  background: linear-gradient(180deg, rgba(24, 9, 26, 0.92), rgba(14, 5, 18, 0.96));
  padding: 5px 10px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.meter-bar.warm {
  border-color: rgba(255, 182, 54, 0.68);
  box-shadow: 0 0 14px rgba(255, 168, 38, 0.25);
}

.meter-bar.hot {
  border-color: #ffe169;
  box-shadow: 0 0 20px rgba(255, 92, 214, 0.45), 0 0 10px rgba(255, 210, 74, 0.45);
  animation: meterHot 0.7s ease-in-out infinite alternate;
}

.meter-bar.pulse {
  animation: meterImpact 0.26s ease;
}

.meter-bar.tease {
  border-color: #fff08a;
  box-shadow: 0 0 24px rgba(255, 92, 214, 0.72), 0 0 14px rgba(255, 224, 92, 0.65);
  animation: meterTeaseSwell 0.55s ease-in-out infinite alternate;
}

@keyframes meterTeaseSwell {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

@keyframes meterHot {
  from { box-shadow: 0 0 14px rgba(255, 92, 214, 0.35), 0 0 8px rgba(255, 210, 74, 0.35); }
  to { box-shadow: 0 0 26px rgba(255, 92, 214, 0.75), 0 0 16px rgba(255, 210, 74, 0.75); }
}

@keyframes meterImpact {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.025); }
}

.meter-track {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.04);
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #5d32d6, #d934c6, #ffd24a);
  opacity: 0.48;
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.meter-bar.warm .meter-fill {
  opacity: 0.65;
  background: linear-gradient(90deg, #d6681e, #ff9d2e, #ffe05c);
}
.meter-bar.hot .meter-fill {
  opacity: 0.82;
  background: linear-gradient(90deg, #ff2e97, #ff8f26, #fff078);
}

.meter-meta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}
.meter-title {
  font-weight: 800;
  color: #ffe9b3;
}
.meter-pct {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

/* Prominent 3-Flame Win Streak / 5x5 Expanded Bar */
.expand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 11px;
  border: 1px solid rgba(255, 168, 72, 0.3);
  background: linear-gradient(180deg, rgba(36, 12, 22, 0.92), rgba(18, 6, 14, 0.96));
  padding: 5px 10px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.expand-bar.ready {
  border-color: #ff9c3b;
  box-shadow: 0 0 16px rgba(255, 124, 38, 0.36);
}

.expand-bar.active {
  border-color: #ffd24a;
  background: linear-gradient(90deg, rgba(168, 36, 18, 0.95), rgba(214, 88, 22, 0.92), rgba(168, 36, 18, 0.95));
  box-shadow: 0 0 20px rgba(255, 132, 42, 0.5);
}

.expand-bar.overdrive {
  border-color: #7ef9ff;
  background: linear-gradient(90deg, rgba(12, 66, 118, 0.96), rgba(88, 24, 114, 0.95), rgba(12, 66, 118, 0.96));
  box-shadow: 0 0 22px rgba(56, 242, 255, 0.55), 0 0 10px rgba(255, 210, 74, 0.4);
  animation: overdriveBarPulse 0.9s ease-in-out infinite alternate;
}

@keyframes overdriveBarPulse {
  from { box-shadow: 0 0 14px rgba(56, 242, 255, 0.42), 0 0 6px rgba(255, 210, 74, 0.3); }
  to { box-shadow: 0 0 26px rgba(56, 242, 255, 0.78), 0 0 14px rgba(255, 210, 74, 0.55); }
}

.expand-streak-view,
.expand-active-view {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.streak-mult-pill {
  flex: 0 0 auto;
  min-width: 44px;
  text-align: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  border: 1.5px solid rgba(255, 214, 112, 0.35);
  background: rgba(255, 214, 112, 0.1);
  color: #ffe9b3;
  transition: transform 0.22s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.streak-mult-pill.heat-1 {
  border-color: #ffd24a;
  background: linear-gradient(180deg, rgba(255, 198, 56, 0.32), rgba(168, 92, 10, 0.36));
  color: #fff6c2;
  box-shadow: 0 0 12px rgba(255, 198, 56, 0.42);
}

.streak-mult-pill.heat-2 {
  border-color: #ff9c3b;
  background: linear-gradient(180deg, rgba(255, 140, 38, 0.45), rgba(178, 48, 12, 0.5));
  color: #fff8d6;
  box-shadow: 0 0 16px rgba(255, 128, 38, 0.6);
}

.streak-mult-pill.heat-3 {
  border-color: #ff5d8f;
  background: linear-gradient(180deg, rgba(255, 78, 128, 0.52), rgba(172, 18, 52, 0.62));
  color: #ffffff;
  box-shadow: 0 0 18px rgba(255, 78, 128, 0.72), 0 0 8px rgba(255, 214, 84, 0.55);
}

.streak-mult-pill.heat-4 {
  border-color: #7ef9ff;
  background: linear-gradient(135deg, rgba(24, 178, 224, 0.62), rgba(162, 34, 212, 0.62));
  color: #ffffff;
  box-shadow: 0 0 22px rgba(56, 242, 255, 0.8), 0 0 10px rgba(255, 224, 92, 0.65);
  animation: multHotGlow 0.7s ease-in-out infinite alternate;
}

.streak-mult-pill.pop {
  animation: multInflatePop 0.44s cubic-bezier(0.22, 1.45, 0.36, 1);
}

@keyframes multInflatePop {
  0% { transform: scale(1); }
  45% { transform: scale(1.38); }
  100% { transform: scale(1.04); }
}

@keyframes multHotGlow {
  from { transform: scale(1.02); box-shadow: 0 0 14px rgba(56, 242, 255, 0.65); }
  to { transform: scale(1.1); box-shadow: 0 0 26px rgba(56, 242, 255, 0.95), 0 0 14px rgba(255, 224, 92, 0.8); }
}
.expand-streak-view[hidden],
.expand-active-view[hidden] {
  display: none;
}

.expand-label-group {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.expand-title {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  color: #ffd88a;
  white-space: nowrap;
}

.expand-hint {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.expand-bar.ready .expand-hint {
  color: #ffcf6b;
  font-weight: 800;
}

.flame-slots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.flame-slot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  filter: grayscale(1) opacity(0.28);
  transition: transform 0.25s ease, filter 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.flame-slot.lit {
  filter: none;
  border-color: #ffb845;
  background: radial-gradient(circle, rgba(255, 174, 48, 0.42), rgba(204, 42, 24, 0.22));
  box-shadow: 0 0 10px rgba(255, 128, 38, 0.65);
  transform: scale(1.06);
}

.flame-slot.next-pulse {
  filter: grayscale(0.45) opacity(0.68);
  border: 1.5px dashed #ffd24a;
  animation: flameReadyPulse 0.8s ease-in-out infinite alternate;
}

@keyframes flameReadyPulse {
  from { transform: scale(0.96); box-shadow: 0 0 4px rgba(255, 198, 66, 0.25); }
  to { transform: scale(1.12); box-shadow: 0 0 14px rgba(255, 168, 48, 0.72); }
}

.expand-active-title {
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #fff8d6;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.expand-spins-left {
  font-size: 0.74rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(24, 6, 8, 0.55);
  border: 1px solid #ffe485;
  color: #fff4be;
  white-space: nowrap;
}

/* Free Spins replacement banner */
.fs-banner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px 10px;
  border-radius: 12px;
  border: 1.5px solid #ffd24a;
  background: linear-gradient(135deg, rgba(122, 16, 48, 0.94), rgba(56, 10, 26, 0.96));
  box-shadow: 0 0 20px rgba(255, 198, 56, 0.32);
}
.fs-banner.overdrive {
  border-color: #7ef9ff;
  background: linear-gradient(135deg, rgba(12, 54, 96, 0.96), rgba(92, 14, 72, 0.96));
  box-shadow: 0 0 24px rgba(56, 242, 255, 0.45), 0 0 10px rgba(255, 210, 74, 0.35);
}
.fs-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}
.fs-stat span {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffd88a;
}
.fs-stat strong {
  font-size: 0.95rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}
.fs-mult strong { color: #ffe169; }
.fs-win strong { color: var(--good); }

/* ==================== CANVAS STAGE ==================== */
.stage-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 180px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#stage {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.fx-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 25;
}

.wheel-cta-wrap {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
}

.wheel-spin-btn {
  border: 2px solid #fff3b0;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #2b0d00;
  background: linear-gradient(180deg, #fff2a6 0%, #ffd24a 45%, #d9820c 100%);
  box-shadow: 0 6px 24px rgba(255, 198, 48, 0.65), 0 0 0 4px rgba(255, 210, 74, 0.25);
  cursor: pointer;
  white-space: nowrap;
  animation: wheelCtaPulse 1s ease-in-out infinite alternate;
}

.wheel-spin-btn.electrified {
  border-color: #d4feff;
  color: #031f2e;
  background: linear-gradient(180deg, #b8fbff 0%, #48e5ff 45%, #ffd24a 100%);
  box-shadow: 0 6px 28px rgba(56, 242, 255, 0.72), 0 0 0 4px rgba(56, 242, 255, 0.28);
}

@keyframes wheelCtaPulse {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

/* MAX BET INCREASED (green) / DECREASED (red) flourish banner */
.maxbet-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 20px;
  border-radius: 16px;
  border: 2px solid #8cffc2;
  background: linear-gradient(180deg, rgba(10, 96, 56, 0.96), rgba(6, 36, 24, 0.97));
  box-shadow: 0 8px 28px rgba(46, 232, 138, 0.52), 0 0 0 3px rgba(66, 245, 155, 0.24);
  text-align: center;
  pointer-events: none;
  z-index: 6;
  white-space: nowrap;
  animation: maxBetPop 0.38s cubic-bezier(0.22, 1.35, 0.36, 1);
}
.maxbet-banner[hidden] { display: none; }

.maxbet-banner.down {
  border-color: #ff99ab;
  background: linear-gradient(180deg, rgba(126, 18, 38, 0.96), rgba(48, 8, 18, 0.97));
  box-shadow: 0 8px 28px rgba(255, 68, 102, 0.52), 0 0 0 3px rgba(255, 82, 114, 0.24);
}

.maxbet-kicker {
  font-family: Georgia, serif;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #8cffc2;
  text-shadow: 0 2px 10px rgba(56, 245, 148, 0.55);
}

.maxbet-banner.down .maxbet-kicker {
  color: #ff9eb0;
  text-shadow: 0 2px 10px rgba(255, 72, 106, 0.55);
}

.maxbet-detail {
  margin-top: 2px;
  font-size: 1.05rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

@keyframes maxBetPop {
  from { transform: translateX(-50%) scale(0.75) translateY(-10px); opacity: 0; }
  to { transform: translateX(-50%) scale(1) translateY(0); opacity: 1; }
}

.stage-toast {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid #ffd24a;
  background: rgba(24, 6, 16, 0.92);
  color: #fff3bd;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}

/* ==================== CONTROL DECK ==================== */
.deck {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 10px 8px;
  border-radius: 18px;
  border: 1px solid rgba(255, 214, 112, 0.22);
  background: linear-gradient(180deg, rgba(28, 12, 24, 0.88), rgba(14, 7, 16, 0.94));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
}

.readouts {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 6px;
}

.readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 6px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1.15;
}
.r-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.r-val {
  font-size: 1rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #fff8e8;
}

.readout-win {
  border-color: rgba(255, 210, 74, 0.35);
  background: rgba(255, 210, 74, 0.08);
}
.readout-win .r-val {
  color: #ffe066;
}
.readout-win.has-win .r-val {
  color: var(--good);
}
.readout-win.tier-pop {
  animation: winTierPop 0.36s cubic-bezier(0.22, 1.45, 0.36, 1);
}
@keyframes winTierPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.15); box-shadow: 0 0 20px rgba(255, 210, 74, 0.65); }
  100% { transform: scale(1); }
}

.bet-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-btn {
  width: 38px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 214, 112, 0.35);
  background: rgba(255, 214, 112, 0.1);
  color: #ffe99e;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
.step-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.quick-chips {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  flex: 1 1 auto;
}

.chip {
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  padding: 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip.active {
  border-color: #ffd24a;
  background: linear-gradient(180deg, rgba(255, 210, 74, 0.32), rgba(186, 116, 14, 0.32));
  color: #fff7cf;
  box-shadow: 0 0 10px rgba(255, 210, 74, 0.25);
}
.chip-max {
  color: #ffcf5c;
}
.chip-max.unlocked-pulse {
  border-color: #8cffc2;
  box-shadow: 0 0 16px rgba(56, 245, 148, 0.85);
  animation: maxChipPulse 0.45s ease-in-out 4 alternate;
}
.chip-max.unlocked-pulse-down {
  border-color: #ff8ea2;
  box-shadow: 0 0 16px rgba(255, 72, 106, 0.85);
  animation: maxChipPulse 0.45s ease-in-out 4 alternate;
}
@keyframes maxChipPulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}
.chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.action-row {
  display: flex;
  align-items: stretch;
  gap: 7px;
}

.refill-pill {
  padding: 0 14px;
  border-radius: 14px;
  border: 1.5px solid var(--good);
  background: linear-gradient(180deg, rgba(56, 225, 154, 0.28), rgba(16, 128, 82, 0.42));
  color: #e6fff4;
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.spin-btn {
  flex: 1 1 auto;
  height: 52px;
  border-radius: 15px;
  border: 2px solid #fff3b8;
  background: linear-gradient(180deg, #ffe885 0%, #f2b426 48%, #bd6b06 100%);
  color: #2c0b00;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(242, 180, 38, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.spin-btn span {
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}
.spin-btn small {
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.82;
}
.spin-btn.refill-mode {
  border-color: #a8ffd9;
  background: linear-gradient(180deg, #5bf5b2 0%, #1fd187 50%, #0d8f58 100%);
  color: #032617;
  box-shadow: 0 6px 20px rgba(31, 209, 135, 0.42);
}
.spin-btn.stop-mode {
  border-color: #ff9ab8;
  background: linear-gradient(180deg, #ff7096 0%, #d91b4c 55%, #8a092b 100%);
  color: #fff6f8;
  box-shadow: 0 6px 18px rgba(217, 27, 76, 0.42);
}
.spin-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

/* ==================== OVERLAYS & MODALS ==================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 3, 10, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 30;
}
.overlay[hidden] { display: none; }

.sheet {
  width: 100%;
  max-width: 440px;
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 214, 112, 0.35);
  background: linear-gradient(180deg, #1d0c1b, #100712);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sheet-head h2 {
  margin: 0;
  font-size: 1.12rem;
  color: #ffe89e;
}

.close-x {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}

.info-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.tab-btn {
  padding: 7px 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.tab-btn.active {
  border-color: #ffd24a;
  background: rgba(255, 210, 74, 0.16);
  color: #fff3bd;
}

.tab-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 2px;
}
.tab-note {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

.paytable-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.pt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.pt-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}
.pt-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  font-size: 0.72rem;
}
.pt-name {
  font-weight: 800;
  color: #ffe8a3;
  margin-bottom: 2px;
}
.pt-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pt-line strong {
  color: var(--text);
}

.rule-card {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  margin-bottom: 8px;
}
.rule-card h3 {
  margin: 0 0 4px;
  font-size: 0.88rem;
  color: #ffe388;
}
.rule-card p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}
.rule-card strong {
  color: var(--text);
}

.lines-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.line-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.line-mini span {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
}
.line-dots {
  display: grid;
  grid-template-columns: repeat(5, 7px);
  grid-template-rows: repeat(3, 7px);
  gap: 2px;
}
.line-dot {
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.stat-box {
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-box span {
  font-size: 0.72rem;
  color: var(--muted);
}
.stat-box strong {
  font-size: 1.05rem;
  color: #ffe699;
  font-variant-numeric: tabular-nums;
}

.sheet-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.btn-primary {
  width: 100%;
  padding: 12px 18px;
  border-radius: 13px;
  border: 1.5px solid #fff3b8;
  background: linear-gradient(180deg, #ffe885, #d9890e);
  color: #2b0d00;
  font-size: 0.96rem;
  font-weight: 900;
  cursor: pointer;
}

.sheet-hub {
  display: inline-block;
  align-self: center;
  margin-top: 4px;
  padding: 8px 16px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}
.sheet-hub:active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

/* Bonus summary modal */
.summary-sheet {
  text-align: center;
  align-items: center;
  border-color: #ffd24a;
}
.summary-crown {
  font-size: 2.5rem;
  line-height: 1;
}
.summary-sheet h2 {
  margin: 0;
  font-family: Georgia, serif;
  color: #ffe485;
  letter-spacing: 0.06em;
  font-size: 1.15rem;
}
.summary-total {
  font-size: 2.4rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 24px rgba(255, 210, 74, 0.65);
  font-variant-numeric: tabular-nums;
}
.summary-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}
.summary-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 210, 74, 0.14);
  border: 1px solid rgba(255, 210, 74, 0.35);
  color: #fff2bd;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .meter-bar.hot,
  .meter-bar.pulse,
  .meter-bar.tease,
  .expand-bar.overdrive,
  .flame-slot.next-pulse,
  .streak-mult-pill.heat-4,
  .streak-mult-pill.pop,
  .readout-win.tier-pop,
  .wheel-spin-btn,
  .maxbet-banner,
  .chip-max.unlocked-pulse,
  .chip-max.unlocked-pulse-down {
    animation: none;
  }
}

@media (max-height: 670px) {
  .cabinet { gap: 4px; padding-top: calc(var(--safe-top) + 8px); }
  .jp-card { padding: 3px 2px; }
  .jp-val { font-size: 0.74rem; }
  .expand-bar { padding: 4px 8px; }
  .flame-slot { width: 20px; height: 20px; font-size: 0.78rem; }
  .deck { padding: 7px 8px 6px; gap: 5px; }
  .spin-btn { height: 46px; }
}
