:root {
  --app-width: 100vw;
  --app-height: 100vh;
  --bg-top: #05070d;
  --bg-bottom: #05070d;
  --frame: #05070d;
  --ink: #fff2d0;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  width: 100%;
  height: var(--app-height);
  min-height: var(--app-height);
  font-family: "VT323", monospace;
  color: var(--ink);
  overflow: hidden;
  background: #05070d;
}

.app-shell {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

.game-frame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #05070d;
  box-shadow: none;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.title-row,
.credit {
  display: none;
}

#game-canvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  border: 0;
  border-radius: 0;
  image-rendering: pixelated;
  background: #05070d;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.hud {
  display: none;
}

@media (min-width: 960px) and (min-height: 720px) {
  .game-frame {
    width: min(100%, calc(var(--app-height) * 16 / 9));
    height: min(100%, calc(var(--app-width) * 9 / 16));
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
  }

  #game-canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    margin: 0 !important;
    flex-shrink: 0;
  }
}

.narration {
  display: none;
}

@supports (height: 100dvh) {
  :root {
    --app-height: 100dvh;
  }
}

@supports (width: 100dvw) {
  :root {
    --app-width: 100dvw;
  }
}
