/* =========================================================
   Sweet Bonanza™ Demo — Dreamy Candy Land UI & Animations
   100% self-contained, responsive desktop + mobile, 60fps
   ========================================================= */

:root {
  --pink-hot: #ff3e9d;
  --pink-soft: #ff9fd0;
  --gold-1: #fff5b8;
  --gold-2: #fbbf24;
  --gold-3: #d97706;
  --plum-deep: #3b0764;
  --glass-dark: rgba(24, 10, 44, 0.78);
  --glass-border: rgba(255, 214, 244, 0.32);
  --font-display: "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  font-family: var(--font-body);
  color: #fff;
  overflow-x: hidden;
  background: #ff9ec9;
}

.hidden {
  display: none !important;
}

/* ================= CANDY LAND WORLD BACKDROP ================= */

.world-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.sky-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    #63c8ff 0%,
    #9ce0ff 28%,
    #ffd1ec 64%,
    #ffa8d5 85%,
    #ff84c1 100%
  );
  transition: filter 1.2s ease, background 1.2s ease;
}

body.free-spins-mode .sky-layer {
  background: linear-gradient(
    180deg,
    #1b083b 0%,
    #3d106b 32%,
    #7e1d7c 66%,
    #c0267a 88%,
    #f97316 100%
  );
}

.sun-rays {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 170vmax;
  height: 170vmax;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.14) 0deg 10deg,
    rgba(255, 255, 255, 0) 10deg 22deg
  );
  animation: spinSlow 65s linear infinite;
  opacity: 0.7;
}

body.free-spins-mode .sun-rays {
  background: repeating-conic-gradient(
    from 0deg,
    rgba(253, 224, 71, 0.15) 0deg 9deg,
    rgba(253, 224, 71, 0) 9deg 22deg
  );
  animation-duration: 32s;
  opacity: 0.9;
}

