/* P1.04.86: game-only viewport lock and PWA safe-area fit. */
:root{--greedy-safe-top:env(safe-area-inset-top,0px);--greedy-safe-bottom:env(safe-area-inset-bottom,0px);--greedy-usable-height:calc(100dvh - var(--greedy-safe-top) - var(--greedy-safe-bottom))}
:root{color-scheme:light;font-family:Arial,"Microsoft YaHei", "PingFang SC", sans-serif;color:#052a3f}
*{box-sizing:border-box}html,body{margin:0;padding:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none;background-color:#f2f5fa}body{position:relative;height:100vh;height:100dvh;padding-top:var(--greedy-safe-top);padding-bottom:var(--greedy-safe-bottom)}
/* P1.04.91: white iPhone system status area; preserve yellow gameplay and bottom safe area. */
body{background-color:#f2f5fa;background-image:linear-gradient(to bottom,#f2f5fa 0,#f2f5fa var(--greedy-safe-top),#fff47c var(--greedy-safe-top),#fff47c 100%)}button,a{font:inherit;-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:focus-visible,a:focus-visible{outline:3px solid #215be5;outline-offset:2px}[hidden]{display:none!important}
.game-shell{container-type:inline-size;max-width:662px;width:min(100%,662px,calc(100vh / 1.94));height:100vh;min-height:0;margin:auto;display:flex;flex-direction:column;overflow:hidden;background:#fff47c;box-shadow:0 0 24px #0e253015}
@supports(height:100dvh){.game-shell{height:var(--greedy-usable-height);width:min(100%,662px,calc(var(--greedy-usable-height) / 1.94))}}
.game-shell>.headbar,.game-shell>.wheel-section,.game-shell>.bet-panel,.game-shell>.stats-panel,.game-shell>.result-zone{flex:0 0 auto}
.headbar{width:100%;height:14.5cqw;background:repeating-linear-gradient(90deg,#ffdc2f 0 2.2cqw,#ffe94b 2.2cqw 3.1cqw,#ffdd34 3.1cqw 4.7cqw);border-radius:0 0 4cqw 0;display:flex;align-items:flex-start;justify-content:space-between;padding:3.5cqw 3.5cqw 0 3.5cqw;position:relative;z-index:1}
.headnav{display:flex;align-items:center;gap:2.45cqw}.tool{display:grid;place-items:center;width:7.9cqw;height:8.2cqw;padding:1cqw;border:0.38cqw solid #27252d;border-radius:2cqw;background:linear-gradient(#fffef5,#fcf8e7);box-shadow:inset 0 0 0 .56cqw #ffe967,0 .55cqw 0 #a89d43;text-decoration:none;color:#a08505}.tool svg{display:block;width:100%;height:100%;fill:none;stroke:#9e8500;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.tool.help{font-size:6cqw;font-weight:900;line-height:1;color:#a08505;text-shadow:.16cqw .2cqw #78590f}
.issue{white-space:nowrap;padding-top:1.1cqw;font-size:3.7cqw;line-height:1.2;font-weight:500;color:#0d161e}
.wheel-section{position:relative;background:#fff47c;line-height:0;isolation:isolate}.wheel-section .wheel-art{display:block;width:100%;height:auto;overflow:visible;background:#fff47c}
/* P1.04.95: red/blue combo betting on the two outer meal plates only. */
.side-bet-zone,.side-bet-zone *{-webkit-tap-highlight-color:transparent}
.side-bet-zone{cursor:pointer;touch-action:manipulation;outline:none}
.side-bet-zone .side-bet-choice-ring{opacity:0;transition:opacity .12s ease-out}
.side-bet-zone.is-picked .side-bet-choice-ring,.side-bet-zone:focus-visible .side-bet-choice-ring{opacity:1}
/* P1.04.94: remove native square tap highlight on the eight SVG food buttons. */
.food-unit,.food-unit *{-webkit-tap-highlight-color:transparent}
.food-unit{cursor:pointer;touch-action:manipulation;outline:none}.food-unit .plate-rim{transition:fill .08s linear}.food-unit .plate-lower{transition:fill .08s linear}.food-unit.is-lit .plate-rim{fill:#ffdc19!important}.food-unit.is-lit .plate-lower{fill:#ffc792!important}.food-unit:focus-visible .plate-rim{stroke:#1b336f;stroke-width:12px}.food-unit:active .plate-rim{filter:brightness(1.05)}
#pointerHand{transition:transform .1s ease-out;filter:drop-shadow(1px 2px 0 #1615217a)}
.bet-panel{height:27.75cqw;background:#20baf0;border:.55cqw solid #143049;border-radius:0 0 2.4cqw 2.4cqw;position:relative;z-index:1;padding:1.1cqw 2.6cqw 0}
.coins{display:grid;grid-template-columns:repeat(5,minmax(0,1fr)) .72fr;align-items:center;gap:1.5cqw;width:100%;height:14cqw}.chip-box{display:grid;place-items:center;height:13.2cqw;min-width:0;padding:.8cqw;border:.35cqw solid #09283b;border-radius:1.3cqw;background:#fefdf7;box-shadow:0 .75cqw 0 #036788}.chip-box.chosen{background:#ff3866;border-color:#12273a}.coin{display:grid;place-items:center;width:10.4cqw;height:10.4cqw;border-radius:50%;background:radial-gradient(circle at 28% 24%,#fff87f 0,#ffed4c 30%,#ffd324 65%,#dd8b00 82%,#ae6a03 100%);border:.46cqw solid #845000;box-shadow:inset 0 0 0 .6cqw #ffdf33,inset 0 0 0 .9cqw #eaaa09,0 .4cqw 0 #614820;color:#402507;text-shadow:.2cqw .2cqw #ffe57c;font-size:3.3cqw}.settings{width:8.5cqw;height:8.5cqw;border-radius:50%;border:.5cqw solid #b77f00;box-shadow:inset 0 0 0 .6cqw #ffef75,0 .45cqw 0 #694a17;background:linear-gradient(#ffe94c,#ffa809);display:grid;place-items:center;padding:1.5cqw}.settings svg{display:block;width:100%;height:100%;fill:#fdfefa;stroke:#987000;stroke-width:1;stroke-linejoin:round}
.recommend{position:absolute;bottom:-.4cqw;left:15.8%;width:68.4%;height:11cqw;background:#fff084;border:.45cqw solid #12283a;border-radius:2.5cqw 2.5cqw .6cqw .6cqw;clip-path:polygon(8% 0,92% 0,100% 100%,0 100%);color:#141d28;padding:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:1.4cqw;padding-bottom:1.1cqw}.hot-title{position:absolute;top:-.3cqw;left:21%;right:21%;height:3.8cqw;background:linear-gradient(#ffb4b7,#f18aa7);font-size:2.7cqw;line-height:3.6cqw;border:.25cqw solid #563347;border-radius:.7cqw}.reco-text{font-size:3.05cqw;white-space:nowrap;color:#171d22}.reco-text b{font-size:4.2cqw;font-weight:400;vertical-align:-.15cqw;margin-left:1.1cqw}
.stats-panel{height:14.2cqw;background:#ce1539;border-top:1.5cqw solid #fa4550;display:flex;align-items:center;gap:2cqw;padding:1.2cqw 5.2cqw 1.1cqw}
.star-medal{width:9.5cqw;height:9.5cqw;flex:none}.star-medal svg{display:block;width:100%;height:100%}.stat{height:9.9cqw;border:.3cqw solid #193147;border-radius:999px;background:#fff;flex:1;min-width:0;display:flex;align-items:center;justify-content:center;flex-direction:column;position:relative;color:#072b44}.stat:before,.stat:after{content:"";position:absolute;top:50%;width:.85cqw;height:.85cqw;background:#09374e;border-radius:50%;transform:translateY(-50%)}.stat:before{left:1.5cqw}.stat:after{right:1.5cqw}.stat>span{font-size:3.45cqw;line-height:1.24;white-space:nowrap}.stat strong{font-size:3.4cqw;font-weight:500;line-height:1.3;display:flex;align-items:center;gap:1.3cqw}.tiny-gold{display:inline-block;width:3cqw;height:3cqw;border-radius:50%;border:.16cqw solid #f6a800;background:linear-gradient(135deg,#fff37c 0 22%,#ffdd27 22% 63%,#f7b600 63%);vertical-align:middle;flex:none}
.result-zone{background:#ce1539;min-height:34.8cqw;padding:0 5.4cqw 5cqw}.result-bar{height:12.4cqw;background:#ed164e;border-radius:2cqw;display:flex;align-items:center;padding:0 4cqw;gap:3.8cqw}.result-bar>span{color:white;font-size:3.1cqw;white-space:nowrap}.result-icons{display:flex;align-items:center;justify-content:space-between;gap:1cqw;min-width:0;flex:1}.draw-item{background:#b9f5f9;border-radius:50%;width:8.9cqw;height:8.9cqw;flex:none;border:0.3cqw solid #e9678f;display:grid;place-items:center;position:relative}.draw-item.red{background:#ff9cbb}.draw-item img{width:83%;height:83%;object-fit:contain}.draw-item small{position:absolute;bottom:-.35cqw;right:0;font-size:2cqw;color:#000;background:#ffef00;border:.2cqw solid #754e04;border-radius:2cqw;padding:0 .2cqw;line-height:2.2cqw}
.rank{width:100%;height:13.9cqw;margin-top:2.7cqw;background:#fff;border:0;border-radius:2cqw;display:flex;align-items:center;text-align:left;padding:1.6cqw 3cqw;gap:2.2cqw;color:#052742}.avatar{position:relative;display:block;width:8cqw;height:8cqw;border-radius:50%;background:#738496 url('assets/rank-avatar.png') center/cover no-repeat;flex:none}.rank-one{position:absolute;bottom:-.65cqw;right:-.55cqw;border-radius:50%;width:3.5cqw;height:3.5cqw;background:#fbee21;display:grid;place-items:center;color:#32310c;border:.2cqw solid #202943;font-size:2.1cqw}.rank-copy{display:flex;flex-direction:column;gap:.9cqw;font-size:3.25cqw}.rank-copy strong{font-size:3.65cqw;display:flex;align-items:center;gap:1cqw;font-weight:500}.rank-chevron{margin-left:auto;font-size:6cqw;color:#17334a;font-weight:200}.dotted-after{min-height:23cqw;background-color:#fff47c;background-image:radial-gradient(#ffd532 .32cqw, transparent .38cqw);background-size:3.2cqw 3.2cqw}
.msg{position:fixed;z-index:45;left:50%;bottom:8vh;transform:translate(-50%,10px);color:#fff;background:#243342e9;border-radius:30px;padding:10px 16px;font-size:14px;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;text-align:center;max-width:85vw}.msg.show{opacity:1;transform:translate(-50%,0)}
/* P1.04.97: center only the guest sign-in prompt; keep other notices at the bottom. */
.msg.login-center{top:50%;bottom:auto;transform:translate(-50%,calc(-50% + 10px))}
.msg.login-center.show{transform:translate(-50%,-50%)}
.shade{position:fixed;z-index:50;inset:0;background:#0008;display:flex;align-items:flex-end;justify-content:center}.sheet{width:min(100%,662px);max-height:75vh;overflow:auto;background:#fff;border-radius:16px 16px 0 0;padding:18px 20px 28px;color:#28364a;box-shadow:0 -8px 22px #0003}.sheet-header{display:flex;align-items:center;justify-content:space-between;font-size:17px;border-bottom:1px solid #eaeaea;padding-bottom:10px}.sheet-header button{border:0;background:#f0f2f5;border-radius:50%;width:34px;height:34px;font-size:27px;color:#425266}.sheet-body{font-size:14px;line-height:1.85}.sheet-body p{margin:12px 0}.sheet-body ul{padding-left:23px}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:0.01ms!important;transition-duration:0.01ms!important}}
/* BG-Greedy-P1.04.6 — draw lifecycle, results and ranking, isolated to Greedy */
.result-bar[role="button"]{cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;touch-action:manipulation}.result-bar[role="button"]:focus-visible{outline:3px solid #fff;outline-offset:1px}
/* P1.05.00: result-board visual refinement only. Keep the existing board
   height, bottom anchor, 5s lifecycle and foreground/backdrop interactions. */
.sheet.result-sheet{position:relative;padding:0;background:#86dcfa;border-radius:12px 12px 0 0;max-height:min(76vh,550px);overflow:visible;animation:greedy-sheet-rise .26s ease-out}
.sheet.result-sheet .sheet-header{display:none}
.sheet.result-sheet .sheet-body{font-size:14px;line-height:1.5}
@keyframes greedy-sheet-rise{from{transform:translateY(16px)}to{transform:translateY(0)}}
.result-board{position:relative;padding:46px 15px 15px;background:#86dcfa;border-radius:12px 12px 0 0}
.party-decor{position:absolute;top:-5px;left:0;width:100%;height:87px;pointer-events:none;z-index:2;overflow:visible}
.result-close-time{position:absolute;right:13px;top:11px;color:#23405b;font-size:13px;z-index:3}
.featured-result{position:absolute;top:7px;left:50%;width:76px;height:76px;transform:translateX(-50%);background:repeating-linear-gradient(143deg,#c2efff 0 16px,#e1f7ff 16px 30px);border-radius:50%;display:grid;place-items:center;z-index:3;border:6px solid #fff}
.featured-result img{width:84%;height:84%;object-fit:contain;filter:drop-shadow(0 1px 1px #24577344)}
/* Existing outer/inner heights stay stable even with the footer caption gone. */
.result-card{background:#fff;border-radius:13px;padding:39px 15px 16px;min-height:278px;text-align:center;color:#131b24;box-shadow:none;box-sizing:border-box}
.result-lead{font-size:16px;display:flex;justify-content:center;align-items:center;gap:5px;white-space:nowrap;color:#101922}
.result-lead b{color:#f03b52;font-weight:500;font-variant-numeric:tabular-nums}
.outcome-duo{display:inline-flex;align-items:center;gap:4px;margin-left:3px}
.outcome-duo img{width:27px;height:27px;background:#c5ecfb;border-radius:50%;object-fit:contain;padding:2px}
.round-my-result{min-height:28px;font-weight:500;color:#0f1820;font-size:17px;margin:14px 0 17px!important}
.winner-divider{display:flex;align-items:center;gap:12px;color:#14202b;font-size:16px;justify-content:center;margin-bottom:12px;font-weight:500}
.winner-divider:before,.winner-divider:after{content:"";height:1px;flex:0 1 41px;background:#ddd}
.winner-row{display:flex;gap:10px;justify-content:space-around}
.winner-player{width:30%;display:flex;flex-direction:column;align-items:center;gap:2.5px;min-width:0;overflow:visible}
.winner-face{display:block;flex:none;width:52px;height:52px;border-radius:50%;background:#e5e8f1;position:relative;border:2px solid #fff;box-shadow:0 0 0 1px #d7dbe4;overflow:visible}
.winner-face img{width:100%;height:100%;display:block;border-radius:50%;object-fit:cover;object-position:center}
.winner-badge{position:absolute;right:-1px;bottom:-1px;width:19px;height:19px;border-radius:50%;background:#ffe60a;color:#0c344e;border:1.5px solid #093b55;font-size:11px;display:grid;place-items:center;font-family:Arial}
.winner-name{font-size:13px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#172532}
.winner-prize{display:flex;align-items:center;gap:4px;font-size:14px;white-space:nowrap;color:#121d28;font-variant-numeric:tabular-nums}
.winner-prize .tiny-gold{width:11px;height:11px}
@media(max-width:370px){.result-board{padding:40px 10px 12px}.result-card{padding:37px 7px 12px;min-height:278px}.result-lead{font-size:11px}.outcome-duo img{width:23px;height:23px}.winner-row{gap:4px}}
@media(prefers-reduced-motion:reduce){.sheet.result-sheet{animation:none}}

/* Chase: no eased CSS movement that could visually lag behind 40ms target steps. */
.wheel-section.is-drawing .food-unit .plate-rim,.wheel-section.is-drawing .food-unit .plate-lower{transition:none}
.wheel-section.is-drawing #pointerHand{transition:none}
/* BG-Greedy-P1.04.8: 30s to immediate chasing draw.
   Hide the hand during the entire fast spinning phase. No screen veil. */
.wheel-section.is-drawing #pointerHand{opacity:0!important;visibility:hidden!important}
/* BG-GREEDY-R1.01: native SVG transfer keeps the original sRGB brightness
   without relying on CSS brightness() support on SVG groups in WebKit. */
.wheel-section.is-drawing .food-unit{opacity:1;transition:none}
.wheel-section.is-drawing .food-unit.is-lit{filter:none}
.wheel-section.is-drawing .food-unit:not(.is-lit){filter:url(#greedy-food-dim)}

/* P1.04.13: 33–35s visibly HOLD the winning yellow-rimmed target.
   The other seven plates MUST stay dark: previously restoring all eight
   made the actual winning stop almost invisible. No second overlay ring. */
.wheel-section.is-drawing.is-winning-stop .food-unit:not(.is-lit){
  opacity:1!important;filter:url(#greedy-food-hold-dim)!important;transition:none!important;
}
.wheel-section.is-drawing.is-winning-stop .food-unit.is-lit{
  opacity:1!important;filter:none!important;transition:none!important;
}
/* Keep the hand hidden through result reveal; restore it next round. */
.wheel-section.is-result #pointerHand{opacity:0!important;visibility:hidden!important}

/* BG-Greedy-P1.04.23 — reference-fine visual finish only.
   Wheel geometry is uniformly scaled inside the SVG, so coin, hand, HOT,
   selected rim and clickable areas remain aligned. Keep all phase logic intact. */
.headbar .tool{border-width:.31cqw;box-shadow:inset 0 0 0 .5cqw #ffe967,0 .38cqw 0 #a89d43}
.headbar .tool.help{font-size:5.55cqw;font-weight:800;text-shadow:.11cqw .13cqw #78590f}
.headbar .issue{font-size:3.5cqw;font-weight:400}
.bet-panel{border-width:.46cqw}
.chip-box{border-width:.3cqw;box-shadow:0 .53cqw 0 #036788}
.coin{width:9.95cqw;height:9.95cqw;border-width:.37cqw;box-shadow:inset 0 0 0 .50cqw #ffdf33,inset 0 0 0 .80cqw #eaaa09,0 .29cqw 0 #614820;font-size:3.15cqw}
.settings{width:8.2cqw;height:8.2cqw;border-width:.39cqw;box-shadow:inset 0 0 0 .54cqw #ffef75,0 .35cqw 0 #694a17}
.stat>span{font-size:3.28cqw}.stat strong{font-size:3.25cqw}
.result-bar>span{font-size:3.0cqw}
.rank-copy{font-size:3.08cqw}.rank-copy strong{font-size:3.45cqw}


/* P1.04.35: slightly lower bottom sheet; isolate every rule to quickbet */
.sheet.quickbet-sheet{
 width:min(100%,662px); max-height:none; overflow:visible;
 background:#7fdbff; color:#12314a; padding:0;
 border-radius:18px 18px 0 0;
 box-shadow:none;
 animation:quickbet-rise .50s cubic-bezier(.2,.68,.2,1) both;
}
.sheet.quickbet-sheet .sheet-header{display:none}
.sheet.quickbet-sheet .sheet-body{padding:0;font-size:14px;line-height:1.35}
@keyframes quickbet-rise{
 from{transform:translateY(100%)}
 to{transform:translateY(0)}
}
/* Quick-bet exit: slide out before hiding the backdrop, no changes to other dialogs. */
.sheet.quickbet-sheet.is-closing{animation:quickbet-fall .30s cubic-bezier(.4,0,.85,.45) both;pointer-events:none}
@keyframes quickbet-fall{
 from{transform:translateY(0)}
 to{transform:translateY(100%)}
}
.sheet.quickbet-sheet .quickbet-wrap{position:relative;padding:72px 0 20px}
.sheet.quickbet-sheet .quickbet-top{
 position:absolute;left:0;right:0;top:-12px;
 height:64px;margin:0;padding:0;min-height:0;pointer-events:none;
}
.sheet.quickbet-sheet .qb-title{
 width:60%;max-width:353px;height:64px;margin:0 auto;
 display:flex;align-items:center;justify-content:center;
 background:#a8e4ff;border:2px solid #4440aa;
 border-radius:0 0 13px 13px;box-shadow:0 2px 0 #4951ae;
 padding:0;color:#142c83;font-size:23px;font-weight:700;
}
.sheet.quickbet-sheet .qb-close{
 position:absolute;right:22px;top:28px;width:29px;height:29px;
 padding:0;display:grid;place-items:center;
 background:#27bce8;border:2px solid #005b84;border-radius:50%;
 color:#09314a;font-weight:500;font-size:23px;line-height:1;
 pointer-events:auto;
}
.sheet.quickbet-sheet .qb-grid{
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
 column-gap:17px;row-gap:16px;
 width:74%;max-width:435px;padding:0;margin:0 auto;
}
.sheet.quickbet-sheet .qb-option{
 height:58px;min-width:0;padding:0 11px 0 13px;
 display:flex;align-items:center;gap:8px;
 background:#fff;border:2px solid #153048;
 border-radius:999px;box-shadow:none;
 color:#193449;font-size:20px;font-weight:500;line-height:1;
}
.sheet.quickbet-sheet .qb-option.is-active{background:#ff344e;color:#fff}
.sheet.quickbet-sheet .qb-option:active{transform:none;filter:brightness(.95)}
.sheet.quickbet-sheet .qb-value{flex:1;text-align:center;letter-spacing:0;font-weight:500}
.sheet.quickbet-sheet .qb-coin{
 flex:none;display:grid;place-items:center;
 width:38px;height:38px;border-radius:50%;
 background:radial-gradient(circle at 28% 24%,#fff87f 0,#ffed4c 30%,#ffd324 65%,#dd8b00 82%,#ae6a03 100%);
 border:2px solid #845000;
 box-shadow:inset 0 0 0 2px #ffdf33,inset 0 0 0 4px #eaaa09,0 2px 0 #614820;
 color:#402507;text-shadow:1px 1px #ffe57c;font-size:16px;line-height:1;
}
.sheet.quickbet-sheet .qb-option[data-qb-chip="1000"] .qb-coin,
.sheet.quickbet-sheet .qb-option[data-qb-chip="2000"] .qb-coin{font-size:11px}
.sheet.quickbet-sheet .qb-coin.is-wide{font-size:10px;font-weight:700;letter-spacing:0}
.sheet.quickbet-sheet .qb-hint{
 text-align:center;color:#ff4e71;font-size:16px;font-weight:400;
 line-height:18px;margin:16px 0 19px;
}
.sheet.quickbet-sheet .qb-confirm{
 width:224px;max-width:54%;height:60px;
 display:block;margin:0 auto;border:2px solid #102d44;
 border-radius:999px;box-shadow:0 4px 0 #a27300;
 background:#ffbf00;color:#172d37;font-size:20px;font-weight:500;
}
@media(max-width:520px){
 .sheet.quickbet-sheet .quickbet-wrap{padding:clamp(49px,12.7vw,67px) 0 16px}
 .sheet.quickbet-sheet .quickbet-top{top:-9px;height:clamp(48px,10.7vw,58px)}
 .sheet.quickbet-sheet .qb-title{height:100%;font-size:clamp(17px,3.75vw,20px)}
 .sheet.quickbet-sheet .qb-close{right:14px;top:18px;width:28px;height:28px}
 .sheet.quickbet-sheet .qb-grid{width:78%;gap:clamp(9px,2.7vw,13px) clamp(9px,2.7vw,14px)}
 .sheet.quickbet-sheet .qb-option{height:clamp(43px,10vw,53px);padding:0 8px;font-size:clamp(15px,3.6vw,18px)}
 .sheet.quickbet-sheet .qb-coin{width:clamp(28px,7vw,35px);height:clamp(28px,7vw,35px);font-size:clamp(12px,3.2vw,15px)}
 .sheet.quickbet-sheet .qb-hint{margin:9px 0 10px;font-size:13px}
 .sheet.quickbet-sheet .qb-confirm{height:clamp(44px,11vw,54px);font-size:18px}
}
@media(max-height:560px){
 .sheet.quickbet-sheet{max-height:94dvh;overflow-y:auto;overflow-x:hidden}
 .sheet.quickbet-sheet .quickbet-top{top:0}
}
@media(prefers-reduced-motion:reduce){.sheet.quickbet-sheet{animation:none}}

/* BG-Greedy-P1.04.39: keep all eight recent food icons inside the red draw strip.
   The old fixed 8.9cqw circles plus flex gaps exceeded the available width. */
.result-bar{overflow:hidden}
.result-bar .result-icons{
 display:grid;grid-template-columns:repeat(8,minmax(0,1fr));
 justify-content:initial;align-items:center;gap:.65cqw;min-width:0;flex:1;
}
.result-bar .result-icons .draw-item{
 width:100%;max-width:8.9cqw;height:auto;aspect-ratio:1;min-width:0;flex:none;
}

/* BG-Greedy-P1.04.40: visually center the tomato art in recent-draw circles only.
   The tomato PNG contains more transparent top padding than bottom padding.
   Keep the circle/grid/other food art unchanged. */
.result-bar .result-icons .draw-item img[src$="/tomato.png"]{transform:translateY(-.35cqw)}


/* P1.04.69: reference-style Greedy rules, same motion as quick-bet, isolated styling. */
.sheet.rules-sheet{
 width:min(100%,662px);height:clamp(330px,58dvh,690px);max-height:92dvh;
 padding:0;overflow:visible;background:#7fdbff;color:#123149;
 border-radius:18px 18px 0 0;box-shadow:none;
 animation:quickbet-rise .50s cubic-bezier(.2,.68,.2,1) both;
}
.sheet.rules-sheet .sheet-header{display:none}
.sheet.rules-sheet .sheet-body{height:100%;min-height:0;padding:0;line-height:1.55}
.sheet.rules-sheet.is-closing{animation:quickbet-fall .30s cubic-bezier(.4,0,.85,.45) both;pointer-events:none}
.sheet.rules-sheet .rules-wrap{position:relative;width:100%;height:100%;padding:74px 20px 20px}
.sheet.rules-sheet .rules-top{position:absolute;top:-9px;left:0;right:0;height:64px;pointer-events:none}
.sheet.rules-sheet .rules-title{
 display:flex;align-items:center;justify-content:center;
 width:60%;max-width:353px;height:64px;margin:auto;
 border:2px solid #101a98;border-radius:0 0 13px 13px;
 box-shadow:0 2px 0 #13269f;background:#91e0ff;
 color:#000063;font-size:23px;font-weight:700;
}
.sheet.rules-sheet .rules-close{
 position:absolute;top:28px;right:22px;display:grid;place-items:center;
 width:29px;height:29px;padding:0;border:2px solid #005b84;border-radius:50%;
 background:#27bce8;color:#09314a;font-size:23px;line-height:1;pointer-events:auto;
}
.sheet.rules-sheet .rules-content{
 height:100%;min-height:0;overflow-y:auto;overscroll-behavior:contain;
 padding:27px 23px 0;background:#fff;border-radius:17px;
 color:#0b2435;font-size:clamp(15px,3.06vw,16.5px);font-weight:500;line-height:1.4; -webkit-text-stroke:.15px currentColor;
 scrollbar-width:none;-ms-overflow-style:none;
}
.sheet.rules-sheet .rules-content::-webkit-scrollbar{display:none}
.sheet.rules-sheet .rules-list{list-style:decimal;margin:0;padding-left:23px}
.sheet.rules-sheet .rules-list li{padding-left:0;margin:0 0 14.5px}
.sheet.rules-sheet .rules-list li:last-child{margin-bottom:0}
@media(max-width:520px){
 .sheet.rules-sheet .rules-wrap{padding:clamp(52px,12.7vw,67px) 14px 14px}
 .sheet.rules-sheet .rules-top{top:-9px;height:clamp(48px,10.7vw,58px)}
 .sheet.rules-sheet .rules-title{height:100%;font-size:clamp(17px,3.75vw,20px)}
 .sheet.rules-sheet .rules-close{right:14px;top:18px;width:28px;height:28px}
 .sheet.rules-sheet .rules-content{padding:14px 16px 20px;font-size:clamp(13px,3.15vw,16px)}
 .sheet.rules-sheet .rules-list{padding-left:21px}
 .sheet.rules-sheet .rules-list li{margin-bottom:10px}
}
@media(prefers-reduced-motion:reduce){.sheet.rules-sheet{animation:none}}


/* P1.04.74: 10-member demonstration ranking; same motion as the rules sheet. */
.sheet.ranking-sheet{
 width:min(100%,662px);height:clamp(385px,48dvh,720px);max-height:94dvh;
 padding:0;overflow:visible;background:#7fdbff;color:#0a2b41;
 border-radius:18px 18px 0 0;box-shadow:none;
 animation:quickbet-rise .50s cubic-bezier(.2,.68,.2,1) both;
}
.sheet.ranking-sheet .sheet-header{display:none}
.sheet.ranking-sheet .sheet-body{height:100%;min-height:0;padding:0;line-height:1.35}
.sheet.ranking-sheet.is-closing{animation:quickbet-fall .30s cubic-bezier(.4,0,.85,.45) both;pointer-events:none}
.sheet.ranking-sheet .leader-wrap{position:relative;width:100%;height:100%;padding:73px 22px 0}
.sheet.ranking-sheet .leader-top{position:absolute;left:0;right:0;top:-9px;height:64px;pointer-events:none}
.sheet.ranking-sheet .leader-title{
 display:flex;align-items:center;justify-content:center;
 width:60%;max-width:353px;height:64px;margin:0 auto;
 border:2px solid #101a98;border-radius:0 0 13px 13px;
 background:#91e0ff;color:#000063;font-size:23px;font-weight:700;
}
.sheet.ranking-sheet .leader-close{
 position:absolute;top:28px;right:22px;display:grid;place-items:center;
 width:29px;height:29px;padding:0;border:2px solid #005b84;border-radius:50%;
 background:#27bce8;color:#09314a;font-size:23px;line-height:1;pointer-events:auto;
}
.sheet.ranking-sheet .leader-emblem{position:absolute;top:23px;left:23px;display:block;pointer-events:none}
.sheet.ranking-sheet .leader-emblem-image{display:block;width:66px;height:65px;object-fit:contain}
.sheet.ranking-sheet .leader-list{height:100%;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none;-ms-overflow-style:none;padding:0 0 10px}
.sheet.ranking-sheet .leader-list::-webkit-scrollbar{display:none}
.sheet.ranking-sheet .leader-row{display:flex;align-items:center;gap:11px;min-height:78px;margin-bottom:10px;padding:9px 16px;background:#fff;border:1px dashed #dbeaf0;border-radius:15px;color:#12334c}
.sheet.ranking-sheet .leader-row:last-child{margin-bottom:0}
.sheet.ranking-sheet .leader-place{position:relative;display:grid;place-items:center;flex:none;width:29px;height:29px;margin:0 1px 7px 0;color:#1c3a54;font-weight:500;font-size:19px}
.sheet.ranking-sheet .leader-place.place-1,.sheet.ranking-sheet .leader-place.place-2,.sheet.ranking-sheet .leader-place.place-3{border-radius:50%;font-size:16px;font-weight:700;z-index:0}
.sheet.ranking-sheet .leader-place.place-1{background:radial-gradient(circle at 31% 25%,#fff8a7,#ffd523 60%,#ffb900);color:#de7b00;box-shadow:0 0 0 2px #ffe173}
.sheet.ranking-sheet .leader-place.place-2{background:radial-gradient(circle at 31% 25%,#f7fbff,#c4d2dd 66%,#9eaebe);color:#78899a;box-shadow:0 0 0 2px #dce3ea}
.sheet.ranking-sheet .leader-place.place-3{background:radial-gradient(circle at 31% 25%,#ffdaa7,#ff995d 62%,#ee672e);color:#ea632a;box-shadow:0 0 0 2px #ffb78d}
.sheet.ranking-sheet .leader-place.place-1:after,.sheet.ranking-sheet .leader-place.place-2:after,.sheet.ranking-sheet .leader-place.place-3:after{content:"";position:absolute;top:24px;left:6px;z-index:-1;width:17px;height:15px;background:linear-gradient(100deg,#ffab28 48%,#ff762f 50%);clip-path:polygon(0 0,100% 0,100% 100%,50% 74%,0 100%)}
.sheet.ranking-sheet .leader-place.place-2:after{background:linear-gradient(100deg,#cdd8e2 48%,#8c9faf 50%)}
.sheet.ranking-sheet .leader-place.place-3:after{background:linear-gradient(100deg,#ffa462 48%,#ed743d 50%)}
.sheet.ranking-sheet .leader-avatar{display:grid;place-items:center;flex:none;width:43px;height:43px;border-radius:50%;color:#fff;font-size:17px;font-weight:600;background:radial-gradient(circle at 28% 20%,#7996cb,#143567 75%);border:2px solid #e2edfa;overflow:hidden}
.sheet.ranking-sheet .leader-avatar.avatar-1{background:radial-gradient(circle at 22% 22%,#949ca6,#32383e 75%)}
.sheet.ranking-sheet .leader-avatar.avatar-2{background:radial-gradient(circle at 20% 20%,#acb9c5,#0f2634 75%)}
.sheet.ranking-sheet .leader-avatar.avatar-3{background:radial-gradient(circle at 20% 20%,#9395a3,#22243e 75%)}
.sheet.ranking-sheet .leader-avatar.avatar-4{background:radial-gradient(circle at 20% 20%,#d67ebb,#5b277b 75%)}
.sheet.ranking-sheet .leader-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#15364b;font-size:17px;font-weight:500}
.sheet.ranking-sheet .leader-amount{display:flex;align-items:center;gap:7px;flex:none;margin-left:auto;color:#0e3045;font-size:18px;font-weight:500;white-space:nowrap;font-variant-numeric:tabular-nums}
.sheet.ranking-sheet .leader-amount .tiny-gold{width:16px;height:16px;flex:none}
@media(max-width:520px){
 .sheet.ranking-sheet .leader-wrap{padding:clamp(51px,12.7vw,66px) 14px 0}
 .sheet.ranking-sheet .leader-top{height:clamp(48px,10.7vw,58px)}
 .sheet.ranking-sheet .leader-title{height:100%;font-size:clamp(17px,3.6vw,20px)}
 .sheet.ranking-sheet .leader-close{top:18px;right:14px;width:28px;height:28px}
 .sheet.ranking-sheet .leader-emblem{top:15px;left:15px}
 .sheet.ranking-sheet .leader-emblem-image{width:clamp(46px,10vw,56px);height:auto}
 .sheet.ranking-sheet .leader-row{gap:clamp(5px,1.7vw,9px);padding:8px 10px;min-height:clamp(62px,15vw,75px);margin-bottom:9px}
 .sheet.ranking-sheet .leader-place{width:24px;height:24px;font-size:16px;margin-right:0}
 .sheet.ranking-sheet .leader-place.place-1,.sheet.ranking-sheet .leader-place.place-2,.sheet.ranking-sheet .leader-place.place-3{font-size:14px}
 .sheet.ranking-sheet .leader-place.place-1:after,.sheet.ranking-sheet .leader-place.place-2:after,.sheet.ranking-sheet .leader-place.place-3:after{top:21px;left:5px;width:14px;height:12px}
 .sheet.ranking-sheet .leader-avatar{width:clamp(30px,8.1vw,40px);height:clamp(30px,8.1vw,40px);font-size:clamp(12px,3.4vw,16px)}
 .sheet.ranking-sheet .leader-name{font-size:clamp(12px,3.35vw,16px)}
 .sheet.ranking-sheet .leader-amount{gap:4px;font-size:clamp(12px,3.35vw,16px)}
 .sheet.ranking-sheet .leader-amount .tiny-gold{width:12px;height:12px}
}
@media(prefers-reduced-motion:reduce){.sheet.ranking-sheet{animation:none}}

/* BG-Greedy-P1.04.58: in-game, full-screen results panel (no game navigation). */
.history-overlay{position:fixed;z-index:100;left:50%;top:0;width:100%;max-width:662px;height:100vh;height:100dvh;background:#fff17a;overflow:hidden;-webkit-transform:translate3d(-50%,100%,0);transform:translate3d(-50%,100%,0);-webkit-transition:-webkit-transform .28s cubic-bezier(.22,.72,.23,1);transition:transform .28s cubic-bezier(.22,.72,.23,1);-webkit-backface-visibility:hidden;backface-visibility:hidden;will-change:transform;box-shadow:0 0 18px #0a2c4412}
.history-overlay.is-open{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0);-webkit-transition-duration:.30s;transition-duration:.30s}
.history-overlay .history-frame{display:block;border:0;width:100%;height:100%;background:#fff17a}
@media(prefers-reduced-motion:reduce){.history-overlay{transition:none}}

/* P1.04.82: the four reference button artworks are a single transparent sprite,
   made from the user's supplied comparison image; native click targets are retained. */
.headbar .headnav{gap:2.05cqw}
.headbar .tool{
  display:block;flex:none;appearance:none;-webkit-appearance:none;
  width:8.24cqw;height:8.25cqw;padding:0;border:0;border-radius:0;
  background-color:transparent;
  background-image:url('./assets/header-reference-p1.04.82.png');
  background-repeat:no-repeat;
  background-size:400% 100%;
  background-position:0% 0%;
  box-shadow:none;line-height:normal;
}
.headbar .tool:nth-child(2){background-position:33.333333% 0%}
.headbar .tool:nth-child(3){background-position:66.666667% 0%}
.headbar .tool:nth-child(4){background-position:100% 0%}

/* BG-Greedy-P1.04.83: independent startup screen; no changes to the running game. */
.greedy-splash{position:fixed;inset:0;left:50%;right:auto;transform:translateX(-50%);width:100%;max-width:662px;height:100vh;height:100dvh;z-index:220;isolation:isolate;overflow:hidden;background-color:#f2f5fa;background-image:radial-gradient(circle,#ffd933 clamp(1.45px,.37vw,2.2px),transparent clamp(1.85px,.45vw,2.65px)),linear-gradient(#ffea69,#ffea69);background-size:clamp(12px,3.08vw,18px) clamp(12px,3.08vw,18px),100% 100%;background-position:-3px 7px,0 0;opacity:1;visibility:visible;transition:opacity .36s ease,visibility .36s ease;touch-action:none;user-select:none;-webkit-user-select:none}
.greedy-splash::before{content:"";position:absolute;top:0;left:0;right:0;height:var(--greedy-safe-top);background:#f2f5fa;pointer-events:none;z-index:5}
.greedy-splash.splash-done{opacity:0;visibility:hidden;pointer-events:none}
.greedy-splash .splash-stage{position:absolute;top:47.1%;left:50%;width:100%;height:clamp(230px,44vh,465px);transform:translate(-50%,-50%);pointer-events:none}
.greedy-splash .splash-logo{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:clamp(165px,41%,245px);height:auto;object-fit:contain;z-index:2;pointer-events:none}
.greedy-splash .splash-food{position:absolute;display:block;width:clamp(32px,8%,57px);height:auto;object-fit:contain;filter:drop-shadow(1px 2px 1px #0d2c3a35);animation:splash-float 3.2s ease-in-out infinite alternate}
.greedy-splash .sf-carrot{left:-1%;top:5%;transform:rotate(-27deg)}
.greedy-splash .sf-lettuce{left:19%;top:9%;animation-delay:-.9s;width:clamp(32px,7%,50px)}
.greedy-splash .sf-skewer{right:14%;top:12%;animation-delay:-1.5s;transform:rotate(25deg)}
.greedy-splash .sf-steak{right:-2%;top:5%;animation-delay:-1.1s}
.greedy-splash .splash-confetti{position:absolute;display:block;width:13px;height:17px;border:2px solid #995c2e;background:#ee5880;clip-path:polygon(0 0,100% 43%,23% 100%);opacity:.95}
.greedy-splash .sc-1{left:-2%;top:41%;transform:rotate(37deg);background:#ff6d3d}
.greedy-splash .sc-2{left:20%;top:54%;transform:rotate(62deg);background:#e8b84e}
.greedy-splash .sc-3{right:24%;top:40%;transform:rotate(13deg);background:#ff647e}
.greedy-splash .sc-4{right:1%;top:48%;transform:rotate(4deg);background:#ff5b84}
.greedy-splash .sc-5{right:13%;top:52%;transform:rotate(70deg);background:#ffc046}
.greedy-splash .sc-6{left:31%;top:53%;transform:rotate(-40deg);background:#348cf2}
.greedy-splash .splash-ribbon{position:absolute;display:block;width:48px;height:70px;border-left:6px solid #2764e8;border-radius:45% 55% 50% 36%;transform:rotate(22deg) skewX(7deg);filter:drop-shadow(1px 1px 0 #122d4e)}
.greedy-splash .sr-left{left:22%;top:30%;transform:rotate(-25deg) skewX(10deg)}
.greedy-splash .sr-right{right:0%;top:54%;transform:rotate(65deg) skewX(7deg);border-color:#337cea}
.greedy-splash .sr-orange{left:1%;top:56%;transform:rotate(62deg);border-color:#ec8b17;width:52px}
.greedy-splash .sr-yellow{right:2%;top:30%;transform:rotate(22deg);border-color:#e1b909;width:19px;height:30px;border-width:4px}
.greedy-splash .splash-gem{position:absolute;font-size:23px;line-height:1;color:#fffdf1;-webkit-text-stroke:2px #b48b13;text-shadow:1px 2px 0 #674e17;transform:rotate(-25deg)}
.greedy-splash .sg-left{left:8%;top:24%}
.greedy-splash .sg-right{right:4%;bottom:5%;transform:rotate(27deg)}
.greedy-splash .splash-progress-area{position:absolute;left:50%;top:65.2%;transform:translateX(-50%);width:65.5%;max-width:385px;display:flex;flex-direction:column;align-items:center;gap:23px;z-index:4}
.greedy-splash .splash-progress-track{width:100%;height:clamp(19px,4.6vw,27px);background:#002c47;border:2px solid #004a7b;border-radius:999px;overflow:hidden}
.greedy-splash .splash-progress-fill{display:block;width:100%;height:100%;transform:scaleX(0);transform-origin:left center;background:#00aadd;border-radius:999px;will-change:transform;box-shadow:inset 0 1px 2px #8fe8fa}
.greedy-splash .splash-loading-label{color:#111;font-size:clamp(18px,3.5vw,22px);line-height:1.3;font-weight:400}
@keyframes splash-float{from{translate:0 0}to{translate:0 -8px}}
@media(max-height:670px){.greedy-splash .splash-stage{top:44%;height:50vh}.greedy-splash .splash-progress-area{top:73%;gap:10px}.greedy-splash .splash-progress-track{height:22px}}
@media(prefers-reduced-motion:reduce){.greedy-splash .splash-food{animation:none}.greedy-splash{transition:none}}

/* Empty patterned footer must flex to remaining screen, never create page overflow. */
.dotted-after{min-height:0;flex:1 1 auto}
/* Keep the interactive bottom-sheet controls out of the PWA gesture area. */
.sheet.quickbet-sheet .quickbet-wrap{padding-bottom:calc(20px + var(--greedy-safe-bottom))}
.sheet.rules-sheet .rules-wrap{padding-bottom:calc(20px + var(--greedy-safe-bottom))}
.sheet.ranking-sheet .leader-list{padding-bottom:calc(10px + var(--greedy-safe-bottom))}
/* Standalone PWA: keep the results iframe clear of system status/gesture areas. */
@supports(height:100dvh){.history-overlay{top:var(--greedy-safe-top);height:var(--greedy-usable-height)}}

/* P1.04.87: keep viewport clipping without fixing the BODY itself.
   On iOS WebKit, a fixed overflow-hidden root can suppress bottom-sheet animation paint.
   These standalone sheets live directly below BODY, not within scaled game-shell. */
.shade{isolation:isolate}
.sheet.quickbet-sheet,.sheet.rules-sheet,.sheet.ranking-sheet{will-change:transform;-webkit-backface-visibility:hidden;backface-visibility:hidden}

/* Restore only the explicitly requested panel slides when iOS reports reduced
   motion; leave the rest of the existing reduced-motion game behavior alone. */
@media(prefers-reduced-motion:reduce){
 html.greedy-ios-webkit .sheet.quickbet-sheet,
 html.greedy-ios-webkit .sheet.rules-sheet,
 html.greedy-ios-webkit .sheet.ranking-sheet{
  animation-name:quickbet-rise!important;
  animation-duration:.50s!important;
  animation-timing-function:cubic-bezier(.2,.68,.2,1)!important;
  animation-fill-mode:both!important;
 }
 html.greedy-ios-webkit .sheet.quickbet-sheet.is-closing,
 html.greedy-ios-webkit .sheet.rules-sheet.is-closing,
 html.greedy-ios-webkit .sheet.ranking-sheet.is-closing{
  animation-name:quickbet-fall!important;
  animation-duration:.30s!important;
  animation-timing-function:cubic-bezier(.4,0,.85,.45)!important;
 }
 html.greedy-ios-webkit .history-overlay{
  -webkit-transition:-webkit-transform .28s cubic-bezier(.22,.72,.23,1)!important;
  transition:transform .28s cubic-bezier(.22,.72,.23,1)!important;
 }
 html.greedy-ios-webkit .history-overlay.is-open{-webkit-transition-duration:.30s!important;transition-duration:.30s!important}
}
/* BG-MOTION-R1.01: keep the starting state after the motion preference rules,
   so the entry animation begins only when its start class is removed. */
html.greedy-ios-webkit .sheet.greedy-ios-start{
 -webkit-animation:none!important;animation:none!important;
 -webkit-transform:translate3d(0,100%,0)!important;transform:translate3d(0,100%,0)!important;
}

/* P1.04.93: iOS standalone WebKit scroll-edge blur guard.
   A tiny opaque surface at the physical viewport top lets iOS sample the
   white status-area color without blurring the yellow in-game header.
   No layout space, scrolling, hit targets, or game timing is changed. */
@media (display-mode: standalone){
  html.greedy-ios-webkit body::before{
    content:"";
    position:fixed;
    top:0;
    left:0;
    right:0;
    height:8px;
    background-color:#f2f5fa;
    z-index:225;
    pointer-events:none;
  }
}

/* P1.05.09: local demo roster avatar display only; existing popup dimensions unchanged. */
.winner-face .demo-avatar-fallback,.sheet.ranking-sheet .leader-avatar .demo-avatar-fallback{position:absolute;inset:0;display:grid;place-items:center;font-size:18px;font-weight:600;color:#fff;background:linear-gradient(140deg,#407fc4,#35516f);border-radius:50%}
.winner-face .demo-avatar-image,.sheet.ranking-sheet .leader-avatar .demo-avatar-image{position:absolute;inset:0;width:100%;height:100%;border-radius:50%;object-fit:cover;display:block}
.sheet.ranking-sheet .leader-avatar{position:relative}
.sheet.ranking-sheet .leader-title{gap:5px}
@media(max-width:520px){.sheet.ranking-sheet .leader-title{gap:3px}}
