html, body {
  margin: 0; height: 100%; background: #0d0a1a; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
body { display: flex; align-items: center; justify-content: center; }

/* Chunky pixels: never smooth the upscaled canvas. */
#game {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #0d0a1a;
  display: block;
}

/* ---- touch controls (plain CSS shapes, no images) ---- */
#touch { display: none; position: fixed; inset: 0; pointer-events: none; font: bold 18px monospace; color: #fff; }
#touch .dpad, #touch .b { pointer-events: auto; position: absolute; opacity: 0.55; }
#touch .dpad {
  left: max(14px, env(safe-area-inset-left)); bottom: 18px; width: 132px; height: 132px; border-radius: 50%;
  background: #1b1530; border: 3px solid #6ff3ff; box-sizing: border-box;
}
#touch .dpad i { position: absolute; width: 0; height: 0; border: 11px solid transparent; }
#touch .dpad .u { left: 52px; top: 6px; border-bottom-color: #6ff3ff; }
#touch .dpad .d { left: 52px; bottom: 6px; border-top-color: #6ff3ff; }
#touch .dpad .l { top: 52px; left: 6px; border-right-color: #6ff3ff; }
#touch .dpad .r { top: 52px; right: 6px; border-left-color: #6ff3ff; }
#touch .b {
  width: 62px; height: 62px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #1b1530; border: 3px solid #ff6ec7; box-sizing: border-box;
}
#touch .atk { right: max(16px, env(safe-area-inset-right)); bottom: 22px; border-color: #ffe45c; }
#touch .jmp { right: calc(max(16px, env(safe-area-inset-right)) + 72px); bottom: 14px; }
#touch .spc { right: calc(max(16px, env(safe-area-inset-right)) + 30px); bottom: 92px; border-color: #6ff3ff; }
