/* OVERPOP — the whole game is one canvas, so this file only has to do four
   things: black out the page, letterbox the canvas, keep real text available to
   crawlers and screen readers, and cover the boot gap. */

:root {
  --bg: #0e1410;
  --bg-deep: #070a08;
  --ink: #e8efe6;
  --moss: #6fae7f;
  --mono: ui-monospace, 'IBM Plex Mono', 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--ink);
  color-scheme: dark;
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: none;
}

#stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 90% at 50% 0%, #16211a 0%, var(--bg-deep) 70%);
}

/* The canvas keeps its 16:9 aspect and scales to fit — the renderer works in a
   fixed 1280x720 logical space and never has to think about the viewport. */
#game {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: 16 / 9;
  image-rendering: auto;
  background: var(--bg);
  touch-action: none;
  cursor: crosshair;
}

@media (min-aspect-ratio: 16/9) {
  #game { width: auto; height: 100%; }
}

/* Real prose for crawlers and screen readers, visually removed. Not
   display:none — that would hide it from assistive tech too. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Boot cover — removed by main.js once the first frame is drawn, so nobody
   sees an unpainted canvas on a cold cache. */
#boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  justify-items: center;
  background: var(--bg-deep);
  z-index: 10;
  transition: opacity 0.4s ease;
}
#boot.gone { opacity: 0; pointer-events: none; }

.boot-mark {
  font-size: clamp(28px, 6vw, 54px);
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--ink);
  text-indent: 0.22em;
}
.boot-note {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--moss);
  text-transform: lowercase;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;
  line-height: 1.7;
  background: var(--bg-deep);
}

:focus-visible { outline: 2px solid var(--moss); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  #boot { transition: none; }
}
