@font-face {
  font-family: "Press Start 2P";
  src: url("../assets/ui/fonts/Press_Start_2P/PressStart2P-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ui-font: "Press Start 2P", "Courier New", monospace;
  --bg: #0e1721;
  --panel: rgba(5, 10, 16, 0.88);
  --panel-border: rgba(190, 216, 255, 0.25);
  --text: #eaf4ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000000;
  color: var(--text);
  font-family: var(--ui-font);
}

#game-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

canvas {
  position: absolute;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.58);
  z-index: 20;
  pointer-events: none;
}

.overlay-interactive {
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

.overlay-message {
  max-width: min(92vw, 460px);
  padding: calc(14px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom))
    calc(18px + env(safe-area-inset-left));
  color: #ffffff;
  font-size: calc(8px * var(--overlay-scale, var(--scene-scale, 1)));
  letter-spacing: 0.04em;
  line-height: 1.35;
  text-align: center;
  white-space: pre-line;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #000;
  animation: overlayBlink 750ms steps(1, end) infinite;
}

#fullscreen-overlay .overlay-message {
  font-size: calc(10px * var(--overlay-scale, var(--scene-scale, 1)));
  width: min(92vw, 460px);
  max-width: none;
  margin: 0 auto;
  padding: 14px 18px;
  text-align: center;
}

@keyframes overlayBlink {
  0% {
    opacity: 1;
  }
  66.666% {
    opacity: 1;
  }
  66.667% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.debug {
  position: fixed;
  top: 10px;
  left: 10px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  color: #c8f4d5;
  z-index: 30;
  font: 12px/1.35 Consolas, "Courier New", monospace;
  pointer-events: none;
  white-space: pre;
}

.hidden {
  display: none !important;
}
