/* Gold Miner — Opera Games front for the `gold_miner` engine. Didder's model (balance pill top-left, close top-right,
   wooden signs on the right, the miner digging the gold pile, the 1× / 10× / 50× / 100× picks at the bottom) with new
   art, animation and sound. The page fills whatever height the host gives (a full screen or a short panel in a live
   room): the top bar and the controls keep their size and the mine scene — miner and pile — scales into what is left. */
:root {
  --gold: #ffd76a; --gold-deep: #b8860b; --wood: #7a4a22; --wood-dark: #3e220e; --wood-ink: #1f1006;
  --cream: #fff1c9; --green: #3fbf4a; --green-dark: #1d6b23;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: #160b04; overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #fff; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:disabled { cursor: default; }
svg { display: block; }

.stage { position: relative; width: 100%; max-width: 520px; height: 100%; margin: 0 auto; overflow: hidden;
  background: url(assets/bg.webp?v=4ce8617a1f) center 58% / cover no-repeat, #2a170b;
  display: flex; flex-direction: column; container-type: size; }
.stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 14%, rgba(0,0,0,0) 55%, rgba(20,9,2,.82) 100%); }
.stage > * { position: relative; z-index: 1; }

/* drifting dust + gold motes */
.dust { position: absolute !important; inset: 0; z-index: 0 !important; pointer-events: none; opacity: .75;
  background-image: radial-gradient(2px 2px at 18% 62%, #ffe8a0, transparent), radial-gradient(1.5px 1.5px at 72% 48%, #fff6d0, transparent),
    radial-gradient(2px 2px at 40% 80%, #ffd76a, transparent), radial-gradient(1.5px 1.5px at 86% 70%, #fff, transparent),
    radial-gradient(2px 2px at 10% 40%, #ffe8a0, transparent), radial-gradient(1.5px 1.5px at 58% 66%, #ffd76a, transparent);
  animation: motes 6s ease-in-out infinite alternate; }
@keyframes motes { from { transform: translateY(0); opacity: .35; } to { transform: translateY(-14px); opacity: .85; } }

/* 1. top bar */
.top { flex: none; height: calc(var(--og-safe-top, env(safe-area-inset-top)) + 54px); display: flex; align-items: flex-start; justify-content: space-between;
  padding: calc(var(--og-safe-top, env(safe-area-inset-top)) + 8px) 10px 0; z-index: 6 !important; }
.top .right { display: flex; gap: 6px; }
.pill { position: relative; display: flex; align-items: center; gap: 6px; height: 36px; min-width: 96px; max-width: 34cqw; padding: 0 12px 0 6px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(40,20,6,.88), rgba(20,9,2,.9)); border: 2px solid var(--gold);
  box-shadow: 0 3px 0 var(--wood-ink), 0 0 12px rgba(255,200,60,.25), inset 0 1px 0 rgba(255,255,255,.18); }
.pill .v { font-weight: 900; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; color: var(--cream); }
.pill.bump { animation: bump .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes bump { 40% { transform: scale(1.12); } }
.coin { flex: none; display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: url(assets/coin.webp?v=bb107ad0b2) center / contain no-repeat; }
.title { position: absolute; left: 8px; top: 4px; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: calc(100% - 120px); pointer-events: none; }
.logo { position: relative; transform: rotate(-1.5deg); pointer-events: none;
  padding: 5px 14px 6px; border-radius: 8px; background: linear-gradient(180deg, #a8682f, #7a4a22 55%, #5b3415); border: 2px solid #3e220e;
  box-shadow: 0 4px 0 #2a170b, 0 6px 14px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,220,160,.35); }
.logo span { display: block; white-space: nowrap; font: 900 20px/1 "Arial Black", Impact, system-ui, sans-serif; letter-spacing: 1px;
  background: linear-gradient(180deg, #fffbe0 0%, #ffe066 40%, #f0a800 70%, #c47a00 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 1px #5b3415; filter: drop-shadow(0 2px 0 #3e220e); }
.logo.big span { font-size: 34px; }
.round { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #a8682f, var(--wood-dark)); border: 2px solid var(--gold);
  box-shadow: 0 3px 0 var(--wood-ink), 0 6px 12px rgba(0,0,0,.4); transition: transform .1s; }
.round:active { transform: translateY(2px) scale(.95); box-shadow: 0 1px 0 var(--wood-ink); }
.round svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.round b { font: 900 18px Georgia, serif; }
#btnSound .off { display: none; } #btnSound.muted .on { display: none; } #btnSound.muted .off { display: block; }

/* fixed prizes (moved into the drawer by info-drawer.js) */
.prizes { display: none; }
.prizes.idr-chips { display: block; }
.prize span { font-size: 10px; font-weight: 900; letter-spacing: 1px; }
.p-motherlode { border-color: #ffd76a; } .p-chest { border-color: #f59e0b; } .p-diamond { border-color: #c7f0ff; } .p-sapphire { border-color: #60a5fa; }

/* 2. the mine scene */
.scene { flex: 1 1 0; min-height: 0; position: relative; container-type: size; }
.ground { position: absolute; left: 0; right: 0; bottom: 2px; height: 100%; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
/* the rig keeps its shape: pile on the right, miner on the left; it grows with the scene up to the width left by the signs */
.rig { position: relative; width: min(90cqw, 112cqh, 430px); aspect-ratio: 1.45 / 1; margin-right: 6cqw; }
.rig .glow { position: absolute; left: 30%; right: -6%; bottom: 0; height: 55%; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 70%, rgba(255,214,90,.55), rgba(255,180,40,0) 70%); opacity: .55; transition: opacity .3s; }
.rig.mining .glow { animation: glowPulse .32s ease-in-out infinite alternate; }
@keyframes glowPulse { from { opacity: .5; } to { opacity: 1; } }
.pile { position: absolute; right: -4%; bottom: 0; width: 66%; filter: drop-shadow(0 8px 10px rgba(0,0,0,.5)); transform-origin: 50% 100%; }
.pile.hit { animation: pileHit .32s ease-out; }
@keyframes pileHit { 0% { transform: scale(1); } 25% { transform: scale(1.04, .95); filter: drop-shadow(0 8px 10px rgba(0,0,0,.5)) brightness(1.35); } 100% { transform: scale(1); } }
.miner { position: absolute; left: 0; bottom: 0; height: 100%; aspect-ratio: .64; transform-origin: 50% 100%; }
.miner img { position: absolute; left: 0; bottom: 0; height: 100%; width: auto; max-width: none; transform-origin: 50% 100%; filter: drop-shadow(0 8px 10px rgba(0,0,0,.45));
  animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(1, 1); } 50% { transform: scale(1.012, .985); } }
.miner.swing img { animation: swing .32s cubic-bezier(.5,0,.7,1) infinite; transform-origin: 40% 95%; }
@keyframes swing { 0% { transform: rotate(-4deg); } 55% { transform: rotate(9deg) translateX(3%); } 100% { transform: rotate(-4deg); } }
.miner.cheer img { animation: hop .5s cubic-bezier(.3,1.6,.5,1) 3; }
@keyframes hop { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-10%) scale(1.03, .97); } 100% { transform: translateY(0) scale(1); } }
/* helmet lamp flicker (over the lamp of the art) */
.lamp { position: absolute; left: 39%; top: 5%; width: 26%; aspect-ratio: 1; border-radius: 50%; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255,250,210,.95) 0%, rgba(255,230,140,.45) 30%, rgba(255,220,120,0) 70%); animation: flicker 3.2s steps(1) infinite; }
.miner.cheer .lamp, .miner.swing .lamp { display: none; }
@keyframes flicker { 0%, 100% { opacity: .85; } 12% { opacity: .55; } 14% { opacity: .9; } 47% { opacity: .7; } 49% { opacity: 1; } 78% { opacity: .65; } }

.signs { position: absolute; right: 8px; top: 44px; z-index: 3; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.sign { position: relative; min-width: 76px; height: 30px; padding: 0 10px 0 14px; border-radius: 4px 8px 8px 4px; transform: rotate(-2deg);
  background: linear-gradient(180deg, #b0743a, #84501f 55%, #64390f); border: 2px solid #3e220e;
  box-shadow: 0 3px 0 #2a170b, 0 5px 10px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,220,160,.4); transition: transform .12s; }
.sign.alt { transform: rotate(2deg); border-radius: 8px 4px 4px 8px; padding: 0 14px 0 10px; }
.sign::before { content: ''; position: absolute; left: 5px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: #3e220e; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.sign.alt::before { left: auto; right: 5px; }
.sign span { display: block; font-size: 11.5px; font-weight: 900; letter-spacing: 1px; color: var(--cream); text-shadow: 0 1px 0 #3e220e, 0 0 6px rgba(0,0,0,.4); white-space: nowrap; }
.sign:active { transform: translateY(2px) rotate(0deg); }

.msg { position: relative; max-width: 100%; pointer-events: none;
  padding: 4px 12px; border-radius: 999px; background: rgba(20,9,2,.62); border: 1px solid rgba(255,215,106,.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 12px; font-weight: 800; color: var(--cream); transition: opacity .25s; }
.msg.hot { color: #fff; border-color: var(--gold); box-shadow: 0 0 14px rgba(255,200,60,.5); }

/* 3. controls */
.controls { flex: none; padding: 0 10px calc(var(--og-safe-bottom, env(safe-area-inset-bottom)) + 10px); display: flex; flex-direction: column; gap: 8px; z-index: 4 !important; }
.hud { display: grid; grid-template-columns: 1.25fr 1fr; gap: 8px; }
.box { height: 44px; border-radius: 12px; background: linear-gradient(180deg, rgba(40,20,6,.9), rgba(20,9,2,.92)); border: 1.5px solid rgba(255,215,106,.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 3px 8px rgba(0,0,0,.35); display: flex; flex-direction: column; justify-content: center; align-items: center; min-width: 0; }
.box .k { font-size: 9.5px; font-weight: 900; letter-spacing: 1.2px; color: #e9c77a; }
.box .v { display: flex; align-items: center; gap: 4px; font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 0; max-width: 100%; }
.box .v .coin { width: 16px; height: 16px; }
.box.win.lit { border-color: var(--gold); box-shadow: 0 0 16px rgba(255,200,60,.65), inset 0 1px 0 rgba(255,255,255,.2); }
.box.win.lit .v { color: #ffe066; }
.betbox { flex-direction: row; justify-content: space-between; padding: 0 4px; }
.betbox .mid { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.mini { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #a8682f, var(--wood-dark)); border: 1.5px solid var(--gold); box-shadow: 0 2px 0 var(--wood-ink); }
.mini svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.mini:active:not(:disabled) { transform: translateY(1px) scale(.94); }
.mini:disabled { opacity: .4; }

.picks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.pick { position: relative; height: 58px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; overflow: hidden;
  background: linear-gradient(180deg, #ffd25a 0%, #f5a623 45%, #d9771a 100%); border: 2px solid #fff0b0;
  box-shadow: 0 4px 0 #8a4a0b, 0 8px 14px rgba(0,0,0,.4), inset 0 2px 0 rgba(255,255,255,.55); transition: transform .08s, box-shadow .08s, filter .2s; }
.pick::before { content: ''; position: absolute; left: -40%; top: 0; width: 30%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg); animation: shine 3.6s ease-in-out infinite; }
.pick:nth-child(2)::before { animation-delay: .25s; } .pick:nth-child(3)::before { animation-delay: .5s; } .pick:nth-child(4)::before { animation-delay: .75s; }
@keyframes shine { 0%, 70% { left: -40%; } 100% { left: 130%; } }
.pick b { position: relative; font-size: 21px; font-weight: 900; line-height: 1; color: #fff; -webkit-text-stroke: 1px #8a4a0b; paint-order: stroke fill; text-shadow: 0 2px 0 #8a4a0b; }
.pick .cost { position: relative; display: flex; align-items: center; gap: 3px; max-width: 100%; padding: 1px 6px; border-radius: 999px; background: rgba(90,40,4,.55); }
.pick .cost em { font-style: normal; font-size: 11px; font-weight: 900; color: #fff3c4; white-space: nowrap; overflow: hidden; }
.pick .cost .coin { width: 12px; height: 12px; }
.pick:active:not(:disabled) { transform: translateY(3px) scale(.97); box-shadow: 0 1px 0 #8a4a0b, 0 3px 6px rgba(0,0,0,.4), inset 0 2px 0 rgba(255,255,255,.55); }
.pick:disabled { filter: saturate(.45) brightness(.8); }
.pick.on { filter: brightness(1.12); box-shadow: 0 4px 0 #8a4a0b, 0 0 18px rgba(255,220,90,.9), inset 0 2px 0 rgba(255,255,255,.55); }
.pick.tap { animation: tapRing .35s ease-out; }
@keyframes tapRing { 0% { box-shadow: 0 4px 0 #8a4a0b, 0 0 0 0 rgba(255,240,170,.9); } 100% { box-shadow: 0 4px 0 #8a4a0b, 0 0 0 14px rgba(255,240,170,0); } }

/* particles + floating finds */
.fx { position: absolute !important; inset: 0; z-index: 7 !important; pointer-events: none; overflow: hidden; }
.chip { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c0, #ffc21a 60%, #b8860b);
  box-shadow: 0 0 6px rgba(255,200,50,.9); will-change: transform, opacity; }
.chip.rock { background: radial-gradient(circle at 35% 30%, #c9a27a, #7a5532); box-shadow: none; border-radius: 3px; }
.spark { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px 2px rgba(255,240,180,.95); will-change: transform, opacity; }
.find { position: absolute; display: flex; flex-direction: column; align-items: center; will-change: transform, opacity; transform: translate(-50%, -50%); }
.find img { width: var(--s, 64px); height: var(--s, 64px); object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,.55)); }
.find::before { content: ''; position: absolute; left: 50%; top: calc(var(--s, 64px) / 2); width: calc(var(--s, 64px) * 1.6); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(255,236,150,.75), rgba(255,200,60,0) 66%); z-index: -1; }
.find .amt { margin-top: 2px; padding: 2px 10px; border-radius: 999px; white-space: nowrap; font-size: 14px; font-weight: 900; color: #ffe98a;
  background: linear-gradient(180deg, #8a4f1c, #4e2a0c); border: 1.5px solid #ffd76a; box-shadow: 0 3px 8px rgba(0,0,0,.45); }
.find.gem .amt { color: #fff; background: linear-gradient(180deg, #7c3aed, #3b0764); border-color: #e9d5ff; }
.find.big .amt { font-size: 17px; }
.trail { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #fff7cf; box-shadow: 0 0 6px 2px rgba(255,220,120,.9); }
/* option b: finds stack briefly at the top-right */
.stack { position: absolute !important; right: 8px; top: calc(var(--og-safe-top, env(safe-area-inset-top)) + 54px); z-index: 7 !important; display: flex; flex-direction: column; gap: 4px;
  align-items: flex-end; pointer-events: none; }
.stack .row { display: flex; align-items: center; gap: 4px; padding: 2px 8px 2px 3px; border-radius: 999px; background: rgba(20,9,2,.78); border: 1px solid rgba(255,215,106,.7);
  font-size: 12px; font-weight: 900; color: #ffe98a; animation: rowIn .3s cubic-bezier(.3,1.5,.5,1); }
.stack .row img { width: 22px; height: 22px; object-fit: contain; }
.stack .row.out { opacity: 0; transform: translateX(20px); transition: opacity .4s, transform .4s; }
@keyframes rowIn { from { opacity: 0; transform: translateY(16px) scale(.6); } }

/* summary of a 10× / 50× / 100× haul (Didder's result card) */
.summary { position: absolute !important; inset: 0; z-index: 8 !important; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.5); }
.summary[hidden] { display: none; }
.summary .card { width: min(100%, 380px); max-height: 100%; display: flex; flex-direction: column; border-radius: 18px; padding: 12px 14px; border: 2px solid var(--gold);
  background: linear-gradient(180deg, #5b3517 0%, #3b2110 55%, #2a170b 100%); box-shadow: 0 0 30px rgba(255,190,40,.35); animation: pop .35s cubic-bezier(.3,1.5,.5,1); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.summary .eyebrow { text-align: center; font-size: 10.5px; font-weight: 900; letter-spacing: 2px; color: rgba(255,236,170,.7); }
.summary h3 { text-align: center; font-size: 20px; font-weight: 900; color: #ffe066; text-shadow: 0 2px 0 #3e220e; }
.haul { margin-top: 8px; min-height: 0; flex: 1 1 auto; overflow-y: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 6px; border-radius: 12px; background: rgba(0,0,0,.3); }
.haul .it { position: relative; display: flex; flex-direction: column; align-items: center; padding: 4px 2px 3px; border-radius: 10px; border: 1px solid rgba(255,215,106,.35);
  background: linear-gradient(180deg, rgba(120,70,20,.55), rgba(0,0,0,.35)); animation: rise .35s backwards; }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
.haul .it img { width: 40px; height: 40px; object-fit: contain; }
.haul .it b { font-size: 11px; font-weight: 900; color: #ffe98a; }
.haul .it i { position: absolute; top: 2px; right: 3px; font-style: normal; font-size: 10px; font-weight: 900; padding: 0 4px; border-radius: 4px; background: #ffd76a; color: #3e220e; }
.haul .it.pot { border-color: #e9d5ff; box-shadow: 0 0 10px rgba(200,160,255,.45); }
.summary .total { margin-top: 8px; display: flex; justify-content: center; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 800; color: rgba(255,236,170,.85); }
.summary .total b { font-size: 24px; color: #ffe066; font-variant-numeric: tabular-nums; }
.acts { margin-top: 10px; display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; }
.acts button { height: 44px; border-radius: 999px; font-weight: 900; }
.acts .ghost { background: rgba(255,255,255,.1); border: 1px solid rgba(255,236,170,.4); font-size: 14px; }
.acts .again { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; background: linear-gradient(180deg, #5fd36a, #2e9b38); box-shadow: 0 3px 0 var(--green-dark); }
.acts .again b { font-size: 14px; } .acts .again small { font-size: 10px; font-weight: 800; color: #eaffd8; }
.acts button:active { transform: translateY(2px); }

/* big win */
.bigwin { position: absolute !important; inset: 0; z-index: 9 !important; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: radial-gradient(circle at 50% 45%, rgba(90,50,10,.55), rgba(0,0,0,.82)); }
.bigwin[hidden] { display: none; }
.rays { position: absolute; left: 50%; top: 45%; width: 160cqmin; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; opacity: .55;
  background: repeating-conic-gradient(from 0deg, rgba(255,214,90,.55) 0 8deg, rgba(255,214,90,0) 8deg 20deg); border-radius: 50%;
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%); animation: spin 14s linear infinite; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.bw-item { position: relative; width: min(42cqw, 30cqh); filter: drop-shadow(0 0 22px rgba(255,214,90,.9)); animation: bwIn .7s cubic-bezier(.3,1.6,.5,1), bob 2.2s 0.7s ease-in-out infinite; }
@keyframes bwIn { from { transform: scale(.2) rotate(-25deg); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-6px) scale(1.03); } }
.bw-title { position: relative; font: 900 clamp(26px, 10cqw, 44px)/1 "Arial Black", Impact, system-ui, sans-serif; letter-spacing: 1px; text-align: center; padding: 0 10px;
  background: linear-gradient(180deg, #fffbe0, #ffe066 45%, #f0a800 75%, #b86b00); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 1.5px #5b3415; filter: drop-shadow(0 4px 0 #3e220e); animation: bwIn .6s .1s cubic-bezier(.3,1.6,.5,1) backwards; }
.bw-amount { position: relative; font-size: clamp(30px, 12cqw, 52px); font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 #7a4a22, 0 0 20px rgba(255,214,90,.8); }
.bw-tap { position: relative; margin-top: 6px; font-size: 13px; font-weight: 800; color: rgba(255,240,200,.85); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .4; } }

/* sheets */
.sheet { position: absolute !important; inset: 0; z-index: 10 !important; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.55); }
.sheet[hidden] { display: none; }
.sheet .card { width: 100%; max-height: 88%; overflow-y: auto; padding: 16px 16px calc(var(--og-safe-bottom, env(safe-area-inset-bottom)) + 14px); border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, #4a2b12, #2a170b); border-top: 2px solid var(--gold); animation: up .3s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h2 { font-size: 18px; font-weight: 900; color: #ffe066; margin-bottom: 8px; }
.sheet p { font-size: 13px; line-height: 1.45; color: #f4e6c8; margin-bottom: 8px; }
.sheet p b { color: #ffe066; }
.sheet .small { font-size: 11px; opacity: .75; }
.sheet .close { display: block; width: 100%; height: 44px; margin-top: 10px; border-radius: 999px; font-weight: 900; font-size: 15px;
  background: linear-gradient(180deg, #ffd25a, #d9771a); color: #3e220e; box-shadow: 0 3px 0 #8a4a0b; }
.paytable table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 4px 0 8px; }
.paytable th { text-align: left; font-size: 10.5px; letter-spacing: 1px; color: #e9c77a; padding: 4px; border-bottom: 1px solid rgba(255,215,106,.35); }
.paytable td { padding: 4px; border-bottom: 1px solid rgba(255,255,255,.08); }
.paytable .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.paytable .it { display: flex; align-items: center; gap: 6px; }
.paytable .it img { width: 26px; height: 26px; object-fit: contain; }
.paytable .tag { font-size: 9px; font-weight: 900; padding: 1px 5px; border-radius: 4px; background: #7c3aed; color: #fff; margin-left: 4px; }
.hist { display: flex; flex-direction: column; gap: 4px; }
.hist .row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(0,0,0,.25); font-size: 13px; }
.hist .row img { width: 30px; height: 30px; object-fit: contain; }
.hist .row b { color: #ffe066; font-variant-numeric: tabular-nums; }
.hist .empty { font-size: 13px; opacity: .7; text-align: center; padding: 18px 0; }

.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 8px; border-radius: 999px; background: rgba(255,255,255,.06); }
.tabs button { flex: 1; height: 30px; border-radius: 999px; font-size: 12px; font-weight: 900; color: rgba(255,255,255,.6); }
.tabs button.on { background: linear-gradient(180deg, #ffd25a, #f0a800); color: #3e220e; box-shadow: 0 2px 0 #8a4a0b; }
.rank { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.rank li { display: grid; grid-template-columns: 26px 34px 1fr auto; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,215,106,.12); animation: rise .3s backwards; }
.rank .pos { text-align: center; font-weight: 900; font-size: 14px; color: rgba(255,255,255,.45); }
.rank li:nth-child(1) .pos { color: #ffd76a; } .rank li:nth-child(2) .pos { color: #d7dde4; } .rank li:nth-child(3) .pos { color: #f59e5b; }
.rank li:nth-child(-n+3) { border-color: rgba(255,215,106,.4); background: linear-gradient(90deg, rgba(255,200,60,.14), rgba(255,255,255,.04)); }
.rank .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 14px; color: #3e220e; object-fit: cover;
  background: linear-gradient(180deg, #ffe08a, #d9951a); box-shadow: 0 0 0 1.5px rgba(255,215,106,.5); }
.rank .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: rgba(255,255,255,.9); }
.rank .tt { display: flex; align-items: center; gap: 4px; font-weight: 900; font-size: 13.5px; color: #ffe066; font-variant-numeric: tabular-nums; }
.rank .tt .coin { width: 14px; height: 14px; }
.rank .empty { display: block; text-align: center; opacity: .6; padding: 16px 0; }
.mock-note { margin-top: 8px; text-align: center; color: #ffb4a8 !important; }
.toast { position: absolute !important; left: 50%; bottom: 140px; transform: translate(-50%, 20px); z-index: 11 !important; max-width: 88%; padding: 8px 14px; border-radius: 12px;
  background: rgba(30,12,2,.92); border: 1px solid var(--gold); font-size: 13px; font-weight: 700; text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.loader { position: absolute !important; inset: 0; z-index: 20 !important; display: grid; place-items: center; background: #2a170b url(assets/bg.webp?v=4ce8617a1f) center 58% / cover; transition: opacity .4s; }
.loader.done { opacity: 0; pointer-events: none; }
.ld-card { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ld-card .logo { position: static; transform: rotate(-1.5deg); }
.ld-bar { width: 180px; height: 8px; border-radius: 999px; background: rgba(0,0,0,.5); border: 1px solid rgba(255,215,106,.6); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd25a, #f5a623); transition: width .2s; }

/* ── short panels (the host lowers the game, e.g. inside a live room) ── */
@container (max-height: 560px) {
  .top { height: calc(var(--og-safe-top, env(safe-area-inset-top)) + 46px); padding-top: calc(var(--og-safe-top, env(safe-area-inset-top)) + 6px); }
  .round { width: 32px; height: 32px; } .pill { height: 32px; } .logo span { font-size: 15px; } .logo { padding: 3px 9px 4px; }
  .pick { height: 50px; } .pick b { font-size: 18px; } .box { height: 40px; } .controls { gap: 6px; }
  .sign { height: 26px; min-width: 66px; } .sign span { font-size: 10.5px; } .signs { gap: 4px; }
  .stack { top: calc(var(--og-safe-top, env(safe-area-inset-top)) + 46px); }
}
@container (max-height: 470px) {
  .pick { height: 46px; } .pick b { font-size: 16px; } .pick .cost { padding: 0 5px; } .pick .cost em { font-size: 10px; }
  .box { height: 36px; } .box .k { display: none; } .mini { width: 28px; height: 28px; }
  .hud { gap: 6px; } .picks { gap: 6px; }
  .sign { height: 24px; min-width: 58px; padding: 0 8px 0 11px; } .sign span { font-size: 9.5px; }
  .msg { font-size: 11px; padding: 3px 10px; }
}
@container (max-height: 390px) {
  .controls { flex-direction: row; align-items: stretch; padding-bottom: calc(var(--og-safe-bottom, env(safe-area-inset-bottom)) + 8px); }
  .hud { grid-template-columns: 1fr; flex: 0 0 38%; gap: 4px; } .box { height: auto; min-height: 30px; } .betbox { padding: 0 2px; }
  .picks { flex: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; } .pick { height: auto; min-height: 30px; }
  .pick b { font-size: 15px; } .pick .cost em { font-size: 10px; }
  .msg { display: none; }
}
/* the scene's own height (the title sits in the scene) */
@container (max-height: 250px) { .logo { display: none; } .signs { top: 38px; } }
@media (prefers-reduced-motion: reduce) { .dust, .pick::before, .rays, .miner img { animation: none !important; } }
/* the closed PRIZES drawer keeps its (invisible) panel box under the tab: let taps through to the signs below it */
.idr { pointer-events: none; } .idr .idr-tab, .idr.open .idr-panel { pointer-events: auto; }
/* TURBO: every delay halves (game.js T()); the swing follows */
#btnTurbo svg { fill: none; }
#btnTurbo.on { background: radial-gradient(circle at 35% 30%, #ffe27a, #d98a10); box-shadow: 0 3px 0 var(--wood-ink), 0 0 14px rgba(255,214,90,.85); }
#btnTurbo.on svg { fill: #fff; stroke: #7a4a00; }
.stage.turbo .miner.swing img { animation-duration: .16s; }
@container (max-width: 360px) { .top .right { gap: 4px; } .round { width: 32px; height: 32px; } .pill { min-width: 84px; } }
