:root {
  --bg: #0d0f15;
  --panel: #161922;
  --panel-2: #1f2330;
  --ink: #e7e9ef;
  --muted: #8b90a0;
  --accent: #e86078;
  --line: #2a2f3d;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 700px at 50% -10%, #1a1f2e 0%, var(--bg) 60%);
  color: var(--ink);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
main {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem) 1rem 3rem;
}
header { text-align: center; margin-bottom: 1.2rem; }
h1 { margin: 0; font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: -0.02em; }
h1 .mark { color: var(--accent); font-size: 0.8em; vertical-align: 0.06em; }
.tag { margin: 0.35rem 0 0; color: var(--muted); }
.tag em { color: var(--ink); font-style: normal; border-bottom: 1px dashed var(--line); }

.stage {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 20px 60px -30px #000, 0 0 0 1px #0006 inset;
  aspect-ratio: 1200 / 750;
}
.stage svg { width: 100%; height: 100%; display: block; }
.stage.drop { outline: 3px dashed var(--accent); outline-offset: -6px; }
/* animation layer (specs-008): static-first — the mesh holds, the surface breathes */
@keyframes facet-shimmer {
  0%   { filter: hue-rotate(0deg) brightness(1); }
  50%  { filter: hue-rotate(10deg) brightness(1.07); }
  100% { filter: hue-rotate(0deg) brightness(1); }
}
.stage.shimmer svg { animation: facet-shimmer 6s ease-in-out infinite; }
.stat { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 0.5rem 0 0.4rem;
  font-variant-numeric: tabular-nums; }
.hint { text-align: center; font-size: 0.85rem; margin: 0 0 1rem; min-height: 1.2em;
  color: var(--accent); opacity: 0; transition: opacity 0.4s; }
.hint.show { opacity: 1; }

.controls {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.85rem;
}
.row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.row > label { width: 56px; color: var(--muted); flex: none; }
.row.actions { justify-content: flex-end; gap: 0.6rem; }

.seg { display: inline-flex; background: var(--panel-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--muted);
  padding: 0.4rem 0.9rem; border-radius: 8px; cursor: pointer; font: inherit;
}
.seg button.on { background: var(--accent); color: #1a0d12; font-weight: 600; }

.swatches { flex-wrap: wrap; }
.swatches button { padding: 0; width: 30px; height: 24px; border-radius: 6px;
  border: 2px solid transparent; cursor: pointer; font-size: 0.7rem; color: #fff;
  text-shadow: 0 1px 2px #0008; overflow: hidden; }
.swatches button.auto { width: auto; padding: 0 0.7rem; background: var(--panel-2); color: var(--muted); }
.swatches button.auto.on { background: var(--accent); color: #1a0d12; }
.swatches button.on { border-color: var(--ink); }

input[type="range"] { flex: 1; accent-color: var(--accent); min-width: 140px; }
output { width: 3ch; color: var(--ink); font-variant-numeric: tabular-nums; }
input[type="number"] {
  width: 8rem; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--ink); border-radius: 8px; padding: 0.4rem 0.6rem; font: inherit;
}

.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  padding: 0.45rem 0.9rem; border-radius: 9px; cursor: pointer; font: inherit;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #1a0d12; border-color: var(--accent); font-weight: 600; }

footer {
  margin-top: 1.4rem; display: flex; justify-content: space-between; gap: 1rem;
  color: var(--muted); font-size: 0.82rem; flex-wrap: wrap;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }
