* {
  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;
}

/* FIX #20: Safe area CSS custom properties with env() fallback */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

/* ====== 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;
}

@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;
  z-index: 1;
}

/* Cyberpunk haze — static GPU-composited tint over the game canvas, replacing
   a per-frame canvas fillRect. Sits between the canvas (z1) and the HUD (z10). */
#hb-haze {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(30, 41, 59, 0.15);
}

#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;
}
