* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

html, body {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ====== 9:16 ASPECT RATIO CONTAINER ====== */
#game-root {
  width: 100%;
  height: 100dvh;
  max-width: calc(100dvh * 9 / 16);
  max-height: 100dvh;
  position: relative;
  background: #000;
  overflow: hidden;
}

/* On very wide screens, center the game with a subtle border */
@media (min-aspect-ratio: 9/16) {
  #game-root {
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
  }
}

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#hud-root {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

#overlay-root {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
}

#overlay-root > * {
  pointer-events: auto;
}
