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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas#game {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  aspect-ratio: 3200 / 2000;
}

@media (max-aspect-ratio: 8/5) {
  canvas#game {
    width: 100vw;
    height: auto;
  }
}

@media (min-aspect-ratio: 8/5) {
  canvas#game {
    width: auto;
    height: 100vh;
  }
}

#landscape-hint {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  font-family: monospace;
  font-size: 18px;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 100;
  padding: 20px;
}

@media (orientation: portrait) and (max-width: 768px) {
  #landscape-hint {
    display: flex;
  }
}
