/* Thumb controls float independently, leaving their empty space touchable. */
:root[data-touch="true"] .topbar{height:calc(44px + env(safe-area-inset-top,0px));gap:8px}
:root[data-touch="true"] .regions button{font-size:14px}
:root[data-touch="true"] .top-actions button{min-height:36px}
:root[data-touch="true"] .icon-button{width:36px;height:36px;font-size:18px}
:root[data-touch="true"] .player-panel{top:6px;left:max(6px,var(--safe-left));width:206px;max-width:30%;padding:5px 7px;gap:6px;pointer-events:none;border-radius:10px;background:#0d1c2eea}
:root[data-touch="true"] .player-panel .portrait{width:25px;height:37px}
:root[data-touch="true"] .player-name{margin-bottom:3px;gap:4px;flex-wrap:nowrap}
:root[data-touch="true"] .player-name strong{font-size:14px;line-height:19px}
:root[data-touch="true"] .player-name>span{font-size:12px}
:root[data-touch="true"] .resource,:root[data-touch="true"] .target-panel .resource{height:17px;border-radius:5px}
:root[data-touch="true"] .resource span{font-size:12px;line-height:15px}
:root[data-touch="true"] .resource.mp{margin-top:3px}
:root[data-touch="true"] .exp-track{margin-top:4px}
:root[data-touch="true"] .target-panel{top:6px;left:50%;right:auto;transform:translateX(-50%);width:240px;max-width:32%;padding:5px 7px;border-radius:10px;background:#151c2ceb;pointer-events:none}
:root[data-touch="true"] .target-panel>span{font-size:13px;line-height:18px}
:root[data-touch="true"] .target-panel .resource{margin-top:3px}
:root[data-touch="true"] .boss-timer{margin-top:3px}
:root[data-touch="true"] .boss-timer span{font-size:12px;line-height:17px}
:root[data-touch="true"] .boss-timer strong{font-size:14px;line-height:17px}
:root[data-touch="true"] .right-hud{top:6px;right:max(6px,var(--safe-right));width:178px;max-width:26%}
:root[data-touch="true"] .quest{border-radius:9px;padding:0 7px;background:#101f30e8}
:root[data-touch="true"] .quest strong{font-size:13px;line-height:19px}
:root[data-touch="true"] #quest-toggle{min-height:36px}
:root[data-touch="true"] #quest-body{font-size:14px;max-height:calc(var(--app-height) - 175px)}
:root[data-touch="true"] .skills-wrap{left:auto;right:max(8px,var(--safe-right));bottom:54px;width:var(--dock-width);height:var(--skillbar-height);max-width:none;transform:none;z-index:8;pointer-events:none}
:root[data-touch="true"] .skillbar{display:block;position:relative;width:100%;height:100%;padding:0;border:0;border-radius:0;background:none;box-shadow:none;backdrop-filter:none;pointer-events:none}
:root[data-touch="true"] .skillbar .skill{position:absolute;left:var(--control-x);top:var(--control-y);width:var(--control-size);height:var(--control-size);min-width:0;border-radius:13px;border:1px solid #8aa7b8;background:#10263bed;box-shadow:0 3px 9px #0007,inset 0 1px #fff4;overflow:hidden;pointer-events:auto;touch-action:none}
:root[data-touch="true"] .skillbar .skill-icon{border-radius:12px;opacity:.96}
:root[data-touch="true"] .skillbar .skill-name{font-size:12px;line-height:17px;bottom:0;padding:1px 0;background:linear-gradient(transparent,#06111ff5 20%);font-weight:600}
:root[data-touch="true"] .skillbar .skill-level,:root[data-touch="true"] .skillbar .skill kbd{display:none}
:root[data-touch="true"] .skillbar .cooldown{font-size:24px;font-weight:750;padding-bottom:10px}
:root[data-touch="true"] .skillbar .skill[data-skill="attack"]{border-radius:50%;border:2px solid #e4d39e;box-shadow:0 4px 14px #0008,inset 0 0 0 3px #f2da9d4d}
:root[data-touch="true"] .skillbar .skill[data-skill="attack"] .skill-icon{border-radius:50%}
:root[data-touch="true"] .skillbar .skill[data-skill="attack"] .skill-name{font-size:14px;bottom:9px;background:#071628bf;line-height:20px}
:root[data-touch="true"] .skillbar .utility-skill{border-radius:50%;border-color:#8bcabb}
:root[data-touch="true"] .skillbar .potion{border-color:#d798a8}
:root[data-touch="true"] .skillbar .utility-skill .skill-name{bottom:6px;background:none;font-size:12px}
:root[data-touch="true"] .skill-art{font-size:30px;padding-bottom:12px}
:root[data-touch="true"] .skillbar .skill:active{border-color:#b2ffeb;filter:brightness(1.25)}
:root[data-touch="true"] .bottom-right{left:max(6px,var(--safe-left));right:auto;bottom:6px;width:min(362px,calc(100% - 12px - var(--safe-left) - var(--safe-right)));max-width:none;display:grid;grid-template-columns:1.15fr 1fr 1fr 1fr;gap:5px;transform:none;z-index:8;pointer-events:none}
:root[data-touch="true"] .bottom-right .bag-button{pointer-events:auto;min-height:40px;min-width:0;padding:4px 5px;border-radius:9px;justify-content:center;box-shadow:0 3px 10px #0005;backdrop-filter:none;background:#14283bec}
:root[data-touch="true"] .bottom-right .bag-button>div{font-size:13px;line-height:18px;white-space:nowrap}
:root[data-touch="true"] .bottom-right .bag-button>img,:root[data-touch="true"] .bottom-right .bag-button>span,:root[data-touch="true"] .bottom-right .bag-button small{display:none}
:root[data-touch="true"] .bottom-right .auto-skill-toggle[aria-pressed="true"]{background:#154b46ed;border-color:#84dfc8}
:root[data-touch="true"] #auto-skills-state{font-size:12px;line-height:17px}
:root[data-touch="true"] .bag-button>b{min-width:18px;height:18px;line-height:18px;font-size:12px;right:-2px;top:-5px;background:#ffda8c;color:#2a2415}
:root[data-touch="true"] .bottom-left{left:max(6px,var(--safe-left));right:auto;top:auto;bottom:54px;width:auto;max-width:min(240px,55%);pointer-events:none}
:root[data-touch="true"] .currency{padding:3px 6px;gap:5px;flex-wrap:wrap;box-shadow:none;background:#0b1b2ac9;border-radius:7px;backdrop-filter:none}
:root[data-touch="true"] .currency b,:root[data-touch="true"] .currency>span{font-size:12px;line-height:17px}
:root[data-touch="true"] .currency .currency-symbol{width:17px;height:17px;flex-basis:17px;line-height:17px}
:root[data-touch="true"] .auto-run-banner{left:max(6px,var(--safe-left));right:auto;top:86px;bottom:auto;transform:none;max-width:min(330px,50%);min-height:32px;padding:3px 7px;gap:5px;font-size:12px;line-height:18px;border-radius:8px;background:#0f2d3bdf}
:root[data-touch="true"] .auto-run-banner button{font-size:12px;line-height:18px;min-height:32px;padding:3px 7px}
:root[data-touch="true"] .interact-wrap{right:max(8px,var(--safe-right));left:auto;bottom:calc(var(--dock-height) + 8px);transform:none}
:root[data-touch="true"] .interact-button{min-height:40px;font-size:14px;padding:5px 12px}
:root[data-touch="true"] #toast-stack{top:24%;max-width:330px;width:85%;pointer-events:none}
:root[data-touch="true"] .toast{font-size:14px;padding:6px 10px;border-radius:8px;background:#11253de8}
#joystick{background:#102b3c5e;border-color:#b5ddd2a6;box-shadow:0 0 0 5px #07172524}
#joystick-knob{background:#afe4d67a;border:1px solid #d5fff2a6;box-shadow:0 2px 8px #0004}
@media(max-width:699px){
 :root[data-touch="true"] .player-panel{width:43%;max-width:none;padding:5px 6px}
 :root[data-touch="true"] .player-panel .portrait,:root[data-touch="true"] .player-name .class-icon{display:none}
 :root[data-touch="true"] .player-name{flex-wrap:wrap;gap:0 4px}
 :root[data-touch="true"] .player-name>span{font-size:12px}
 :root[data-touch="true"] .target-panel{top:6px;left:auto;right:max(6px,var(--safe-right));transform:none;width:52%;max-width:none;padding:5px 6px}
 :root[data-touch="true"] .right-hud{top:86px;width:43%;max-width:none}
 :root[data-touch="true"] .auto-run-banner{top:86px;max-width:52%;gap:4px;padding:2px 5px;flex-wrap:wrap}
 :root[data-touch="true"] #auto-run-mode{white-space:normal;line-height:18px}
 :root[data-touch="true"] .auto-run-banner button{min-height:32px}
 :root[data-touch="true"] .bottom-left{bottom:calc(var(--dock-height) + 2px);max-width:60%}
}
@media(max-width:479px){
 :root[data-touch="true"] .topbar{height:calc(74px + env(safe-area-inset-top,0px));flex-wrap:wrap;gap:0}
 :root[data-touch="true"] .top-actions{height:38px;width:100%;justify-content:flex-end}
 :root[data-touch="true"] .regions{height:36px;width:100%;justify-content:space-around}
 :root[data-touch="true"] .regions button{font-size:13px;min-height:34px}
 :root[data-touch="true"] .main-menu-button{font-size:13px}
 :root[data-touch="true"] .bottom-right .bag-button>div{font-size:12px}
 :root[data-touch="true"] .bottom-right .bag-button{padding:4px 2px;min-height:40px}
}
:root[data-touch="true"][data-control-layout="compact"] .skills-wrap{bottom:8px}
:root[data-touch="true"][data-control-layout="compact"] .bottom-right{width:280px;gap:4px}
:root[data-touch="true"][data-control-layout="compact"] .bottom-right .bag-button>div{font-size:12px}
:root[data-touch="true"][data-control-layout="compact"] .auto-run-banner{top:83px;max-width:45%}
:root[data-touch="true"][data-control-layout="compact"] .bottom-left{bottom:52px;max-width:40%}
@media(max-width:699px){
 :root[data-touch="true"][data-control-layout="compact"] .player-panel{width:30%;max-width:30%}
 :root[data-touch="true"][data-control-layout="compact"] .target-panel{width:32%;max-width:32%;left:50%;right:auto;transform:translateX(-50%)}
 :root[data-touch="true"][data-control-layout="compact"] .right-hud{top:6px;width:26%;max-width:26%}
}
