:root {
  --bg: #0a0e1a;
  --ink: #e8e6d8;
  --moon: #9bb4c9;
  --warm: #e8b76a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#stage {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  cursor: crosshair;
  display: block;
}

#hud {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}

#hud > * { pointer-events: auto; }

#mute {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 120ms ease;
}
#mute:hover { opacity: 1; }
#mute.muted { opacity: 0.3; text-decoration: line-through; }

#hint {
  font-size: 0.75rem;
  opacity: 0.5;
  letter-spacing: 0.05em;
  max-width: 14rem;
  text-align: right;
  min-height: 1rem;
}

#overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.93);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 1;
  transition: opacity 180ms ease;
}
#overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 120ms ease;
}
#close:hover { opacity: 1; }

#vignette {
  max-width: min(34rem, 88vw);
  padding: 2rem;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.7;
}

#vignette p { margin: 0.5rem 0; }
#vignette small { opacity: 0.6; font-size: 0.8rem; display: block; margin-top: 0.75rem; }
#vignette .canvas-wrap { display: flex; justify-content: center; margin: 1rem 0; }
#vignette canvas { image-rendering: pixelated; width: 256px; height: auto; }
#vignette em { font-style: italic; color: var(--moon); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
