:root {
  color-scheme: dark;
  font-family: "Courier New", "MS Gothic", monospace;
  color: #b9d89d;
  background: #071011;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: radial-gradient(circle at 50% 38%, #203836 0, #101e1f 52%, #071011 100%);
  touch-action: none;
  user-select: none;
}

.game-shell {
  width: min(100%, calc((100dvh - 84px) * 16 / 9), 960px);
  text-align: center;
}

.screen-frame {
  border: clamp(5px, 1.2vw, 11px) solid #304846;
  border-radius: 5px;
  padding: clamp(3px, 0.6vw, 6px);
  background: #09100f;
  box-shadow: 0 0 0 2px #080d0d, 0 12px 35px #0009;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #a8c98b;
  cursor: pointer;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  outline: none;
  touch-action: none;
  user-select: none;
}

canvas:focus-visible {
  box-shadow: inset 0 0 0 2px #d3e4a5;
}

.controls {
  margin: 9px 0 0;
  color: #78998a;
  font-size: clamp(9px, 1.8vw, 13px);
  letter-spacing: 0.06em;
}

.app-footer {
  margin-top: 7px;
  color: #78998a;
  font-size: clamp(9px, 1.6vw, 12px);
  line-height: 1.5;
}

.app-footer a {
  color: #b9d89d;
  text-underline-offset: 3px;
  touch-action: manipulation;
  user-select: auto;
}

.app-footer a:hover,
.app-footer a:focus-visible {
  color: #e1efbd;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (orientation: portrait) {
  .game-shell {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen-frame {
    box-shadow: 0 0 0 2px #080d0d;
  }
}
