@font-face {
  font-family: "VT323";
  src: url("../fonts/vt323.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --phosphor-rgb: 51, 255, 102;
  --color-phosphor: rgb(var(--phosphor-rgb));
  --glow: 0 0 2px rgba(var(--phosphor-rgb), 0.9), 0 0 8px rgba(var(--phosphor-rgb), 0.45), 0 0 18px rgba(var(--phosphor-rgb), 0.2);
  --font-terminal: "VT323", ui-monospace, "Courier New", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #000;
  color: var(--color-phosphor);
  font-family: var(--font-terminal);
  font-size: clamp(20px, 2.6vmin + 10px, 32px);
  line-height: 1.2;
  -webkit-font-smoothing: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

p {
  margin: 0;
}

.glow {
  text-shadow: var(--glow);
}

.game-page {
  touch-action: none;
  overscroll-behavior: none;
}

.game-stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  touch-action: none;
}

.game-screen {
  display: block;
  touch-action: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.game-screen.is-fallback {
  filter: drop-shadow(0 0 6px rgba(var(--phosphor-rgb), 0.35));
}

.orientation-hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(1.5em, env(safe-area-inset-bottom));
  z-index: 10;
  display: none;
  margin: 0;
  padding: 0 1em;
  text-align: center;
  pointer-events: none;
  animation: orientation-hint-fade 5s linear forwards;
}

.orientation-hint--portrait {
  top: 50%;
  right: auto;
  bottom: auto;
  width: calc((100vw - 100vh * 9 / 16) / 2);
  box-sizing: border-box;
  transform: translateY(-50%);
}

@keyframes orientation-hint-fade {
  0%,
  70% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
  }
}

@media (orientation: portrait) and (pointer: coarse) {
  .orientation-hint:not(.orientation-hint--portrait) {
    display: block;
  }
}

@media (orientation: landscape) and (pointer: coarse) {
  .orientation-hint--portrait {
    display: block;
  }
}

.system-message {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
}

@media (prefers-reduced-motion: reduce) {
  .crt,
  .crt::after,
  .terminal__screen {
    animation: none;
  }

  .terminal.is-powering-off .terminal__screen {
    animation: none;
  }
}

.test-menu-page {
  overflow: auto;
  user-select: text;
  -webkit-user-select: text;
}

.test-menu {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.test-menu__title,
.test-menu__zone-title {
  margin: 0 0 0.5rem;
  font-size: 1.2em;
  font-weight: 400;
}

.test-menu__zone-title {
  font-size: 1em;
  color: rgb(var(--phosphor-rgb));
}

.test-menu__options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.test-menu__input {
  font: inherit;
  color: inherit;
  background: #000;
  border: 1px solid currentColor;
  padding: 0 0.3em;
}

.test-menu__input[type="number"] {
  width: 4em;
}

.test-menu__zone {
  margin-bottom: 1.25rem;
  color: rgb(var(--phosphor-rgb));
}

.test-menu__acts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.test-menu__act {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
  margin-bottom: 0.35rem;
}

.test-menu__act-title {
  min-width: 3.5em;
  opacity: 0.6;
}

.test-menu__level {
  padding: 0 0.35em;
  color: inherit;
  text-decoration: none;
  border: 1px solid rgba(var(--phosphor-rgb), 0.5);
}

.test-menu__level:hover,
.test-menu__level:focus-visible {
  background: rgba(var(--phosphor-rgb), 0.2);
  outline: none;
}

.test-menu__level--boss {
  border-color: rgb(var(--phosphor-rgb));
}

.ad-stub {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  background: #000;
  text-align: center;
  touch-action: none;
}

.ad-stub__countdown {
  opacity: 0.6;
}
