@font-face { font-family: 'Geist'; src: url('fonts/geist-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('fonts/geist-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('fonts/geist-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
/* display face: Instrument Sans, baked at a semi-condensed width so CSS and canvas labels match */
@font-face { font-family: 'Instrument Sans Display'; src: url('fonts/instrument-sans-display-500-normal.woff2') format('woff2'); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Instrument Sans Display'; src: url('fonts/instrument-sans-display-600-normal.woff2') format('woff2'); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Instrument Sans Display'; src: url('fonts/instrument-sans-display-500-italic.woff2') format('woff2'); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Rye'; src: url('fonts/rye-latin-400-normal.woff2') format('woff2'); font-display: block; }
@font-face { font-family: 'Alfa Slab One'; src: url('fonts/alfa-slab-one-latin-400-normal.woff2') format('woff2'); font-display: block; }

:root {
  --ink: #f4efe6;
  --ink-2: rgba(244, 239, 230, 0.7);
  --ink-3: rgba(244, 239, 230, 0.44);
  --line: rgba(255, 255, 255, 0.1);
  --glass: rgba(18, 15, 14, 0.52);
  --glass-2: rgba(255, 255, 255, 0.07);
  --well: rgba(0, 0, 0, 0.25);
  --accent: #ffb547;
  --on-accent: #17110b;
  --shadow: 0 18px 50px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  --text-shadow: 0 1px 12px rgba(0,0,0,.5);
  --circus: #ff5a4e;
  --space: #5cc8ff;
  --midway: #ffb547;
  --curiosities: #b996ff;
  --pop: #ff5fae;
  --sea: #3fd6c4;
  --ghost: #9be15d;
  --factory: #f5a623;
  --music: #ef7fae;
  --dino: #4fc27a;
  --sky: #5ab4f0;
  --snow: #a8c0ff;
  --west: #ff9a5a;
  --radius: 18px;
  --ui: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Instrument Sans Display', 'Geist', ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
/* bright worlds get a light glass UI */
body.ui-light {
  --ink: #17150f;
  --ink-2: rgba(23, 21, 15, 0.68);
  --ink-3: rgba(23, 21, 15, 0.42);
  --line: rgba(0, 0, 0, 0.08);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-2: rgba(0, 0, 0, 0.045);
  --well: rgba(0, 0, 0, 0.045);
  --accent: #ff6a1a;
  --on-accent: #ffffff;
  --shadow: 0 18px 50px rgba(30,30,40,.12), inset 0 1px 0 rgba(255,255,255,.7);
  --text-shadow: none;
  --circus: #f0473b;
  --space: #1f9fe0;
  --midway: #f29b12;
  --curiosities: #8b62f0;
  --pop: #e8338f;
  --sea: #12a594;
  --ghost: #5fa82e;
  --factory: #c97a00;
  --music: #c13f74;
  --dino: #2a8a4e;
  --sky: #2a78c0;
  --snow: #4a62c0;
  --west: #c0562a;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b0908; color: var(--ink); font-family: var(--ui); overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
svg { display: block; }
kbd { font-family: var(--ui); font-size: 10.5px; font-weight: 500; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--glass-2); color: var(--ink-2); }

#stage { position: fixed; inset: 0; touch-action: none; }
#stage canvas { display: block; width: 100%; height: 100%; outline: none; }
#fade { position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: 0; background: #000; transition: opacity .38s var(--ease); }
#fade.on { opacity: 1; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: background .5s, border-color .5s, box-shadow .5s, color .5s;
}

body.ui-hidden .brand, body.ui-hidden .toolbar, body.ui-hidden .dock, body.ui-hidden .inspector, body.ui-hidden .hint, body.ui-hidden .popover, body.ui-hidden .modes-top, body.ui-hidden .beats, body.ui-hidden .drawer, body.ui-hidden .binsp { opacity: 0 !important; pointer-events: none !important; }

/* ---------- loader ---------- */
#loader { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 40%, #1d1410 0%, #0b0908 70%); transition: opacity .9s var(--ease), visibility .9s; color: #f4efe6; }
#loader.done { opacity: 0; visibility: hidden; }
.loader-inner { display: grid; justify-items: center; gap: 18px; }
.loader-key { width: 46px; height: 46px; color: #ffb547; animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-mark { font-family: var(--display); font-weight: 500; font-size: 36px; letter-spacing: -.02em; }
.loader-mark em { font-style: italic; color: #ffb547; }
.loader-bar { width: 220px; height: 2px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 0; background: #ffb547; transition: width .3s var(--ease); }
.loader-text { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: rgba(244,239,230,.44); }

/* ---------- brand ---------- */
.brand { position: fixed; left: 24px; top: 20px; z-index: 10; transition: opacity .4s; text-shadow: var(--text-shadow); }
.brand-mark { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 500; font-size: 24px; line-height: 1; letter-spacing: -.02em; pointer-events: none; }
.brand-mark em { font-style: italic; color: var(--accent); }
.brand-mark svg { width: 20px; height: 20px; color: var(--accent); }
.brand-sub { margin: 6px 0 0 24px; display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); background: none; border: 0; padding: 3px 6px; border-radius: 8px; cursor: pointer; text-shadow: inherit; }
.brand-sub:hover { background: var(--glass-2); color: var(--ink); }
.brand-sub i { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }

/* ---------- top modes ---------- */
.modes-top { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 11; display: flex; gap: 2px; padding: 4px; border-radius: 14px; transition: opacity .4s; }
.mode { position: relative; border: 0; background: transparent; padding: 0 14px; height: 34px; border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s; }
.mode.on { background: var(--glass-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.mode:disabled { cursor: default; color: var(--ink-3); }
.mode i { font-style: normal; font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase; margin-left: 5px; padding: 1px 4px; border-radius: 4px; background: var(--glass-2); vertical-align: 2px; }

/* ---------- toolbar ---------- */
.toolbar { position: fixed; right: 20px; top: 18px; z-index: 12; display: flex; gap: 2px; padding: 5px; border-radius: 14px; transition: opacity .4s; }
.tb { min-width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; cursor: pointer; color: var(--ink-2); transition: background .2s, color .2s; padding: 0 8px; }
.tb:hover { background: var(--glass-2); color: var(--ink); }
.tb.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.tb svg, .icon-btn svg, .btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#btnSound .snd-off { display: none; }
#btnSound.muted .snd-on { display: none; }
#btnSound.muted .snd-off { display: inline; }

/* ---------- popover ---------- */
.popover { position: fixed; right: 20px; top: 70px; z-index: 13; width: 356px; padding: 16px 16px 18px; border-radius: var(--radius); transform-origin: top right; animation: pop .28s var(--ease); max-height: calc(100vh - 100px); overflow-y: auto; }
.popover[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.popover h3 { margin: 4px 2px 10px; font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.popover h3:not(:first-child) { margin-top: 18px; }
.worlds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.world { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 0; overflow: hidden; background: #000; cursor: pointer; text-align: left; transition: border-color .2s, transform .2s; color: #f4efe6; }
.world:hover:not(:disabled) { transform: translateY(-1px); }
.world.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.world:disabled { cursor: default; opacity: .72; }
.world .thumb { height: 64px; }
.world .wname { display: block; padding: 7px 9px 8px; font-size: 12px; font-weight: 500; background: rgba(0,0,0,.55); }
.world.lightthumb .wname { background: rgba(255,255,255,.72); color: #17150f; }
.world i { position: absolute; top: 6px; right: 6px; font-style: normal; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.55); color: rgba(255,255,255,.8); }
.lights { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.light { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 11px; border: 1px solid var(--line); background: var(--glass-2); cursor: pointer; font-size: 12.5px; text-align: left; transition: background .2s, border-color .2s; }
.light:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.light.on { border-color: color-mix(in srgb, var(--accent) 70%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.light .sw { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(127,127,127,.3); }
.toggles { display: grid; gap: 8px; }
.tog { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.tog input { display: none; }
.tog span { width: 30px; height: 18px; border-radius: 10px; background: rgba(127,127,127,.3); position: relative; transition: background .2s; flex: none; }
.tog span::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.tog input:checked + span { background: var(--accent); }
.tog input:checked + span::after { transform: translateX(12px); }

/* ---------- inspector ---------- */
.inspector { position: fixed; right: 20px; top: 74px; z-index: 11; width: 330px; padding: 18px 18px 16px; border-radius: 22px; transform: translateX(calc(100% + 40px)); opacity: 0; transition: transform .5s var(--ease), opacity .4s, background .5s; }
.inspector.open { transform: none; opacity: 1; }
.insp-top { display: flex; justify-content: space-between; align-items: center; }
.theme-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.theme-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); box-shadow: 0 0 12px var(--c, var(--accent)); }
.icon-btn { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--ink-3); cursor: pointer; }
.icon-btn:hover { background: var(--glass-2); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.insp-name { margin: 10px 0 6px; font-family: var(--display); font-weight: 500; font-size: 30px; line-height: 1.04; letter-spacing: -.02em; }
.insp-blurb { margin: 0 0 16px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.insp-wind { display: grid; grid-template-columns: 92px 1fr; grid-template-rows: auto auto; column-gap: 16px; align-items: center; padding: 14px; border-radius: 16px; background: var(--well); border: 1px solid var(--line); position: relative; }
.ring { width: 92px; height: 92px; grid-row: span 2; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-bg { stroke: rgba(127,127,127,.15); }
.ring-ticks { stroke: rgba(127,127,127,.3); stroke-width: 7; stroke-dasharray: 1.2 25; }
.ring-fg { stroke: var(--c, var(--accent)); stroke-linecap: round; stroke-dasharray: 314.16; stroke-dashoffset: 314.16; transition: stroke .3s; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c, var(--accent)) 60%, transparent)); }
.wind-read { position: absolute; left: 14px; top: 14px; width: 92px; height: 92px; display: grid; place-content: center; text-align: center; }
.wind-read b { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.wind-read span { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }
.wind-meta { display: grid; gap: 10px; }
.wind-meta div { display: grid; gap: 2px; }
.wind-meta label { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.wind-meta span { font-size: 13px; color: var(--ink); }
#inspStatus { font-weight: 500; }
#inspStatus.live { color: var(--c, var(--accent)); }
.insp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass-2); cursor: pointer; font-size: 13px; font-weight: 500; transition: background .2s, transform .1s, border-color .2s; user-select: none; -webkit-user-select: none; touch-action: none; }
.btn:hover { border-color: color-mix(in srgb, var(--ink) 20%, transparent); }
.btn:active { transform: scale(.98); }
.btn.primary { grid-column: span 2; background: var(--c, var(--accent)); color: #17110b; border-color: transparent; }
.btn.primary kbd { background: rgba(0,0,0,.12); border-color: rgba(0,0,0,.12); color: rgba(0,0,0,.6); }
.btn.primary.holding { filter: brightness(1.12); box-shadow: 0 0 0 4px rgba(127,127,127,.12); }
.btn.ghost { background: transparent; }
.insp-tip { margin: 12px 2px 0; font-size: 12px; line-height: 1.5; color: var(--ink-3); }

/* ---------- floating gauge ---------- */
.gauge { position: fixed; left: 0; top: 0; z-index: 9; width: 78px; height: 78px; margin: -39px 0 0 -39px; pointer-events: none; opacity: 0; transform: scale(.8); transition: opacity .2s, transform .25s var(--ease); display: grid; place-items: center; }
.gauge.show { opacity: 1; transform: scale(1); }
.gauge svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 5; }
.g-bg { stroke: rgba(0,0,0,.25); }
.g-fg { stroke: var(--c, var(--accent)); stroke-linecap: round; stroke-dasharray: 201; stroke-dashoffset: 201; }
.gauge b { font-size: 12px; font-weight: 600; padding: 3px 7px; border-radius: 8px; background: rgba(10,8,7,.62); color: #fff; font-variant-numeric: tabular-nums; transform: translateY(46px); }

/* ---------- dock ---------- */
.dock { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 10; display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: 20px; transition: opacity .4s, background .5s; max-width: calc(100vw - 24px); }
.transport { display: flex; align-items: center; gap: 4px; }
.play { display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 18px 0 14px; border: 0; border-radius: 13px; background: var(--accent); color: var(--on-accent); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: filter .2s, transform .1s, background .4s; white-space: nowrap; }
.play:hover { filter: brightness(1.06); }
.play:active { transform: scale(.98); }
.play svg { width: 17px; height: 17px; fill: currentColor; stroke: none; }
.play .i-replay { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.play .i-pause, .play .i-replay { display: none; }
.play[data-state="running"] .i-play, .play[data-state="done"] .i-play { display: none; }
.play[data-state="running"] .i-pause { display: block; }
.play[data-state="done"] .i-replay { display: block; }
.play[data-state="resetting"] { opacity: .75; }
.slow-txt { font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
#btnSlow.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.tb.follow { display: inline-flex; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 0 12px 0 10px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tb.follow[hidden] { display: none; }
.dock-sep { width: 1px; height: 26px; background: var(--line); }
.roster { display: flex; gap: 4px; }
.chip { position: relative; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 13px 0 11px; border: 1px solid transparent; border-radius: 13px; background: transparent; cursor: pointer; font-size: 13px; color: var(--ink-2); transition: background .2s, color .2s, border-color .2s; white-space: nowrap; }
.chip:hover { background: var(--glass-2); color: var(--ink); }
.chip.on { background: var(--glass-2); border-color: var(--line); color: var(--ink); }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); flex: none; }
.chip .bar { position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; border-radius: 2px; background: rgba(127,127,127,.15); overflow: hidden; }
.chip .bar span { display: block; height: 100%; width: 0; background: var(--c); }
.chip.running i { animation: pulse 0.9s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.5); opacity: .7; } }

/* ---------- beat tracker ---------- */
.beats { position: fixed; left: 50%; bottom: 86px; transform: translate(-50%, 10px); z-index: 9; display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 14px; opacity: 0; pointer-events: none; transition: opacity .35s, transform .45s var(--ease); max-width: calc(100vw - 24px); }
.beats.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.beat { appearance: none; border: 0; background: none; font-family: inherit; cursor: pointer; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 8px; border-radius: 9px; font-size: 11.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap; transition: color .3s, background .3s; }
.beat b { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 9.5px; font-weight: 600; background: var(--glass-2); color: var(--ink-3); transition: background .3s, color .3s; }
.beat:hover { color: var(--ink); background: var(--glass-2); }
.beat:hover b { background: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--ink); }
.beat:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.beat.done { color: var(--ink-2); }
.beat.done b { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--ink); }
.beat.now { color: var(--ink); background: var(--glass-2); }
.beat.now b { background: var(--accent); color: var(--on-accent); animation: beatpulse 1.1s ease-in-out infinite; }
@keyframes beatpulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); } }

/* ---------- hint & toast ---------- */
.hint { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 8; font-size: 12px; color: var(--ink-2); padding: 7px 13px; border-radius: 11px; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line); white-space: nowrap; transition: opacity .3s; pointer-events: none; }
.hint:empty, body.playing .hint { opacity: 0; }
.hint b { color: var(--ink); font-weight: 500; }
.toast { position: fixed; left: 50%; top: 70px; transform: translate(-50%, -14px); z-index: 20; padding: 10px 16px; border-radius: 13px; font-size: 13px; background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--line); box-shadow: var(--shadow); opacity: 0; transition: opacity .3s, transform .4s var(--ease); pointer-events: none; max-width: min(520px, calc(100vw - 32px)); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- help ---------- */
.help { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(0,0,0,.3); animation: fade .3s; }
.help[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.help-card { width: min(680px, calc(100vw - 32px)); padding: 22px 24px 24px; border-radius: 24px; }
.help-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.help-head h2 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 28px; letter-spacing: -.02em; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.help-grid div { display: grid; gap: 4px; align-content: start; }
.help-grid b { font-size: 13px; font-weight: 500; }
.help-grid span { font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.help-grid kbd { margin: 0 1px; }


/* ---------- scene button (dock) ---------- */
.scene-btn { flex: none; min-width: 150px; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 42px; padding: 0 10px 0 14px; border: 0; border-radius: 13px; background: transparent; cursor: pointer; text-align: left; color: var(--ink); transition: background .2s; max-width: 220px; }
.scene-btn:hover, .scene-btn.on { background: var(--glass-2); }
.sc-text { display: grid; line-height: 1.1; min-width: 0; }
.sc-no { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.sc-name { font-family: var(--display); font-weight: 500; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-btn .chev { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.scene-btn.on .chev { transform: rotate(180deg); }
.scene-btn.dirty .sc-no::after { content: ' · edited'; color: var(--accent); }

.scene-link { width: 100%; margin-top: 10px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--well); color: var(--ink-2); font: 500 11.5px var(--ui); padding: 0 10px; }

/* ---------- build mode ---------- */
.btools { display: none; gap: 2px; }
.tb:disabled { opacity: .35; cursor: default; background: transparent; }
body.building .roster { display: none; }
body.building .btools { display: flex; }
body.building .inspector, body.building .gauge { display: none; }
.mode[data-mode="build"].on { color: var(--on-accent); background: var(--accent); box-shadow: none; }

.drawer { position: fixed; left: 20px; top: 92px; z-index: 11; width: 252px; max-height: calc(100vh - 200px); overflow-y: auto; padding: 14px 12px 12px; border-radius: 20px; transform: translateX(calc(-100% - 40px)); opacity: 0; transition: transform .5s var(--ease), opacity .4s, background .5s; scrollbar-width: none; }
.drawer::-webkit-scrollbar { display: none; }
body.building .drawer { transform: none; opacity: 1; }
.drawer-head { display: grid; gap: 2px; padding: 0 4px 4px; }
.drawer-head b { font-family: var(--display); font-weight: 500; font-size: 23px; line-height: 1; letter-spacing: -.02em; }
.drawer-head span { font-size: 11.5px; color: var(--ink-3); }
.drawer h3 { margin: 12px 4px 6px; font-size: 10px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.parts { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.part { --c: var(--ink-3); display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 9px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass-2); cursor: pointer; font-size: 11.5px; font-weight: 500; color: var(--ink-2); transition: background .2s, border-color .2s, transform .15s; user-select: none; -webkit-user-select: none; touch-action: none; }
.part svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; color: var(--c); }
.part:hover { border-color: color-mix(in srgb, var(--c) 55%, transparent); color: var(--ink); transform: translateY(-1px); }
.part.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--ink); }
.part { min-width: 0; }
.part span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; text-align: left; }

.binsp { position: fixed; right: 20px; top: 74px; z-index: 11; width: 318px; max-height: calc(100vh - 180px); overflow-y: auto; padding: 16px 18px 16px; border-radius: 22px; transform: translateX(calc(100% + 40px)); opacity: 0; transition: transform .5s var(--ease), opacity .4s, background .5s; scrollbar-width: none; }
.binsp::-webkit-scrollbar { display: none; }
body.building .binsp { transform: none; opacity: 1; }
.bi-top { display: flex; justify-content: space-between; align-items: center; min-height: 30px; }
.bi-name { margin: 8px 0 6px; font-family: var(--display); font-weight: 500; font-size: 28px; line-height: 1.04; letter-spacing: -.02em; }
.bi-title { width: 100%; margin: 8px 0 10px; padding: 4px 8px; margin-left: -8px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); font: 500 26px/1.12 var(--display); letter-spacing: -.02em; }
.bi-title:hover { border-color: var(--line); }
.bi-title:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: var(--well); }
.bi-about, .bi-line { margin: 0 0 12px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.bi-line b, .bi-route b { color: var(--ink); font-weight: 500; }
.bi-route { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.bi-route span { color: var(--accent); margin: 0 3px; }
.bi-stats { display: flex; gap: 14px; margin: 0 0 12px; font-size: 12px; color: var(--ink-3); }
.bi-stats b { font-size: 15px; font-weight: 600; color: var(--ink); margin-right: 3px; font-variant-numeric: tabular-nums; }
.bi-ports { display: grid; gap: 2px; margin: 4px 0 14px; padding: 6px; border-radius: 14px; background: var(--well); border: 1px solid var(--line); }
.bi-port { display: grid; grid-template-columns: 14px auto 1fr; align-items: baseline; gap: 8px; padding: 6px 6px; font-size: 12.5px; }
.bi-port i { width: 10px; height: 10px; border-radius: 50%; align-self: center; }
.bi-port.out i { background: #ff7a1a; box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.bi-port.in i { background: #fff; box-shadow: inset 0 0 0 2.5px #1d1b18; }
.bi-port b { font-weight: 500; white-space: nowrap; }
.bi-port span { color: var(--ink-2); text-align: right; }
.bi-port em { font-style: normal; color: var(--ink-3); }
.bi-port .free { color: var(--ink-3); }
.bi-actions { display: grid; grid-template-columns: 44px 44px 1fr 1fr; gap: 6px; }
.bi-actions.two { grid-template-columns: 1fr 1fr; }
.bi-actions .btn { height: 38px; padding: 0 10px; }
.btn.danger:hover { border-color: rgba(255,77,77,.6); color: #ff6b5a; }
.btn:disabled { opacity: .4; cursor: default; }
.bi-kinds { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 12px; }
.kind { height: 32px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass-2); cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--ink-2); transition: background .2s, border-color .2s; }
.kind:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--ink); }
.kind.on { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.kind:disabled { opacity: .35; cursor: default; }
.bi-warn { margin: 0 0 12px; padding: 9px 11px; border-radius: 11px; font-size: 12px; line-height: 1.45; color: #ff6b5a; background: rgba(255,77,77,.1); border: 1px solid rgba(255,77,77,.25); }
.bi-steps { margin: 6px 0 12px; padding: 0 0 0 18px; display: grid; gap: 8px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.bi-steps b { color: var(--ink); font-weight: 500; }
.pin { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; }
.pin.out { background: #ff7a1a; box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.pin.in { background: #fff; box-shadow: inset 0 0 0 2.5px #1d1b18; }
.bi-tip { margin: 12px 2px 0; font-size: 11.5px; line-height: 1.7; color: var(--ink-3); }
.bi-finale { margin: 4px 0 6px; padding: 10px 0 0; border-top: 1px solid var(--line, rgba(255,255,255,.08)); }
.bi-finale > b { display: block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 0 0 6px 2px; }
.bi-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.bi-chips .dchip { height: 27px; padding: 0 9px; font-size: 12px; background: var(--glass-2); }
.bi-chips .dchip.on { background: var(--accent); color: var(--on-accent); }

.btip { position: fixed; left: 0; top: 0; z-index: 25; pointer-events: none; padding: 7px 11px; border-radius: 10px; font-size: 12px; white-space: nowrap; background: rgba(16,14,12,.86); color: #f4efe6; box-shadow: 0 8px 24px rgba(0,0,0,.25); opacity: 0; transition: opacity .15s; }
.btip.show { opacity: 1; }
.btip b { font-weight: 600; }
.btip i { font-style: normal; color: rgba(244,239,230,.55); margin-left: 4px; }
body.building .hint { display: none; }


/* ---------- film & tour ---------- */
#stage { display: grid; place-items: center; transition: background .4s; }
/* the film stage is dark, so its UI is too, whatever the light preset */
body.vidcap.ui-light {
  --ink: #f4efe6; --ink-2: rgba(244, 239, 230, 0.7); --ink-3: rgba(244, 239, 230, 0.44);
  --line: rgba(255, 255, 255, 0.1); --glass: rgba(24, 22, 20, 0.62); --glass-2: rgba(255, 255, 255, 0.07);
  --well: rgba(0, 0, 0, 0.25); --shadow: 0 18px 50px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
}
body.vidcap #stage { background: #050505; padding: 66px 356px 120px 20px; }
/* centre the dock and beat tracker under the frame, clear of the panel */
@media (min-width: 821px) {
  body.vidcap .dock, body.vidcap .beats { left: calc(50% - 168px); }
  body.vidcap .beats { bottom: 80px; max-width: calc(100vw - 400px); }
}
body.vidcap #stage canvas { border-radius: 4px; box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 30px 80px rgba(0,0,0,.5); }
body.touring .roster, body.vidcap .roster, body.directing .roster, body.touring .inspector, body.vidcap .inspector, body.directing .inspector, body.touring .gauge, body.vidcap .gauge, body.directing .gauge, body.touring .hint, body.vidcap .hint, body.directing .hint { display: none; }

/* Film: full-screen directing with a slim camera bar under the mode tabs */
.dirbar { position: fixed; left: 50%; top: 66px; z-index: 11; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 14px; transform: translate(-50%, -8px); opacity: 0; pointer-events: none; transition: opacity .45s, transform .45s var(--ease), background .5s; max-width: calc(100vw - 24px); }
body.directing .dirbar { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.db-group { display: flex; gap: 2px; }
.db-sep { width: 1px; height: 18px; margin: 0 5px; background: var(--line); flex: none; }
.dchip { height: 30px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background .2s, color .2s; }
.dchip:hover { background: var(--glass-2); color: var(--ink); }
.dchip.on { background: var(--accent); color: var(--on-accent); }
.dchip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dtog.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.dcap { color: var(--ink); }
.dcap .recdot { width: 8px; height: 8px; box-shadow: 0 0 0 2.5px rgba(255,59,48,.2); }
body.directing .toast { top: 116px; }
/* the bar sits where the world caption would be on narrower desktops */
@media (max-width: 1400px) { body.directing .brand-sub { opacity: 0; pointer-events: none; } }
/* while a take plays the UI steps aside; any pointer movement brings it back */
body.cine-idle { cursor: none; }
body.cine-idle .brand, body.cine-idle .toolbar, body.cine-idle .modes-top, body.cine-idle .dirbar, body.cine-idle .dock, body.cine-idle .beats, body.cine-idle .inspector, body.cine-idle .hint, body.cine-idle .gauge { opacity: 0 !important; pointer-events: none !important; transition-duration: .9s; }
body.ui-hidden .dirbar { opacity: 0 !important; pointer-events: none !important; }
.mode[data-mode="film"].on, .mode[data-mode="tour"].on { color: var(--on-accent); background: var(--accent); box-shadow: none; }

.fpanel { position: fixed; right: 20px; top: 74px; z-index: 11; width: 316px; max-height: calc(100vh - 94px); overflow-y: auto; padding: 16px 16px 14px; border-radius: 22px; transform: translateX(calc(100% + 40px)); opacity: 0; transition: transform .5s var(--ease), opacity .4s, background .5s; scrollbar-width: none; }
.fpanel::-webkit-scrollbar { display: none; }
body.vidcap .fpanel { transform: none; opacity: 1; }
.fp-head { display: grid; gap: 3px; padding: 0 2px 2px; }
.fp-head b { font-family: var(--display); font-weight: 500; font-size: 26px; line-height: 1; letter-spacing: -.02em; }
.fp-head span { font-size: 12px; color: var(--ink-3); }
.fpanel h3 { margin: 12px 2px 6px; font-size: 10px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.fchips { display: flex; flex-wrap: wrap; gap: 5px; }
.fchip { height: 32px; padding: 0 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass-2); cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--ink-2); transition: background .2s, border-color .2s, color .2s; white-space: nowrap; }
.fchip:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--ink); }
.fchip.on { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.fp-toggles { display: grid; gap: 7px; margin-top: 10px; }
.fp-row { display: flex; gap: 10px; flex-wrap: wrap; }
.fp-size { margin: 10px 2px 0; font-size: 12px; color: var(--ink-3); }
.fp-size b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.fp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.fp-actions .primary { grid-column: span 2; }
.fp-actions .btn { height: 40px; }
.fp-actions .btn svg { width: 17px; height: 17px; }
.recdot { width: 10px; height: 10px; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 0 3px rgba(255,59,48,.2); flex: none; }
.fp-note { margin: 12px 2px 0; font-size: 11.5px; line-height: 1.55; color: var(--ink-3); }

.rec-pill { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 14; display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 14px; font-size: 13px; }
.rec-pill[hidden] { display: none; }
.rec-pill i { width: 10px; height: 10px; border-radius: 50%; background: #ff3b30; animation: recblink 1s steps(2) infinite; }
@keyframes recblink { 50% { opacity: .25; } }
.rec-pill b { letter-spacing: .12em; font-size: 11px; }
.rec-pill span { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.rec-pill .btn { height: 32px; }
body.recording .modes-top { opacity: 0; pointer-events: none; }

.render-ov { position: fixed; inset: 0; z-index: 26; pointer-events: none; display: grid; align-items: end; justify-items: center; padding-bottom: 96px; }
.render-ov[hidden] { display: none; }
.ro-card { pointer-events: auto; width: min(460px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 18px; display: grid; gap: 10px; }
.ro-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ro-head b { font-family: var(--display); font-weight: 500; font-size: 21px; letter-spacing: -.02em; }
.ro-head span { font-size: 12px; color: var(--ink-3); }
.ro-bar { height: 4px; border-radius: 4px; background: rgba(127,127,127,.2); overflow: hidden; }
.ro-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.ro-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ro-card .btn { justify-self: end; height: 34px; }
body.rendering .dock, body.rendering .fpanel, body.rendering .toolbar, body.rendering .modes-top, body.rendering .brand { opacity: .25; pointer-events: none; }

.tcard { position: fixed; left: 20px; bottom: 96px; z-index: 11; width: 372px; padding: 14px 16px 12px; border-radius: 22px; transform: translateY(calc(100% + 140px)); opacity: 0; transition: transform .5s var(--ease), opacity .4s, background .5s; }
body.touring .tcard { transform: none; opacity: 1; }
.tc-themes { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.tc-themes .fchip { height: 28px; padding: 0 10px; font-size: 11.5px; }
.tc-top { display: flex; justify-content: space-between; align-items: center; }
.tc-no { font-size: 11px; letter-spacing: .12em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tc-name { margin: 6px 0 6px; font-family: var(--display); font-weight: 500; font-size: 30px; line-height: 1.04; letter-spacing: -.02em; }
.tc-blurb { margin: 0 0 8px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.tc-mech { margin: 0 0 12px; font-size: 12px; color: var(--ink-3); }
.tc-mech b { font-weight: 500; color: var(--ink-2); margin-right: 4px; }
.tc-bar { height: 2px; border-radius: 2px; background: rgba(127,127,127,.18); overflow: hidden; margin-bottom: 10px; transition: opacity .3s; }
.tc-bar.off { opacity: 0; }
.tc-bar span { display: block; height: 100%; width: 0; background: var(--accent); }
.tc-ctl { display: flex; align-items: center; gap: 2px; }
.tc-ctl .tb svg { width: 18px; height: 18px; }
.tc-sep { flex: 1; }
.tc-ctl .btn { height: 36px; padding: 0 12px; margin-left: 4px; }
.tc-ctl .btn.on { border-color: var(--accent); color: var(--accent); }

/* ---------- click to focus ---------- */
.fmark { position: fixed; left: 0; top: 0; z-index: 7; width: 0; height: 0; pointer-events: none; opacity: 0; transition: opacity .35s; }
.fmark.on { opacity: .6; }
.fmark i { position: absolute; width: 9px; height: 9px; border: 1.5px solid #fff; filter: drop-shadow(0 0 3px rgba(0,0,0,.5)); transition: transform .45s var(--ease); }
.fmark i:nth-child(1) { left: -15px; top: -15px; border-right: 0; border-bottom: 0; }
.fmark i:nth-child(2) { left: 6px; top: -15px; border-left: 0; border-bottom: 0; }
.fmark i:nth-child(3) { left: -15px; top: 6px; border-right: 0; border-top: 0; }
.fmark i:nth-child(4) { left: 6px; top: 6px; border-left: 0; border-top: 0; }
.fmark.snap.on { animation: fsnap .9s var(--ease); }
@keyframes fsnap { 0% { opacity: 1; } 60% { opacity: 1; } 100% { opacity: .6; } }
.fmark.snap i:nth-child(1) { animation: fs1 .5s var(--ease); } .fmark.snap i:nth-child(2) { animation: fs2 .5s var(--ease); }
.fmark.snap i:nth-child(3) { animation: fs3 .5s var(--ease); } .fmark.snap i:nth-child(4) { animation: fs4 .5s var(--ease); }
@keyframes fs1 { from { transform: translate(-10px, -10px); } } @keyframes fs2 { from { transform: translate(10px, -10px); } }
@keyframes fs3 { from { transform: translate(-10px, 10px); } } @keyframes fs4 { from { transform: translate(10px, 10px); } }
body.ui-hidden .fmark, body.cine-idle .fmark, body.building .fmark { opacity: 0 !important; }

/* ---------- small screens ---------- */
.roster.compact .chip .name { display: none; }
.roster.compact .chip.on .name { display: inline; }
/* ---------- Toy Box ---------- */
body.toybox .dock, body.toybox .beats, body.toybox .inspector, body.toybox .hint, body.toybox #btnCapture, body.toybox .drawer, body.toybox .binsp, body.toybox .tcard, body.toybox .fpanel { display: none !important; }
body.toybox #worldList, body.toybox #worldPop h3:first-child { display: none; }
body.toybox #worldPop h3:nth-of-type(2) { margin-top: 4px; }
.tbx-bar { position: fixed; left: 50%; bottom: 22px; z-index: 10; transform: translate(-50%, 140%); opacity: 0; padding: 5px; border-radius: 16px; width: max-content; max-width: calc(100vw - 24px); transition: transform .5s var(--ease), opacity .4s; }
body.toybox .tbx-bar { transform: translate(-50%, 0); opacity: 1; }
body.tbx-staged .tbx-bar { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
.tbx-rows { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; max-width: calc(100vw - 34px); }
.tbx-rows::-webkit-scrollbar { display: none; }
.tbx-row { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 0; border-radius: 11px; background: transparent; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background .25s, color .25s; }
.tbx-row:hover { color: var(--ink); background: var(--glass-2); }
.tbx-row i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); flex: none; }
.tbx-row em { font-style: normal; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tbx-row.on { background: var(--glass-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.tbx-hint { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); z-index: 8; font-size: 11.5px; letter-spacing: .01em; color: var(--ink-3); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .4s, bottom .4s var(--ease); max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; }
body.toybox .tbx-hint:not(:empty) { opacity: 1; }
body.tbx-staged .tbx-hint { bottom: 22px; left: calc(50% - 182px); max-width: calc(100vw - 420px); padding: 7px 13px; border-radius: 11px; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line); color: var(--ink-2); }
/* the hover tooltip: rides just above the piece */
.tbx-tip { position: fixed; left: 0; top: 0; z-index: 12; pointer-events: none; display: grid; gap: 4px; padding: 10px 14px 11px; border-radius: 13px; background: rgba(20, 17, 15, .82); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); color: #f6f2ea; box-shadow: 0 14px 34px rgba(0,0,0,.22), 0 0 0 1px rgba(255,255,255,.06) inset; white-space: nowrap; translate: -50% calc(-100% - 4px); opacity: 0; transition: opacity .18s, translate .3s var(--ease); }
body.ui-light .tbx-tip { background: rgba(255, 255, 255, .9); color: #17150f; box-shadow: 0 14px 34px rgba(30,28,24,.14), 0 0 0 1px rgba(0,0,0,.05) inset; }
.tbx-tip.show { opacity: 1; translate: -50% calc(-100% - 12px); }
.tbx-tip b { font-family: var(--display); font-weight: 500; font-size: 17px; line-height: 1.05; letter-spacing: -.01em; }
.tbx-tip span { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; opacity: .55; }
.tbx-tip i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); opacity: 1; }
.tbx-tip em { font-style: normal; margin-left: 4px; font-variant-numeric: tabular-nums; }
body.toybox:not(.tbx-staged) #stage canvas { cursor: inherit; }
/* back to all toys, and stepping between them, on the stage */
.tbx-back { position: fixed; left: 24px; top: 92px; z-index: 11; display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 15px; opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .35s, transform .45s var(--ease); }
body.tbx-staged .tbx-back { opacity: 1; transform: none; pointer-events: auto; }
.tbx-all { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 15px 0 9px; border: 0; border-radius: 11px; background: var(--ink); color: #17150f; font-size: 13px; font-weight: 600; cursor: pointer; transition: transform .12s, filter .2s; }
body.ui-light .tbx-all { color: #fff; }
.tbx-all:hover { filter: brightness(1.15); }
.tbx-all:active { transform: scale(.97); }
.tbx-all svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tbx-sep { width: 1px; height: 22px; margin: 0 4px; background: var(--line); }
.tbx-back .tb { min-width: 34px; height: 34px; }
.tbx-count { min-width: 52px; text-align: center; font-size: 11.5px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.tbx-gap { flex: 1; }
.tbx-lights [data-act].on { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.tbx-lights .fchip svg, .tbx-row2 .fchip svg { display: inline-block; width: 14px; height: 14px; margin: -2px 5px -2px -2px; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.tbx-hint b { color: var(--ink); font-weight: 500; }
.tbx-stage { position: fixed; right: 20px; top: 74px; z-index: 11; width: 344px; max-height: calc(100vh - 94px); overflow-y: auto; padding: 16px 16px 14px; border-radius: 22px; transform: translateX(calc(100% + 40px)); opacity: 0; transition: transform .5s var(--ease), opacity .4s, background .5s; scrollbar-width: none; }
.tbx-stage::-webkit-scrollbar { display: none; }
.tbx-stage.open { transform: none; opacity: 1; }
.tbx-stage .insp-name { font-size: 26px; margin: 6px 0 4px; }
.tbx-stage .insp-blurb { margin-bottom: 6px; font-size: 12.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tbx-stage .tc-mech { margin-bottom: 8px; }
.tbx-stage h3 { margin: 11px 2px 6px; font-size: 10px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.tbx-wind { display: grid; gap: 7px; padding: 10px; border-radius: 16px; background: var(--well); border: 1px solid var(--line); margin-top: 4px; }
.tbx-meter { height: 6px; border-radius: 4px; background: rgba(127,127,127,.18); overflow: hidden; }
.tbx-meter span { display: block; height: 100%; width: 0; background: var(--c); box-shadow: 0 0 10px var(--c); }
.tbx-wread { font-size: 12px; color: var(--ink-3); }
.tbx-wread b { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.tbx-wbtns { display: grid; grid-template-columns: 1.4fr 1fr; gap: 6px; }
.tbx-wbtns .btn { height: 34px; }
.tbx-wbtns .btn.primary { grid-column: auto; }
.tbx-ins, .tbx-outs { display: grid; gap: 5px; }
.tbx-in { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 5px 5px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass-2); transition: border-color .3s, box-shadow .3s; }
.tbx-in.pulse { animation: tbxpulse .7s var(--ease); }
@keyframes tbxpulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); border-color: var(--accent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.tbx-pl { display: flex; align-items: center; gap: 7px; font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbx-pl kbd { font-size: 9.5px; padding: 0 5px; }
.tbx-btns { display: flex; gap: 4px; flex: none; }
.tbx-btns .fchip { height: 28px; padding: 0 10px; font-size: 12px; }
.tbx-out { display: flex; align-items: center; gap: 9px; padding: 5px 10px; border-radius: 12px; border: 1px dashed var(--line); font-size: 12.5px; color: var(--ink-2); transition: color .3s, border-color .3s, background .3s; }
.tbx-out i { width: 10px; height: 10px; border-radius: 50%; background: rgba(127,127,127,.3); flex: none; transition: background .3s, box-shadow .3s; }
.tbx-out em { margin-left: auto; font-style: normal; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.tbx-out.fired { color: var(--ink); border-style: solid; border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tbx-out.fired i { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.tbx-out.fired em { color: var(--accent); }
.tbx-out.lit i { animation: tbxlamp .9s var(--ease); }
@keyframes tbxlamp { 0% { transform: scale(2.2); box-shadow: 0 0 26px 6px var(--accent); } 100% { transform: scale(1); } }
.tbx-none { margin: 0 2px; font-size: 12px; color: var(--ink-3); }
.tbx-dist { display: flex; align-items: center; gap: 10px; }
.tbx-dist input { flex: 1; accent-color: var(--accent); }
.tbx-dist b { width: 34px; text-align: right; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tbx-row2 { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.tbx-row2 .fchip, .tbx-lights .fchip { height: 30px; padding: 0 10px; font-size: 12px; }
.tbx-lights { margin-top: 6px; }
.tbx-row2 [data-act].on { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.tbx-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; margin-top: 12px; }
.tbx-actions .primary { grid-column: auto; padding: 0 10px; }
.tbx-actions .btn:not(.primary) { padding: 0 10px; gap: 6px; font-size: 12.5px; min-width: 68px; }
.tbx-actions .btn { height: 36px; }
.tbx-actions .btn svg { width: 17px; height: 17px; }
.tbx-actions .btn:disabled { opacity: .55; cursor: default; }
.tbx-stage .fp-note { margin-top: 10px; }

@media (max-width: 1100px) {
  .chip .name { display: none; }
  .chip.on .name { display: inline; }
  .beat span { display: none; }
  .beat.now span { display: inline; }
}
@media (max-width: 820px) {
  .brand { left: 16px; top: 14px; }
  .brand-mark { font-size: 18px; gap: 8px; }
  .brand-mark svg { width: 16px; height: 16px; }
  .brand-sub { display: none; }
  .modes-top { left: 14px; top: 46px; transform: none; padding: 3px; border-radius: 12px; }
  .mode { height: 28px; padding: 0 12px; font-size: 12px; border-radius: 9px; }
  
  .toolbar { right: 12px; top: 12px; }
  .tb { min-width: 32px; height: 32px; }
  #btnFull, #btnHome, #btnShot { display: none; } /* stills live in Video Capture on phones */
  .dock { left: 12px; right: 12px; transform: none; bottom: 21px; flex-direction: column; align-items: stretch; gap: 6px; border-radius: 18px; }
  .transport { justify-content: center; }
  .play { flex: 1; justify-content: center; }
  .dock-sep { display: none; }
  .roster { overflow-x: auto; scrollbar-width: none; }
  .roster::-webkit-scrollbar { display: none; }
  .chip { flex: 1; justify-content: center; }
  .btn kbd { display: none; }
  .beats { bottom: 181px; }
  .inspector { left: 12px; right: 12px; top: auto; bottom: 179px; width: auto; max-height: 46vh; overflow-y: auto; transform: translateY(calc(100% + 140px)); border-radius: 20px; }
  .insp-blurb, .insp-tip, .hint { display: none; }
  .insp-name { font-size: 25px; margin-top: 6px; }
  .popover { left: 12px; right: 12px; width: auto; top: 56px; }
  .help-grid { grid-template-columns: 1fr; }
  .toast { top: 88px; }
  .scene-btn { max-width: none; justify-content: center; }
  .drawer { left: 12px; right: 12px; top: auto; bottom: 175px; width: auto; max-height: none; padding: 7px; border-radius: 16px; }
  .drawer-head, .drawer h3 { display: none; }
  .drawer-body { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
  .drawer-body::-webkit-scrollbar { display: none; }
  .parts { display: contents; }
  .part { flex: none; width: 118px; }
  .binsp { left: 12px; right: 12px; top: 84px; width: auto; max-height: 38vh; padding: 12px 14px; }
  .binsp[data-kind="scene"] { display: none; }
  .fpanel { left: 12px; right: 12px; top: auto; bottom: 177px; width: auto; max-height: 34vh; padding: 12px 14px; }
  body.vidcap #stage { padding: 84px 8px calc(34vh + 176px); align-items: start; }
  .fp-head, .fp-note { display: none; }
  .dirbar { left: 12px; right: 12px; top: 88px; transform: translateY(-8px); overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .dirbar::-webkit-scrollbar { display: none; }
  body.directing .dirbar { transform: none; }
  .dchip { height: 28px; padding: 0 10px; font-size: 12px; }
  body.directing .toast { top: 134px; }
  .tcard { left: 12px; right: 12px; bottom: 177px; width: auto; padding: 12px 14px 10px; }
  .tc-blurb { display: none; }
  .tc-name { font-size: 24px; }
  .render-ov { padding-bottom: 180px; }
  .bi-name { font-size: 23px; }
  .bi-about, .bi-tip { display: none; }
  .tbx-bar { left: 12px; right: 12px; width: auto; transform: translateY(140%); bottom: 12px; }
  body.toybox .tbx-bar { transform: none; }
  body.tbx-staged .tbx-bar { transform: translateY(140%); }
  .tbx-hint { display: none; }
  .tbx-back { left: 12px; top: 100px; }
  .tbx-tip b { font-size: 15px; }
  .tbx-stage { left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: 44vh; padding: 12px 14px; transform: translateY(calc(100% + 40px)); }
  .tbx-stage .insp-blurb, .tbx-stage .tc-mech, .tbx-stage .fp-note { display: none; }
  .tbx-stage .insp-name { font-size: 23px; }
}

/* ---------------------------------------------------------------- start card */
.brand-mark.clickable { pointer-events: auto; cursor: pointer; }
.brand-mark.clickable:hover span { opacity: .85; }
.start { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 70px 20px 20px; }
body.start-open .modes-top { z-index: 41; }
.start[hidden] { display: none; }
.start-scrim { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 40%, rgba(10,8,6,.38), rgba(10,8,6,.72)); backdrop-filter: blur(10px) saturate(1.1); -webkit-backdrop-filter: blur(10px) saturate(1.1); opacity: 0; transition: opacity .32s var(--ease); }
body.ui-light .start-scrim { background: radial-gradient(120% 90% at 50% 40%, rgba(250,248,244,.35), rgba(232,228,220,.7)); }
.start-card { position: relative; width: min(1120px, 100%); max-height: calc(100vh - 90px); overflow-y: auto; overscroll-behavior: contain; padding: 26px 32px 18px; border-radius: 26px; opacity: 0; transform: translateY(14px) scale(.985); transition: opacity .32s var(--ease), transform .42s var(--ease); scrollbar-width: thin; }
.start.in .start-scrim, .start.in .start-card { opacity: 1; }
.start.in .start-card { transform: none; }
body.start-open .brand, body.start-open .toolbar, body.start-open .dock, body.start-open .drawer, body.start-open .binsp, body.start-open .inspector, body.start-open .beats, body.start-open .hint, body.start-open .toast { opacity: 0 !important; pointer-events: none !important; }
.start-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.start-head h1 { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(30px, 4.2vw, 46px); line-height: 1; letter-spacing: -.025em; }
.start-head h1 em { font-style: italic; color: var(--accent); }
.start-head p { margin: 10px 0 0; max-width: 560px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.start-x { flex: none; width: 36px; height: 36px; }
.start-x svg { width: 18px; height: 18px; }
.start-hero { display: grid; grid-template-columns: 2.1fr 1fr; gap: 14px; margin-bottom: 20px; }
.start-surprise, .start-continue { position: relative; display: flex; align-items: center; gap: 18px; min-height: 96px; padding: 16px 22px; border-radius: 18px; border: 1px solid var(--line); cursor: pointer; text-align: left; color: inherit; font: inherit; transition: transform .18s var(--ease), box-shadow .25s, border-color .2s, background .2s; }
.start-surprise { overflow: hidden; color: #1a1208; border-color: transparent;
  background: radial-gradient(circle at 12% 120%, rgba(255,255,255,.45) 0 18%, transparent 19%), radial-gradient(circle at 92% -10%, rgba(255,255,255,.3) 0 16%, transparent 17%), conic-gradient(from 210deg at 70% 60%, #ffb547, #ff7a59, #ff5fae, #b996ff, #5cc8ff, #3fd6c4, #ffd23f, #ffb547);
  box-shadow: 0 14px 40px rgba(255,140,60,.28), inset 0 1px 0 rgba(255,255,255,.5); }
.start-surprise::after { content: ''; position: absolute; inset: 0; background: radial-gradient(3px 3px at 20% 30%, rgba(255,255,255,.9) 50%, transparent 51%), radial-gradient(2px 2px at 64% 22%, rgba(255,255,255,.8) 50%, transparent 51%), radial-gradient(3px 3px at 84% 70%, rgba(255,255,255,.75) 50%, transparent 51%), radial-gradient(2px 2px at 44% 80%, rgba(255,255,255,.7) 50%, transparent 51%), linear-gradient(90deg, rgba(255,250,240,.82) 0%, rgba(255,250,240,.5) 52%, rgba(255,250,240,0) 100%); pointer-events: none; }
.start-surprise > * { position: relative; z-index: 1; }
.start-surprise:hover, .start-continue:hover { transform: translateY(-2px); }
.start-surprise:hover { box-shadow: 0 18px 48px rgba(255,140,60,.36), inset 0 1px 0 rgba(255,255,255,.5); }
.start-surprise:focus-visible, .start-continue:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ss-dice { flex: none; width: 66px; height: 66px; display: grid; place-items: center; border-radius: 18px; background: #1d1610; box-shadow: 0 8px 20px rgba(40,20,0,.3); transition: transform .5s var(--ease); }
.ss-dice svg { width: 46px; height: 46px; }
.ss-dice rect { fill: #fff6e6; stroke: #1d1610; stroke-width: 1.2; }
.ss-dice .pip circle { fill: #ff5a4e; }
.start-surprise:hover .ss-dice { transform: rotate(-12deg) scale(1.04); }
.ss-text { display: grid; gap: 6px; min-width: 0; }
.ss-text b { font-family: var(--display); font-weight: 600; font-size: 28px; line-height: 1; letter-spacing: -.02em; }
.ss-text span { font-size: 13.5px; line-height: 1.4; color: rgba(26,18,8,.72); }
.start-surprise kbd { position: absolute; right: 16px; top: 14px; background: rgba(26,18,8,.1); border-color: rgba(26,18,8,.14); color: rgba(26,18,8,.66); }
.ss-busy { display: none; font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.start-surprise.busy .ss-text { display: none; }
.start-surprise.busy .ss-busy { display: block; }
.start-surprise.busy .ss-dice { animation: dice-roll .5s linear infinite; }
@keyframes dice-roll { to { transform: rotate(360deg); } }
.start-continue { flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; background: var(--glass-2); }
.start-continue:hover { border-color: var(--ink-3); }
.sc-k { font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.sc-name { font-family: var(--display); font-weight: 500; font-size: 19px; line-height: 1.15; letter-spacing: -.01em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-world { font-size: 12.5px; color: var(--ink-2); }
.start-card h3 { margin: 0 2px 12px; font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.start-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px 12px; }
.st-tile { display: grid; gap: 8px; align-content: start; min-width: 0; }
.st-img { position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer; aspect-ratio: 16 / 9; border-radius: 13px; overflow: hidden; background: var(--g); box-shadow: 0 0 0 1px var(--line), 0 8px 22px rgba(0,0,0,.18); transition: transform .22s var(--ease), box-shadow .22s; }
.st-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.st-img:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--c), 0 12px 28px rgba(0,0,0,.24); }
.st-img:hover img { transform: scale(1.045); }
.st-tile.on .st-img { box-shadow: 0 0 0 2px var(--c), 0 8px 22px rgba(0,0,0,.18); }
.st-meta { display: grid; gap: 2px; padding: 0 2px; min-width: 0; }
.st-meta b { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 500; font-size: 16px; line-height: 1.2; letter-spacing: -.01em; margin-bottom: 2px; }
.st-meta b em { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.st-track { display: flex; align-items: baseline; gap: 6px; padding: 3px 6px; margin: 0 -6px; border: 0; border-radius: 7px; background: none; color: var(--ink-2); font: inherit; font-size: 12.5px; line-height: 1.3; text-align: left; cursor: pointer; min-width: 0; transition: background .15s, color .15s; }
.st-track i { font-style: normal; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; color: var(--ink-3); flex: none; }
.st-track:hover { background: var(--glass-2); color: var(--ink); }
.st-track.on { color: var(--ink); }
.st-track.on i { color: var(--c); }
.st-img:focus-visible, .st-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Build new: in place of Carry on until there's work of your own */
.start-continue[hidden] { display: none; }
.start-new { flex-direction: row; align-items: center; gap: 16px; }
.sn-plus { flex: none; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 20px rgba(0,0,0,.22); transition: transform .4s var(--ease); }
.sn-plus svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.start-new:hover .sn-plus { transform: rotate(90deg); }
.sn-text { display: grid; gap: 4px; }
.sn-text b { font-family: var(--display); font-weight: 600; font-size: 24px; line-height: 1; letter-spacing: -.02em; }
.sn-text span { font-size: 13px; line-height: 1.35; color: var(--ink-2); }
/* My scenes, at the foot of the card */
.start-mine { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.sm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sm-head h3 { margin: 0 2px !important; }
.sm-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.sm-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass-2); color: var(--ink); font: 500 12.5px var(--ui); cursor: pointer; transition: background .2s, border-color .2s, transform .2s var(--ease); }
.sm-btn:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.sm-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sm-btn[data-act="new"] { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.sm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.sm-item { display: flex; align-items: center; gap: 12px; padding: 11px 8px 11px 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--glass-2); cursor: pointer; min-width: 0; transition: border-color .2s, transform .2s var(--ease); }
.sm-item:hover { border-color: var(--c); transform: translateY(-1px); }
.sm-item.on { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.sm-item > i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.sm-item > span { display: grid; gap: 3px; flex: 1; min-width: 0; }
.sm-item b { font-family: var(--display); font-weight: 500; font-size: 16px; line-height: 1.2; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-item b + span { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-del { width: 28px; height: 28px; flex: none; opacity: .55; }
.sm-item:hover .sm-del { opacity: 1; }
.sm-empty { grid-column: 1 / -1; margin: 0; padding: 14px 16px; border-radius: 13px; border: 1px dashed var(--line); font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.sm-empty b { color: var(--ink-2); font-weight: 600; }
.start-mine .scene-link { margin-top: 10px; }
.start-credit { color: inherit; text-decoration: none; }
.start-credit:hover { color: var(--accent); }
.start-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
@media (max-width: 820px) {
  .start { padding: 86px 10px 10px; }
  .start-card { padding: 20px 16px 16px; border-radius: 20px; max-height: calc(100vh - 96px); }
  .mode { padding: 0 10px; }
  .start-hero { grid-template-columns: 1fr; }
  .start-surprise { min-height: 92px; padding: 14px 16px; gap: 14px; }
  .ss-dice { width: 54px; height: 54px; }
  .ss-text b { font-size: 23px; }
  .start-surprise kbd { display: none; }
  .start-continue { min-height: 0; padding: 12px 16px; }
  .start-grid { grid-template-columns: repeat(2, 1fr); gap: 12px 10px; }
  .st-meta b { font-size: 14px; }
  .drawer-surprise em { display: none; }
}
@media (prefers-reduced-motion: reduce) { .start-card, .start-scrim, .st-img, .st-img img, .ss-dice { transition: none !important; animation: none !important; } }

/* Surprise me in the Build drawer */
.drawer-surprise { display: flex; align-items: center; gap: 10px; width: 100%; margin: 8px 0 2px; padding: 9px 12px; border: 0; border-radius: 12px; cursor: pointer; text-align: left; color: #1a1208; font: inherit; background: linear-gradient(100deg, #ffb547, #ff7a59 55%, #ff5fae); box-shadow: 0 8px 20px rgba(255,120,60,.22); transition: transform .15s var(--ease), filter .2s; }
.drawer-surprise:hover { transform: translateY(-1px); filter: brightness(1.05); }
.drawer-surprise svg { width: 22px; height: 22px; flex: none; fill: rgba(255,250,240,.92); stroke: #1a1208; stroke-width: 1.3; }
.drawer-surprise span { display: grid; gap: 1px; min-width: 0; }
.drawer-surprise b { font-size: 13.5px; font-weight: 600; }
.drawer-surprise em { font-style: normal; font-size: 11px; color: rgba(26,18,8,.66); }

/* ---------------------------------------------------------------- the intro */
.intro { position: fixed; inset: 0; z-index: 46; pointer-events: auto; color: #fff; font-family: var(--ui); }
.intro[hidden] { display: none; }
body.intro-on .brand, body.intro-on .toolbar, body.intro-on .dock, body.intro-on .drawer, body.intro-on .binsp, body.intro-on .inspector, body.intro-on .beats, body.intro-on .hint, body.intro-on .toast, body.intro-on .modes-top, body.intro-on .dirbar, body.intro-on .gauge, body.intro-on .roster, body.intro-on .tbx-stage, body.intro-on .tcard, body.intro-on .fpanel, body.intro-on .popover, body.intro-on .tbx-bar, body.intro-on .tbx-hint, body.intro-on .tbx-tip, body.intro-on .tbx-back, body.intro-on .tbx-card, body.intro-on .focus-mark { opacity: 0 !important; pointer-events: none !important; transition: opacity .6s; }
.intro-curtain { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity .95s cubic-bezier(.2,0,.3,1); z-index: 1; pointer-events: none; will-change: opacity; }
.intro-curtain.on { opacity: 1; transition: opacity 1.3s cubic-bezier(.35,0,.65,1); }
.intro-title { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; z-index: 3; pointer-events: none; padding: 0 6vw; text-shadow: 0 2px 30px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.35); }
.intro-title::before, .intro-logo::before { content: ''; position: absolute; left: 50%; top: 50%; width: min(1180px, 96vw); height: clamp(220px, 34vh, 420px); transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(8,6,10,.46), rgba(8,6,10,.18) 62%, rgba(8,6,10,0)); z-index: -1; opacity: 0; transition: opacity 1s var(--ease); }
.intro-title.in::before, .intro-logo.in::before { opacity: 1; }
.intro-lower::before { content: ''; position: absolute; left: -5vw; right: -14vw; top: -30px; bottom: -22px; background: radial-gradient(60% 80% at 20% 60%, rgba(8,6,10,.45), rgba(8,6,10,0)); z-index: -1; opacity: 0; transition: opacity .8s; }
.intro-lower.in::before { opacity: 1; }
.intro-title > * { opacity: 0; transform: translateY(14px); transition: opacity .9s var(--ease), transform 1.2s var(--ease), letter-spacing 1.6s var(--ease); }
.intro-title.in > * { opacity: 1; transform: none; }
.intro-title.in .it-p { transition-delay: .35s; }
.it-k { display: block; font-size: clamp(11px, 1.05vw, 15px); font-weight: 600; letter-spacing: .42em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.1vh; }
.it-k:empty, .it-p:empty { display: none; }
.it-h { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(34px, 5.6vw, 92px); line-height: .98; letter-spacing: .06em; }
.intro-title.in .it-h { letter-spacing: -0.005em; }
.it-p { margin: 1.6vh auto 0; max-width: 40em; font-size: clamp(13px, 1.25vw, 19px); color: rgba(255,255,255,.86); letter-spacing: .01em; }
.intro-lower { position: absolute; left: 5vw; bottom: 8vh; z-index: 3; pointer-events: none; display: flex; flex-direction: column; gap: 4px; text-shadow: 0 1px 16px rgba(0,0,0,.55); }
.intro-lower > * { opacity: 0; transform: translateX(-16px); transition: opacity .6s var(--ease), transform .9s var(--ease); }
.intro-lower.in > * { opacity: 1; transform: none; }
.intro-lower.in span { transition-delay: .15s; }
.intro-lower b { font-family: var(--display); font-weight: 600; font-size: clamp(20px, 2.3vw, 34px); letter-spacing: .01em; }
.intro-lower b::before { content: ''; display: inline-block; width: 26px; height: 3px; background: var(--accent); vertical-align: middle; margin: -3px 12px 0 0; border-radius: 2px; }
.intro-lower span { font-size: clamp(11px, .95vw, 14px); letter-spacing: .28em; text-transform: uppercase; color: rgba(255,255,255,.78); padding-left: 38px; }
.intro-logo { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-58%); z-index: 3; text-align: center; pointer-events: none; text-shadow: 0 2px 40px rgba(0,0,0,.5); }
.intro-logo > * { opacity: 0; transform: translateY(18px) scale(.98); transition: opacity 1.4s var(--ease), transform 1.8s var(--ease); }
.intro-logo.in > * { opacity: 1; transform: none; }
.intro-logo.in .il-tag { transition-delay: .6s; }
.intro-logo.in .il-credit { transition-delay: 1.2s; }
.il-mark { font-family: var(--display); font-weight: 600; font-size: clamp(44px, 7.8vw, 132px); letter-spacing: -0.015em; line-height: .95; }
.il-mark em, .ig-mark em { font-style: italic; font-weight: 500; color: var(--accent); }
.il-tag { margin: 2vh 0 0; font-size: clamp(14px, 1.6vw, 24px); letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.92); }
.il-credit { display: block; margin-top: 3vh; font-size: clamp(10px, .9vw, 13px); letter-spacing: .3em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.intro-skip { position: absolute; right: 2.4vw; bottom: calc(3.2vh + 26px); z-index: 4; appearance: none; border: 1px solid rgba(255,255,255,.22); background: rgba(0,0,0,.28); color: rgba(255,255,255,.86); font: 500 12px var(--ui); letter-spacing: .06em; padding: 8px 12px; border-radius: 999px; cursor: pointer; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity .6s, background .2s; display: flex; align-items: center; gap: 8px; }
.intro.film .intro-skip { opacity: .75; }
.intro.film .intro-skip:hover { opacity: 1; background: rgba(0,0,0,.5); }
.intro-skip kbd { font: 600 10px var(--ui); padding: 2px 5px; border-radius: 5px; background: rgba(255,255,255,.14); }
.intro-gate { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 24px; background: radial-gradient(90% 80% at 50% 52%, rgba(10,8,7,.5) 0%, rgba(10,8,7,.7) 62%, rgba(6,5,4,.9) 100%); opacity: 0; visibility: hidden; transition: opacity .8s var(--ease), visibility .8s; }
.intro.gate .intro-gate { opacity: 1; visibility: visible; }
.ig-inner { text-align: center; max-width: 760px; text-shadow: 0 2px 30px rgba(0,0,0,.5); animation: igIn 1.4s var(--ease) both; }
@keyframes igIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.ig-k { display: block; font-size: 12px; font-weight: 600; letter-spacing: .42em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.ig-mark { font-family: var(--display); font-weight: 600; font-size: clamp(46px, 8vw, 120px); letter-spacing: -0.015em; line-height: .95; }
.ig-inner p { margin: 18px auto 0; max-width: 34em; font-size: clamp(14px, 1.35vw, 18px); line-height: 1.5; color: rgba(255,255,255,.86); }
.ig-btns { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.ig-btns button { appearance: none; border: 0; cursor: pointer; font: 600 15px var(--ui); letter-spacing: .01em; border-radius: 999px; padding: 14px 24px; display: inline-flex; align-items: center; gap: 10px; transition: transform .2s var(--ease), background .2s, box-shadow .2s; }
.ig-play { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 34px rgba(255,181,71,.35); }
.ig-play svg { width: 18px; height: 18px; fill: currentColor; }
.ig-play:hover { transform: translateY(-1px) scale(1.02); box-shadow: 0 14px 40px rgba(255,181,71,.45); }
.ig-skip { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.2) !important; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.ig-skip:hover { background: rgba(255,255,255,.18); }
.ig-foot { display: block; margin-top: 22px; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.start-intro { appearance: none; border: 1px solid var(--line); background: var(--glass-2); color: var(--ink-2); font: 500 12px var(--ui); border-radius: 999px; padding: 6px 12px 6px 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: color .2s, background .2s; }
.start-intro:hover { color: var(--ink); background: rgba(255,255,255,.12); }
.start-intro svg { width: 12px; height: 12px; fill: currentColor; }
@media (max-width: 640px) { .intro-lower { bottom: 9vh; } }
/* the design credit, bottom right on every screen (the intro included) */
.credit { position: fixed; right: 18px; bottom: 7px; z-index: 47; font: 600 10px var(--ui); letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3); text-decoration: none; opacity: .75; padding: 4px 2px; transition: opacity .6s, color .2s; text-shadow: var(--text-shadow); }
.credit:hover { opacity: 1; color: var(--accent); }
body.intro-on .credit { color: rgba(255,255,255,.62); text-shadow: 0 1px 8px rgba(0,0,0,.5); }
body.cine-idle .credit { opacity: .4; }
body.ui-hidden .credit, body.capturing .credit { opacity: 0; pointer-events: none; }
@media (max-width: 820px) { .credit { right: 14px; bottom: 2px; padding: 2px; font-size: 8.5px; letter-spacing: .2em; } }
