/* Apex Ace — Social Casino Slots */

:root {
  --void: #07040c;
  --obsidian: #12081a;
  --panel: #1a0c22;
  --crimson: #c41e3a;
  --crimson-hot: #ff2d55;
  --gold: #f0c14b;
  --gold-bright: #ffe566;
  --gold-deep: #b8860b;
  --ivory: #fff6e8;
  --muted: #a890a8;
  --teal-glow: #3dffc5;
  --win-purple: #b84dff;
  --frame: #2a1528;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-display: "Cinzel", "Times New Roman", serif;
  --font-tech: "Orbitron", system-ui, sans-serif;
  --font-ui: "Rajdhani", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--void);
  color: var(--ivory);
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

#app {
  position: relative;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 8px 12px calc(8px + var(--safe-bottom));
  isolation: isolate;
}

#app[hidden] {
  display: none !important;
}

/* ——— Age gate (Google Ads social casino) ——— */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(120, 40, 50, 0.5), transparent 55%),
    rgba(6, 3, 10, 0.92);
  backdrop-filter: blur(8px);
}

.age-gate[hidden] {
  display: none !important;
}

.age-card {
  max-width: 400px;
  width: 100%;
  padding: 28px 22px 22px;
  border-radius: 18px;
  background: linear-gradient(165deg, #2a1524, #120810);
  border: 1px solid rgba(240, 193, 75, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(196, 30, 58, 0.2);
  text-align: center;
}

.age-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 10px;
}

.age-card h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--ivory);
  margin-bottom: 12px;
}

.age-copy {
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(255, 246, 232, 0.85);
  margin-bottom: 18px;
}

.age-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.age-yes,
.age-no {
  padding: 12px 16px;
  border-radius: 12px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
}

.age-yes {
  background: linear-gradient(180deg, #e02040, #8b1020);
  color: #fff;
  box-shadow: 0 6px 20px rgba(196, 30, 58, 0.45);
}

.age-no {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--muted);
}

.age-note {
  margin-top: 14px;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.35;
}

.underage {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: #07040c;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 24px;
  text-align: center;
}

.underage[hidden] {
  display: none !important;
}

/* ——— Live 4D casino world ——— */
.stage-world {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  perspective: 900px;
  transform-style: preserve-3d;
  pointer-events: none;
}

.bg-hall {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%, rgba(180, 50, 60, 0.55), transparent 58%),
    radial-gradient(ellipse 50% 40% at 15% 40%, rgba(255, 180, 60, 0.12), transparent 50%),
    radial-gradient(ellipse 50% 40% at 85% 45%, rgba(255, 80, 100, 0.1), transparent 50%),
    linear-gradient(180deg, #1a0a14 0%, #0c0610 38%, #1a0c10 72%, #0a0508 100%);
}

.bg-curtains {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,
      rgba(60, 8, 18, 0.92) 0%,
      rgba(90, 12, 28, 0.55) 8%,
      transparent 18%,
      transparent 82%,
      rgba(90, 12, 28, 0.55) 92%,
      rgba(60, 8, 18, 0.92) 100%);
  box-shadow: inset 40px 0 60px rgba(0, 0, 0, 0.35), inset -40px 0 60px rgba(0, 0, 0, 0.35);
}

.bg-floor {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -5%;
  height: 42%;
  background:
    linear-gradient(180deg, transparent 0%, rgba(40, 10, 18, 0.4) 18%, rgba(80, 18, 28, 0.55) 100%),
    repeating-linear-gradient(
      90deg,
      rgba(240, 193, 75, 0.04) 0px,
      rgba(240, 193, 75, 0.04) 1px,
      transparent 1px,
      transparent 48px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.15) 0px,
      rgba(0, 0, 0, 0.15) 1px,
      transparent 1px,
      transparent 36px
    );
  transform: rotateX(58deg) translateZ(-40px);
  transform-origin: center top;
  mask-image: linear-gradient(180deg, transparent, black 30%);
}

