/* ============================================================
   Living ASCII colony — style.css
   The CSS only holds the stage open. Every visible thing —
   organism, mycelium, environment — is a character on canvas.
   ============================================================ */

:root {
  --bg: #000000;                 /* pure black, per the brief */
  --ink: #7a7488;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
          "DejaVu Sans Mono", "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

/* touch-action: none — the canvas handles pinch-zoom itself, so the
   browser must not steal two-finger gestures for page zoom. */
#world {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

/* Keyboard-only affordance over the main node. Invisible, but it must
   still be focusable and show a focus ring when tabbed to. */
.stimulus {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 40vmin;
  height: 40vmin;
  transform: translate(-50%, -50%);
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: transparent;
  font: inherit;
  border-radius: 50%;
  z-index: 2;
  /* The canvas hit-tests every node itself, so this element must not
     swallow pointer events over the centre of the organism. It stays
     focusable, and Enter/Space still fire its click. */
  pointer-events: none;
}
.stimulus:focus { outline: none; }
.stimulus:focus-visible {
  outline: 1px dashed rgba(160, 150, 175, 0.45);
  outline-offset: 4px;
}

/* One quiet glyph in the corner. Not a UI panel. */
.sound-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 3;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 0.35rem 0.5rem;
  background: transparent;
  color: rgba(122, 116, 136, 0.35);
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 180ms ease;
}
.sound-toggle:hover,
.sound-toggle[aria-pressed="true"] { color: rgba(122, 116, 136, 0.8); }
.sound-toggle:focus { outline: none; }
.sound-toggle:focus-visible {
  outline: 1px dashed rgba(160, 150, 175, 0.45);
  outline-offset: 2px;
}

.noscript-note {
  display: none;
  position: fixed;
  inset: 0;
  margin: 0;
  place-items: center;
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .sound-toggle { transition: none; }
}
