#touch-controller{position:fixed;inset:0;pointer-events:none;z-index:10;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
#touch-controller[hidden],#touch-controller [hidden],#touch-more[hidden]{display:none!important}
#touch-controller button,#touch-stick{pointer-events:auto;touch-action:none;-webkit-tap-highlight-color:transparent}
.touch-stick-wrap{position:absolute;left:max(22px,env(safe-area-inset-left));bottom:max(17px,env(safe-area-inset-bottom));display:grid;justify-items:center;gap:7px}
#touch-stick{width:140px;height:140px;border:2px solid #fff9;background:#1723398c;border-radius:50%;position:relative;box-shadow:0 2px 10px #0004}
#touch-thumb{position:absolute;width:55px;height:55px;left:calc(50% - 27.5px);top:calc(50% - 27.5px);border-radius:50%;background:#f8f0d9d9;border:2px solid #fff;box-shadow:0 2px 7px #0006;pointer-events:none}
.touch-cross{position:absolute;inset:12px;display:grid;place-content:center;text-align:center;font:28px/1.4 system-ui;color:#fff7;pointer-events:none}
.touch-caption{font:11px system-ui;color:white;text-shadow:0 1px 3px #000,0 1px 8px #000}
.touch-actions{position:absolute;right:max(22px,env(safe-area-inset-right));bottom:max(22px,env(safe-area-inset-bottom));display:grid;grid-template-columns:70px 86px;grid-template-rows:62px 76px;gap:10px;align-items:center}
#touch-controller button{font:600 12px system-ui;border:2px solid #fff9;background:#172339b8;color:#fff;border-radius:18px;box-shadow:0 2px 8px #0004;min-height:52px;padding:8px;cursor:pointer}
#touch-controller button[data-held],#touch-controller button:active{background:#f8f0d9;color:#172339;border-color:#fff;transform:scale(.96)}
#touch-controller .touch-jump{grid-column:2;grid-row:1/3;width:86px;height:86px;border-radius:50%;background:#ffe08fd9;color:#172339;font-size:15px;border-color:#fff5dc}
.touch-jump span{display:block;font-size:11px;opacity:.7}.touch-use{grid-column:1;grid-row:2}.touch-throw{grid-column:1;grid-row:1}
.touch-extras{position:absolute;right:max(16px,env(safe-area-inset-right));top:max(64px,calc(env(safe-area-inset-top) + 56px));display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end;max-width:400px;padding:9px;background:#161c2bdf;border:1px solid #fff6;border-radius:14px;pointer-events:auto}
.touch-orientation{display:none;position:absolute;left:14px;right:14px;top:max(63px,calc(env(safe-area-inset-top) + 55px));text-align:center;font:11px system-ui;color:#fff;background:#161c2bb8;padding:7px;border-radius:8px}
body.touch-mode #tools{z-index:20;gap:5px}body.touch-mode #tools button{font-size:11px;padding:8px}body.touch-mode #unity-canvas{touch-action:none}
@media(orientation:portrait){.touch-orientation{display:block}.touch-extras{top:110px;max-width:calc(100vw - 32px)}}
@media(max-height:450px){#touch-stick{width:116px;height:116px}.touch-actions{grid-template-columns:62px 78px;grid-template-rows:50px 64px;gap:7px}#touch-controller .touch-jump{width:78px;height:78px}.touch-stick-wrap{bottom:max(8px,env(safe-area-inset-bottom))}.touch-actions{bottom:max(10px,env(safe-area-inset-bottom))}#touch-controller button{min-height:46px}}
@media(max-width:360px){#touch-stick{width:116px;height:116px}.touch-stick-wrap{left:12px}.touch-actions{right:12px;gap:6px;grid-template-columns:57px 75px}#touch-controller .touch-jump{width:75px;height:75px;font-size:13px}#touch-controller button{font-size:10px}}

#touch-controller button small{display:block;font-size:10px;line-height:1.2;opacity:.75;margin-top:2px}
.touch-actions[data-count="1"]{grid-template-columns:auto;grid-template-rows:auto}
#touch-controller .touch-actions[data-count="1"] .touch-jump{grid-column:1;grid-row:1}
.touch-actions[data-count="2"]{grid-template-rows:auto;align-items:end}
#touch-controller .touch-actions[data-count="2"] .touch-jump{grid-column:2;grid-row:1}
.touch-actions[data-count="2"] .touch-use{grid-column:1;grid-row:1}
