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

body {
  background: #000008;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: 'Press Start 2P', monospace;
}

.game-wrapper {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-block;
  line-height: 0;
}

/* Fullscreen centering */
:fullscreen .game-wrapper,
:-webkit-full-screen .game-wrapper,
:-moz-full-screen .game-wrapper {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
:fullscreen body,
:-webkit-full-screen body,
:-moz-full-screen body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000008;
}

#gameCanvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: min(100vw, 177.78vh);
  height: min(56.25vw, 100vh);
}

/* CRT scanlines */
.game-wrapper::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 1px,
    rgba(0,0,0,0.18) 1px, rgba(0,0,0,0.18) 2px
  );
  pointer-events: none;
  z-index: 10;
}

/* CRT vignette */
.game-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
  z-index: 11;
}
