* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  background: #05020f;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Matches the in-canvas background exactly, so the very first paint
   (before JS runs) is indistinguishable from the game itself. */
#wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(70, 40, 190, 0.30) 0%, rgba(40, 20, 120, 0.10) 45%, rgba(0, 0, 0, 0) 75%),
    linear-gradient(180deg, #2b1163 0%, #190b3e 30%, #0c0624 68%, #05020f 100%);
}

/* Sized in pure CSS (same maths as the JS resize) so the canvas is
   already the correct size on the very first paint - no layout jump. */
#game {
  display: block;
  width: min(100vw, 46.875vh);   /* 540 / 1152 */
  height: min(100vh, 213.333vw);
  aspect-ratio: 540 / 1152;
  touch-action: none;
  border-radius: 4px;
  visibility: hidden;
  box-shadow:
    0 0 70px rgba(80, 40, 210, 0.35),
    0 0 160px rgba(30, 180, 220, 0.12);
}

#game.ready {
  visibility: visible;
}