* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; user-select: none; }
html, body { height: 100%; background: #1b1035; overflow: hidden; font-family: 'Nunito', system-ui, sans-serif; }
body { display: flex; align-items: center; justify-content: center; }

#frame { position: relative; height: 100vh; aspect-ratio: 9 / 16; max-width: 100vw; overflow: hidden; background: #ffe7a8; container-type: size; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* 1cqh = 1% of frame height, so the HUD scales with the 9:16 frame */
#hud { position: absolute; inset: 0; pointer-events: none; color: #fff; }
#hud button { pointer-events: auto; }
.hidden { display: none !important; }
body.noui #hud, body.noui #help { display: none; }

.chunky { font-family: 'Lilita One', 'Arial Black', sans-serif; }
#topbar { position: absolute; top: 2.2cqh; left: 3cqw; right: 3cqw; display: flex; justify-content: space-between; align-items: flex-start; }
#wallet-box { background: rgba(30, 15, 70, .55); border: .35cqh solid rgba(255,255,255,.9); border-radius: 2cqh; padding: .8cqh 1.6cqh; }
#wallet { font-family: 'Lilita One', sans-serif; font-size: 3.6cqh; color: #ffe14d; text-shadow: 0 .35cqh 0 #b86b00; letter-spacing: .05em; }
#juice { font-size: 1.7cqh; font-weight: 900; margin-top: .2cqh; }
#world-label { font-family: 'Lilita One', sans-serif; font-size: 2.2cqh; background: #ff4f8b; padding: .7cqh 1.8cqh; border-radius: 99px; border: .35cqh solid #fff; box-shadow: 0 .5cqh 0 #a3164b; margin-top: .6cqh; }
#logo-mini { font-family: 'Lilita One', sans-serif; font-size: 2.1cqh; line-height: .9; text-align: right; color: #fff; text-shadow: 0 .3cqh 0 #ff4f8b, 0 -.15cqh 0 #ff4f8b; transform: rotate(4deg); }

#coop-row { position: absolute; top: 11cqh; left: 2cqw; right: 2cqw; display: flex; gap: 1.2cqw; justify-content: center; }
.chip { position: relative; flex: 1; background: rgba(30,15,70,.6); border: .3cqh solid #fff; border-radius: 1.6cqh; padding: .6cqh .4cqh; text-align: center; transition: background .15s, transform .15s; }
.chip .nm { font-family: 'Lilita One', sans-serif; font-size: 1.8cqh; }
.chip .st { font-size: 1.15cqh; font-weight: 900; opacity: .95; }
.chip.hold { background: #19b96b; transform: translateY(-.3cqh); }
.chip.pumping { background: #ff3b5c; animation: wob .25s infinite alternate; }
.chip .av { width: 3.2cqh; height: 3.2cqh; border-radius: 50%; margin: 0 auto .3cqh; border: .25cqh solid #fff; }
.bubble { position: absolute; top: 105%; left: 50%; transform: translateX(-50%) scale(0); background: #fff; color: #1b1035; font-family: 'Lilita One', sans-serif; font-size: 2.1cqh; padding: .5cqh 1.2cqh; border-radius: 1.4cqh; white-space: nowrap; transition: transform .18s cubic-bezier(.3,1.8,.5,1); z-index: 3; }
.bubble::before { content: ''; position: absolute; top: -1cqh; left: 50%; margin-left: -1cqh; border: 1cqh solid transparent; border-top: 0; border-bottom-color: #fff; }
.bubble.show { transform: translateX(-50%) scale(1); }
.bubble.red { background: #ff3b5c; color: #fff; }
.bubble.red::before { border-bottom-color: #ff3b5c; }
@keyframes wob { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }

#pot-box { position: absolute; top: 19cqh; left: 0; right: 0; text-align: center; }
#pot-label { font-weight: 900; font-size: 1.6cqh; letter-spacing: .3em; text-shadow: 0 .2cqh .4cqh rgba(0,0,0,.4); }
#pot { font-family: 'Lilita One', sans-serif; font-size: 6.4cqh; color: #fff; -webkit-text-stroke: .35cqh #1b1035; paint-order: stroke fill; text-shadow: 0 .6cqh 0 #1b1035; transition: transform .1s; }
#pot.bump { transform: scale(1.12); }
#pot.danger { color: #ffd84d; animation: shakeTxt .08s infinite; }
@keyframes shakeTxt { 0% { transform: translate(.2cqh,0) } 50% { transform: translate(-.2cqh,.1cqh) } 100% { transform: translate(0,-.1cqh) } }

#gauge { position: absolute; right: 3cqw; top: 33cqh; width: 3.2cqw; height: 30cqh; border-radius: 99px; background: rgba(30,15,70,.55); border: .3cqh solid #fff; overflow: hidden; }
#gauge-fill { position: absolute; bottom: 0; left: 0; right: 0; height: 0; background: linear-gradient(0deg, #21d07a 0%, #ffe14d 55%, #ff3b5c 85%); transition: height .15s; }
#gauge.bands #gauge-fill { background: #21d07a; }
#gauge-pct { position: absolute; bottom: -.2cqh; width: 100%; text-align: center; font-weight: 900; font-size: 1.2cqh; }

#bottombar { position: absolute; bottom: 4cqh; left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: 4cqw; }
#btn-pump { width: 15cqh; height: 15cqh; border-radius: 50%; border: .6cqh solid #fff; background: radial-gradient(circle at 35% 30%, #ff8a8a, #ff2d4f 55%, #c30f33); color: #fff; font-family: 'Lilita One', sans-serif; font-size: 3.4cqh; letter-spacing: .04em; box-shadow: 0 1.1cqh 0 #7d0620, 0 1.6cqh 2cqh rgba(0,0,0,.35); cursor: pointer; transition: transform .06s, box-shadow .06s; text-shadow: 0 .3cqh 0 #7d0620; }
#btn-pump:active, #btn-pump.press { transform: translateY(.9cqh) scale(.96); box-shadow: 0 .2cqh 0 #7d0620, 0 .5cqh 1cqh rgba(0,0,0,.35); }
.side-btn { width: 9.5cqh; height: 9.5cqh; border-radius: 2.6cqh; border: .45cqh solid #fff; background: #6c4bff; color: #fff; font-family: 'Lilita One', sans-serif; font-size: 3.6cqh; box-shadow: 0 .8cqh 0 #3a1fb8; cursor: pointer; transition: transform .06s; }
.side-btn.bank { background: #19c46f; box-shadow: 0 .8cqh 0 #0b7a42; font-size: 2.3cqh; }
.side-btn:active, .side-btn.press { transform: translateY(.6cqh); box-shadow: 0 .2cqh 0 rgba(0,0,0,.4); }
.side-btn.bank.waiting { background: #ffb020; box-shadow: 0 .8cqh 0 #a96a00; }
#btn-auto, #btn-coop { position: absolute; bottom: 21.5cqh; padding: .7cqh 1.6cqh; border-radius: 99px; border: .3cqh solid #fff; font-family: 'Lilita One', sans-serif; font-size: 1.7cqh; color: #fff; cursor: pointer; }
#btn-auto { left: 3cqw; background: #2b9bff; }
#btn-auto.on { background: #ff8a00; }
#btn-coop { right: 3cqw; background: rgba(30,15,70,.6); }
#btn-coop.on { background: #ff4f8b; }

#shop { position: absolute; left: 3cqw; right: 3cqw; bottom: 3cqh; top: 30cqh; background: #fff8e8; border: .5cqh solid #1b1035; border-radius: 3cqh; box-shadow: 0 1cqh 0 #1b1035; display: flex; flex-direction: column; z-index: 20; animation: up .25s cubic-bezier(.3,1.5,.6,1); }
@keyframes up { from { transform: translateY(60%); opacity: 0 } to { transform: none; opacity: 1 } }
#shop-head { display: flex; justify-content: space-between; align-items: center; padding: 1.4cqh 2cqh; font-family: 'Lilita One', sans-serif; font-size: 3cqh; color: #1b1035; }
#shop-close { border: 0; background: #1b1035; color: #fff; width: 4.4cqh; height: 4.4cqh; border-radius: 50%; font-size: 2cqh; cursor: pointer; }
#shop-list { flex: 1; overflow-y: auto; padding: 0 1.6cqh 1.6cqh; display: grid; gap: 1.1cqh; }
.card { display: flex; align-items: center; gap: 1.4cqh; background: #fff; border: .3cqh solid #1b1035; border-radius: 2cqh; padding: 1cqh 1.2cqh; color: #1b1035; }
.card .ic { font-size: 4cqh; width: 6cqh; height: 6cqh; display: grid; place-items: center; border-radius: 1.6cqh; }
.card .tx { flex: 1; }
.card .nm { font-family: 'Lilita One', sans-serif; font-size: 2.1cqh; }
.card .ef { font-size: 1.35cqh; font-weight: 800; opacity: .75; }
.card button { border: 0; border-radius: 1.4cqh; padding: 1cqh 1.3cqh; background: #19c46f; color: #fff; font-family: 'Lilita One', sans-serif; font-size: 1.8cqh; box-shadow: 0 .5cqh 0 #0b7a42; cursor: pointer; min-width: 10cqh; }
.card button:disabled { background: #b9b4c9; box-shadow: 0 .5cqh 0 #7b7690; cursor: default; }
.card.bought { animation: pop .3s; }
@keyframes pop { 50% { transform: scale(1.06) } }

#shame { position: absolute; left: 8cqw; right: 8cqw; top: 26cqh; background: #1b1035; border: .5cqh solid #ff4f8b; border-radius: 3cqh; padding: 2.4cqh; text-align: center; color: #fff; z-index: 25; animation: up .3s cubic-bezier(.3,1.5,.6,1); }
.shame-title { font-family: 'Lilita One', sans-serif; font-size: 3.8cqh; line-height: 1; color: #ff4f8b; margin-bottom: 2cqh; }
.srow { display: flex; align-items: center; gap: 1.4cqh; padding: 1cqh 1.4cqh; border-radius: 1.6cqh; margin-bottom: .8cqh; background: rgba(255,255,255,.08); font-family: 'Lilita One', sans-serif; font-size: 2.6cqh; }
.srow:first-child { background: #ff4f8b; transform: scale(1.04); }
.srow .rk { width: 3cqh; opacity: .8; }
.srow .n { flex: 1; text-align: left; }
.shame-sub { font-weight: 900; font-size: 1.4cqh; opacity: .6; margin-top: 1cqh; letter-spacing: .2em; text-transform: uppercase; }

#fx { position: absolute; inset: 0; pointer-events: none; z-index: 10; overflow: hidden; }
.coin { position: absolute; width: 3.2cqh; height: 3.2cqh; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6a8, #ffcc00 50%, #c98a00); border: .25cqh solid #8a5a00; transition: transform .9s cubic-bezier(.5,-0.4,.6,1), opacity .9s; }
.splat { position: absolute; border-radius: 50%; background: radial-gradient(circle at 40% 40%, rgba(255,214,90,.98), rgba(255,140,0,.95) 45%, rgba(230,90,0,.9) 70%, rgba(230,90,0,0) 72%); transition: opacity 1.2s ease-in, transform 1.6s ease-in; }
.drip { position: absolute; width: 1.2cqh; border-radius: 0 0 1cqh 1cqh; background: rgba(255,140,0,.9); transition: height 1.4s ease-in, opacity 1.2s ease-in; }

#flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 30; }
#flash.on { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .95 } 100% { opacity: 0 } }

#slam, #banner { position: absolute; left: 0; right: 0; text-align: center; pointer-events: none; z-index: 31; font-family: 'Lilita One', sans-serif; opacity: 0; }
#slam { top: 47cqh; font-size: 8cqh; line-height: 1; color: #fff; -webkit-text-stroke: .5cqh #1b1035; paint-order: stroke fill; text-shadow: 0 1cqh 0 #1b1035; }
#slam.on { animation: slam 1.4s cubic-bezier(.2,1.6,.4,1) forwards; }
@keyframes slam { 0% { opacity: 0; transform: scale(3) rotate(-8deg) } 15% { opacity: 1; transform: scale(1) rotate(-4deg) } 80% { opacity: 1; transform: scale(1.04) rotate(-4deg) } 100% { opacity: 0; transform: scale(.9) rotate(-4deg) } }
#banner { top: 60cqh; }
body.coop #pot-box { top: 21.5cqh; }
#banner .b { display: inline-block; background: #ff3b5c; color: #fff; font-size: 5.4cqh; padding: 1.2cqh 3cqh; border: .5cqh solid #fff; border-radius: 2cqh; box-shadow: 0 1cqh 0 #7d0620; transform: rotate(-5deg); }
#banner.on { animation: slam 2.4s cubic-bezier(.2,1.6,.4,1) forwards; }

#outro { position: absolute; inset: 0; z-index: 40; background: radial-gradient(circle at 50% 45%, #ff4f8b, #6c2bd9 70%, #1b1035); display: flex; flex-direction: column; align-items: center; justify-content: center; }
#outro-logo { white-space: nowrap; font-family: 'Lilita One', sans-serif; font-size: 8.6cqh; color: #ffe14d; -webkit-text-stroke: .6cqh #1b1035; paint-order: stroke fill; text-shadow: 0 1.2cqh 0 #1b1035; display: flex; align-items: center; }
#outro-o { display: inline-block; color: #ff9d1c; transform-origin: 50% 60%; }
#outro-o.inflate { animation: inflateO 1.2s cubic-bezier(.4,0,.8,.6) forwards; }
#outro-o.burst { animation: none; opacity: 0; }
@keyframes inflateO { 0% { transform: scale(1) } 70% { transform: scale(1.9) } 85% { transform: scale(1.8, 2.0) } 100% { transform: scale(2.3) } }
#outro-sub { margin-top: 4cqh; font-family: 'Lilita One', sans-serif; font-size: 3.4cqh; color: #fff; background: #1b1035; padding: 1.2cqh 3cqh; border-radius: 99px; }

#loading { position: absolute; inset: 0; display: grid; place-items: center; background: #ffe7a8; font-family: 'Lilita One', sans-serif; font-size: 3cqh; color: #ff4f8b; z-index: 50; }
#help { position: absolute; left: 0; right: 0; bottom: 0; padding: .6cqh 1cqh; background: rgba(0,0,0,.45); color: #fff; font-size: 1.15cqh; line-height: 1.4; text-align: center; z-index: 5; }
body.capture #help { display: none; }
