/* ── CANDY ACCENTS (theme-agnostic, slightly muted) ─────────────────────── */
:root {
  --candy-pink:   #f06d96;
  --candy-yellow: #f5c947;
  --candy-orange: #ee9355;
  --candy-mint:   #4cd1b0;
  --candy-blue:   #5aa8e8;
  --candy-purple: #9b78e0;
  --candy-red:    #e8606e;
}

/* ── TOKENS (dark — light mode removed) ─────────────────────────────────── */
:root,
:root[data-theme="dark"] {
  --cream:     #232137;          /* warmer charcoal-slate — card surfaces */
  --paper:     #2d2a44;          /* soft slate — interior surfaces */
  --ink:       #ffffff;          /* text */
  --ink-soft:  #d8cee8;
  --outline-c: #4a4060;          /* card borders */
  --drop-c:    #0a0816;          /* 3D drop shadows / canvas outlines */

  --bg-1: #232047;
  --bg-2: #1a2342;
  --bg-3: #2a1d3c;
  --bg-4: #15132a;
  --bg-5: #0e0d1e;

  --frame-1: #232047;
  --frame-2: #1d2645;
  --frame-3: #141d33;

  --tip-bg:    #1d1a30;
  --tip-dash:  var(--ink-soft);

  --tab-active: #d6a83f;

  --r:    16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --outline: 3px solid var(--outline-c);
  --drop:    0 4px 0 var(--drop-c);
  --drop-sm: 0 3px 0 var(--drop-c);

  /* Universal text-stroke colour for chunky white-on-dark text. */
  --text-stroke-c: #0a0816;

  /* Rectangular "ad" glyph used on every rewarded-ad button — a rounded
     banner frame with a play triangle inside, so the offer reads clearly
     as "watch an ad" rather than a bare play arrow (CrazyGames review).
     Applied as a mask so each button can tint it (white on dark, dark on
     gold) via background-color. */
  --ad-play-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2016'%3E%3Cpath%20fill-rule='evenodd'%20d='M2%200h20a2%202%200%200%201%202%202v12a2%202%200%200%201-2%202H2a2%202%200%200%201-2-2V2a2%202%200%200%201%202-2zm1.4%203.4v9.2h17.2V3.4z'/%3E%3Cpath%20d='M9.7%204.8%2015.6%208%209.7%2011.2z'/%3E%3C/svg%3E");
}

/* ── RESET ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Lock the page so nothing can scroll the document / CrazyGames iframe
   (per the CrazyGames common-fixes guide).  All in-game scrolling is
   confined to #tab-content; the document itself never scrolls, which
   also stops the tutorial highlight from jumping the host page. */
html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  position: fixed;
  width: 100%;
  /* Solid dark base under everything.  Safari paints the document
     element's background in the safe-area insets / overscroll regions
     that the fixed-position body gradient doesn't cover — without this
     it defaulted to white and clashed with the dark game (CrazyGames
     review: Safari showed a white page background).  Chrome already
     inherited a dark base, so this only changes Safari. */
  background-color: var(--bg-5);
}
body {
  background:
    radial-gradient(ellipse at 20% 0%,  var(--bg-1) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 30%, var(--bg-2) 0%, transparent 60%),
    radial-gradient(ellipse at 40% 100%, var(--bg-3) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-4) 0%, var(--bg-5) 100%);
  color: var(--ink);
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  /* Disable accidental text selection / long-press menus across the whole game */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
img, svg, canvas { -webkit-user-drag: none; user-drag: none; }

/* ── LOADER ──────────────────────────────────────────────────────────────
   Dark cavern backdrop + animated mini plinko field + wobble-pulse logo
   + diagonal-shine progress bar.  Dark by default so the very first paint
   matches the in-game dark theme (no flash of light). */
#loader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 30%, #4b1d5a 0%, transparent 55%),
    radial-gradient(ellipse at 50% 85%, #1d3a6b 0%, transparent 60%),
    linear-gradient(180deg, #1a0a2e 0%, #050310 100%);
  transition: opacity 0.5s;
}
/* Vertical light shaft behind the logo — slow shimmer that screams "press
   play".  Pure CSS, no JS. */
.loader-light-shaft {
  position: absolute;
  left: 50%;
  top: -10vh;
  width: clamp(180px, 22vw, 320px);
  height: 140vh;
  transform: translateX(-50%);
  background: linear-gradient(180deg,
    rgba(255, 210, 63, 0)   0%,
    rgba(255, 210, 63, 0.18) 30%,
    rgba(255, 110, 199, 0.22) 50%,
    rgba(160, 108, 255, 0.18) 70%,
    rgba(160, 108, 255, 0)   100%);
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
  animation: loader-shaft-pulse 4s ease-in-out infinite;
}
@keyframes loader-shaft-pulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scaleY(1); }
  50%      { opacity: 1;   transform: translateX(-50%) scaleY(1.08); }
}

/* Three expanding ring pulses behind the logo, staggered. */
.loader-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 100px; height: 100px;
  border: 3px solid rgba(255, 210, 63, 0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  animation: loader-ring-expand 2.4s ease-out infinite;
}
.loader-ring-2 { animation-delay: 0.8s; border-color: rgba(255, 110, 199, 0.55); }
.loader-ring-3 { animation-delay: 1.6s; border-color: rgba(160, 108, 255, 0.55); }
@keyframes loader-ring-expand {
  0%   { width: 80px;  height: 80px;  opacity: 0.9; border-width: 4px; }
  60%  {                                opacity: 0.4; border-width: 2px; }
  100% { width: 520px; height: 520px; opacity: 0;   border-width: 1px; }
}

/* Sparkles — small 4-point stars drifting upward, fading in and out. */
.loader-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.loader-sparkle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 10px; height: 10px;
  background:
    linear-gradient(180deg, transparent 45%, #ffd23f 45%, #ffd23f 55%, transparent 55%) 50% 50% / 100% 100% no-repeat,
    linear-gradient(90deg,  transparent 45%, #ffd23f 45%, #ffd23f 55%, transparent 55%) 50% 50% / 100% 100% no-repeat;
  filter: drop-shadow(0 0 4px rgba(255, 210, 63, 0.85));
  transform: translate(-50%, -50%) rotate(45deg) scale(0);
  animation: loader-sparkle-twinkle 2.4s ease-in-out infinite;
  animation-delay: var(--d);
}
@keyframes loader-sparkle-twinkle {
  0%, 100% { transform: translate(-50%, -50%) rotate(45deg)  scale(0);   opacity: 0; }
  30%      { transform: translate(-50%, -50%) rotate(180deg) scale(1.2); opacity: 1; }
  60%      { transform: translate(-50%, -50%) rotate(320deg) scale(0.8); opacity: 0.5; }
}
.loader-inner {
  position: relative;
  text-align: center;
  z-index: 1;
  animation: loader-pop-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes loader-pop-in {
  0%   { transform: scale(0.5) rotate(-8deg); opacity: 0; }
  60%  { transform: scale(1.08) rotate(2deg);  opacity: 1; }
  100% { transform: scale(1)    rotate(0);     opacity: 1; }
}

.loader-logo {
  font-family: 'Titan One', cursive;
  font-size: clamp(68px, 11vw, 122px);
  letter-spacing: 2px;
  /* Two clipped layers: a diagonal white sheen that sweeps across (animated
     via background-position) over a glossy candy gradient. */
  background:
    linear-gradient(115deg, transparent 36%, rgba(255,255,255,0.92) 48%, transparent 60%),
    linear-gradient(180deg, #fff7cc 0%, #ffd23f 30%, #ff7eb4 62%, #a06cff 100%);
  background-size: 250% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-position: -120% 0, 0 0;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  -webkit-text-stroke: 3px #2a0b16;
  paint-order: stroke fill;
  /* Stacked solid offsets = chunky 3D extrude; soft ambient + warm glow. */
  filter:
    drop-shadow(0 2px 0 #5a163b)
    drop-shadow(0 5px 0 #2a0b16)
    drop-shadow(0 10px 13px rgba(0,0,0,0.45))
    drop-shadow(0 0 28px rgba(255,196,90,0.55));
  transform: rotate(-3deg);
  animation:
    loader-logo-wobble 2.6s ease-in-out infinite,
    loader-logo-sheen 3.2s ease-in-out infinite;
}
@keyframes loader-logo-wobble {
  0%, 100% { transform: rotate(-3deg) scale(1); }
  50%      { transform: rotate(2deg)  scale(1.04); }
}
/* Sheen sweep — only the first (highlight) background layer moves. */
@keyframes loader-logo-sheen {
  0%       { background-position: -120% 0, 0 0; }
  55%, 100% { background-position: 250% 0, 0 0; }
}
.loader-tagline {
  font-family: 'Luckiest Guy', cursive;
  font-size: clamp(14px, 1.6vw, 18px);
  letter-spacing: 3px;
  color: #ffd96b;
  -webkit-text-stroke: 1.2px #0a0414;
  paint-order: stroke fill;
  margin-top: 4px;
  margin-bottom: 28px;
  filter: drop-shadow(0 2px 0 #0a0414);
  animation: loader-tagline-glow 1.8s ease-in-out infinite;
}
@keyframes loader-tagline-glow {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}

.loader-bar-wrap {
  position: relative;
  width: min(280px, 70vw);
  height: 18px;
  background: rgba(0, 0, 0, 0.42);
  border: 2.5px solid #2c1856;
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto;
  box-shadow:
    0 4px 0 #0a0414,
    inset 0 2px 0 rgba(255,255,255,0.08);
}
.loader-bar-fill {
  position: relative;
  height: 100%; width: 0;
  background: linear-gradient(90deg, #ff8a3c, #ffd23f, #ff5d8f, #a06cff);
  background-size: 200% 100%;
  border-radius: 999px;
  box-shadow:
    inset 0 -2px 0 rgba(0,0,0,0.25),
    inset 0 1.5px 0 rgba(255,255,255,0.55);
  transition: width 0.6s ease;
  animation: loader-bar-shift 3s linear infinite;
}
@keyframes loader-bar-shift {
  to { background-position: -200% 0; }
}
/* Diagonal shine sweep that races across whatever portion is filled. */
.loader-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    transparent 30%,
    rgba(255,255,255,0.55) 50%,
    transparent 70%);
  animation: loader-bar-shine 1.8s linear infinite;
}
@keyframes loader-bar-shine {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── ROOT LAYOUT ────────────────────────────────────────────────────────── */
#root {
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
  padding: 10px;
  gap: 10px;
}

/* ── HUD ────────────────────────────────────────────────────────────────── */
.hud {
  flex-shrink: 0;
  height: 52px;
  background: var(--paper);
  border: var(--outline);
  border-radius: var(--r-lg);
  box-shadow: var(--drop);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}
.hud-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
}

.hud-block {
  display: flex; align-items: center; gap: 7px;
  background: var(--cream);
  border: 2.5px solid var(--outline-c);
  border-radius: 999px;
  padding: 2px 11px 2px 2px;
  box-shadow: var(--drop-sm);
}
.hud-block-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2.5px solid var(--outline-c);
  flex-shrink: 0;
}
.hud-total .hud-block-icon { background: linear-gradient(180deg, #ffb6da, #ff5d8f); }
.hud-sp .hud-block-icon    { background: linear-gradient(180deg, #c8a8ff 0%, #8a4fee 100%); }
.hud-sp .hud-block-icon svg { display: block; filter: drop-shadow(0 1px 0 rgba(0,0,0,0.18)); }

/* ── HUD COINS · GRAND TREASURE PILL ──────────────────────────────────────
   Shrink-to-fit the (always-≤5-char) fmt() output — e.g. "999", "1.5K",
   "1.23M" — so the pill is tight against the SP pill instead of carrying
   a fixed 280px reservation that pushed the layout apart. */
.hud-coins {
  background: var(--cream);
  border: 2.5px solid var(--outline-c);
  padding: 4px 14px 4px 4px;
  gap: 10px;
  width: auto;
  flex: 0 0 auto;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  box-shadow: var(--drop-sm);
}
.hud-coins .hud-block-text {
  flex: 0 0 auto;
  text-align: left;
}
.hud-coins::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 60%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.55) 50%, transparent 100%);
  transform: translateX(-200%);
  animation: coin-shine 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes coin-shine {
  0%, 75%   { transform: translateX(-200%); }
  90%, 100% { transform: translateX(280%); }
}

.hud-coins .hud-block-icon {
  width: 44px; height: 44px;
  background: radial-gradient(circle at 30% 30%, #fff5d8 0%, #ffd970 35%, #ff9920 100%);
  border: 3px solid var(--outline-c);
  font-size: 22px;
  animation: coin-bob 2.4s ease-in-out infinite;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.65);
}
@keyframes coin-bob {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50%      { transform: rotate(4deg) translateY(-2px); }
}

.hud-coins .hud-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: #ffffff;
  -webkit-text-stroke: 1.2px var(--text-stroke-c);
  paint-order: stroke fill;
}

.hud-coins .hud-value {
  font-size: 26px;
  letter-spacing: 1.5px;
  color: #ffffff;
  -webkit-text-stroke: 2.5px var(--text-stroke-c);
  paint-order: stroke fill;
  display: inline-block;
  transform-origin: center;
}

/* Bump animation triggered on coin update */
.hud-coins.bump .hud-value {
  animation: coin-bump 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hud-sp.bump .hud-value {
  animation: coin-bump 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes coin-bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.22); }
  100% { transform: scale(1); }
}
.hud-block-text { display: flex; flex-direction: column; line-height: 1; }
.hud-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 9px; letter-spacing: 1.5px;
  color: var(--ink-soft);
  text-transform: uppercase;
  font-weight: 700;
}
.hud-value {
  font-family: 'Luckiest Guy', cursive;
  font-size: 20px; letter-spacing: 1px;
  color: var(--ink);
  margin-top: 2px;
}

.hud-title {
  font-family: 'Titan One', cursive;
  font-size: 32px; letter-spacing: 1.5px;
  background:
    linear-gradient(115deg, transparent 38%, rgba(255,255,255,0.85) 50%, transparent 62%),
    linear-gradient(180deg, #ffe27a 0%, #ffb13f 45%, #ff5d8f 100%);
  background-size: 250% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-position: -120% 0, 0 0;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  -webkit-text-stroke: 2px var(--text-stroke-c);
  paint-order: stroke fill;
  filter:
    drop-shadow(0 2px 0 var(--drop-c))
    drop-shadow(0 4px 6px rgba(0,0,0,0.4));
  transform: rotate(-2deg);
  user-select: none;
  animation: hud-title-sheen 3.6s ease-in-out infinite;
}
@keyframes hud-title-sheen {
  0%       { background-position: -120% 0, 0 0; }
  55%, 100% { background-position: 250% 0, 0 0; }
}

.hud-mute {
  background: var(--paper);
  border: 2.5px solid var(--outline-c);
  color: var(--ink);
  border-radius: 50%;
  width: 42px; height: 42px;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s;
  box-shadow: var(--drop-sm);
}
.hud-mute svg, .hud-theme svg, .hud-reset svg {
  width: 64%; height: 64%;
  display: block;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.15));
}
.hud-mute:hover  { /* still on hover */ }
.hud-mute:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--drop-c); }
.hud-mute.muted  { background: color-mix(in srgb, var(--candy-red) 25%, var(--paper)); }

/* ── GAME AREA ──────────────────────────────────────────────────────────── */
.game-area {
  flex: 1; display: flex; overflow: hidden; min-height: 0; gap: 10px;
}

/* ── BOARD PANEL (left) ──────────────────────────────────────────────────── */
.board-panel {
  /* Field is sized purely by how tall the 600/620 canvas can be — the
     side panel shrinks instead. A floor keeps the UI panel usable on
     extreme aspect ratios.  Chrome budget = HUD (52) + auto-bar (36)
     + drop-btn (40) + bonus-ball-btn (36) + gaps/padding (~56) ≈ 220.
     The 220px figure is the smallest budget that keeps the right
     column ≥ 468px wide on the typical viewport — narrower than that
     hides the leaderboard slot because the candidate ladder has no
     320px fallback. */
  flex: 0 0 auto;
  width: calc((100vh - 220px) * 600 / 620 + 20px);
  max-width: calc(100vw - 220px);
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start;
  padding: 10px;
  gap: 8px;
  background: var(--paper);
  border: var(--outline);
  border-radius: var(--r-lg);
  box-shadow: var(--drop);
  overflow: hidden;
}

/* Auto-bar row = chunky pause toggle button + auto-drop bar.  The button
   is intentionally larger than the bar so it pops as a primary control. */
.auto-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 36px;
  flex-shrink: 0;
}
.auto-pause-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 3px solid var(--drop-c);
  border-radius: 999px;
  background: linear-gradient(180deg, #8be7ff 0%, #3aa9ff 55%, #1a6dcc 100%);
  cursor: pointer;
  box-shadow:
    var(--drop),
    inset 0 3px 0 rgba(255,255,255,0.55),
    inset 0 -3px 0 rgba(0,0,0,0.22),
    0 0 14px rgba(58,169,255,0.55);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  animation: auto-pause-running-pulse 1.8s ease-in-out infinite;
}
.auto-pause-btn svg { width: 60%; height: 60%; display: block; filter: drop-shadow(0 1px 0 rgba(0,0,0,0.35)); }
.auto-pause-btn:hover  { filter: brightness(1.08); transform: translateY(-1px); }
.auto-pause-btn:active { transform: translateY(2px); box-shadow: var(--drop-sm), inset 0 3px 0 rgba(255,255,255,0.55), inset 0 -2px 0 rgba(0,0,0,0.22); }
@keyframes auto-pause-running-pulse {
  0%, 100% { box-shadow: var(--drop), inset 0 3px 0 rgba(255,255,255,0.55), inset 0 -3px 0 rgba(0,0,0,0.22), 0 0 8px rgba(58,169,255,0.45); }
  50%      { box-shadow: var(--drop), inset 0 3px 0 rgba(255,255,255,0.55), inset 0 -3px 0 rgba(0,0,0,0.22), 0 0 20px rgba(58,169,255,0.85); }
}
.auto-pause-btn.paused {
  background: linear-gradient(180deg, #ffe699 0%, #ffd23f 55%, #ff8a3c 100%);
  animation: auto-pause-paused-pulse 1.1s ease-in-out infinite;
}
@keyframes auto-pause-paused-pulse {
  0%, 100% { box-shadow: var(--drop), inset 0 3px 0 rgba(255,255,255,0.55), inset 0 -3px 0 rgba(0,0,0,0.22), 0 0 10px rgba(255,210,63,0.55); transform: scale(1); }
  50%      { box-shadow: var(--drop), inset 0 3px 0 rgba(255,255,255,0.55), inset 0 -3px 0 rgba(0,0,0,0.22), 0 0 26px rgba(255,170,40,0.9); transform: scale(1.06); }
}
.auto-bar {
  flex: 1 1 auto;
  height: 22px;
  position: relative;
  background: var(--cream);
  border: 2.5px solid var(--outline-c);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: var(--drop-sm), inset 0 2px 0 rgba(0,0,0,0.18);
}
/* When auto-drop is paused, the bar is dimmed and stamped with the word
   "PAUSED" — the player should never be wondering whether it's running. */
.auto-bar.paused .auto-bar-fill { opacity: 0; }
.auto-bar.paused .auto-bar-label::after {
  content: 'PAUSED';
  margin-left: 4px;
  color: #ffd23f;
}
.auto-bar.paused { filter: saturate(0.65) brightness(0.92); }
.auto-bar-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0;
  background: linear-gradient(180deg, #7cc8ff 0%, #3aa9ff 55%, #1a8ad6 100%);
  box-shadow:
    inset 0 -3px 0 rgba(0,0,0,0.18),
    inset 0 2px 0 rgba(255,255,255,0.45);
  transition: width 0.08s linear;
}
/* ── TURBO mode (auto-drop ≤ 300ms) ────────────────────────────────────
   Bar is parked at 100% to skip per-frame width churn; the visual effect
   sells "too fast for the bar" with scrolling diagonal stripes, an
   electric blue glow pulse, and a brighter base gradient. */
.auto-bar-fill.maxed {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255,255,255,0.32) 0px,
      rgba(255,255,255,0.32) 10px,
      rgba(255,255,255,0) 10px,
      rgba(255,255,255,0) 20px
    ),
    linear-gradient(180deg, #9ad6ff 0%, #4ab8ff 50%, #2196f3 100%);
  background-size: 28.28px 28.28px, 100% 100%;
  animation: auto-bar-turbo-stripes 0.5s linear infinite,
             auto-bar-turbo-glow 1.1s ease-in-out infinite;
  box-shadow:
    inset 0 -3px 0 rgba(0,0,0,0.18),
    inset 0 2px 0 rgba(255,255,255,0.55),
    0 0 12px rgba(90,170,255,0.65);
}
@keyframes auto-bar-turbo-stripes {
  from { background-position: 0 0, 0 0; }
  to   { background-position: -28.28px 0, 0 0; }
}
@keyframes auto-bar-turbo-glow {
  0%, 100% { filter: brightness(1.05) saturate(1.1); }
  50%      { filter: brightness(1.25) saturate(1.4); }
}
.auto-bar-label.maxed {
  color: #fff;
  letter-spacing: 1.8px;
  animation: auto-bar-turbo-label 1.1s ease-in-out infinite;
}
@keyframes auto-bar-turbo-label {
  0%, 100% { text-shadow: 0 0 0 transparent; }
  50%      { text-shadow: 0 0 6px rgba(255,255,255,0.9); }
}
.auto-bar-label {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Luckiest Guy', cursive;
  font-size: 12px; letter-spacing: 1.5px;
  color: #fff;
  -webkit-text-stroke: 1.5px var(--text-stroke-c);
  paint-order: stroke fill;
  pointer-events: none;
  z-index: 1;
}

.canvas-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 600 / 620;
  border: 2.5px solid var(--outline-c);
  border-radius: var(--r);
  overflow: hidden;
  background: linear-gradient(180deg, var(--frame-1) 0%, var(--frame-2) 60%, var(--frame-3) 100%);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.18);
  /* Container so the overlay pills (ball counter, tier pills) can scale
     with the canvas via cqw units. */
  container-type: inline-size;
  container-name: field;
}

#plinko-canvas {
  display: block;
  width: 100%;
  height: 100%;
  /* Suppress the default browser focus ring — without this, clicking the
     canvas then pressing Space inside the CrazyGames iframe paints a thin
     blue outline around the plinko field. */
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
#plinko-canvas:focus, #plinko-canvas:focus-visible { outline: none; }

/* ── BALL COUNTER (top-left of canvas frame) ──────────────────────────────
   Sizes scale with the canvas via cqw units (1cqw = 1% of canvas width).
   Hard clamp on both ends so the pill never gets unusably small or
   ridiculously huge. */
.ball-counter {
  position: absolute;
  top: clamp(4px, 1.3cqw, 8px);
  left: clamp(4px, 1.3cqw, 8px);
  z-index: 2;
  background: var(--cream);
  border: clamp(2px, 0.45cqw, 2.5px) solid var(--outline-c);
  border-radius: 999px;
  padding: clamp(2px, 0.55cqw, 3px) clamp(7px, 1.9cqw, 11px) clamp(2px, 0.55cqw, 3px) clamp(2px, 0.55cqw, 3px);
  display: flex;
  align-items: center;
  gap: clamp(4px, 1cqw, 6px);
  box-shadow: var(--drop-sm);
  font-family: 'Luckiest Guy', cursive;
  font-size: clamp(10px, 2.4cqw, 14px);
  letter-spacing: 1px;
  color: var(--ink);
  pointer-events: none;
  user-select: none;
}
.ball-counter-icon {
  width: clamp(14px, 3.8cqw, 22px);
  height: clamp(14px, 3.8cqw, 22px);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffe17a 0%, #ffb620 60%, #d68800 100%);
  border: clamp(1.5px, 0.35cqw, 2px) solid var(--outline-c);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.18), inset 0 1.5px 0 rgba(255,255,255,0.5);
  flex-shrink: 0;
}
.ball-counter span {
  color: #ffffff;
  -webkit-text-stroke: 1.4px var(--text-stroke-c);
  paint-order: stroke fill;
}

