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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0F0D1A;
  color: #EDE9F7;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Prevent iOS bounce/pull-to-refresh and text selection on the game surface. */
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  /* Faint CRT scanline atmosphere behind the letterboxed canvas. */
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.02) 0px,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px,
      transparent 3px
    ),
    #0F0D1A;
}

#game-canvas {
  display: block;
  touch-action: none;
  border-radius: 4px;
}

#loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 13px "Courier New", monospace;
  color: #8C87A8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
