* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #12192b; color: #fff; overflow: hidden; overscroll-behavior: none;
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; touch-action: none; user-select: none; -webkit-user-select: none; }
#stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; background: #4aa3ff; display: block; max-width: 100vw; max-height: 100vh; box-shadow: 0 0 0 1px #0006; }
#bar { position: fixed; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); display: flex; gap: 6px; z-index: 5; }
#bar button, #bar a { background: #0008; color: #fff; border: 1px solid #fff4; border-radius: 8px; padding: 6px 10px; font: inherit; text-decoration: none; cursor: pointer; }
#touch { position: fixed; left: 0; right: 0; bottom: max(10px, env(safe-area-inset-bottom)); display: none; justify-content: space-between;
  padding: 0 max(14px, env(safe-area-inset-left)); pointer-events: none; z-index: 4; }
.pad { display: flex; gap: 12px; pointer-events: auto; }
#touch button { width: 78px; height: 78px; border-radius: 50%; border: 2px solid #fff6; background: #0007; color: #fff; font-size: 22px; font-weight: 700; touch-action: none; }
#touch button.on { background: #ffffff55; }
#btnJ { width: 96px; height: 96px; font-size: 16px; }
@media (pointer: coarse), (hover: none) { #touch { display: flex; } }
body.touch #touch { display: flex; }
@media ((pointer: coarse), (hover: none)) and (orientation: portrait) {
  canvas { width: 100vw; height: auto; align-self: flex-start; margin-top: 18vh; }
}

#actbar { position: fixed; transform: translate(-50%, -50%); display: flex; flex-direction: column; gap: 10px; align-items: stretch; z-index: 6; min-width: 190px; }
#actbar button { font: 700 18px system-ui, sans-serif; padding: 13px 24px; border-radius: 14px; border: 2px solid #fff; background: #ffb000; color: #1b1300; cursor: pointer; touch-action: manipulation; }
#actbar button#btnAct2 { background: #0009; color: #fff; font-size: 14px; padding: 9px 16px; border-color: #fff8; }
[hidden] { display: none !important; }