/* ── TIER PILL STACK (top-left of canvas frame, below ball counter) ─────
   Mirrors .ball-counter's visual language — same cream pill, same chunky
   outline, same Luckiest Guy 14px count — but the icon takes the tier's
   colour instead of the yellow coin gradient. */
.tier-pill-stack {
  position: absolute;
  top: clamp(30px, 7cqw, 42px);
  left: clamp(4px, 1.3cqw, 8px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: clamp(2px, 0.7cqw, 4px);
  pointer-events: none;
  user-select: none;
}
.tier-pill {
  background: var(--cream);
  border: clamp(2px, 0.45cqw, 2.5px) solid var(--outline-c);
  border-radius: 999px;
  padding: clamp(2px, 0.55cqw, 3px) clamp(7px, 1.9cqw, 11px) clamp(2px, 0.55cqw, 3px) clamp(2px, 0.55cqw, 3px);
  display: flex;
  align-items: center;
  gap: clamp(4px, 1cqw, 6px);
  box-shadow: var(--drop-sm);
  font-family: 'Luckiest Guy', cursive;
  font-size: clamp(10px, 2.4cqw, 14px);
  letter-spacing: 1px;
  color: var(--ink);
  animation: tier-pill-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tier-pill-icon {
  width: clamp(14px, 3.8cqw, 22px);
  height: clamp(14px, 3.8cqw, 22px);
  border-radius: 50%;
  border: clamp(1.5px, 0.35cqw, 2px) solid var(--outline-c);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.18), inset 0 1.5px 0 rgba(255,255,255,0.5);
  flex-shrink: 0;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.tier-pill-icon svg { display: block; width: 100%; height: 100%; }
.tier-pill-count { line-height: 1; }

/* ── GENERATOR YIELD PANEL ─────────────────────────────────────────────
   Pinned top-right of the canvas frame.  Hidden until the player has
   their first Supreme generator installed (toggled via `.on`).  Each
   .gen-yield-row inside is also `.on`-toggled per owned generator. */
.gen-yield-panel {
  position: absolute;
  top: clamp(4px, 1cqw, 8px);
  right: clamp(4px, 1.3cqw, 8px);
  z-index: 2;
  background: rgba(20, 8, 38, 0.78);
  border: clamp(2px, 0.45cqw, 2.5px) solid var(--outline-c);
  border-radius: clamp(8px, 2cqw, 12px);
  padding: clamp(4px, 1cqw, 6px) clamp(6px, 1.6cqw, 10px) clamp(5px, 1.2cqw, 7px);
  box-shadow: var(--drop-sm), inset 0 1px 0 rgba(255,255,255,0.18);
  backdrop-filter: blur(4px);
  display: none;
  flex-direction: column;
  gap: clamp(1px, 0.3cqw, 2px);
  pointer-events: none;
  user-select: none;
  min-width: clamp(96px, 24cqw, 130px);
}
.gen-yield-panel.on { display: flex; }
.gen-yield-header {
  font-family: 'Luckiest Guy', cursive;
  font-size: clamp(10px, 2.4cqw, 13px);
  letter-spacing: 1.4px;
  color: #ffd23f;
  text-shadow: 0 1px 0 #2c1856, 0 0 8px rgba(255, 210, 63, 0.55);
  text-align: center;
  padding-bottom: clamp(2px, 0.6cqw, 4px);
  border-bottom: 1px solid rgba(255, 210, 63, 0.35);
  margin-bottom: clamp(2px, 0.6cqw, 4px);
}
.gen-yield-row {
  display: none;
  align-items: baseline;
  justify-content: space-between;
  gap: clamp(4px, 1cqw, 8px);
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(10px, 2.2cqw, 12px);
  font-weight: 600;
  line-height: 1.25;
}
.gen-yield-row.on { display: flex; }
.gen-yield-label {
  color: #c8a8ff;
  letter-spacing: 0.4px;
}
.gen-yield-val {
  color: #fff;
  font-family: 'Luckiest Guy', cursive;
  letter-spacing: 0.6px;
  text-shadow: 0 1px 0 #2c1856;
}
/* Per-row accent colour matches each generator's slot tint. */
#gen-yield-cash .gen-yield-label { color: #ffd23f; }
#gen-yield-cash .gen-yield-val   { color: #ffe699; }
#gen-yield-ball .gen-yield-label { color: #8bd0ff; }
#gen-yield-ball .gen-yield-val   { color: #d4ecff; }
#gen-yield-sp   .gen-yield-label { color: #ff8fd2; }
#gen-yield-sp   .gen-yield-val   { color: #ffd2ee; }
#gen-yield-xp   .gen-yield-label { color: #c8a8ff; }
#gen-yield-xp   .gen-yield-val   { color: #e6d4ff; }
@keyframes tier-pill-pop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.tier-pill-count {
  color: #ffffff;
  -webkit-text-stroke: 1.2px var(--text-stroke-c);
  paint-order: stroke fill;
}

.drop-btn {
  width: 100%;
  height: 40px;
  background: linear-gradient(180deg, #ff8eb6 0%, var(--candy-pink) 100%);
  border: var(--outline);
  border-radius: var(--r);
  color: #fff;
  font-family: 'Luckiest Guy', cursive;
  font-size: 19px; letter-spacing: 2.4px;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
  flex-shrink: 0;
  box-shadow: var(--drop), inset 0 -4px 0 rgba(0,0,0,0.18), inset 0 3px 0 rgba(255,255,255,0.5);
  text-shadow: 0 2px 0 rgba(46,24,84,0.4);
  user-select: none;
}
.drop-btn:hover { /* still on hover */ }
.drop-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--drop-c), inset 0 -2px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.4); }

/* DROP IT! and the rewarded "Drop Tier N Ball" offer sit side by side
   in one row (CrazyGames review).  Both flex to equal width + height so
   the pair reads as a balanced set instead of a stacked tower. */
.drop-row {
  display: flex;
  width: 100%;
  gap: 8px;
  align-items: stretch;
  flex-shrink: 0;
  margin-top: 2px;
}
.drop-row .drop-btn,
.drop-row .bonus-ball-button {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  /* Taller now that they share one row instead of stacking — the freed
     vertical space goes back into the buttons so they're easier to tap. */
  height: 56px;
  margin-top: 0;
}

/* ── SMALL / MINIMIZED VIEWPORT — shrink chrome so the field stays ~2/5 ── */
/* On short or narrow windows the height-constrained canvas formula drops
   the field to ~1/3 of viewport width.  Trimming the HUD / auto-bar /
   drop-btn frees ~60px of vertical chrome, bringing the field closer to
   2/5.  We also tighten the formula's chrome budget from 198px → 138px. */
@media (max-height: 620px), (max-width: 760px) {
  #root { padding: 5px; gap: 5px; }

  .hud { height: 42px; padding: 0 9px; gap: 6px; }
  /* Title yields space so the coin value keeps its full length, not the
     other way around — coins are the gameplay-critical readout. */
  .hud-title { font-size: 20px; letter-spacing: 1.6px; flex-shrink: 1; min-width: 0; }
  .hud-coins {
    flex-shrink: 0;
    padding: 2px 14px 2px 2px;
    gap: 8px;
  }
  .hud-block { padding: 2px 10px 2px 2px; gap: 6px; flex-shrink: 0; }
  .hud-block-icon { width: 28px; height: 28px; }
  .hud-coins .hud-block-icon { width: 32px; height: 32px; font-size: 16px; }
  .hud-coins .hud-label { font-size: 8.5px; letter-spacing: 1.4px; }
  .hud-coins .hud-value { font-size: 19px; letter-spacing: 0.8px; }
  .hud-label { font-size: 8px; letter-spacing: 0.9px; }
  .hud-value { font-size: 15px; }
  .hud-mute, .hud-theme, .hud-reset {
    width: 30px; height: 30px; font-size: 14px;
    border-width: 2px;
    flex-shrink: 0;
  }

  .board-panel {
    padding: 4px;
    gap: 3px;
    /* Compact chrome — HUD (42) + auto-bar row (16) + drop-btn (20)
       + bonus-ball-btn (18) + gaps/padding (~34) ≈ 130.  Sized so the
       right column reclaims width for the leaderboard slot at this
       breakpoint too. */
    width: calc((100vh - 130px) * 600 / 620 + 12px);
    max-width: calc(100vw - 180px);
  }

  /* Half-size auto-bar row — pause button + bar both shrink, and the
     auto-drop countdown text is hidden so the thin bar stays clean. */
  .auto-bar-row { height: 16px; gap: 5px; }
  .auto-pause-btn { width: 16px; height: 16px; border-width: 2px; }
  .auto-pause-btn svg { width: 65%; height: 65%; }
  .auto-bar { height: 10px; border-width: 2px; }
  .auto-bar-label { display: none; }
  /* Half-height drop + bonus-ball buttons.  Text scales down to keep
     proportional, padding tightens so the labels still fit. */
  .drop-btn { height: 20px; font-size: 11px; letter-spacing: 1.2px; padding: 0 8px; }
  /* Bonus-ball at small breakpoint — compact strip. */
  .bonus-ball-button { width: 100%; height: 18px; margin-top: 2px; font-size: 10px; letter-spacing: 0.7px; padding: 0 6px; gap: 4px; }
  .bonus-ball-play { width: 18px; height: 12px; }
  /* Side-by-side row — both buttons share one compact height so the row
     stays balanced when the chrome shrinks. */
  .drop-row { gap: 5px; margin-top: 1px; }
  .drop-row .drop-btn,
  .drop-row .bonus-ball-button { height: 34px; }

  /* Tab bar shrinks at viewport-narrow too. */
  .tab-bar { padding: 4px 4px 0; gap: 4px; }
  .tab-btn { height: 34px; padding: 0 9px 0 5px; font-size: 11.5px; letter-spacing: 1.1px; gap: 5px; }
  .tab-btn-icon { width: 20px; height: 20px; border-width: 1.5px; }
  .tab-arrow { width: 28px; height: 34px; }
  .tab-arrow svg { width: 16px; height: 16px; }
}

/* Hide the title entirely on very narrow viewports — it would otherwise
   crowd the coin pill on phones. */
@media (max-width: 480px) {
  .hud-title { display: none; }
  .hud { padding: 0 8px; gap: 6px; }
  .hud-right { gap: 6px; }

  /* Compact coin pill — keep value font readable, trim chrome. */
  .hud-coins { padding: 3px 10px 3px 3px; gap: 6px; }
  .hud-coins .hud-block-icon { width: 32px; height: 32px; font-size: 16px; }
  .hud-coins .hud-value { font-size: 19px; letter-spacing: 0.5px; }
  .hud-coins .hud-label { font-size: 8px; letter-spacing: 1px; }

  /* SP pill — hide the label, keep just icon + value to save horizontal room. */
  .hud-sp { padding: 3px 8px 3px 3px; gap: 4px; }
  .hud-sp .hud-block-icon { width: 28px; height: 28px; }
  .hud-sp .hud-label { display: none; }
  .hud-sp .hud-value { font-size: 14px; letter-spacing: 0.5px; }

  /* Round buttons shrink in unison. */
  .hud-mute, .hud-theme, .hud-reset {
    width: 30px; height: 30px; font-size: 13px;
  }

  /* Tighter horizontal tabs at phone widths — arrows kick in for overflow. */
  .tab-bar { padding: 4px 4px 0; gap: 3px; }
  .tab-btn { height: 34px; padding: 0 9px 0 5px; font-size: 11px; letter-spacing: 1px; gap: 5px; }
  .tab-btn-icon { width: 19px; height: 19px; border-width: 1.5px; border-radius: 6px; }
  .tab-arrow { width: 26px; height: 34px; }
  .tab-arrow svg { width: 16px; height: 16px; }
}

/* Extreme phone width — hide reset button entirely (least-used control). */
@media (max-width: 360px) {
  .hud-reset { display: none; }
  .hud-sp .hud-block-icon { width: 24px; height: 24px; }
  .hud-sp .hud-value { font-size: 12px; }
  .hud-coins .hud-block-icon { width: 28px; height: 28px; font-size: 14px; }
  .hud-coins .hud-value { font-size: 16px; }
  .hud-mute, .hud-theme { width: 26px; height: 26px; font-size: 11px; }
}

/* ── UI PANEL (right) ───────────────────────────────────────────────────── */
.ui-panel {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-width: 0;
  background: var(--paper);
  border: var(--outline);
  border-radius: var(--r-lg);
  box-shadow: var(--drop);
  /* Container context so cards can shrink based on UI panel width
     rather than viewport — the field always takes priority. */
  container-type: inline-size;
  container-name: ui;
}

/* ── TABS (Gear-Factory-style horizontal strip with scroll arrows) ─────── */
.tab-bar {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  gap: 5px;
  padding: 6px 6px 0;
  min-width: 0;
}
.tab-bar-scroll {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 2px 4px;
}
.tab-bar-scroll::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 0 0 auto;
  height: 38px;
  background: var(--cream);
  border: 2.5px solid var(--outline-c);
  color: var(--ink-soft);
  font-family: 'Luckiest Guy', cursive;
  font-size: 13px;
  letter-spacing: 1.4px;
  cursor: pointer;
  border-radius: var(--r);
  padding: 0 12px 0 6px;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.12s;
  box-shadow: var(--drop-sm);
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  white-space: nowrap;
}
.tab-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid var(--outline-c);
  box-shadow: inset 0 -1.5px 0 rgba(0,0,0,0.18), inset 0 1.5px 0 rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.tab-btn-icon svg { width: 88%; height: 88%; display: block; }
.tab-btn-label {
  display: inline-block;
  line-height: 1;
}
.tab-btn:hover { filter: brightness(1.05); }
.tab-btn.active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--tab-active) 70%, white) 0%, var(--tab-active) 100%);
  color: var(--ink);
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--drop-c);
}
.tab-btn.active .tab-btn-icon {
  background: rgba(255, 255, 255, 0.32);
  box-shadow: inset 0 -1.5px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.55);
}

/* Arrow chips — hidden by default, revealed only when the strip
   overflows (toggled by syncTabBarOverflow via .has-overflow on .tab-bar). */
.tab-arrow {
  display: none;
  flex: 0 0 auto;
  width: 36px; height: 44px;
  border-radius: var(--r);
  background: linear-gradient(180deg, #4a4060 0%, #2d2a44 100%);
  border: 2.5px solid var(--outline-c);
  box-shadow: var(--drop-sm), inset 0 -2px 0 rgba(0,0,0,0.25), inset 0 1.5px 0 rgba(255,255,255,0.18);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s, filter 0.12s;
}
.tab-arrow svg { width: 22px; height: 22px; display: block; filter: drop-shadow(0 1px 0 rgba(0,0,0,0.4)); }
.tab-arrow:hover:not(.disabled) { filter: brightness(1.12); }
.tab-arrow:active:not(.disabled) { transform: translateY(1px); }
.tab-arrow.disabled { opacity: 0.35; cursor: default; pointer-events: none; }
.tab-bar.has-overflow .tab-arrow { display: inline-flex; }

.tab-content {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.tab-content > * { flex-shrink: 0; }
.tab-content::-webkit-scrollbar { width: 8px; }
.tab-content::-webkit-scrollbar-track { background: var(--cream); border-radius: 4px; }
.tab-content::-webkit-scrollbar-thumb {
  background: var(--candy-pink);
  border-radius: 4px;
  border: 1.5px solid var(--outline-c);
}

/* ── UPGRADE CARDS ──────────────────────────────────────────────────────── */
.upgrade-card {
  background: var(--cream);
  border: var(--outline);
  border-radius: var(--r);
  padding: 8px 10px;
  display: flex; align-items: center; gap: 9px;
  transition: transform 0.1s;
  box-shadow: var(--drop-sm);
  position: relative;
}
.upgrade-card:hover { /* still on hover */ }

.upg-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  border: 2.5px solid var(--outline-c);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.15), inset 0 2.5px 0 rgba(255,255,255,0.5);
  font-size: 22px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(46,24,84,0.4);
}

/* Custom SVG icons sit nicely inside any chunky icon container */
.upg-icon svg,
.shop-card-icon svg,
.invest-icon svg,
.hud-block-icon svg,
.cashout-icon svg {
  width: 72%;
  height: 72%;
  display: block;
  filter: drop-shadow(0 1.5px 0 rgba(0,0,0,0.18));
}
.hud-block-icon svg { width: 78%; height: 78%; }

.upg-info { flex: 1; min-width: 0; }
.upg-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 10px; letter-spacing: 0.9px; font-weight: 700;
  color: var(--ink-soft); text-transform: uppercase;
  line-height: 1.05;
}
.upg-val {
  font-family: 'Luckiest Guy', cursive;
  font-size: 18px; letter-spacing: 0.8px;
  line-height: 1.05;
  color: var(--ink);
  margin-top: 1px;
}
.upg-addon {
  color: #9b5fff; /* shop-bonus addon (purple — matches SP/Shop theme) */
  font-size: 0.65em;
  letter-spacing: 0.5px;
}
.upg-addon.inv {
  color: #f5b820; /* investment-bonus addon (gold — matches Invest tab theme) */
}
.upg-addon.ascend {
  color: #ff6b3c; /* Ascend-stat addon (orange — matches Ascend tab accent) */
  font-weight: 700;
}
.upg-next {
  font-family: 'Fredoka', sans-serif;
  font-size: 11px; font-weight: 600;
  color: var(--ink-soft);
  margin-top: 0;
  line-height: 1.05;
}

.upg-right { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
/* Free-upgrade rewarded chip — sits to the LEFT of the buy button area
   (the .upg-right column) inside the upgrade card.  Matches the green
   "rewarded reward" family used by the free-merge chip so every
   rewarded surface reads as a family. */
.upgrade-card .free-upg-chip {
  flex-shrink: 0;
  align-self: center;
  height: 36px;
  padding: 0 10px;
  font-size: 11px;
  letter-spacing: 0.7px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: linear-gradient(180deg, #6ee69a 0%, #1f9d5a 100%);
  color: #ffffff;
  text-shadow: 0 1.2px 0 rgba(20,68,40,0.45);
}
.upgrade-card .free-upg-chip .rewarded-chip-play {
  width: 19px;
  height: 12px;
  filter: drop-shadow(0 1px 0 rgba(20,68,40,0.4));
}
.lv-pips { display: flex; gap: 4px; align-items: center; }
.lv-pips.compact { gap: 2px; }
.lv-pip {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(46,24,84,0.12);
  border: 2px solid var(--outline-c);
  transition: background 0.2s;
}
.lv-pips.compact .lv-pip {
  width: 7px; height: 7px;
  border-width: 1.5px;
}
.lv-pips.tiny { gap: 1.5px; }
.lv-pips.tiny .lv-pip {
  width: 5px; height: 5px;
  border-width: 1px;
}

.upg-btn {
  height: 34px; padding: 0 11px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--btn-c) 80%, white) 0%, var(--btn-c) 100%);
  border: 2.5px solid var(--outline-c);
  color: #fff;
  border-radius: 11px;
  font-family: 'Luckiest Guy', cursive;
  font-size: 13px; letter-spacing: 0.9px;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.08s, box-shadow 0.08s;
  box-shadow: var(--drop-sm), inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.5);
  text-shadow: 0 2px 0 rgba(46,24,84,0.5);
  user-select: none;
  display: inline-flex; align-items: center; gap: 5px;
}
/* Coin/star inline glyph used in coin-priced buttons (upgrade buys, skin
   buy buttons).  Tracks the font size of its parent so it scales together
   with the cost text. */
.btn-coin-ico {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 1.3em; height: 1.3em;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.25));
}
.btn-coin-ico svg { width: 100%; height: 100%; display: block; }
.btn-coin-cost { display: inline-block; line-height: 1; }

/* Generic small inline icon for chip-style labels (Owned / Equipped / Locked
   pills next to short text). Tracks the chip's font size so it scales with
   the surrounding type. */
.chip-ico {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 1.25em; height: 1.25em;
  vertical-align: -0.2em;
  margin-right: 4px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.18));
}
.chip-ico svg { width: 100%; height: 100%; display: block; }

/* Lightning glyph inside the auto-drop bar label. Sized smaller so two
   bolts fit comfortably in TURBO mode without dwarfing the text. */
.auto-bar-ico {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 1em; height: 1em;
  vertical-align: -0.15em;
  margin-right: 2px;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.25));
}
.auto-bar-ico svg { width: 100%; height: 100%; display: block; }

/* Cashout button icon — leftward of the "CASH OUT" label. */
.cashout-btn-ico {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 1.4em; height: 1.4em;
  vertical-align: -0.3em;
  margin-right: 6px;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.25));
}
.cashout-btn-ico svg { width: 100%; height: 100%; display: block; }

.upg-btn:hover { /* still on hover */ }
.upg-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--drop-c), inset 0 -2px 0 rgba(0,0,0,0.18); }
.upg-btn.glow { animation: btn-bounce 1.6s ease-in-out infinite; }
/* Pure brightness pulse — no transform, so hovering doesn't trigger mouseleave
   loops as the button moves out from under the cursor. */
@keyframes btn-bounce {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.12); }
}
/* Animation pauses while hovering so the hover state can take over cleanly. */
.upg-btn.glow:hover,
.shop-buy.glow:hover,
.cashout-btn.glow:hover { animation: none; }
.upg-btn:disabled {
  background: color-mix(in srgb, var(--ink-soft) 35%, var(--paper));
  color: color-mix(in srgb, var(--ink) 50%, transparent);
  text-shadow: none;
  cursor: not-allowed;
  animation: none;
  transform: none;
}

.upg-maxed {
  font-family: 'Luckiest Guy', cursive;
  font-size: 13px; letter-spacing: 2px;
  color: #fff;
  padding: 6px 12px;
  border: 2.5px solid var(--outline-c);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd55a, var(--candy-yellow));
  box-shadow: var(--drop-sm), inset 0 -2px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.5);
  text-shadow: 0 2px 0 rgba(46,24,84,0.4);
  transform: rotate(-3deg);
}

/* ── RESPONSIVE: shrink cards when the UI panel gets narrow ─────────────── */
@container ui (max-width: 360px) {
  .tab-content { padding: 8px; gap: 7px; }
  .tab-bar { padding: 8px 8px 0; gap: 5px; }
  .tab-btn { height: 36px; font-size: 11px; letter-spacing: 1px; padding: 0 5px; }

  .upgrade-card,
  .shop-card,
  .invest-card { padding: 8px; gap: 8px; }
  .upg-icon,
  .shop-card-icon,
  .invest-icon { width: 38px; height: 38px; font-size: 20px; border-radius: 11px; }
  .upg-name,
  .shop-card-name,
  .invest-name { font-size: 10px; letter-spacing: 0.5px; }
  .upg-val,
  .shop-card-val { font-size: 17px; }
  .upg-next,
  .shop-card-desc,
  .invest-desc { font-size: 10px; }
  .upg-btn,
  .shop-buy,
  .invest-buy { height: 32px; padding: 0 10px; font-size: 12px; letter-spacing: 0.5px; }
  .upg-maxed,
  .shop-maxed,
  .invest-owned { font-size: 11px; padding: 4px 8px; letter-spacing: 1px; }
  .lv-pip { width: 7px; height: 7px; border-width: 1.5px; }
  .lv-pips, .shop-pips { gap: 2px; }
  .shop-locked,
  .invest-locked { font-size: 11px; padding: 4px 8px; letter-spacing: 0.5px; }
}

/* Column tab layout — icon on top, small label below.  Kicks in well
   before labels would have to be clipped, so the full word stays visible
   rather than getting cut to "UP..." */
