:root {
  color-scheme: dark;
  --bg: #05070f; --panel: rgba(10, 15, 32, .86); --line: rgba(148, 163, 184, .2); --text: #e8edf9; --muted: #9aa6c3;
  --accent: #22d3ee; --accent2: #f2c38f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, "Segoe UI", sans-serif; }
#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; cursor: grab; }
#stage.pointing { cursor: pointer; }
button { font: inherit; color: var(--text); background: rgba(18, 28, 61, .85); border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.on { border-color: var(--accent); background: rgba(34, 211, 238, .16); }
button.primary { background: linear-gradient(180deg, #19c3e0, #0e8fb0); border-color: transparent; color: #031018; font-weight: 600; }
button.primary:hover { filter: brightness(1.1); }
button:disabled { opacity: .5; cursor: default; }
button.icon { padding: 2px 9px; font-size: 18px; line-height: 1.2; }

.brand { position: fixed; top: 16px; left: 18px; display: flex; gap: 12px; align-items: center; z-index: 3; pointer-events: none; }
.brand svg { width: 34px; height: 34px; color: var(--accent); filter: drop-shadow(0 0 8px rgba(34, 211, 238, .5)); }
.brand h1 { margin: 0; font-size: 19px; letter-spacing: .02em; }
.brand p { margin: 0; color: var(--muted); font-size: 13px; }
.brand nav { pointer-events: auto; margin-left: 10px; display: flex; gap: 12px; font-size: 13px; }
.brand nav a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--line); }
.brand nav a:hover { color: var(--accent); }

.toolbar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 32px); }
.toolbar button { backdrop-filter: blur(8px); }

.panel { position: fixed; top: 16px; right: 16px; bottom: 16px; width: 330px; z-index: 4; overflow: auto; padding: 16px 16px 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(14px); display: grid; gap: 12px; align-content: start; }
.panel[hidden] { display: none; }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.panel h2 { margin: 0; font-size: 18px; }
.panel h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.panel .kind { margin: 2px 0 0; color: var(--accent2); font-size: 13px; }
.panel .blurb { margin: 0; color: var(--muted); font-size: 14px; }
.panel section { display: grid; gap: 8px; }
.panel section[hidden] { display: none; }
#controls { display: grid; gap: 14px; }
#controls[hidden] { display: none; }
.row { display: flex; flex-wrap: wrap; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips button { padding: 4px 9px; font-size: 13px; border-radius: 999px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .2); }
.swatches button.on { border-color: #fff; }
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.thumbs button { padding: 0; aspect-ratio: 1; overflow: hidden; border-radius: 8px; }
.thumbs button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
label.slider { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
label.slider input { flex: 1; accent-color: var(--accent); }
pre { margin: 0; padding: 10px; border-radius: 9px; background: #040814; border: 1px solid var(--line); font: 12px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; color: #cfe7ff; }
.open-panel { position: fixed; right: 16px; top: 16px; z-index: 4; }

.bubble { position: fixed; z-index: 2; left: 0; top: 0; max-width: 300px; padding: 9px 13px 10px; border-radius: 14px; pointer-events: none;
  background: rgba(250, 251, 255, .96); color: #10162a; font-size: 14px; line-height: 1.35; box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
  transform: translate(-50%, calc(-100% - 14px)); transition: opacity .2s; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: rgba(250, 251, 255, .96); }
.bubble b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #0e7490; margin-bottom: 2px; }
.bubble[hidden] { display: block; opacity: 0; }

#labels { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
#labels span { position: absolute; transform: translate(-50%, 0); font-size: 12px; color: rgba(232, 237, 249, .75); white-space: nowrap; text-shadow: 0 1px 4px #000; transition: opacity .3s; }
#labels span.on { color: var(--accent); }

.enter { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(5, 7, 15, .55), rgba(5, 7, 15, .9)); }
.enter > div { max-width: 460px; padding: 28px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.enter h1 { margin: 0; font-size: 34px; letter-spacing: .02em; }
.enter p { margin: 0; color: var(--muted); }
.enter button { min-width: 220px; padding: 10px 18px; }
.enter[hidden] { display: none; }
.loading { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--muted); z-index: 11; font-size: 14px; }
.loading[hidden] { display: none; }

@media (max-width: 760px) {
  .brand nav, .brand p { display: none; }
  .brand { top: 12px; left: 12px; }
  .brand h1 { font-size: 17px; }
  .panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 52vh; border-radius: 14px; }
  .toolbar { bottom: auto; top: 56px; gap: 6px; }
  .toolbar button { padding: 5px 10px; font-size: 13px; }
  .open-panel { top: auto; bottom: 12px; right: 12px; }
  .bubble { max-width: 220px; font-size: 13px; }
}
