body.touch-enabled,body.touch-enabled #game{overscroll-behavior:none}
body.touch-enabled #game{height:100dvh;min-height:0;touch-action:none}
.mobile-help{display:none}
body.touch-enabled .mobile-help{display:block}
body.touch-enabled .desktop-help{display:none}
body.touch-enabled #scene{touch-action:none}
#intermission-options button{border:1px solid #9b8d7899;background:#182128e9;padding:10px 8px;color:#f8d69e;font:inherit;font-size:10px;line-height:1.4;cursor:pointer;pointer-events:auto;touch-action:manipulation}
#intermission-options button b{display:block;color:#fff;font-size:13px;margin-top:5px}
#intermission-options button small{display:block;color:#bfc9c3;font-size:9px;line-height:1.3;margin-top:5px;letter-spacing:0}
#intermission-options button:hover{border-color:#ffc877;background:#2a3439}
#intermission-reroll{pointer-events:auto;touch-action:manipulation;background:#322a28;color:#ffe5bd;border:1px solid #ffc877;padding:6px 10px;margin:2px 0 8px;font:10px Arial,sans-serif;cursor:pointer}
body.touch-enabled #controls,body.touch-enabled.playing .masthead{display:none}
#touch-ui{position:absolute;inset:0;z-index:9;pointer-events:none;user-select:none;-webkit-user-select:none;font-family:Arial,sans-serif}
#touch-ui button,.touch-stick{pointer-events:auto;touch-action:none;-webkit-tap-highlight-color:transparent}
#touch-ui button{border:1px solid #f8e4bc9c;background:#12222acd;color:#fff2d6;font-weight:900;box-shadow:0 2px 12px #0008}
#touch-ui button:active{background:#fa9a55;color:#172029}
#touch-ui button:disabled{opacity:.42}
#touch-ui button small{display:block;font-size:8px;letter-spacing:.6px;margin-top:2px}
.touch-toolbar{position:absolute;top:calc(env(safe-area-inset-top) + 8px);right:calc(env(safe-area-inset-right) + 10px);display:flex;gap:7px}
.touch-toolbar button{width:39px;height:37px;border-radius:8px;font-size:20px}
.touch-quick{position:absolute;top:calc(env(safe-area-inset-top) + 54px);right:calc(env(safe-area-inset-right) + 9px);display:flex;gap:5px;max-width:48vw;flex-wrap:wrap;justify-content:flex-end}
.touch-quick button{width:56px;height:45px;border-radius:8px;font-size:18px;line-height:1}
#touch-shop{border-color:#ffbd6a!important;color:#ffe3b5!important;background:#493021ed!important}
#touch-shop svg{width:21px;height:21px;display:block;margin:0 auto}
.touch-stick{position:absolute;width:118px;height:118px;border:2px solid #f2dfb480;border-radius:50%;background:radial-gradient(circle,#223844a3 0%,#0c202ba3 65%,#06141ca8 100%);box-shadow:0 0 0 7px #f2dfb41b,inset 0 0 15px #0007}
.touch-stick.engaged{border-color:#f8ae68;box-shadow:0 0 0 7px #f8ae682c,0 0 24px #f8ae6860}
.touch-stick-thumb{position:absolute;left:50%;top:50%;width:55px;height:55px;border-radius:50%;transform:translate(-50%,-50%);display:grid;place-items:center;background:#e9e0c9d9;border:2px solid #fff7dd;box-shadow:0 3px 11px #0008;color:#122330}
.touch-stick-thumb b{font:900 28px Arial,sans-serif}
.touch-stick>small{position:absolute;top:-24px;left:0;right:0;text-align:center;font-size:10px;letter-spacing:2px;color:#fff0cf;text-shadow:1px 2px 4px #000}
#touch-move{left:calc(env(safe-area-inset-left) + 23px);bottom:calc(env(safe-area-inset-bottom) + 25px)}
#touch-fire{right:calc(env(safe-area-inset-right) + 22px);bottom:calc(env(safe-area-inset-bottom) + 93px)}
#touch-jump{position:absolute;right:calc(env(safe-area-inset-right) + 35px);bottom:calc(env(safe-area-inset-bottom) + 17px);width:92px;height:54px;border-radius:13px;font-size:11px;letter-spacing:1px}
#touch-jump span{font-size:20px;margin-left:4px}
#touch-medkit{position:absolute;left:calc(env(safe-area-inset-left) + 42px);bottom:calc(env(safe-area-inset-bottom) + 197px);width:68px;height:68px;padding:5px;border-radius:16px}
#touch-medkit svg{width:47px;height:47px;display:block;margin:auto}
#touch-medkit small{position:absolute;right:-5px;bottom:-6px;background:#f48758;color:#161b1d;border-radius:50%;min-width:20px;line-height:20px;font-size:12px;margin:0}
.touch-skills{position:absolute;right:calc(env(safe-area-inset-right) + 158px);bottom:calc(env(safe-area-inset-bottom) + 120px);display:flex;flex-direction:column-reverse;gap:8px}
.touch-skills button{width:58px;height:51px;border-radius:12px;font-size:10px}
.touch-tip{position:absolute;bottom:calc(env(safe-area-inset-bottom) + 13px);left:50%;transform:translateX(-50%);font-size:9px;letter-spacing:1px;text-shadow:1px 2px 3px #000;white-space:nowrap;color:#d8d8c8}
body.touch-enabled #intermission{top:104px;padding:8px 10px;width:min(440px,92vw)}
body.touch-enabled #intermission>strong{font-size:29px}
body.touch-enabled #intermission>span{font-size:9px}
body.touch-enabled #intermission-options{margin:5px 0;gap:4px}
body.touch-enabled #intermission-options button{font-size:9px;min-height:67px;padding:5px;line-height:1.1;touch-action:manipulation}
body.touch-enabled #intermission-options b{font-size:10px;margin-top:3px}
body.touch-enabled #intermission-options button small{font-size:8px;line-height:1.2;margin-top:3px}
body.touch-enabled #intermission-tip{display:none}
body.touch-enabled #intermission-reroll:not([hidden]){display:inline-block;margin-top:5px}
body.touch-enabled #ready-wave{top:73%;min-width:190px;min-height:51px;padding:6px 12px;z-index:10}
body.touch-enabled #ready-wave>span{font-size:15px}
body.touch-enabled #ready-wave small{font-size:8px}
body.touch-enabled #ready-wave small b{display:none}
body.touch-enabled #intermission,body.touch-enabled #intermission-options button,body.touch-enabled #intermission-reroll{pointer-events:auto}
body.touch-enabled .hud-top{top:calc(env(safe-area-inset-top) + 5px);left:12px;right:120px}
body.touch-enabled .hud-top strong{font-size:20px;line-height:1}
body.touch-enabled .hud-top span{font-size:8px}
body.touch-enabled .hud-top small{font-size:8px}
body.touch-enabled .score-block{position:absolute;left:180px;top:5px;text-align:left}
body.touch-enabled .score-block>span,body.touch-enabled .score-block>strong,body.touch-enabled #timer{display:none}
body.touch-enabled #coins{white-space:nowrap;font-size:10px;margin:0;color:#ffd37d}
body.touch-enabled .hud-bottom{top:calc(env(safe-area-inset-top) + 45px);bottom:auto;left:12px;right:auto;width:205px;display:block}
body.touch-enabled .health-panel,body.touch-enabled .ammo-panel{min-width:0;padding:4px 6px;border:0;background:#09121bbd}
body.touch-enabled .health-panel>span,body.touch-enabled .ammo-panel>span{font-size:8px}
body.touch-enabled .health-panel>strong{font-size:16px;margin:0}
body.touch-enabled .health-panel>div,body.touch-enabled .health-panel>small,body.touch-enabled .ammo-panel>small,body.touch-enabled .ammo-panel>div>span{display:none!important}
body.touch-enabled .ammo-panel{text-align:left;margin-top:2px}
body.touch-enabled .ammo-panel strong{font-size:17px}
body.touch-enabled .threat-panel,body.touch-enabled #radar,body.touch-enabled #arsenal,body.touch-enabled #skills,body.touch-enabled #progress{display:none}
body.touch-enabled #remaining{display:none}
body.touch-enabled #boss-status{font-size:8px;top:calc(env(safe-area-inset-top) + 93px)}
body.touch-enabled #loot-hint{top:35%;font-size:9px}
body.touch-enabled #structure-hint{bottom:31%;font-size:9px}
body.touch-enabled #place-hint{top:45%;font-size:9px;max-width:50vw}
body.touch-enabled .shop-panel,body.touch-enabled .inventory-panel{touch-action:pan-y;overscroll-behavior:contain}
body.touch-enabled .shop-panel{width:96vw;max-height:92dvh;padding:14px}
body.touch-enabled #shop-defenses,body.touch-enabled #shop-weapons{grid-template-columns:repeat(2,minmax(0,1fr))}
body.touch-enabled .shop-item{min-height:78px;padding:7px}
body.touch-enabled .shop-panel h2{font-size:28px}
body.touch-enabled .menu-copy{width:88%;left:6%}
body.touch-enabled .story{font-size:12px}
@media (orientation:portrait){
 body.touch-enabled #touch-move{bottom:calc(env(safe-area-inset-bottom) + 46px)}
 body.touch-enabled #touch-fire{bottom:calc(env(safe-area-inset-bottom) + 120px)}
 body.touch-enabled #touch-jump{bottom:calc(env(safe-area-inset-bottom) + 36px)}
 body.touch-enabled #touch-medkit{bottom:calc(env(safe-area-inset-bottom) + 217px)}
 body.touch-enabled .score-block{left:0;top:160px}
 body.touch-enabled .touch-skills{bottom:calc(env(safe-area-inset-bottom) + 147px)}
 body.touch-enabled #intermission{top:205px;width:92vw}
 body.touch-enabled #ready-wave{top:56%}
}
@media (max-height:430px){
 body.touch-enabled .masthead{height:42px;margin:0 3%}
 body.touch-enabled .brand-mark{font-size:24px}
 body.touch-enabled .brand small,body.touch-enabled .edition,body.touch-enabled .issue-stamp,body.touch-enabled .scene-caption{display:none}
 body.touch-enabled .overlay{inset:42px 0 0}
 body.touch-enabled .menu-copy{top:12px;transform:none;left:6%;width:65%}
 body.touch-enabled .menu-copy h1{font-size:clamp(42px,6vw,58px);margin:6px 0 10px}
 body.touch-enabled .menu-copy .story{font-size:10px;line-height:1.35;margin-bottom:8px}
 body.touch-enabled .game-tags{font-size:6px;margin-bottom:8px}
 body.touch-enabled .menu-copy .primary{height:37px;font-size:9px}
 body.touch-enabled .menu-secondary,body.touch-enabled .load-status{margin-top:5px}
 body.touch-enabled #help{top:0;left:100%;width:min(290px,45vw);max-height:calc(100dvh - 56px)}
 body.touch-enabled .touch-stick{width:98px;height:98px}
 body.touch-enabled .touch-stick-thumb{width:48px;height:48px}
 body.touch-enabled #touch-move{bottom:calc(env(safe-area-inset-bottom) + 20px)}
 body.touch-enabled #touch-fire{bottom:calc(env(safe-area-inset-bottom) + 68px)}
 body.touch-enabled #touch-jump{height:42px;bottom:calc(env(safe-area-inset-bottom) + 10px)}
 body.touch-enabled #touch-medkit{bottom:calc(env(safe-area-inset-bottom) + 153px)}
 body.touch-enabled .touch-skills{bottom:calc(env(safe-area-inset-bottom) + 88px)}
 body.touch-enabled .touch-skills button{height:39px}
 body.touch-enabled #intermission{top:104px}
}