.bg-spot {
  position: absolute;
  width: 55%;
  height: 70%;
  top: -10%;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.35;
  animation: spot-breathe 6s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}

.bg-spot.left {
  left: -15%;
  background: radial-gradient(circle, rgba(255, 200, 80, 0.55), transparent 65%);
  animation-delay: 0s;
}

.bg-spot.right {
  right: -15%;
  left: auto;
  background: radial-gradient(circle, rgba(255, 60, 90, 0.45), transparent 65%);
  animation-delay: -2s;
}

.bg-spot.center {
  left: 22%;
  width: 56%;
  top: -20%;
  background: radial-gradient(circle, rgba(255, 230, 160, 0.4), transparent 60%);
  opacity: 0.45;
  animation-delay: -1s;
}

@keyframes spot-breathe {
  from { opacity: 0.25; transform: scale(1); }
  to { opacity: 0.48; transform: scale(1.08); }
}

.bg-bokeh {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 12% 28%, rgba(255, 220, 120, 0.55) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 22%, rgba(255, 120, 140, 0.45) 0 3px, transparent 4px),
    radial-gradient(circle at 88% 58%, rgba(255, 200, 80, 0.35) 0 2px, transparent 3px),
    radial-gradient(circle at 18% 68%, rgba(255, 255, 255, 0.25) 0 2px, transparent 3px),
    radial-gradient(circle at 45% 18%, rgba(255, 180, 60, 0.4) 0 4px, transparent 5px),
    radial-gradient(circle at 62% 72%, rgba(255, 80, 100, 0.3) 0 3px, transparent 4px);
  animation: bokeh-drift 14s ease-in-out infinite alternate;
  filter: blur(0.5px);
}

@keyframes bokeh-drift {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.7; }
  to { transform: translate3d(-12px, 10px, 20px) scale(1.05); opacity: 1; }
}

.bg-haze {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(255, 200, 120, 0.08), transparent 55%);
  animation: haze-pulse 8s ease-in-out infinite alternate;
}

