html, body {
  margin: 0; height: 100%; background: #000; overflow: hidden;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; touch-action: none; overscroll-behavior: none;
}
#game {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh;
  image-rendering: pixelated; image-rendering: crisp-edges; display: block;
}
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
#flash { position: fixed; inset: 0; background: #a00; opacity: 0; pointer-events: none; z-index: 5; transition: opacity .35s; }
#flash.on { opacity: .45; transition: none; }

#touch { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 10; }
body.is-touch #touch { display: block; }
body.no-touch-ui #touch { display: none; }
#stick {
  position: absolute; pointer-events: auto; touch-action: none;
  left: calc(24px + env(safe-area-inset-left)); bottom: calc(20px + env(safe-area-inset-bottom));
  width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.06), rgba(255,255,255,.12));
  border: 2px solid rgba(255,255,255,.18);
}
#knob {
  position: absolute; left: 45px; top: 45px; width: 50px; height: 50px; border-radius: 50%;
  background: rgba(255,255,255,.28); border: 2px solid rgba(255,255,255,.35);
}
#buttons {
  position: absolute; right: calc(20px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom));
  width: 190px; height: 190px; pointer-events: none;
}
.tb {
  position: absolute; pointer-events: auto; touch-action: none;
  border-radius: 50%; border: 2px solid rgba(255,255,255,.25); background: rgba(20,20,20,.35);
  color: rgba(255,255,255,.75); font: 600 11px ui-monospace, Menlo, monospace; letter-spacing: .05em;
  width: 58px; height: 58px; padding: 0;
}
.tb.big { width: 84px; height: 84px; font-size: 12px; }
.tb.down { background: rgba(160,20,20,.55); color: #fff; }
#b-act { right: 0; bottom: 0; }
#b-aim { right: 96px; bottom: 26px; }
#b-turn { right: 12px; bottom: 100px; }
#b-inv { right: 92px; bottom: 122px; }

#rotate {
  display: none; position: fixed; inset: 0; z-index: 50; background: #000; color: #bbb;
  font: 18px Georgia, serif; align-items: center; justify-content: center; letter-spacing: .1em;
}
@media (orientation: portrait) and (pointer: coarse) { #rotate { display: flex; } }
