#wolfz-mobile-controls{position:fixed;inset:0;z-index:7;pointer-events:none;user-select:none;-webkit-user-select:none;--safe-left:env(safe-area-inset-left,0px);--safe-right:env(safe-area-inset-right,0px);--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);font:14px system-ui,-apple-system,sans-serif;color:#eee7f7}
#wolfz-mobile-controls[hidden]{display:none}
#wolfz-mobile-controls:before,#wolfz-mobile-controls:after{content:'';position:absolute;top:0;bottom:0;width:100px;background:linear-gradient(90deg,#100d16f5,#19121eea);z-index:-1}
#wolfz-mobile-controls:before{left:var(--safe-left)}#wolfz-mobile-controls:after{right:var(--safe-right);transform:scaleX(-1)}
#wolfz-mobile-controls button{pointer-events:auto;touch-action:manipulation;color:inherit;font:600 13px system-ui,-apple-system,sans-serif;min-width:44px;min-height:44px;box-sizing:border-box;border:1px solid #694d83;border-radius:10px;background:linear-gradient(#302439,#1b1524);display:flex;align-items:center;justify-content:center;gap:8px;padding:0 12px;-webkit-tap-highlight-color:transparent}
#wolfz-mobile-controls button:active{background:#704598;border-color:#d5a7ff}
#wolfz-mobile-controls svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.wz-phone-hud{pointer-events:none;position:absolute;left:var(--safe-left);right:var(--safe-right);top:var(--safe-top);height:44px;background:linear-gradient(#211729f5,#15101def);border-bottom:1px solid #55386c;display:flex;align-items:center;gap:10px;padding:0 8px;box-sizing:border-box}
.wz-phone-identity{width:135px;min-width:65px;line-height:15px}.wz-phone-identity strong{display:block;font-size:12px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.wz-phone-identity small{font-size:10px;letter-spacing:1px;color:#b5a3c6}
.wz-phone-meter{flex:1;min-width:80px;height:23px;background:#0b0811;border:1px solid #72506b;position:relative;border-radius:5px;overflow:hidden}.wz-phone-meter.mp{border-color:#425179}.wz-phone-meter i{display:block;height:100%;background:linear-gradient(#cf535c,#9f2938);width:100%;transition:width .12s linear}.wz-phone-meter.mp i{background:linear-gradient(#4b8bc8,#285a9c)}.wz-phone-meter span{position:absolute;inset:0;display:grid;place-items:center;font-size:12px;font-weight:700;text-shadow:0 1px 3px #000}
.wz-phone-hud button{height:40px;min-height:40px;padding:0 10px;font-size:12px;border-color:transparent;background:transparent;gap:5px}.wz-phone-hud button svg{width:20px;height:20px}
.wz-phone-joystick{pointer-events:auto;touch-action:none;position:absolute;left:calc(3px + var(--safe-left));bottom:calc(66px + var(--safe-bottom));width:88px;height:88px;border-radius:50%;background:radial-gradient(circle,#3b294e80 20%,#1c142dcc 65%);border:1px solid #765b9180;box-shadow:inset 0 0 18px #08050d70;display:grid;place-items:center}
.wz-stick-guide{font-size:56px;color:#a788c32a;line-height:1}.wz-phone-joystick i{position:absolute;width:36px;height:36px;border:1px solid #bf96dd80;border-radius:50%;background:radial-gradient(circle at 40% 30%,#775b8f,#32253f);box-shadow:0 3px 9px #0008;pointer-events:none}
.wz-phone-actions{position:absolute;right:calc(8px + var(--safe-right));bottom:calc(62px + var(--safe-bottom));display:flex;flex-direction:column;gap:7px}
#wolfz-mobile-controls .wz-phone-actions button{width:76px;height:48px;font-size:11px;padding:0 6px;gap:5px;border-color:#6d5285;background:linear-gradient(#30223aeb,#1b1424e8)}.wz-phone-actions button svg{width:21px;height:21px}
#wolfz-mobile-controls .wz-phone-back{display:none;position:absolute;right:calc(16px + var(--safe-right));top:calc(10px + var(--safe-top));height:44px;min-width:84px;background:#4e3265;z-index:4}
.wz-phone-dialog-header{display:none;position:absolute;left:var(--safe-left);right:var(--safe-right);top:var(--safe-top);height:56px;box-sizing:border-box;padding:14px 116px 8px 24px;background:#1d1427;border-bottom:1px solid #604178;align-items:center}.wz-phone-dialog-header strong{font-size:18px;font-weight:650;color:#ead4ff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dialog-open .wz-phone-dialog-header{display:flex}
.dialog-open .wz-phone-hud,.dialog-open .wz-phone-joystick,.dialog-open .wz-phone-actions,.dialog-open:before,.dialog-open:after{display:none!important}#wolfz-mobile-controls.dialog-open .wz-phone-back{display:flex}
.wz-phone-menu{pointer-events:auto;position:absolute;inset:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);padding:20px 24px;background:linear-gradient(135deg,#23152dfc,#110e19fc);box-sizing:border-box;overflow:auto;z-index:3}.wz-phone-menu[hidden]{display:none}.wz-phone-menu h1{margin:0 130px 18px 0;font-size:22px;font-weight:650;letter-spacing:.5px;color:#ead4ff}#wolfz-mobile-controls .wz-menu-close{position:absolute;right:20px;top:12px}.wz-phone-menu-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}#wolfz-mobile-controls .wz-phone-menu-grid button{height:76px;flex-direction:column;gap:6px;font-size:14px;border-color:#654778}.wz-phone-menu footer{font-size:11px;color:#9f89af;margin-top:18px;letter-spacing:.5px}
.menu-open .wz-phone-joystick,.menu-open .wz-phone-actions,.menu-open .wz-phone-hud{display:none}
.wz-mobile-online #wzdbg-btn,.wz-mobile-online .wz-release{display:none!important}
@media(max-width:720px){.wz-phone-identity{width:80px}.wz-phone-hud{gap:6px}.wz-phone-hud button span{display:none}.wz-phone-hud button{padding:0 7px}.wz-phone-menu-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.wz-phone-menu{padding:15px}.wz-phone-menu h1{font-size:19px;margin-bottom:14px}}
@media(max-width:540px){.wz-phone-menu-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.wz-phone-identity{display:none}}

/* Real mobile editors stay legible and use the browser's Unicode/caret support. */
.wz-mobile-online .wz-native-input{opacity:1;color:#f1e6fc;caret-color:#e5b6ff;background:#2b2333;border:1px solid #705387;border-radius:4px;padding:0 8px;font:16px system-ui,-apple-system,sans-serif;}
.wz-mobile-online textarea.wz-native-input{padding:8px;font:15px ui-monospace,monospace;line-height:1.4;}
.wz-mobile-online .wz-native-input:focus{border-color:#cc9bff;outline:1px solid #cc9bff;}

/* Side panels own their background; browser controls only cover their hit areas. */
#wolfz-mobile-controls:before,#wolfz-mobile-controls:after{display:none}
.wz-phone-actions{flex-direction:row;gap:4px;right:calc(4px + var(--safe-right));bottom:calc(66px + var(--safe-bottom))}
#wolfz-mobile-controls .wz-phone-actions button{width:48px;height:60px;flex-direction:column;gap:1px;padding:0 2px;font-size:10px}
.wz-phone-joystick{left:calc(36px + var(--safe-left))}

/* Thumb controls sit beside the hotbar, leaving the side panels usable. */
.wz-phone-joystick,.wz-phone-actions{bottom:calc(12px + var(--safe-bottom))}

/* The scene extends under the notch. Interactive controls stay inside the safe area. */
body.wz-mobile-online #stage-container { padding: 0; }
#wolfz-mobile-controls .wz-phone-hud {
  height: 44px;
  justify-content: center;
  gap: 4px;
  padding: 0 4px;
  background: transparent;
  border: 0;
}
.wz-phone-hud .wz-phone-identity { display: none; }
.wz-phone-hud .wz-phone-meter {
  flex: 0 1 108px;
  height: 14px;
  min-width: 52px;
  border-radius: 3px;
}
.wz-phone-hud .wz-phone-meter span { font-size: 10px; }
#wolfz-mobile-controls .wz-phone-hud button,
#wolfz-mobile-controls .wz-phone-actions button {
  width: 44px;
  height: 44px;
  padding: 0;
  background: #191323aa;
  border: 1px solid #d5c4e652;
  border-radius: 12px;
}
#wolfz-mobile-controls .wz-phone-hud button { position: absolute; top: 2px; }
.wz-phone-hud button[aria-label="Chat"] { left: 4px; }
.wz-phone-hud button[aria-label="Menu"] { right: 4px; }
.wz-phone-hud button span, .wz-phone-actions button span { display: none; }
.wz-phone-actions { gap: 3px; bottom: calc(4px + var(--safe-bottom)); }
.wz-phone-joystick {
  left: calc(4px + var(--safe-left));
  bottom: calc(4px + var(--safe-bottom));
  width: 72px;
  height: 72px;
  background: #21193166;
}
.wz-phone-joystick i { width: 30px; height: 30px; background: #80659a99; }
@media (orientation: portrait) {
  .wz-phone-actions, .wz-phone-joystick { bottom: calc(58px + var(--safe-bottom)); }
}
