:root{
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --ink:#4a2e12; --ink2:#7a5531; --cream:#fff8e6; --cream2:#ffefc8; --honey:#ffb627; --honey2:#f08c00; --line:#e9cf96;
  --jelly:#b45cff; --good:#3fbf62; --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;background:#8fd3f4;font-family:var(--font);color:var(--ink);
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;overscroll-behavior:none;touch-action:manipulation}
button{font-family:inherit;color:inherit;border:0;background:none;padding:0;cursor:pointer}
.hidden{display:none!important}
#app{position:fixed;inset:0;overflow:hidden}
#scene{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}
#app.shake{animation:shake .5s}
@keyframes shake{10%,90%{transform:translate(-2px,1px)}20%,80%{transform:translate(4px,-2px)}30%,50%,70%{transform:translate(-6px,2px)}40%,60%{transform:translate(6px,-1px)}}

/* HUD */
#hud{position:absolute;left:0;right:0;top:0;padding:calc(var(--sat) + 8px) 12px 0;pointer-events:none;z-index:5}
#hud button{pointer-events:auto}
.hud-row{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}
.honey-badge{display:flex;align-items:center;gap:8px;background:rgba(255,248,230,.92);border:2px solid #fff;border-radius:18px;padding:5px 10px 5px 6px;
  box-shadow:0 3px 0 rgba(120,80,20,.25),0 6px 16px rgba(60,40,10,.15);max-width:62%}