@container ui (max-width: 380px) {
  /* Tab strip keeps icon+label horizontal at narrow widths — the new
     arrow scrollers reveal the rest of the tabs when they overflow. */
  .tab-bar { padding: 6px 6px 0; gap: 4px; }
  .tab-btn { height: 38px; padding: 0 10px 0 6px; font-size: 12px; letter-spacing: 1.2px; gap: 6px; }
  .tab-btn-icon { width: 22px; height: 22px; border-width: 1.5px; }
  .tab-arrow { width: 30px; height: 38px; }
  .tab-arrow svg { width: 18px; height: 18px; }
}

@container ui (max-width: 260px) {
  .tab-content { padding: 6px; gap: 5px; }
  .tab-bar { padding: 4px 4px 0; gap: 3px; }
  .tab-btn { height: 32px; padding: 0 8px 0 5px; font-size: 10px; letter-spacing: 0.8px; gap: 5px; }
  .tab-btn-icon { width: 18px; height: 18px; border-width: 1.5px; border-radius: 5px; }
  .tab-arrow { width: 24px; height: 32px; }
  .tab-arrow svg { width: 14px; height: 14px; }

  .upgrade-card,
  .shop-card,
  .invest-card { padding: 6px; gap: 6px; }
  .upg-icon,
  .shop-card-icon,
  .invest-icon { width: 30px; height: 30px; font-size: 16px; border-radius: 9px; }
  .upg-val,
  .shop-card-val { font-size: 14px; }
  .upg-btn,
  .shop-buy,
  .invest-buy { height: 28px; padding: 0 8px; font-size: 11px; }
  .lv-pips, .shop-pips { display: none; }
  .upg-right { gap: 2px; }
}

/* ── SLOT CARDS ─────────────────────────────────────────────────────────── */
.slots-section-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 16px; letter-spacing: 3px; color: var(--ink);
  padding: 4px 4px 4px;
  transform: rotate(-1deg);
}
.slot-card {
  background: var(--cream);
  border: var(--outline);
  border-radius: var(--r);
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 6px;
  transition: transform 0.1s;
  box-shadow: var(--drop-sm);
}
.slot-card:hover { /* no movement on hover */ }
.slot-card-top { display: flex; align-items: center; gap: 10px; }
.slot-pos-badge {
  width: 30px; height: 30px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Luckiest Guy', cursive;
  font-size: 14px; color: #fff;
  flex-shrink: 0;
  border: 2.5px solid var(--outline-c);
  text-shadow: 0 2px 0 rgba(46,24,84,0.4);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.4);
}
.slot-name-wrap {
  flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
}
.slot-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
  letter-spacing: 1px; text-transform: uppercase;
}
.slot-mult {
  font-family: 'Luckiest Guy', cursive;
  font-size: 20px; letter-spacing: 1px;
}
.slot-lv {
  font-family: 'Luckiest Guy', cursive;
  font-size: 11px; letter-spacing: 1.5px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--outline-c);
  border-radius: 999px;
  padding: 1px 8px;
}
/* Popping green XP bar with centered overlay count */
.slot-xp-bar-bg {
  height: 18px; border-radius: 999px;
  background: var(--paper);
  border: 2px solid var(--outline-c);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 0 rgba(0,0,0,0.18);
}
.slot-xp-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(180deg, #6fffb0 0%, #1fd96a 60%, #16b84f 100%);
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    inset 0 -3px 0 rgba(0,0,0,0.22),
    inset 0 2px 0 rgba(255,255,255,0.55),
    0 0 12px rgba(34, 217, 110, 0.5);
}
.slot-xp-txt {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Luckiest Guy', cursive;
  font-size: 11px; letter-spacing: 1px;
  color: #fff;
  -webkit-text-stroke: 1.5px var(--text-stroke-c);
  paint-order: stroke fill;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
  pointer-events: none;
}

/* ── CASHOUT TAB ────────────────────────────────────────────────────────── */
.cashout-card {
  background: linear-gradient(180deg, color-mix(in srgb, #9b5fff 18%, var(--cream)) 0%, var(--cream) 100%);
  border: 3px solid color-mix(in srgb, #9b5fff 60%, var(--outline-c));
  border-radius: var(--r-lg);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 7px;
  box-shadow: var(--drop), 0 0 24px rgba(155, 95, 255, 0.18);
  position: relative;
  overflow: hidden;
}

.cashout-header {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 4px;
  border-bottom: 2px dashed color-mix(in srgb, #9b5fff 40%, transparent);
}
.cashout-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(180deg, #c8a8ff, #9b5fff);
  border: 2.5px solid var(--outline-c);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.5);
}
.cashout-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 19px; letter-spacing: 2.4px;
  color: var(--ink);
  line-height: 1.1;
}
.cashout-sub {
  font-family: 'Fredoka', sans-serif;
  font-size: 10.5px; font-weight: 600;
  color: var(--ink-soft);
  margin-top: 1px;
}

.cashout-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 2px 2px;
}

.cashout-progress-wrap {
  display: flex; flex-direction: column; gap: 3px;
  padding: 2px 2px 0;
}
.cashout-progress-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 11px; font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.cashout-progress-bar {
  position: relative;
  height: 18px;
  background: var(--paper);
  border: 2.5px solid var(--outline-c);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 0 rgba(0,0,0,0.18);
}
.cashout-progress-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(180deg, #c8a8ff 0%, #9b5fff 55%, #7236d2 100%);
  box-shadow:
    inset 0 -3px 0 rgba(0,0,0,0.22),
    inset 0 2px 0 rgba(255,255,255,0.45);
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cashout-progress-txt {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Luckiest Guy', cursive;
  font-size: 12px; letter-spacing: 1px;
  color: #fff;
  -webkit-text-stroke: 1.5px var(--text-stroke-c);
  paint-order: stroke fill;
  pointer-events: none;
}
.cashout-row.reward {
  background: color-mix(in srgb, #9b5fff 15%, transparent);
  border-radius: var(--r);
  padding: 5px 10px;
}
.cashout-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 12px; font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.cashout-val {
  font-family: 'Luckiest Guy', cursive;
  font-size: 18px; letter-spacing: 1px;
  color: var(--ink);
}
.cashout-reward {
  font-family: 'Luckiest Guy', cursive;
  font-size: 22px; letter-spacing: 1px;
  color: #9b5fff;
}

/* Row that pairs the main Cash Out button with the rewarded-ad
   "double SP" chip — chip hugs right, button stretches to fill. */
.cashout-action-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.cashout-action-row .cashout-btn { flex: 1 1 auto; }
/* Cashout-double popup — appears after clicking CASH OUT, offering
   the rewarded "double SP" path inline.  Modal backdrop + centred
   card so the player can't miss the choice. */
.cashout-prompt-overlay {
  position: fixed;
  inset: 0;
  z-index: 10080;
  background: rgba(8, 4, 22, 0.74);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: cashout-prompt-fade 0.22s ease;
}
@keyframes cashout-prompt-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.cashout-prompt-card {
  position: relative;
  width: min(100%, 380px);
  /* Cap height to the viewport so on short laptops (Chromebooks etc.)
     the popup never overflows.  The body becomes scrollable inside the
     card while the action buttons stay pinned at the bottom. */
  max-height: calc(100vh - 32px);
  background: var(--paper);
  border: 2.5px solid var(--outline-c);
  border-radius: var(--r-lg);
  padding: 22px 22px 18px;
  box-shadow: var(--drop), 0 0 36px rgba(255, 210, 63, 0.25);
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--ink);
  text-align: center;
  overflow: hidden;
  animation: cashout-prompt-pop 0.25s cubic-bezier(0.22, 1.36, 0.4, 1);
}
.cashout-prompt-body {
  /* Allow vertical scroll inside the body when the card is height-
     capped on short screens — actions stay visible below. */
  overflow-y: auto;
}
/* Cashout-prompt small-screen overrides consolidated into the main
   responsive popup block lower in the file. */
@keyframes cashout-prompt-pop {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.cashout-prompt-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.cashout-prompt-title .cashout-btn-ico {
  display: inline-flex;
  width: 28px;
  height: 28px;
}
.cashout-prompt-title .cashout-btn-ico svg {
  width: 100%;
  height: 100%;
}
.cashout-prompt-body {
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-soft);
}
.cashout-prompt-body strong { color: var(--ink); font-weight: 700; }
.cashout-prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cashout-prompt-btn {
  height: 50px;
  border: var(--outline);
  border-radius: var(--r);
  font-family: 'Luckiest Guy', cursive;
  font-size: 16px;
  letter-spacing: 1.6px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--drop-sm), inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.45);
  text-shadow: 0 1.5px 0 rgba(46,24,84,0.4);
  -webkit-text-stroke: 1.2px var(--text-stroke-c);
  paint-order: stroke fill;
  transition: transform 0.08s, filter 0.15s;
}
.cashout-prompt-btn:active { transform: translateY(2px); }
.cashout-prompt-btn:hover { filter: brightness(1.07); }
.cashout-prompt-double {
  background: linear-gradient(180deg, #ffe699 0%, #ffb820 100%);
  color: #2c1856;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
  /* Dark text on a light-gold button needs NO text-stroke — the inherited
     near-black 1.2px stroke merged into the dark letters and muddied them,
     making the "W" / "H" in "WATCH AD" hard to read (CrazyGames review).
     The dark-on-gold contrast is already strong on its own. */
  -webkit-text-stroke: 0;
  paint-order: normal;
  font-size: 15px;
  letter-spacing: 1.1px;
}
.cashout-prompt-double .rewarded-chip-play {
  background-color: #2c1856;
  filter: none;
}
.cashout-prompt-single {
  background: linear-gradient(180deg, #c8a8ff 0%, #8a4fee 100%);
}
.cashout-prompt-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: 2px solid var(--outline-c);
  border-radius: 50%;
  background: var(--paper);
  font-family: 'Luckiest Guy', cursive;
  font-size: 18px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.cashout-prompt-x:hover { background: var(--cream); }
body.has-adblock .cashout-prompt-double { display: none; }

.cashout-btn {
  height: 56px;
  background: linear-gradient(180deg, #c8a8ff 0%, #9b5fff 100%);
  border: 3px solid var(--outline-c);
  border-radius: var(--r);
  color: #fff;
  font-family: 'Luckiest Guy', cursive;
  font-size: 22px; letter-spacing: 4px;
  cursor: pointer;
  margin-top: 4px;
  transition: transform 0.08s, box-shadow 0.08s;
  box-shadow: var(--drop), inset 0 -4px 0 rgba(0,0,0,0.18), inset 0 3px 0 rgba(255,255,255,0.5);
  text-shadow: 0 2px 0 rgba(46,24,84,0.4);
  user-select: none;
}
.cashout-btn:hover { /* still on hover */ }
.cashout-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--drop-c), inset 0 -2px 0 rgba(0,0,0,0.18); }
.cashout-btn:disabled {
  background: color-mix(in srgb, var(--ink-soft) 35%, var(--paper));
  color: color-mix(in srgb, var(--ink) 50%, transparent);
  text-shadow: none;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--drop-sm);
  animation: none;
}
.cashout-btn.glow { animation: btn-bounce 1.4s ease-in-out infinite; }

.cashout-warn {
  font-family: 'Fredoka', sans-serif;
  font-size: 11px; font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
  padding-top: 2px;
}

/* Compact-viewport trim for the cashout card — keeps the card short
   enough that the Shop section title AND at least the top of the first
   shop card peek above the fold, signaling "scroll for more". */
@media (max-width: 760px), (max-height: 620px) {
  .cashout-card { padding: 7px 9px; gap: 5px; border-width: 2.5px; }
  .cashout-header { padding-bottom: 3px; gap: 8px; }
  .cashout-icon { width: 30px; height: 30px; font-size: 16px; border-radius: 10px; }
  .cashout-title { font-size: 15px; letter-spacing: 1.6px; }
  .cashout-sub { font-size: 9.5px; }
  .cashout-row { padding: 1px 2px; }
  .cashout-label { font-size: 10px; letter-spacing: 0.8px; }
  .cashout-val { font-size: 14px; }
  .cashout-progress-wrap { gap: 2px; padding: 1px 2px 0; }
  .cashout-progress-label { font-size: 9.5px; letter-spacing: 0.8px; }
  .cashout-progress-bar { height: 13px; }
  .cashout-progress-txt { font-size: 10px; letter-spacing: 0.6px; }
  .cashout-row.reward { padding: 4px 8px; }
  .cashout-reward { font-size: 16px; }
  .cashout-action-row .cashout-btn { height: 34px; font-size: 14px; letter-spacing: 1.4px; padding: 0 10px; }
  .cashout-btn-ico { width: 18px; height: 18px; }
  .cashout-warn { font-size: 9.5px; padding-top: 0; }
}

