html,body{height:100%;overscroll-behavior:none;-webkit-text-size-adjust:100%}
#game{height:100dvh;touch-action:none}
#celebration{height:100dvh}
.touch-guide{display:none}
#touch-controls{position:fixed;inset:0;pointer-events:none;z-index:6;--dock:90px;--edge:max(14px,env(safe-area-inset-left));user-select:none;-webkit-user-select:none}
#touch-stick{position:absolute;left:var(--edge);bottom:calc(var(--dock) + env(safe-area-inset-bottom));width:124px;height:124px;border:2px solid #a3eaf18c;border-radius:50%;background:#101c397a;box-shadow:inset 0 0 22px #85e2f322;pointer-events:auto;touch-action:none;-webkit-touch-callout:none}
.stick-thumb{position:absolute;left:38px;top:38px;width:44px;height:44px;border:2px solid #bdf6ff;border-radius:50%;background:#71dbe9b3;box-shadow:0 2px 10px #08162a66;pointer-events:none}
.stick-guide{position:absolute;top:14px;left:0;right:0;text-align:center;font-size:9px;font-weight:bold;letter-spacing:1.5px;color:#d3f4ff;pointer-events:none}
#touch-stick.engaged{border-color:#bdffff;background:#162b4d9c}
.touch-actions{position:absolute;right:max(14px,env(safe-area-inset-right));bottom:calc(var(--dock) + env(safe-area-inset-bottom));display:grid;grid-template-columns:62px 62px;gap:8px}
.touch-actions button{pointer-events:auto;touch-action:none;-webkit-touch-callout:none;min-height:56px;border-radius:16px;border:1px solid #a7c8efb3;background:#182943db;color:#f7faff;padding:8px 4px;box-shadow:0 3px 0 #070e20}
.touch-actions b{display:block;font-size:11px;letter-spacing:1px}.touch-actions small{display:block;font-size:8px;color:#b4cce8;margin-top:5px}
.touch-actions button:active{background:#405a7c;transform:translateY(2px)}
.touch-actions button:disabled{opacity:.65;cursor:default;filter:none}
.touch-actions .touch-power{grid-column:1/-1;min-height:49px;background:#302747e8;border-color:#c7a2ff}
.touch-actions .touch-power.ready{background:#65469af0;border-color:#ead7ff;box-shadow:0 0 13px #c89bff80,0 3px 0 #100c25}
.touch-actions .touch-power.ready small{color:#d6fff2}
.touch-actions .touch-repair{position:absolute;bottom:calc(100% + 9px);right:0;width:132px;min-height:44px;background:#233e46ed;border-color:#b6f1d1}
.touch-mode .keyboard-help,.touch-mode .control-hint{display:none}
.touch-mode .touch-guide{display:block;border:1px solid #8ad8f45e;border-radius:12px;background:#182943da;padding:16px 18px;margin-top:18px}
.touch-guide h2{font:24px Barlow,Impact,sans-serif;color:#d9f8ff;margin:0 0 11px}.touch-guide p{font-size:12px;line-height:1.5;margin:7px 0;color:#e4edff}.touch-guide small{display:block;font-size:11px;color:#bcd5f3;margin-top:12px;line-height:1.5}
.touch-mode .screen{padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right));padding-top:calc(20px + env(safe-area-inset-top));padding-bottom:calc(24px + env(safe-area-inset-bottom));touch-action:pan-y pinch-zoom;scroll-padding:20px}
.touch-mode .menu-screen{place-items:start center}
.touch-mode button{min-height:44px}
.touch-mode .hud-top{display:grid;grid-template-columns:minmax(105px,1fr) 38px 63px auto;gap:6px 9px;padding:calc(7px + env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) 7px max(10px,env(safe-area-inset-left));align-items:center}
.touch-mode .vitals{width:auto;grid-column:1;grid-row:1;min-width:0}
.touch-mode .bar-head{font-size:8px;letter-spacing:0;gap:5px}.touch-mode .bar-head>strong{font-size:15px}
.touch-mode .power-row{gap:5px;margin-top:5px;font-size:8px}.touch-mode .power-row>span:first-child{display:none}.touch-mode .health{height:7px}
.touch-mode .gold-block{grid-column:2;grid-row:1;min-width:0;display:block;text-align:center}.touch-mode .gold-block .coin{display:none}.touch-mode .gold-block strong{font-size:23px}.touch-mode .gold-block>span:last-child{font-size:7px;letter-spacing:0}
.touch-mode .deadline{grid-column:3;grid-row:1;margin:0;padding:0;border:0;min-width:0}.touch-mode .deadline strong{font-size:24px}.touch-mode .deadline>span{font-size:6px;letter-spacing:.4px}.touch-mode .deadline small{display:none}
.touch-mode .hud-actions{grid-column:4;grid-row:1;gap:4px}.touch-mode .icon-button{width:38px;height:44px}
.touch-mode .level-block{grid-column:1/-1;grid-row:2;display:flex;align-items:center;gap:9px;max-width:none;min-width:0}.touch-mode .level-block .bar-head{margin:0;flex:0 1 auto;min-width:110px;white-space:nowrap}.touch-mode .experience{flex:1;height:5px}.touch-mode #xp-hint{display:none}
.touch-mode .objective{top:calc(86px + env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));max-width:calc(100% - 24px)}
.touch-mode .objective h2{font-size:21px;margin:3px 0}.touch-mode .objective p{font-size:10px;line-height:1.35;max-width:340px}
.touch-mode .bottom-hud{min-height:0;display:block;padding:7px max(10px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));background:#111e37ee}
.touch-mode .weapon-dock{max-width:none}.touch-mode .dock-label{font-size:7px;margin-bottom:5px}.touch-mode .dock-label>span{font-size:7px}.touch-mode .run-count{display:none}.touch-mode .last-upgrade{display:block;font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:10px;margin-top:4px}
.touch-mode .loadout-row{grid-template-columns:minmax(0,1fr) 100px;gap:5px}.touch-mode .weapons{gap:4px}.touch-mode .weapon-slot{display:block;min-height:48px;padding:5px;min-width:0}.touch-mode .weapon-slot b{font-size:13px}.touch-mode .weapon-icon,.touch-mode .weapon-level{display:none}.touch-mode .weapon-state{font-size:6px;margin-top:4px}
.touch-mode .special-power{min-height:48px;padding:5px}.touch-mode .special-power b{padding-top:0;max-width:none;font-size:13px}.touch-mode .special-power>span{font-size:6px;margin-top:4px}.touch-mode .special-power kbd{display:none}
.touch-mode .weapon-detail{position:fixed;top:calc(148px + env(safe-area-inset-top));bottom:auto;left:12px;right:12px;width:auto;max-width:480px;margin:auto;padding:12px 54px 12px 14px}.touch-mode .weapon-detail>button{width:44px;height:44px;top:3px;right:3px}.touch-mode .weapon-detail p{font-size:12px}
.touch-mode .dialogue{top:calc(159px + env(safe-area-inset-top));bottom:auto;left:12px;max-width:min(310px,calc(100% - 24px));padding:9px 11px}.touch-mode .dialogue span{font-size:11px}.touch-mode .dialogue b{font-size:8px;letter-spacing:1px;margin-bottom:4px}
.touch-mode .boss-hud{top:calc(151px + env(safe-area-inset-top));left:12px;right:12px;transform:none;width:auto;padding:5px 10px}.touch-mode .boss-hud strong{font-size:19px;margin:1px}.touch-mode .boss-hud small,.touch-mode .boss-hud span{display:none}
.touch-mode:has(#boss-hud:not([hidden])) .dialogue{top:calc(199px + env(safe-area-inset-top))}
.touch-mode .announcement{top:calc(150px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);padding:9px 13px;min-width:0;width:calc(100% - 24px);max-width:370px}.touch-mode .announcement>span{font-size:24px}.touch-mode .announcement p{font-size:10px;margin:5px 0 0}
.touch-mode:has(#announcement:not([hidden])) .dialogue,.touch-mode:has(#announcement:not([hidden])) #boss-hud{visibility:hidden}
.touch-mode .toast{bottom:calc(220px + env(safe-area-inset-bottom));width:max-content;max-width:calc(100% - 24px);font-size:11px}
@media(orientation:landscape){
 .touch-mode .hud-top{grid-template-columns:170px minmax(100px,1fr) 50px 77px auto;gap:10px;padding-top:calc(5px + env(safe-area-inset-top));padding-bottom:5px}
 .touch-mode .level-block{grid-column:2;grid-row:1;display:block}.touch-mode .level-block .bar-head{margin-bottom:5px}.touch-mode .experience{width:100%}
 .touch-mode .gold-block{grid-column:3}.touch-mode .deadline{grid-column:4}.touch-mode .hud-actions{grid-column:5}
 .touch-mode .objective{top:calc(65px + env(safe-area-inset-top));max-width:265px}.touch-mode .objective p{max-width:265px}.touch-mode .objective h2{font-size:19px}
 .touch-mode .dialogue{top:calc(128px + env(safe-area-inset-top));max-width:225px}.touch-mode:has(#boss-hud:not([hidden])) .dialogue{top:calc(128px + env(safe-area-inset-top))}
 .touch-mode .boss-hud{top:calc(67px + env(safe-area-inset-top));left:auto;right:max(12px,env(safe-area-inset-right));width:230px}
 .touch-mode .announcement{top:calc(67px + env(safe-area-inset-top));width:280px;max-width:38%;padding:7px 10px}.touch-mode .announcement>span{font-size:20px}
 .touch-mode .bottom-hud{padding-top:5px;padding-bottom:calc(5px + env(safe-area-inset-bottom))}.touch-mode .dock-label{display:none}.touch-mode .loadout-row{max-width:610px;margin:auto;grid-template-columns:minmax(0,1fr) 130px}.touch-mode .weapon-slot{min-height:44px}.touch-mode .special-power{min-height:44px}
 #touch-controls{--dock:67px}#touch-stick{width:104px;height:104px}.stick-thumb{left:31px;top:31px;width:38px;height:38px}.stick-guide{top:10px;font-size:8px}.touch-actions{grid-template-columns:58px 58px;gap:6px}.touch-actions button{min-height:49px}.touch-actions .touch-power{min-height:44px}
 .touch-mode .weapon-detail{top:calc(85px + env(safe-area-inset-top));max-height:calc(100dvh - 155px);overflow:auto}
 .touch-mode .choice-wrap{max-width:1000px}.touch-mode .choice-options{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.touch-mode .upgrade-card{padding:14px;min-height:210px}.touch-mode .power-preview{position:static;width:100%;height:60px;margin:0}.touch-mode .upgrade-card h3{font-size:22px}.touch-mode .upgrade-card p{font-size:11px}.touch-mode .upgrade-tag{font-size:7px}.touch-mode .choice-wrap h2{font-size:32px}.touch-mode .choice-wrap>p{font-size:11px;margin-bottom:16px}
}
