/* Dune Drift — 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;
}

.scene {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#stage {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;            /* the play area owns the gesture */
  cursor: crosshair;
  transform-origin: 50% 100%;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;     /* a long press pours sand, never selects */
  user-select: none;
  -webkit-touch-callout: none;   /* no iOS callout / magnifier */
  -webkit-user-drag: none;
}
#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.72);
  border: 1px solid rgba(139, 255, 190, 0.16);
  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;
}
.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.78);
  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 !important; }
}
