:root{--ink:#27304f;--card:#fff8ec;--edge:#e5c79a;--gold:#ffc93c;--blue:#39a7f2}*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;height:100%;overflow:hidden;background:#79c8f5;user-select:none;-webkit-user-select:none;touch-action:none;font-family:ui-rounded,SF Pro Rounded,Arial Rounded MT Bold,Nunito,system-ui,sans-serif;color:var(--ink)}#game{position:fixed;inset:0;width:100%;height:100%;outline:none;display:block}#hud{position:fixed;top:max(10px,env(safe-area-inset-top));left:12px;right:12px;display:flex;align-items:center;gap:10px;pointer-events:none}.spacer{flex:1}.pill{height:50px;min-width:50px;padding:0 16px;display:flex;align-items:center;gap:8px;background:linear-gradient(#fffdf7,#fbeed6);border:0;border-radius:18px;box-shadow:0 4px 0 var(--edge),0 7px 14px #1b2a5a33;font:800 22px inherit;font-family:inherit;color:var(--ink);pointer-events:auto;transition:transform .08s}button.pill{cursor:pointer}button.pill:active{transform:translateY(3px);box-shadow:0 1px 0 var(--edge),0 3px 8px #1b2a5a33}.pill svg{width:24px;height:24px;fill:currentColor}#scoreBox svg{fill:var(--gold);stroke:#c98a14;stroke-width:1}.pill.next{padding:2px 6px;background:linear-gradient(#e8f6ff,#cfe9fb);box-shadow:0 4px #9cc9e8,0 7px 14px #1b2a5a33}#next{width:44px;height:44px;display:block}.pill.next.pop{animation:pop .25s}.pill.round{padding:0;width:50px;justify-content:center}#sndBtn .off{display:none;fill:#e8443a}#sndBtn.off .off{display:inline}#sndBtn.off .on{display:none}#score{min-width:42px;font-variant-numeric:tabular-nums}#score.bump{animation:pop .2s}@keyframes pop{0%{transform:scale(1)}40%{transform:scale(1.22)}to{transform:scale(1)}}#reveal{position:fixed;left:50%;top:44%;width:min(250px,56vw);display:flex;flex-direction:column;align-items:center;pointer-events:none;opacity:0;z-index:8;transform:translate(-50%,-50%) scale(.3)}#reveal canvas{position:relative;width:100%;filter:drop-shadow(0 10px 16px #1b2a5a66)}#reveal b{position:relative;margin-top:-12px;padding:5px 20px;background:var(--gold);border-radius:16px;box-shadow:0 4px #c98a14;font-size:26px;font-weight:900;white-space:nowrap}#reveal .formula{position:relative;display:flex;align-items:center;gap:4px;margin-top:8px;padding:3px 10px;background:#fff8ecee;border-radius:14px;font-weight:900;font-size:20px}#reveal .formula canvas{width:46px;height:46px;filter:none}#reveal.in{opacity:1;transform:translate(-50%,-50%) scale(1);transition:transform .32s cubic-bezier(.2,1.7,.4,1),opacity .12s}#reveal.fly{opacity:0;transition:transform .38s cubic-bezier(.5,0,.8,.4),opacity .38s ease-in}#reveal.big{width:min(330px,72vw)}.rays{position:absolute;top:42%;left:50%;width:300%;aspect-ratio:1;transform:translate(-50%,-50%);background:radial-gradient(circle,#fff9 0,#fff0 62%),repeating-conic-gradient(#ffffff40 0 12deg,#fff0 12deg 30deg);border-radius:50%;-webkit-mask:radial-gradient(circle,#000 30%,#0000 68%);mask:radial-gradient(circle,#000 30%,#0000 68%);animation:spin 7s linear infinite}@keyframes spin{to{rotate:360deg}}#flash{position:fixed;inset:0;background:#fff;opacity:0;pointer-events:none;z-index:7}#flash.go{animation:fl .5s ease-out}@keyframes fl{0%{opacity:.5}to{opacity:0}}#unlock{position:fixed;left:50%;top:22%;transform:translate(-50%,-50%) scale(.5);display:flex;align-items:center;gap:10px;padding:10px 22px 10px 12px;background:linear-gradient(#fff,#ffeec2);border-radius:26px;box-shadow:0 6px #e0a400,0 14px 30px #0a123a55;opacity:0;pointer-events:none;z-index:9}#unlock b{font-size:26px;font-weight:900;white-space:nowrap}#unlock .gem{width:54px;height:54px}#unlock.show{animation:unl 2.4s cubic-bezier(.2,1.6,.4,1) forwards}@keyframes unl{0%{opacity:0;transform:translate(-50%,-50%) scale(.4)}10%{opacity:1;transform:translate(-50%,-50%) scale(1.08)}16%{transform:translate(-50%,-50%) scale(1)}85%{opacity:1;transform:translate(-50%,-50%) scale(1)}to{opacity:0;transform:translate(-50%,-80%) scale(.9)}}.gem{display:inline-grid;place-items:center;border-radius:50%;color:#fff;font-weight:900;-webkit-text-stroke:3px #1d2540;paint-order:stroke fill;box-shadow:inset 0 -3px #0003,0 0 0 3px #1d2540}#ladder{position:fixed;top:max(14px,env(safe-area-inset-top));left:50%;transform:translate(-50%);display:flex;gap:6px;pointer-events:none;z-index:2}#ladder .gem{width:34px;height:34px;font-size:18px;opacity:.3;filter:grayscale(1);transition:all .3s}#ladder .gem.on{opacity:1;filter:none}#ladder .gem.now{transform:scale(1.25)}#ladder .gem.best{outline:3px solid #fff8;outline-offset:2px}#challenge{position:fixed;top:62px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:6px;padding:4px 12px;background:#26305acc;color:#fff;border-radius:14px;font-weight:800;z-index:2;pointer-events:none}#challenge.hidden{display:none}#challenge canvas{width:32px;height:32px}#challenge svg{width:22px;height:22px;fill:#ff6b5a}#goals{position:fixed;left:12px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:10px;z-index:3;pointer-events:none}.goal{display:flex;align-items:center;gap:3px;padding:6px 10px 6px 8px;background:linear-gradient(#fffdf7,#fbeed6);border-radius:18px;box-shadow:0 4px 0 var(--edge),0 8px 16px #1b2a5a33;border-left:8px solid var(--g);font-weight:900;font-size:18px;color:#7a6a55;animation:goalIn .45s cubic-bezier(.2,1.5,.4,1) backwards}.goal canvas{width:46px;height:46px}.goal canvas.t{width:52px;height:52px;filter:drop-shadow(0 0 6px var(--g))}.goal .q{display:inline-grid;place-items:center;width:46px;height:46px;border-radius:14px;background:#e9dcc3;color:#a8957a;font-size:26px}.goal.done{animation:goalOut .4s forwards}@keyframes goalIn{0%{opacity:0;transform:translate(-40px) scale(.8)}}@keyframes goalOut{to{opacity:0;transform:scale(1.3)}}.pill.next.want{box-shadow:0 4px #9cc9e8,0 0 0 4px var(--g),0 0 18px var(--g)}#powers{position:fixed;left:50%;bottom:max(14px,env(safe-area-inset-bottom));transform:translate(-50%);display:flex;align-items:flex-end;gap:16px;z-index:6}.power{position:relative;width:64px;height:64px;border:0;border-radius:20px;background:linear-gradient(#fffdf7,#fbeed6);box-shadow:0 5px 0 var(--edge),0 9px 16px #1b2a5a44;cursor:pointer;color:var(--ink);transition:transform .08s}.power svg{width:36px;height:36px;fill:currentColor}#zapBtn svg{fill:#f0a800}#swapBtn svg{fill:#2b8fe0}.power b{position:absolute;right:-6px;top:-6px;min-width:24px;height:24px;padding:0 5px;border-radius:12px;background:#ff4f6a;color:#fff;font-size:15px;line-height:24px;box-shadow:0 2px #b8243a}.power.empty{opacity:.4}.power.empty b{background:#9a9a9a;box-shadow:none}.power.active{transform:translateY(-6px);box-shadow:0 5px 0 var(--edge),0 0 0 4px #ffd23f,0 0 22px #ffd23f}.power.urge{animation:beat .8s infinite}#whirl{position:relative;width:84px;height:84px;border:0;border-radius:50%;background:radial-gradient(circle at 35% 30%,#d8f8ff,#46c0f0 65%,#2191c9);box-shadow:0 6px #1a6f9e,0 10px 22px #1b2a5a66;cursor:pointer;display:none;animation:beat .8s infinite}#whirl svg{width:50px;height:50px;fill:#fff}#whirl.show{display:block}#endBtn{width:66px;height:66px;border:0;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff,#ffd25a 70%);box-shadow:0 5px #d29a1a,0 8px 18px #1b2a5a55;cursor:pointer;display:none}#endBtn svg{width:34px;height:34px;fill:#c0392b}#endBtn.show{display:block;animation:pop .3s}#toast{position:fixed;left:50%;bottom:110px;transform:translate(-50%);padding:8px 16px;background:#26305aee;color:#fff;border-radius:14px;font-weight:800;opacity:0;pointer-events:none;transition:opacity .2s;z-index:12}#toast.show{opacity:1}@media(max-aspect-ratio:11/10){#ladder{top:calc(max(10px,env(safe-area-inset-top)) + 58px)}#ladder .gem{width:28px;height:28px;font-size:15px}#challenge{top:132px}#goals{left:0;right:0;top:104px;transform:none;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:6px}.goal{padding:3px 7px 3px 5px;font-size:14px;border-left-width:6px;border-radius:14px}.goal canvas,.goal .q{width:32px;height:32px;font-size:18px}.goal canvas.t{width:36px;height:36px}}#floats{position:fixed;inset:0;pointer-events:none;overflow:hidden}.float{position:absolute;font-weight:900;font-size:24px;color:#fff;-webkit-text-stroke:5px var(--ink);paint-order:stroke fill;animation:rise .8s ease-out forwards}@keyframes rise{0%{transform:translate(-50%) scale(.5);opacity:0}18%{transform:translate(-50%,-18px) scale(1.15);opacity:1}to{transform:translate(-50%,-66px) scale(1);opacity:0}}@keyframes beat{50%{transform:scale(1.12)}}#hand{position:fixed;width:74px;height:74px;pointer-events:none;display:none;z-index:7;filter:drop-shadow(0 4px 5px #0005)}#hand.show{display:block;animation:swipe 1.3s ease-in-out infinite}@keyframes swipe{0%{transform:translate(170px);opacity:0}15%{opacity:1}70%{transform:translate(0);opacity:1}to{transform:translate(0);opacity:0}}.panel{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#16204a77;backdrop-filter:blur(3px);z-index:10;transition:opacity .18s;padding:14px}.panel.hidden{opacity:0;pointer-events:none}.card{position:relative;width:min(400px,100%);padding:24px 22px;background:var(--card);border-radius:28px;box-shadow:0 8px 0 var(--edge),0 18px 40px #0a123a66;text-align:center;animation:cardIn .35s cubic-bezier(.2,1.6,.4,1)}.panel.hidden .card{animation:none}.card.wide{width:min(720px,100%);max-height:calc(100dvh - 28px);display:flex;flex-direction:column}@keyframes cardIn{0%{transform:scale(.7) translateY(30px)}}.big{display:flex;justify-content:center;align-items:center;gap:10px;font-size:52px;font-weight:900}.big svg{width:50px;height:50px;fill:var(--gold);stroke:#c98a14}#bestRow{height:26px;font-weight:800;color:#c9841a;font-size:18px}#newFinds{display:flex;flex-wrap:wrap;justify-content:center;gap:2px;margin:10px 0 16px;min-height:60px}#newFinds canvas{width:58px;height:58px;animation:cardIn .35s backwards}#again{width:100%;height:76px;border:0;border-radius:24px;background:linear-gradient(#7fe05a,#3fbe3a);box-shadow:0 6px #2a8c2c;cursor:pointer;color:#fff}#again:active{transform:translateY(4px);box-shadow:0 2px #2a8c2c}#again svg{width:44px;height:44px;fill:#fff}.close{position:absolute;right:12px;top:12px;width:44px;height:44px;border:0;border-radius:50%;background:#efdcb9;cursor:pointer;z-index:2}.close svg{width:24px;height:24px;fill:var(--ink)}#detail{min-height:82px;display:flex;align-items:center;justify-content:center;gap:4px;font-weight:800;font-size:20px;padding-right:44px;padding-left:44px;flex-wrap:wrap}#detail canvas{width:64px;height:64px}#grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(58px,1fr));gap:4px;overflow:auto;padding:6px;touch-action:pan-y}#grid button{aspect-ratio:1;border:0;padding:3px;background:#f3e3c6;border-radius:14px;cursor:pointer}#grid button.on{background:#ffe9b8}#grid canvas{width:100%;height:100%;display:block}#loader{position:fixed;inset:0;display:flex;gap:12px;align-items:center;justify-content:center;background:linear-gradient(#39a7f2,#bff0ff);z-index:20;transition:opacity .4s}#loader.done{opacity:0;pointer-events:none;visibility:hidden;transition:opacity .4s,visibility 0s .4s}#loader.done i{animation:none}#loader i{width:22px;height:22px;border-radius:50%;background:#fff;animation:beat .7s infinite}#loader i:nth-child(1){background:#2f9bff;animation-delay:.1s}#loader i:nth-child(2){background:#ff5a1f;animation-delay:.2s}#loader i:nth-child(3){background:#ffd91f;animation-delay:.3s}#result{min-height:0;font-size:22px;font-weight:900;margin-bottom:4px}#result.win{color:#3fae2a}#result.lose{color:#c94a3a}#nextGoal{display:flex;justify-content:center;margin:0 0 10px}#nextGoal .goal{animation:none}#memBtn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;height:58px;margin:0 0 12px;border:0;border-radius:20px;background:linear-gradient(#ffe9a8,#ffd25a);box-shadow:0 5px #d29a1a;cursor:pointer;font:900 20px inherit;font-family:inherit;color:var(--ink)}#memBtn:active{transform:translateY(3px);box-shadow:0 2px #d29a1a}#memBtn.hidden{display:none}#memBtn>svg{width:30px;height:30px;fill:#c0392b}#memBtn .start .gem{width:34px;height:34px;font-size:17px}#memBtn .pay{display:flex;align-items:center;gap:3px;padding:2px 10px;background:#fff8;border-radius:12px}#memBtn .pay svg{width:22px;height:22px;fill:var(--ink)}#memBtn:disabled{filter:grayscale(1);opacity:.55;cursor:default}.pill.keys svg{fill:#e0a400}.pill.keys.hidden{display:none}.pill.keys.pop{animation:pop .3s}.flykey{position:fixed;z-index:11;width:64px;height:64px;margin:-32px 0 0 -32px;pointer-events:none;fill:#ffc61a;stroke:#1d2540;stroke-width:1.4;filter:drop-shadow(0 4px 8px #0006);transition:left .7s cubic-bezier(.5,0,.6,1),top .7s cubic-bezier(.5,-.6,.6,1),transform .7s}#climbStars{display:flex;flex-direction:column;align-items:center;gap:6px;margin:6px 0 0}#climbStars .stars{display:flex;gap:4px}#climbStars .stars svg{width:44px;height:44px;fill:#e2d6c0;stroke:#1d2540;stroke-width:1.2}#climbStars .stars svg.on{fill:#ffc61a;animation:starIn .45s cubic-bezier(.2,1.8,.4,1) backwards}@keyframes starIn{0%{transform:scale(0) rotate(-90deg)}}#climbStars .mbar{width:min(260px,80%);margin:0;display:flex;align-items:center}#climbStars .mbar i{transition:width 1s ease-out .6s}#climbStars .mbar .gem{position:relative;width:22px;height:22px;font-size:12px;margin-left:2px;z-index:1}#climbStars .fast{display:flex;align-items:center;gap:4px;padding:2px 10px;border-radius:14px;background:#e6f6ff;font-weight:900;font-size:18px;color:#2b6fb0}#climbStars .fast svg{width:20px;height:20px;fill:#2b6fb0}#climbStars .fast .gem{width:24px;height:24px;font-size:13px}#themes{display:flex;justify-content:center;gap:8px;margin:0 0 12px}#themes.hidden{display:none}#themes button{position:relative;width:58px;height:58px;padding:4px;border:0;border-radius:18px;background:#f3e6cc;box-shadow:0 4px 0 var(--edge);cursor:pointer}#themes button img{width:100%;height:100%;object-fit:contain}#themes button.on{background:#fff;box-shadow:0 4px 0 var(--edge),0 0 0 3px #ffd23f}#themes button:disabled{cursor:default}#themes button:disabled img{filter:grayscale(1) brightness(.6);opacity:.5}#themes button svg{position:absolute;right:-4px;bottom:-4px;width:24px;height:24px;fill:#1d2540}#unlock img.gem{width:54px;height:54px;object-fit:contain;box-shadow:none;background:none;border-radius:0}.extra{display:inline-flex;align-items:center;gap:3px;padding:2px 10px;border-radius:14px;background:#fff3d6;font-weight:900;font-size:18px}.extra svg{width:22px;height:22px;fill:#e0a400}.row{display:flex;gap:10px;align-items:center}.row #again{flex:1}.side{width:62px;height:62px;border:0;border-radius:20px;background:linear-gradient(#e8f6ff,#cfe9fb);box-shadow:0 5px #9cc9e8;cursor:pointer}.side svg{width:32px;height:32px;fill:#2b6fb0}.goal.req{gap:6px;padding:6px 10px 6px 6px}.goal.req .who{width:58px;height:58px;filter:drop-shadow(0 3px 3px #0003)}.goal.req .bubble{position:relative;display:flex;align-items:center;gap:6px;padding:4px 10px 4px 4px;background:#fff;border-radius:16px;box-shadow:inset 0 0 0 3px var(--g)}.goal.req .bubble:before{content:"";position:absolute;left:-9px;top:50%;margin-top:-7px;border:7px solid transparent;border-right:9px solid var(--g);border-left:0}.goal.req .timer{position:absolute;left:0;top:0;width:60px;height:60px;transform:rotate(-90deg)}.goal.req .timer circle{fill:none;stroke-width:3.4}.goal.req .timer .bg{stroke:#0001}.goal.req .timer .fg{stroke:var(--g);stroke-dasharray:106.8;stroke-linecap:round;transition:stroke-dashoffset .3s,stroke .3s}.goal.req canvas.t{width:52px;height:52px;margin:4px;filter:none}.goal.req .f{display:flex;align-items:center;gap:1px;font-size:14px;color:#a08c70}.goal.req .f canvas{width:30px;height:30px}.goal.req .stars{position:absolute;right:6px;top:-11px;font-style:normal;color:var(--g);font-size:15px;-webkit-text-stroke:2px #fff;paint-order:stroke fill;letter-spacing:-2px}.goal.req.warn .fg{stroke:#ff9a1f}.goal.req.danger .fg{stroke:#ff3b3b}.goal.req.danger{animation:shake .5s infinite}.goal.req.oops{animation:oops .5s}.goal.req.gone{animation:gone .5s forwards}@keyframes shake{25%{transform:translate(-2px)}75%{transform:translate(2px)}}@keyframes oops{0%,to{transform:none}20%{transform:translate(-7px) rotate(-2deg)}40%{transform:translate(7px) rotate(2deg);box-shadow:0 0 0 4px #ff3b3b,0 8px 16px #1b2a5a33}60%{transform:translate(-4px)}}@keyframes gone{to{opacity:0;transform:translateY(20px) scale(.85);filter:grayscale(1)}}#hint{position:fixed;width:64px;height:64px;margin:-32px 0 0 -32px;pointer-events:none;opacity:0;z-index:5;filter:drop-shadow(0 3px 4px #0006)}#hint svg{width:100%;height:100%;fill:#fff;stroke:#27304f;stroke-width:1.2}#hint.show{opacity:1;animation:nudge 1s ease-in-out infinite}#hint[data-dir=left]{--r:180deg}#hint[data-dir=up]{--r:-90deg}#hint[data-dir=down]{--r:90deg}#hint[data-dir=right]{--r:0deg}@keyframes nudge{0%,to{transform:rotate(var(--r)) translate(-6px)}50%{transform:rotate(var(--r)) translate(14px)}}@media(max-aspect-ratio:11/10){.goal.req .who{width:38px;height:38px}.goal.req canvas.t{width:36px;height:36px;margin:3px}.goal.req .timer{width:42px;height:42px}.goal.req .f canvas{width:22px;height:22px}.goal.req .f{font-size:11px}}.goal{position:relative}.goal .crown{position:absolute;right:4px;top:-12px;font-style:normal;font-size:20px;color:#ffd23f;-webkit-text-stroke:2px #1d2540;paint-order:stroke fill}#grid button{position:relative}#grid button[data-mark]:after{content:attr(data-mark);position:absolute;right:2px;top:-4px;font-size:16px;color:#ffd23f;-webkit-text-stroke:2px #1d2540;paint-order:stroke fill}.gem.medal{width:54px;height:54px;font-size:28px;-webkit-text-stroke:0;color:#fff}.gem.m1{background:radial-gradient(circle at 35% 30%,#fff,#d08a4a 55%)}.gem.m2{background:radial-gradient(circle at 35% 30%,#fff,#b9c5d6 55%)}.gem.m3{background:radial-gradient(circle at 35% 30%,#fff,#ffd23f 55%)}#unlock b{display:flex;align-items:center;gap:6px}#unlock b canvas{width:44px;height:44px}.mbar{position:relative;flex-basis:100%;height:22px;margin:4px 30px 0;background:#ead9b8;border-radius:11px;overflow:hidden}.mbar i{position:absolute;inset:0 auto 0 0;background:linear-gradient(#ffe27a,#f0a800)}.mbar[data-lvl="0"] i{background:linear-gradient(#f0b07a,#d08a4a)}.mbar[data-lvl="1"] i{background:linear-gradient(#e6edf5,#b9c5d6)}.mbar span{position:relative;font-size:14px;line-height:22px}#grid button[data-medal]:before{content:"★";position:absolute;left:3px;top:-3px;font-size:15px;-webkit-text-stroke:2px #1d2540;paint-order:stroke fill}#grid button[data-medal="1"]:before{color:#d08a4a}#grid button[data-medal="2"]:before{color:#c9d3e0}#grid button[data-medal="3"]:before{color:#ffd23f}@media(max-width:520px){#unlock{max-width:calc(100vw - 24px);padding:8px 14px 8px 8px;gap:8px}#unlock b{font-size:20px;white-space:normal;line-height:1.15}#unlock .gem,#unlock .gem.medal{width:42px;height:42px;font-size:22px;flex:none}}
