:root {
  --ink: #05060d;
  --sound: #cfe0ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
}

body {
  background:
    radial-gradient(120vmax 80vmax at 50% 38%, #0a0c19 0%, #070810 48%, #04050a 100%);
  color: #cfd8ea;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#scene {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: default;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  opacity: 0;
  transition: opacity 900ms ease;
}

body.ready #scene { opacity: 1; }

#fallback {
  position: fixed;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: #9fb0cf;
}

#fallback[hidden] { display: none; }

/* Small, quiet sound control. The scene itself has no other interface. */
#soundToggle {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(176, 199, 255, 0.17);
  background: rgba(7, 9, 18, 0.42);
  color: var(--sound);
  opacity: 0.56;
  cursor: pointer;
  z-index: 10;
  backdrop-filter: blur(2px);
  transition: opacity 180ms ease, background 180ms ease, border-color 180ms ease;
}

#soundToggle:hover,
#soundToggle:focus-visible {
  opacity: 0.92;
  background: rgba(13, 18, 34, 0.66);
  border-color: rgba(190, 214, 255, 0.4);
  outline: none;
}

#soundToggle:active { transform: scale(0.96); }

#soundToggle svg {
  width: 17px;
  height: 17px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#soundToggle svg .spk { fill: currentColor; stroke: none; opacity: 0.9; }
#soundToggle svg .wave { opacity: 0; transition: opacity 160ms ease; }
#soundToggle svg .slash { opacity: 0.9; stroke-width: 1.5; }

#soundToggle[aria-pressed="true"] svg .wave { opacity: 0.9; }
#soundToggle[aria-pressed="true"] svg .slash { opacity: 0; }
#soundToggle[aria-pressed="true"] { opacity: 0.75; color: #e4eeff; }

@media (max-width: 620px) {
  #soundToggle { width: 36px; height: 36px; right: 10px; bottom: 10px; opacity: 0.5; }
  #soundToggle svg { width: 18px; height: 18px; }
}

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

