.mobile-help{display:flex;align-items:flex-start;gap:10px;max-width:430px;margin:17px 0 0;color:#b6bdaf;font:11px/1.6 var(--sans)}
.mobile-help svg{flex:none;margin-top:2px;color:var(--red)}
.controls-mode-row select{grid-column:1/-1;width:100%;min-height:42px;padding:8px 29px 8px 10px;border:1px solid #49513f;border-radius:0;background:#20261a;color:var(--fg);font:13px var(--sans)}
.controls-mode-row select:focus-visible{outline:2px solid var(--red);outline-offset:3px}

.mobile-controls{--touch-left:max(18px,env(safe-area-inset-left));--touch-right:max(18px,env(safe-area-inset-right));--touch-top:max(12px,env(safe-area-inset-top));--touch-bottom:max(12px,env(safe-area-inset-bottom));position:absolute;inset:0;z-index:12;overflow:hidden;pointer-events:none;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;color:#f1eee4;font-family:var(--mono)}
.mobile-controls *{box-sizing:border-box;touch-action:none;-webkit-tap-highlight-color:transparent}
.mobile-rotate-hint{display:none;position:absolute;top:calc(var(--touch-top) + 56px);left:14px;right:14px;z-index:2;margin:0;text-align:center;color:#cbcfc0;font:9px/1.5 var(--mono);letter-spacing:.1px;text-shadow:0 1px 4px #000;pointer-events:none}
.mobile-look{position:absolute;inset:0;z-index:0;pointer-events:auto}
.mobile-look-hint{position:absolute;right:28%;top:58%;font-size:8px;letter-spacing:1.4px;color:#fff8;text-shadow:0 1px 3px #000;pointer-events:none}
.mobile-move{position:absolute;z-index:1;left:var(--touch-left);bottom:calc(var(--touch-bottom) + 43px);width:128px;height:128px;border:1px solid #eee8;border-radius:50%;background:radial-gradient(circle,transparent 44%,#c4cec508 45%,#c4cec508 62%,transparent 63%),#090b092b;box-shadow:0 2px 14px #0002,inset 0 0 18px #0002;pointer-events:auto}
.mobile-move-guides{position:absolute;inset:0;width:100%;height:100%;color:#f3eee4a8;pointer-events:none}
.mobile-stick{position:absolute;left:50%;top:50%;width:49px;height:49px;transform:translate(calc(-50% + var(--stick-x,0px)),calc(-50% + var(--stick-y,0px)));display:grid;place-items:center;border:1px solid #f3eee4a6;border-radius:50%;background:#1115108c;box-shadow:inset 0 0 0 5px #fff07,0 2px 12px #0005;pointer-events:none;will-change:transform}
.mobile-stick i{width:5px;height:5px;background:#e9ebd7;border-radius:50%}
.mobile-move-label{position:absolute;top:calc(100% + 8px);left:0;right:0;text-align:center;font-size:8px;letter-spacing:1.5px;color:#fffc;text-shadow:0 1px 4px #000;pointer-events:none}
.mobile-move.is-pressed{border-color:#ff685dd9;background-color:#28101042}
.mobile-move.is-pressed .mobile-stick{border-color:#ff756c;background:#a82c2380}
.mobile-button{position:absolute;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:44px;min-height:44px;padding:0;border:1px solid #edeae38c;border-radius:50%;color:#f3eee7;background:#0a0c095c;box-shadow:0 2px 12px #0002;pointer-events:auto;cursor:pointer}
.mobile-button svg,.mobile-button span{pointer-events:none}
.mobile-button span{font:8px/1 var(--mono);letter-spacing:.6px}
.mobile-button.is-pressed,.mobile-button:active{color:#fff;border-color:#ff8c80;background:#da3a2dc2;box-shadow:0 0 17px #ef3e303d}
.mobile-button:focus-visible{outline:2px solid #ffd5c7;outline-offset:3px}
.mobile-fire{right:calc(var(--touch-right) + 83px);bottom:calc(var(--touch-bottom) + 91px);width:74px;height:74px;border:1px solid #ff8a80c4;background:#7c211a70;box-shadow:inset 0 0 0 5px #ef3e300c,0 2px 15px #0003}
.mobile-jump{right:var(--touch-right);bottom:calc(var(--touch-bottom) + 143px);width:58px;height:58px}
.mobile-crouch{right:calc(var(--touch-right) + 3px);bottom:calc(var(--touch-bottom) + 76px);width:50px;height:50px}
.mobile-weapons{position:absolute;z-index:2;right:calc(var(--touch-right) + 22px);bottom:calc(var(--touch-bottom) + 19px);display:flex;align-items:center;gap:9px;pointer-events:none}
.mobile-weapons>span{font:8px var(--mono);letter-spacing:1px;color:#eee9db;text-shadow:0 1px 4px #000}
.mobile-weapon{position:relative;width:44px;height:44px;min-width:44px;border-radius:5px;background:#0c0e0b70}
.mobile-system{position:absolute;z-index:2;right:var(--touch-right);top:var(--touch-top);display:flex;gap:8px;pointer-events:none}
.mobile-system-button{position:relative;width:44px;height:44px;min-width:44px;border-radius:5px;border-color:#f0eadd64;background:#0a0c096b}

@media(orientation:portrait){
  .mobile-rotate-hint{display:block}
  .mobile-move{bottom:calc(var(--touch-bottom) + 118px);width:122px;height:122px}
  .mobile-fire{right:calc(var(--touch-right) + 76px);bottom:calc(var(--touch-bottom) + 176px);width:72px;height:72px}
  .mobile-jump{bottom:calc(var(--touch-bottom) + 245px);width:56px;height:56px}
  .mobile-crouch{bottom:calc(var(--touch-bottom) + 177px)}
  .mobile-weapons{right:var(--touch-right);bottom:calc(var(--touch-bottom) + 110px);gap:8px}
  .mobile-look-hint{top:48%;right:13%}
}
@media(orientation:landscape) and (max-height:370px){
  .mobile-move{width:116px;height:116px;bottom:calc(var(--touch-bottom) + 40px)}
  .mobile-fire{width:68px;height:68px;bottom:calc(var(--touch-bottom) + 81px)}
  .mobile-jump{width:54px;height:54px;bottom:calc(var(--touch-bottom) + 128px)}
  .mobile-crouch{width:48px;height:48px;bottom:calc(var(--touch-bottom) + 67px)}
  .mobile-weapons{bottom:calc(var(--touch-bottom) + 12px)}
  .mobile-look-hint{top:51%}
}
@media(max-width:380px) and (orientation:portrait){
  .mobile-move{width:110px;height:110px}
  .mobile-fire{right:calc(var(--touch-right) + 68px);width:66px;height:66px}
}
@media(hover:none) and (pointer:coarse){
  .setup-field input,.setup-field select{font-size:16px}
  .settings-dialog{max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain}
  .settings-dialog .setting-row{margin:18px 0}
  .settings-dialog h2{margin-bottom:22px}
}