@keyframes haze-pulse {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

#amb-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

.compliance-banner {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 6px;
  padding: 5px 8px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(240, 193, 75, 0.35);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  text-align: center;
  z-index: 5;
}

.compliance-banner .dot {
  opacity: 0.45;
}

.jp-note {
  text-align: center;
  font-size: 0.55rem;
  color: rgba(168, 144, 168, 0.75);
  margin: -4px 0 6px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.win-virtual-tag {
  margin-top: 8px;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: rgba(255, 246, 232, 0.75);
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.legal-footer {
  flex-shrink: 0;
  margin-top: 6px;
  padding: 8px 4px 2px;
  max-height: 72px;
  overflow-y: auto;
  z-index: 5;
}

.legal-footer p {
  font-size: 0.55rem;
  line-height: 1.4;
  color: rgba(168, 144, 168, 0.85);
  text-align: center;
}

.legal-footer strong {
  color: rgba(240, 193, 75, 0.9);
  font-weight: 700;
}

/* ——— Top bar ——— */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--crimson), #6b1020);
  color: var(--gold-bright);
  font-size: 1.25rem;
  box-shadow: 0 0 20px rgba(196, 30, 58, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold), var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.brand-text p {
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 600;
}

.wallet {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip {
  background: linear-gradient(180deg, rgba(40, 18, 48, 0.95), rgba(18, 8, 24, 0.98));
  border: 1px solid rgba(240, 193, 75, 0.35);
  border-radius: 12px;
  padding: 4px 12px;
  min-width: 88px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.chip-label {
  display: block;
  font-size: 0.48rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-weight: 700;
}

.chip-value {
  display: block;
  font-family: var(--font-tech);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ivory);
  text-shadow: 0 0 12px rgba(240, 193, 75, 0.35);
}

.balance-chip .chip-value {
  color: var(--gold-bright);
}

.btn-ghost {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(240, 193, 75, 0.25);
  border-radius: 10px;
  background: rgba(20, 10, 28, 0.8);
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.btn-ghost:active {
  transform: scale(0.92);
}

.btn-ghost.muted {
  opacity: 0.45;
}

/* ——— Jackpot rail ——— */
.jackpot-rail {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 6px;
  margin: 10px 0 8px;
  flex-shrink: 0;
}

.jackpot-card {
  background: linear-gradient(160deg, rgba(50, 20, 40, 0.9), rgba(20, 8, 24, 0.95));
  border: 1px solid rgba(240, 193, 75, 0.2);
  border-radius: 10px;
  padding: 6px 4px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.jackpot-card.hot {
  border-color: rgba(255, 45, 85, 0.5);
  box-shadow: 0 0 18px rgba(196, 30, 58, 0.25);
}

.jackpot-card.hot::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 45, 85, 0.15), transparent);
  animation: jp-sweep 2.5s linear infinite;
}

@keyframes jp-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.jp-label {
  display: block;
  font-size: 0.45rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
}

.jp-value {
  font-family: var(--font-tech);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
}

.jackpot-card.hot .jp-value {
  color: var(--crimson-hot);
  text-shadow: 0 0 10px rgba(255, 45, 85, 0.5);
}

/* ——— Stage / Machine ——— */
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  z-index: 2;
}

.machine {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.machine.tilt-win {
  animation: machine-tilt 0.55s ease-out;
}

@keyframes machine-tilt {
  0%, 100% { transform: rotateX(0) scale(1); }
  30% { transform: rotateX(4deg) scale(1.02); }
  60% { transform: rotateX(-2deg) scale(1.015); }
}

.machine-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  border-radius: 22px;
  padding: 10px 10px 8px;
  background:
    linear-gradient(165deg, #3a1a2e 0%, #1a0a18 40%, #120810 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow:
    0 0 0 2px rgba(240, 193, 75, 0.45),
    0 0 40px rgba(196, 30, 58, 0.35),
    0 20px 50px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.frame-glow {
  position: absolute;
  inset: -2px;
  border-radius: 24px;
  background: conic-gradient(from 0deg, var(--gold), var(--crimson), var(--gold-bright), var(--crimson-hot), var(--gold));
  opacity: 0.35;
  z-index: -1;
  animation: frame-spin 8s linear infinite;
  filter: blur(8px);
}

.machine.spinning .frame-glow {
  opacity: 0.65;
  animation-duration: 2s;
}

.machine.big-win .frame-glow {
  opacity: 0.9;
  animation-duration: 1s;
  filter: blur(12px);
}

@keyframes frame-spin {
  to { transform: rotate(360deg); }
}

.frame-bevel {
  position: absolute;
  inset: 4px;
  border-radius: 18px;
  border: 1px solid rgba(240, 193, 75, 0.15);
  pointer-events: none;
  z-index: 1;
}

.title-plaque {
  text-align: center;
  padding: 4px 0 8px;
  position: relative;
  z-index: 2;
}

.plaque-ace {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold-deep));
  color: #3a1008;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 0 16px rgba(240, 193, 75, 0.6);
  margin-bottom: 2px;
}

.plaque-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  background: linear-gradient(180deg, #fff8e0, var(--gold), #c9a227);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.plaque-sub {
  display: block;
  font-size: 0.5rem;
  letter-spacing: 0.28em;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 600;
}

/* ——— Reels ——— */
.reels-viewport {
  flex: 1;
  min-height: 0;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, #2a1030 0%, #0e0614 70%),
    #0e0614;
  box-shadow:
    inset 0 0 40px rgba(0, 0, 0, 0.7),
    inset 0 0 0 2px rgba(240, 193, 75, 0.2);
  z-index: 2;
}

.reels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  height: 100%;
  padding: 4px;
  position: relative;
  z-index: 1;
}

.reel {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.15));
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.5);
}

.reel::before,
.reel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 18%;
  z-index: 4;
  pointer-events: none;
}

.reel::before {
  top: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent);
}

.reel::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), transparent);
}

