:root{--ink:#243249;--muted:#66738a;--paper:#fffcf4;--edge:#23334c;--blue:#387ad6;--magic-color:#70e7ff;--gold:#f4c453;--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}
*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#64c9e9;color:var(--ink);font-family:"Trebuchet MS",Arial,sans-serif;-webkit-user-select:none;user-select:none;touch-action:none}
body>canvas{display:block;width:100%;height:100%;cursor:crosshair}
.hidden{display:none!important}
button{font:inherit;font-weight:700;color:var(--ink);cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;border:2px solid var(--edge);border-radius:10px;background:var(--paper);box-shadow:0 3px 0 var(--edge);padding:10px 14px;transition:background .12s,transform .12s}
button:hover{background:#eaf1fa}
button:active{transform:translateY(2px);box-shadow:0 1px 0 var(--edge)}
button:disabled{cursor:not-allowed;color:#8190a5;background:#e4e8ec;box-shadow:none;border-color:#aeb8c4}
button:focus-visible{outline:3px solid #f9c84e;outline-offset:3px}
.uiIcon{width:28px;height:28px;display:block;flex:0 0 auto}
.powerGlyph{width:100%;height:100%;display:block;overflow:visible}
small{font-size:12px}
#labels{display:none}
#hud{position:fixed;inset:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);z-index:5;pointer-events:none;display:none}
.playing #hud{display:block}
.topbar{position:absolute;top:16px;left:18px;display:flex;gap:8px}
.stat{height:54px;min-width:96px;padding:8px 12px;border:2px solid var(--edge);border-radius:10px;background:var(--paper);box-shadow:0 3px 0 var(--edge);display:grid;grid-template-columns:auto 1fr;column-gap:8px;align-items:center}
.stat>.uiIcon,.stat>.powerGlyph{grid-row:1/3;width:28px;height:32px}
.stat small{font-size:10px;color:var(--muted);font-weight:700;letter-spacing:.6px;line-height:1}
.stat strong{font-size:21px;line-height:1.1;font-weight:900;font-variant-numeric:tabular-nums}
.stat.gems{min-width:78px}
.stat.gems>.uiIcon{color:#8660bc}
.stat.mana>.powerGlyph{color:var(--magic-color)}
#utility{position:absolute;right:18px;top:16px;display:flex;gap:8px;pointer-events:auto}
.iconBtn{width:48px;height:48px;padding:10px;display:grid;place-items:center}
#hubBtn{display:none}
.is-running #hubBtn{display:grid}
#quest{position:absolute;top:87px;left:18px;max-width:270px;padding:10px 13px;background:#fffcf4ed;border-left:4px solid var(--blue);border-radius:0 8px 8px 0;line-height:1.35;font-size:13px;box-shadow:0 2px 5px #23334c18}
#quest strong{display:block;font-size:16px;margin-bottom:3px}
#quest small{display:block;color:var(--muted);font-size:12px}
#skipHint{border:0;box-shadow:none;background:none;color:#66738a;padding:4px 0 0;font-size:11px;pointer-events:auto;text-decoration:underline}
#runStatus{display:none;position:absolute;top:18px;left:50%;transform:translateX(-50%);min-width:200px;padding:8px 15px;border-radius:10px;border:2px solid var(--edge);background:var(--paper);text-align:center;box-shadow:0 3px 0 var(--edge)}
.is-running #runStatus{display:block}
#runTitle{font-size:15px;font-weight:900}
#runPips{display:flex;gap:5px;margin-top:5px;justify-content:center}
#runPips i{width:19px;height:5px;border-radius:2px;background:#d8e1e6}
#runPips i.done{background:#52aa83}
#hint{position:absolute;left:18px;bottom:18px;font-size:11px;line-height:1.65;color:#23334c;background:#fffcf4e6;padding:8px 11px;border-radius:8px;max-width:218px}
kbd{display:inline-block;min-width:18px;border:1px solid #b2becc;border-radius:3px;background:#fff;padding:0 4px;font-family:inherit;font-weight:700}
#guideHud{display:none}
#autoBreakBtn{position:absolute;bottom:23px;right:18px;pointer-events:auto;display:flex;align-items:center;gap:9px;min-height:62px;padding:10px 13px;background:#fff6cd;border:3px solid #253554;border-radius:12px;text-align:left}
#autoBreakBtn kbd{font-size:22px;min-width:32px;text-align:center;padding:3px;background:#fff;border:2px solid #253554;border-radius:7px;box-shadow:0 2px 0 #253554}
#autoBreakBtn strong{display:block;font-size:16px}#autoBreakBtn small{display:block;margin-top:3px;font-size:10px;font-weight:400}
#autoBreakBtn.active{background:#81dc55}#autoBreakBtn.active:hover{background:#98eb6c}#autoBreakBtn:hover{background:#ffed9c}
#levelPanel{position:absolute;bottom:21px;left:50%;transform:translateX(-50%);display:flex;align-items:center;width:min(420px,43vw);height:60px;gap:8px}
.levelStar{width:48px;height:55px;flex:0 0 auto;color:var(--magic-color);filter:drop-shadow(0 2px 0 #fff)}
.levelBody{flex:1;min-width:0;background:var(--paper);border:2px solid var(--edge);border-radius:10px;padding:8px 10px;box-shadow:0 3px 0 var(--edge);display:flex;flex-direction:column-reverse;gap:4px}
.levelMeta{display:flex;justify-content:space-between;font-size:10px;color:var(--muted);font-weight:700}
.levelTrack{height:27px;position:relative;border-bottom:6px solid #dae1e5}
.levelFill{position:absolute;left:0;bottom:-6px;height:6px;width:0;background:var(--blue);transition:width .3s ease-out}
.levelTrack.capped{border-bottom-color:#f4c453}
.levelTrack.capped .levelFill{background:#e8b738}
.levelText{position:relative;display:flex;justify-content:space-between;align-items:center;gap:5px;white-space:nowrap;font-size:14px;font-weight:900}
.levelDamage{font-size:14px}
.levelFill:after{content:"";position:absolute;inset:0;background:#fff;opacity:0}
.levelPanelHit .levelFill:after{animation:fillFlash .4s ease-out}
.levelPanelHit .levelStar{animation:powerPop .35s ease-out}
@keyframes fillFlash{0%{opacity:.8}100%{opacity:0}}
@keyframes powerPop{40%{transform:scale(1.15)}100%{transform:scale(1)}}
.powerFly{position:fixed;width:clamp(48px,4.7vw,60px);height:clamp(56px,5.5vw,70px);z-index:14;pointer-events:none;will-change:transform,opacity;filter:drop-shadow(0 2px 2px #ffffffb3)}
.powerFly small{position:absolute;left:50%;top:83%;transform:translateX(-50%);color:#fff7c2;font-weight:900;font-size:clamp(24px,2.3vw,30px);line-height:1.05;white-space:nowrap;font-variant-numeric:tabular-nums;-webkit-text-stroke:1px #243249;paint-order:stroke fill;text-shadow:0 3px #243249,2px 0 #243249,-2px 0 #243249,0 -2px #243249}
.powerFly.spark{width:22px;height:27px;z-index:13}
.powerFly.spark small{display:none}
#prompt{position:absolute;top:42%;bottom:auto;left:50%;transform:translate(-50%,-100%);display:none;align-items:center;gap:10px;width:max-content;max-width:min(340px,75vw);padding:11px 15px 15px;border:3px solid #334263;border-radius:13px;background:#fff6cd;box-shadow:0 4px 0 #24334f;text-align:left;z-index:12;pointer-events:auto;touch-action:none;cursor:pointer}
#prompt:after{content:"";position:absolute;left:calc(50% - 7px);bottom:-10px;width:14px;height:14px;transform:rotate(45deg);background:#fff6cd;border-right:3px solid #334263;border-bottom:3px solid #334263}
#prompt.show{display:flex}
.promptKey{width:43px;height:43px;flex:0 0 auto;display:grid;place-items:center;border:2px solid #9d792c;border-bottom-width:4px;background:#ffe278;border-radius:9px;font-size:25px;font-weight:900}
.promptKey .powerGlyph{width:26px;height:32px;color:var(--magic-color)}
.promptCopy b{display:block;font-size:19px;line-height:1.2}
.promptCopy small{display:block;font-size:12px;color:#55657b;margin-top:3px}
.promptBar{position:absolute;bottom:0;left:10px;right:10px;height:4px;background:#dce5eb}
.promptBar i{display:block;height:100%;background:var(--blue);transition:width .05s linear}
#prompt.done .promptBar i{background:#55a981}
#prompt.locked .promptKey{color:#8d5e57}
#toast{position:absolute;top:87px;left:50%;transform:translateX(-50%) translateY(-8px);padding:9px 15px;border:1px solid #24324938;border-radius:8px;background:var(--paper);color:var(--ink);font-size:14px;font-weight:700;max-width:80vw;text-align:center;opacity:0;transition:opacity .15s,transform .15s;box-shadow:0 3px 12px #23334c20}
#toast.show{opacity:1;transform:translateX(-50%)}
#toast.bad{border-left:4px solid #cd705c}
#toast.good{border-left:4px solid #56a885}
#damageFlash{position:absolute;inset:0;background:#ed604226;opacity:0;transition:opacity .2s;pointer-events:none}
.odds{font-size:11px;line-height:1.8;color:var(--muted)}
.odds span{display:flex;justify-content:space-between;gap:5px}
.miniAction{width:auto;padding:7px 11px}
.stageGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.stageCard{border:1px solid #cdd8e1;border-radius:12px;padding:14px;background:white}
.stageCard strong{font-size:17px}
.stageCard small{display:block;line-height:1.6;color:var(--muted)}
#start{position:fixed;inset:0;z-index:50;display:flex;align-items:center;background:linear-gradient(90deg,#153b667a,transparent 68%);text-align:center;cursor:default}
.startContent{width:min(530px,46vw);margin-left:clamp(10px,5vw,100px);padding-bottom:20px}
.startTitle{margin:0 0 34px;font-family:"Arial Black","Trebuchet MS",sans-serif;font-weight:900;font-size:clamp(30px,4.7vw,72px);line-height:.98;letter-spacing:-.025em;transform:rotate(-3deg);color:#fff;paint-order:stroke fill;-webkit-text-stroke:6px #1a2847;text-shadow:0 5px 0 #1a2847}
.startTitle>span{display:block;white-space:nowrap}
.startTitle .startObby{color:#ffdc40;font-size:1.65em;letter-spacing:-.04em;margin-bottom:8px}
.startMagic{color:#88f0ff}.startBreaker{font-size:1.2em}
.play{display:flex;align-items:center;justify-content:center;gap:18px;width:80%;min-height:82px;margin:0 auto;border:4px solid #17372c;border-radius:14px;background:#65d63a;color:white;padding:10px 20px;font-size:44px;font-weight:900;text-transform:uppercase;text-shadow:0 3px #23672b;box-shadow:inset 0 4px #b0f26c,0 7px 0 #17372c}
.play svg{width:29px;height:34px;fill:#fff;stroke:#23672b;stroke-width:2;stroke-linejoin:round;flex:none}
.play:not(:disabled):hover{background:#7fe848;transform:translateY(-2px)}
.play:not(:disabled):active{transform:translateY(5px);box-shadow:inset 0 3px #b0f26c,0 2px 0 #17372c}
.play:focus-visible{outline:4px solid #fff;outline-offset:7px}
.play:disabled{background:#708594;border-color:#263849;color:#eef3f7;text-shadow:none;font-size:25px;box-shadow:0 5px #263849}.play:disabled svg{display:none}
.startLoading{width:74%;margin:22px auto 0;color:white;text-shadow:0 2px 2px #17304b;font-size:14px;font-weight:700}
#loadTrack{height:13px;border:3px solid #23344e;border-radius:5px;background:#324863;overflow:hidden;margin-bottom:7px}
#loadFill{display:block;height:100%;width:0;background:#ffe368;transition:width .15s}
.ready .startLoading{visibility:hidden}
.startControls{position:absolute;bottom:calc(var(--safe-bottom) + 24px);left:calc(var(--safe-left) + 20px);right:calc(var(--safe-right) + 20px);font-size:16px;font-weight:700;color:#fff;text-shadow:0 2px 3px #17304b}
.startDesktop{display:flex;align-items:center;justify-content:center;gap:12px}.startControls kbd{padding:4px 10px;border:2px solid #23344e;border-radius:5px;box-shadow:0 2px #23344e;color:#243249;text-shadow:none}.startControls i{width:4px;height:4px;border-radius:50%;background:white;margin:0 4px}
.startTouch{display:none}.touch .startDesktop{display:none}.touch .startTouch{display:inline}
@media(max-height:600px) and (orientation:landscape){.startContent{padding-bottom:10px}.startTitle{font-size:clamp(29px,4.4vw,52px);margin-bottom:22px;-webkit-text-stroke:3px #1a2847;text-shadow:0 3px #1a2847}.startTitle .startObby{font-size:1.5em;margin-bottom:5px}.play{min-height:64px;font-size:32px;gap:12px}.play svg{width:23px;height:28px}.startLoading{margin-top:15px;font-size:12px}.startControls{bottom:calc(var(--safe-bottom) + 14px);font-size:13px}}
@media(orientation:portrait){#start{align-items:flex-start;background:linear-gradient(#153b664a,transparent 48%)}.startContent{width:100%;margin:3vh 0 0;padding:0}.startTitle{font-size:clamp(29px,8vw,58px);line-height:1;margin-bottom:0;-webkit-text-stroke:3px #1a2847;text-shadow:0 3px #1a2847}.startTitle .startObby{font-size:1.45em}.play{position:absolute;bottom:calc(var(--safe-bottom) + 90px);left:18%;width:64%;min-height:66px;font-size:34px}.startLoading{position:absolute;bottom:calc(var(--safe-bottom) + 37px);left:23%;width:54%;margin:0}.startControls{bottom:calc(var(--safe-bottom) + 20px);font-size:12px}.startControls kbd{padding:2px 5px}.startDesktop{gap:7px}#start:not(.ready) .startControls{visibility:hidden}}
#mobile{display:none;position:absolute;left:14px;bottom:107px;width:148px;height:146px;pointer-events:auto}
.mkey{position:absolute;width:44px;height:44px;padding:8px;border-radius:10px;background:#fffcf4dc}
.mkey[data-k=w]{left:49px;top:0}
.mkey[data-k=a]{left:0;top:49px}
.mkey[data-k=s]{left:49px;top:49px}
.mkey[data-k=d]{left:98px;top:49px}
.mkey[data-k=e]{color:#3475c4}
#castBtn{display:none;position:absolute;right:16px;bottom:112px;width:76px;height:64px;pointer-events:auto;background:#edf5ff}
#touchUse{display:none;position:absolute;right:105px;bottom:112px;width:78px;height:64px;pointer-events:auto;padding:5px;border:3px solid #34435e;background:#fff6ce;overflow:hidden}
#touchUse strong,#touchUse small{display:block;position:relative}#touchUse strong{font-size:18px}#touchUse small{font-size:12px}
#touchUse.available{background:linear-gradient(to top,#9de45b var(--use-progress,0%),#fff6ce var(--use-progress,0%))}
#touchUse:disabled{background:#e4e8ecc9;color:#65738b;border-color:#98a5b8}
.mkey.pressed,#castBtn.pressed{background:#90dcff;box-shadow:0 1px 0 var(--edge);transform:translateY(2px)}
.touch #touchUse{display:block}.touch #prompt .promptKey{display:none}
.cameraZoom{display:flex;align-items:center;gap:12px}.cameraZoom button{width:44px;padding:5px;font-size:24px}.cameraZoom output{min-width:25px;text-align:center;font-size:16px}
.touch #mobile,.touch #castBtn{display:block}
.touch #hint{display:none}
#error{position:fixed;inset:0;display:none;place-items:center;z-index:99;background:#f5f3ed;padding:30px;text-align:center}
#error p{max-width:450px;line-height:1.6}
@media(max-width:1000px){#hint{font-size:10px;max-width:170px}
.topbar{gap:5px}
.stat{min-width:84px;padding:7px 9px}
.stat.gems{min-width:68px}
#levelPanel{width:41vw}
}
@media(max-width:850px){.topbar{top:10px;left:10px}
.stat{height:46px;min-width:78px;column-gap:5px;padding:6px 8px}
.stat>.uiIcon,.stat>.powerGlyph{width:24px;height:27px}
.stat strong{font-size:18px}
.stat small{font-size:9px}
.stat.gems{min-width:65px}
#utility{top:10px;right:10px}
.iconBtn{width:42px;height:42px;padding:8px}
#runStatus{top:11px;min-width:180px}
#runTitle{font-size:13px}
#quest{top:70px;left:10px;max-width:210px;font-size:12px}
#quest strong{font-size:14px}
#quest small{font-size:11px}
#hint{display:none}
#levelPanel{width:50vw;bottom:16px;height:55px}
.levelStar{width:37px;height:44px}
.levelBody{padding:7px 8px}
.levelText,.levelDamage{font-size:12px}
.levelMeta{font-size:9px}
.levelTrack{height:24px}
#autoBreakBtn{bottom:19px;right:10px;min-height:54px;padding:7px 9px;gap:6px;max-width:178px}#autoBreakBtn strong{font-size:13px}#autoBreakBtn small{font-size:9px}#autoBreakBtn kbd{min-width:26px;font-size:18px}
#prompt{bottom:auto;max-width:55vw;padding:8px 10px 12px}.promptCopy b{font-size:16px}
.promptCopy b{font-size:14px}
.promptCopy small{font-size:11px}
.promptKey{width:34px;height:34px;font-size:19px}
.promptKey .powerGlyph{height:29px;width:25px}
#toast{top:68px;font-size:12px}
.stageGrid{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:620px){.stat.mana{display:none}
#runStatus{top:63px}
.is-running #quest{top:113px;max-width:185px}
#levelPanel{left:12px;transform:none;width:calc(100vw - 210px)}
.levelText{font-size:11px}
.levelDamage{font-size:11px}
#prompt{max-width:80vw;bottom:auto}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}
}
.reduce-motion *{animation:none!important;transition:none!important}
@media(max-height:600px){}

/* Inventory-style game menus: short labels, visual slots, one primary action. */
#shopDock{position:absolute;left:16px;top:49%;transform:translateY(-50%);display:grid;gap:12px;pointer-events:auto}
.dockBtn{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:80px;min-height:82px;padding:7px 4px;border:3px solid #253554;border-radius:15px;background:#56c8a1;color:#fff;box-shadow:0 4px 0 #253554,inset 0 3px 0 #ffffff70;font-size:14px;font-weight:900;text-shadow:0 1px 2px #172b4e}
.dockBtn .uiIcon{width:34px;height:34px;stroke-width:2.8;filter:drop-shadow(0 2px 0 #25355480)}.dockBtn small{font-size:11px;color:#fff;font-weight:900}
#auraMenuBtn{background:#a276e8}#rebirthMenuBtn{background:#ef79a7}.dockBtn:hover{filter:brightness(1.09)}#rebirthMenuBtn.ready{border-color:#fff;box-shadow:0 0 0 3px #285339,0 5px 0 #285339;background:#49bd66}#rebirthMenuBtn.ready small{background:#fff;color:#257240;border-radius:10px;padding:1px 7px;text-shadow:none}
#shopOverlay{position:fixed;inset:0;z-index:70;display:none;place-items:center;background:#102548a8;padding:calc(var(--safe-top) + 12px) calc(var(--safe-right) + 12px) calc(var(--safe-bottom) + 12px) calc(var(--safe-left) + 12px)}
#shopOverlay.show{display:grid}
.shopPanel{--menu-color:#369ce3;--menu-dark:#236daf;width:min(880px,95vw);height:min(640px,91vh);display:flex;flex-direction:column;overflow:hidden;border:4px solid #233757;border-radius:20px;background:#e5f1fc;box-shadow:0 7px 0 #162940,inset 0 0 0 3px #fff}
.shopPanel[data-menu=auras]{--menu-color:#9964dc;--menu-dark:#7247b0;background:#eee7fa}.shopPanel[data-menu=rebirth]{--menu-color:#e56a9d;--menu-dark:#b64677;width:min(720px,95vw);height:auto;max-height:94vh;background:#f9eaf4}
.shopPanel[data-menu=settings]{width:min(520px,95vw);height:auto;max-height:91vh;--menu-color:#5584b6}
.shopHeader{display:flex;align-items:center;gap:12px;flex:0 0 auto;min-height:80px;padding:11px 18px;background-color:var(--menu-color);background-image:radial-gradient(circle,#ffffff19 2px,transparent 3px);background-size:15px 15px;border-bottom:4px solid var(--menu-dark);box-shadow:inset 0 3px 0 #ffffff80}
#shopHeaderIcon .uiIcon{width:42px;height:42px;color:white;stroke-width:3;filter:drop-shadow(0 2px 0 #24355788)}
#shopTitle{display:block;font-size:30px;font-weight:900;line-height:1;color:white;text-transform:uppercase;letter-spacing:.4px;text-shadow:0 2px 0 #243557}
#shopSubtitle{display:block;color:#fff;font-size:12px;font-weight:700;margin-top:5px}#shopSubtitle:empty{display:none}
#menuWallet{margin-left:auto;background:#fff4c3;border:2px solid #936728;border-radius:10px;padding:7px 9px;color:#55401c;box-shadow:0 2px 0 #936728}
#menuWallet .winPrice{margin:0;font-size:19px}#menuWallet .winPrice>span{display:none}
.shopClose{display:grid;place-items:center;margin-left:4px;width:43px;height:43px;flex:0 0 auto;padding:7px;border:3px solid #782e48;border-radius:11px;background:#fb6072;color:#fff;box-shadow:0 3px 0 #782e48,inset 0 2px 0 #ffffff66}.shopClose:hover{background:#ff7988}.shopClose .uiIcon{width:24px;height:24px;stroke-width:4}
.shopPanel[data-menu=settings] .shopClose{margin-left:auto}
.shopTabs{display:flex;gap:8px;flex:0 0 auto;padding:10px 16px 0}
.shopTab{flex:1;display:flex;justify-content:center;align-items:center;gap:7px;padding:8px 12px;border:2px solid #91a6c2;border-radius:11px;box-shadow:0 3px 0 #91a6c2;background:#f4f8ff;color:#506080;font-size:14px}
.shopTab .uiIcon{width:24px;height:24px}
.shopTab.active{color:#fff;border-color:var(--menu-dark);background:var(--menu-color);box-shadow:0 3px 0 var(--menu-dark),inset 0 2px 0 #ffffff70}
.shopBody{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:15px 16px 20px;touch-action:pan-y;scrollbar-color:var(--menu-color) #cadbec;scrollbar-width:thin}
.shopBody *{touch-action:pan-y}#shopFeedback:empty{display:none}#shopFeedback{flex:0 0 auto;align-self:center;margin:10px 14px 0;padding:7px 16px;border:2px solid #57a35c;border-radius:10px;background:#e0ffd7;color:#265431;font-weight:900;font-size:14px;text-align:center}#shopFeedback.bad{border-color:#c96465;background:#ffdfdf;color:#903443}
.sectionTabs{display:flex;justify-content:center;gap:8px;margin-bottom:12px}.sectionTabs button{min-width:100px;padding:7px 13px;border:2px solid #91a9c5;border-radius:9px;background:#fff;box-shadow:0 2px 0 #91a9c5;font-size:13px}.sectionTabs button.active{background:#ffe37b;border-color:#be923e;box-shadow:0 2px 0 #be923e}
.shopSummary{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:0 0 12px;font-size:13px;font-weight:700}.equipCount{display:flex;align-items:center;gap:5px}.equipCount .uiIcon{width:22px;height:22px}.equipCount small,.tinyTip{font-size:12px;font-weight:700;color:#50617c}
.eggGrid,.petGrid,.auraGrid,.stageGrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.eggCard,.petCard,.auraCard,.stageCard{position:relative;min-width:0;padding:10px;background:#fff;border:3px solid #a2b6d1;border-radius:14px;box-shadow:0 3px 0 #a2b6d1;display:flex;flex-direction:column;align-items:stretch;text-align:center}
.petCard.equipped,.auraCard.equipped{border-color:#54a868;box-shadow:0 3px 0 #38844b;background:#efffeb}
.equippedMark{position:absolute;z-index:1;right:6px;top:6px;border:2px solid #398346;background:#76db83;color:#183e28;width:26px;height:26px;border-radius:50%;font-weight:900;display:grid;place-items:center}
.eggCard h3,.petCard h3,.auraCard h3{font-size:14px;font-weight:900;line-height:1.2;margin:7px 0;min-height:17px}
.eggPreview{height:103px;display:grid;place-items:center}.eggArt{width:95px;height:110px;display:block}
.eggDrops{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-radius:8px;background:#edf3fc;padding:4px 2px;margin:7px 0}
.eggDrops>div{display:flex;align-items:center;flex-direction:column;gap:1px;font-size:12px}.eggDrops img{height:33px;width:42px;object-fit:contain}.eggDrops small{font-size:10px;color:#59708e}.eggDrops b{font-size:12px}
.petIcon{height:96px;display:grid;place-items:center;overflow:hidden;margin-top:3px;border-radius:10px;background:radial-gradient(ellipse,var(--item-color),#eff6fc 74%)}.petIcon img{width:95px;height:95px;object-fit:contain;image-rendering:auto;filter:drop-shadow(0 4px 0 #263c5222)}
.petIcon img,.eggDrops img,.mergePet img,.mergeConfirm>img{transform:none;image-rendering:auto}
.ownedLabel{margin:5px 0 9px;min-height:22px;display:grid;place-items:center;font-size:13px;font-weight:900;color:#45804d}
.rarity{font-size:10px;line-height:16px;font-weight:900;color:#697b98;text-transform:uppercase;letter-spacing:.5px;text-align:left}.enchanted .rarity{color:#8b55b5}
.powerBadge{font-size:23px;font-weight:900;line-height:1.05;color:#405779;margin:1px 0 6px}.powerBadge small{display:block;font-size:10px;font-weight:700;color:#697b98;margin-top:3px}
.winPrice{display:flex;justify-content:center;align-items:center;gap:4px;margin:4px 0;font-size:17px;line-height:1.2;font-variant-numeric:tabular-nums;color:#8b601e}.winPrice .uiIcon{width:22px;height:22px}.winPrice>span{font-size:10px;font-weight:700}
.shopAction,.miniAction,.primary,.rebirthAction{display:flex;justify-content:center;align-items:center;gap:7px;background:#78d947;color:#234529;border:2px solid #38843a;border-radius:10px;box-shadow:0 3px 0 #286532,inset 0 2px 0 #ffffff75;font-weight:900;font-size:16px;padding:9px 10px;min-height:41px}
.shopAction{width:100%;margin-top:auto}.shopAction:hover,.miniAction:hover,.primary:hover,.rebirthAction:hover{background:#99ea65}
.shopAction:disabled,.miniAction:disabled,.rebirthAction:disabled{background:#dce5ef;color:#8595ad;border-color:#b1bfd1;box-shadow:0 2px 0 #a0b1c8}
.shopAction.secondary{background:#c7e5ff;color:#335881;border-color:#7ea9ce;box-shadow:0 2px 0 #6690b6}.shopAction.secondary:disabled{opacity:.8}
.miniAction{font-size:13px;min-height:36px;padding:6px 11px}
.auraSwatch{height:110px;display:grid;place-items:center;background:#26324e;border-radius:10px;box-shadow:inset 0 0 0 2px #ffffff35}.auraSwatch svg{width:100%;height:100%}.auraCard .winPrice{margin:5px 0 9px}
.emptyPets{display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px;padding:35px 12px;color:#50617c;font-size:13px}.emptyPets>.uiIcon{width:64px;height:64px;color:#7ca1ce}.emptyPets strong{font-size:20px;color:#324b6a}.emptyPets button{margin-top:8px}
.mergeTip{text-align:center;font-size:13px;font-weight:700;margin:0 0 15px;color:#536683}
.mergeRows{display:grid;gap:12px}.mergeRow{display:grid;grid-template-columns:1fr 1.4fr;align-items:center;gap:12px;background:#fff;border:2px solid #a2b6d1;border-radius:12px;padding:10px}.mergePet{display:flex;align-items:center;gap:10px;font-size:14px;font-weight:900}.mergePet img{width:60px;height:60px;object-fit:contain}.mergePet small{display:block;font-size:12px;color:#6d80a0;margin-top:4px}
.mergeChoices{display:grid;grid-template-columns:repeat(5,1fr);gap:7px}.mergeBtn{padding:7px 5px;border:2px solid #8770b0;border-radius:9px;background:#dfcef9;box-shadow:0 3px 0 #8770b0;color:#58417f}.mergeBtn b{display:block;font-size:20px}.mergeBtn small{font-size:11px}.mergeBtn:disabled{background:#edf0f6;border-color:#c8d0db;color:#a2afc0;box-shadow:none}
.mergeConfirm{max-width:430px;margin:auto;text-align:center}.mergeConfirm>img{width:105px;height:100px;object-fit:contain}.mergeConfirm h2{font-size:22px;margin:5px 0 12px}.mergeOdds{display:flex;justify-content:center;align-items:center;gap:25px;background:#fff;padding:15px;border:2px solid #a5bada;border-radius:14px}.mergeOdds b{font-size:30px;color:#8a4cbb}.mergeOdds small{display:block;font-size:12px;color:#587092}.mergeWarning{font-size:14px;line-height:1.5;color:#a34153;font-weight:700}
.confirmActions{display:flex;justify-content:center;gap:13px;margin-top:14px}.confirmActions button{min-width:120px;display:flex;align-items:center;justify-content:center;gap:6px;font-size:16px;min-height:44px}
.rebirthSheet{max-width:600px;margin:0 auto;text-align:center}.rebirthNumber{font-size:13px;font-weight:900;color:#94608c;margin-bottom:9px}
.rebirthCompare{display:grid;grid-template-columns:1fr 42px 1fr;align-items:center;gap:10px}.rebirthSide{border:3px solid #9fb4d0;border-radius:14px;background:#f5f9ff;padding:12px 8px;box-shadow:0 3px 0 #9fb4d0}.rebirthSide>span{font-size:12px;font-weight:900;color:#68809d}.rebirthSide strong{display:block;background:#ffe577;color:#5e481f;border:2px solid #ccad51;border-radius:9px;padding:8px 5px;font-size:22px;margin:7px 0}.rebirthSide>b{display:block;font-size:27px;color:#8055aa;line-height:1.15}.rebirthSide b small{display:block;font-size:11px;color:#886299}.rebirthSide.next{border-color:#9e70be;background:#f9f1ff;box-shadow:0 3px 0 #9e70be}.rebirthArrow .uiIcon{width:42px;height:42px;stroke-width:4;color:#548cd7}
.unlockPrize{display:flex;justify-content:center;align-items:center;gap:5px;margin-top:13px;font-size:14px;font-weight:900;color:#5a7c38}.unlockPrize .uiIcon{width:22px;height:22px}
.rebirthNeeds{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:14px 0 12px}.rebirthNeeds>span{padding:8px 5px;border:2px solid #c2b8cc;border-radius:9px;background:#f7f5fa;color:#89788e;font-size:13px;font-weight:900}.rebirthNeeds>.met{border-color:#93c47e;background:#e5fad9;color:#3c7631}
.rebirthRules{display:grid;grid-template-columns:1fr 1fr;gap:10px;text-align:left;margin-bottom:15px}.rebirthRules>div{display:flex;align-items:center;gap:9px;background:#fff7;padding:9px 10px;border-radius:10px;font-size:11px;line-height:1.5}.rebirthRules b{color:#b55566;font-size:12px}.rebirthRules>div+div b{color:#45804d}
.rebirthAction{min-width:230px;min-height:49px;font-size:21px;margin:0 auto}.rebirthAction .uiIcon{width:26px;height:26px}
.settingsSheet{max-width:400px;margin:auto}.settingRow{display:flex;justify-content:space-between;align-items:center;gap:15px;margin:6px 0 16px;background:#fff8;border:2px solid #c3d5eb;border-radius:13px;padding:13px 15px;font-size:16px}.settingRow button{min-width:72px;padding:8px 10px;font-size:15px}.settingRow [aria-pressed=true]{background:#a2e783}.platformNote{display:block;margin:-10px 0 15px;color:#64728b}.controlHelp{font-size:13px;color:#536984;margin:16px 4px}.controlHelp summary{cursor:pointer;font-weight:900;padding:7px}.controlList{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px 5px;line-height:1.3;font-size:12px}.saveNotice{font-size:12px;color:#ad4153}
.stageTile{display:grid;place-items:center;align-self:center;width:80px;height:65px;margin:3px 0 8px;background:var(--item-color);border:3px solid #395171;border-radius:8px;box-shadow:inset 0 4px 0 #ffffff60,0 4px 0 #395171;color:#fff;font-size:30px;font-weight:900;text-shadow:0 2px 0 #243557}.stageCard>strong{font-size:15px;margin:6px 0}.stageCard .winPrice{margin-bottom:10px}
@media(max-width:1000px){.dockBtn{width:72px;min-height:74px;font-size:13px}#shopDock{left:12px;gap:10px}.dockBtn .uiIcon{width:30px;height:30px}}
@media(max-width:850px){#shopDock{top:76px;right:10px;left:auto;transform:none;gap:9px}.dockBtn{width:58px;min-height:59px;padding:5px 2px;border-radius:11px;font-size:10px}.dockBtn .uiIcon{width:25px;height:25px}.dockBtn small{display:none}#rebirthMenuBtn.ready:after{content:"!";position:absolute;right:-5px;top:-7px;width:18px;height:18px;border-radius:50%;border:2px solid #285339;background:#fff;color:#285339;font-size:13px;text-shadow:none}.shopHeader{min-height:62px;padding:8px 12px;gap:9px}#shopTitle{font-size:24px}#shopHeaderIcon .uiIcon{width:32px;height:32px}.shopClose{width:37px;height:37px}#menuWallet{padding:5px 7px}#menuWallet .winPrice{font-size:16px}.shopTabs{padding:8px 10px 0;gap:6px}.shopTab{padding:6px 8px;font-size:13px}.shopBody{padding:12px 10px 15px}.shopPanel{height:93vh}.eggGrid,.petGrid,.auraGrid,.stageGrid{gap:8px}.petIcon{height:79px}.petIcon img{height:79px;width:79px}.auraSwatch{height:86px}.eggCard,.petCard,.auraCard,.stageCard{padding:8px}.eggCard h3,.petCard h3,.auraCard h3{font-size:12px}.powerBadge{font-size:21px}.winPrice{font-size:15px}.shopAction{font-size:14px;min-height:38px;padding:7px}.mergeRow{grid-template-columns:1fr 1.3fr}.mergeChoices{gap:4px}}
@media(max-width:620px){.eggGrid,.petGrid,.auraGrid,.stageGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.shopPanel{width:96vw;border-width:3px}.shopHeader{gap:6px}#shopTitle{font-size:21px}#shopSubtitle{font-size:10px}#shopHeaderIcon .uiIcon{width:26px;height:26px}#menuWallet .uiIcon{width:19px}#menuWallet .winPrice{font-size:14px}.shopTabs{gap:5px}.shopTab{font-size:12px;gap:5px}.shopTab .uiIcon{width:20px;height:20px}.sectionTabs button{min-width:0;flex:1;padding:7px 10px}.rebirthCompare{grid-template-columns:1fr 25px 1fr;gap:6px}.rebirthArrow .uiIcon{width:25px}.rebirthSide strong{font-size:18px}.rebirthRules{gap:5px}.rebirthRules>div{padding:6px;display:block}.rebirthRules b{display:block}.rebirthNeeds>span{font-size:11px}.mergeRow{grid-template-columns:1fr;gap:5px}.mergePet img{width:45px;height:45px}}
@media(max-height:600px){.shopPanel{height:94vh}.shopHeader{min-height:57px;padding:7px 12px}#shopTitle{font-size:24px}#shopSubtitle{font-size:10px;margin-top:2px}#shopHeaderIcon .uiIcon{width:31px;height:31px}.shopTabs{padding-top:7px}.shopTab{padding:5px 10px;font-size:12px;min-height:32px}.shopTab .uiIcon{width:21px;height:21px}.shopBody{padding-top:10px}.sectionTabs{margin-bottom:8px}.sectionTabs button{padding:5px 10px;font-size:12px}.shopSummary{margin-bottom:9px}.shopAction{min-height:36px;padding:6px;font-size:14px}.eggPreview{height:70px}.eggArt{height:78px;width:70px}.eggDrops{margin:4px 0;padding:2px}.eggDrops img{height:25px;width:31px}.eggCard h3{margin:2px 0 4px}.winPrice{margin:4px 0;font-size:15px}.eggCard .winPrice{margin:4px 0 7px}.petIcon{height:74px}.petIcon img{height:74px}.auraSwatch{height:73px}.powerBadge{font-size:20px}.rebirthNumber{margin-bottom:5px;font-size:11px}.rebirthSide{padding:6px 7px;border-width:2px}.rebirthSide strong{font-size:19px;padding:5px;margin:4px 0}.rebirthSide>b{font-size:23px}.rebirthSide b small{font-size:10px}.rebirthSide>span{font-size:11px}.unlockPrize{font-size:12px;margin-top:9px}.rebirthNeeds{margin:9px 0 7px}.rebirthNeeds>span{padding:5px;font-size:12px}.rebirthRules{margin-bottom:10px}.rebirthRules>div{padding:5px 9px;font-size:10px}.rebirthAction{min-height:40px;font-size:18px;padding:6px 12px}.mergeConfirm>img{width:70px;height:60px}.mergeConfirm h2{font-size:19px;margin:0 0 8px}.mergeOdds{padding:9px}.mergeOdds b{font-size:25px}.mergeWarning{margin:9px 0;font-size:12px}.confirmActions{margin-top:10px}.confirmActions button{min-height:37px;font-size:14px}.settingRow{padding:9px 12px;margin-bottom:10px}.controlHelp{margin:9px 0}}

/* Readability scale: larger game controls; reflow small screens instead of
   shrinking prices and action text back to tiny desktop labels. */
#wandPreview{position:absolute;left:50%;bottom:118px;transform:translateX(-50%);width:410px;max-width:90vw;padding:12px 17px;background:#fff7d9;border:3px solid #594728;border-top:7px solid #ffda50;border-radius:13px;box-shadow:0 4px 0 #594728;text-align:center;pointer-events:none}
#wandPreview[hidden]{display:none}.wandPreviewTitle{display:block;font-size:19px;line-height:1.3}.wandPreviewValues{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:6px 0}.wandPreviewValues>b{font-size:26px}.wandPreviewHint{display:block;font-size:16px;font-weight:700;color:#73501e}
#wandPreview.ready{background:#efffdd}.ready .wandPreviewHint{color:#285a2b}.wand-shopping #quest{display:none}
button{font-size:18px;min-height:44px}
.stat{height:66px;min-width:116px;padding:9px 13px}
.stat>.uiIcon,.stat>.powerGlyph{width:35px;height:39px}
.stat small{font-size:12px}.stat strong{font-size:28px}.stat.gems{min-width:100px}
.iconBtn{width:56px;height:56px}.iconBtn .uiIcon{width:32px;height:32px}
#quest{top:100px;max-width:310px;font-size:16px}#quest strong{font-size:20px}#quest small{font-size:15px}
#skipHint{font-size:14px;min-height:28px}
#runStatus{min-width:225px;padding:10px 17px}#runTitle{font-size:20px}
#hint{font-size:13px;max-width:265px}
#levelPanel{width:min(520px,45vw);height:78px}
.levelStar{width:58px;height:66px}.levelBody{padding:10px 12px;gap:6px}
.levelText,.levelDamage{font-size:20px}.levelMeta{font-size:13px}.levelTrack{height:35px}
#autoBreakBtn{min-height:78px;padding:12px 16px}#autoBreakBtn strong{font-size:20px}#autoBreakBtn small{font-size:13px}#autoBreakBtn kbd{font-size:26px;min-width:38px}
#shopDock{gap:14px}.dockBtn{width:96px;min-height:98px;font-size:18px}.dockBtn .uiIcon{width:42px;height:42px}.dockBtn small{font-size:14px}
#prompt{max-width:min(430px,80vw);padding:14px 18px 18px;gap:13px}.promptCopy{min-width:0}.promptCopy b{font-size:24px}.promptCopy small{font-size:16px;line-height:1.35;color:#35465f}
.promptKey{width:52px;height:52px;font-size:30px}.promptBar{height:6px}#prompt.locked{background:#f0edf6;cursor:default}#prompt.locked:after{background:#f0edf6}
#toast{top:100px;font-size:18px}
.shopPanel{width:min(960px,95vw);height:min(720px,92vh)}
#shopTitle{font-size:34px}#shopSubtitle{font-size:15px}.shopClose{width:50px;height:50px}
.shopTab{font-size:18px;min-height:48px}.sectionTabs button{font-size:17px;min-height:44px}
.shopSummary{font-size:17px}.equipCount small,.tinyTip{font-size:14px}
.eggCard h3,.petCard h3,.auraCard h3{font-size:18px;min-height:22px}
.petIcon{height:112px}.petIcon img{width:112px;height:112px}.auraSwatch{height:122px}
.eggDrops img{width:50px;height:43px}.eggDrops b{font-size:15px}.eggDrops small{font-size:13px}
.powerBadge{font-size:30px}.powerBadge small{font-size:13px}.rarity{font-size:12px;line-height:19px}
.winPrice{font-size:23px;gap:6px}.winPrice>span{font-size:14px}.winPrice .uiIcon{width:27px;height:27px}#menuWallet .winPrice{font-size:23px}
.ownedLabel{font-size:16px;min-height:28px}.shopAction,.miniAction,.primary{font-size:20px;min-height:48px;padding:10px 12px}
.shopAction:disabled,.miniAction:disabled,.rebirthAction:disabled{color:#576783}
.mergeTip,.mergeWarning{font-size:16px}.mergePet{font-size:18px}.mergePet small{font-size:15px}.mergeBtn b{font-size:24px}.mergeBtn small{font-size:14px}.mergeOdds small{font-size:15px}
.rebirthNumber,.rebirthSide>span{font-size:16px}.rebirthSide strong{font-size:26px}.rebirthSide>b{font-size:31px}.rebirthSide b small{font-size:14px}
.rebirthNeeds>span,.unlockPrize{font-size:16px}.rebirthRules>div,.rebirthRules b{font-size:14px}.rebirthAction{font-size:24px;min-height:54px}
.settingRow{font-size:20px}.settingRow button{font-size:18px;min-height:44px}.controlHelp,.controlList{font-size:16px}.confirmActions button{font-size:19px;min-height:48px}
.emptyPets{font-size:16px}.emptyPets strong{font-size:24px}#shopFeedback{font-size:17px}
@media(max-width:1100px){#hint{display:none}#levelPanel{width:43vw}.levelText,.levelDamage{font-size:18px}.dockBtn{width:86px;min-height:89px}.shopPanel{width:96vw}}
@media(max-width:850px){
  #wandPreview{left:10px;top:80px;bottom:auto;transform:none;width:300px;max-width:calc(100vw - 102px);padding:10px 12px}.wandPreviewTitle{font-size:17px}.wandPreviewValues>b{font-size:22px}.wandPreviewHint{font-size:15px}
  .stat{height:56px;min-width:100px;padding:7px 9px}.stat.gems{min-width:90px}.stat strong{font-size:24px}.stat small{font-size:11px}.stat>.uiIcon,.stat>.powerGlyph{width:29px;height:33px}
  .iconBtn{width:50px;height:50px}#quest{top:80px;max-width:250px;font-size:14px}#quest strong{font-size:17px}#quest small{font-size:13px}
  #shopDock{top:80px;gap:10px}.dockBtn{width:70px;min-height:72px;font-size:14px}.dockBtn .uiIcon{width:31px;height:31px}.dockBtn small{display:none}
  #runStatus{min-width:195px}#runTitle{font-size:17px}
  #levelPanel{width:48vw;height:68px}.levelStar{width:44px;height:53px}.levelText,.levelDamage{font-size:17px}.levelMeta{font-size:12px}.levelTrack{height:30px}
  #autoBreakBtn{max-width:192px;min-height:65px;padding:9px 10px}#autoBreakBtn strong{font-size:16px}#autoBreakBtn small{font-size:12px}#autoBreakBtn kbd{font-size:22px;min-width:29px}
  #prompt{max-width:min(410px,76vw);padding:11px 13px 15px}.promptCopy b{font-size:21px}.promptCopy small{font-size:15px}.promptKey{width:44px;height:44px;font-size:25px}
  #toast{top:80px;font-size:16px}
  .petGrid,.auraGrid,.stageGrid{grid-template-columns:repeat(3,minmax(0,1fr))}.eggGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
  #shopTitle{font-size:28px}#shopSubtitle{font-size:14px}.shopHeader{min-height:70px}.shopClose{width:46px;height:46px}
  .shopTab{font-size:17px}.sectionTabs button{font-size:16px}.shopAction{font-size:18px}.winPrice{font-size:21px}.powerBadge{font-size:27px}
}
@media(max-width:620px){
  .shopPanel{width:100%}
  #runStatus{top:79px}.is-running #quest{top:144px;max-width:220px}
  #levelPanel{left:12px;bottom:96px;width:calc(100% - 24px);transform:none;height:72px}.levelText,.levelDamage{font-size:18px}
  #autoBreakBtn{bottom:15px;max-width:210px;min-height:64px}#autoBreakBtn strong{font-size:17px}
  #mobile{bottom:185px}#castBtn{bottom:185px;width:85px;height:70px;font-size:20px}
  #prompt{max-width:calc(100vw - 108px)}.promptCopy b{font-size:20px}
  .petGrid,.auraGrid,.stageGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .shopHeader{gap:7px;padding:10px}#shopTitle{font-size:24px}#shopHeaderIcon .uiIcon{width:28px;height:28px}#shopSubtitle{font-size:13px}#menuWallet .winPrice{font-size:18px}.shopClose{margin-left:0}
  .shopTab{font-size:15px;padding:7px}.shopTab .uiIcon{width:21px;height:21px}.shopSummary{flex-wrap:wrap}
  .rebirthSide strong{font-size:21px}.rebirthSide>b{font-size:27px}.rebirthNeeds>span{font-size:14px}.rebirthRules>div,.rebirthRules b{font-size:13px}
}
@media(max-height:600px) and (min-width:621px){
  #quest{font-size:13px;max-width:230px}#quest strong{font-size:16px}#quest small{font-size:13px}
  .dockBtn{width:66px;min-height:65px;font-size:13px}.dockBtn .uiIcon{width:28px;height:28px}.dockBtn small{display:none}#shopDock{gap:8px}
  #levelPanel{height:64px;bottom:14px}#mobile{bottom:100px}#castBtn{bottom:100px}
  .shopPanel{height:94vh}.shopHeader{min-height:64px}#shopTitle{font-size:26px}.shopBody{padding-top:10px}
  .shopTab{min-height:44px}.sectionTabs button{min-height:44px}.shopAction{min-height:46px}
  .eggPreview{height:80px}.eggArt{height:88px}.petIcon{height:88px}.petIcon img{width:88px;height:88px}.auraSwatch{height:94px}
}

/* Fit the safe viewport, including notched landscape phones. The action footer
   is outside the scrolling body so the reset explanation never leaves its button. */
.shopPanel,.shopPanel[data-menu=rebirth],.shopPanel[data-menu=settings]{max-width:100%;max-height:100%}
#shopFooter{flex:0 0 auto;padding:8px 14px 12px;border-top:2px solid #dfb8ce;background:#f9eaf4}
#shopFooter[hidden]{display:none}.rebirthFooter{max-width:640px;margin:auto;text-align:center}
.rebirthFooter .rebirthRules{margin:0 0 8px}.rebirthFooter .rebirthAction{width:100%;min-width:0}
#wandPreview{max-width:calc(100% - 24px)}
#start,#error{padding:calc(var(--safe-top) + 16px) calc(var(--safe-right) + 16px) calc(var(--safe-bottom) + 16px) calc(var(--safe-left) + 16px)}
@media(max-width:850px){#wandPreview{max-width:calc(100% - 102px)}#prompt{max-width:calc(100% - 108px)}}
@media(max-height:700px){
  .shopHeader{min-height:56px;padding:6px 12px}#shopSubtitle{display:none}
  .shopTabs{padding-top:6px}.shopBody{padding:8px 10px 12px}
  .sectionTabs{margin-bottom:8px}.shopSummary{margin-bottom:8px;font-size:14px}
  .eggCard{display:grid;grid-template-columns:65px minmax(0,1fr);column-gap:8px;row-gap:4px;padding:8px}
  .eggCard .eggPreview{grid-column:1;grid-row:1/4;height:80px;align-self:center}
  .eggCard .eggArt{width:62px;height:76px}
  .eggCard h3{grid-column:2;grid-row:1;margin:0;min-height:0;font-size:17px;text-align:left}
  .eggCard>.winPrice{grid-column:2;grid-row:2;margin:0;justify-content:flex-start;font-size:21px}
  .eggCard>.shopAction{grid-column:2;grid-row:3;min-height:44px;margin:0;padding:6px;font-size:18px}
  .eggCard .eggDrops{grid-column:1/-1;grid-row:4;margin:2px 0 0;padding:2px}
  .eggDrops img{height:30px;width:36px}.eggDrops small{font-size:12px}
  .rebirthNumber{margin:0 0 5px;font-size:14px}.rebirthSide{padding:5px 7px}
  .rebirthSide>span{font-size:14px}.rebirthSide strong{font-size:20px;padding:4px;margin:3px 0}
  .rebirthSide>b{font-size:24px}.rebirthSide b small{font-size:12px}
  .unlockPrize{margin-top:4px;font-size:14px}.rebirthNeeds{margin:4px 0 0}
  .rebirthNeeds>span{font-size:14px;padding:5px}
  #shopFooter{padding:6px 10px 9px}.rebirthFooter .rebirthRules{margin-bottom:6px}
  .rebirthFooter .rebirthRules>div{padding:4px 6px;font-size:12px;line-height:1.3}
  .rebirthFooter .rebirthRules b{font-size:13px}.rebirthFooter .rebirthAction{min-height:46px;font-size:20px;padding:6px}
}
@media(max-height:600px) and (min-width:621px){
  #levelPanel{left:14px;transform:none;width:calc(100% - 224px);max-width:520px}
  .touch #shopDock{display:flex;right:10px;left:auto;top:80px;transform:none;gap:8px}
  .touch #mobile{bottom:80px}
}

/* Touch landscape has its own layout, independent of desktop breakpoints.
   Left thumb moves, right thumb casts/uses; the centre remains clear. */
@media(orientation:landscape){
  .touch .topbar{top:8px;left:10px;gap:5px}
  .touch .stat,.touch .stat.gems{display:grid;height:46px;min-width:78px;padding:5px 7px;column-gap:5px}
  .touch .stat strong{font-size:20px}.touch .stat small{font-size:9px}
  .touch .stat>.uiIcon,.touch .stat>.powerGlyph{width:24px;height:28px}
  .touch #utility{top:8px;right:10px;gap:8px;display:flex}.touch .iconBtn{width:44px;height:44px;padding:8px}.touch .iconBtn .uiIcon{width:26px;height:26px}
  .touch #shopDock{display:flex;left:auto;right:10px;top:64px;transform:none;gap:7px}
  .touch .dockBtn{width:60px;min-height:57px;padding:4px 3px;font-size:12px;border-radius:11px}.touch .dockBtn .uiIcon{width:26px;height:26px}.touch .dockBtn small{display:none}
  .touch #quest{left:10px;top:64px;max-width:calc(100% - 240px);width:240px;padding:8px 10px;font-size:12px}
  .touch #quest strong{font-size:15px}.touch #quest small{font-size:12px;line-height:1.3}.touch #skipHint{min-height:44px;padding:4px 0;font-size:12px}
  .touch.is-running #quest,.touch.wand-shopping #quest,.touch.touch-interacting #quest,.touch.touch-interacting #runStatus{display:none!important}
  .touch #runStatus{left:10px;top:64px;transform:none;min-width:0;max-width:calc(100% - 240px);padding:7px 10px}.touch #runTitle{font-size:15px}.touch #runPips{margin-top:4px}
  .touch #mobile{left:10px;bottom:14px;width:148px;height:98px}
  .touch .mkey{width:46px;height:46px;min-height:46px;font-size:21px;padding:7px;touch-action:none}
  .touch .mkey[data-k=w]{left:51px;top:0}.touch .mkey[data-k=a]{left:0;top:52px}.touch .mkey[data-k=s]{left:51px;top:52px}.touch .mkey[data-k=d]{left:102px;top:52px}
  .touch #castBtn{right:10px;bottom:14px;width:84px;height:72px;font-size:22px;border-width:3px;border-radius:16px;touch-action:none}
  .touch #touchUse{left:auto;top:auto;right:104px;bottom:14px;width:74px;height:62px;padding:5px}
  .touch #autoBreakBtn{left:auto;right:10px;bottom:102px;width:168px;max-width:none;min-height:46px;padding:8px;justify-content:center;border-radius:11px}
  .touch #autoBreakBtn kbd,.touch #autoBreakBtn small{display:none}.touch #autoBreakBtn strong{font-size:14px;white-space:nowrap}
  .touch #levelPanel{left:172px;right:192px;bottom:14px;width:auto;max-width:540px;transform:none;height:54px;gap:5px}
  .touch .levelStar{width:32px;height:40px}.touch .levelBody{padding:6px 8px;gap:3px}.touch .levelText,.touch .levelDamage{font-size:14px}.touch .levelMeta{font-size:10px}.touch .levelTrack{height:24px}
  .touch #wandPreview{left:10px;top:64px;bottom:auto;transform:none;width:300px;max-width:calc(100% - 232px);padding:7px 10px;border-top-width:4px}
  .touch .wandPreviewTitle{font-size:15px}.touch .wandPreviewValues{gap:6px;margin:4px 0}.touch .wandPreviewValues>b{font-size:18px}.touch .wandPreviewHint{font-size:12px}
  .touch #prompt{left:10px;top:64px;bottom:auto;transform:none;width:300px;max-width:calc(100% - 232px);padding:8px 10px 13px;gap:0;pointer-events:none}
  .touch #prompt:after{display:none}.touch .promptCopy b{font-size:17px}.touch .promptCopy small{font-size:13px;line-height:1.2}.touch .promptBar{height:5px}
  .touch #toast{top:auto;bottom:132px;max-width:calc(100% - 32px);width:max-content;font-size:13px;padding:7px 10px;pointer-events:none}
  .touch .powerFly{width:42px;height:49px}.touch .powerFly small{font-size:23px}
  .touch #shopOverlay{padding:calc(var(--safe-top) + 5px) calc(var(--safe-right) + 6px) calc(var(--safe-bottom) + 5px) calc(var(--safe-left) + 6px)}
  .touch .shopPanel{height:100%;max-height:100%;width:min(960px,100%);border-radius:14px}
  .touch .shopHeader{min-height:52px;padding:4px 10px;gap:8px}.touch #shopTitle{font-size:24px}.touch #shopSubtitle{display:none}.touch #shopHeaderIcon .uiIcon{width:30px;height:30px}
  .touch .shopClose{width:44px;height:44px}.touch .shopTabs{padding:5px 10px 0}.touch .shopTab{min-height:44px;font-size:16px;padding:5px 8px}
  .touch .shopBody{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:6px 10px 10px}
  .touch .sectionTabs{margin-bottom:6px}.touch .sectionTabs button{min-height:44px;font-size:15px}
  .touch .shopAction,.touch .confirmActions button,.touch .mergeChoices button{min-height:44px}
  .touch .shopPanel[data-section=eggs] .shopSummary{display:none}
  .touch .shopPanel[data-menu=rebirth],.touch .shopPanel[data-menu=settings]{height:auto}
}
@media(orientation:landscape) and (max-height:430px){
  .touch .shopTabs{display:none!important}
  .touch .rebirthNumber{display:none}
  .touch .rebirthFooter{display:grid;grid-template-columns:minmax(0,1fr) minmax(132px,.72fr);align-items:stretch;gap:8px}
  .touch .rebirthFooter .rebirthRules{grid-template-columns:1fr;gap:3px;margin:0}
  .touch .rebirthFooter .rebirthRules>div{display:flex;gap:6px;padding:3px 5px;font-size:12px}
  .touch .rebirthFooter .rebirthAction{font-size:18px;line-height:1.2}
  .touch #quest small{display:none}.touch #quest{width:210px}.touch #wandPreview .wandPreviewHint{display:none}
  .touch #levelPanel{height:44px}.touch .levelMeta,.touch .levelDamage{display:none}
  .touch #shopFeedback{padding:4px 10px;margin:4px 10px 0;font-size:13px}
  .touch .eggCard{grid-template-columns:48px minmax(0,1fr);padding:6px;column-gap:6px;row-gap:2px}
  .touch .eggCard h3{font-size:15px;line-height:18px}.touch .eggCard>.winPrice{font-size:18px;line-height:22px}.touch .eggCard>.shopAction{min-height:44px;padding:4px;font-size:17px}
  .touch .eggCard .eggArt{width:48px;height:65px}.touch .eggCard .eggPreview{height:65px}
  .touch .eggCard .winPrice .uiIcon{width:20px;height:20px}
  .touch .auraGrid,.touch .petGrid{grid-template-columns:repeat(auto-fit,minmax(min(340px,100%),1fr))}
  .touch .auraCard,.touch .petCard{display:grid;grid-template-columns:80px minmax(0,1fr) 92px;grid-template-rows:auto auto auto;gap:3px 8px;padding:7px;text-align:left}
  .touch .auraSwatch,.touch .petIcon{grid-column:1;grid-row:1/4;height:82px;margin:0}.touch .petIcon img{width:80px;height:80px}
  .touch .auraCard h3,.touch .petCard h3{grid-column:2;grid-row:1;font-size:16px;margin:0;min-height:0}
  .touch .auraCard .powerBadge,.touch .petCard .rarity{grid-column:2;grid-row:2;margin:0}
  .touch .auraCard .powerBadge,.touch .petCard .powerBadge{font-size:22px}.touch .powerBadge small{display:inline;font-size:11px;margin-left:5px}
  .touch .auraCard .winPrice,.touch .auraCard .ownedLabel,.touch .petCard .powerBadge{grid-column:2;grid-row:3;margin:0;font-size:18px;justify-content:flex-start}
  .touch .auraCard .shopAction,.touch .petCard .shopAction{grid-column:3;grid-row:1/4;margin:0;padding:5px;font-size:17px}
}
@media(orientation:landscape) and (max-width:740px){
  .touch #levelPanel{left:164px;right:188px}.touch .levelMeta,.touch .levelDamage{display:none}
  .touch .levelTrack{height:30px}.touch .levelText{font-size:13px}.touch #levelName{white-space:normal;line-height:1.05}
  .touch #prompt .promptCopy small{font-size:12px}
  .touch #wandPreview{max-width:calc(100% - 230px)}.touch .wandPreviewValues{flex-wrap:wrap;gap:0}.touch #wandPreview .winPrice{font-size:18px;margin:0}
}
@media(orientation:portrait){.touch #touchUse{right:16px;bottom:267px;width:85px}}
