* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: #000;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
}
#screen {
  /* object-fit: contain in pure CSS — scales to fill viewport, keeps 320:224 */
  width: min(100vw, calc(100vh * 320 / 224));
  height: min(100vh, calc(100vw * 224 / 320));
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}
#help {
  position: fixed;
  bottom: 10px;
  width: 100%;
  text-align: center;
  font-size: clamp(9px, 1.6vw, 13px);
  font-family: "Courier New", monospace;
  color: #445;
  pointer-events: none;
}
@media (hover: none) and (pointer: coarse) {
  #help { display: none; }
}

/* ---- virtual gamepad (touch.js, touch devices only) ---- */
.vbtn {
  position: fixed;
  width: 12vmin; height: 12vmin;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.75);
  font-size: 5vmin;
  line-height: 12vmin;
  padding: 0; margin: 0;
  text-align: center;
  touch-action: none;
  pointer-events: all;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  z-index: 10;
}
.vbtn:active { background: rgba(255,255,255,0.32); }