@keyframes spinSlow {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Fluffy clouds */
.cloud {
  position: absolute;
  background: rgba(255, 250, 255, 0.75);
  border-radius: 999px;
  filter: blur(1px);
  box-shadow: 0 12px 30px rgba(255, 130, 195, 0.25);
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.cloud-1 {
  width: 220px; height: 64px; top: 8%; left: -60px;
  animation: driftCloud 42s linear infinite;
}
.cloud-1::before { width: 96px; height: 96px; top: -44px; left: 32px; }
.cloud-1::after { width: 76px; height: 76px; top: -32px; right: 34px; }

.cloud-2 {
  width: 260px; height: 74px; top: 18%; right: -80px;
  opacity: 0.65;
  animation: driftCloudRev 52s linear infinite;
}
.cloud-2::before { width: 112px; height: 112px; top: -52px; left: 44px; }
.cloud-2::after { width: 84px; height: 84px; top: -34px; right: 42px; }

.cloud-3 {
  width: 180px; height: 52px; top: 30%; left: 18%;
  opacity: 0.5;
  animation: driftCloud 60s linear infinite;
}
.cloud-3::before { width: 78px; height: 78px; top: -36px; left: 26px; }

body.free-spins-mode .cloud {
  background: rgba(232, 121, 249, 0.26);
  box-shadow: 0 0 36px rgba(244, 114, 182, 0.3);
}

@keyframes driftCloud {
  0% { transform: translateX(-10vw); }
  100% { transform: translateX(115vw); }
}
@keyframes driftCloudRev {
  0% { transform: translateX(10vw); }
  100% { transform: translateX(-115vw); }
}

/* Frosting Hills */
.candy-hills {
  position: absolute;
  inset: auto 0 0 0;
  height: 36vh;
}
.hill {
  position: absolute;
  bottom: -14vh;
  border-radius: 50% 50% 0 0;
  transition: background 1.2s ease;
}
.hill-back {
  left: 10%; width: 80vw; height: 38vh;
  background: radial-gradient(circle at 50% 20%, #fff0f8, #ffb6db 55%, #f472b6 100%);
  opacity: 0.85;
}
.hill-left {
  left: -16vw; width: 62vw; height: 34vh;
  background: radial-gradient(circle at 40% 25%, #ffe5f3, #ff8dc7 60%, #e11d8a 100%);
}
.hill-right {
  right: -16vw; width: 62vw; height: 34vh;
  background: radial-gradient(circle at 60% 25%, #fff0fa, #ff99d0 60%, #db2777 100%);
}

body.free-spins-mode .hill-back {
  background: radial-gradient(circle at 50% 20%, #a855f7, #581c87 70%, #2e1065 100%);
}
body.free-spins-mode .hill-left,
body.free-spins-mode .hill-right {
  background: radial-gradient(circle at 50% 20%, #d946ef, #6b21a8 65%, #2e1065 100%);
}

/* Decorative Side Lollipops */
.deco-lollipop {
  position: absolute;
  bottom: 12vh;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: repeating-conic-gradient(#ff4da6 0deg 30deg, #fff5fa 30deg 60deg);
  border: 5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 26px rgba(157, 23, 77, 0.35), inset 0 8px 16px rgba(255, 255, 255, 0.5);
  animation: gentleSway 5.5s ease-in-out infinite;
}
.deco-lollipop::after {
  content: "";
  position: absolute;
  top: 90px;
  left: 50%;
  width: 12px;
  height: 150px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #f8fafc, #cbd5e1, #f8fafc);
  border-radius: 6px;
}
.deco-left { left: 2.5vw; transform-origin: bottom center; }
.deco-right {
  right: 2.5vw;
  width: 82px; height: 82px;
  background: repeating-conic-gradient(#38bdf8 0deg 30deg, #fff 30deg 60deg);
  animation-delay: -2.4s;
  transform-origin: bottom center;
}

@keyframes gentleSway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

.sugar-dust {
  position: absolute;
  inset: 0;
}
.sparkle-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px #fff, 0 0 18px #fde047;
  animation: floatSparkle linear infinite;
}
@keyframes floatSparkle {
  0% { transform: translateY(105vh) scale(0.4); opacity: 0; }
  15% { opacity: 0.9; }
  85% { opacity: 0.85; }
  100% { transform: translateY(-10vh) scale(1.1); opacity: 0; }
}

/* ================= APP SHELL ================= */

.app-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-width: 1260px;
  margin: 0 auto;
  padding: 10px 16px 12px;
  gap: 8px;
}

/* ================= HEADER ================= */

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.game-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(131, 24, 67, 0.48));
}

.logo-sweet {
  font-size: clamp(1.35rem, 2.5vw, 2.05rem);
  background: linear-gradient(180deg, #fff 0%, #ffe0f0 40%, #ff55a5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1.5px #831843;
}

.logo-bonanza {
  font-size: clamp(1.35rem, 2.5vw, 2.05rem);
  background: linear-gradient(180deg, #fff9c4 0%, #facc15 48%, #ea580c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1.5px #7c2d12;
}

.logo-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #451a03;
  letter-spacing: 0.8px;
  vertical-align: top;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.demo-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: rgba(46, 16, 101, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

/* Free Spins HUD */
.fs-hud {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 7px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.92), rgba(190, 24, 93, 0.92));
  border: 2px solid #fde047;
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.55);
  animation: pulseGoldBorder 1.8s ease-in-out infinite;
}
.fs-hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}
.fs-hud-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fbcfe8;
}
.fs-hud-val {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
}
.fs-hud-val.gold { color: #fde047; }
.fs-hud-divider {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.3);
}

@keyframes pulseGoldBorder {
  0%, 100% { box-shadow: 0 0 16px rgba(250, 204, 21, 0.45); }
  50% { box-shadow: 0 0 30px rgba(250, 204, 21, 0.85); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 38px;
  min-width: 38px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: rgba(46, 16, 101, 0.64);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 0.14s ease, background 0.2s ease, border-color 0.2s ease;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover {
  background: rgba(126, 34, 206, 0.85);
  border-color: #fde047;
  transform: translateY(-1px);
}
.icon-btn:active { transform: scale(0.95); }
.btn-mini-txt { font-size: 0.75rem; font-weight: 800; color: #fde047; }

/* ================= MAIN STAGE ================= */

.stage {
  flex: 1;
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  width: 100%;
}

/* Left Side Panel */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-card {
  position: relative;
  width: 100%;
  border-radius: 20px;
  padding: 14px 12px;
  text-align: center;
  color: #fff;
  border: 3px solid #fef08a;
  box-shadow: 0 10px 24px rgba(88, 28, 135, 0.38), inset 0 2px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.16s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.buy-card {
  cursor: pointer;
  background: linear-gradient(160deg, #ff55a5 0%, #db2777 52%, #9d174d 100%);
}
.buy-card:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 30px rgba(219, 39, 119, 0.55), 0 0 22px rgba(253, 224, 71, 0.45);
}
.buy-card:active:not(:disabled) { transform: scale(0.97); }
.buy-card:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.feature-ribbon {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 1.2px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  color: #fde047;
  margin-bottom: 6px;
}
.feature-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.15;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}
.feature-price {
  margin: 8px 0 4px;
  padding: 5px 8px;
  border-radius: 12px;
  background: rgba(34, 8, 56, 0.46);
  border: 1.5px solid rgba(254, 240, 138, 0.55);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  color: #fde047;
}
.feature-sub {
  font-size: 0.64rem;
  font-weight: 700;
  opacity: 0.92;
  letter-spacing: 0.4px;
}

.ante-card {
  background: linear-gradient(160deg, #9333ea 0%, #6b21a8 58%, #3b0764 100%);
  border-color: #d8b4fe;
}
.ante-card.active {
  background: linear-gradient(160deg, #16a34a 0%, #15803d 60%, #14532d 100%);
  border-color: #86efac;
  box-shadow: 0 10px 26px rgba(22, 163, 74, 0.45), 0 0 18px rgba(134, 239, 172, 0.35);
}
.ante-bet-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  opacity: 0.85;
}
.ante-bet-amount {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  color: #fde047;
  margin-bottom: 4px;
}
.ante-desc {
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
}

.ante-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 82px;
  height: 32px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-weight: 900;
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.ante-toggle:disabled { opacity: 0.55; cursor: not-allowed; }
.ante-knob {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #e2e8f0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ante-card.active .ante-knob {
  transform: translateX(38px);
  background: linear-gradient(180deg, #fef08a, #facc15);
}
.ante-card.active .ante-state {
  transform: translateX(-26px);
  color: #fef08a;
}

.mini-stats {
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(34, 10, 62, 0.62);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mini-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #f3e8ff;
}
.mini-stat-row strong { color: #fde047; font-weight: 800; }

/* ================= REEL BOARD ================= */

.board-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 8px;
}

.tumble-bar {
  width: 100%;
  max-width: 820px;
  display: flex;
  justify-content: center;
}

.tumble-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 38px;
  padding: 6px 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(64, 14, 99, 0.88), rgba(34, 8, 56, 0.92));
  border: 2px solid #f9a8d4;
  box-shadow: 0 6px 18px rgba(59, 7, 100, 0.42);
  transition: transform 0.2s ease, border-color 0.25s ease;
}

.tumble-pill.winning {
  border-color: #fde047;
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.55);
  transform: scale(1.04);
}

.tumble-label {
  font-family: var(--font-display);
  font-size: clamp(0.75rem, 1.3vw, 0.92rem);
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #fdf2f8;
}

.tumble-value {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  font-weight: 900;
  color: #fde047;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

.tumble-mult {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  font-weight: 900;
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f97316, #ec4899, #8b5cf6);
  border: 1.5px solid #fef08a;
  color: #fff;
  animation: popBadge 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popBadge {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Candy-Cane Frame */
.reel-frame {
  position: relative;
  width: 100%;
  max-width: 820px;
  padding: 11px;
  border-radius: 28px;
  background: repeating-linear-gradient(
    -45deg,
    #ff3b7f 0px,
    #ff3b7f 14px,
    #fff7fb 14px,
    #fff7fb 28px
  );
  box-shadow:
    0 20px 50px rgba(74, 4, 78, 0.45),
    0 0 0 4px #fde047,
    inset 0 2px 6px rgba(255, 255, 255, 0.8);
  transition: box-shadow 0.4s ease;
}

body.free-spins-mode .reel-frame {
  background: repeating-linear-gradient(
    -45deg,
    #f59e0b 0px,
    #f59e0b 14px,
    #ec4899 14px,
    #ec4899 28px
  );
  box-shadow:
    0 20px 60px rgba(236, 72, 153, 0.55),
    0 0 0 4px #fef08a,
    0 0 36px rgba(250, 204, 21, 0.5);
}

.reel-frame.shake {
  animation: boardShake 0.42s ease-in-out;
}
@keyframes boardShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 3px); }
  40% { transform: translate(5px, -4px); }
  60% { transform: translate(-4px, -2px); }
  80% { transform: translate(4px, 3px); }
}

.reel-frame-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 5;
  max-height: 64vh;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 245, 252, 0.45), rgba(255, 214, 238, 0.22) 60%, rgba(168, 85, 247, 0.24) 100%),
    rgba(255, 255, 255, 0.2);
  border: 3px solid rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 8px 26px rgba(131, 24, 67, 0.22);
  backdrop-filter: blur(8px);
}

body.free-spins-mode .reel-frame-inner {
  background:
    radial-gradient(circle at 50% 35%, rgba(139, 92, 246, 0.32), rgba(76, 29, 149, 0.48) 70%, rgba(30, 10, 60, 0.65) 100%);
  border-color: rgba(254, 240, 138, 0.75);
}

/* 6x5 Grid */
.grid-container {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(5, 1fr);
  padding: 6px;
  gap: 2px;
}

.cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
}

.sym-wrap {
  width: 92%;
  height: 92%;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform, opacity;
  filter: drop-shadow(0 5px 7px rgba(68, 12, 56, 0.36));
}

.sym-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Drop-in & Drop-out Physics */
.sym-wrap.drop-in {
  animation: symDropIn var(--drop-dur, 420ms) cubic-bezier(0.22, 1.24, 0.42, 1) var(--drop-delay, 0ms) both;
}

@keyframes symDropIn {
  0% {
    transform: translateY(var(--drop-from, -240%)) scale(0.92);
    opacity: 0.4;
  }
  75% {
    transform: translateY(5%) scale(1.04, 0.94);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.sym-wrap.drop-out {
  animation: symDropOut var(--out-dur, 240ms) cubic-bezier(0.55, 0.05, 0.78, 0.5) var(--out-delay, 0ms) forwards;
}

@keyframes symDropOut {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(280%) scale(0.92); opacity: 0; }
}

/* Win highlight + explode */
.sym-wrap.win-highlight {
  z-index: 6;
  animation: winPulse 0.42s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 14px #fde047) drop-shadow(0 0 6px #fff);
}

@keyframes winPulse {
  0% { transform: scale(1) rotate(-3deg); }
  100% { transform: scale(1.16) rotate(3deg); }
}

.sym-wrap.win-pop {
  animation: winPop 0.28s cubic-bezier(0.45, 0, 0.85, 0.4) forwards;
}
@keyframes winPop {
  0% { transform: scale(1.15); opacity: 1; }
  45% { transform: scale(1.38); opacity: 0.9; filter: brightness(1.6) drop-shadow(0 0 18px #fff); }
  100% { transform: scale(0.1); opacity: 0; }
}

/* Scatter glow */
.sym-wrap.scatter-glow {
  z-index: 7;
  animation: scatterBounce 0.55s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 16px #ff4da6) drop-shadow(0 0 10px #fde047);
}
@keyframes scatterBounce {
  0% { transform: scale(1) rotate(-6deg); }
  100% { transform: scale(1.18) rotate(6deg); }
}

/* Bomb continuous sparkle & launch */
.bomb-spark {
  transform-origin: 80px 15px;
  animation: sparkFlicker 0.35s ease-in-out infinite alternate;
}
@keyframes sparkFlicker {
  0% { transform: scale(0.8); opacity: 0.75; }
  100% { transform: scale(1.3); opacity: 1; }
}

.sym-wrap.bomb-detonate {
  z-index: 10;
  animation: bombDetonate 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 0 24px #fde047) drop-shadow(0 0 12px #ec4899);
}
@keyframes bombDetonate {
  0% { transform: scale(1); }
  45% { transform: scale(1.42) rotate(-8deg); }
  75% { transform: scale(1.22) rotate(5deg); }
  100% { transform: scale(1.08); }
}

/* Overlays inside reel frame */
.popups-layer {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  overflow: hidden;
}

.win-popup {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.05rem, 2.2vw, 1.65rem);
  color: #fef08a;
  text-shadow:
    0 3px 0 #831843,
    0 0 14px rgba(250, 204, 21, 0.85),
    0 5px 12px rgba(0, 0, 0, 0.65);
  white-space: nowrap;
  animation: floatPopup 1.15s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.win-popup.bomb-fly {
  font-size: clamp(1.3rem, 2.8vw, 2.1rem);
  color: #ffffff;
  text-shadow: 0 3px 0 #701a75, 0 0 22px #fde047;
  animation: flyToTop 0.72s cubic-bezier(0.3, 0.95, 0.4, 1) forwards;
}

@keyframes floatPopup {
  0% { transform: translate(-50%, -20%) scale(0.5); opacity: 0; }
  20% { transform: translate(-50%, -55%) scale(1.18); opacity: 1; }
  80% { transform: translate(-50%, -95%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -135%) scale(0.92); opacity: 0; }
}

@keyframes flyToTop {
  0% { transform: translate(-50%, -50%) scale(0.7); opacity: 1; }
  35% { transform: translate(-50%, -90%) scale(1.35); opacity: 1; }
  100% { left: 50%; top: 4%; transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
}

.fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9;
  pointer-events: none;
}

/* ================= BOTTOM CONTROL BAR ================= */

.control-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-radius: 22px;
  background: var(--glass-dark);
  border: 2px solid var(--glass-border);
  box-shadow: 0 12px 32px rgba(34, 8, 56, 0.55);
  backdrop-filter: blur(14px);
}

.control-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #fdf2f8;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.ctrl-pill:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #f9a8d4;
}
.ctrl-pill.active {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  border-color: #fef08a;
  color: #fff;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.55);
}

.autoplay-wrap { position: relative; }
.autoplay-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  width: 210px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(28, 10, 52, 0.96);
  border: 2px solid #f472b6;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
  z-index: 30;
}
.ap-title {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fde047;
  margin-bottom: 8px;
  text-align: center;
}
.ap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.ap-opt {
  padding: 8px 0;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  cursor: pointer;
}
.ap-opt:hover {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  border-color: #fef08a;
}
.ap-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  color: #f3e8ff;
  cursor: pointer;
}