/* ── INVEST TAB ─────────────────────────────────────────────────────────── */
.invest-summary {
  background: linear-gradient(180deg, color-mix(in srgb, #ffd23f 18%, var(--cream)) 0%, var(--cream) 100%);
  border: 3px solid color-mix(in srgb, #ffd23f 60%, var(--outline-c));
  border-radius: var(--r-lg);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  align-items: center;
  box-shadow: var(--drop), 0 0 24px rgba(255, 210, 63, 0.18);
  position: relative;
}
/* ── ASCEND TAB · STAT SPREAD ─────────────────────────────────────────
   Hero card up top with a 4-stat readout + the big ASCEND action, then
   a 2-column grid of compact perk "stat blocks".  Purple/cream palette
   so it reads as the layer above the gold-themed Invest tab. */
.ascend-hero {
  background: linear-gradient(180deg, color-mix(in srgb, #c75dff 22%, var(--cream)) 0%, var(--cream) 100%);
  border: 3px solid color-mix(in srgb, #c75dff 65%, var(--outline-c));
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--drop), 0 0 28px rgba(199, 93, 255, 0.3);
  display: flex; flex-direction: column; gap: 10px;
}
.ascend-hero.gated {
  background: linear-gradient(180deg, color-mix(in srgb, #6b4d8a 12%, var(--cream)) 0%, var(--cream) 100%);
  border-color: color-mix(in srgb, #6b4d8a 50%, var(--outline-c));
  box-shadow: var(--drop);
  filter: saturate(0.85);
}
.ascend-hero-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 24px; letter-spacing: 4px;
  background: linear-gradient(180deg, #ffd23f 0%, #c75dff 70%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 2px var(--text-stroke-c);
  paint-order: stroke fill;
  filter: drop-shadow(0 3px 0 var(--drop-c));
  text-align: center;
  transform: rotate(-2deg);
}
.ascend-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ascend-stat {
  background: rgba(199, 93, 255, 0.08);
  border: 2px solid color-mix(in srgb, #c75dff 35%, var(--outline-c));
  border-radius: var(--r);
  padding: 6px 10px;
  display: flex; flex-direction: column; gap: 1px;
}
.ascend-stat-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 9.5px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.ascend-stat-val {
  font-family: 'Luckiest Guy', cursive;
  font-size: 18px; letter-spacing: 1.2px;
  color: var(--ink);
}
.ascend-hero-locked {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}
.ascend-hero-sub {
  font-family: 'Fredoka', sans-serif;
  font-size: 10.5px; font-weight: 500;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.35;
}
.ascend-btn {
  width: 100%;
  background: linear-gradient(180deg, #c8a3ff 0%, #9b5fff 60%, #5a2fa3 100%);
}

/* 2-col stat-block grid. */
.ascend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.ascend-block {
  background: var(--cream);
  border: 2.5px solid color-mix(in srgb, #c75dff 35%, var(--outline-c));
  border-radius: var(--r);
  padding: 8px 10px 10px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--drop-sm);
  transition: transform 0.1s, border-color 0.15s;
}
.ascend-block.owned {
  border-color: #c75dff;
  background: color-mix(in srgb, #c75dff 10%, var(--cream));
}
.ascend-block.gated { opacity: 0.55; filter: grayscale(0.5); }
.ascend-block-head {
  display: flex; align-items: center; gap: 8px;
}
.ascend-block-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 10px;
  border: 2px solid var(--outline-c);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.18), inset 0 1.5px 0 rgba(255,255,255,0.4);
}
.ascend-block-icon svg { width: 70%; height: 70%; display: block; }
.ascend-block-name {
  font-family: 'Luckiest Guy', cursive;
  font-size: 13px; letter-spacing: 1px;
  color: var(--ink);
  line-height: 1.05;
}
.ascend-block-desc {
  font-family: 'Fredoka', sans-serif;
  font-size: 10.5px; font-weight: 500;
  line-height: 1.35;
  color: var(--ink-soft);
  flex: 1;
}
.ascend-chip {
  align-self: stretch;
  font-family: 'Luckiest Guy', cursive;
  font-size: 11px; letter-spacing: 1.3px;
  padding: 5px 8px;
  border: 2px solid var(--outline-c);
  border-radius: var(--r);
  text-align: center;
  user-select: none;
}
.ascend-chip.owned {
  background: color-mix(in srgb, #3ee08c 22%, var(--paper));
  color: var(--ink);
}
.ascend-chip.locked {
  background: color-mix(in srgb, var(--ink-soft) 18%, var(--paper));
  color: var(--ink-soft);
}
.ascend-chip.buy {
  background: linear-gradient(180deg, #c8a3ff 0%, #9b5fff 100%);
  color: #fff;
  text-shadow: 0 2px 0 rgba(46,24,84,0.45);
  box-shadow: var(--drop-sm), inset 0 -2px 0 rgba(0,0,0,0.18), inset 0 1.5px 0 rgba(255,255,255,0.5);
  cursor: pointer;
}
.ascend-chip.buy:disabled {
  background: color-mix(in srgb, var(--ink-soft) 35%, var(--paper));
  color: color-mix(in srgb, var(--ink) 50%, transparent);
  text-shadow: none;
  cursor: not-allowed;
}
.ascend-chip.buy.glow { animation: btn-bounce 1.6s ease-in-out infinite; }
.ascend-chip.buy:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--drop-c), inset 0 -2px 0 rgba(0,0,0,0.2);
}
.ascend-stat-val.glow {
  color: #ffd23f;
  text-shadow: 0 0 8px rgba(255,210,63,0.7);
  animation: btn-bounce 1.4s ease-in-out infinite;
}

/* ── RPG STAT ROWS ─────────────────────────────────────────────────
   Four wide horizontal panels stacked vertically.  Each row has a
   left block (icon + name + description + max-perk hint) and a right
   block (5-segment pip bar + effect readout + +1 button).  Border /
   pip colour is driven by the per-row `--c` custom property set
   inline in the JS render. */
.ascend-rows {
  display: flex; flex-direction: column;
  gap: 10px;
}
.ascend-row.stat-row {
  background: var(--cream);
  border: 2.5px solid var(--outline-c);
  border-radius: var(--r);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  box-shadow: var(--drop-sm);
  position: relative;
  overflow: hidden;
}
.ascend-row.stat-row::before {
  /* RPG-style coloured edge stripe down the left side. */
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--c, #9b5fff);
  box-shadow: 0 0 10px var(--c, #9b5fff);
}
.ascend-row.stat-row.maxed {
  background: color-mix(in srgb, var(--c, #9b5fff) 10%, var(--cream));
}
.ascend-row-left {
  display: flex; align-items: flex-start; gap: 10px;
  min-width: 0;
  padding-left: 4px;
}
.ascend-row-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 2px solid var(--outline-c);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.18), inset 0 1.5px 0 rgba(255,255,255,0.4), var(--drop-sm);
}
.ascend-row-icon svg { width: 70%; height: 70%; display: block; }
.ascend-row-text {
  display: flex; flex-direction: column; gap: 3px;
  min-width: 0;
}
.ascend-row-namewrap {
  display: flex; align-items: center; gap: 8px;
}
.ascend-row-name {
  font-family: 'Luckiest Guy', cursive;
  font-size: 16px; letter-spacing: 1px;
  color: var(--ink);
  line-height: 1;
}
.ascend-row-lv {
  font-family: 'Luckiest Guy', cursive;
  font-size: 11px; letter-spacing: 1.2px;
  background: color-mix(in srgb, var(--outline-c) 5%, var(--paper));
  border: 2px solid var(--outline-c);
  border-radius: 999px;
  padding: 2px 8px;
  line-height: 1;
}
.ascend-row-desc {
  font-family: 'Fredoka', sans-serif;
  font-size: 11.5px; font-weight: 500;
  line-height: 1.35;
  color: var(--ink-soft);
}
.ascend-row-milestone {
  font-family: 'Luckiest Guy', cursive;
  font-size: 10px; letter-spacing: 1.1px;
  opacity: 0.85;
  margin-top: 1px;
}
.ascend-row-right {
  display: flex; flex-direction: column;
  align-items: stretch;
  gap: 6px;
  /* Locked width so every stat row's pip bar is identical — without
     this, the SPEED row's longer "-N% drop time" text expands the
     right column and makes its pip bar visibly wider than the others. */
  width: 220px;
  flex-shrink: 0;
}

/* Segmented RPG pip bar — 5 trapezoidal segments. */
.ascend-pipbar {
  display: flex; gap: 4px;
  height: 22px;
  padding: 0;
}
.ascend-pip {
  flex: 1;
  background: color-mix(in srgb, var(--outline-c) 22%, var(--paper));
  border: 2px solid var(--outline-c);
  border-radius: 3px;
  transform: skewX(-14deg);
  transition: background 0.2s, box-shadow 0.2s;
  position: relative;
}
.ascend-pip.next {
  animation: pip-pulse 1.4s ease-in-out infinite;
}
@keyframes pip-pulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.35); }
}

.ascend-row-vals {
  display: flex; align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}
.ascend-row-cur {
  font-family: 'Luckiest Guy', cursive;
  font-size: 15px; letter-spacing: 0.6px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.18);
}
.ascend-row-next {
  font-family: 'Fredoka', sans-serif;
  font-size: 11px; font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.2px;
}
.ascend-row-next.maxed {
  color: #ffd23f;
  text-shadow: 0 0 6px rgba(255,210,63,0.55);
}

.ascend-row-buy {
  font-family: 'Luckiest Guy', cursive;
  font-size: 14px; letter-spacing: 1.4px;
  padding: 8px 10px;
  border: 2.5px solid var(--outline-c);
  border-radius: var(--r);
  color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,0.32);
  box-shadow: var(--drop-sm), inset 0 -2px 0 rgba(0,0,0,0.22), inset 0 1.5px 0 rgba(255,255,255,0.5);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 5px;
  user-select: none;
}
.ascend-row-buy .chip-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
}
.ascend-row-buy .chip-ico svg { width: 100%; height: 100%; display: block; }
.ascend-row-buy:disabled {
  background: color-mix(in srgb, var(--ink-soft) 35%, var(--paper)) !important;
  color: color-mix(in srgb, var(--ink) 50%, transparent);
  text-shadow: none;
  cursor: not-allowed;
  box-shadow: none;
}
.ascend-row-buy.maxed {
  background: color-mix(in srgb, #ffd23f 30%, var(--paper)) !important;
  color: var(--ink);
  text-shadow: 0 0 6px rgba(255,210,63,0.7);
  border-color: #d49b1f;
  cursor: default;
}
.ascend-row-buy.glow { animation: btn-bounce 1.6s ease-in-out infinite; }
.ascend-row-buy:active:not(:disabled):not(.maxed) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--drop-c), inset 0 -2px 0 rgba(0,0,0,0.2);
}

@media (max-width: 720px) {
  .ascend-grid { grid-template-columns: 1fr; }
  .ascend-hero-stats { grid-template-columns: 1fr 1fr 1fr; }
  .ascend-row.stat-row {
    grid-template-columns: 1fr;
  }
  .ascend-row-right {
    width: 100%;
    flex-direction: column;
    gap: 6px;
  }
  .ascend-row-icon { width: 38px; height: 38px; }
  .ascend-row-name { font-size: 14px; }
}
.hud-at .hud-block-icon {
  background: linear-gradient(180deg, #c8a3ff 0%, #9b5fff 100%);
}

/* Bonus-peg drag hint — pinned NEAR THE TOP of the canvas frame, well
   clear of the buckets.  Visible whenever at least one bonus peg is on
   the field, hides itself while a drag is in progress (.dragging class
   added by initCanvas / removed by endDrag).  Pointer-events disabled
   so it never blocks the canvas. */
.peg-drag-hint {
  /* Lives in the board-panel flow between the canvas and the DROP IT
     button so it never sits over the colored bonus pegs on the field. */
  display: none;
  align-self: center;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  margin: 2px 0;
  background: rgba(10, 4, 20, 0.78);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  font-family: 'Fredoka', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.8px;
  color: #fff;
  text-shadow: 0 1px 0 #0a0414;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  animation: peg-hint-pulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
}
.peg-drag-hint.active { display: inline-flex; }
.peg-drag-hint.dragging { display: none; }
.peg-drag-grab {
  display: inline-flex;
  font-size: 14px;
  filter: drop-shadow(0 1px 0 #0a0414);
  animation: peg-hint-wiggle 1.6s ease-in-out infinite;
}
@keyframes peg-hint-pulse {
  0%, 100% { box-shadow: 0 2px 6px rgba(0,0,0,0.45), 0 0 0 0 rgba(255,255,255,0.35); }
  50%      { box-shadow: 0 2px 6px rgba(0,0,0,0.45), 0 0 0 6px rgba(255,255,255,0); }
}
@keyframes peg-hint-wiggle {
  0%, 100% { transform: translateX(-3px) rotate(-8deg); }
  50%      { transform: translateX(3px)  rotate(8deg); }
}

/* Realistic-mode tab — two-save toggle card + spec sheet.  Card pulses
   gold when realistic is active so the player sees at a glance which
   slot they're on. */
.realistic-card {
  background: var(--cream);
  border: 2.5px solid var(--outline-c);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: var(--drop-sm), inset 0 -3px 0 rgba(0,0,0,0.08), inset 0 2px 0 rgba(255,255,255,0.6);
  text-align: center;
  margin-bottom: 4px;
}
.realistic-card.on {
  background: linear-gradient(180deg, #fff4b3 0%, #ffd966 100%);
  border-color: #c88b1a;
  box-shadow: var(--drop-sm), 0 0 22px rgba(255,210,63,0.45);
}
.realistic-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.realistic-icon svg { width: 100%; height: 100%; display: block; }
.realistic-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 26px;
  letter-spacing: 2.2px;
  color: var(--ink);
}
.realistic-status {
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  color: var(--ink-soft);
}
.realistic-status strong {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 1px;
}
.realistic-body {
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 480px;
}
.realistic-toggle-btn {
  margin-top: 6px;
  height: 50px;
  padding: 0 24px;
  background: linear-gradient(180deg, #c8a8ff 0%, #8a4fee 100%);
  border: 2.5px solid var(--outline-c);
  border-radius: var(--r);
  color: #ffffff;
  font-family: 'Luckiest Guy', cursive;
  font-size: 17px;
  letter-spacing: 1.8px;
  cursor: pointer;
  box-shadow: var(--drop-sm), inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.4);
  text-shadow: 0 1.5px 0 rgba(46,24,84,0.4);
  -webkit-text-stroke: 1.2px var(--text-stroke-c);
  paint-order: stroke fill;
  transition: transform 0.08s, filter 0.15s;
}
.realistic-toggle-btn:hover { filter: brightness(1.07); }
.realistic-toggle-btn:active { transform: translateY(2px); }
.realistic-card.on .realistic-toggle-btn {
  background: linear-gradient(180deg, #a8e6ff 0%, #3aa9ff 100%);
}
.realistic-spec {
  background: var(--paper);
  border: 2.5px solid var(--outline-c);
  border-radius: var(--r);
  padding: 14px 16px 12px;
  box-shadow: var(--drop-sm);
}
.realistic-spec-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 16px;
  letter-spacing: 1.6px;
  color: var(--ink);
  margin-bottom: 8px;
}
.realistic-spec-list {
  list-style: disc;
  padding-left: 22px;
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.realistic-spec-list li { margin-bottom: 2px; }

/* ── SUPREME TAB (rebuilt — eerie red altar + 4 generator slots) ──── */
.supreme-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,60,72,0.32) 0%, rgba(40,0,0,0.92) 60%, #160003 100%);
  border: 2.5px solid #5a0a14;
  border-radius: var(--r);
  padding: 18px 16px 16px;
  margin-bottom: 12px;
  color: #ffe2d8;
  box-shadow: var(--drop), 0 0 40px rgba(255,40,60,0.22) inset, 0 0 22px rgba(180,0,30,0.5);
  text-align: center;
}
.supreme-stage.ready {
  animation: supreme-pulse 2.4s ease-in-out infinite;
}
@keyframes supreme-pulse {
  0%, 100% { box-shadow: var(--drop), 0 0 40px rgba(255,40,60,0.22) inset, 0 0 22px rgba(180,0,30,0.5); }
  50%      { box-shadow: var(--drop), 0 0 60px rgba(255,40,60,0.45) inset, 0 0 38px rgba(255,40,80,0.8); }
}
.supreme-stage-lightning {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
}
/* Jagged SVG lightning bolts matching the Supreme-ritual cinematic. */
.supreme-bolt {
  position: absolute;
  display: block;
  pointer-events: none;
  transform-origin: top center;
  opacity: 0;
  animation: bolt-flash 2.8s ease-in-out infinite;
  filter:
    drop-shadow(0 0 4px #ff1828)
    drop-shadow(0 0 10px rgba(255,40,72,0.6));
}
.supreme-bolt-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.supreme-bolt.b1 { left: 8%;  top: -8%;  width: 26px; height: 70%; transform: rotate(6deg);   animation-delay: 0s;    }
.supreme-bolt.b2 { left: 28%; top: -6%;  width: 22px; height: 55%; transform: rotate(-9deg);  animation-delay: 0.6s;  }
.supreme-bolt.b3 { left: 52%; top: -8%;  width: 24px; height: 65%; transform: rotate(3deg);   animation-delay: 1.2s;  }
.supreme-bolt.b4 { left: 72%; top: -6%;  width: 22px; height: 50%; transform: rotate(-4deg);  animation-delay: 1.8s;  }
.supreme-bolt.b5 { left: 90%; top: -8%;  width: 26px; height: 60%; transform: rotate(12deg);  animation-delay: 2.3s;  }
/* Lightning-flicker pattern: each bolt strikes briefly then darkens —
   stutters like the per-frame bolt spawns in the cinematic. */
@keyframes bolt-flash {
  0%, 38%, 100% { opacity: 0; }
  40%           { opacity: 1;   }
  44%           { opacity: 0.2; }
  47%           { opacity: 0.95;}
  50%           { opacity: 0.3; }
  53%           { opacity: 0.85;}
  58%           { opacity: 0;   }
}
.supreme-stage-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 30px; letter-spacing: 4px;
  color: #ff5b6a;
  text-shadow: 0 0 18px rgba(255,40,80,0.85), 0 0 36px rgba(255,40,80,0.4);
  margin-bottom: 2px;
  position: relative;
}
.supreme-stage-sub {
  font-family: 'Fredoka', sans-serif;
  font-size: 12.5px; font-weight: 600;
  color: #ffc7c0;
  letter-spacing: 0.2px;
  margin-bottom: 8px;
  position: relative;
}
.supreme-rank {
  font-family: 'Luckiest Guy', cursive;
  font-size: 13px; letter-spacing: 2.2px;
  color: #ffd23f;
  text-shadow: 0 0 6px rgba(255,210,63,0.55);
  margin-bottom: 10px;
  position: relative;
}
.supreme-sacrifice {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%;
  padding: 16px 18px;
  font-family: 'Luckiest Guy', cursive;
  font-size: 18px; letter-spacing: 1.6px;
  background: linear-gradient(180deg, #c4202c 0%, #6b0510 100%);
  border: 3px solid #ff1828;
  border-radius: var(--r);
  color: #fff;
  text-shadow: 0 0 12px rgba(0,0,0,0.7);
  box-shadow:
    0 0 22px rgba(255,40,60,0.8),
    inset 0 -3px 0 rgba(0,0,0,0.4),
    inset 0 2px 0 rgba(255,140,140,0.45);
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  animation: sacrifice-shake 4s ease-in-out infinite;
}
.supreme-sacrifice:hover { filter: brightness(1.15); }
.supreme-sacrifice:active { transform: translateY(2px); }
@keyframes sacrifice-shake {
  0%, 92%, 100% { transform: translateX(0); }
  93%           { transform: translateX(-2px); }
  94%           { transform: translateX(2px); }
  95%           { transform: translateX(-2px); }
  96%           { transform: translateX(0); }
}
.supreme-sac-text { position: relative; z-index: 1; line-height: 1.2; }
.supreme-sac-text .sub {
  display: block;
  font-size: 11.5px;
  letter-spacing: 2.2px;
  margin-top: 4px;
  color: #ffe2c0;
  text-shadow: 0 0 10px rgba(255,90,60,0.7);
}
.supreme-sac-bolt {
  position: absolute;
  top: 50%;
  width: 56px;
  height: 18px;
  display: block;
  transform: translateY(-50%);
  filter:
    drop-shadow(0 0 4px #ff1828)
    drop-shadow(0 0 8px rgba(255,40,72,0.7));
  animation: sac-bolt-flash 1.1s ease-in-out infinite;
  overflow: visible;
  pointer-events: none;
}
.supreme-sac-bolt.left  { left: 8px;  }
.supreme-sac-bolt.right { right: 8px; animation-delay: 0.55s; }
@keyframes sac-bolt-flash {
  0%, 100% { opacity: 0.35; }
  35%      { opacity: 1;    }
  42%      { opacity: 0.3;  }
  48%      { opacity: 0.95; }
  55%      { opacity: 0.4;  }
}
.supreme-warn {
  font-family: 'Fredoka', sans-serif;
  font-size: 10.5px; font-weight: 600;
  color: #ff9890;
  margin-top: 8px;
  letter-spacing: 0.2px;
}
.supreme-locked-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: rgba(40,0,0,0.55);
  border: 2px dashed #5a0a14;
  border-radius: 999px;
  color: #ffc0bf;
  font-family: 'Luckiest Guy', cursive;
  font-size: 12px; letter-spacing: 1.4px;
}
.supreme-locked-cta .chip-ico svg { fill: #ff5b6a; }

.supreme-gen-header {
  font-family: 'Luckiest Guy', cursive;
  font-size: 13px; letter-spacing: 2.2px;
  color: var(--ink-soft);
  margin: 6px 0 6px 2px;
}
.supreme-gen-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

/* Base slot frame — every generator panel is a metal-rivet box.  Extra
   bottom padding so the absolute-positioned cadence bar + status pill
   don't overlap the foreground content. */
.supreme-gen-slot {
  position: relative;
  border: 2.5px solid var(--outline-c);
  border-radius: var(--r);
  padding: 14px 12px 56px;
  display: block;
  min-height: 178px;
  overflow: hidden;
  box-shadow: var(--drop-sm), 0 1px 0 rgba(255,255,255,0.4) inset;
  isolation: isolate;
}
.supreme-gen-slot.empty {
  filter: grayscale(0.65) brightness(0.92);
  opacity: 0.85;
}
.supreme-gen-slot.empty .supreme-gen-deco { opacity: 0.55; }
.supreme-gen-slot.owned {
  box-shadow:
    var(--drop-sm),
    0 1px 0 rgba(255,255,255,0.4) inset,
    0 0 22px color-mix(in srgb, var(--c, #ffd23f) 65%, transparent);
}

.supreme-gen-deco {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
}
.supreme-gen-content {
  position: relative;
  z-index: 2;
  display: flex; flex-direction: column; gap: 8px;
}
.gen-rivet {
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #d8d8d8, #5a5a5a 70%, #2a2a2a);
  box-shadow: 0 0 0 1px #1a1a1a, inset 0 -1px 0 rgba(255,255,255,0.4);
  z-index: 3;
}
.gen-rivet.r-tl { top: 6px;    left: 6px; }
.gen-rivet.r-tr { top: 6px;    right: 6px; }
.gen-rivet.r-bl { bottom: 6px; left: 6px; }
.gen-rivet.r-br { bottom: 6px; right: 6px; }

.supreme-gen-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  border: 2.5px solid var(--outline-c);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.22), inset 0 1.5px 0 rgba(255,255,255,0.45), var(--drop-sm);
}
.supreme-gen-icon svg { width: 70%; height: 70%; display: block; }
.supreme-gen-text { display: flex; flex-direction: column; gap: 2px; }
.supreme-gen-name {
  font-family: 'Luckiest Guy', cursive;
  font-size: 14px; letter-spacing: 1.3px;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255,255,255,0.45);
}
.supreme-gen-desc {
  font-family: 'Fredoka', sans-serif;
  font-size: 11px; font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.35;
}
.supreme-gen-status {
  /* Pinned to the same fixed location at the bottom of every slot so
     all four "INSTALLED" / "EMPTY SLOT" badges line up regardless of
     each generator's decorative back-layer. */
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 3;
  font-family: 'Luckiest Guy', cursive;
  font-size: 11px; letter-spacing: 1.3px;
  color: var(--ink-soft);
  background: rgba(20,20,20,0.55);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 4px 7px;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}
/* Cadence bar — same look-and-feel as the auto-drop bar so the player
   immediately reads it as "fills, then fires".  Pinned above the
   status pill at a fixed offset so every owned slot's bar is in the
   exact same position. */
.supreme-gen-progress {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 38px;
  height: 6px;
  z-index: 3;
  background: rgba(20,20,20,0.55);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.25);
}
.supreme-gen-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--c, #ffd23f) 65%, #fff) 0%,
    var(--c, #ffd23f) 100%);
  box-shadow: 0 0 6px color-mix(in srgb, var(--c, #ffd23f) 70%, transparent);
  /* No CSS transition — the JS updates width every frame, so any
     transition just causes the fill to "chase" stale values and look
     juddery instead of smooth. */
}
.supreme-gen-status.owned {
  background: color-mix(in srgb, var(--c, #ffd23f) 35%, rgba(20,20,20,0.55));
  border-color: var(--c, #ffd23f);
  color: #fff;
}
.supreme-gen-status .chip-ico { display: inline-flex; vertical-align: -2px; }
.supreme-gen-status .chip-ico svg { width: 13px; height: 13px; }

/* ───── CASH GENERATOR — industrial gray panel ───────────────────── */
.supreme-gen-slot[data-gen="cash"] {
  background:
    linear-gradient(180deg,
      #6c7077 0%,
      #555a62 30%,
      #3f444d 70%,
      #2c3038 100%);
  border-color: #1a1d22;
}
.supreme-gen-slot[data-gen="cash"] .gen-rivet {
  background: radial-gradient(circle at 30% 30%, #c8a04c, #6f4d10 70%, #2a1800);
  box-shadow: 0 0 0 1px #1a0e00, inset 0 -1px 0 rgba(255,220,120,0.45);
}
/* Diagonal black-and-yellow warning tape strips top & bottom. */
.supreme-gen-slot[data-gen="cash"] .gen-deco-tape {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 14px;
  background: repeating-linear-gradient(
    -45deg,
    #ffd23f 0 14px,
    #1a1a1a 14px 28px
  );
  border-bottom: 2px solid #1a1a1a;
  box-shadow: 0 2px 6px rgba(0,0,0,0.45);
}
.supreme-gen-slot[data-gen="cash"] .gen-deco-tape-bot {
  top: auto; bottom: 0;
  border-bottom: none;
  border-top: 2px solid #1a1a1a;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.45);
}
/* Spinning gold gears behind the content. */
.supreme-gen-slot[data-gen="cash"] .gen-deco-gear {
  position: absolute;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.55));
  opacity: 0.85;
}
.supreme-gen-slot[data-gen="cash"] .gen-deco-gear svg {
  width: 100%; height: 100%; display: block;
}
.supreme-gen-slot[data-gen="cash"] .gear-big {
  width: 88px; height: 88px;
  right: -22px;
  bottom: 8px;
  animation: gear-spin-cw 9s linear infinite;
}
.supreme-gen-slot[data-gen="cash"] .gear-small {
  width: 54px; height: 54px;
  right: 56px;
  bottom: 50px;
  animation: gear-spin-ccw 6s linear infinite;
}
.supreme-gen-slot[data-gen="cash"].empty .gen-deco-gear { opacity: 0.45; }
.supreme-gen-slot[data-gen="cash"] .supreme-gen-name {
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,0.6), 0 0 6px rgba(255,210,63,0.45);
  letter-spacing: 1.6px;
}
.supreme-gen-slot[data-gen="cash"] .supreme-gen-desc {
  color: #d2d4d8;
  text-shadow: 0 1px 0 rgba(0,0,0,0.45);
}
.supreme-gen-slot[data-gen="cash"] .supreme-gen-icon {
  border-color: #1a0e00;
  box-shadow:
    inset 0 -2px 0 rgba(0,0,0,0.35),
    inset 0 1.5px 0 rgba(255,255,255,0.45),
    0 0 12px rgba(255,200,40,0.55),
    var(--drop-sm);
}
@keyframes gear-spin-cw  { from { transform: rotate(0deg);   } to { transform: rotate(360deg);  } }
@keyframes gear-spin-ccw { from { transform: rotate(360deg); } to { transform: rotate(0deg);    } }

/* ───── BALL GENERATOR — pressurised horizontal ball-boiler ───────── */
.supreme-gen-slot[data-gen="ball"] {
  background:
    linear-gradient(180deg, #2a4878 0%, #1a3056 50%, #0c1c38 100%);
  border-color: #0a1428;
}
/* Brushed steel edge bands — top and bottom, same 14px proportion
   as the Cash hazard tape but rendered as a riveted metal rail. */
.supreme-gen-slot[data-gen="ball"] .gen-deco-band {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 14px;
  background:
    radial-gradient(circle at 8% 50%, #5478a8 0 1.5px, transparent 1.7px),
    radial-gradient(circle at 24% 50%, #5478a8 0 1.5px, transparent 1.7px),
    radial-gradient(circle at 40% 50%, #5478a8 0 1.5px, transparent 1.7px),
    radial-gradient(circle at 56% 50%, #5478a8 0 1.5px, transparent 1.7px),
    radial-gradient(circle at 72% 50%, #5478a8 0 1.5px, transparent 1.7px),
    radial-gradient(circle at 88% 50%, #5478a8 0 1.5px, transparent 1.7px),
    linear-gradient(180deg, #4a6c98 0%, #2a4878 50%, #0c1c38 100%);
  border-bottom: 2px solid #0a1428;
  box-shadow: 0 2px 6px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}
.supreme-gen-slot[data-gen="ball"] .gen-deco-band-bot {
  top: auto; bottom: 0;
  border-bottom: none;
  border-top: 2px solid #0a1428;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.45), inset 0 -1px 0 rgba(255,255,255,0.18);
  background:
    radial-gradient(circle at 8% 50%, #5478a8 0 1.5px, transparent 1.7px),
    radial-gradient(circle at 24% 50%, #5478a8 0 1.5px, transparent 1.7px),
    radial-gradient(circle at 40% 50%, #5478a8 0 1.5px, transparent 1.7px),
    radial-gradient(circle at 56% 50%, #5478a8 0 1.5px, transparent 1.7px),
    radial-gradient(circle at 72% 50%, #5478a8 0 1.5px, transparent 1.7px),
    radial-gradient(circle at 88% 50%, #5478a8 0 1.5px, transparent 1.7px),
    linear-gradient(0deg, #4a6c98 0%, #2a4878 50%, #0c1c38 100%);
}
.supreme-gen-slot[data-gen="ball"] .gen-deco-grid {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(120,180,255,0.08) 0 1px, transparent 1px 14px);
  opacity: 0.6;
}
.supreme-gen-slot[data-gen="ball"] .gen-rivet {
  background: radial-gradient(circle at 30% 30%, #dcebff, #5478a8 70%, #1a2a4a);
  box-shadow: 0 0 0 1px #0a1428, inset 0 -1px 0 rgba(255,255,255,0.4);
}
/* Boiler tank — horizontal cylinder with riveted seams */
.supreme-gen-slot[data-gen="ball"] .gen-deco-tank {
  position: absolute;
  top: 32px;
  right: 8px;
  width: 116px;
  height: 78px;
  background:
    linear-gradient(180deg,
      #5478a8 0%, #3a5c8c 12%,
      #2a4878 50%,
      #1a3056 88%, #1a2a4a 100%);
  border: 2px solid #0a1428;
  border-radius: 38px / 30px;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.35),
    inset 0 -3px 0 rgba(0,0,0,0.45),
    inset 12px 0 16px rgba(0,0,0,0.25),
    0 2px 5px rgba(0,0,0,0.55);
}
/* Rivets on the tank seams */
.supreme-gen-slot[data-gen="ball"] .gen-deco-tank-rivet {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #dcebff, #5478a8 70%, #1a2a4a);
  box-shadow: 0 0 0 1px #0a1428;
}
.supreme-gen-slot[data-gen="ball"] .tr1 { left: 10px; top: 6px;  }
.supreme-gen-slot[data-gen="ball"] .tr2 { left: 10px; bottom: 6px; }
.supreme-gen-slot[data-gen="ball"] .tr3 { right: 10px; top: 6px;  }
.supreme-gen-slot[data-gen="ball"] .tr4 { right: 10px; bottom: 6px; }
/* Porthole window — the chamber where the balls bounce */
.supreme-gen-slot[data-gen="ball"] .gen-deco-porthole {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.08) 30%, transparent 50%),
    linear-gradient(180deg, #6cb6ff 0%, #1a52c8 100%);
  border: 3px solid #0a1428;
  box-shadow:
    0 0 0 2px #4a7aac,
    inset 0 2px 0 rgba(255,255,255,0.5),
    inset 0 -4px 4px rgba(0,0,0,0.4);
  overflow: hidden;
}
/* 4 balls bouncing inside the porthole on distinct random paths */
.supreme-gen-slot[data-gen="ball"] .gen-deco-bball {
  position: absolute;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff, #c0d8ff 60%, #5a8cff);
  box-shadow: 0 0 6px rgba(180,210,255,0.9);
}
.supreme-gen-slot[data-gen="ball"] .b1 { animation: bb1 2.2s linear infinite; }
.supreme-gen-slot[data-gen="ball"] .b2 { animation: bb2 2.6s linear infinite; }
.supreme-gen-slot[data-gen="ball"] .b3 { animation: bb3 1.9s linear infinite; }
.supreme-gen-slot[data-gen="ball"] .b4 { animation: bb4 3.0s linear infinite; }
@keyframes bb1 {
  0%   { top: 15%; left: 20%; }
  25%  { top: 70%; left: 60%; }
  50%  { top: 35%; left: 75%; }
  75%  { top: 80%; left: 25%; }
  100% { top: 15%; left: 20%; }
}
@keyframes bb2 {
  0%   { top: 60%; left: 70%; }
  25%  { top: 20%; left: 35%; }
  50%  { top: 75%; left: 20%; }
  75%  { top: 30%; left: 65%; }
  100% { top: 60%; left: 70%; }
}
@keyframes bb3 {
  0%   { top: 30%; left: 50%; }
  25%  { top: 75%; left: 65%; }
  50%  { top: 50%; left: 20%; }
  75%  { top: 20%; left: 70%; }
  100% { top: 30%; left: 50%; }
}
@keyframes bb4 {
  0%   { top: 75%; left: 30%; }
  25%  { top: 35%; left: 70%; }
  50%  { top: 65%; left: 40%; }
  75%  { top: 25%; left: 25%; }
  100% { top: 75%; left: 30%; }
}
/* Status LED on the tank */
.supreme-gen-slot[data-gen="ball"] .gen-deco-led {
  position: absolute;
  right: 16px; top: 16px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #1aff80;
  box-shadow: 0 0 8px rgba(60,255,120,0.95), inset 0 -1px 0 rgba(0,80,40,0.55);
  animation: led-blink 1.4s ease-in-out infinite;
}
@keyframes led-blink {
  0%, 100% { opacity: 1;   box-shadow: 0 0 8px rgba(60,255,120,0.95);  }
  50%      { opacity: 0.4; box-shadow: 0 0 3px rgba(60,255,120,0.45);  }
}
/* Steam vents on top */
.supreme-gen-slot[data-gen="ball"] .gen-deco-vent {
  position: absolute;
  width: 10px; height: 6px;
  top: 24px;
  background: linear-gradient(180deg, #5478a8, #2a4878);
  border: 2px solid #0a1428;
  border-radius: 2px;
  border-bottom: none;
}
.supreme-gen-slot[data-gen="ball"] .v1 { right: 48px; }
.supreme-gen-slot[data-gen="ball"] .v2 { right: 78px; }
/* Rising steam puffs */
.supreme-gen-slot[data-gen="ball"] .gen-deco-steam {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220,235,255,0.85), transparent 70%);
  filter: blur(2px);
  animation: steam-rise 2.2s ease-out infinite;
}
.supreme-gen-slot[data-gen="ball"] .st1 { right: 52px; bottom: calc(100% - 30px); animation-delay: 0s;   }
.supreme-gen-slot[data-gen="ball"] .st2 { right: 82px; bottom: calc(100% - 30px); animation-delay: 0.8s; }
.supreme-gen-slot[data-gen="ball"] .st3 { right: 67px; bottom: calc(100% - 30px); animation-delay: 1.5s; }
@keyframes steam-rise {
  0%   { transform: translateY(0)     scale(0.5); opacity: 0;    }
  20%  { opacity: 0.9; }
  100% { transform: translateY(-26px) scale(1.6); opacity: 0;    }
}
/* Valve wheel on the side of the tank */
.supreme-gen-slot[data-gen="ball"] .gen-deco-wheel {
  position: absolute;
  left: 14px; bottom: 22px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #2a4878 0%, #2a4878 22%, transparent 26%),
    repeating-conic-gradient(
      from 0deg,
      #5478a8 0deg 18deg,
      #2a4878 18deg 27deg,
      #5478a8 27deg 45deg
    );
  border: 2.5px solid #0a1428;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.55);
  animation: wheel-spin 6s linear infinite;
}
.supreme-gen-slot[data-gen="ball"] .gen-deco-wheel::after {
  content: '';
  position: absolute;
  inset: 38%;
  border-radius: 50%;
  background: #dcebff;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.4);
}
@keyframes wheel-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
/* Pressure gauge (kept from before, repositioned) */
.supreme-gen-slot[data-gen="ball"] .gen-deco-gauge {
  position: absolute;
  left: 14px; top: 18px;
  width: 28px; height: 28px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.55));
}
.supreme-gen-slot[data-gen="ball"] .gen-deco-gauge svg {
  width: 100%; height: 100%; display: block;
  animation: gauge-tick 3.2s ease-in-out infinite;
  transform-origin: center;
}
@keyframes gauge-tick {
  0%, 100% { transform: rotate(-4deg); }
  50%      { transform: rotate(4deg);  }
}
.supreme-gen-slot[data-gen="ball"].empty .gen-deco-bball,
.supreme-gen-slot[data-gen="ball"].empty .gen-deco-steam,
.supreme-gen-slot[data-gen="ball"].empty .gen-deco-led { opacity: 0.45; }
.supreme-gen-slot[data-gen="ball"] .supreme-gen-name {
  color: #e2eefe;
  text-shadow: 0 1px 0 rgba(0,0,0,0.55), 0 0 6px rgba(120,180,255,0.7);
  letter-spacing: 1.6px;
}
.supreme-gen-slot[data-gen="ball"] .supreme-gen-desc {
  color: #b8c8e0;
  text-shadow: 0 1px 0 rgba(0,0,0,0.45);
}
.supreme-gen-slot[data-gen="ball"] .supreme-gen-icon {
  border-color: #0a1428;
  box-shadow:
    inset 0 -2px 0 rgba(0,0,0,0.32),
    inset 0 1.5px 0 rgba(255,255,255,0.45),
    0 0 12px rgba(80,140,255,0.7),
    var(--drop-sm);
}

/* ───── SP GENERATOR — mint-press stamping forge ─────────────────── */
.supreme-gen-slot[data-gen="sp"] {
  background:
    radial-gradient(ellipse at 70% 45%, rgba(255,140,200,0.4) 0%, transparent 55%),
    radial-gradient(ellipse at 25% 75%, rgba(180,40,120,0.35) 0%, transparent 50%),
    linear-gradient(180deg, #4a1838 0%, #2a0a20 100%);
  border-color: #1a0414;
}
/* Brass-rail edge bands with a pink filament running down the centre. */
.supreme-gen-slot[data-gen="sp"] .gen-deco-band {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 14px;
  background: linear-gradient(180deg, #ffe2a8 0%, #d49b1f 35%, #b97700 65%, #5a3a00 100%);
  border-bottom: 2px solid #1a0414;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.45);
}
.supreme-gen-slot[data-gen="sp"] .gen-deco-band::after {
  content: '';
  position: absolute;
  left: 4%; right: 4%;
  top: 50%;
  transform: translateY(-50%);
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #ff80c4 50%, transparent 100%);
  box-shadow: 0 0 6px rgba(255,128,200,0.85);
}
.supreme-gen-slot[data-gen="sp"] .gen-deco-band-bot {
  top: auto; bottom: 0;
  border-bottom: none;
  border-top: 2px solid #1a0414;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.5), inset 0 -1px 0 rgba(255,255,255,0.35);
  background: linear-gradient(0deg, #ffe2a8 0%, #d49b1f 35%, #b97700 65%, #5a3a00 100%);
}
.supreme-gen-slot[data-gen="sp"] .gen-rivet {
  background: radial-gradient(circle at 30% 30%, #ffe2a8, #c08820 70%, #5a3a00);
  box-shadow: 0 0 0 1px #1a0414, inset 0 -1px 0 rgba(255,230,160,0.6);
}
/* Soft pulsing aura behind the cabinet */
.supreme-gen-slot[data-gen="sp"] .gen-deco-aura {
  position: absolute;
  right: 4px; top: 14px;
  width: 116px; height: 124px;
  background: radial-gradient(circle, rgba(255,140,200,0.5), transparent 70%);
  animation: sp-aura-pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sp-aura-pulse {
  0%, 100% { transform: scale(0.95); opacity: 0.55; }
  50%      { transform: scale(1.15); opacity: 1;    }
}
/* Slot machine cabinet — dark wine body with brass trim */
.supreme-gen-slot[data-gen="sp"] .gen-deco-cabinet {
  position: absolute;
  right: 12px; top: 20px;
  width: 96px; height: 116px;
  background:
    linear-gradient(180deg, #6a1838 0%, #3a0a20 60%, #2a0414 100%);
  border: 2.5px solid #1a0414;
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1.5px #b97700,
    inset 0 2px 0 rgba(255,200,230,0.18),
    inset 0 -3px 0 rgba(0,0,0,0.45),
    0 3px 5px rgba(0,0,0,0.55);
}
/* Top marquee with bulbs and JACKPOT label */
.supreme-gen-slot[data-gen="sp"] .gen-deco-marquee {
  position: absolute;
  right: 17px; top: 24px;
  width: 86px; height: 18px;
  background: linear-gradient(180deg, #ffe2a8 0%, #d49b1f 60%, #8a5a00 100%);
  border: 2px solid #1a0414;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 1px 3px rgba(0,0,0,0.4);
}
.supreme-gen-slot[data-gen="sp"] .gen-deco-marquee-txt {
  font-family: 'Luckiest Guy', cursive;
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #4a2200;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}
/* Marquee bulbs around the edge */
.supreme-gen-slot[data-gen="sp"] .gen-deco-marquee .gen-deco-bulb {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #ffd0e8 50%, #ff80c4);
  box-shadow: 0 0 4px rgba(255,128,200,0.95);
  animation: bulb-blink 1.4s ease-in-out infinite;
  top: -1px;
}
.supreme-gen-slot[data-gen="sp"] .mb1 { left: 4px;   animation-delay: 0s;   }
.supreme-gen-slot[data-gen="sp"] .mb2 { left: 22px;  animation-delay: 0.3s; }
.supreme-gen-slot[data-gen="sp"] .mb3 { left: 40px;  animation-delay: 0.6s; }
.supreme-gen-slot[data-gen="sp"] .mb4 { left: 58px;  animation-delay: 0.9s; }
.supreme-gen-slot[data-gen="sp"] .mb5 { left: 76px;  animation-delay: 1.2s; }
@keyframes bulb-blink {
  0%, 100% { opacity: 1;   box-shadow: 0 0 4px rgba(255,128,200,0.95); }
  50%      { opacity: 0.4; box-shadow: 0 0 2px rgba(255,128,200,0.5);  }
}
/* Reel bank — 3 spinning reels */
.supreme-gen-slot[data-gen="sp"] .gen-deco-reels {
  position: absolute;
  right: 18px; top: 50px;
  width: 84px; height: 44px;
  background: linear-gradient(180deg, #100008 0%, #2a0a20 100%);
  border: 2px solid #1a0414;
  border-radius: 4px;
  display: flex;
  padding: 3px;
  gap: 2px;
  box-shadow: inset 0 0 0 1px #b97700, inset 0 2px 3px rgba(0,0,0,0.5);
}
.supreme-gen-slot[data-gen="sp"] .gen-deco-reel {
  flex: 1;
  background: linear-gradient(180deg, #ffe2a8 0%, #d49b1f 100%);
  border: 1.5px solid #5a3a00;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -1px 0 rgba(0,0,0,0.35);
}
.supreme-gen-slot[data-gen="sp"] .reel-strip {
  position: absolute;
  left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.supreme-gen-slot[data-gen="sp"] .reel-strip span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  font-size: 14px;
  color: #c8408c;
  text-shadow: 0 0 4px rgba(255,128,200,0.85), 0 1px 0 rgba(255,255,255,0.5);
  line-height: 1;
}
.supreme-gen-slot[data-gen="sp"] .r1 .reel-strip { animation: reel-roll 0.55s linear infinite; }
.supreme-gen-slot[data-gen="sp"] .r2 .reel-strip { animation: reel-roll 0.78s linear infinite; }
.supreme-gen-slot[data-gen="sp"] .r3 .reel-strip { animation: reel-roll 0.42s linear infinite; }
@keyframes reel-roll {
  0%   { transform: translateY(-72px); }
  100% { transform: translateY(0); }
}
/* Pull lever on the right side of the cabinet */
.supreme-gen-slot[data-gen="sp"] .gen-deco-lever {
  position: absolute;
  right: 4px;
  top: 70px;
  width: 12px;
  height: 38px;
  animation: lever-pull 3.2s ease-in-out infinite;
  transform-origin: top center;
}
@keyframes lever-pull {
  0%, 60%, 100% { transform: rotate(0deg);  }
  72%           { transform: rotate(28deg); }
  82%           { transform: rotate(0deg);  }
}
.supreme-gen-slot[data-gen="sp"] .gen-deco-lever-shaft {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 32px;
  background: linear-gradient(90deg, #5a3a00 0%, #ffe2a8 35%, #b97700 70%, #5a3a00 100%);
  border: 1.5px solid #1a0414;
  border-radius: 2px;
}
.supreme-gen-slot[data-gen="sp"] .gen-deco-lever-ball {
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #ff80c4 60%, #c8408c);
  border: 1.5px solid #1a0414;
  box-shadow: 0 0 6px rgba(255,128,200,0.85);
}
/* Coin tray at the bottom of the cabinet */
.supreme-gen-slot[data-gen="sp"] .gen-deco-tray {
  position: absolute;
  right: 18px; bottom: 26px;
  width: 84px; height: 14px;
  background: linear-gradient(180deg, #1a0a14 0%, #100008 100%);
  border: 2px solid #1a0414;
  border-top: 2px solid #b97700;
  border-radius: 0 0 4px 4px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.7);
}
/* Star coin sitting in the tray */
.supreme-gen-slot[data-gen="sp"] .gen-deco-coin {
  position: absolute;
  right: 50px; bottom: 27px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffe0f0, #ff80c4 50%, #c8408c 90%);
  border: 1.5px solid #1a0414;
  box-shadow: 0 0 10px rgba(255,140,200,0.95);
  animation: coin-glow 1.8s ease-in-out infinite;
}
.supreme-gen-slot[data-gen="sp"] .gen-deco-coin::after {
  content: '\2605';   /* ★ */
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  color: #fff;
  text-shadow: 0 0 3px rgba(0,0,0,0.5);
}
@keyframes coin-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(255,140,200,0.7);   }
  50%      { box-shadow: 0 0 16px rgba(255,200,230,1);    }
}
.supreme-gen-slot[data-gen="sp"].empty .gen-deco-marquee,
.supreme-gen-slot[data-gen="sp"].empty .reel-strip,
.supreme-gen-slot[data-gen="sp"].empty .gen-deco-coin,
.supreme-gen-slot[data-gen="sp"].empty .gen-deco-bulb { opacity: 0.45; }
.supreme-gen-slot[data-gen="sp"] .supreme-gen-name {
  color: #ffe4f2;
  text-shadow: 0 1px 0 rgba(0,0,0,0.55), 0 0 8px rgba(255,120,200,0.9);
  letter-spacing: 1.6px;
}
.supreme-gen-slot[data-gen="sp"] .supreme-gen-desc {
  color: #e9c8dc;
  text-shadow: 0 1px 0 rgba(0,0,0,0.45);
}
.supreme-gen-slot[data-gen="sp"] .supreme-gen-icon {
  border-color: #1a0414;
  box-shadow:
    inset 0 -2px 0 rgba(0,0,0,0.32),
    inset 0 1.5px 0 rgba(255,255,255,0.45),
    0 0 14px rgba(255,120,200,0.8),
    var(--drop-sm);
}

/* ───── STAT GENERATOR — cosmic vortex generator ─────────────────── */
.supreme-gen-slot[data-gen="xp"] {
  background:
    radial-gradient(ellipse at 20% 80%, rgba(155,95,255,0.32) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(80,40,180,0.45) 0%, transparent 55%),
    linear-gradient(180deg, #1a0a2e 0%, #0a0418 100%);
  border-color: #06020e;
}
/* Deep-space edge bands with a sprinkle of stars and a violet glow line. */
.supreme-gen-slot[data-gen="xp"] .gen-deco-band {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 14px;
  background:
    radial-gradient(1.4px 1.4px at 14% 50%, #fff, transparent),
    radial-gradient(1px 1px at 34% 50%, #d8c4ff, transparent),
    radial-gradient(1.4px 1.4px at 56% 50%, #fff, transparent),
    radial-gradient(1px 1px at 76% 50%, #d8c4ff, transparent),
    radial-gradient(1.4px 1.4px at 92% 50%, #fff, transparent),
    linear-gradient(180deg, #2a1a4a 0%, #150a2e 60%, #06020e 100%);
  border-bottom: 2px solid #06020e;
  box-shadow: 0 2px 8px rgba(155,95,255,0.45), inset 0 1px 0 rgba(216,184,255,0.35);
}
.supreme-gen-slot[data-gen="xp"] .gen-deco-band::after {
  content: '';
  position: absolute;
  left: 6%; right: 6%;
  bottom: 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent 0%, #c75dff 50%, transparent 100%);
  box-shadow: 0 0 8px rgba(199,93,255,0.85);
}
.supreme-gen-slot[data-gen="xp"] .gen-deco-band-bot {
  top: auto; bottom: 0;
  border-bottom: none;
  border-top: 2px solid #06020e;
  box-shadow: 0 -2px 8px rgba(155,95,255,0.45), inset 0 -1px 0 rgba(216,184,255,0.3);
  background:
    radial-gradient(1.4px 1.4px at 18% 50%, #fff, transparent),
    radial-gradient(1px 1px at 38% 50%, #d8c4ff, transparent),
    radial-gradient(1.4px 1.4px at 60% 50%, #fff, transparent),
    radial-gradient(1px 1px at 80% 50%, #d8c4ff, transparent),
    radial-gradient(1.4px 1.4px at 95% 50%, #fff, transparent),
    linear-gradient(0deg, #2a1a4a 0%, #150a2e 60%, #06020e 100%);
}
.supreme-gen-slot[data-gen="xp"] .gen-deco-band-bot::after {
  content: '';
  position: absolute;
  left: 6%; right: 6%;
  top: 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent 0%, #c75dff 50%, transparent 100%);
  box-shadow: 0 0 8px rgba(199,93,255,0.85);
}
.supreme-gen-slot[data-gen="xp"] .gen-rivet {
  background: radial-gradient(circle at 30% 30%, #d8b8ff, #6a3ad8 70%, #2a1a4a);
  box-shadow: 0 0 0 1px #06020e, inset 0 -1px 0 rgba(216,184,255,0.6),
              0 0 4px rgba(155,95,255,0.7);
}
/* Nebula clouds */
.supreme-gen-slot[data-gen="xp"] .gen-deco-nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(12px);
}
.supreme-gen-slot[data-gen="xp"] .n1 {
  right: -10px; top: -10px;
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(199,93,255,0.55), transparent 70%);
}
.supreme-gen-slot[data-gen="xp"] .n2 {
  left: 12px; bottom: -12px;
  width: 60px; height: 60px;
  background: radial-gradient(circle, rgba(80,40,180,0.7), transparent 70%);
}
/* Dense starfield */
.supreme-gen-slot[data-gen="xp"] .gen-deco-stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff, transparent),
    radial-gradient(1px 1px   at 78% 36%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 64% 78%, #d8c4ff, transparent),
    radial-gradient(1px 1px   at 32% 65%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 88% 88%, #fff, transparent),
    radial-gradient(1px 1px   at 22% 88%, #d8c4ff, transparent),
    radial-gradient(1px 1px   at 50% 14%, #fff, transparent),
    radial-gradient(2px 2px   at 70% 55%, #fff, transparent),
    radial-gradient(1px 1px   at 8% 50%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 42% 35%, #c8a4ff, transparent);
  animation: stars-twinkle 3.5s ease-in-out infinite;
}
@keyframes stars-twinkle {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1;   }
}
/* Concentric orbit rings */
.supreme-gen-slot[data-gen="xp"] .gen-deco-orbit {
  position: absolute;
  right: 18px; top: 28px;
  border-radius: 50%;
  pointer-events: none;
}
.supreme-gen-slot[data-gen="xp"] .o1 {
  width: 92px; height: 92px;
  margin-right: -10px; margin-top: -10px;
  border: 1.5px dashed rgba(216,184,255,0.45);
  animation: orbit-spin 16s linear infinite;
}
.supreme-gen-slot[data-gen="xp"] .o2 {
  width: 64px; height: 64px;
  margin-right: 4px;   margin-top: 4px;
  border: 1.5px solid rgba(199,93,255,0.55);
  animation: orbit-spin 10s linear infinite reverse;
}
.supreme-gen-slot[data-gen="xp"] .o3 {
  width: 38px; height: 38px;
  margin-right: 17px;  margin-top: 17px;
  border: 1.2px dashed rgba(255,255,255,0.65);
  animation: orbit-spin 6s linear infinite;
}
@keyframes orbit-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
/* Tiny planets on the rings */
.supreme-gen-slot[data-gen="xp"] .gen-deco-planet {
  position: absolute;
  border-radius: 50%;
}
.supreme-gen-slot[data-gen="xp"] .pl1 {
  right: 18px; top: 24px;
  width: 92px; height: 92px;
  animation: orbit-spin 16s linear infinite;
}
.supreme-gen-slot[data-gen="xp"] .pl1::after {
  content: '';
  position: absolute;
  right: -3px; top: 50%;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #d8b8ff, #6a3ad8);
  box-shadow: 0 0 6px rgba(155,95,255,0.85);
}
.supreme-gen-slot[data-gen="xp"] .pl2 {
  right: 36px; top: 42px;
  width: 64px; height: 64px;
  animation: orbit-spin 10s linear infinite reverse;
}
.supreme-gen-slot[data-gen="xp"] .pl2::after {
  content: '';
  position: absolute;
  left: 50%; top: -3px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #c8a4ff);
  box-shadow: 0 0 5px rgba(255,255,255,0.85);
}
/* Central glowing core */
.supreme-gen-slot[data-gen="xp"] .gen-deco-core {
  position: absolute;
  right: 56px; top: 65px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #d8b8ff 40%, transparent 75%);
  box-shadow: 0 0 18px rgba(216,184,255,0.95), 0 0 36px rgba(155,95,255,0.6);
  animation: core-pulse 2s ease-in-out infinite;
}
@keyframes core-pulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 18px rgba(216,184,255,0.95), 0 0 36px rgba(155,95,255,0.6); }
  50%      { transform: scale(1.25); box-shadow: 0 0 26px rgba(216,184,255,1),    0 0 52px rgba(155,95,255,0.85); }
}
/* Shooting stars */
.supreme-gen-slot[data-gen="xp"] .gen-deco-shoot {
  position: absolute;
  width: 22px; height: 1.5px;
  background: linear-gradient(90deg, transparent, #fff 70%, transparent);
  filter: drop-shadow(0 0 4px #fff);
  animation: shoot-star 3.2s ease-in infinite;
  opacity: 0;
}
.supreme-gen-slot[data-gen="xp"] .sh1 { top: 30%; left: -10%; animation-delay: 0s;   transform: rotate(15deg); }
.supreme-gen-slot[data-gen="xp"] .sh2 { top: 60%; left: -10%; animation-delay: 1.6s; transform: rotate(-10deg); }
@keyframes shoot-star {
  0%   { left: -10%; opacity: 0; }
  10%  { opacity: 1; }
  40%  { opacity: 1; }
  60%  { left: 110%; opacity: 0; }
  100% { left: 110%; opacity: 0; }
}
.supreme-gen-slot[data-gen="xp"].empty .gen-deco-core,
.supreme-gen-slot[data-gen="xp"].empty .gen-deco-orbit,
.supreme-gen-slot[data-gen="xp"].empty .gen-deco-shoot,
.supreme-gen-slot[data-gen="xp"].empty .gen-deco-orb,
.supreme-gen-slot[data-gen="xp"].empty .gen-deco-stream,
.supreme-gen-slot[data-gen="xp"].empty .gen-deco-aura { opacity: 0.5; }

/* ── XP generator — new design (orb → 5 streams → 5 mini buckets) ──── */
.supreme-gen-slot[data-gen="xp"] .gen-deco-grid {
  position: absolute; inset: 14px 12px 26px;
  background:
    repeating-linear-gradient(0deg,   transparent 0 14px, rgba(216,184,255,0.05) 14px 15px),
    repeating-linear-gradient(90deg,  transparent 0 14px, rgba(216,184,255,0.05) 14px 15px);
  pointer-events: none;
}
.supreme-gen-slot[data-gen="xp"] .gen-deco-star {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 30%, rgba(216,184,255,0.7) 70%, transparent);
  filter: drop-shadow(0 0 3px rgba(216,184,255,0.8));
  animation: xp-star-rise 3.4s linear infinite;
  opacity: 0;
}
.supreme-gen-slot[data-gen="xp"] .xs1 { left: 12%; animation-delay: 0s;   }
.supreme-gen-slot[data-gen="xp"] .xs2 { left: 30%; animation-delay: 0.6s; }
.supreme-gen-slot[data-gen="xp"] .xs3 { left: 48%; animation-delay: 1.1s; }
.supreme-gen-slot[data-gen="xp"] .xs4 { left: 66%; animation-delay: 1.7s; }
.supreme-gen-slot[data-gen="xp"] .xs5 { left: 82%; animation-delay: 2.3s; }
.supreme-gen-slot[data-gen="xp"] .xs6 { left: 92%; animation-delay: 0.3s; }
@keyframes xp-star-rise {
  0%   { bottom: 30px;  opacity: 0; }
  20%  { opacity: 1; }
  90%  { opacity: 0.5; }
  100% { bottom: 110%;  opacity: 0; }
}

.supreme-gen-slot[data-gen="xp"] .gen-deco-aura {
  position: absolute;
  left: 50%; top: 44px;
  transform: translate(-50%, 0);
  width: 92px; height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(199,93,255,0.55) 0%, rgba(155,95,255,0.18) 45%, transparent 70%);
  animation: xp-aura-pulse 2.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes xp-aura-pulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, 0) scale(1);    }
  50%      { opacity: 1;   transform: translate(-50%, 0) scale(1.18); }
}
.supreme-gen-slot[data-gen="xp"] .gen-deco-orb {
  position: absolute;
  left: 50%; top: 56px;
  transform: translate(-50%, 0);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #ffffff 0%, #d8c4ff 30%, #9b5fff 65%, #4a256e 95%);
  border: 2.5px solid #2c1856;
  box-shadow:
    0 0 18px rgba(199,93,255,0.95),
    inset 0 -4px 8px rgba(0,0,0,0.4),
    inset 0 2px 4px rgba(255,255,255,0.55);
  animation: xp-orb-pulse 2.2s ease-in-out infinite;
  display: flex; align-items: center; justify-content: center;
}
.supreme-gen-slot[data-gen="xp"] .gen-deco-orb span {
  font-family: 'Luckiest Guy', cursive;
  font-size: 14px;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 1px 0 #2c1856, 0 0 6px rgba(199,93,255,0.85);
}
@keyframes xp-orb-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(199,93,255,0.85), inset 0 -4px 8px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.55); }
  50%      { box-shadow: 0 0 26px rgba(216,184,255,1.0),  inset 0 -4px 8px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.55); }
}

/* 5 streams flowing from the orb area down to the mini buckets. */
.supreme-gen-slot[data-gen="xp"] .gen-deco-stream {
  position: absolute;
  bottom: 14px;
  width: 2.5px;
  height: 38px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(199,93,255,0.85) 35%, rgba(155,95,255,0) 100%);
  box-shadow: 0 0 6px rgba(199,93,255,0.8);
  border-radius: 2px;
  animation: xp-stream-flow 1.4s ease-in-out infinite;
  opacity: 0;
}
.supreme-gen-slot[data-gen="xp"] .s1 { left: 14%; animation-delay: 0s;   }
.supreme-gen-slot[data-gen="xp"] .s2 { left: 30%; animation-delay: 0.16s; }
.supreme-gen-slot[data-gen="xp"] .s3 { left: 46%; animation-delay: 0.32s; }
.supreme-gen-slot[data-gen="xp"] .s4 { left: 62%; animation-delay: 0.48s; }
.supreme-gen-slot[data-gen="xp"] .s5 { left: 78%; animation-delay: 0.64s; }
@keyframes xp-stream-flow {
  0%   { opacity: 0; transform: translateY(-22px) scaleY(0.4); }
  35%  { opacity: 1; transform: translateY(-2px)  scaleY(1.0); }
  75%  { opacity: 0.7; }
  100% { opacity: 0; transform: translateY(18px)  scaleY(0.6); }
}

/* 5 mini receiving buckets — the visual destination of the streams. */
.supreme-gen-slot[data-gen="xp"] .gen-deco-mini {
  position: absolute;
  bottom: 4px;
  width: 14px; height: 12px;
  background: linear-gradient(180deg, #6b3fc0 0%, #2a1654 100%);
  border: 1.5px solid #c8a8ff;
  border-radius: 3px 3px 1px 1px;
  box-shadow:
    inset 0 -2px 0 rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.4),
    0 0 6px rgba(199,93,255,0.55);
}
.supreme-gen-slot[data-gen="xp"] .m1 { left: calc(14% - 5px); }
.supreme-gen-slot[data-gen="xp"] .m2 { left: calc(30% - 5px); }
.supreme-gen-slot[data-gen="xp"] .m3 { left: calc(46% - 5px); }
.supreme-gen-slot[data-gen="xp"] .m4 { left: calc(62% - 5px); }
.supreme-gen-slot[data-gen="xp"] .m5 { left: calc(78% - 5px); }
.supreme-gen-slot[data-gen="xp"].empty .gen-deco-mini { opacity: 0.55; }
.supreme-gen-slot[data-gen="xp"] .supreme-gen-name {
  color: #f0e0ff;
  text-shadow: 0 1px 0 rgba(0,0,0,0.55), 0 0 8px rgba(199,93,255,0.85);
  letter-spacing: 1.6px;
}
.supreme-gen-slot[data-gen="xp"] .supreme-gen-desc {
  color: #c8b0e8;
  text-shadow: 0 1px 0 rgba(0,0,0,0.45);
}
.supreme-gen-slot[data-gen="xp"] .supreme-gen-icon {
  border-color: #06020e;
  box-shadow:
    inset 0 -2px 0 rgba(0,0,0,0.32),
    inset 0 1.5px 0 rgba(255,255,255,0.45),
    0 0 14px rgba(155,95,255,0.85),
    var(--drop-sm);
}

@media (max-width: 720px) {
  .supreme-gen-grid { grid-template-columns: 1fr; }
  .supreme-stage-title { font-size: 26px; letter-spacing: 3px; }
  .supreme-sacrifice { font-size: 16px; padding: 14px 14px; }
  .supreme-gen-slot[data-gen="cash"] .gear-big { right: -10px; width: 76px; height: 76px; }
}

/* ── SUPREME RITUAL OVERLAY (full-screen Angelic Plinko cinematic) ─── */
/* Opaque red-to-black overlay — the normal game must be fully hidden
   during the ritual.  Bucket DOM slots and DROP-IT button sit above
   the canvas via z-index. */
.fb-fx-overlay.supreme-overlay {
  /* Solid black baseline so any transparent decals can't leak through
     to the normal game; the inline radial gradients painted in
     startSupremeRitual paint over this for the ominous red glow. */
  background-color: #000 !important;
  animation: supreme-bg-pulse 5s ease-in-out infinite, fb-fx-fade 0.25s ease;
}
@keyframes supreme-bg-pulse {
  0%, 100% { filter: brightness(1)    saturate(1);    }
  50%      { filter: brightness(1.25) saturate(1.25); }
}
.fb-fx-overlay.supreme-overlay .fb-fx-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.fb-fx-overlay .supreme-bucket {
  /* Bucket DOM slots sit BELOW the canvas — the canvas leaves the
     bucket area transparent so the slot shows through, while the ball
     drawn on the canvas appears in front of the slot when it lands. */
  z-index: 0;
  border-radius: 14px 14px 4px 4px;
  pointer-events: none;
}
.fb-fx-overlay .supreme-bucket-label {
  position: absolute;
  left: 0; right: 0;
  bottom: 6px;
  text-align: center;
  font-family: 'Luckiest Guy', cursive;
  font-size: 11px;
  letter-spacing: 1.4px;
  color: #fff;
  text-shadow: 0 0 6px rgba(0,0,0,0.95), 0 1px 0 #000, 0 0 12px var(--c, #ffd23f);
  z-index: 5;
  pointer-events: none;
}
/* The base .fb-fx-overlay has pointer-events:none so other cinematics
   can't be clicked through; the Supreme ritual NEEDS the DROP IT button
   to receive clicks, so we re-enable pointer events on that button only
   while leaving the overlay otherwise click-through. */
/* Fullscreen invisible catcher — taps anywhere during the prompt
   phase trigger the drop so the player can never get stuck. */
.supreme-drop-catcher {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: auto;
  cursor: pointer;
  background: transparent;
}
.supreme-drop-btn {
  position: absolute;
  left: 50%;
  top: 70%;
  transform: translate(-50%, -50%);
  padding: 18px 36px;
  font-family: 'Luckiest Guy', cursive;
  font-size: 28px;
  letter-spacing: 4px;
  color: #4a2f00;
  text-shadow: 0 1px 0 rgba(255,255,255,0.55);
  background: linear-gradient(180deg, #fff7c2 0%, #ffd23f 55%, #c98a14 100%);
  border: 3px solid #b97700;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  box-shadow:
    0 0 40px rgba(255,210,63,0.85),
    0 0 80px rgba(255,180,40,0.5),
    inset 0 -4px 0 rgba(0,0,0,0.22),
    inset 0 3px 0 rgba(255,255,255,0.55);
  animation: drop-pop 0.45s ease-out, drop-pulse 1.6s ease-in-out infinite 0.45s;
  z-index: 10;
}
.supreme-drop-btn:hover  { filter: brightness(1.1); }
.supreme-drop-btn:active { transform: translate(-50%, -50%) translateY(3px); }
.supreme-drop-btn.out {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
  transition: opacity 0.3s, transform 0.3s;
}
.supreme-drop-glow {
  position: absolute; inset: -10px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,210,63,0.35), transparent 70%);
  pointer-events: none;
}
.supreme-drop-text { position: relative; z-index: 1; }
@keyframes drop-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  60%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes drop-pulse {
  0%, 100% { filter: brightness(1)    drop-shadow(0 0 8px rgba(255,210,63,0.55)); }
  50%      { filter: brightness(1.15) drop-shadow(0 0 16px rgba(255,210,63,0.85)); }
}
.invest-summary-icon {
  grid-row: 1 / 3;
  width: 44px; height: 44px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffe88a, #ffb620);
  border: 2.5px solid var(--outline-c);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.5);
}
.invest-summary-text { display: flex; flex-direction: column; }
.invest-summary-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 22px; letter-spacing: 3px;
  color: var(--ink);
  line-height: 1.1;
}
.invest-summary-sub {
  font-family: 'Fredoka', sans-serif;
  font-size: 12px; font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.5px;
}
.invest-summary-warn {
  grid-column: 1 / 3;
  font-family: 'Fredoka', sans-serif;
  font-style: italic;
  font-size: 11px; font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
  border-top: 2px dashed color-mix(in srgb, #ffd23f 50%, transparent);
  padding-top: 6px;
  margin-top: 2px;
}

.invest-card {
  background: var(--cream);
  border: var(--outline);
  border-radius: var(--r);
  padding: 11px 12px;
  display: flex; align-items: center; gap: 11px;
  box-shadow: var(--drop-sm);
}
.invest-card.owned {
  background: linear-gradient(180deg, color-mix(in srgb, #3ee08c 18%, var(--cream)) 0%, var(--cream) 100%);
  border-color: color-mix(in srgb, #3ee08c 70%, var(--outline-c));
}
.invest-card.next {
  background: linear-gradient(180deg, color-mix(in srgb, #ffd23f 14%, var(--cream)) 0%, var(--cream) 100%);
  border-color: color-mix(in srgb, #ffd23f 70%, var(--outline-c));
}
/* Less aggressive dimming than before (was 0.6) so the locked padlock —
   now a high-contrast gold glyph — stays clearly legible against the
   dark card (CrazyGames review: the lock icon was hard to see). */
.invest-card.locked { opacity: 0.82; }

.invest-num {
  flex-shrink: 0;
  font-family: 'Luckiest Guy', cursive;
  font-size: 14px; letter-spacing: 1px;
  color: var(--ink-soft);
  width: 28px;
  text-align: center;
}
.invest-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 14px;
  border: 2.5px solid var(--outline-c);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Luckiest Guy', cursive;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(46,24,84,0.4);
  /* chunky cartoon outline on the +/× text glyphs (matches the slots tab look) */
  -webkit-text-stroke: 1.8px var(--text-stroke-c);
  paint-order: stroke fill;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.45);
}
.invest-info { flex: 1; min-width: 0; }
.invest-name {
  font-family: 'Luckiest Guy', cursive;
  font-size: 14px; letter-spacing: 1.5px;
  color: var(--ink);
  line-height: 1.1;
}
.invest-desc {
  font-family: 'Fredoka', sans-serif;
  font-size: 11px; font-weight: 500;
  font-style: italic;
  color: color-mix(in srgb, var(--ink-soft) 80%, transparent);
  letter-spacing: 0.3px;
  margin-top: 2px;
}
.invest-buy {
  height: 34px;
  padding: 0 12px;
  background: linear-gradient(180deg, #c8a8ff 0%, #8a4fee 100%);
  border: 2.5px solid var(--outline-c);
  color: #fff;
  border-radius: 12px;
  font-family: 'Luckiest Guy', cursive;
  font-size: 13px; letter-spacing: 1px;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap;
  box-shadow: var(--drop-sm), inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.45);
  text-shadow: 0 2px 0 rgba(46,24,84,0.4);
}
.invest-buy:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--drop-c), inset 0 -2px 0 rgba(0,0,0,0.18); }
.invest-buy:disabled {
  background: color-mix(in srgb, var(--ink-soft) 35%, var(--paper));
  color: color-mix(in srgb, var(--ink) 50%, transparent);
  text-shadow: none;
  cursor: not-allowed;
}
.invest-buy.glow { animation: btn-bounce 1.6s ease-in-out infinite; }
.invest-buy.glow:hover { animation: none; }

.invest-owned {
  font-family: 'Luckiest Guy', cursive;
  font-size: 12px; letter-spacing: 1.5px;
  color: #fff;
  padding: 6px 12px;
  border: 2.5px solid var(--outline-c);
  border-radius: 999px;
  background: linear-gradient(180deg, #80f5b4, #1fbf68);
  box-shadow: var(--drop-sm), inset 0 -2px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.5);
  text-shadow: 0 2px 0 rgba(46,24,84,0.4);
  white-space: nowrap;
}
.invest-locked,
.shop-locked {
  font-family: 'Luckiest Guy', cursive;
  font-size: 13px; letter-spacing: 1px;
  color: var(--ink-soft);
  padding: 6px 10px;
  background: var(--paper);
  border: 2.5px solid var(--outline-c);
  border-radius: 12px;
  white-space: nowrap;
}
.shop-card.locked { opacity: 0.65; }
.shop-card.locked .shop-card-icon { filter: grayscale(0.6); }

/* ── SHOP SECTION ───────────────────────────────────────────────────────── */
.shop-section-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 16px; letter-spacing: 3px;
  color: var(--ink);
  padding: 10px 4px 0;
  transform: rotate(-1deg);
  display: flex; align-items: center; gap: 8px;
}
/* Inline icon used in section titles ("[cart] SHOP", "[sun] LIGHT BACKDROP", …) */
.title-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  filter: drop-shadow(0 1.5px 0 rgba(0,0,0,0.18));
}
.title-ico svg { width: 100%; height: 100%; display: block; }
.shop-subtitle {
  font-family: 'Fredoka', sans-serif;
  font-size: 11px; font-weight: 600;
  color: var(--ink-soft);
  padding: 0 4px 4px;
}
/* Subtitle + bulk-toggle share one row.  The subtitle hugs the left,
   the 1/MAX toggle hugs the right, with the bulk-toggle's own padding
   handled by .bulk-toggle-row (justify-content: flex-end was the
   previous standalone behavior — we override here to flex-end:0 since
   the parent row already places it on the right). */
.shop-subtitle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 2px;
  flex-wrap: nowrap;
}
.shop-subtitle-row .shop-subtitle { padding: 0; flex: 1 1 auto; min-width: 0; }
.shop-subtitle-row .bulk-toggle-row { padding: 0; flex: 0 0 auto; }

.shop-card {
  background: var(--cream);
  border: var(--outline);
  border-radius: var(--r);
  padding: 11px 12px;
  display: flex; align-items: center; gap: 11px;
  box-shadow: var(--drop-sm);
  transition: transform 0.1s;
}
.shop-card:hover { /* still on hover */ }

/* ── BULK-ACTION TOGGLE ─────────────────────────────────────────────────
   Shared label + two-segment pill switch used by:
   - the Unify tab (10 / ALL) under the tier ladder, and
   - the Upgrades tab (1 / MAX) above the upgrade cards.
   Both options always visible so the player sees what they're flipping
   between. */
.bulk-toggle-row {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px;
  padding: 6px 2px 2px;
}
.bulk-toggle-label {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 11px; letter-spacing: 0.6px;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.bulk-toggle {
  display: inline-flex; align-items: stretch;
  background: var(--paper);
  border: 2px solid var(--outline-c);
  border-radius: 999px;
  padding: 2px;
  cursor: pointer;
  user-select: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.bulk-toggle-opt {
  font-family: 'Luckiest Guy', cursive;
  font-size: 12px; letter-spacing: 1.2px;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--ink-soft);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  line-height: 1.2;
}
.bulk-toggle-opt.active {
  background: linear-gradient(180deg, #ffd23f 0%, #ff9326 100%);
  color: #fff;
  text-shadow: 0 1.5px 0 rgba(46,24,84,0.45);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.18), inset 0 1.5px 0 rgba(255,255,255,0.5);
}
.bulk-toggle-opt.active {
  -webkit-text-stroke: 1.1px var(--text-stroke-c);
  paint-order: stroke fill;
}

/* ── UNIFY GLOBAL MERGE ALL ACTION ───────────────────────────────────── */
.merge-all-row {
  display: flex;
  justify-content: stretch;
  padding: 4px 2px 0;
}
.merge-all-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 56px;
  padding: 6px 14px;
  background: linear-gradient(180deg, #c8a8ff 0%, #8a4fee 100%);
  border: 3px solid var(--outline-c);
  border-radius: var(--r);
  box-shadow: var(--drop), inset 0 -3px 0 rgba(0,0,0,0.22), inset 0 2px 0 rgba(255,255,255,0.45);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.merge-all-btn:hover:not(:disabled) { filter: brightness(1.06); }
.merge-all-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--drop-c), inset 0 -2px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.45);
}
.merge-all-btn:disabled {
  filter: grayscale(0.55) brightness(0.78);
  cursor: not-allowed;
}
.merge-all-btn.glow { animation: btn-bounce 1.6s ease-in-out infinite; }
.merge-all-label {
  font-family: 'Luckiest Guy', cursive;
  font-size: 18px;
  letter-spacing: 2.4px;
  color: #ffffff;
  -webkit-text-stroke: 2px var(--text-stroke-c);
  paint-order: stroke fill;
  line-height: 1;
}
.merge-all-sub {
  font-family: 'Fredoka', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #ffffff;
  -webkit-text-stroke: 1.2px var(--text-stroke-c);
  paint-order: stroke fill;
}

/* ── UNIFY TIER LADDER (compact 8-rung overview) ─────────────────────── */
.unify-ladder {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  padding: 8px;
  background: var(--cream);
  border: var(--outline);
  border-radius: var(--r);
  box-shadow: var(--drop-sm);
}
.unify-lrung {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 5px 2px 4px;
  border-radius: 9px;
  background: var(--paper);
  border: 2px solid var(--outline-c);
  transition: transform 0.12s, filter 0.15s, border-color 0.15s;
}
.unify-lrung.has {
  border-color: color-mix(in srgb, var(--candy-pink) 65%, var(--outline-c));
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12);
}
.unify-lrung.empty {
  filter: grayscale(0.85) brightness(0.85);
  opacity: 0.6;
}
.unify-lball { line-height: 0; }
.unify-lball svg { display: block; }
.unify-lname {
  font-family: 'Luckiest Guy', cursive;
  font-size: 9px; letter-spacing: 0.6px;
  color: var(--ink-soft);
  line-height: 1;
}
.unify-lcount {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 11px;
  color: var(--ink);
  line-height: 1;
}

/* ── UNIFY ENDGAME CARD (permanent +1 ball) ──────────────────────────── */
/* Eternal Capacity — the long-tail SP sink lives in the Cashout shop now,
   but keeps a gold-glow accent to mark it apart from the 5 capped tracks. */
.shop-card.eternal {
  position: relative;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, #ffd23f 18%, var(--paper)) 0%,
      var(--paper) 100%);
  border-color: #ffb820;
  overflow: hidden;
}
.shop-card.eternal::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,210,63,0.35) 0%, transparent 70%);
  pointer-events: none;
}
.shop-card.eternal > * { position: relative; }
.shop-card.eternal.affordable {
  border-color: #ff9326;
  animation: eternal-shop-pulse 1.6s ease-in-out infinite;
}
@keyframes eternal-shop-pulse {
  0%, 100% { box-shadow: var(--drop-sm), 0 0 0 0 rgba(255,160,60,0.6); }
  50%      { box-shadow: var(--drop-sm), 0 0 0 8px rgba(255,160,60,0); }
}
.shop-card.eternal .shop-card-icon {
  background: linear-gradient(180deg, #ffd23f 0%, #ff9326 100%);
  font-family: 'Luckiest Guy', cursive;
  font-size: 28px;
  text-shadow: 0 2px 0 rgba(46,24,84,0.45);
}
.shop-card.eternal .shop-card-icon {
  -webkit-text-stroke: 1.2px var(--text-stroke-c);
  paint-order: stroke fill;
}
.unify-card {
  background: var(--cream);
  border: var(--outline);
  border-radius: var(--r);
  padding: 9px 11px;
  display: flex; align-items: center; gap: 11px;
  box-shadow: var(--drop-sm);
  transition: transform 0.1s, border-color 0.15s;
}
.unify-card.affordable {
  border-color: color-mix(in srgb, var(--candy-pink) 60%, var(--outline-c));
}
.unify-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
}
.unify-icon svg { display: block; }
.unify-info { flex: 1; min-width: 0; }
.unify-name {
  font-family: 'Luckiest Guy', cursive;
  font-size: 13px; letter-spacing: 1.4px;
  color: var(--ink);
  line-height: 1.1;
}
.unify-stats {
  display: flex; gap: 8px; align-items: baseline;
  margin-top: 3px;
}
.unify-count {
  font-family: 'Luckiest Guy', cursive;
  font-size: 14px; letter-spacing: 1px;
  color: var(--ink);
}
.unify-mult {
  font-family: 'Fredoka', sans-serif;
  font-size: 11px; font-weight: 600;
  color: var(--ink-soft);
}
.unify-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 6px;
}
/* Surface 4 — free-merge rewarded chip sits to the LEFT of the MERGE
   button when the player has 1..9 of a tier.  Sized to match the merge
   button's height so the row reads as one paired control. */
.unify-right .free-merge-chip {
  height: 42px;
  padding: 0 10px;
  font-size: 12px;
  letter-spacing: 0.8px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: linear-gradient(180deg, #6ee69a 0%, #1f9d5a 100%);
  color: #ffffff;
  text-shadow: 0 1.2px 0 rgba(20,68,40,0.45);
}
.unify-right .free-merge-chip .rewarded-chip-play {
  width: 19px;
  height: 12px;
  filter: drop-shadow(0 1px 0 rgba(20,68,40,0.4));
}
.unify-btn {
  height: 42px;
  padding: 0 12px;
  background: linear-gradient(180deg, #c8a8ff 0%, #8a4fee 100%);
  border: var(--outline);
  border-radius: var(--r);
  color: #fff;
  font-family: 'Luckiest Guy', cursive;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: var(--drop-sm), inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.4);
  text-shadow: 0 1.5px 0 rgba(46,24,84,0.4);
  line-height: 1.05;
  transition: transform 0.08s, filter 0.15s;
}
.unify-btn-label { font-size: 12px; letter-spacing: 1.2px; }
.unify-btn-sub   { font-size: 9px;  letter-spacing: 0.5px; opacity: 0.9; margin-top: 1px; }
.unify-btn:disabled { filter: grayscale(0.6) brightness(0.85); cursor: default; }
.unify-btn.glow { animation: unify-glow 1.2s ease-in-out infinite; }
.unify-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--drop-c), inset 0 -2px 0 rgba(0,0,0,0.18); }
@keyframes unify-glow {
  0%, 100% { box-shadow: var(--drop-sm), inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.4), 0 0 0 0 rgba(200,168,255,0.5); }
  50%      { box-shadow: var(--drop-sm), inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.4), 0 0 0 6px rgba(200,168,255,0); }
}
.unify-maxed {
  font-family: 'Luckiest Guy', cursive;
  font-size: 13px; letter-spacing: 1.2px;
  color: var(--candy-pink);
  padding: 6px 10px;
  background: var(--paper);
  border: 2.5px solid var(--candy-pink);
  border-radius: 12px;
  white-space: nowrap;
}
.unify-btn,
.unify-btn-label,
.unify-btn-sub {
  -webkit-text-stroke: 1.2px var(--text-stroke-c);
  paint-order: stroke fill;
}

.shop-card-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 14px;
  border: 2.5px solid var(--outline-c);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: #fff;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.45);
}
.shop-card-info { flex: 1; min-width: 0; }
.shop-card-name {
  font-family: 'Luckiest Guy', cursive;
  font-size: 14px; letter-spacing: 1.5px;
  color: var(--ink);
  line-height: 1.1;
}
.shop-card-desc {
  font-family: 'Fredoka', sans-serif;
  font-size: 10px; font-weight: 500;
  font-style: italic;
  color: color-mix(in srgb, var(--ink-soft) 80%, transparent);
  letter-spacing: 0.3px;
  margin-top: 1px;
  line-height: 1.2;
}
.shop-card-val {
  font-family: 'Luckiest Guy', cursive;
  font-size: 13px; letter-spacing: 1px;
  color: var(--ink);
  margin-top: 3px;
}
.shop-card-val .shop-next {
  color: var(--ink-soft);
  font-weight: normal;
}
.shop-card-right {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.shop-pips {
  display: flex; gap: 4px; align-items: center;
}
.shop-pip {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(46,24,84,0.10);
  border: 2px solid var(--outline-c);
}
.shop-buy {
  height: 32px;
  padding: 0 10px;
  background: linear-gradient(180deg, #c8a8ff 0%, #8a4fee 100%);
  border: 2.5px solid var(--outline-c);
  color: #fff;
  border-radius: 12px;
  font-family: 'Luckiest Guy', cursive;
  font-size: 13px; letter-spacing: 1px;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap;
  transition: transform 0.08s, box-shadow 0.08s;
  box-shadow: var(--drop-sm), inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.45);
  text-shadow: 0 2px 0 rgba(46,24,84,0.4);
}
.shop-buy:hover { /* still on hover */ }
.shop-buy:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--drop-c), inset 0 -2px 0 rgba(0,0,0,0.18); }
.shop-buy:disabled {
  background: color-mix(in srgb, var(--ink-soft) 35%, var(--paper));
  color: color-mix(in srgb, var(--ink) 50%, transparent);
  text-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.shop-buy.glow { animation: btn-bounce 1.4s ease-in-out infinite; }
.shop-buy-icon {
  display: flex; align-items: center;
}

.shop-maxed {
  font-family: 'Luckiest Guy', cursive;
  font-size: 12px; letter-spacing: 1.5px;
  color: #fff;
  padding: 5px 10px;
  border: 2.5px solid var(--outline-c);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd55a, var(--candy-yellow));
  box-shadow: var(--drop-sm), inset 0 -2px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.5);
  text-shadow: 0 2px 0 rgba(46,24,84,0.4);
  transform: rotate(-2deg);
}

/* ── SKINS TAB ──────────────────────────────────────────────────────────── */
.skin-section-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 16px; letter-spacing: 3px;
  color: var(--ink);
  padding: 10px 4px 0;
  transform: rotate(-1deg);
  display: flex; align-items: center; gap: 8px;
}
.skin-section-sub {
  font-family: 'Fredoka', sans-serif;
  font-size: 11px; font-weight: 500;
  font-style: italic;
  color: color-mix(in srgb, var(--ink-soft) 80%, transparent);
  padding: 0 4px 4px;
}

.skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}

.skin-card {
  background: var(--cream);
  border: var(--outline);
  border-radius: var(--r);
  padding: 10px;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  box-shadow: var(--drop-sm);
  text-align: center;
  position: relative;
}
.skin-card.on {
  background: linear-gradient(180deg, color-mix(in srgb, #3ee08c 20%, var(--cream)) 0%, var(--cream) 100%);
  border-color: color-mix(in srgb, #3ee08c 70%, var(--outline-c));
}
.skin-card.locked { opacity: 0.7; }

.skin-preview {
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
}
.skin-preview svg { width: 100%; height: 100%; display: block; }

.skin-info { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.skin-name {
  font-family: 'Luckiest Guy', cursive;
  font-size: 13px; letter-spacing: 1.2px;
  color: var(--ink);
  line-height: 1.1;
}
.skin-desc {
  font-family: 'Fredoka', sans-serif;
  font-size: 10px; font-weight: 500;
  font-style: italic;
  color: color-mix(in srgb, var(--ink-soft) 80%, transparent);
  letter-spacing: 0.3px;
  line-height: 1.2;
  min-height: 24px;
}

.skin-equip,
.skin-buy {
  height: 28px;
  padding: 0 12px;
  border: 2.5px solid var(--outline-c);
  color: #fff;
  border-radius: 10px;
  font-family: 'Luckiest Guy', cursive;
  font-size: 12px; letter-spacing: 1px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--drop-sm), inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.45);
  text-shadow: 0 2px 0 rgba(46,24,84,0.4);
}
.skin-equip {
  background: linear-gradient(180deg, #ff8eb6 0%, #ff5d8f 100%);
}
.skin-buy {
  background: linear-gradient(180deg, #ffe17a 0%, #ffb620 100%);
}
.skin-buy.sp {
  background: linear-gradient(180deg, #c8a8ff 0%, #8a4fee 100%);
}
.skin-equip:active,
.skin-buy:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--drop-c), inset 0 -2px 0 rgba(0,0,0,0.18); }
.skin-buy:disabled {
  background: color-mix(in srgb, var(--ink-soft) 35%, var(--paper));
  color: color-mix(in srgb, var(--ink) 50%, transparent);
  text-shadow: none;
  cursor: not-allowed;
}

.skin-equipped {
  font-family: 'Luckiest Guy', cursive;
  font-size: 11px; letter-spacing: 1.5px;
  color: #fff;
  padding: 5px 10px;
  border: 2.5px solid var(--outline-c);
  border-radius: 999px;
  background: linear-gradient(180deg, #80f5b4, #1fbf68);
  box-shadow: var(--drop-sm), inset 0 -2px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.45);
  text-shadow: 0 2px 0 rgba(46,24,84,0.4);
}
.skin-locked {
  font-family: 'Luckiest Guy', cursive;
  font-size: 11px; letter-spacing: 1px;
  color: var(--ink-soft);
  padding: 5px 10px;
  background: var(--paper);
  border: 2.5px solid var(--outline-c);
  border-radius: 10px;
}

/* ── STATS TAB ──────────────────────────────────────────────────────────── */
.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  background: var(--cream);
  border: var(--outline);
  border-radius: var(--r);
  box-shadow: var(--drop-sm);
}
.stat-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 13px; font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-val {
  font-family: 'Luckiest Guy', cursive;
  font-size: 16px; letter-spacing: 1px;
  color: var(--ink);
}
.stat-section-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 14px; letter-spacing: 2px; color: var(--ink);
  padding: 8px 0 4px;
  transform: rotate(-1deg);
}
.slots-info-row { display: flex; gap: 8px; }
.slot-mini-badge {
  flex: 1; padding: 8px 4px;
  background: var(--cream);
  border: 2.5px solid var(--outline-c);
  border-radius: 12px; text-align: center;
  box-shadow: var(--drop-sm);
}
.slot-mini-mult {
  font-family: 'Luckiest Guy', cursive;
  font-size: 16px; letter-spacing: 1px;
}
.slot-mini-lv {
  font-family: 'Fredoka', sans-serif;
  font-size: 10px; font-weight: 700;
  color: var(--ink-soft);
}

/* ── TIP ────────────────────────────────────────────────────────────────── */
.tip-row {
  font-family: 'Fredoka', sans-serif;
  font-size: 12px; font-weight: 600;
  color: var(--ink-soft);
  text-align: center; padding: 8px 0;
  background: var(--tip-bg);
  border: 2.5px dashed var(--tip-dash);
  border-radius: var(--r);
}

/* ── UNIVERSAL CHUNKY-TEXT OUTLINES (white fill + dark stroke) ────────────
   Applied in both light and dark mode so headline numbers, buttons,
   titles, and tab labels all read as bold white text with a chunky
   cartoon ink border, regardless of theme.  Light mode used to have
   plain plum text on cream cards which the player flagged as too dark
   and visually messy. */
.upg-val,
.hud-value,
.slot-mult,
.stat-val,
.slots-section-title,
.stat-section-title,
.slot-pos-badge,
.slot-mini-mult,
.upg-maxed,
.tab-btn,
.cashout-title,
.cashout-val,
.cashout-reward,
.shop-section-title,
.shop-card-name,
.shop-card-val .shop-cur,
.shop-maxed,
.shop-buy,
.invest-summary-title,
.invest-name,
.invest-num,
.invest-buy,
.invest-owned,
.invest-locked,
.shop-locked,
.skin-section-title,
.skin-name,
.skin-equip,
.skin-buy,
.skin-equipped,
.skin-locked,
/* Ascend tab */
.ascend-hero-title,
.ascend-stat-val,
.ascend-row-name,
.ascend-row-cur,
.ascend-row-lv,
.ascend-row-buy,
.ascend-chip,
.ascend-block-name,
/* Supreme tab */
.supreme-stage-title,
.supreme-gen-header,
.supreme-gen-name,
.supreme-sacrifice,
.supreme-locked-cta,
.supreme-bucket-label,
/* Unify tab — headline text */
.unify-name,
.unify-count,
.unify-maxed,
.unify-lname,
.unify-lcount {
  color: #ffffff;
  -webkit-text-stroke: 2.5px var(--text-stroke-c);
  paint-order: stroke fill;
}

.upg-name,
.upg-next,
.hud-label,
.stat-label,
.slot-name,
.slot-lv,
.slot-mini-lv,
.tip-row,
.cashout-sub,
.cashout-label,
.cashout-warn,
.cashout-progress-label,
.shop-subtitle,
.shop-card-val,
.invest-summary-sub,
/* Ascend tab — small text */
.ascend-stat-label,
.ascend-hero-locked,
.ascend-hero-sub,
.ascend-row-desc,
.ascend-row-next,
.ascend-row-milestone,
.ascend-block-desc,
/* Supreme tab — small text */
.supreme-stage-sub,
.supreme-gen-desc,
.supreme-gen-status,
.supreme-warn,
/* Skins tab */
.skin-desc,
.skin-section-sub,
/* In-field generator yield panel */
.gen-yield-header,
.gen-yield-label,
.gen-yield-val,
/* Cashout tab — small text */
.cashout-progress-txt,
/* Shop section (lives inside Cashout) — italic desc + next-value preview + bulk toggle */
.shop-card-desc,
.shop-card-val .shop-next,
.bulk-toggle-label,
.bulk-toggle-opt,
/* Invest tab — card descriptions + summary warn */
.invest-desc,
.invest-summary-warn,
/* Unify tab — secondary text */
.unify-stats,
.unify-mult {
  color: #ffffff;
  -webkit-text-stroke: 1.4px var(--text-stroke-c);
  paint-order: stroke fill;
}

/* Disabled / maxed button states have their own colour rules with higher
   specificity (state pseudo + class).  Force them back to chunky white
   with dark stroke so the player still reads CASH OUT / +1 even when
   the button is unaffordable. */
.cashout-btn:disabled,
.ascend-row-buy:disabled,
.ascend-row-buy.maxed,
.invest-buy:disabled,
.shop-buy:disabled,
.upg-btn:disabled,
.skin-buy:disabled,
.unify-btn:disabled {
  color: #ffffff !important;
  -webkit-text-stroke: 2px var(--text-stroke-c);
  paint-order: stroke fill;
  text-shadow: none;
  opacity: 0.85;
}

/* Theme picker modal removed — the game is locked to dark mode. */

/* ── ONE-TIME TIP MODAL ───────────────────────────────────────────────────
   Tuned to the same dramatic register as the in-canvas cinematics: deep
   radial backdrop, pulsing halo, oversized Luckiest-Guy title, icon
   that breathes, shining CTA. */
.tip-overlay {
  position: fixed;
  inset: 0;
  /* Must outrank cinematic overlays (.fb-fx-overlay z=10050) so a tip that
     fires during a Supreme ritual is never hidden behind it.  An invisible
     tip-overlay still receives the dismiss click, which would permanently
     mark the tip as "shown" without the player ever seeing it. */
  z-index: 10100;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 109, 150, 0.32) 0%, rgba(10, 4, 20, 0.92) 70%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  overflow: hidden;
  animation: tip-fade 0.3s ease;
}
@keyframes tip-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Soft gold halo throbbing behind the card so the whole moment feels
   alive even before the player reads the body. */
.tip-overlay::before {
  content: '';
  position: absolute;
  width: min(680px, 90vw);
  height: min(680px, 90vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 63, 0.28) 0%, transparent 65%);
  filter: blur(24px);
  pointer-events: none;
  animation: tip-halo-pulse 2s ease-in-out infinite;
}
@keyframes tip-halo-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.15); opacity: 1; }
}

.tip-modal {
  position: relative;
  background: var(--paper);
  border: 3.5px solid var(--outline-c);
  border-radius: var(--r-lg);
  padding: 28px 28px 22px;
  max-width: 420px;
  text-align: center;
  z-index: 1;
  box-shadow:
    0 6px 0 var(--drop-c),
    0 0 0 6px rgba(255, 210, 63, 0.32),
    0 0 44px 12px rgba(255, 142, 182, 0.42);
  animation: tip-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tip-pop {
  0%   { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  60%  { transform: scale(1.08) rotate(2deg);  opacity: 1; }
  100% { transform: scale(1) rotate(0);        opacity: 1; }
}

.tip-icon {
  width: 64px; height: 64px;
  line-height: 1;
  margin: 0 auto 6px;
  filter: drop-shadow(0 4px 0 var(--drop-c));
  animation: tip-icon-breath 1.4s ease-in-out infinite;
  display: flex; align-items: center; justify-content: center;
  transform-origin: center;
}
.tip-icon svg { width: 100%; height: 100%; display: block; }
@keyframes tip-icon-breath {
  0%, 100% { transform: scale(1)    rotate(-3deg); }
  50%      { transform: scale(1.1)  rotate(3deg);  }
}

.tip-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 34px; letter-spacing: 2px;
  line-height: 1.1;
  background: linear-gradient(180deg, #fff4b3 0%, #ffd23f 45%, var(--candy-pink) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 3px var(--text-stroke-c);
  paint-order: stroke fill;
  filter: drop-shadow(0 4px 0 var(--drop-c));
  transform: rotate(-2deg);
  margin-bottom: 14px;
  animation: tip-title-throb 1.6s ease-in-out infinite;
}
@keyframes tip-title-throb {
  0%, 100% { transform: rotate(-2deg) scale(1);    }
  50%      { transform: rotate(-2deg) scale(1.04); }
}

.tip-body {
  font-family: 'Fredoka', sans-serif;
  font-size: 15px; font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 22px;
}
.tip-body strong {
  color: var(--candy-pink);
  font-weight: 700;
}

.tip-btn {
  height: 52px;
  padding: 0 30px;
  background: linear-gradient(180deg, #ffd96b 0%, #ff9445 55%, var(--candy-pink) 100%);
  border: 3px solid var(--outline-c);
  border-radius: var(--r);
  color: #fff;
  font-family: 'Luckiest Guy', cursive;
  font-size: 20px; letter-spacing: 2.5px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 5px 0 var(--drop-c),
    0 7px 22px rgba(255, 142, 60, 0.45),
    inset 0 -4px 0 rgba(0,0,0,0.22),
    inset 0 3px 0 rgba(255,255,255,0.55);
  text-shadow: 0 3px 0 rgba(46,24,84,0.55);
  user-select: none;
}
/* Diagonal shine sweep — sells the button as the next thing to click. */
.tip-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 70%; height: 100%;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,0.55) 50%, transparent 100%);
  animation: tip-btn-shine 2.4s linear infinite;
  pointer-events: none;
}
@keyframes tip-btn-shine {
  to { left: 220%; }
}
.tip-btn:active {
  transform: translateY(3px);
  box-shadow:
    0 2px 0 var(--drop-c),
    inset 0 -3px 0 rgba(0,0,0,0.22),
    inset 0 2px 0 rgba(255,255,255,0.4);
}

[data-theme="dark"] .tip-btn {
  -webkit-text-stroke: 1.6px var(--text-stroke-c);
  paint-order: stroke fill;
}

/* HUD theme toggle button */
.hud-theme {
  background: var(--paper);
  border: 2.5px solid var(--outline-c);
  color: var(--ink);
  border-radius: 50%;
  width: 42px; height: 42px;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s;
  box-shadow: var(--drop-sm);
}
.hud-theme:hover  { /* still on hover */ }
.hud-theme:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--drop-c); }

/* HUD reset-save button — same shape as mute/theme, danger-tinted on hover */
.hud-reset {
  background: var(--paper);
  border: 2.5px solid var(--outline-c);
  color: var(--ink);
  border-radius: 50%;
  width: 42px; height: 42px;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s, background 0.15s;
  box-shadow: var(--drop-sm);
}
.hud-reset:hover  { background: color-mix(in srgb, var(--candy-red) 25%, var(--paper)); }
.hud-reset:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--drop-c); }

/* Two-button row inside reset confirm modal */
.tip-btn-row {
  display: flex; gap: 10px; justify-content: center;
}
/* Settings popup: vertical stack of action rows above the DONE button. */
.settings-row {
  display: flex; flex-direction: column; gap: 8px;
  margin: 10px 0 14px; width: 100%;
}
.reset-confirm-btn {
  background: linear-gradient(180deg, #ff7878 0%, var(--candy-red) 100%);
}
.reset-cancel-btn {
  background: linear-gradient(180deg, #c8c0d8 0%, #8a82a0 100%);
}

/* ── FIRST-BALL CINEMATIC OVERLAY ─────────────────────────────────────────
   Full-viewport canvas layer that hosts the once-per-save starting-bonus
   animation. Covers HUD, tabs, playfield — every other element — so the
   moment reads as a global event, not something tucked inside the field.
   Pointer-events disabled so dragging on the canvas is impossible while
   the cinematic plays (the player just watches). */
.fb-fx-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(60,10,30,0.55) 0%, rgba(10,4,20,0.92) 70%);
  animation: fb-fx-fade 0.25s ease;
}
@keyframes fb-fx-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── CRAZYGAMES BANNER SLOTS ──────────────────────────────────────────────
   Slot containers are fixed-size so the SDK doesn't reject them.  Hidden
   entirely when the player has an adblocker (body.has-adblock) — the
   alternative would be empty grey rectangles forever. */
.banner-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  border-radius: 10px;
  overflow: hidden;
}
/* Top — slot above the tab bar.  Actual rendered size is set inline by
   JS (mountBanners) after picking the best-paying candidate that fits
   the column.  CSS just provides a sensible default placeholder so the
   layout doesn't jump if mountBanners hasn't run yet. */
.banner-slot-side {
  /* Hidden by default — mountBanners sets inline display + size when
     it picks a fitting candidate.  Without this default the 320×100
     placeholder leaks through during SDK init, before the picker has
     decided what fits the column. */
  display: none;
  margin: 4px auto 6px;
  align-self: center;
  max-width: 100%;
  /* Persistent placement (CrazyGames review): once shown it stays put
     and never animates/collapses, so it can't shift and cause misclicks. */
  transition: none;
  flex-shrink: 0;
}
.banner-slot-side.banner-pending {
  /* The persistent banner never collapses even if the pending class is
     somehow applied — keep its reserved space stable. */
  max-height: none !important;
}
/* Support tab — hero card + stacked banner collage that fills the tab
   content with the highest-CPM mix that fits the column.  Each slot
   is hidden until JS picks a size for it (same pattern as banner-side). */
.support-hero {
  background: linear-gradient(180deg, #d8f7e3 0%, #6ee69a 100%);
  border: 2.5px solid #1f9d5a;
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  text-align: center;
  box-shadow: var(--drop-sm), inset 0 -3px 0 rgba(0,0,0,0.1), inset 0 2px 0 rgba(255,255,255,0.55);
  margin-bottom: 4px;
}
.support-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 28px;
  letter-spacing: 2.4px;
  /* White fill with a thick black outline — the chunky-cartoon
     standard used everywhere else.  Reads cleanly on the green hero
     gradient regardless of which shade the gradient lands on. */
  color: #ffffff;
  -webkit-text-stroke: 2.5px var(--text-stroke-c);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(0,0,0,0.25);
  margin-bottom: 6px;
}
.support-body {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
}
/* Support-tab banner slots — JS sets the explicit width/height inline
   based on the greedy-packer's output.  Display defaults to flex so
   the placeholder is visible even if the SDK hasn't filled it yet. */
.banner-slot-support {
  display: flex;
  margin: 0 auto;
  align-self: center;
  max-width: 100%;
}
/* Support tab locks tab-content's overflow so the packed banners fill
   the column edge-to-edge without a scrollbar.  Belt-and-suspenders
   with the inline style renderSupport sets — defense against any tab
   switch that forgets to clear it. */
.tab-content.tab-support {
  overflow: hidden;
}
/* Bottom row — two banner slots in a flex row at the foot of the right
   column.  JS picks each slot's actual size; CSS only provides default
   placeholders and the row layout. */
.banner-row-bottom {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 6px 6px;
  max-width: 100%;
}
.banner-slot-tab-l,
.banner-slot-tab-r {
  width: 320px;
  height: 100px;
  max-width: 100%;
}
/* When the JS picker drops the right slot (no candidate fits), the
   surviving left one is centred in the row. */
.banner-row-bottom:has(.banner-slot-tab-r[style*="display: none"]) {
  justify-content: center;
}
/* Short-viewport relief: when the screen barely fits the gameplay
   chrome, kill the footer banner row entirely so the tab content
   isn't crushed into a thin strip. */
@media (max-height: 640px) {
  .banner-row-bottom { display: none; }
}
/* Loader — 728×90 default; JS overrides inline based on viewport.
   Hidden on narrow viewports where no candidate would fit cleanly. */
.banner-slot-loader {
  width: 728px;
  height: 90px;
  margin: 28px auto 0;
  max-width: 100%;
}

/* Adblock active — kill every banner slot AND tag rewarded chips so
   they read as inactive instead of a teaser. */
body.has-adblock .banner-slot { display: none; }
/* Tutorial active — banner refreshes are paused per CG spec, so the
   slots have nothing fresh to show.  Collapse them so the UI behind
   the spotlight isn't padded by reserved-but-empty ad space. */
body.tutorial-active .banner-slot { display: none !important; }

/* Pending state — the slot has been picked + requested by the SDK
   but no iframe has been injected yet.  Collapse the visual layout
   to zero (overflow hidden masks any half-loaded content) so the UI
   doesn't reserve space for an ad that hasn't arrived.  The slot
   keeps its inline width/height so the SDK's getBoundingClientRect
   check during requestBanner still measures correctly — only the
   PAINTED size is 0.  Once mountBanners detects the iframe (promise
   resolves true), the class is removed and the slot animates open. */
.banner-slot {
  transition: max-height 0.28s ease, margin 0.28s ease, padding 0.28s ease;
}
.banner-slot.banner-pending {
  max-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  overflow: hidden;
}
/* Ad-blocker present — we can never show the player an ad, so every
   rewarded-ad surface is HIDDEN outright rather than greyed out.  A
   permanently-disabled "watch ad" button just confuses players
   (CrazyGames review).  Covers every rewarded entry point in the game:
   the shared chip, the bonus-ball drop button, the free-upgrade and
   free-merge chips, the slot x2-XP chip and the generator skip chip.
   (The cashout DOUBLE button is already hidden under .has-adblock and
   the Cash Out popup is skipped entirely when an ad-blocker is on.) */
body.has-adblock .rewarded-chip,
body.has-adblock .bonus-ball-button,
body.has-adblock .free-upg-chip,
body.has-adblock .free-merge-chip,
body.has-adblock .slot-xp-chip,
body.has-adblock .gen-skip-chip {
  display: none !important;
}

/* ── REWARDED-AD CHIP (shared across the 4 surface points) ────────────────
   Compact button styled like a "watch ad for X" affordance — gold
   gradient with a play triangle prefix.  Used inline next to the action
   it augments (cashout double, generator skip, etc.). */
.rewarded-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 14px;
  height: 36px;
  background: linear-gradient(180deg, #ffe699 0%, #ffd23f 55%, #ff8a3c 100%);
  border: 2.5px solid var(--outline-c);
  border-radius: 12px;
  box-shadow: var(--drop-sm), inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.55);
  font-family: 'Luckiest Guy', cursive;
  font-size: 13px;
  letter-spacing: 1.3px;
  color: #ffffff;
  -webkit-text-stroke: 1.6px var(--text-stroke-c);
  paint-order: stroke fill;
  text-shadow: 0 1px 0 rgba(0,0,0,0.25);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s, filter 0.12s, box-shadow 0.12s;
}
.rewarded-chip:hover:not(:disabled) { filter: brightness(1.08); }
.rewarded-chip:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: var(--drop-sm), inset 0 -1px 0 rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.45);
}
.rewarded-chip:disabled {
  filter: grayscale(0.55) brightness(0.78);
  cursor: not-allowed;
}
.rewarded-chip-play {
  display: inline-block;
  width: 21px; height: 14px;
  flex-shrink: 0;
  border: 0;
  background-color: #ffffff;
  -webkit-mask: var(--ad-play-mask) center / contain no-repeat;
  mask: var(--ad-play-mask) center / contain no-repeat;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.35));
}

/* Bonus-ball rewarded-ad button — full-width green bar UNDER the
   DROP IT button.  Shape clones drop-btn so the two read as a paired
   set; green palette keeps it visually distinct from the pink primary. */
.bonus-ball-button {
  /* Full-width like DROP IT!, but slightly shorter (~90% height) so
     the visual hierarchy still favours the primary pink action. */
  width: 100%;
  height: 36px;
  margin-top: 4px;
  background: linear-gradient(180deg, #6ee69a 0%, #1f9d5a 100%);
  border: var(--outline);
  border-radius: var(--r);
  color: #ffffff;
  font-family: 'Luckiest Guy', cursive;
  font-size: 13px;
  letter-spacing: 1.3px;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
  flex-shrink: 0;
  box-shadow: var(--drop), inset 0 -4px 0 rgba(0,0,0,0.18), inset 0 3px 0 rgba(255,255,255,0.5);
  text-shadow: 0 1.5px 0 rgba(20,68,40,0.45);
  -webkit-text-stroke: 1.2px var(--text-stroke-c);
  paint-order: stroke fill;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
}
.bonus-ball-button:hover:not(:disabled) { filter: brightness(1.06); }
.bonus-ball-button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--drop-c), inset 0 -2px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.4);
}
.bonus-ball-button:disabled { filter: grayscale(0.55) brightness(0.85); cursor: default; }
/* Cooldown state — hide the play-triangle glyph so the label can show
   just the remaining seconds (e.g. "30s") with no truncation
   (CrazyGames review).  Hidden entirely under .has-adblock (rule above). */