.reel-strip {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.reel.spinning .reel-strip {
  filter: blur(1.5px) brightness(1.1);
}

.reel.stopping .symbol-cell {
  animation: symbol-land 0.35s cubic-bezier(0.22, 1.4, 0.36, 1);
}

@keyframes symbol-land {
  0% { transform: scaleY(0.85) scaleX(1.05); }
  60% { transform: scaleY(1.08) scaleX(0.96); }
  100% { transform: scaleY(1) scaleX(1); }
}

.symbol-cell {
  height: calc(100% / 3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  transform-style: preserve-3d;
}

.symbol {
  width: 100%;
  height: 100%;
  max-height: 96px;
  position: relative;
  transform: translateZ(0);
  transition: box-shadow 0.2s, transform 0.2s, filter 0.2s;
  background: transparent;
  border: none;
  box-shadow: none;
}

.playing-card .card-face {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(165deg, #fffef9 0%, #f7f0e4 45%, #efe4d2 100%);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(0, 0, 0, 0.08) inset;
  border: 1.5px solid #d9c9a8;
}

.playing-card .card-rim {
  position: absolute;
  inset: 3px;
  border-radius: 5px;
  border: 1px solid rgba(184, 134, 11, 0.28);
  pointer-events: none;
  z-index: 2;
}

.playing-card .corner {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  width: 16px;
}

.playing-card .corner.tl {
  top: 4px;
  left: 3px;
}

.playing-card .corner.br {
  bottom: 4px;
  right: 3px;
  transform: rotate(180deg);
}

.playing-card .corner .rank {
  font-family: "Cinzel", "Times New Roman", serif;
  font-weight: 800;
  font-size: clamp(0.65rem, 2.8vw, 0.9rem);
  letter-spacing: -0.02em;
}

.playing-card .corner .suit-mark {
  font-size: clamp(0.5rem, 2.2vw, 0.7rem);
  margin-top: 1px;
}

.playing-card.color-red .corner { color: #c41e3a; }
.playing-card.color-black .corner { color: #1a1a2e; }
.playing-card.color-teal .corner { color: #0d7a62; }

.card-center {
  position: absolute;
  inset: 14px 10px 12px;
  display: grid;
  place-items: center;
  z-index: 1;
}

.pip {
  width: 100%;
  height: 100%;
  max-width: 42px;
  max-height: 52px;
}

.pip-hero {
  max-width: 36px;
  max-height: 44px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.12));
}

.color-red .pip { fill: #c41e3a; }
.color-black .pip { fill: #1a1a2e; }
.color-teal .pip { fill: #0d7a62; }

.ace-center .pip-hero {
  max-width: 40px;
  max-height: 50px;
  fill: #1a1a2e;
}

.sym-A .card-face {
  background:
    linear-gradient(165deg, #fffef9 0%, #fff5e6 40%, #f0e0c0 100%);
  border-color: #c9a227;
  box-shadow:
    0 3px 10px rgba(196, 30, 58, 0.25),
    0 0 0 1px rgba(201, 162, 39, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.95) inset;
}

.sym-A .ace-flourish {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 162, 39, 0.45);
  pointer-events: none;
}

.sym-A .corner { color: #1a1a2e; }
.sym-A .pip-hero { fill: #1a1a2e; }

.pip-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 1px 4px;
  place-items: center;
  padding: 2px 6px;
}

.pip-mini {
  width: 10px;
  height: 12px;
  max-width: none;
  max-height: none;
  fill: #0d7a62;
}

.court-wrap {
  inset: 10px 8px 8px !important;
}

.court {
  width: 100%;
  height: 100%;
  max-height: 68px;
  overflow: visible;
}

/* Special cards — still card-shaped */
.is-wild .card-face,
.is-scatter .card-face,
.is-mult .card-face {
  border-width: 2px;
}

.is-wild .card-face {
  background:
    radial-gradient(circle at 50% 35%, #fff8d0 0%, #f5d76e 35%, #c9a227 100%);
  border-color: #ffe566;
  box-shadow:
    0 0 16px rgba(240, 193, 75, 0.55),
    0 3px 8px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: wild-pulse 2s ease-in-out infinite;
}

.is-scatter .card-face {
  background:
    radial-gradient(circle at 50% 40%, #e8fff8 0%, #7ee0c4 40%, #1a6b58 100%);
  border-color: #3dffc5;
  box-shadow:
    0 0 14px rgba(61, 255, 197, 0.4),
    0 3px 8px rgba(0, 0, 0, 0.35);
}

.is-mult .card-face {
  background:
    radial-gradient(circle at 50% 35%, #ffe0c0 0%, #ff6b2d 45%, #8b2010 100%);
  border-color: #ffb060;
  box-shadow:
    0 0 14px rgba(255, 107, 45, 0.45),
    0 3px 8px rgba(0, 0, 0, 0.35);
}

.special-wild,
.special-scatter,
.special-mult {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  inset: 6px 4px !important;
}

.special-wild svg,
.special-scatter svg {
  width: 70%;
  max-height: 48px;
}

.special-tag {
  font-family: var(--font-tech);
  font-size: clamp(0.45rem, 2vw, 0.58rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #3a2008;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.is-scatter .special-tag { color: #064838; }
.is-mult .special-tag { color: #fff8e0; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }

.mult-chip {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 30%, #ffe8a0, #ff8a3d 55%, #a02810);
  border: 2px solid #ffe566;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.35),
    inset 0 2px 4px rgba(255, 255, 255, 0.35);
}

.mult-chip span {
  font-family: var(--font-tech);
  font-weight: 800;
  font-size: clamp(0.85rem, 3.5vw, 1.15rem);
  color: #fff;
  text-shadow: 0 2px 0 rgba(80, 20, 0, 0.45);
}

@keyframes wild-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

/* Winning highlight */
.symbol.win-glow {
  animation: win-pop 0.65s ease-out infinite alternate;
  z-index: 3;
  filter: brightness(1.15) saturate(1.15);
}

.symbol.win-glow .card-face {
  box-shadow:
    0 0 20px rgba(240, 193, 75, 0.9),
    0 0 36px rgba(255, 45, 85, 0.45),
    0 0 0 2px #ffe566,
    inset 0 0 12px rgba(255, 255, 255, 0.5);
}

@keyframes win-pop {
  from {
    transform: scale(1.04) rotateY(-6deg) rotateX(3deg) translateZ(10px);
  }
  to {
    transform: scale(1.1) rotateY(6deg) rotateX(-3deg) translateZ(22px);
  }
}

.reels-viewport.depth-pulse {
  animation: depth-pulse 0.6s ease-out;
}

@keyframes depth-pulse {
  0% { transform: scale(1) rotateX(0); }
  40% { transform: scale(1.025) rotateX(3deg); }
  100% { transform: scale(1) rotateX(0); }
}

.payline-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.payline-overlay svg {
  width: 100%;
  height: 100%;
}

.win-flash {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(255, 229, 102, 0.35), transparent 60%);
  opacity: 0;
}

.win-flash.flash {
  animation: flash-burst 0.5s ease-out;
}

@keyframes flash-burst {
  0% { opacity: 0.9; }
  100% { opacity: 0; }
}

.message-bar {
  margin-top: 8px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(240, 193, 75, 0.15);
  z-index: 2;
}

#message {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  text-shadow: 0 0 10px rgba(240, 193, 75, 0.3);
}

/* ——— Win overlay ——— */
.win-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, rgba(20, 5, 15, 0.55), rgba(0, 0, 0, 0.75));
  backdrop-filter: blur(2px);
  animation: overlay-in 0.25s ease-out;
}

.win-overlay[hidden] {
  display: none;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.win-burst {
  text-align: center;
  position: relative;
  animation: win-scale-in 0.55s cubic-bezier(0.22, 1.5, 0.36, 1);
}

@keyframes win-scale-in {
  from { transform: scale(0.3) rotateX(40deg); opacity: 0; }
  to { transform: scale(1) rotateX(0); opacity: 1; }
}

.win-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  border-radius: 50%;
  border: 3px solid rgba(240, 193, 75, 0.6);
  animation: ring-expand 1.2s ease-out infinite;
  pointer-events: none;
}

.win-ring.delay {
  animation-delay: 0.35s;
  border-color: rgba(255, 45, 85, 0.5);
}

@keyframes ring-expand {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.win-label {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  background: linear-gradient(180deg, #fff, var(--gold-bright), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 20px rgba(240, 193, 75, 0.7));
  position: relative;
  z-index: 1;
}

.win-amount {
  font-family: var(--font-tech);
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(240, 193, 75, 0.8), 0 4px 0 #5a3010;
  position: relative;
  z-index: 1;
  margin-top: 4px;
}

.win-mult {
  font-family: var(--font-tech);
  font-size: 1.1rem;
  color: var(--crimson-hot);
  text-shadow: 0 0 12px rgba(255, 45, 85, 0.6);
  margin-top: 4px;
  min-height: 1.2em;
  position: relative;
  z-index: 1;
}

.win-overlay.mega .win-label {
  font-size: 1.9rem;
  letter-spacing: 0.15em;
}

.win-overlay.mega .win-amount {
  font-size: 3.2rem;
  animation: mega-pulse 0.4s ease-in-out infinite alternate;
}

@keyframes mega-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

/* ——— Controls ——— */
.controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-shrink: 0;
  z-index: 5;
}

.ctrl-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.ctrl-group.stacked {
  flex-direction: column;
  gap: 6px;
}

.btn-ctrl {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(240, 193, 75, 0.4);
  background: linear-gradient(180deg, #3a2030, #1a0c18);
  color: var(--gold);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.12s, box-shadow 0.12s;
}

.btn-ctrl:active {
  transform: scale(0.9);
}

.bet-chip {
  min-width: 72px;
}

.btn-secondary {
  width: 100%;
  max-width: 72px;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid rgba(240, 193, 75, 0.3);
  background: linear-gradient(180deg, #2a1830, #140a18);
  color: var(--ivory);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s, border-color 0.15s;
}

.btn-secondary:active {
  transform: scale(0.95);
}

.btn-secondary.active {
  border-color: var(--crimson-hot);
  background: linear-gradient(180deg, #5a1828, #2a0c14);
  color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(196, 30, 58, 0.4);
}

.spin-btn {
  position: relative;
  width: 88px;
  height: 88px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  padding: 0;
  justify-self: center;
}

.spin-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--gold), var(--crimson-hot), var(--gold-bright), var(--crimson), var(--gold));
  animation: spin-ring-idle 4s linear infinite;
  box-shadow: 0 0 28px rgba(240, 193, 75, 0.45);
}

.spin-btn:disabled .spin-ring {
  animation: spin-ring-fast 0.6s linear infinite;
  opacity: 0.85;
}

@keyframes spin-ring-idle {
  to { transform: rotate(360deg); }
}

@keyframes spin-ring-fast {
  to { transform: rotate(360deg); }
}

.spin-core {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #ff6a7a, transparent 50%),
    linear-gradient(160deg, #e02040, #6b0818);
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.35),
    inset 0 -4px 8px rgba(0, 0, 0, 0.4),
    0 8px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s;
}

.spin-btn:active:not(:disabled) .spin-core {
  transform: scale(0.94);
}

.spin-text {
  font-family: var(--font-tech);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.spin-btn:disabled .spin-text {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.btn-refill {
  display: block;
  margin: 6px auto 0;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(240, 193, 75, 0.45);
  background: linear-gradient(180deg, #3a2030, #1a0c18);
  color: var(--gold-bright);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 5;
}

.btn-refill[hidden] {
  display: none;
}

/* Screen shake */
#app.shake {
  animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

/* Desktop widen slightly */
@media (min-width: 520px) {
  #app {
    max-width: 420px;
    padding-top: 16px;
  }
}

@media (max-height: 700px) {
  .jackpot-rail { margin: 6px 0; }
  .plaque-title { font-size: 1rem; }
  .spin-btn { width: 76px; height: 76px; }
  .win-amount { font-size: 2.1rem; }
}
