html,
body {
  margin: 0;
  height: 100%;
  background: #000;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Area di gioco 4:3, la più grande possibile nella finestra */
#screen {
  position: relative;
  width: min(100vw, calc(100vh * 4 / 3));
  aspect-ratio: 4 / 3;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Il canvas è a 320x240: lo ingrandiamo senza sfumare i pixel */
#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

/* Effetto monitor CRT: linee di scansione e vignettatura */
.crt {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.18) 3px
  );
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.65);
}

.noscript {
  color: #fff;
  font-family: monospace;
  text-align: center;
}
