/* Snow Garden — styling. Values are taken from the Section 9 tokens
   (crew/design/tokens/section9.css) so a night and the house read as one room. */
:root {
  --bg: #060b09;
  --surface: #0b1410;
  --text: #e6f2ea;
  --text-muted: #9db3a7;
  --accent: #8bffbe;
  --accent-ink: #060b09;
  --focus: #ffb454;
  --font-mono: ui-monospace, "Share Tech Mono", SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font-mono);
  overflow: hidden;
  overscroll-behavior: none;
}

/* The scene is fixed to the window and centres the canvas. Its background
   carries the same sky-to-snow ramp as the frame, so the sliver between the
   integer-scaled canvas and the window edge (at most one world pixel) reads as
   part of the garden instead of a seam. */
.scene {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(180deg, #060b09 0%, #0e231c 34%, #122a22 52%, #7fada0 78%, #e4f2e8 100%);
}

#stage {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  cursor: crosshair;
  transform-origin: 50% 100%;
  will-change: transform;
}
#stage:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }

.hint {
  position: absolute;
  left: 50%;
  top: max(14px, env(safe-area-inset-top));
  transform: translate(-50%, -6px);
  margin: 0;
  max-width: min(88vw, 44ch);
  text-align: center;
  font-size: 16px;
  color: var(--text-muted);
  background: rgba(6, 11, 9, 0.78);
  border: 1px solid rgba(139, 255, 190, 0.42);
  padding: 8px 14px;
  opacity: 0;
  transition: opacity 420ms ease, transform 420ms ease;
  pointer-events: none;
}
.hint.show { opacity: 1; transform: translate(-50%, 0); }

.dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding:
    12px
    max(14px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  pointer-events: none;
  touch-action: none;
  /* the snow is bright at the foot of the frame: a soft scrim keeps the caption
     and the sound button readable over it */
  background: linear-gradient(180deg, rgba(6, 11, 9, 0) 0%, rgba(6, 11, 9, 0.72) 48%, rgba(6, 11, 9, 0.9) 100%);
  -webkit-user-select: none;
  user-select: none;
}
.dock > * { pointer-events: auto; }

.caption {
  margin: 0;
  font-size: 16px;
  color: var(--text-muted);
  text-shadow: 0 1px 2px rgba(6, 11, 9, 0.9);
}

.btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 18px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: rgba(11, 20, 16, 0.82);
  border: 1px solid rgba(139, 255, 190, 0.42);
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--accent); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn[aria-pressed="true"] {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .hint { transition: none; }
  #stage { transform: none; }
  .btn { transition: none; }
}
