* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: #000;
}

body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  overflow-x: hidden;
}

main {
  position: relative;
  width: min(640px, 100vw);
  text-align: center;
}

#game-canvas {
  display: block;
  width: min(640px, 100vw);
  height: auto;
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  background: #000;
  outline: none;
  cursor: pointer;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
}

#game-canvas:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 2px;
}

.control-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  margin: 0;
  padding: 5px 8px;
  color: #fff;
  background: rgb(0 0 0 / 72%);
  font: 600 clamp(10px, 2.2vw, 14px) / 1.25 ui-monospace, SFMono-Regular,
    Menlo, Consolas, monospace;
  pointer-events: none;
  user-select: none;
}

.error {
  margin: 8px 8px 0;
  color: #aaa;
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.error {
  color: #f66;
}

@media (max-height: 480px) and (min-width: 641px) {
  #game-canvas {
    width: auto;
    height: 100vh;
  }

  main {
    width: auto;
  }
}