.bonus-ball-button.cooling .bonus-ball-play { display: none; }
.bonus-ball-button.cooling { letter-spacing: 1px; }
/* Small-screen override — placed AFTER the base rule so the cascade
   actually wins.  Mirrors (and supersedes) the .bonus-ball-button
   entries up in the chrome-trim block. */
@media (max-width: 760px), (max-height: 620px) {
  .bonus-ball-button {
    width: 100%;
    height: 18px;
    margin-top: 2px;
    font-size: 10px;
    letter-spacing: 0.7px;
    padding: 0 6px;
    gap: 4px;
  }
  .bonus-ball-play {
    width: 18px;
    height: 12px;
  }
}
/* White play-triangle glyph — same iconography as the gold rewarded
   chip, but sized for the larger drop-button sibling. */
.bonus-ball-play {
  width: 26px;
  height: 17px;
  flex-shrink: 0;
  border: 0;
  background-color: #ffffff;
  -webkit-mask: var(--ad-play-mask) center / contain no-repeat;
  mask: var(--ad-play-mask) center / contain no-repeat;
  filter: drop-shadow(0 1px 0 rgba(20,68,40,0.45));
}
.bonus-ball-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* x2 bucket-XP rewarded offer on the Slots tab — reuses the green
   rewarded-button look, but lives in the tab content at a comfortable
   height (not the compact board-panel size).  Higher specificity than
   the board-panel compact overrides so the tab button stays tappable. */
