html,
body {
  margin: 0;
  min-height: 100%;
  background: #050505;
  color: white;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

main {
  position: relative;
  width: fit-content;
}

.frame {
  display: block;
  width: min(100vw, 576px);
  height: min(100vw, 576px);
  image-rendering: pixelated;
  background: #111;
  object-fit: contain;
}

.wasd {
  position: absolute;
  left: 20px;
  bottom: 20px;
  display: grid;
  grid-template-columns: repeat(3, 54px);
  grid-template-rows: repeat(2, 54px);
  gap: 8px;
  opacity: 0.72;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

.key {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.48);
  color: white;
  font: 700 20px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  text-shadow: 1px 1px 0 #000;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

.key:active,
.key.pressed {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.78);
}

.key-w {
  grid-column: 2;
  grid-row: 1;
}

.key-a {
  grid-column: 1;
  grid-row: 2;
}

.key-s {
  grid-column: 2;
  grid-row: 2;
}

.key-d {
  grid-column: 3;
  grid-row: 2;
}

.hud {
  position: absolute;
  left: 8px;
  top: 8px;
  max-width: calc(100% - 16px);
  font-size: 16px;
  line-height: 22px;
  text-shadow: 1px 1px 0 #000, 0 0 4px #000;
  pointer-events: none;
}

@media (max-width: 460px) {
  .hud {
    font-size: 12px;
    line-height: 18px;
  }

  .wasd {
    left: 12px;
    bottom: 12px;
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(2, 44px);
    gap: 6px;
  }
}
