html {
  display: flex;
  height: 100%;
}

body {
  align-items: stretch;
  background: #000;
  display: flex;
  flex: 1;
  justify-content: center;
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

body::before {
  background:
    radial-gradient(
      circle at center,
      rgba(0, 0, 0, 0) 48%,
      rgba(0, 0, 0, 0.18) 68%,
      rgba(0, 0, 0, 0.45) 84%,
      rgba(0, 0, 0, 0.72) 100%
    );
  content: '';
  inset: 0;
  pointer-events: none;
  position: absolute;
}

body::after {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.12) 0,
      rgba(255, 255, 255, 0.12) 1px,
      rgba(0, 0, 0, 0.32) 1px,
      rgba(0, 0, 0, 0.32) 4px
    );
  content: '';
  inset: 0;
  pointer-events: none;
  position: absolute;
}

body.scanlines-disabled::before,
body.scanlines-disabled::after {
  display: none;
}

.loading {
  align-items: center;
  display: flex;
  color: #fff;
  font-family: Lucida Console, Courier, monospace;
  font-size: 32px;
}

canvas {
  aspect-ratio: var(--game-width) / var(--game-height);
  display: block;
  height: min(100vh, calc(100vw * var(--game-height) / var(--game-width)));
  image-rendering: pixelated;
  max-height: 100vh;
  max-width: 100vw;
  width: min(100vw, calc(100vh * var(--game-width) / var(--game-height)));
}
