html.touch, html.touch body { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#pad { display: none; position: fixed; inset: 0; z-index: 20; pointer-events: none; }
html.touch #pad { display: block; }
html.touch #loading { pointer-events: none; }
html.touch #ls-bars, html.touch #modes, html.touch #modes button { pointer-events: auto; }
.stick { position: absolute; width: 118px; height: 118px; border: 2px solid rgba(255,255,255,.72); border-radius: 50%; pointer-events: auto; touch-action: none; background: rgba(0,0,0,.22); box-sizing: border-box; }
.stick i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(255,255,255,.32); border: 2px solid rgba(255,255,255,.8); }
#stick-move { left: max(16px, env(safe-area-inset-left)); bottom: max(22px, env(safe-area-inset-bottom)); }
#stick-look { right: max(16px, env(safe-area-inset-right)); bottom: max(92px, calc(env(safe-area-inset-bottom) + 70px)); }
.tbtn { position: absolute; width: 52px; height: 52px; border-radius: 50%; border: 2px solid rgba(255,255,255,.78); background: rgba(0,0,0,.32); color: #fff; font: 700 13px/1 system-ui, sans-serif; pointer-events: auto; touch-action: none; display: flex; align-items: center; justify-content: center; padding: 0; }
.tbtn.wide { width: 64px; height: 40px; border-radius: 14px; font-size: 12px; }
.tbtn.icon { width: 44px; height: 44px; }
.tbtn.on { background: rgba(255,255,255,.45); color: #111; }
#btn-gas { left: max(18px, env(safe-area-inset-left)); bottom: max(154px, calc(env(safe-area-inset-bottom) + 132px)); }
#btn-brk { left: max(92px, calc(env(safe-area-inset-left) + 74px)); bottom: max(154px, calc(env(safe-area-inset-bottom) + 132px)); }
#btn-a { right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); }
#btn-b { right: max(78px, calc(env(safe-area-inset-right) + 60px)); bottom: max(62px, calc(env(safe-area-inset-bottom) + 44px)); }
#btn-x { right: max(18px, env(safe-area-inset-right)); bottom: max(148px, calc(env(safe-area-inset-bottom) + 126px)); }
#btn-y { right: max(78px, calc(env(safe-area-inset-right) + 60px)); bottom: max(192px, calc(env(safe-area-inset-bottom) + 170px)); }
#btn-lb { left: max(18px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top)); }
#btn-rb { right: max(18px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top)); }
#btn-sprint { left: max(148px, calc(env(safe-area-inset-left) + 130px)); bottom: max(28px, env(safe-area-inset-bottom)); }
#btn-enter { left: 50%; bottom: max(8px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: 86px; }
#btn-back { left: 50%; top: max(12px, env(safe-area-inset-top)); transform: translateX(-50%); width: 58px; }
#btn-map { right: max(148px, calc(env(safe-area-inset-right) + 126px)); bottom: max(18px, env(safe-area-inset-bottom)); }
#btn-look { right: max(148px, calc(env(safe-area-inset-right) + 126px)); bottom: max(72px, calc(env(safe-area-inset-bottom) + 54px)); }
#btn-map::before { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-radius: 3px; box-shadow: inset 0 7px 0 -5px currentColor, inset 7px 0 0 -5px currentColor; }
#btn-look::before { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-radius: 50%; box-shadow: inset 0 0 0 3px currentColor; }
@media (orientation: portrait) {
	html.touch #canvas { height: 62vh; top: 8vh; }
	html.touch #loading { height: 70vh; }
}
@media (max-height: 420px) {
	.stick { width: 96px; height: 96px; }
	.tbtn { width: 44px; height: 44px; }
	#btn-y, #btn-x { display: none; }
}