/* Meters */
.control-meters {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.5vw, 34px);
}

.meter-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 96px;
}
.meter-label {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #f9a8d4;
}
.meter-value {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.9vw, 1.42rem);
  font-weight: 900;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}
.meter-value.gold { color: #fde047; }

/* Spin & Bet Steppers */
.control-spin {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bet-step-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.bet-step-btn:hover:not(:disabled) {
  background: rgba(236, 72, 153, 0.65);
  border-color: #fde047;
  transform: scale(1.08);
}
.bet-step-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.spin-btn {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 3px solid #fef08a;
  background: radial-gradient(circle at 35% 28%, #86efac, #22c55e 48%, #15803d 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 22px rgba(21, 128, 61, 0.55),
    0 0 18px rgba(134, 239, 172, 0.45),
    inset 0 3px 6px rgba(255, 255, 255, 0.55);
  transition: transform 0.14s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.spin-btn:hover {
  transform: scale(1.06);
  filter: brightness(1.08);
}
.spin-btn:active { transform: scale(0.95); }
.spin-btn.spinning .spin-svg {
  animation: spinArrows 0.8s linear infinite;
}
.spin-btn.autoplay-on {
  background: radial-gradient(circle at 35% 28%, #fca5a5, #ef4444 50%, #991b1b 100%);
  box-shadow: 0 8px 22px rgba(239, 68, 68, 0.55);
}
.spin-svg { width: 38px; height: 38px; }
.spin-stop-icon { font-size: 1.5rem; }

@keyframes spinArrows {
  to { transform: rotate(360deg); }
}

/* ================= OVERLAYS & MODALS ================= */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 6, 38, 0.76);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.coin-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.win-banner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 32px 48px;
  border-radius: 32px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.92), rgba(131, 24, 67, 0.96));
  border: 4px solid #fef08a;
  box-shadow: 0 0 60px rgba(250, 204, 21, 0.7), 0 24px 60px rgba(0, 0, 0, 0.65);
  animation: popModal 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}
@keyframes popModal {
  0% { transform: scale(0.45); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.win-tier {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #ffffff 0%, #fef08a 45%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 5px 0 #7c2d12);
}

.win-amount {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 5px 0 #831843, 0 0 28px #fde047;
  font-variant-numeric: tabular-nums;
}

.win-hint {
  margin-top: 14px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 1px;
  opacity: 0.85;
}

/* Free Spins Intro/Outro Modal */
.fs-modal-card {
  max-width: 460px;
  width: 100%;
  text-align: center;
  padding: 32px 28px;
  border-radius: 28px;
  background: linear-gradient(165deg, #7e22ce 0%, #be185d 60%, #4c0519 100%);
  border: 4px solid #fef08a;
  box-shadow: 0 0 55px rgba(236, 72, 153, 0.65), 0 22px 50px rgba(0, 0, 0, 0.6);
  animation: popModal 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fs-modal-sparkles { font-size: 2.2rem; margin-bottom: 6px; }
.fs-modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  color: #fbcfe8;
  letter-spacing: 1px;
}
.fs-modal-big {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 900;
  color: #fde047;
  margin: 8px 0;
  text-shadow: 0 4px 0 #7c2d12;
}
.fs-modal-sub {
  font-size: 0.95rem;
  color: #fdf2f8;
  margin-bottom: 20px;
  line-height: 1.45;
}
.candy-cta {
  padding: 13px 34px;
  border-radius: 999px;
  border: 3px solid #fef08a;
  background: linear-gradient(180deg, #4ade80, #16a34a);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.5);
  transition: transform 0.15s ease;
}
.candy-cta:hover { transform: scale(1.06); }

/* Buy Dialog */
.dialog-card {
  max-width: 400px;
  width: 100%;
  padding: 26px 24px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(170deg, #3b0764, #1e0836);
  border: 3px solid #f472b6;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.65);
  animation: popModal 0.28s ease;
}
.dialog-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  color: #fde047;
}
.dialog-desc {
  font-size: 0.9rem;
  color: #f3e8ff;
  line-height: 1.5;
  margin: 12px 0;
}
.dialog-cost {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  margin: 12px 0 20px;
  text-shadow: 0 3px 10px rgba(236, 72, 153, 0.6);
}
.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dialog-btn {
  padding: 12px;
  border-radius: 14px;
  border: 2px solid transparent;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.95rem;
  cursor: pointer;
  color: #fff;
}
.dialog-btn.cancel {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}
.dialog-btn.confirm {
  background: linear-gradient(135deg, #22c55e, #15803d);
  border-color: #fef08a;
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45);
}

/* Paytable Modal */
.info-card {
  max-width: 780px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(170deg, #2e1065, #180630);
  border: 3px solid #f472b6;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}
.info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.info-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.12rem;
  color: #fde047;
}
.close-x {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}
.info-body {
  padding: 18px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.info-note {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(236, 72, 153, 0.16);
  border: 1px solid rgba(244, 114, 182, 0.4);
  font-size: 0.86rem;
  line-height: 1.45;
}
.paytable-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pt-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.pt-icon { width: 52px; height: 52px; flex-shrink: 0; }
.pt-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.78rem;
  width: 100%;
}
.pt-row {
  display: flex;
  justify-content: space-between;
}
.pt-row span { color: #f9a8d4; font-weight: 700; }
.pt-row strong { color: #fde047; font-variant-numeric: tabular-nums; }

.info-specials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.special-box {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(254, 240, 138, 0.3);
}
.special-icon { width: 64px; height: 64px; flex-shrink: 0; }
.special-box h4 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 0.86rem;
  color: #fde047;
}
.special-box p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #f3e8ff;
}

/* ================= RESPONSIVE MOBILE / TABLET ================= */

@media (max-width: 960px) {
  .stage {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .board-section { order: 1; }
  .side-panel {
    order: 2;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .feature-card {
    flex: 1 1 155px;
    max-width: 240px;
    padding: 10px;
  }
  .mini-stats { display: none; }
  .deco-lollipop { display: none; }
}

@media (max-width: 680px) {
  .app-shell { padding: 8px 10px 10px; }
  .demo-pill { display: none; }
  .reel-frame { padding: 7px; border-radius: 20px; }
  .reel-frame-inner { border-radius: 14px; }
  .control-bar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 12px;
  }
  .control-left { justify-content: center; }
  .control-spin { justify-content: center; }
  .paytable-grid { grid-template-columns: repeat(2, 1fr); }
  .info-specials { grid-template-columns: 1fr; }
}
