/* Care Bears: Care-a-Lot Cloud Kingdom — 3D Video Slot Cabinet
   Built strictly to the `slot-machine` skill: bespoke 3D art, strict text containment in recessed
   cut-in boxes, vertical side-pillar chasing bulbs, 3 perceived-persistence meters, built-in
   depressing SPIN TO WIN bar, interactive payline hover previews, and pull-down paytable drawer. */

:root {
  --bg-0: #050a24;
  --bg-1: #0b1442;
  --bg-2: #172063;
  --gold: #f5cd6a;
  --gold-hi: #fff5c8;
  --gold-lo: #a37218;
  --pink: #ff4fa8;
  --cyan: #44e5ff;
  --green: #2bff8c;
  --yellow: #ffd93d;
  --red: #ff3352;
  --ink: #f4f7ff;
  --muted: #a4b2e8;
  --f-ui: 'Oswald', system-ui, sans-serif;
  --f-display: 'Fredoka', 'Oswald', sans-serif;
  --gold-grad: linear-gradient(180deg, #fff7cc 0%, #f5cd6a 46%, #bc8620 58%, #ffe18c 100%);
  --cell: clamp(74px, min(10.1vh, calc((100vw - 110px) / 5)), 98px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg-0); }
body {
  background-color: #050a24;
  background-image:
    radial-gradient(920px 560px at 50% -10%, rgba(255, 79, 168, .28) 0%, rgba(68, 229, 255, .12) 34%, transparent 72%),
    radial-gradient(1200px 800px at 50% 45%, #121c58 0%, #070e32 62%, #04081d 100%);
  color: var(--ink);
  font-family: var(--f-ui);
  letter-spacing: .02em;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
#stardust { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
a { color: inherit; }
button { font-family: inherit; }
[hidden] { display: none !important; }

/* ---------- Topbar (No extra subtitle line above brand) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 10px clamp(12px, 3vw, 32px);
  background: linear-gradient(180deg, rgba(5, 10, 36, .94), rgba(5, 10, 36, .68));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(245, 205, 106, .32);
}
.top-left { justify-self: start; display: flex; align-items: center; gap: 8px; }
.top-right { justify-self: end; display: flex; align-items: center; gap: 10px; }
.brand { text-decoration: none; display: flex; align-items: center; justify-content: center; }
.brand-neon {
  font-family: var(--f-display); font-weight: 700; font-size: clamp(22px, 2.8vw, 34px);
  letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
  background: linear-gradient(90deg, #ff7bc0 0%, #ffe680 33%, #78ffbe 66%, #74e9ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 12px rgba(255, 79, 168, .65)) drop-shadow(0 2px 6px rgba(0, 0, 0, .75));
}
.pill-btn {
  padding: 7px 14px; border-radius: 999px; background: rgba(8, 16, 54, .85); color: var(--ink);
  cursor: pointer; border: 1px solid rgba(245, 205, 106, .52); font-size: 12px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
}
.pill-btn:hover { border-color: var(--gold-hi); background: rgba(255, 79, 168, .18); }
.credits {
  display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 7px; border-radius: 999px;
  background: rgba(5, 11, 38, .9); border: 1px solid var(--gold);
  box-shadow: 0 0 18px rgba(245, 205, 106, .25), inset 0 0 10px rgba(255, 79, 168, .14);
  transition: box-shadow .25s, transform .25s;
}
.credits.up { box-shadow: 0 0 28px rgba(43, 255, 140, .65); transform: scale(1.05); }
.credits.down { box-shadow: 0 0 18px rgba(255, 79, 168, .55); }
.credits-gem {
  width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #ff9ad2, #ff286c 58%, #7d0632);
  border: 2px solid var(--gold); box-shadow: 0 0 10px rgba(255, 79, 168, .75);
}
.credits-num { font-weight: 700; font-size: 19px; color: var(--gold-hi); font-variant-numeric: tabular-nums; min-width: 4ch; text-align: right; }
.credits-lbl { font-size: 11px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(245, 205, 106, .48);
  background: rgba(8, 16, 54, .88); color: var(--ink); font-size: 17px; cursor: pointer;
}
.icon-btn.off { opacity: .55; }

main { position: relative; z-index: 1; padding: 14px clamp(8px, 2.5vw, 24px) 44px; display: flex; justify-content: center; }

/* ---------- 3D Care-a-Lot Video Slot Cabinet (No Pull Handle) ---------- */
.cabinet {
  position: relative; width: fit-content; max-width: 100%; margin: 0 auto; padding: 0 0 12px;
  border-radius: 34px 34px 20px 20px;
  background: linear-gradient(90deg, #271a5c 0%, #101545 8%, #070d2e 50%, #101545 92%, #271a5c 100%);
  border: 2px solid #eab94f;
  box-shadow:
    inset 0 2px 1px rgba(255, 248, 210, .48),
    inset 12px 0 18px rgba(0, 0, 0, .6),
    inset -12px 0 18px rgba(0, 0, 0, .6),
    0 0 0 6px #070b24,
    0 0 0 8px rgba(245, 205, 106, .45),
    0 16px 0 -4px #040718,
    0 36px 72px rgba(0, 0, 0, .82);
}
.cabinet.win-pulse { animation: cabPulse 880ms ease-in-out 2; }
@keyframes cabPulse {
  50% { box-shadow: inset 0 2px 1px rgba(255, 248, 210, .6), 0 0 0 6px #070b24, 0 0 0 9px #ffe478, 0 0 50px rgba(255, 79, 168, .72), 0 36px 72px rgba(0, 0, 0, .82); }
}

.cab-topper {
  position: relative; z-index: 2; padding: 10px 18px 8px; border-radius: 32px 32px 0 0;
  border-bottom: 3px solid #d9a43d;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .14) 0%, transparent 20%),
    radial-gradient(640px 160px at 50% 0, rgba(255, 79, 168, .42), rgba(40, 26, 108, .92) 72%, #091038 100%);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .72), inset 0 -2px 5px rgba(0, 0, 0, .65);
  text-align: center;
}
.marquee-text {
  font-family: var(--f-display); font-weight: 700; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.08;
  letter-spacing: .04em; text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, #ffe68c 55%, #ff85c8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(255, 79, 168, .75)) drop-shadow(0 3px 4px rgba(0, 0, 0, .7));
}
.mq-sub {
  margin-top: 3px; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted);
}
.mq-sub .g { color: var(--green); } .mq-sub .a { color: var(--yellow); } .mq-sub .k { color: var(--pink); }

.bonus-lamps { display: flex; justify-content: center; gap: 6px; height: 0; overflow: hidden; }
.bonus-lamps.on { height: auto; margin: 6px 0 2px; }
.bonus-lamps i { width: 12px; height: 12px; border-radius: 50%; background: #26103a; border: 1px solid var(--gold); }
.bonus-lamps i.lit { background: var(--yellow); box-shadow: 0 0 10px var(--yellow); }

.fs-banner {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px auto 2px; padding: 6px 14px; width: fit-content;
  border-radius: 999px; border: 1.5px solid var(--green); background: rgba(5, 28, 22, .92); color: #d4ffe8;
  letter-spacing: .16em; text-transform: uppercase; font-size: 13px; box-shadow: 0 0 22px rgba(43, 255, 140, .4);
}
.fs-banner img { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; }
.fs-banner b { color: var(--green); }

/* Body + Vertical Chasing Side Pillars */
.cab-body { display: flex; align-items: stretch; justify-content: center; gap: 8px; padding: 8px 10px 6px; }
.cab-pillar {
  width: 16px; flex: none; border-radius: 999px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 10px 0;
  background: linear-gradient(180deg, #ff54a8 0%, #ffd93d 28%, #2bff8c 55%, #44e5ff 80%, #b77dff 100%);
  box-shadow: 0 0 0 2px #050a20, 0 0 0 3px rgba(245, 205, 106, .42), 0 0 18px rgba(255, 79, 168, .48), inset 0 0 5px rgba(255, 255, 255, .85);
}
.cab-pillar i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #fff7c2; border: 1px solid rgba(120, 68, 0, .55);
  box-shadow: 0 0 6px #fff, 0 0 12px #ffd93d;
  animation: bulb 1.1s infinite;
}
.cab-pillar i:nth-child(2n) { animation-delay: .55s; }
@keyframes bulb { 50% { opacity: .25; box-shadow: none; } }
body.free-mode .cab-pillar {
  background: linear-gradient(180deg, #9bffc8, #19c769);
  box-shadow: 0 0 0 2px #050a20, 0 0 0 3px rgba(43, 255, 140, .48), 0 0 20px rgba(43, 255, 140, .75);
}
body.free-mode .cab-pillar i { animation-duration: .42s; }
body.star-mode .cab-pillar {
  background: linear-gradient(180deg, #ffe76e, #ff3366);
  box-shadow: 0 0 0 2px #050a20, 0 0 0 3px rgba(255, 217, 61, .5), 0 0 20px rgba(255, 51, 102, .75);
}

.cab-stage { flex: 0 1 auto; min-width: 0; width: calc(var(--cell) * 5 + 84px); max-width: 100%; }

/* 3 Perceived-Persistence Overdrive Heart Meters (Green / Yellow / Red, no numbers) */
.meters-wrap { width: 100%; margin: 0 auto 8px; }
.meter-card {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 100%; padding: 6px 10px 5px; border-radius: 14px;
  background: linear-gradient(180deg, #191f58, #070c2a);
  border: 1.5px solid rgba(245, 205, 106, .52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 8px 20px rgba(0, 0, 0, .55);
}
.meter-card.surge { animation: meterSurge 560ms ease-out; }
@keyframes meterSurge {
  0% { transform: scale(1); }
  40% { transform: scale(1.03); border-color: #fff3b0; box-shadow: 0 0 28px rgba(255, 217, 61, .75); }
  100% { transform: scale(1); }
}
.meters-trio {
  display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; justify-items: center;
  gap: 8px; width: 100%;
}
.meter-unit {
  position: relative; width: 100%; max-width: 170px; aspect-ratio: 640 / 166;
  border-radius: 12px; overflow: hidden;
  background: #04081e; border: 1.5px solid rgba(245, 205, 106, .6);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .9);
  transition: transform .25s, box-shadow .25s;
}
.meter-unit.surge { animation: unitPop 520ms ease-out; }
@keyframes unitPop { 40% { transform: scale(1.08); } }
.meter-unit.meter-green { border-color: rgba(43, 255, 140, .82); box-shadow: inset 0 2px 8px rgba(0, 0, 0, .9), 0 0 14px rgba(43, 255, 140, .28); }
.meter-unit.meter-yellow { border-color: rgba(255, 217, 61, .86); box-shadow: inset 0 2px 8px rgba(0, 0, 0, .9), 0 0 14px rgba(255, 217, 61, .3); }
.meter-unit.meter-red { border-color: rgba(255, 51, 82, .86); box-shadow: inset 0 2px 8px rgba(0, 0, 0, .9), 0 0 14px rgba(255, 51, 82, .3); }

/* Bespoke 3D crystal meter frame image + glowing horizontal liquid inside the glass cylinder */
.meter-frame-img {
  position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block;
}
.meter-glass {
  position: absolute; z-index: 2; left: 23.5%; right: 14.5%; top: 21%; bottom: 21%;
  border-radius: 5px; overflow: hidden; pointer-events: none;
  background: rgba(3, 8, 28, .28);
  mix-blend-mode: screen;
}
.meter-unit.meter-green .meter-frame-img { filter: hue-rotate(128deg) saturate(1.25); }
.meter-unit.meter-yellow .meter-frame-img { filter: hue-rotate(46deg) saturate(1.18); }
.meter-unit.meter-red .meter-frame-img { filter: none; }
.meter-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 50%;
  transition: width 460ms cubic-bezier(.22, .88, .32, 1);
  border-radius: 4px;
}
.meter-unit.meter-green .meter-fill {
  background: linear-gradient(90deg, #067a3a 0%, #19e075 65%, #c2ffe0 100%);
  box-shadow: 0 0 14px rgba(43, 255, 140, .95);
}
.meter-unit.meter-yellow .meter-fill {
  background: linear-gradient(90deg, #c97200 0%, #ffd93d 65%, #fff9c4 100%);
  box-shadow: 0 0 14px rgba(255, 217, 61, .95);
}
.meter-unit.meter-red .meter-fill {
  background: linear-gradient(90deg, #9c0622 0%, #ff2b56 65%, #ffc4d4 100%);
  box-shadow: 0 0 14px rgba(255, 51, 82, .95);
}
.meter-unit.hot .meter-fill { animation: hotPulse 1.05s ease-in-out infinite; }
@keyframes hotPulse { 50% { filter: brightness(1.3) saturate(1.22); } }
.meter-ticks {
  position: absolute; inset: 0; display: flex; justify-content: space-evenly; pointer-events: none; z-index: 3;
}
.meter-ticks i { width: 1px; height: 100%; background: rgba(255, 245, 200, .42); }
.meter-tagline {
  font-size: 11.5px; font-weight: 700; letter-spacing: .25em; text-transform: uppercase;
  color: var(--gold-hi); text-align: center; text-shadow: 0 0 10px rgba(245, 205, 106, .48);
}

/* Deep Recessed Screen Bezel & Dark High-Contrast Reels */
.cab-screen-bezel {
  padding: 10px; border-radius: 18px;
  background: linear-gradient(180deg, #05091a 0%, #131c4c 52%, #222c6a 100%);
  border: 2px solid rgba(245, 205, 106, .62);
  border-top-color: rgba(130, 92, 22, .85);
  border-bottom-color: rgba(255, 240, 178, .82);
  box-shadow: inset 0 14px 26px rgba(0, 0, 0, .92), inset 0 -4px 10px rgba(255, 255, 255, .14), 0 8px 20px rgba(0, 0, 0, .72);
}
.reel-zone { display: flex; align-items: stretch; justify-content: center; gap: 6px; }
.line-tags { display: grid; grid-template-rows: repeat(3, 1fr); position: relative; width: 22px; }
.line-tags span {
  position: absolute; left: 0; width: 22px; height: 18px; border-radius: 4px; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; top: calc((var(--r) + .5) * var(--cell) - 9px);
  color: #090d26; background: var(--c); opacity: .52; cursor: pointer;
  transition: opacity .15s, transform .15s, box-shadow .15s;
}
.line-tags span:hover, .line-tags span.on { opacity: 1; box-shadow: 0 0 12px var(--c); z-index: 3; }
.line-tags span:nth-child(4), .line-tags span:nth-child(5) { transform: translateY(-20px); }
.line-tags span:nth-child(6), .line-tags span:nth-child(7) { transform: translateY(20px); }
.line-tags span:nth-child(8), .line-tags span:nth-child(9) { transform: translateY(-40px); }
.line-tags span:nth-child(10) { transform: translateY(40px); }

.reels {
  position: relative; display: grid; grid-template-columns: repeat(5, var(--cell));
  border-radius: 14px; overflow: hidden; border: 3px solid transparent;
  background: linear-gradient(180deg, #060d2a 0%, #03071a 52%, #020411 100%) padding-box, var(--gold-grad) border-box;
  box-shadow: 0 0 0 3px #1b0d38, 0 0 30px rgba(245, 205, 106, .35), inset 0 0 18px rgba(0, 0, 0, .58);
}
body.free-mode .reels { background-image: linear-gradient(180deg, #0b2b2c, #04131c); }
body.star-mode .reels { background-image: linear-gradient(180deg, #2d0d24, #140514); }

.screen-glass {
  position: absolute; inset: 0; pointer-events: none; z-index: 6;
  background: linear-gradient(128deg, rgba(255, 255, 255, .09) 0%, rgba(255, 255, 255, .02) 22%, transparent 36%, transparent 76%, rgba(255, 255, 255, .04) 100%);
}
.reel { position: relative; height: calc(var(--cell) * 3); overflow: hidden; border-right: 1px solid rgba(245, 205, 106, .22); }
.reel:last-of-type { border-right: none; }
.reel::before, .reel::after { content: ''; position: absolute; left: 0; right: 0; height: 18%; z-index: 2; pointer-events: none; }
.reel::before { top: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .2) 55%, transparent 100%); }
.reel::after { bottom: 0; background: linear-gradient(0deg, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .2) 55%, transparent 100%); }
.reel.spinning::after { height: 34%; animation: gloss 210ms linear infinite; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .22), transparent); }
@keyframes gloss { from { transform: translateY(-120%); } to { transform: translateY(420%); } }
.reel.tease { animation: tease 320ms ease-in-out infinite; background: radial-gradient(ellipse at 50% 50%, rgba(255, 190, 60, .28), transparent 72%); }
@keyframes tease {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(255, 217, 61, .6), inset 0 0 18px rgba(255, 79, 168, .38); }
  50% { box-shadow: inset 0 0 0 4px #ffe478, inset 0 0 32px rgba(255, 79, 168, .75); }
}
.reel.reel-thud { animation: reelThud 220ms cubic-bezier(.22, .68, .35, 1.2); }
@keyframes reelThud { 0% { transform: translateY(5px); } 55% { transform: translateY(-2px); } 100% { transform: translateY(0); } }

.strip { will-change: transform; }
.strip.blur { filter: blur(1.8px) brightness(1.16) saturate(1.12); }
.cell { height: var(--cell); display: grid; place-items: center; padding: 5%; position: relative; }
.cell img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 11px;
  border: 1.5px solid rgba(245, 205, 106, .35);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .65); user-select: none;
  transition: transform .22s, filter .22s;
}
.cell.cell-land img { animation: cellLand 420ms cubic-bezier(.18, .88, .32, 1.35); border-color: #ffe88a; filter: drop-shadow(0 0 14px rgba(255, 217, 61, .95)); }
@keyframes cellLand { 0% { transform: scale(.78); } 55% { transform: scale(1.16); } 100% { transform: scale(1); } }
.cell.lamp-off img { filter: grayscale(.85) brightness(.42); }
.lamp-ring { position: absolute; inset: 10%; border-radius: 50%; border: 3px solid #fff; animation: bloom 420ms ease-out forwards; pointer-events: none; }
@keyframes bloom { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.cell.win { animation: pop .75s ease-in-out infinite; z-index: 2; }
.cell.win img { border-color: #ffe88a; filter: drop-shadow(0 0 14px rgba(255, 217, 61, .95)) brightness(1.1); }
.cell.win::before {
  content: ''; position: absolute; inset: 3%; border-radius: 13px; border: 2.5px solid #ffe88a;
  background: radial-gradient(circle, rgba(255, 217, 61, .35), transparent 72%);
  box-shadow: 0 0 20px rgba(255, 217, 61, .9), inset 0 0 12px rgba(255, 79, 168, .42); pointer-events: none;
}
@keyframes pop { 50% { transform: scale(1.09); } }
.reels.has-win .cell:not(.win) img { opacity: .34; filter: grayscale(.4) brightness(.65); }

.lock-layer { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(3, 1fr); pointer-events: none; z-index: 4; }
.lock-layer i { grid-column: calc(var(--i) + 1); grid-row: calc(var(--j) + 1); display: grid; place-items: center; padding: 6%; }
.lock-layer img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 2.5px solid #ffe88a; box-shadow: 0 0 16px rgba(255, 217, 61, .85); }
.lines-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.lines-overlay .ln { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw .65s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.line-pill { animation: pillPop 300ms cubic-bezier(.2, .9, .3, 1.3) backwards; animation-delay: 140ms; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .82)); }
@keyframes pillPop { from { opacity: 0; transform: scale(.5); } }
.coin-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.pole-ghost { position: fixed; width: 60px; height: 60px; z-index: 40; pointer-events: none; border-radius: 10px; }

.win-flash { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .3s; padding: 0 12px; text-align: center; }
.win-flash.show { opacity: 1; }
.win-flash span {
  font-family: var(--f-display); font-weight: 700; font-size: clamp(24px, 4vw, 44px); color: #fff9de;
  padding: 8px 26px; border-radius: 16px; max-width: 92%; white-space: nowrap;
  background: rgba(14, 12, 52, .9); border: 2.5px solid var(--gold);
  text-shadow: 0 0 18px var(--gold), 0 0 36px var(--pink); transform: rotate(-2deg); animation: pop .6s infinite;
}
.win-flash.mega span { border-color: var(--pink); text-shadow: 0 0 22px var(--pink), 0 0 42px #ff0088; }
.win-flash.epic span { border-color: var(--cyan); text-shadow: 0 0 22px var(--cyan), 0 0 44px var(--yellow); }

/* Protruding 3D Control Deck — Strict Text Containment in Recessed Cut-In Boxes */
.cab-deck {
  position: relative; z-index: 3; width: calc(100% + 28px); max-width: calc(100vw - 16px);
  margin: 4px -14px 0; padding: 8px 14px 10px; border-radius: 14px 14px 12px 12px;
  background: linear-gradient(180deg, #2b2472 0%, #15174f 30%, #0b0f35 74%, #060922 100%);
  border: 1.5px solid rgba(245, 205, 106, .6); border-top-color: rgba(255, 240, 185, .8);
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, .24), inset 0 -4px 10px rgba(0, 0, 0, .55), 0 18px 28px rgba(0, 0, 0, .82);
}
.cab-deck-lip {
  height: 12px; margin: 8px -14px -10px; border-radius: 0 0 11px 11px;
  background: linear-gradient(180deg, #f8dc8c 0%, #cf9830 38%, #734c09 78%, #301e03 100%);
  border-top: 1px solid rgba(255, 248, 215, .85); box-shadow: 0 8px 16px rgba(0, 0, 0, .75);
}

.status-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto 148px; align-items: center; gap: 10px; margin: 0 2px; }
.msg-box, .win-box, .cut-box {
  background: #03071d;
  border: 1.5px solid rgba(245, 205, 106, .5);
  border-top-color: rgba(120, 88, 22, .68);
  border-bottom-color: rgba(255, 238, 175, .75);
  border-radius: 10px;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .92), inset 0 -1px 0 rgba(255, 255, 255, .08), 0 1px 0 rgba(255, 255, 255, .12);
}
.msg-box { padding: 5px 10px; min-height: 40px; display: flex; align-items: center; min-width: 0; }
.msg {
  font-size: 11.5px; color: #e2e9ff; font-weight: 500; letter-spacing: .04em; line-height: 1.2;
  width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.win-box {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 5px 12px; min-height: 40px; width: 148px; justify-self: end;
}
.win-box span { font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.win-box b { font-size: 23px; color: var(--gold-hi); font-variant-numeric: tabular-nums; text-shadow: 0 0 10px rgba(245, 205, 106, .5); }

/* Built-In 3D Rectangular SPIN TO WIN Bar that moves down when pressed */
.spin-well {
  padding: 4px 6px 7px; border-radius: 12px;
  background: linear-gradient(180deg, #020410 0%, #0b1236 100%);
  border: 1.5px solid rgba(245, 205, 106, .58);
  box-shadow: inset 0 5px 10px rgba(0, 0, 0, .95), 0 2px 0 rgba(255, 240, 190, .25);
  display: flex; align-items: center; justify-content: center;
}
.spin-btn {
  min-width: 162px; height: 38px; padding: 0 18px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid #ffe29a; position: relative;
  background: linear-gradient(180deg, #ff7bc0 0%, #f0207e 48%, #9e084b 100%);
  box-shadow:
    0 5px 0 #570228,
    0 7px 14px rgba(0, 0, 0, .85),
    0 0 20px rgba(255, 79, 168, .55),
    inset 0 2px 2px rgba(255, 255, 255, .52),
    inset 0 -3px 6px rgba(90, 0, 42, .6);
  color: #fff; font-family: var(--f-ui); font-weight: 700; font-size: 15px; letter-spacing: .22em; text-transform: uppercase;
  transition: transform 80ms ease, box-shadow 80ms ease, filter .18s;
  transform: translateY(-2px);
}
.spin-btn span { text-shadow: 0 2px 3px rgba(0, 0, 0, .65); }
.spin-btn:hover:not(:disabled) { filter: brightness(1.1); }
.spin-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #570228, 0 2px 5px rgba(0, 0, 0, .85), inset 0 2px 5px rgba(70, 0, 35, .7);
}
.spin-btn:disabled {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #420420, 0 3px 6px rgba(0, 0, 0, .7);
  filter: saturate(.55) brightness(.78); cursor: progress;
}
body.free-mode .spin-btn {
  border-color: #b7ffd8; color: #031a0c;
  background: linear-gradient(180deg, #8affc1 0%, #19c769 48%, #096331 100%);
  box-shadow: 0 5px 0 #04381a, 0 7px 14px rgba(0, 0, 0, .85), 0 0 22px rgba(43, 255, 140, .55), inset 0 2px 2px rgba(255, 255, 255, .55);
}

.controls { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; gap: 12px; margin: 8px 2px 0; }
.bet-ctl.cut-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 12px; }
.round-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--gold);
  background: linear-gradient(180deg, #272272, #0c1242); color: var(--gold-hi); font-size: 20px;
  cursor: pointer; line-height: 1; box-shadow: 0 3px 0 #04071a, inset 0 1px 1px rgba(255, 255, 255, .25);
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.round-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #04071a; }
.bet-read { display: flex; flex-direction: column; align-items: center; min-width: 72px; line-height: 1.1; }
.bet-read span { font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.bet-read b { font-size: 23px; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.bet-read.total.cut-box { flex-direction: row; align-items: baseline; justify-content: space-between; padding: 6px 16px; }

/* Belly Pull-Down Paytable Drawer */
.cab-belly {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 8px 18px 0; padding: 5px 14px; border-radius: 10px;
  background: linear-gradient(180deg, #070d2c, #0f164a 45%, #050920);
  border: 1px solid rgba(245, 205, 106, .42);
  box-shadow: inset 0 10px 16px rgba(0, 0, 0, .82);
}
.cab-grille {
  width: 44px; height: 10px; border-radius: 4px;
  background: repeating-linear-gradient(90deg, rgba(245, 205, 106, .35) 0 2px, #020512 2px 5px);
  border: 1px solid rgba(245, 205, 106, .28);
}
.drawer-handle {
  appearance: none; border: none; background: transparent; color: var(--gold-hi);
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 11px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 6px;
}
.drawer-handle:hover { background: rgba(245, 205, 106, .14); color: #fff; }
.drawer-chevron { font-style: normal; font-size: 14px; color: var(--gold); transition: transform .28s ease; display: inline-block; }
.drawer-handle[aria-expanded="true"] .drawer-chevron { transform: rotate(180deg); }

.pt-drawer {
  max-height: 0; overflow: hidden; opacity: 0;
  width: calc(var(--cell) * 5 + 106px); max-width: calc(100% - 20px);
  margin: 0 auto; border-radius: 0 0 16px 16px;
  background: linear-gradient(180deg, #0b1342 0%, #050920 100%);
  border: 0 solid rgba(245, 205, 106, .52);
  box-shadow: inset 0 10px 24px rgba(0, 0, 0, .85), 0 22px 44px rgba(0, 0, 0, .78);
  transition: max-height .42s cubic-bezier(.22, .88, .32, 1), opacity .28s ease, margin .3s ease, border-width .2s;
}
.pt-drawer.open { max-height: 980px; opacity: 1; margin-top: 4px; border-width: 1.5px; border-top: none; }
.pt-drawer-inner { padding: 14px 16px 18px; text-align: left; }
.pt-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.pt-drawer-head .kicker { display: block; font-size: 10px; letter-spacing: .32em; text-transform: uppercase; color: var(--pink); }
.pt-drawer-head h3 { margin: 0; font-family: var(--f-display); font-size: 22px; color: var(--gold-hi); }
.pt-drawer-note { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.pt-head, .pt-row { display: grid; grid-template-columns: 46px 1fr 48px 48px 48px 48px; align-items: center; gap: 8px; padding: 4px 6px; }
.pt-head span:nth-child(2), .pt-head b { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.pt-head b, .pt-row b { text-align: right; }
.pt-row { border-bottom: 1px solid rgba(245, 205, 106, .14); }
.pt-row img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; border: 1px solid rgba(245, 205, 106, .4); }
.pt-row b { color: var(--gold-hi); font-size: 17px; }
.pt-scatters-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.pt-scatter {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  background: rgba(3, 7, 26, .78); border: 1px solid rgba(245, 205, 106, .25); font-size: 12.5px; color: var(--muted);
}
.pt-scatter img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.pt-scatter b { color: var(--ink); }
.pt-test-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding: 10px 14px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(30, 18, 72, .9), rgba(10, 14, 46, .95));
  border: 1.5px dashed rgba(255, 79, 168, .65);
}
.pt-test-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 240px; }
.pt-test-copy b { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-hi); }
.pt-test-copy span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.test-mode-btn {
  background: linear-gradient(180deg, #ff7bc0, #d91c73); border-color: #ffe29a; color: #fff;
  box-shadow: 0 3px 0 #5c042c, 0 0 16px rgba(255, 79, 168, .45);
}
.test-mode-btn.active {
  background: linear-gradient(180deg, #7bffb6, #14b85e); border-color: #d8ffeb; color: #04180d;
  box-shadow: 0 3px 0 #064a24, 0 0 18px rgba(43, 255, 140, .55);
}

/* Modals & Interactive Bonus Rounds */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 30px); opacity: 0;
  padding: 12px 20px; border-radius: 12px; background: rgba(7, 13, 46, .95); border: 1px solid var(--gold);
  color: var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .65); transition: all .3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: var(--pink); }

.modal-wrap {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(3, 6, 22, .76); backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s;
}
.modal-wrap.in { opacity: 1; }
.modal {
  position: relative; width: min(740px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  padding: clamp(18px, 3vw, 30px); border-radius: 22px; text-align: center;
  background: radial-gradient(560px 260px at 50% 0, rgba(255, 79, 168, .28), transparent 70%), linear-gradient(180deg, #131c5a, #060b28);
  border: 1.5px solid var(--gold); box-shadow: 0 0 0 6px rgba(5, 10, 36, .85), 0 30px 80px rgba(0, 0, 0, .75);
}
.modal .kicker { margin: 0 0 6px; letter-spacing: .36em; font-size: 11px; text-transform: uppercase; color: var(--pink); }
.modal h2 { margin: 0 0 6px; font-family: var(--f-display); font-size: clamp(26px, 4vw, 38px); color: var(--gold-hi); }
.modal p { color: var(--muted); margin: 6px 0 14px; font-size: 15px; }
.modal .big-win { font-family: var(--f-display); font-weight: 700; font-size: clamp(42px, 7vw, 68px); color: var(--gold-hi); text-shadow: 0 0 22px rgba(245, 205, 106, .65); margin: 8px 0; }
.bonus-art { width: 164px; margin: 10px auto; filter: drop-shadow(0 0 20px rgba(68, 229, 255, .55)); }
.bonus-art img { width: 100%; display: block; border-radius: 16px; border: 2px solid var(--gold); }
.btn {
  appearance: none; border: none; cursor: pointer; border-radius: 12px; padding: 12px 22px;
  font-family: var(--f-ui); font-weight: 700; font-size: 16px; letter-spacing: .16em; text-transform: uppercase;
  color: #160c00; background: var(--gold-grad); box-shadow: 0 4px 0 var(--gold-lo), 0 8px 20px rgba(0, 0, 0, .5);
}
.btn.green { background: linear-gradient(180deg, #8affc1, #19c769 55%, #09753a); color: #04140b; box-shadow: 0 4px 0 #054723; }
.btn.pink { background: linear-gradient(180deg, #ff7ec2, #ec1f7c 55%, #990849); color: #fff; box-shadow: 0 4px 0 #590228; }
.btn:active { transform: translateY(3px); }

.pick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.pick {
  background: #0c164a; border: 1.5px solid var(--gold); border-radius: 14px; color: var(--ink);
  padding: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.pick:hover { transform: translateY(-4px); box-shadow: 0 0 22px rgba(255, 79, 168, .45); }
.pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.pick span { font-size: 11.5px; color: var(--muted); }

/* Cloud-Mobile 2-Stage Pick & 4-Star-Wheel Bonus */
.bear-pick { display: flex; justify-content: center; gap: 16px; margin: 16px 0 6px; flex-wrap: wrap; }
.bp {
  width: clamp(120px, 25vw, 172px); padding: 12px; border-radius: 16px; cursor: pointer; color: var(--ink);
  background: linear-gradient(180deg, #1b226a, #080f38); border: 1.5px solid rgba(245, 205, 106, .55);
  display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .2s, opacity .25s;
}
.bp img { width: 88%; border-radius: 12px; }
.bp:hover { transform: translateY(-4px); box-shadow: 0 0 24px rgba(255, 79, 168, .5); }
.bp-name { text-transform: uppercase; letter-spacing: .2em; font-size: 12px; color: var(--muted); }
.bp-prize { font-family: var(--f-display); font-size: 28px; color: var(--gold-hi); }
.bear-pick.done .bp { pointer-events: none; }
.bp.chosen { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 32px rgba(255, 217, 61, .55); transform: scale(1.04); }
.bp.other { opacity: .45; }

/* Care Bear Stare Rainbow Charge Bonus (8 Care Bears in 2 rows of 4) */
.rainbow-modal { width: min(780px, 100%); }
.rb-stage { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 12px; }
.rb-sky {
  position: relative; border-radius: 16px; padding: 8px 12px 6px; overflow: hidden;
  background: radial-gradient(360px 180px at 50% 85%, rgba(255, 79, 168, .22), rgba(5, 10, 36, .94) 75%);
  border: 1.5px solid rgba(245, 205, 106, .5);
  box-shadow: inset 0 6px 18px rgba(0, 0, 0, .85);
}
.rb-sky.full-rainbow {
  border-color: #ffe88a;
  box-shadow: inset 0 0 32px rgba(255, 217, 61, .35), 0 0 32px rgba(255, 79, 168, .65);
}
.rb-svg { width: min(360px, 100%); height: auto; display: block; margin: 0 auto; }
.rb-arc { opacity: .16; transition: opacity .28s ease, filter .28s ease; }
.rb-arc.lit { opacity: 1; filter: url(#rbGlow) drop-shadow(0 0 8px currentColor); }
.rb-beams { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.care-beam { animation: beamZap 480ms ease-out forwards; filter: drop-shadow(0 0 6px #fff); }
@keyframes beamZap {
  0% { opacity: 1; stroke-width: 7; }
  100% { opacity: 0; stroke-width: 1; }
}
.rb-hud {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  max-width: 440px; margin: -6px auto 2px; position: relative; z-index: 2;
}
.rb-stat {
  display: flex; flex-direction: column; align-items: center; padding: 4px 8px; border-radius: 9px;
  background: #03071d; border: 1px solid rgba(245, 205, 106, .48);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .9);
}
.rb-stat span { font-size: 9.5px; letter-spacing: .24em; color: var(--muted); }
.rb-stat b { font-size: 19px; color: var(--gold-hi); font-variant-numeric: tabular-nums; }

.rb-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.rb-bear {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px; border-radius: 14px; cursor: pointer; color: var(--ink);
  background: linear-gradient(180deg, #131c54, #060b28);
  border: 1.5px solid rgba(245, 205, 106, .36);
  transition: transform .15s, border-color .18s, box-shadow .18s;
}
.rb-bear-frame {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: #050b22;
}
.rb-bear-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rb-bear-name { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Glowing Care Bear Belly Badge Power Indicator */
.belly-glow {
  position: absolute; left: 50%; top: 62%; width: 44%; height: 44%;
  transform: translate(-50%, -50%) scale(.4); border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, var(--bc) 42%, transparent 74%);
  opacity: 0; pointer-events: none; mix-blend-mode: screen;
}
.rb-bear.glowing {
  border-color: var(--bc); transform: translateY(-4px) scale(1.04);
  box-shadow: 0 0 0 2px var(--bc), 0 0 26px var(--bc);
}
.rb-bear.glowing .rb-bear-name { color: #fff; }
.rb-bear.glowing .belly-glow {
  opacity: 1; animation: bellyPulse 460ms ease-in-out infinite;
}
@keyframes bellyPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(.88); opacity: .9; }
  50% { transform: translate(-50%, -50%) scale(1.38); opacity: 1; }
}
.rb-bear.released {
  border-color: var(--green);
  box-shadow: inset 0 0 14px rgba(43, 255, 140, .25), 0 0 12px rgba(43, 255, 140, .35);
}
.rb-bear.released .rb-bear-name { color: var(--green); }
.rb-bear.released .belly-glow {
  opacity: .55; transform: translate(-50%, -50%) scale(.78);
}
.rb-bear.miss { animation: shake .24s; border-color: var(--red); }

.rb-tiers {
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
}
.rb-tiers span {
  padding: 4px 12px; border-radius: 999px; font-size: 12px; letter-spacing: .08em;
  background: #040920; border: 1px solid rgba(245, 205, 106, .35); color: var(--muted);
}
.rb-tiers span b { color: var(--gold-hi); margin-left: 4px; }
.rb-tiers span.hit { border-color: var(--green); color: #d8ffeb; background: rgba(10, 48, 30, .85); box-shadow: 0 0 12px rgba(43, 255, 140, .35); }
.tune-result { display: flex; align-items: baseline; justify-content: center; gap: 14px; font-family: var(--f-display); font-size: clamp(26px, 5vw, 42px); margin: 10px 0; }
.tune-result i { color: var(--pink); font-style: normal; }
.tune-result b { color: var(--gold-hi); font-size: 1.35em; }

@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (max-width: 700px) {
  :root { --cell: calc((100vw - 68px) / 5); }
  .rb-grid { gap: 6px; }
  .rb-bear { padding: 4px; border-radius: 10px; }
  .rb-bear-name { font-size: 9px; letter-spacing: .04em; }
  .topbar { display: flex; justify-content: space-between; gap: 6px; padding: 8px; }
  .brand { display: none; }
  .credits-lbl { display: none; }
  .cab-stage { width: auto; flex: 1 1 auto; }
  .cab-body { gap: 4px; padding: 6px 4px 5px; }
  .cab-pillar { width: 9px; padding: 6px 0; }
  .cab-pillar i { width: 5px; height: 5px; }
  .cab-screen-bezel { padding: 4px; border-radius: 14px; }
  .reels { border-width: 2px; }
  .cab-deck { width: auto; max-width: none; margin: 4px 6px 0; padding: 8px 8px 10px; }
  .cab-deck-lip { height: 9px; margin: 8px -8px -10px; }
  .cab-belly { margin: 8px 10px 0; padding: 5px 8px; }
  .drawer-handle { font-size: 9.5px; letter-spacing: .12em; }
  .cab-grille { width: 18px; }
  .pt-drawer { width: auto; max-width: none; margin: 0 10px; }
  .pt-scatters-grid { grid-template-columns: 1fr; }
  .line-tags { display: none; }
  .status-bar { grid-template-columns: 1fr auto; gap: 6px; }
  .msg-box { grid-column: 1 / -1; order: 2; min-height: 32px; }
  .spin-well { order: 1; }
  .spin-btn { min-width: 132px; height: 34px; font-size: 13px; padding: 0 14px; }
  .win-box { order: 1; width: auto; min-width: 108px; min-height: 34px; }
  .pick-row { grid-template-columns: 1fr 1fr; }
  .tune-stage { grid-template-columns: 44px 1fr; }
  .tune-side { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
}