.honey-badge.ready{animation:wiggle 1.2s infinite}
@keyframes wiggle{0%,60%,100%{transform:rotate(0)}70%{transform:rotate(-4deg)}80%{transform:rotate(4deg)}90%{transform:rotate(-2deg)}}
.jar{width:30px;height:34px;flex:none;background-size:contain;background-repeat:no-repeat;background-position:center}
.hb-text{display:flex;flex-direction:column;gap:3px;min-width:0;text-align:left}
.hb-text b{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hb-bar{display:block;width:118px;height:7px;border-radius:5px;background:#f0dfb5;overflow:hidden}
.hb-bar i{display:block;height:100%;width:0;background:linear-gradient(90deg,#ffcf3f,#ff9d00);border-radius:5px;transition:width .3s}
.pills{display:flex;gap:6px}
.pill{display:flex;align-items:center;gap:4px;white-space:nowrap;height:32px;padding:0 10px;border-radius:16px;background:rgba(255,248,230,.92);border:2px solid #fff;font-weight:800;font-size:14px;
  box-shadow:0 3px 0 rgba(120,80,20,.25)}
.pill.jelly{color:#7b2fc0}.pill small{font-size:11px;color:#3fbf62;font-weight:900}.pill.menu{width:34px;justify-content:center;padding:0;font-size:16px}
.cash-wrap{display:flex;flex-direction:column;align-items:center;margin-top:6px;text-shadow:0 2px 0 rgba(255,255,255,.6)}
.cash{display:flex;align-items:center;gap:8px;font-size:38px;font-weight:900;letter-spacing:-.5px;color:#3b2408;
  text-shadow:0 2px 0 #fff,0 0 12px rgba(255,255,255,.8)}
.cash.bump{animation:bump .25s}
@keyframes bump{50%{transform:scale(1.08)}}
.coin{width:28px;height:28px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff3b0,#ffc21a 45%,#d98a00);box-shadow:inset 0 -2px 0 rgba(0,0,0,.15),0 2px 0 #b06b00;position:relative}
.coin::after{content:"";position:absolute;inset:7px;clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);background:rgba(160,90,0,.45)}
.rate{font-size:15px;font-weight:800;color:#5a3a14;margin-top:-2px}
.flight{display:flex;align-items:center;gap:6px;margin-top:5px;background:rgba(255,248,230,.85);border-radius:12px;padding:3px 9px;font-size:12px;font-weight:900;transition:transform .15s}
.flight.hot{transform:scale(1.08);background:#fff3c4}
.fl-bar{width:70px;height:6px;border-radius:4px;background:#ecd9ab;overflow:hidden}
.fl-bar i{display:block;height:100%;width:0;background:linear-gradient(90deg,#7ed957,#ffd13b,#ff7a1a);transition:width .12s}
.boosts{display:flex;gap:6px;margin-top:5px}
.boost-chip{font-size:11px;font-weight:900;padding:3px 8px;border-radius:10px;background:#fff;color:#a2550a;box-shadow:0 2px 0 rgba(0,0,0,.12)}
.boost-chip.frenzy{background:linear-gradient(90deg,#ffe46b,#ffb02e);color:#5b2b00;animation:pulse .6s infinite alternate}
@keyframes pulse{to{transform:scale(1.07)}}
.upgrade-banner{position:absolute;left:50%;top:calc(var(--sat) + 178px);transform:translateX(-50%);display:flex;align-items:center;gap:10px;
  background:linear-gradient(180deg,#fff7d1,#ffd65a);border:3px solid #fff;border-radius:20px;padding:7px 12px 7px 8px;box-shadow:0 4px 0 #c98200,0 10px 24px rgba(160,90,0,.35);
  animation:bannerIn .5s cubic-bezier(.2,1.6,.4,1), glow 1.4s infinite alternate;white-space:nowrap}
.upgrade-banner b{display:block;font-size:14px}.upgrade-banner small{font-size:12px;font-weight:700;color:var(--ink2)}
.upgrade-banner span{text-align:left}
.ub-jar{width:30px;height:34px;background-size:contain;background-repeat:no-repeat}
.ub-go{background:#ff8a00;color:#fff;font-weight:900;font-size:13px;padding:6px 10px;border-radius:12px;box-shadow:0 2px 0 #b35c00}
@keyframes bannerIn{from{transform:translateX(-50%) scale(.3);opacity:0}}
@keyframes glow{to{box-shadow:0 4px 0 #c98200,0 0 34px rgba(255,190,40,.9)}}

/* bottom controls */
#controls{position:absolute;left:0;right:0;bottom:0;padding:0 10px calc(var(--sab) + 10px);display:flex;align-items:flex-end;justify-content:space-between;z-index:5;pointer-events:none}
#controls button{pointer-events:auto}
.side{display:flex;flex-direction:column;gap:10px;width:76px;align-items:center}
.round{position:relative;width:62px;height:62px;border-radius:50%;background:radial-gradient(circle at 50% 30%,#fffdf3,#ffeab5);border:3px solid #fff;
  box-shadow:0 4px 0 #d3a54d,0 8px 16px rgba(90,60,10,.25);display:flex;flex-direction:column;align-items:center;justify-content:center;transition:transform .08s}
.round:active{transform:translateY(3px) scale(.96);box-shadow:0 1px 0 #d3a54d}
.ri{font-size:24px;line-height:1}.rl{font-size:10px;font-weight:900;margin-top:1px}
.dot{position:absolute;top:-2px;right:-2px;width:16px;height:16px;border-radius:50%;background:#ff4d4d;border:2px solid #fff;animation:pulse .7s infinite alternate}
.hatch-wrap{display:flex;flex-direction:column;align-items:center;gap:6px;margin-bottom:2px}
#hatch{position:relative;width:132px;height:132px;border-radius:50%;touch-action:none;transition:transform .08s}
#hatch .tank{position:absolute;inset:-6px;width:144px;height:144px;transform:rotate(-90deg)}
.tank-bg{fill:none;stroke:rgba(255,255,255,.55);stroke-width:7}
.tank-fg{fill:none;stroke:#5fd35a;stroke-width:7;stroke-linecap:round;stroke-dasharray:345.6;stroke-dashoffset:0;transition:stroke .3s}
.tank-fg.low{stroke:#ff5a3c}
.hatch-face{position:absolute;inset:6px;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;
  background:radial-gradient(circle at 50% 28%,#fff1a8 0%,#ffc531 38%,#ff9800 75%,#e07000 100%);border:4px solid #fff;
  box-shadow:0 7px 0 #b85a00,0 12px 26px rgba(150,70,0,.45),inset 0 -8px 14px rgba(170,70,0,.35),inset 0 6px 10px rgba(255,255,255,.6)}
.hatch-face::before{content:"";position:absolute;inset:10px;border-radius:50%;opacity:.25;
  background-image:radial-gradient(circle,transparent 55%,rgba(150,70,0,.8) 57%,transparent 62%);background-size:22px 19px}
.hatch-bee{width:56px;height:46px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 46'%3E%3Cellipse cx='20' cy='12' rx='11' ry='8' fill='%23fff' opacity='.9' transform='rotate(-25 20 12)'/%3E%3Cellipse cx='34' cy='11' rx='10' ry='7' fill='%23fff' opacity='.8' transform='rotate(20 34 11)'/%3E%3Cellipse cx='28' cy='28' rx='19' ry='14' fill='%23ffd23a' stroke='%234a2e12' stroke-width='3'/%3E%3Cpath d='M22 15 Q19 28 22 41 M32 15 Q35 28 32 41' stroke='%234a2e12' stroke-width='5' fill='none'/%3E%3Ccircle cx='42' cy='25' r='2.5' fill='%234a2e12'/%3E%3C/svg%3E") center/contain no-repeat;position:relative}
.hatch-lbl{font-weight:900;font-size:15px;color:#fff;letter-spacing:1px;text-shadow:0 2px 0 #b35a00;position:relative}
#hatch.holding{transform:scale(.93)}
#hatch.holding .hatch-face{box-shadow:0 3px 0 #b85a00,0 0 30px rgba(255,200,40,.9),inset 0 -8px 14px rgba(170,70,0,.35)}
#hatch.empty .hatch-face{filter:saturate(.4) brightness(.95)}
.hatch-sub{font-size:12px;font-weight:900;background:rgba(255,248,230,.9);padding:3px 10px;border-radius:10px;box-shadow:0 2px 0 rgba(120,80,20,.2)}
.hatch-sub.full{background:#ffdddd;color:#b4231b}

/* pops */
#pops{position:absolute;inset:0;pointer-events:none;z-index:6}
.pop{position:absolute;font-weight:900;font-size:18px;color:#fff;text-shadow:0 2px 0 #a35b00,0 0 6px rgba(0,0,0,.25);animation:popUp 1.2s ease-out forwards;white-space:nowrap;transform:translate(-50%,-50%)}
.pop.big{font-size:26px}.pop.pollen{color:#fff6b3}
@keyframes popUp{0%{opacity:0;transform:translate(-50%,-30%) scale(.6)}15%{opacity:1;transform:translate(-50%,-60%) scale(1.15)}100%{opacity:0;transform:translate(-50%,-200%) scale(1)}}
.hint{position:absolute;left:50%;bottom:calc(var(--sab) + 196px);transform:translateX(-50%);background:#fff;padding:8px 14px;border-radius:14px;font-weight:900;font-size:14px;
  box-shadow:0 4px 0 rgba(0,0,0,.12);animation:float 1.2s ease-in-out infinite alternate;z-index:6;white-space:nowrap}
.hint::after{content:"";position:absolute;left:50%;bottom:-8px;margin-left:-8px;border:8px solid transparent;border-top-color:#fff;border-bottom:0}
@keyframes float{to{transform:translate(-50%,-6px)}}

/* sheet */
.shade{position:absolute;inset:0;background:rgba(40,25,5,.25);opacity:0;pointer-events:none;transition:opacity .25s;z-index:8}
.shade.on{opacity:1;pointer-events:auto}
.sheet{position:absolute;left:0;right:0;bottom:0;height:min(68%,620px);background:var(--cream);border-radius:26px 26px 0 0;z-index:9;transform:translateY(105%);
  transition:transform .32s cubic-bezier(.2,1.1,.3,1);box-shadow:0 -8px 30px rgba(60,40,10,.25);display:flex;flex-direction:column;border-top:3px solid #fff}
.sheet.open{transform:translateY(0)}
.sheet-grab{width:44px;height:5px;border-radius:3px;background:#e2c992;margin:8px auto 2px}
.sheet-head{display:flex;align-items:center;gap:10px;padding:4px 16px 8px}
.sheet-head h2{margin:0;font-size:22px;font-weight:900;flex:1}
.sheet-cash{font-weight:900;font-size:15px;background:#fff;border-radius:12px;padding:4px 10px;box-shadow:0 2px 0 var(--line)}
#sheetClose{width:34px;height:34px;border-radius:50%;background:#f3e1b5;font-weight:900;font-size:15px}
.sheet-body{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:2px 14px calc(var(--sab) + 20px)}
.sec{font-size:12px;font-weight:900;letter-spacing:.8px;text-transform:uppercase;color:var(--ink2);margin:14px 4px 8px;display:flex;justify-content:space-between}
.card{display:flex;align-items:center;gap:12px;background:#fff;border-radius:18px;padding:10px 10px 10px 10px;margin-bottom:9px;box-shadow:0 3px 0 var(--line)}
.card.locked{opacity:.55;filter:grayscale(.7)}
.card .thumb{width:62px;height:56px;flex:none;background-size:contain;background-position:center bottom;background-repeat:no-repeat;border-radius:12px;background-color:#f4fbe9}
.card .ico{width:46px;height:46px;flex:none;border-radius:14px;background:#fff3cf;display:flex;align-items:center;justify-content:center;font-size:24px}
.card .info{flex:1;min-width:0}
.card .t{font-weight:900;font-size:15px}
.card .d{font-size:12px;color:var(--ink2);font-weight:700;margin-top:2px}
.pips{display:flex;gap:2px;margin-top:5px}.pips i{flex:1;height:5px;border-radius:3px;background:#f0e2bf;max-width:14px}.pips i.on{background:#ffae1a}
.buy{min-width:84px;padding:9px 8px;border-radius:14px;background:linear-gradient(180deg,#7fe071,#3fbf62);color:#fff;font-weight:900;font-size:14px;
  box-shadow:0 3px 0 #2a8f45;text-shadow:0 1px 0 rgba(0,0,0,.2);display:flex;flex-direction:column;align-items:center;line-height:1.1}
.buy small{font-size:10px;opacity:.9}
.buy:active{transform:translateY(2px);box-shadow:0 1px 0 #2a8f45}
.buy.no{background:#e9dcc0;color:#a48a5e;box-shadow:0 3px 0 #d4c19c;text-shadow:none}
.buy.max{background:#f6e7c1;color:#b08a3c;box-shadow:none}
.buy.gold{background:linear-gradient(180deg,#ffd75e,#ff9d00);box-shadow:0 3px 0 #c06a00}
.buy.purple{background:linear-gradient(180deg,#d38cff,#9a3df0);box-shadow:0 3px 0 #6a1fb0}
.tierlock{font-size:12px;font-weight:800;color:#a2804a;background:#fbefcf;border-radius:12px;padding:8px 12px;margin-bottom:9px;text-align:center}
.bigstat{background:#fff;border-radius:20px;padding:14px;text-align:center;box-shadow:0 3px 0 var(--line);margin-top:4px}
.bigstat .n{font-size:34px;font-weight:900;color:#7b2fc0}
.bigstat .l{font-size:13px;font-weight:800;color:var(--ink2)}
.rebirth-btn{width:100%;margin-top:12px;padding:14px;border-radius:18px;font-size:18px;font-weight:900;color:#fff;background:linear-gradient(180deg,#d38cff,#8d2ee8);box-shadow:0 5px 0 #5c1aa0}
.rebirth-btn.no{background:#e3d6ee;color:#9a86ad;box-shadow:0 5px 0 #c9b8d8}
.note{font-size:12px;color:var(--ink2);font-weight:700;text-align:center;margin:8px 6px}
.ms{display:flex;gap:10px;align-items:center;background:#fff;border-radius:14px;padding:9px 12px;margin-bottom:7px;box-shadow:0 2px 0 var(--line)}
.ms .b{width:34px;height:34px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;font-weight:900;font-size:13px;background:#efe3f7;color:#8a55b5}
.ms.done .b{background:linear-gradient(180deg,#d38cff,#9a3df0);color:#fff}
.ms .t{font-weight:900;font-size:14px}.ms .d{font-size:12px;color:var(--ink2);font-weight:700}
.teasers{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.teaser{border-radius:18px;padding:12px;min-height:104px;color:#fff;position:relative;overflow:hidden;box-shadow:0 3px 0 rgba(0,0,0,.12)}
.teaser .lk{position:absolute;top:8px;right:10px;font-size:16px}
.teaser .ti{font-size:26px}.teaser .tn{font-weight:900;font-size:15px;margin-top:4px}.teaser .td{font-size:11px;font-weight:700;opacity:.9;margin-top:2px}
.ladder{display:flex;flex-direction:column;gap:7px}
.lrow{display:flex;align-items:center;gap:10px;background:#fff;border-radius:14px;padding:7px 10px;box-shadow:0 2px 0 var(--line)}
.lrow.cur{outline:3px solid #ffb627}.lrow.lock{opacity:.5}
.lrow .jar{width:26px;height:30px}.lrow .nm{flex:1;font-weight:900;font-size:14px}.lrow .vl{font-weight:800;font-size:12px;color:var(--ink2)}

/* modal */
.modal{position:absolute;inset:0;background:rgba(40,25,5,.45);z-index:20;display:flex;align-items:center;justify-content:center;padding:24px}
.modal-card{background:var(--cream);border-radius:26px;padding:22px 18px 16px;width:100%;max-width:360px;text-align:center;border:3px solid #fff;box-shadow:0 10px 40px rgba(0,0,0,.3);animation:bannerIn2 .35s cubic-bezier(.2,1.5,.4,1)}
@keyframes bannerIn2{from{transform:scale(.6);opacity:0}}
.modal-card h3{margin:0 0 6px;font-size:22px;font-weight:900}
.modal-card p{margin:6px 0;font-size:14px;font-weight:700;color:var(--ink2)}
.modal-card .row{display:flex;gap:10px;margin-top:14px}
.modal-card .row button{flex:1;padding:12px;border-radius:16px;font-weight:900;font-size:16px;background:#efe0bb;box-shadow:0 3px 0 #d6c092}
.modal-card .row button.go{background:linear-gradient(180deg,#7fe071,#3fbf62);color:#fff;box-shadow:0 3px 0 #2a8f45}
.modal-card .row button.gold{background:linear-gradient(180deg,#ffd75e,#ff9d00);color:#fff;box-shadow:0 3px 0 #c06a00}
.modal-card .row button.purple{background:linear-gradient(180deg,#d38cff,#9a3df0);color:#fff;box-shadow:0 3px 0 #6a1fb0}
.modal-card .big{font-size:30px;font-weight:900;color:#3b2408;margin:6px 0}
.setrow{display:flex;justify-content:space-between;align-items:center;background:#fff;border-radius:14px;padding:11px 14px;margin-bottom:8px;font-weight:800;font-size:14px;box-shadow:0 2px 0 var(--line)}
.setrow button{padding:6px 12px;border-radius:10px;background:#f3e1b5;font-weight:900}
.setrow button.danger{background:#ffd9d4;color:#b4231b}

/* celebration */
.celebrate{position:absolute;inset:0;z-index:30;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;background:rgba(30,18,4,.55)}
.celebrate .rays{position:absolute;width:220vmax;height:220vmax;left:50%;top:44%;margin:-110vmax 0 0 -110vmax;animation:spin 14s linear infinite;opacity:.55}
@keyframes spin{to{transform:rotate(360deg)}}
.celebrate .bigjar{width:150px;height:170px;background-size:contain;background-repeat:no-repeat;background-position:center;position:relative;animation:jarDrop .9s cubic-bezier(.3,1.6,.5,1) both;filter:drop-shadow(0 12px 20px rgba(0,0,0,.35))}
@keyframes jarDrop{0%{transform:translateY(-80vh) rotate(-30deg) scale(.6)}70%{transform:translateY(0) rotate(6deg) scale(1.08)}100%{transform:none}}
.celebrate .kick{position:relative;color:#fff;font-weight:900;font-size:16px;letter-spacing:3px;text-transform:uppercase;margin-top:18px;animation:fadeUp .5s .5s both;text-shadow:0 2px 0 rgba(0,0,0,.3)}
.celebrate .title{position:relative;color:#fff;font-weight:900;font-size:36px;text-align:center;line-height:1.05;animation:fadeUp .5s .65s both;text-shadow:0 3px 0 rgba(0,0,0,.3);padding:0 20px}
.celebrate .sub{position:relative;color:#fff7d6;font-weight:800;font-size:15px;margin-top:8px;text-align:center;animation:fadeUp .5s .8s both;padding:0 30px}
.celebrate .mult{position:relative;margin-top:14px;font-size:22px;font-weight:900;color:#3b2408;background:#fff;border-radius:16px;padding:6px 16px;animation:fadeUp .5s .95s both, pulse .7s 1.5s infinite alternate}
.celebrate button{position:relative;margin-top:26px;padding:14px 34px;border-radius:20px;font-size:18px;font-weight:900;color:#fff;background:linear-gradient(180deg,#7fe071,#3fbf62);box-shadow:0 5px 0 #2a8f45;animation:fadeUp .5s 1.1s both}
@keyframes fadeUp{from{opacity:0;transform:translateY(20px)}}
.confetti{position:absolute;top:-20px;width:14px;height:12px;clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);animation:fall linear forwards}
@keyframes fall{to{transform:translateY(110vh) rotate(720deg)}}

#toasts{position:absolute;left:0;right:0;top:calc(var(--sat) + 246px);display:flex;flex-direction:column;align-items:center;gap:6px;z-index:25;pointer-events:none}
.toast{background:#fff;padding:9px 16px;border-radius:16px;font-weight:900;font-size:14px;box-shadow:0 4px 0 rgba(0,0,0,.12),0 8px 20px rgba(0,0,0,.15);animation:toast 2.6s forwards}
@keyframes toast{0%{opacity:0;transform:translateY(-10px) scale(.9)}10%{opacity:1;transform:none}85%{opacity:1}100%{opacity:0;transform:translateY(-10px)}}
@media (max-height:700px){ #hatch{width:112px;height:112px} #hatch .tank{width:124px;height:124px} .round{width:54px;height:54px} .cash{font-size:32px} }