.tab-content .slot-xp-chip {
  height: 40px;
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.8px;
}
.tab-content .slot-xp-chip.boost-active {
  background: linear-gradient(180deg, #7cc8ff 0%, #1a8ad6 100%);
}
/* Bonus-ball small-screen overrides moved into the main compact block
   above (with the matching auto-bar / pause / drop button trims) so
   the full set of half-size chrome lives in one place. */

/* Per-generator SKIP rewarded chip — corner of each supreme-gen-slot.  Sits
   above the deco layer (z-index 4) so it stays clickable on every theme. */
.supreme-gen-slot .gen-skip-chip {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  letter-spacing: 1px;
  min-width: 72px;
  border-radius: 10px;
}
.supreme-gen-slot .gen-skip-chip .rewarded-chip-play {
  width: 17px;
  height: 11px;
}

/* ── INTERACTIVE TUTORIAL ─────────────────────────────────────────────────
   Full-screen dim with a "spotlight" cutout over the currently-explained
   element + a textbox beside it.  The cutout is achieved with a huge
   box-shadow on the spotlight element so everything OUTSIDE the box
   reads as dark while the spotlight itself stays transparent — clicks
   pass through to the highlighted element. */
.tut-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
}
/* SKIP TUTORIAL — fixed top-right escape hatch, above the dim overlay so
   experienced players can bail at any step (CrazyGames review). */
