:root {
  --bg: #08070d;
  --fg: #e9e7f5;
  --accent: #b388ff;
  --accent-2: #ff79c6;
  --panel: rgba(15, 13, 25, 0.78);
  --border: rgba(179, 136, 255, 0.25);
  --mono: ui-monospace, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  overflow: hidden;
}

#visual-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

#unicorn-host,
#fallback-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#fallback-canvas { display: block; }
/* hidden once a unicorn scene successfully loads */
body.unicorn-active #fallback-canvas { display: none; }

#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 14px 20px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.45), transparent);
  z-index: 5;
}
#topbar h1 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
#topbar .hint {
  font-size: 12px;
  opacity: 0.7;
}

#panel {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: min(560px, calc(100vw - 40px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  backdrop-filter: blur(10px);
  z-index: 5;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
button, input[type="text"] {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(255,255,255,0.05);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
button:hover { background: rgba(179, 136, 255, 0.18); border-color: var(--accent); }
button:active { transform: translateY(1px); }
input[type="text"] {
  flex: 1;
  cursor: text;
}

#status {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.7;
}
#status.ok { color: #8aff9d; opacity: 1; }
#status.err { color: #ff8a8a; opacity: 1; }

#code {
  width: 100%;
  height: 220px;
  resize: vertical;
  background: rgba(0,0,0,0.35);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  outline: none;
}
#code:focus { border-color: var(--accent); }

#unicorn-config {
  margin-top: 10px;
  font-size: 11px;
}
#unicorn-config summary {
  cursor: pointer;
  opacity: 0.75;
  user-select: none;
}
#unicorn-config summary:hover { opacity: 1; }
.muted { opacity: 0.55; font-size: 11px; margin: 6px 0 0; }
.muted code {
  background: rgba(255,255,255,0.07);
  padding: 1px 5px;
  border-radius: 3px;
}
