/* ═══════════════════════════════════════════════════════════════════════════
   lib/styles/quest.css — the Start page: a game-style first hour in Dysnomia
   (start.html + lib/quest.js). Deep Field tokens from deep-field.css.

   Scenes animate by beat: lib/quest.js adds .b1, .b2 … to #stage as the
   caption advances, so a rule under .bN applies from beat N onward.
   ═══════════════════════════════════════════════════════════════════════════ */

.q-body main { position: relative; z-index: 1; }
.q-body [hidden] { display: none !important; }

/* ── immersive mode: the whole Start experience without the site's chrome ── */
html.q-imm #dfBar, html.q-imm #dfFoot, html.q-imm .df-behind, html.q-imm .emnav, html.q-imm .emnav-panel { display: none !important; }
html.q-imm .q-title { min-height: 100vh; min-height: 100svh; }
html.q-imm .q-map, html.q-imm .q-level { padding-top: 64px; }
.q-fsbar { position: fixed; z-index: 500; top: 14px; right: 14px; display: flex; gap: 8px; }
.q-fs-b { border: 1px solid rgba(168,230,255,.35); background: rgba(4,7,14,.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #d6e9f5; border-radius: 9px; padding: 8px 12px; font: 500 13px var(--df-sans); cursor: pointer; }
.q-fs-b:hover { border-color: var(--df-ice); color: #fff; }
html.q-cine-on .q-fsbar { top: calc(4.5vh + 10px); }

/* wallet badge, always in view */
.q-fsbar { z-index: 2000; align-items: center; }
.q-wal { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(240,163,92,.55); background: rgba(4,7,14,.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #ffd6b0; border-radius: 999px; padding: 7px 13px; font: 500 12.5px var(--df-mono); cursor: pointer; max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-wal i { width: 8px; height: 8px; border-radius: 50%; background: #f0a35c; flex: none; animation: q-pulse 2s ease-in-out infinite; }
.q-wal.on { border-color: rgba(100,227,168,.5); color: #bff3da; }
.q-wal.on i { background: #64e3a8; box-shadow: 0 0 8px #64e3a8; animation: none; }
html:not(.q-imm) .q-fsbar { top: 74px; }
@media (max-width: 600px) { .q-fsbar { top: 10px; right: 10px; gap: 6px; } .q-fs-b { padding: 7px 10px; font-size: 12px; white-space: nowrap; } .q-fs-b .l { display: none; } .q-wal { max-width: 52vw; } }

/* connect gate */
.q-gate { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 70px 16px; background: radial-gradient(ellipse at 50% 40%, #0c1426 0%, #03050a 70%); }
.q-gate-in { max-width: 560px; text-align: center; animation: q-rise .8s ease both; }
.q-gate h2 { font: 650 clamp(26px, 3.6vw, 40px)/1.1 var(--df-wide); margin: 0 0 14px; }
.q-gate p { color: #b9c1d1; font-size: 15.5px; line-height: 1.65; }
.q-gate-b { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 24px 0 6px; }

/* skip ahead */
.q-skipnext { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--df-line); display: flex; flex-direction: column; gap: 3px; }
.q-skipnext span { font-size: 12px; color: var(--df-dim); }
.q-act.flash { animation: q-flash .9s ease; }
@keyframes q-flash { 30% { box-shadow: 0 0 0 2px var(--df-ice), 0 0 40px rgba(168,230,255,.45); } }

/* full-screen scene + your move docked beside it */
.q-docktab { display: none; }
html.q-cine-on .q-act { position: fixed; z-index: 400; right: 16px; top: calc(4.5vh + 56px); bottom: calc(4.5vh + 14px); width: 380px; overflow: auto; background: rgba(5,8,15,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-color: rgba(168,230,255,.3); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
@media (min-width: 1101px) {
  html.q-cine-on .q-stage-wrap.cine .q-box { left: calc((100vw - 410px) / 2); width: min(calc(100vw - 430px), calc((91vh - 280px) * 16 / 9)); }
  html.q-cine-on .q-stage-wrap.cine .q-caption { left: calc((100vw - 410px) / 2); width: min(820px, calc(100vw - 450px)); }
  /* the title card sits in the space left of the "Your move" panel, sized to that space
     (this needs the extra class: `.q-stage-wrap.cine .q-card { inset: 0 }` would otherwise win) */
  html.q-cine-on .q-stage-wrap.cine .q-card { right: 410px; }
  html.q-cine-on .q-stage-wrap.cine .q-card .t { font-size: clamp(30px, calc((100vw - 410px) * .062), 80px); max-width: calc(100vw - 470px); }
  html.q-cine-on .q-stage-wrap.cine .q-card .ln { width: min(560px, calc(100vw - 490px)); }
}
@media (max-width: 1100px) {
  html.q-cine-on .q-act { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 72vh; border-radius: 16px 16px 0 0; transform: translateY(calc(100% - 46px)); transition: transform .45s cubic-bezier(.2,.8,.2,1); padding-top: 52px; }
  html.q-cine-on.q-dock-open .q-act { transform: none; }
  html.q-cine-on .q-docktab { display: block; position: absolute; top: 0; left: 0; right: 0; height: 46px; border: 0; background: none; color: var(--df-ice); font: 600 13px var(--df-mono); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
  html.q-cine-on .q-docktab::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: rgba(168,230,255,.4); }
  html.q-cine-on .q-stage-wrap.cine .q-caption { bottom: calc(46px + 10px); }
}

/* ── title screen ───────────────────────────────────────────────────────── */
.q-title { position: relative; min-height: calc(100vh - 64px); min-height: calc(100svh - 64px); display: grid; place-items: center; overflow: hidden; padding: 40px 16px 70px; }
.q-title-bg { position: absolute; inset: 0; z-index: -1; }
.q-title-bg canvas { position: absolute; left: 50%; top: 50%; width: max(120vw, 120vh); height: max(120vw, 120vh); transform: translate(-50%, -50%); opacity: 0; transition: opacity 2.4s ease; image-rendering: auto; }
.q-title-bg canvas.on { opacity: .85; animation: q-zoom 26s linear forwards; }
.q-title-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 46%, rgba(3,4,7,.25) 0%, rgba(3,4,7,.72) 58%, rgba(3,4,7,.96) 100%); }
@keyframes q-zoom { from { transform: translate(-50%, -50%) scale(1) rotate(0deg); } to { transform: translate(-50%, -50%) scale(1.9) rotate(14deg); } }
.q-title-in { position: relative; max-width: 640px; text-align: center; }
/* a soft pool of dark behind the words, so they read over the brightest part of the fractal */
.q-title-in::before { content: ""; position: absolute; z-index: -1; inset: -60px -90px; background: radial-gradient(ellipse at 50% 50%, rgba(3,4,7,.78) 0%, rgba(3,4,7,.55) 45%, rgba(3,4,7,0) 72%); pointer-events: none; }
.q-lede, .q-note { text-shadow: 0 1px 12px rgba(3,4,7,.9); }
.q-kicker { font: 500 11px var(--df-mono); letter-spacing: .3em; text-transform: uppercase; color: var(--df-ice); margin: 0 0 14px; opacity: 0; animation: q-rise .9s .2s ease forwards; }
.q-title h1 { font: 650 clamp(28px, 4.2vw, 46px)/1.1 var(--df-wide); letter-spacing: -.02em; margin: 0; color: var(--df-ink); opacity: 0; animation: q-rise 1s .45s ease forwards; }
.q-lede { color: #b9c1d1; font-size: 16px; line-height: 1.65; margin: 16px auto 0; max-width: 54ch; opacity: 0; animation: q-rise 1s .75s ease forwards; }
.q-menu { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 30px; opacity: 0; animation: q-rise 1s 1.05s ease forwards; }
.q-start { display: inline-flex; align-items: center; gap: 12px; padding: 15px 30px; border-radius: 12px; border: 1px solid var(--df-ice); background: var(--df-ice); color: #04121a; font: 650 17px var(--df-wide); letter-spacing: .01em; cursor: pointer; box-shadow: 0 0 0 0 rgba(168,230,255,.5); animation: q-pulse 2.4s 2s ease-in-out infinite; }
.q-start .k { font-size: 13px; }
.q-start .h { font: 500 10.5px var(--df-mono); letter-spacing: .12em; text-transform: uppercase; padding: 3px 7px; border-radius: 5px; background: rgba(4,18,26,.12); }
.q-start:hover { background: #c9f0ff; }
.q-cont { padding: 11px 22px; border-radius: 10px; border: 1px solid var(--df-line-strong); background: rgba(6,8,14,.6); color: var(--df-ink); font: 600 14px var(--df-sans); cursor: pointer; }
.q-cont:hover { border-color: var(--df-ice); }
.q-skip { color: var(--df-muted); font-size: 13.5px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(142,151,169,.4); }
.q-skip:hover { color: var(--df-ink); }
.q-note { font-size: 12.5px; color: #8e97a9; max-width: 50ch; margin: 26px auto 0; line-height: 1.6; opacity: 0; animation: q-rise 1s 1.35s ease forwards; }
.q-cap { position: absolute; left: 16px; right: 16px; bottom: 14px; text-align: center; font: 11px var(--df-mono); color: var(--df-dim); margin: 0; }
@keyframes q-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes q-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(168,230,255,.45); } 50% { box-shadow: 0 0 0 12px rgba(168,230,255,0); } }

/* ── the path ───────────────────────────────────────────────────────────── */
.q-map, .q-level { max-width: 1180px; margin: 0 auto; padding: 26px 24px 70px; }
.q-hud { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--df-line); }
.q-hud h2 { font: 650 clamp(22px, 2.4vw, 28px)/1.2 var(--df-wide); margin: 0 0 10px; }
.q-xp { display: flex; align-items: center; gap: 12px; font: 12px var(--df-mono); color: var(--df-muted); }
.q-xp .bar { width: 220px; max-width: 46vw; height: 6px; border-radius: 6px; background: rgba(255,255,255,.07); overflow: hidden; }
.q-xp .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6fd3ff, var(--df-ice)); transition: width .8s cubic-bezier(.2,.8,.2,1); box-shadow: 0 0 12px rgba(168,230,255,.6); }
.q-hud-r { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--df-line); background: var(--df-panel); font: 12px var(--df-mono); color: var(--df-muted); }
.q-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #f0a35c; }
.q-chip.on .dot { background: #64e3a8; box-shadow: 0 0 8px #64e3a8; }
.q-chip canvas { width: 22px; height: 22px; border-radius: 50%; }

.q-path { list-style: none; margin: 30px 0 0; padding: 0; position: relative; display: grid; gap: 14px; }
.q-path::before { content: ""; position: absolute; left: 31px; top: 20px; bottom: 20px; width: 2px; background: linear-gradient(var(--df-line-strong), rgba(190,210,255,.05)); }
.q-node { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 14px 18px 14px 0; border-radius: 14px; cursor: pointer; border: 1px solid transparent; transition: background .2s, border-color .2s; text-align: left; width: 100%; background: none; color: inherit; font: inherit; }
.q-node:hover, .q-node:focus-visible { background: rgba(168,230,255,.04); border-color: var(--df-line); outline: none; }
.q-orb { position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: #070a12; border: 1px solid var(--df-line-strong); font: 600 15px var(--df-mono); color: var(--df-muted); }
.q-orb canvas { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); border-radius: 50%; opacity: .35; }
.q-orb b { position: relative; z-index: 1; }
.q-node.next .q-orb { border-color: var(--df-ice); color: var(--df-ink); box-shadow: 0 0 0 0 rgba(168,230,255,.5); animation: q-pulse 2.2s ease-in-out infinite; }
.q-node.next .q-orb canvas { opacity: .8; }
.q-node.done .q-orb { border-color: #64e3a8; color: #64e3a8; }
.q-node.done .q-orb canvas { opacity: .95; }
.q-node.done .q-orb b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(3,4,7,.75); }
.q-node .t { font: 650 17px/1.3 var(--df-wide); color: var(--df-ink); }
.q-node .d { font-size: 14px; color: var(--df-muted); margin-top: 3px; line-height: 1.5; }
.q-node .code { font: 11.5px var(--df-mono); color: var(--df-dim); margin-top: 5px; }
.q-node .st { font: 500 10.5px var(--df-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--df-dim); white-space: nowrap; }
.q-node.next .st { color: var(--df-ice); }
.q-node.done .st { color: #64e3a8; }
.q-node.locked { opacity: .6; }
.q-foot-note { font-size: 13px; color: var(--df-dim); margin-top: 26px; }
.q-next-h { font: 650 18px var(--df-wide); margin: 40px 0 12px; }
.q-next { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.q-next a { display: block; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--df-line); background: var(--df-panel); color: inherit; text-decoration: none; transition: border-color .2s, transform .2s; }
.q-next a:hover { border-color: var(--df-ice); transform: translateY(-2px); }
.q-next b { display: block; font: 650 15px var(--df-wide); color: var(--df-ink); }
.q-next span { display: block; font-size: 13px; color: var(--df-muted); margin-top: 4px; line-height: 1.5; }
@media (max-width: 760px) { .q-next { grid-template-columns: minmax(0, 1fr); } }

/* ── a level ────────────────────────────────────────────────────────────── */
.q-lv-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.q-back { border: 1px solid var(--df-line); background: var(--df-panel); color: var(--df-muted); border-radius: 8px; padding: 7px 12px; font: 13px var(--df-sans); cursor: pointer; }
.q-back:hover { color: var(--df-ink); border-color: var(--df-line-strong); }
.q-lv-n { font: 500 11px var(--df-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--df-ice); margin: 0; }
.q-lv-title { font: 650 clamp(22px, 2.6vw, 30px)/1.2 var(--df-wide); margin: 14px 0 18px; }
.q-lv-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.q-stage-wrap { margin: 0; border: 1px solid var(--df-line); border-radius: 14px; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, #0b1120 0%, #04060b 75%); }
.q-stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.q-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.q-caption { padding: 14px 16px 14px; border-top: 1px solid var(--df-line); background: rgba(3,4,7,.6); }
.q-say { margin: 0; min-height: 3.3em; font-size: 15.5px; line-height: 1.6; color: var(--df-ink); }
.q-say .cur { display: inline-block; width: 8px; height: 1.05em; vertical-align: -2px; background: var(--df-ice); margin-left: 2px; animation: q-blink 1s steps(1) infinite; }
@keyframes q-blink { 50% { opacity: 0; } }
.q-prog { display: flex; align-items: center; margin-top: 10px; min-height: 22px; }
.q-ctl { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.q-ctl-sp { flex: 1; }
.q-more { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.q-more-b { display: none; }
.q-ctl-b { white-space: nowrap; border: 1px solid var(--df-line); background: rgba(6,9,16,.55); color: var(--df-muted); border-radius: 8px; padding: 7px 12px; font: 500 13px var(--df-sans); cursor: pointer; line-height: 1.1; }
.q-ctl-b:hover { color: var(--df-ink); border-color: var(--df-line-strong); }
.q-ctl-b:focus-visible { outline: 2px solid var(--df-ice); outline-offset: 2px; }
.q-ctl-b.q-ic { min-width: 38px; padding: 7px 10px; text-align: center; }
.q-ctl-b[aria-pressed="true"] { color: #ffd27a; border-color: rgba(255,210,122,.5); }
.q-ctl-b.main { color: #04121a; background: var(--df-ice); border-color: var(--df-ice); font-weight: 650; padding: 7px 16px; box-shadow: 0 0 18px -4px rgba(168,230,255,.6); }
.q-ctl-b.main:hover { background: #c9f0ff; color: #04121a; }

.q-act { border: 1px solid var(--df-line); border-radius: 14px; background: var(--df-panel); padding: 18px; }
.q-act-k { font: 500 10.5px var(--df-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--df-ice); margin: 0 0 10px; }
.q-act p { font-size: 14.5px; line-height: 1.6; color: #c3cad8; margin: 0 0 12px; }
.q-act .q-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.q-act .q-row .df-btn { white-space: nowrap; flex: none; }
.q-act label { display: block; font: 500 11px var(--df-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--df-muted); margin: 10px 0 5px; }
.q-act input { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--df-line-strong); background: rgba(3,4,7,.7); color: var(--df-ink); font: 14px var(--df-mono); }
.q-act input:focus { outline: none; border-color: var(--df-ice); }
.q-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 6px 0 12px; }
.q-stat { border: 1px solid var(--df-line); border-radius: 10px; padding: 9px 11px; background: rgba(3,4,7,.5); min-width: 0; }
.q-stat .l { font: 500 10px var(--df-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--df-dim); }
.q-stat .v { font: 600 15px var(--df-mono); color: var(--df-ink); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-stat .v.good { color: #64e3a8; }
.q-stat .v.warn { color: #ffb070; }
.q-out { font: 12.5px/1.6 var(--df-mono); color: var(--df-muted); white-space: pre-wrap; word-break: break-word; margin-top: 10px; min-height: 1em; }
.q-out .good, .q-act .good { color: #64e3a8; }
.q-out .bad, .q-act .bad { color: #ff8b8b; }
.q-done { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(100,227,168,.35); background: rgba(100,227,168,.07); color: #bff3da; font-size: 14px; margin-bottom: 12px; }
.q-warn { padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,160,90,.45); background: rgba(60,22,0,.4); color: #ffd6b0; font-size: 13.5px; line-height: 1.55; margin: 10px 0; }
.q-chain { margin-top: 16px; border-top: 1px solid var(--df-line); padding-top: 12px; }
.q-chain summary { cursor: pointer; font: 500 12px var(--df-mono); color: var(--df-muted); letter-spacing: .04em; }
.q-chain summary:hover { color: var(--df-ink); }
.q-chain code, .q-chain .df-code { font: 12px/1.6 var(--df-mono); color: #b8d9ea; }
.q-chain p { font-size: 13.5px; color: var(--df-muted); margin: 10px 0 0; }
.q-chain a, .q-act a { color: var(--df-ice); }

/* level complete */
.q-win { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: rgba(3,4,7,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 16px; animation: q-fade .3s ease; }
.q-win-in { position: relative; max-width: 440px; width: 100%; text-align: center; border: 1px solid rgba(100,227,168,.4); border-radius: 18px; background: #070b12; padding: 34px 26px 26px; overflow: hidden; animation: q-pop .5s cubic-bezier(.2,1.4,.4,1); }
.q-win-k { font: 500 11px var(--df-mono); letter-spacing: .3em; text-transform: uppercase; color: #64e3a8; margin: 0; }
.q-win h2 { font: 650 24px/1.25 var(--df-wide); margin: 10px 0 8px; }
.q-win p { color: #c3cad8; font-size: 14.5px; line-height: 1.6; margin: 0; }
.q-win-b { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.q-burst { position: absolute; left: 50%; top: 46px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; box-shadow: 0 0 0 0 rgba(100,227,168,.6); animation: q-burst 1.1s ease-out; pointer-events: none; }
@keyframes q-burst { from { box-shadow: 0 0 0 0 rgba(100,227,168,.65); } to { box-shadow: 0 0 0 220px rgba(100,227,168,0); } }
@keyframes q-fade { from { opacity: 0; } }
@keyframes q-pop { from { transform: scale(.85); opacity: 0; } }

/* ── scenes (SVG, viewBox 0 0 640 360) ──────────────────────────────────── */
.q-stage text { font-family: var(--df-mono); fill: var(--df-ink); }
.q-stage .lbl { font-size: 13px; fill: #aeb7c8; }
.q-stage .sm { font-size: 11px; fill: var(--df-muted); }
.q-stage .big { font-size: 22px; font-weight: 600; }
.q-stage .ice { fill: var(--df-ice); }
.q-stage .grn { fill: #64e3a8; }
.q-stage .red { fill: #ff7b7b; }
.q-stage .ln { stroke: var(--df-line-strong); stroke-width: 1.5; fill: none; }
.q-stage .ln-ice { stroke: var(--df-ice); stroke-width: 2; fill: none; }
.q-stage .fade { opacity: 0; transition: opacity .9s ease, transform 1.2s cubic-bezier(.2,.8,.2,1); }
.q-stage .mv { transition: transform 1.3s cubic-bezier(.3,.7,.2,1), opacity .9s ease; transform-box: fill-box; transform-origin: center; }
.q-stage .draw { stroke-dasharray: 600; stroke-dashoffset: 600; transition: stroke-dashoffset 1.6s ease; }
.q-stage .cv { position: absolute; border-radius: 50%; opacity: 0; transition: opacity 1.2s ease, transform 1.4s cubic-bezier(.2,.8,.2,1); }
.q-stage .spin { animation: q-spin 40s linear infinite; }
@keyframes q-spin { to { transform: rotate(360deg); } }
.q-stage .glow { filter: drop-shadow(0 0 6px rgba(168,230,255,.8)); }
.q-stage .hovr { animation: q-hover 3s ease-in-out infinite; transform-box: fill-box; }
@keyframes q-hover { 50% { transform: translateY(-5px); } }

/* stage layers: backdrop fractal, camera (SVG + canvases + particles), vignette */
.q-stage .q-bg { position: absolute; inset: -10%; display: grid; place-items: center; opacity: .2; pointer-events: none; }
.q-stage .q-bg canvas { width: 92%; aspect-ratio: 1; border-radius: 50%; animation: q-spin 140s linear infinite; filter: blur(.4px) saturate(1.2); }
/* the endless dive (lib/cinema.js): full bleed, its own light and vignette */
.q-stage .q-bg.gl { inset: 0; opacity: .8; display: block; }
.q-stage-wrap.cine .q-stage .q-bg.gl { opacity: .85; }
/* in the caption the secondary controls are icons (each has a title); the main ones keep their words */
.q-caption .cine-b:not(.cine-spd) .l, .q-caption #replay .l, .q-caption #cineBtn .l { display: none; }
.q-caption .cine-b, .q-caption #replay, .q-caption #cineBtn { min-width: 38px; justify-content: center; padding: 7px 9px; }
.q-stage .q-cam { position: absolute; inset: 0; transform-origin: 0 0; transition: transform 1.9s cubic-bezier(.45,.05,.2,1); will-change: transform; }
.q-stage .q-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.q-stage .q-vig { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, rgba(3,4,7,0) 55%, rgba(3,4,7,.55) 100%); }
.q-code { margin: 8px 0 0; min-height: 1.3em; font: 12.5px/1.5 var(--df-mono); color: #8fd8f5; opacity: 0; transform: translateY(4px); transition: opacity .5s ease .2s, transform .5s ease .2s; overflow-wrap: anywhere; }
.q-code.on { opacity: .95; transform: none; }
.q-code::before { content: "› "; color: var(--df-dim); }
.q-code:empty::before { content: ""; }
.q-stage-wrap.cine .q-code:not(:empty) { display: inline-block; max-width: 100%; box-sizing: border-box; padding: 3px 9px; border-radius: 6px; background: rgba(168,230,255,.06); border: 1px solid rgba(168,230,255,.14); }

.q-stage .q-box { position: absolute; inset: 0; }
.q-card { display: none; }

/* ── full-screen scenes: the stage takes the whole screen, captions become a dialogue box ── */
html.q-cine-on, html.q-cine-on body { overflow: hidden; }
/* the scene sits above everything: lift its layer, hide the site chrome while it plays */
html.q-cine-on .q-body main { z-index: 1000; }
html.q-cine-on #dfBar, html.q-cine-on .df-behind, html.q-cine-on #dfFoot, html.q-cine-on .emnav, html.q-cine-on .emnav-panel, html.q-cine-on .enav-wrap { visibility: hidden; }
.q-stage-wrap.cine { position: fixed; inset: 0; z-index: 300; margin: 0; border: 0; border-radius: 0; background: radial-gradient(ellipse at 50% 42%, #0c1426 0%, #03050a 70%); }
.q-stage-wrap.cine .q-stage { position: absolute; inset: 0; aspect-ratio: auto; }
.q-stage-wrap.cine .q-box { inset: auto; left: 50%; top: calc(50% - 84px); width: min(100vw, calc((91vh - 280px) * 16 / 9)); aspect-ratio: 16 / 9; transform: translate(-50%, -50%); overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%), linear-gradient(180deg, transparent 0, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%), linear-gradient(180deg, transparent 0, #000 5%, #000 95%, transparent 100%); mask-composite: intersect; }
/* a slow drift, so the frame is never quite still (picture, art and particles move as one) */
.q-stage .q-drift { position: absolute; inset: 0; }
.q-stage-wrap.cine .q-drift { animation: q-drift 22s ease-in-out infinite alternate; transform-origin: 50% 50%; }
@keyframes q-drift { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.025) translate(-.6%, .4%); } }
.q-stage-wrap.cine .q-bg { inset: 0; opacity: .32; }
.q-stage-wrap.cine .q-bg canvas { width: max(118vw, 118vh); animation: q-spin 160s linear infinite, q-breathe 18s ease-in-out infinite; }
@keyframes q-breathe { 50% { scale: 1.12; } }
.q-stage-wrap.cine .q-vig { background: radial-gradient(ellipse at 50% 45%, rgba(3,4,7,0) 40%, rgba(3,4,7,.85) 100%); }
.q-stage-wrap.cine::before, .q-stage-wrap.cine::after { content: ""; position: absolute; left: 0; right: 0; height: 0; background: #000; z-index: 2; animation: q-bars .9s cubic-bezier(.2,.8,.2,1) forwards; pointer-events: none; }
.q-stage-wrap.cine::before { top: 0; } .q-stage-wrap.cine::after { bottom: 0; }
@keyframes q-bars { to { height: 4.5vh; } }
.q-stage-wrap.cine .q-caption { position: absolute; z-index: 3; left: 50%; bottom: calc(4.5vh + 14px); transform: translateX(-50%); width: min(940px, calc(100% - 24px)); border: 1px solid rgba(168,230,255,.32); border-radius: 14px; background: rgba(4,7,14,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 20px 60px rgba(0,0,0,.6), 0 0 40px -10px rgba(168,230,255,.35); padding: 16px 20px; }
.q-stage-wrap.cine .q-say { font-size: clamp(15.5px, 1.35vw, 19px); min-height: 3em; }
.q-stage-wrap.cine .q-code { font-size: clamp(12px, 1vw, 14px); }
.q-stage-wrap.cine .q-stage text { font-family: var(--df-mono); }
.q-skip-b { display: none; }
.q-stage-wrap.cine .q-skip-b { display: inline-block; }
.q-stage-wrap.cine .q-card { display: grid; position: absolute; z-index: 4; inset: 0; place-content: center; text-align: center; pointer-events: none; opacity: 0; }
.q-card.on { animation: q-cardin 2.3s ease forwards; }
@keyframes q-cardin { 0% { opacity: 0; letter-spacing: .5em; } 20% { opacity: 1; letter-spacing: .22em; } 75% { opacity: 1; } 100% { opacity: 0; } }
.q-card .k { font: 500 clamp(11px, 1vw, 13px) var(--df-mono); letter-spacing: .4em; text-transform: uppercase; color: var(--df-ice); }
.q-card b { font: 600 clamp(14px, 1.4vw, 18px) var(--df-mono); letter-spacing: .5em; text-transform: uppercase; color: #8e97a9; margin-top: 18px; }
.q-card b em { font-style: normal; color: #5d6578; letter-spacing: .3em; }
.q-card .t { font: 700 clamp(30px, 6vw, 84px)/1.05 var(--df-wide); letter-spacing: -.01em; color: #eef6ff; margin: 10px auto 0; text-shadow: 0 0 30px rgba(168,230,255,.55), 0 0 90px rgba(168,230,255,.25); padding: 0 16px; max-width: calc(100vw - 32px); box-sizing: border-box; text-wrap: balance; overflow-wrap: break-word; }
.q-card .ln { display: block; height: 1px; width: min(560px, 70vw); margin: 22px auto 0; background: linear-gradient(90deg, transparent, rgba(168,230,255,.9), transparent); transform: scaleX(0); box-shadow: 0 0 12px rgba(168,230,255,.8); }
.q-card.on .ln { animation: q-streak 2.3s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes q-streak { 0% { transform: scaleX(0); opacity: 0; } 25% { transform: scaleX(1); opacity: 1; } 75% { opacity: .8; } 100% { transform: scaleX(1.15); opacity: 0; } }
.q-stage-wrap.cine .q-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, rgba(3,4,7,.0) 0%, rgba(3,4,7,.55) 60%); opacity: 0; }
.q-card.on::before { animation: q-cardin 2.3s ease forwards; }
@media (max-width: 760px) {
  .q-more-b { display: inline-block; min-width: 38px; }
  .q-more { display: none; position: absolute; z-index: 8; left: 10px; right: 10px; bottom: calc(100% + 8px); padding: 10px; border-radius: 12px; border: 1px solid rgba(168,230,255,.3); background: rgba(4,7,14,.96); box-shadow: 0 16px 40px rgba(0,0,0,.6); flex-wrap: wrap; gap: 8px; }
  .q-more.open { display: flex; }
  .q-caption { position: relative; }
  .q-skip-b .l, .q-ctl-b .l { display: none; }
  .q-caption .q-more .q-ctl-b .l, .q-caption .q-more .cine-b .l { display: inline; }
  .q-caption .q-more .cine-b, .q-caption .q-more #replay, .q-caption .q-more #cineBtn { padding: 8px 12px; }
}
@media (max-width: 600px) {
  .q-card .k { letter-spacing: .22em; padding: 0 16px; }
  .q-card b { letter-spacing: .3em; }
  .q-stage-wrap.cine .q-stage .q-bg.gl { opacity: .7; }
  .q-stage-wrap.cine .q-box { top: 37%; width: 100vw; }
  .q-stage-wrap.cine .q-caption { bottom: calc(4.5vh + 8px); padding: 12px 14px; }
  .q-stage-wrap.cine .q-say { min-height: 4.4em; }
}

/* prologue */
.sc-pro.b1 .p-title { opacity: 1; }
.sc-pro.b1 .p-net { opacity: .35; }
.sc-pro.b2 .p-net, .sc-pro.b2 .p-core { opacity: 1; }
.sc-pro.b3 .p-title { opacity: 0; }
.sc-pro.b3 .p-formula { opacity: 1; }
.sc-pro.b4 .p-coins { opacity: 1; }
.sc-pro.b5 .p-rates { opacity: 1; }
.sc-pro.b6 .p-formula { opacity: 0; }
.sc-pro.b6 .p-aff { opacity: 1; }
.sc-pro.b6 .p-coins { opacity: .45; }
.sc-pro.b9 .p-id { opacity: 1; }
.sc-pro.b9 .p-rates { opacity: 0; }
.sc-pro.b10 .p-field { opacity: 1; }
.sc-pro.b10 .p-net { opacity: .25; }
.sc-pro.b11 .p-bars { opacity: 1; }
.sc-pro.b12 .p-maria, .sc-pro.b12 .m1 { opacity: 1; }
.sc-pro.b13 .m2 { opacity: 1; }
.sc-pro.b14 .m3 { opacity: 1; }
.sc-pro.b15 .m4 { opacity: 1; }
/* while Maria's card is up, everything behind it steps back */
.sc-pro.b12 .p-id, .sc-pro.b12 .p-field, .sc-pro.b12 .p-bars, .sc-pro.b12 .p-aff, .sc-pro.b12 .p-coins { opacity: .06; }
.sc-pro.b12 .p-net { opacity: .12; }
.sc-pro.b16 .p-maria { opacity: 0; }
.sc-pro.b16 .p-net, .sc-pro.b16 .p-id, .sc-pro.b16 .p-field, .sc-pro.b16 .p-bars, .sc-pro.b16 .p-aff { opacity: 1; }
.sc-pro.b16 .p-coins { opacity: .45; }

/* the prologue's written overview */
.q-pro h3 { font: 650 15px var(--df-wide); color: var(--df-ink); margin: 14px 0 4px; }
.q-pro h3:first-child { margin-top: 0; }
.q-pro p { font-size: 14px; line-height: 1.6; color: #c3cad8; margin: 0 0 6px; }

/* 1 · arrive */
.sc-arrive.b1 .ring { opacity: 1; }
.sc-arrive .addr { transition: transform 1.4s cubic-bezier(.4,0,.2,1), opacity 1.2s ease; transform-box: fill-box; transform-origin: center; }
.sc-arrive.b2 .addr { opacity: 1; }
.sc-arrive.b3 .addr { transform: translateY(150px) scale(.2); opacity: 0; }
.sc-arrive.b4 .aura { opacity: 1; }
.sc-arrive.b5 .chip { opacity: 1; }
.sc-arrive.b6 .cv { opacity: 1; transform: scale(1.04); }
.sc-arrive.b6 .aura { opacity: .2; }
.sc-arrive.b6 .ring { opacity: .35; }

/* 2 · forge */
.sc-forge.b1 .hex, .sc-forge.b1 .nm { opacity: 1; }
.sc-forge.b2 .fac { opacity: 1; }
.sc-forge.b3 .orb { opacity: 1; }
.sc-forge.b4 .orb { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(.3); }
.sc-forge.b4 .cv { opacity: 1; }
.sc-forge.b5 .wal { opacity: 1; }
.sc-forge.b5 .coin-out { opacity: 1; transform: translate(calc(-200px + var(--i) * 4px), 64px) scale(.7); }
.sc-forge.b6 .coin-in { opacity: 1; animation: q-throb 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.sc-forge .coin-out { transition-delay: calc(var(--i) * .12s); }
@keyframes q-throb { 50% { transform: scale(1.35); } }

/* 3 · name */
.sc-name.b1 .hex, .sc-name.b1 .plate { opacity: 1; }
.sc-name .nm-set { opacity: 0; transition: opacity .9s ease .6s; }
.sc-name .blank { transition: opacity .6s ease; }
.sc-name.b2 .stops { opacity: 1; }
.sc-name.b3 .blank { opacity: 0; }
.sc-name.b3 .nm-set { opacity: 1; }
.sc-name.b4 .stops { opacity: 0; }
.sc-name.b4 .oks { opacity: 1; }
.sc-name.b5 .log { opacity: 1; }

/* 4 · bind */
.sc-bind.b1 .nodeA, .sc-bind.b1 .nodeB { opacity: 1; }
.sc-bind.b2 .hub { opacity: 1; }
.sc-bind.b3 .link { stroke-dashoffset: 0; }
.sc-bind.b3 .hub-ring { opacity: 1; }
.sc-bind.b4 .sat { opacity: 1; }
.sc-bind.b4 .spoke { stroke-dashoffset: 0; }

/* 5 · self-snipe */
.sc-snipe.b1 .vault, .sc-snipe.b1 .you, .sc-snipe.b1 .cnt0 { opacity: 1; }
.sc-snipe.b2 .bub { opacity: 1; }
.sc-snipe .coin { transform: translateY(-70px); }
.sc-snipe.b3 .bub { opacity: 0; }
.sc-snipe.b3 .coin { opacity: 1; transform: translateY(0); }
.sc-snipe.b3 .cnt0 { opacity: 0; } .sc-snipe.b3 .cnt1 { opacity: 1; }
.sc-snipe.b4 .tag, .sc-snipe.b4 .bot { opacity: 1; }
.sc-snipe.b4 .bot { transform: translateX(-70px); transition-duration: 3.6s; }
.sc-snipe.b5 .aff { opacity: 1; transform: translateX(150px); }
.sc-snipe.b5 .coin { transform: translate(-150px, 30px); }
.sc-snipe.b5 .cnt1 { opacity: 0; } .sc-snipe.b5 .cnt2 { opacity: 1; }
.sc-snipe.b5 .bot { transform: translateX(-95px); }
.sc-snipe.b6 .late { opacity: 1; }
.sc-snipe.b6 .aff { opacity: .9; }

/* 6 · claim */
.sc-claim.b1 .field { opacity: 1; }
.sc-claim .zone { transform: scale(.2); }
.sc-claim.b2 .cv { opacity: 1; }
.sc-claim.b2 .zone { opacity: 1; transform: scale(1); }
.sc-claim.b3 .grid { opacity: 1; }
.sc-claim.b4 .crown { opacity: 1; }
.sc-claim.b5 .ghost { opacity: 1; }
.sc-claim.b5 .ghost-line { stroke-dashoffset: 0; }
.sc-claim.b6 .grid { opacity: .35; }

/* 7 · yue */
.sc-yue.b1 .vessel, .sc-yue.b1 .sei { opacity: 1; }
.sc-yue.b2 .chan { opacity: 1; }
.sc-yue.b3 .bars { opacity: 1; }
.sc-yue .fill-h, .sc-yue .fill-e, .sc-su .fill-h, .sc-su .fill-e { transform: scaleY(.04); transform-box: fill-box; transform-origin: bottom; transition: transform 2.2s cubic-bezier(.2,.8,.2,1); }
.sc-yue .fill-e, .sc-su .fill-e { transition-delay: .5s; }
.sc-yue.b4 .fill-h, .sc-yue.b4 .fill-e { transform: scaleY(1); }
.sc-yue.b5 .stop { opacity: 1; }

/* 8 · door */
.sc-door.b1 .door { opacity: 1; }
.sc-door.b2 .lock { opacity: 1; }
.sc-door.b3 .lock.k2 rect { stroke: #64e3a8; fill: rgba(100,227,168,.1); }
.sc-door.b3 .lock.k2 text { fill: #64e3a8; }
.sc-door .pl { transition: transform 1.6s cubic-bezier(.6,0,.2,1); transform-box: fill-box; }
.sc-door.b4 .pl.l { transform: translateX(-58px); }
.sc-door.b4 .pl.r { transform: translateX(58px); }
.sc-door.b4 .light { opacity: .16; }
.sc-door.b4 .timer { opacity: 1; }
.sc-door.b5 .say { opacity: 1; }

/* 9 · gather */
.sc-gather.b1 .hex, .sc-gather.b1 .wal, .sc-gather.b1 .orb4 { opacity: 1; }
.sc-gather .g1, .sc-gather .g2, .sc-gather .g3, .sc-gather .g4 { transition: transform 1.4s cubic-bezier(.3,.7,.2,1); }
.sc-gather.b2 .g1 { transform: translate(120px, 90px); }
.sc-gather.b3 .g2 { transform: translate(-120px, 156px); }
.sc-gather.b4 .g3 { transform: translate(-105px, 120px); }
.sc-gather.b5 .g4 { transform: translate(-42px, -110px); }
.sc-gather.b6 .zero { opacity: 1; }

/* 10 · su */
.sc-su.b1 .vessel, .sc-su.b1 .chip { opacity: 1; }
.sc-su.b2 .bars { opacity: 1; }
.sc-su.b2 .fill-h, .sc-su.b2 .fill-e { transform: scaleY(1); }
.sc-su.b3 .xia { opacity: 1; }
.sc-su.b4 .plus { opacity: 1; }
.sc-su.b5 .cap { opacity: 1; }

/* 11 · beat */
.sc-beat.b1 .core { opacity: 1; }
.sc-beat.b2 .chain { opacity: 1; }
.sc-beat.b3 .loop1 { opacity: 1; }
.sc-beat.b3 .chain { opacity: .35; }
.sc-beat.b4 .loop2 { opacity: 1; }
.sc-beat.b5 .mix { opacity: 1; }
.sc-beat.b6 .outs { opacity: 1; }
.sc-beat .spin { animation-duration: 9s; }

/* Act IV · the tour */
.sc-field .tile { border-radius: 50%; }
.sc-field.b1 .tile { opacity: 1; transform: scale(1); }
.sc-field .tile { transform: scale(.4); }
.sc-field.b2 .tl { opacity: 1; }
.sc-void.b1 .feed { opacity: 1; }
.sc-void .vl { animation: q-feed 7s linear infinite; }
@keyframes q-feed { from { transform: translateY(0); } to { transform: translateY(-30px); } }
.sc-void.b2 .mine { opacity: 1; }
.sc-void.b3 .lock { opacity: 1; }
.sc-ranks.b1 .rk { opacity: 1; }
.sc-ranks .rb { transform: scaleX(.02); transform-box: fill-box; transform-origin: left; transition: transform 1.8s cubic-bezier(.2,.8,.2,1) var(--d, 0s); }
.sc-ranks.b1 .rb { transform: scaleX(1); }
.sc-page.b1 .me, .sc-page.b1 .who { opacity: 1; }
.sc-page.b2 .tab { opacity: 1; }
.sc-page.b3 .share { opacity: 1; }
.sc-explorer.b1 .nd { opacity: 1; }
.sc-explorer.b2 .fns { opacity: 1; }
.sc-codex.b1 .ly { opacity: 1; }

/* swap box + create steps */
.q-swap { border: 1px solid rgba(168,230,255,.28); border-radius: 10px; padding: 10px 12px; background: rgba(168,230,255,.04); margin: 10px 0; }
.q-swap p { margin: 0 0 4px; font-size: 13.5px; }
.q-swap input { max-width: 110px; }
.q-steps { margin: 10px 0 4px; padding-left: 20px; font-size: 13.5px; color: #c3cad8; line-height: 1.55; }
.q-steps li { margin: 2px 0; }

/* a level's steps, one live at a time */
.q-flow { list-style: none; margin: 12px 0 4px; padding: 0; display: grid; gap: 8px; }
.q-flow-s { border: 1px solid var(--df-line); border-radius: 10px; padding: 10px 12px; background: rgba(3,4,7,.45); }
.q-flow-h { display: flex; align-items: center; gap: 10px; }
.q-flow-h .n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--df-mono); border: 1px solid var(--df-line-strong); color: var(--df-muted); }
.q-flow-h b { font-size: 14px; color: var(--df-ink); font-weight: 600; }
.q-flow-d { font-size: 13px; color: var(--df-muted); margin: 4px 0 0 34px; }
.q-flow-b { margin: 8px 0 0 34px; }
.q-flow-b p { font-size: 13.5px; margin: 0 0 6px; }
.q-flow-b .q-swap { margin: 0; }
.q-flow-s.now { border-color: var(--df-ice); background: rgba(168,230,255,.05); }
.q-flow-s.now .n { border-color: var(--df-ice); color: var(--df-ink); background: rgba(168,230,255,.12); }
.q-flow-s.done .n { border-color: #64e3a8; color: #64e3a8; }
.q-flow-s.done b { color: #bff3da; }
.q-flow-s.wait { opacity: .55; }
.q-linkbtn { border: 0; background: none; padding: 0; color: var(--df-muted); font: 13px var(--df-sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.q-linkbtn:hover { color: var(--df-ink); }
@media (max-width: 600px) { .q-flow-d, .q-flow-b { margin-left: 0; } }

/* path acts + the four holdings */
.q-act-h { list-style: none; font: 500 11px var(--df-mono); letter-spacing: .24em; text-transform: uppercase; color: var(--df-ice); margin: 18px 0 2px 84px; }
.q-act-h:first-child { margin-top: 0; }
.q-four { display: grid; gap: 8px; margin: 8px 0; }
.q-four-r { border: 1px solid var(--df-line); border-radius: 10px; padding: 10px 12px; background: rgba(3,4,7,.5); }
.q-four-r.ok { border-color: rgba(100,227,168,.35); }
.q-four-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.q-four-h b { font-size: 14px; color: var(--df-ink); }
.q-four-r.ok .q-four-h b { color: #64e3a8; }
.q-four-h span { font: 11px var(--df-mono); color: var(--df-dim); }
.q-four-v { font: 12px var(--df-mono); color: var(--df-muted); margin-top: 4px; }
.q-four .q-row { margin: 8px 0 0; }
.q-four .q-row:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .q-title-bg canvas.on { animation: none; }
  .q-stage *, .q-start, .q-node.next .q-orb, .q-card .ln { transition: none !important; animation: none !important; }
}

/* ── phone ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .q-lv-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .q-ctl { flex-wrap: nowrap; }
  .q-act-h { margin-left: 0; }
  .q-map, .q-level { padding: 18px 16px 60px; }
  .q-node { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding-right: 8px; }
  .q-node .st { grid-column: 2; }
  .q-orb { width: 52px; height: 52px; }
  .q-path::before { left: 25px; }
  .q-two, .q-stats { grid-template-columns: minmax(0, 1fr); }
  .q-say { font-size: 14.5px; }
  .q-hud-r { width: 100%; }
}
@media (max-width: 1100px) { html.q-cine-on .q-act .q-act-k { display: none; } }
/* full screen, narrower desktops: controls wrap rather than overflow */
@media (max-width: 1500px) {
  .q-stage-wrap.cine .q-ctl { flex-wrap: wrap; row-gap: 8px; }
}

.q-restart { border: 0; background: none; cursor: pointer; font: inherit; font-size: 13.5px; }

/* Act IV explainer scenes: .rN shows an element from beat N, .dN dims it from beat N */
.sc-lore.b1 .r1,
.sc-lore.b2 .r2,
.sc-lore.b3 .r3,
.sc-lore.b4 .r4,
.sc-lore.b5 .r5,
.sc-lore.b6 .r6,
.sc-lore.b7 .r7,
.sc-lore.b8 .r8,
.sc-lore.b9 .r9,
.sc-lore.b10 .r10,
.sc-lore.b11 .r11,
.sc-lore.b12 .r12,
.sc-lore.b13 .r13,
.sc-lore.b14 .r14,
.sc-lore.b15 .r15,
.sc-lore.b16 .r16 { opacity: 1; }
.sc-lore.b1 .d1,
.sc-lore.b2 .d2,
.sc-lore.b3 .d3,
.sc-lore.b4 .d4,
.sc-lore.b5 .d5,
.sc-lore.b6 .d6,
.sc-lore.b7 .d7,
.sc-lore.b8 .d8,
.sc-lore.b9 .d9,
.sc-lore.b10 .d10,
.sc-lore.b11 .d11,
.sc-lore.b12 .d12,
.sc-lore.b13 .d13,
.sc-lore.b14 .d14,
.sc-lore.b15 .d15,
.sc-lore.b16 .d16 { opacity: .16; }
.q-live { margin: 6px 0 12px; font-size: 13px; }
.q-tbl { width: 100%; border-collapse: collapse; font: 12.5px var(--df-mono); }
.q-tbl th { text-align: left; font-weight: 600; color: var(--df-ink); padding: 8px 6px 4px; border-bottom: 1px solid var(--df-line); }
.q-tbl td { padding: 5px 6px; border-bottom: 1px solid rgba(190,210,255,.07); color: #c3cad8; vertical-align: top; word-break: break-word; }
.q-tbl td.ok, .q-walk .ok { color: #8fe6c4; }
.q-tbl td.bad, .q-walk .bad { color: #ffb4a0; }
.q-walk { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; font: 11.5px var(--df-mono); }
.q-walk span { border: 1px solid var(--df-line); border-radius: 6px; padding: 3px 7px; background: rgba(0,0,0,.25); color: #c3cad8; }
.sc-lore.b1 .h1,
.sc-lore.b2 .h2,
.sc-lore.b3 .h3,
.sc-lore.b4 .h4,
.sc-lore.b5 .h5,
.sc-lore.b6 .h6,
.sc-lore.b7 .h7,
.sc-lore.b8 .h8,
.sc-lore.b9 .h9,
.sc-lore.b10 .h10,
.sc-lore.b11 .h11,
.sc-lore.b12 .h12,
.sc-lore.b13 .h13,
.sc-lore.b14 .h14,
.sc-lore.b15 .h15,
.sc-lore.b16 .h16 { opacity: 0; }
.q-tbl td:last-child { white-space: nowrap; }
.q-tbl td:first-child { min-width: 9em; }
.q-capbar { height: 10px; border-radius: 5px; background: rgba(190,210,255,.1); overflow: hidden; margin: 2px 0 10px; }
.q-capbar i { display: block; height: 100%; border-radius: 5px; }