.tut-skip-btn {
  position: fixed;
  /* Top-CENTER, not top-right: the HUD is space-between (title left, gear
     cluster right), so the right corner sat directly over the settings gear
     and a tap on Skip fell through and also opened Settings (player report).
     The HUD centre is empty, so anchoring here can't overlap any button. */
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  pointer-events: auto;
  padding: 8px 16px;
  background: linear-gradient(180deg, #4a4566 0%, #2a2740 100%);
  border: 2.5px solid rgba(255, 210, 63, 0.9);
  border-radius: 999px;
  color: #fff;
  font-family: 'Luckiest Guy', cursive;
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(8,4,22,0.6), 0 0 16px rgba(255,210,63,0.35);
  -webkit-text-stroke: 1.2px var(--text-stroke-c);
  paint-order: stroke fill;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s, filter 0.12s;
}
.tut-skip-btn:hover { filter: brightness(1.1); }
.tut-skip-btn:active { transform: translateX(-50%) translateY(2px); }
@media (max-width: 480px) {
  .tut-skip-btn { padding: 6px 12px; font-size: 11px; }
}

.tut-spotlight {
  position: fixed;
  border-radius: 14px;
  /* 9999px shadow paints the entire viewport dark; the box itself
     remains transparent so the highlighted element shines through. */
  box-shadow: 0 0 0 9999px rgba(8, 4, 22, 0.78);
  pointer-events: none;
  transition: top 0.32s cubic-bezier(0.4, 0.0, 0.2, 1),
              left 0.32s cubic-bezier(0.4, 0.0, 0.2, 1),
              width 0.32s cubic-bezier(0.4, 0.0, 0.2, 1),
              height 0.32s cubic-bezier(0.4, 0.0, 0.2, 1);
  outline: 3px solid rgba(255, 210, 63, 0.95);
  animation: tut-spotlight-pulse 1.6s ease-in-out infinite;
}
@keyframes tut-spotlight-pulse {
  0%, 100% { outline-color: rgba(255, 210, 63, 0.6); box-shadow: 0 0 0 9999px rgba(8, 4, 22, 0.78), 0 0 18px rgba(255, 210, 63, 0.4) inset; }
  50%      { outline-color: rgba(255, 210, 63, 1.0); box-shadow: 0 0 0 9999px rgba(8, 4, 22, 0.78), 0 0 32px rgba(255, 210, 63, 0.7) inset; }
}
.tut-textbox {
  position: fixed;
  max-width: 440px;
  width: min(90vw, 440px);
  background: linear-gradient(180deg, #2d2a44 0%, #1a1730 100%);
  border: 3px solid rgba(255, 210, 63, 0.9);
  border-radius: 18px;
  padding: 18px 22px;
  box-shadow:
    0 0 32px rgba(255, 210, 63, 0.45),
    0 8px 24px rgba(0, 0, 0, 0.7);
  pointer-events: auto;
  text-align: center;
  z-index: 9999;
  animation: tut-fade-in 0.32s ease;
}
@keyframes tut-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tut-text {
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: #ffffff;
  margin-bottom: 14px;
}
.tut-text strong { color: #ffd23f; font-weight: 700; }
.tut-btn {
  background: linear-gradient(180deg, #ffd23f 0%, #ff9326 100%);
  border: 3px solid #1a0d2a;
  border-radius: 12px;
  padding: 10px 26px;
  font-family: 'Luckiest Guy', cursive;
  font-size: 16px;
  letter-spacing: 1.6px;
  color: #ffffff;
  -webkit-text-stroke: 1.8px #1a0d2a;
  paint-order: stroke fill;
  cursor: pointer;
  box-shadow: 0 4px 0 #1a0d2a, inset 0 -2px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.45);
  transition: transform 0.08s, box-shadow 0.08s;
  animation: tut-btn-bounce 1.6s ease-in-out infinite;
}
.tut-btn:hover { filter: brightness(1.06); }
.tut-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #1a0d2a, inset 0 -2px 0 rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.45);
  animation: none;
}
@keyframes tut-btn-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

/* ── RESPONSIVE POPUPS & TUTORIAL ─────────────────────────────────────────
   At the compact breakpoint every modal / overlay also has to scale —
   on a phone or short laptop the default tip padding (28px) and 64px
   tip-icon eat the whole viewport.  Mirrors the chrome trims above. */
@media (max-width: 760px), (max-height: 620px) {
  /* Tip / reset-confirm modal */
  .tip-overlay { padding: 12px; }
  .tip-modal {
    padding: 16px 16px 14px;
    max-width: min(92vw, 340px);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    border-width: 3px;
  }
  .tip-icon { width: 44px; height: 44px; margin-bottom: 4px; }
  .tip-title { font-size: 22px; letter-spacing: 1.4px; margin-bottom: 8px; -webkit-text-stroke-width: 2.2px; }
  .tip-body  { font-size: 12.5px; line-height: 1.4; margin-bottom: 14px; }
  .tip-btn   { height: 40px; padding: 0 18px; font-size: 15px; letter-spacing: 1.6px; border-width: 2.5px; }
  .tip-btn-row { gap: 7px; flex-wrap: wrap; justify-content: center; }
  /* Tutorial textbox + button */
  .tut-textbox {
    width: min(94vw, 320px);
    padding: 12px 14px;
    border-width: 2.5px;
    border-radius: 14px;
  }
  .tut-text { font-size: 12.5px; line-height: 1.4; margin-bottom: 9px; }
  .tut-btn { padding: 7px 18px; font-size: 13px; letter-spacing: 1.2px; border-width: 2.5px; }
  /* Tutorial spotlight already follows the target element; clamp its
     pulse outline thickness so the highlight doesn't dominate the
     small viewport. */
  .tut-spotlight { outline-width: 2px; }
  /* Cashout-double prompt — was already partially trimmed; this block
     consolidates the responsive treatment with the rest of the popups
     so the same breakpoint flips them all in sync. */
  .cashout-prompt-overlay { padding: 10px; }
  .cashout-prompt-card {
    padding: 12px 14px 10px;
    gap: 8px;
    max-width: min(94vw, 340px);
  }
  .cashout-prompt-title { font-size: 17px; letter-spacing: 1.3px; gap: 5px; }
  .cashout-prompt-title .cashout-btn-ico { width: 20px; height: 20px; }
  .cashout-prompt-body { font-size: 12.5px; line-height: 1.4; }
  .cashout-prompt-actions { gap: 6px; }
  .cashout-prompt-btn { height: 40px; font-size: 13px; letter-spacing: 1px; gap: 7px; }
  .cashout-prompt-x { width: 24px; height: 24px; font-size: 15px; top: 6px; right: 6px; }
}

/* Phone-portrait extra trim — title becomes a single short word, body
   wraps tighter, action buttons stack but stay readable. */
@media (max-width: 380px) {
  .tip-modal     { padding: 12px 12px 10px; }
  .tip-title     { font-size: 19px; letter-spacing: 1.2px; }
  .tip-body      { font-size: 12px; }
  .tip-btn       { height: 36px; padding: 0 14px; font-size: 13.5px; }
  .tut-textbox   { padding: 10px 12px; }
  .tut-text      { font-size: 12px; }
  .cashout-prompt-card { padding: 10px 12px 8px; }
  .cashout-prompt-title { font-size: 15px; }
}

.fb-fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Light-mode icon harmonization rule removed along with the light theme. */

/* ── PORTRAIT LAYOUT ──────────────────────────────────────────────────────
   In portrait the old side-by-side board + UI columns were cropped on
   phones and tablets (CrazyGames review: iPhone 15, iPad A16).  Stack
   them vertically instead: the plinko field sits on top sized by a
   capped height (so the UI panel always gets room), and the UI panel
   fills the rest with its own internal scroll.  Placed last in the file
   so it wins over the equal-specificity landscape rules whenever both a
   width/height breakpoint AND portrait orientation match at once. */
@media (orientation: portrait) {
  .game-area {
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
  }
  /* Board no longer competes with the UI panel for width — it spans the
     full row and is sized by the (capped) field height below. */
  .board-panel {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    padding: 8px;
    gap: 6px;
  }
  /* Field height capped at ~46% of the viewport so the stacked UI panel
     always has at least half the screen.  Width derives from the fixed
     600/620 aspect ratio and is clamped to the available width. */
  .canvas-frame {
    width: auto;
    height: min(46vh, calc(100vw - 36px) * 620 / 600);
    max-width: 100%;
    aspect-ratio: 600 / 620;
  }
  /* UI panel takes the remaining height and scrolls internally. */
  .ui-panel {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
  }
  /* The single persistent banner sits under the scrolling tab content,
     pinned to the bottom of the UI panel. */
  .banner-slot-side {
    flex-shrink: 0;
  }
}

/* Very short portrait windows (small phones in portrait): give the field
   a touch more of the screen since the chrome is proportionally larger. */
@media (orientation: portrait) and (max-height: 700px) {
  .canvas-frame {
    height: min(42vh, calc(100vw - 28px) * 620 / 600);
  }
}

/* ── LEGIBILITY OVERRIDES ──────────────────────────────────────────────────
   Player feedback: "the font is too hard to read; I can't make out the words
   or numbers at any window size."  Two causes, fixed here so the originals
   stay intact for reference:
     1. Numeric / data text used the chunky display face (Luckiest Guy), whose
        stylized digits are hard to read as actual numbers → route data text
        to Fredoka 700 (already loaded).
     2. Heavy -webkit-text-stroke (1.2–2.5px) on small text swallowed the glyph
        interiors → roughly halve the stroke on data/body text.  Large display
        TITLES (hud-title, tip-title, loader, hero titles) keep their chunky
        strokes and Luckiest Guy — they read fine and carry the cartoon look.
   Appended last so these win by source order at matching specificity. */

/* Numeric / data displays → readable Fredoka */
.hud-value,
.hud-coins .hud-value,
.auto-bar-label,
.cashout-progress-txt,
.slot-xp-txt,
.ball-counter span,
.tier-pill-count,
.unify-count,
.unify-lcount {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
}

/* Lighter strokes on small data / body text (titles untouched) */
.hud-coins .hud-value { -webkit-text-stroke-width: 1.2px; }
.hud-coins .hud-label { -webkit-text-stroke-width: 0.5px; }
.auto-bar-label,
.cashout-progress-txt,
.slot-xp-txt { -webkit-text-stroke-width: 0.7px; }
.ball-counter span { -webkit-text-stroke-width: 0.7px; }
.tier-pill-count { -webkit-text-stroke-width: 0.6px; }
.merge-all-sub { -webkit-text-stroke-width: 0.6px; }
.invest-desc,
.unify-stats,
.unify-mult { -webkit-text-stroke-width: 0.6px; }
.unify-name,
.unify-count,
.unify-maxed,
.unify-lname,
.unify-lcount { -webkit-text-stroke-width: 1px; }

/* ───────────────────────────────────────────────────────────────────────
   AD-APOLOGY POPUP — bespoke solar / Tier-V showcase (showAdApologyPopup).
   Deliberately NOT the generic cashout-prompt look: a dark starfield card
   with a floating, lightning-wreathed Tier-V (Solar) ball so the one-time gift
   reads as a special event. Dark-themed in both light & dark mode by design.
   Accent palette is themed to Tier V (Solar gold/orange); if AD_APOLOGY_TIER
   changes in game.js, retune the accent colours below to that tier's halo.
   ─────────────────────────────────────────────────────────────────────── */
.apology-overlay {
  position: fixed; inset: 0; z-index: 130;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 36%, rgba(90,55,20,0.55), rgba(14,8,4,0.88));
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: apology-fade 0.3s ease;
}
@keyframes apology-fade { from { opacity: 0; } to { opacity: 1; } }

.apology-card {
  position: relative;
  width: min(370px, 92vw);
  padding: 22px 20px 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, #2a1d12 0%, #1a0f06 100%);
  border: 2.5px solid #ffb24d;
  box-shadow:
    0 0 0 2px rgba(255,150,50,0.22),
    0 18px 52px rgba(0,0,0,0.62),
    inset 0 0 52px rgba(255,150,50,0.30);
  text-align: center;
  overflow: hidden;
  animation: apology-pop 0.45s cubic-bezier(0.2, 1.3, 0.4, 1);
}
@keyframes apology-pop {
  0%   { transform: scale(0.82) translateY(18px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
/* faint starfield speckle */
.apology-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(2px 2px at 18% 16%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1.5px 1.5px at 72% 11%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1.5px 1.5px at 84% 58%, rgba(255,255,255,0.35), transparent),
    radial-gradient(2px 2px at 28% 78%, rgba(255,255,255,0.30), transparent),
    radial-gradient(1.5px 1.5px at 12% 52%, rgba(255,255,255,0.32), transparent),
    radial-gradient(1.5px 1.5px at 90% 84%, rgba(255,255,255,0.28), transparent);
  opacity: 0.75;
}

.apology-eyebrow {
  position: relative;
  font-family: 'Fredoka', sans-serif; font-weight: 700;
  font-size: 12px; letter-spacing: 2.6px; text-transform: uppercase;
  color: #ffd9a8;
  margin-bottom: 6px;
}

.apology-showcase {
  position: relative;
  width: 176px; height: 168px;
  margin: 2px auto 4px;
  display: flex; align-items: center; justify-content: center;
}
.apology-halo {
  position: absolute; top: 50%; left: 50%;
  width: 150px; height: 150px; transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,150,50,0.62) 0%, rgba(255,150,50,0.18) 46%, transparent 70%);
  animation: apology-halo-pulse 2.2s ease-in-out infinite;
}
@keyframes apology-halo-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(0.9);  opacity: 0.55; }
  50%      { transform: translate(-50%, -50%) scale(1.12); opacity: 0.95; }
}
.apology-ball {
  position: relative; width: 116px; height: 116px;
  animation: apology-ball-float 3.2s ease-in-out infinite;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.5)) drop-shadow(0 0 14px rgba(255,150,50,0.75));
}
.apology-ball svg { display: block; width: 100%; height: 100%; overflow: visible; }
@keyframes apology-ball-float {
  0%, 100% { transform: translateY(5px)  rotate(-3deg); }
  50%      { transform: translateY(-6px) rotate(3deg); }
}
/* lightning bolts hovering over the ball */
.apology-bolts { position: absolute; inset: 0; pointer-events: none; }
.apology-bolt {
  position: absolute; display: block; pointer-events: none;
  transform-origin: top center; opacity: 0;
  animation: bolt-flash 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 4px #ff9326) drop-shadow(0 0 9px rgba(255,150,50,0.7));
}
.apology-bolt-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.apology-bolt.ab1 { left: 8%;  top: -10%; width: 18px; height: 58%; transform: rotate(8deg);   animation-delay: 0s;   }
.apology-bolt.ab2 { left: 30%; top: -16%; width: 16px; height: 46%; transform: rotate(-11deg); animation-delay: 0.5s; }
.apology-bolt.ab3 { left: 64%; top: -14%; width: 18px; height: 54%; transform: rotate(6deg);   animation-delay: 1.0s; }
.apology-bolt.ab4 { left: 86%; top: -10%; width: 16px; height: 48%; transform: rotate(-7deg);  animation-delay: 1.5s; }
.apology-tierbadge {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  z-index: 2;
  font-family: 'Luckiest Guy', cursive; font-size: 13px; letter-spacing: 1.6px;
  color: #fff; padding: 3px 13px; border-radius: 20px;
  background: linear-gradient(180deg, #ffb24d, #e07b1a);
  border: 1.5px solid #ffe6c2;
  box-shadow: 0 0 12px rgba(255,150,50,0.85), inset 0 1px 0 rgba(255,255,255,0.4);
}

.apology-rewardname {
  position: relative;
  font-family: 'Luckiest Guy', cursive;
  font-size: 23px; letter-spacing: 0.8px; line-height: 1.1;
  color: #fff;
  text-shadow: 0 0 12px rgba(255,150,50,0.95), 0 0 26px rgba(255,150,50,0.5);
  margin: 6px 0 4px;
}
.apology-sub {
  position: relative;
  font-family: 'Fredoka', sans-serif; font-size: 13px; font-weight: 500;
  color: #f3ddc4; line-height: 1.35;
  margin: 0 auto 15px; max-width: 290px;
}
.apology-sub strong { color: #fff; }

.apology-actions { position: relative; display: flex; gap: 10px; }
.apology-btn {
  border: none; cursor: pointer;
  font-family: 'Luckiest Guy', cursive; letter-spacing: 0.8px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: filter 0.12s ease;
}
.apology-btn-watch {
  flex: 1; padding: 13px 10px;
  font-size: 16px; color: #fff;
  background: linear-gradient(180deg, #ffd23f 0%, #ff8a3c 100%);
  border: 2px solid #fff;
  box-shadow: 0 4px 0 #b85b16, 0 0 18px rgba(255,160,60,0.55);
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.apology-watch-ico { display: inline-flex; }
.apology-btn-watch:active { transform: translateY(3px); box-shadow: 0 1px 0 #b85b16, 0 0 18px rgba(255,160,60,0.55); }
.apology-btn-watch:disabled { filter: grayscale(0.45) brightness(0.85); cursor: default; }
.apology-btn-decline {
  flex: 0 0 auto; padding: 13px 18px;
  font-size: 13px; color: #e0c5a4;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(230,180,120,0.4);
}
.apology-btn-decline:active { transform: translateY(2px); }
.apology-x {
  position: absolute; top: 9px; right: 11px; z-index: 3;
  width: 28px; height: 28px; padding: 0; border-radius: 50%;
  border: 1.5px solid rgba(230,180,120,0.5);
  background: rgba(255,255,255,0.07); color: #f3ddc4;
  font-size: 18px; line-height: 1; cursor: pointer;
}
.apology-x:active { transform: translateY(1px); }

