:root { --accent: #ff2bd6; --ink: #07060d; --bone: #f3ead7; --cyan: #25f4ee; --gold: #ffc94d; --mag: #ff2bd6; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--bone); font-family: var(--text); }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }

/* ---------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; user-select: none; text-shadow: 0 0 8px #000, 0 0 2px #000; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--bone); opacity: .7; box-shadow: 0 0 8px var(--accent); }
#objective { position: absolute; left: 22px; top: 18px; max-width: min(420px, 27vw); font-size: 14px; letter-spacing: .06em; line-height: 1.45; }
#objective::before { content: "◆ WILL"; display: block; color: var(--accent); font-weight: bold; font-size: 11px; letter-spacing: .3em; margin-bottom: 4px; }
#objective:empty { display: none; }
#paradigm { position: absolute; right: 22px; top: 18px; text-align: right; font-size: 12px; letter-spacing: .12em; }
#paradigm b { color: var(--accent); font-size: 14px; }
#paradigm span { display: inline-block; margin-left: 8px; padding: 2px 6px; border: 1px solid rgba(243,234,215,.35); opacity: .6; }
#paradigm span.on { border-color: var(--accent); color: var(--accent); opacity: 1; box-shadow: 0 0 10px var(--accent); }
#paradigm span.ban { text-decoration: line-through; opacity: .25; }
#meter { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); width: min(400px, 36vw); text-align: center; font-size: 11px; letter-spacing: .35em; color: var(--accent); }
#meter .bar { height: 8px; margin-top: 6px; border: 1px solid var(--accent); background: rgba(0,0,0,.5); }
#meter .bar i { display: block; height: 100%; width: 0; background: var(--accent); box-shadow: 0 0 14px var(--accent); transition: width .12s linear; }
#prompt { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); padding: 8px 16px; background: rgba(7,6,13,.75); border: 1px solid var(--accent); font-size: 15px; letter-spacing: .08em; white-space: nowrap; }
#prompt kbd { display: inline-block; padding: 0 7px; margin-right: 8px; background: var(--accent); color: #000; font-weight: bold; text-shadow: none; }
#hint { position: absolute; left: 50%; top: 58px; transform: translateX(-50%); font-size: 13px; letter-spacing: .1em; opacity: .85; padding: 6px 12px; background: rgba(7,6,13,.6); white-space: nowrap; }
#subtitle { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); width: min(820px, 88vw); padding: 14px 20px; background: rgba(7,6,13,.82); border-left: 4px solid var(--accent); font-size: 17px; line-height: 1.45; }
#subtitle b { display: block; color: var(--accent); font-size: 11px; letter-spacing: .35em; margin-bottom: 4px; }
#subtitle.other { border-left-color: var(--bone); } #subtitle.other b { color: var(--bone); }
#toast { position: absolute; left: 50%; top: 104px; transform: translateX(-50%); font-size: 13px; letter-spacing: .14em; padding: 6px 14px; background: var(--accent); color: #000; text-shadow: none; font-weight: bold; opacity: 0; transition: opacity .3s; white-space: nowrap; }
#toast.show { opacity: 1; }
#keys { position: absolute; right: 22px; bottom: 14px; font-size: 11px; opacity: .45; letter-spacing: .1em; }
#banner { position: absolute; left: 0; right: 0; top: 26%; text-align: center; animation: bannerIn 4.2s ease forwards; }
#banner h2 { margin: 0; font: 900 clamp(34px, 6vw, 84px)/1 var(--display); letter-spacing: .08em; color: var(--bone); text-shadow: 4px 4px 0 var(--accent), -3px -2px 0 var(--cyan); }
#banner p { margin: 12px 0 0; letter-spacing: .4em; font-size: 14px; color: var(--accent); text-transform: uppercase; }
@keyframes bannerIn { 0% { opacity: 0; transform: scale(1.15) rotate(-1deg); } 12% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- full screens */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 10; }
#title { background: radial-gradient(ellipse at center, rgba(7,6,13,.2), rgba(7,6,13,.86)); }
#pause, #modal { background: rgba(7,6,13,.78); backdrop-filter: blur(3px); }
.title-inner { text-align: center; padding: 20px; }
.kicker { letter-spacing: .6em; font-size: 13px; color: var(--cyan); text-transform: uppercase; }
#logo { margin: 6px 0 0; font: 900 clamp(70px, 17vw, 230px)/.9 var(--display); letter-spacing: .04em; color: var(--bone);
  text-shadow: 6px 6px 0 var(--mag), -5px -3px 0 var(--cyan), 0 0 60px rgba(255,43,214,.6); animation: jitter 5s infinite steps(1); }
@keyframes jitter { 0%,91%,100% { transform: none; } 92% { transform: translate(-4px,2px) skewX(-6deg); } 94% { transform: translate(5px,-2px) skewX(4deg); } 96% { transform: translate(-2px,0); } }
.tag { font-size: 18px; letter-spacing: .08em; margin: 18px 0 26px; } .tag small { opacity: .55; font-size: 12px; }
.buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.buttons button, .zbtn { padding: 14px 34px; background: var(--bone); color: #000; border: 0; font-weight: 900; font-size: 18px; letter-spacing: .25em; box-shadow: 5px 5px 0 var(--mag), -3px -3px 0 var(--cyan); transition: transform .08s; }
.buttons button:hover, .zbtn:hover { transform: translate(-2px,-2px) rotate(-1deg); background: #fff; }
.fine { font-size: 11px; opacity: .55; letter-spacing: .12em; line-height: 1.8; margin-top: 30px; }
#pause h2 { font: 900 72px/1 var(--display); letter-spacing: .1em; margin: 0; text-shadow: 4px 4px 0 var(--mag), -3px -2px 0 var(--cyan); }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .45s; z-index: 20; }
#fade.on { opacity: 1; }
#fatal { position: fixed; inset: 0; z-index: 99; background: #07060d; padding: 40px; white-space: pre-wrap; color: var(--mag); }

/* ---------- modal (paper card) */
#modal-box { width: min(760px, 92vw); max-height: 90vh; overflow: auto; padding: 30px 34px; color: #111; position: relative;
  background: #efe6cf repeating-linear-gradient(0deg, rgba(0,0,0,.035) 0 1px, transparent 1px 4px); box-shadow: 10px 10px 0 var(--mag), -6px -6px 0 var(--cyan); transform: rotate(-.6deg); }
#modal-box h2 { font: 900 34px/1 var(--display); letter-spacing: .06em; margin: 0 0 6px; }
#modal-box h2 span, #zine-page h1 span { display: inline-block; padding: 0 5px; margin-right: 2px; }
#modal-box p { line-height: 1.5; font-size: 15px; margin: 10px 0; }
#modal-box .sub { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: #a3127f; font-weight: bold; }
#modal-box input[type=text] { width: 100%; padding: 12px 14px; font: bold 22px var(--text); letter-spacing: .08em; text-transform: uppercase; border: 3px solid #111; background: #fffaf0; color: #111; outline: none; }
#modal-box input[type=text]:focus { box-shadow: 4px 4px 0 var(--mag); }
#modal-box .row { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
#modal-box .opt { flex: 1 1 150px; padding: 12px; border: 3px solid #111; background: #fffaf0; color: #111; text-align: left; font-size: 13px; line-height: 1.4; }
#modal-box .opt b { display: block; font: 900 17px var(--display); letter-spacing: .08em; margin-bottom: 4px; }
#modal-box .opt:hover { background: #fff; transform: rotate(-1deg); }
#modal-box .opt.sel { background: #111; color: #efe6cf; box-shadow: 4px 4px 0 var(--mag); }
#modal-box .actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; }
#modal-box .zbtn { background: #111; color: #efe6cf; font-size: 15px; padding: 11px 24px; }
#modal-box .zbtn.ghost { background: transparent; color: #111; box-shadow: none; border: 2px solid #111; }
#modal-box .err { color: #c8102e; font-weight: bold; min-height: 1.3em; font-size: 13px; }
.letters { display: flex; flex-wrap: wrap; gap: 5px; margin: 14px 0; min-height: 50px; }
.letters span { display: inline-flex; width: 36px; height: 44px; align-items: center; justify-content: center; font: 900 26px var(--display); background: #111; color: #efe6cf; transition: all .35s; }
.letters span:nth-child(3n) { transform: rotate(-4deg); } .letters span:nth-child(4n+1) { transform: rotate(3deg); background: #a3127f; }
.letters span.dead { opacity: .18; transform: scale(.7) rotate(12deg); text-decoration: line-through; background: #777; }
.letters span.keep { background: #ffc94d; color: #111; box-shadow: 0 0 0 3px #111; }

/* ---------- the zine */
#codex { background: rgba(7,6,13,.86); }
#zine { display: flex; width: min(1040px, 95vw); height: min(680px, 90vh); color: #111; transform: rotate(.4deg); box-shadow: 12px 12px 0 var(--mag), -7px -7px 0 var(--cyan); }
#zine-nav { width: 250px; flex: none; background: #111; color: #efe6cf; padding: 22px 0 14px; overflow: auto; }
#zine-nav h3 { font: 900 40px/.9 var(--display); margin: 0 20px 16px; letter-spacing: .05em; color: var(--gold); transform: rotate(-3deg); }
#zine-nav ul { list-style: none; margin: 0; padding: 0; }
#zine-nav li { padding: 8px 20px; font-size: 13px; letter-spacing: .06em; cursor: pointer; border-left: 5px solid transparent; }
#zine-nav li:hover { background: #222; } #zine-nav li.on { border-left-color: var(--mag); background: #efe6cf; color: #111; font-weight: bold; }
#zine-nav li.locked { opacity: .3; cursor: default; font-style: italic; }
#zine-nav li.new::after { content: " ★"; color: var(--gold); }
#zine-nav .fine { margin: 14px 20px 0; }
#zine-page { flex: 1; overflow: auto; padding: 30px 38px 40px; position: relative;
  background: #efe6cf repeating-linear-gradient(0deg, rgba(0,0,0,.035) 0 1px, transparent 1px 4px); }
#zine-page::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 12% 8%, rgba(0,0,0,.12), transparent 30%), radial-gradient(circle at 90% 95%, rgba(0,0,0,.16), transparent 35%); mix-blend-mode: multiply; }
#zine-page .kick { font-size: 11px; letter-spacing: .35em; text-transform: uppercase; color: #a3127f; font-weight: bold; }
#zine-page h1 { font: 900 44px/1.05 var(--display); margin: 6px 0 14px; letter-spacing: .03em; }
#zine-page p, #zine-page li { font-size: 15px; line-height: 1.6; }
#zine-page blockquote { margin: 16px 0; padding: 12px 16px; background: #111; color: #efe6cf; font-size: 17px; font-weight: bold; transform: rotate(-.8deg); box-shadow: 5px 5px 0 var(--mag); }
#zine-page blockquote cite { display: block; font-size: 11px; font-weight: normal; opacity: .7; margin-top: 6px; font-style: normal; letter-spacing: .1em; }
#zine-page .stamp { display: inline-block; border: 3px solid #c8102e; color: #c8102e; padding: 3px 10px; font: 900 14px var(--display); letter-spacing: .2em; transform: rotate(-5deg); margin: 6px 0; }
#zine-page .do { border: 3px dashed #111; padding: 10px 16px; margin: 16px 0; background: rgba(255,201,77,.35); }
#zine-page .do b:first-child { font: 900 15px var(--display); letter-spacing: .15em; }
#zine-page mark { background: var(--gold); padding: 0 3px; }
#zine-page .sigil-card { float: right; width: 170px; margin: 0 0 12px 18px; background: #111; padding: 8px; transform: rotate(3deg); box-shadow: 4px 4px 0 var(--cyan); color: #efe6cf; font-size: 10px; text-align: center; letter-spacing: .1em; }
#zine-page .sigil-card canvas { width: 100%; display: block; }
@media (max-width: 700px) { #zine-nav { width: 150px; } #zine-page { padding: 18px; } #zine-page h1 { font-size: 30px; } }

/* side card: leaves the 3D view visible (servitor builder) */
#modal.side { justify-content: flex-end; background: transparent; backdrop-filter: none; padding-right: 3vw; }
#modal.side #modal-box { width: min(480px, 46vw); transform: none; padding: 20px 22px; }
#modal.side #modal-box h2 { font-size: 26px; } #modal.side .opt { flex: 1 1 100px; padding: 8px; font-size: 11.5px; } #modal.side .opt b { font-size: 14px; }
#modal-box h4 { margin: 14px 0 0; font: 900 13px var(--display); letter-spacing: .25em; color: #a3127f; }
#modal-box .row.tight { margin: 6px 0; gap: 6px; } #modal-box .sw { width: 34px; height: 34px; flex: none; border: 3px solid #111; padding: 0; } #modal-box .sw.sel { box-shadow: 0 0 0 3px var(--mag); transform: scale(1.15); }

/* ---------- title ticker */
#ticker { position: fixed; left: 0; right: 0; bottom: 0; overflow: hidden; white-space: nowrap; background: var(--bone); color: #000; font-weight: bold; font-size: 12px; letter-spacing: .18em; padding: 7px 0; }
#ticker span { display: inline-block; padding-left: 100%; animation: tick 60s linear infinite; }
@keyframes tick { to { transform: translateX(-100%); } }
.phone { display: none; } .is-touch .phone { display: inline; } .is-touch .desk { display: none; }

.phone { display: none; } .is-touch .phone { display: inline; } .is-touch .desk { display: none; }
@media (max-height: 480px) { #logo { font-size: 22vh; } .tag { margin: 8px 0 12px; font-size: 14px; } .fine { margin-top: 12px; } #modal-box { padding: 16px 18px; } #modal-box h2 { font-size: 24px; } #zine { height: 96vh; } #zine-nav { width: 170px; } #zine-nav h3 { font-size: 26px; } #zine-page { padding: 16px 20px; } #zine-page h1 { font-size: 28px; } #banner { top: 16%; } }
@media (orientation: portrait) { #zine { flex-direction: column; } #zine-nav { width: auto; max-height: 28%; } }

/* ================= HUD v2: one centred stack up top, markers in the world, action bar at the bottom ================= */
#topstack { position: absolute; left: 50%; top: max(12px, env(safe-area-inset-top)); transform: translateX(-50%); width: min(760px, 94vw); display: flex; flex-direction: column; align-items: center; gap: 8px; }
#objective { position: static; max-width: 100%; text-align: center; font-size: clamp(14px, 1.5vw, 18px); line-height: 1.35; letter-spacing: .04em; padding: 9px 18px; background: rgba(7,6,13,.78); border: 1px solid var(--accent); border-radius: 4px; box-shadow: 4px 4px 0 rgba(0,0,0,.5); }
#objective::before { content: "◆ "; display: inline; font-size: inherit; letter-spacing: 0; margin: 0; }
#meter { position: static; transform: none; width: min(420px, 80%); }
#hint { position: static; transform: none; white-space: normal; text-align: center; font-size: 13px; }
#toast { position: static; transform: none; white-space: normal; text-align: center; display: none; } #toast.show { display: block; }
#paradigm { top: auto; bottom: 14px; right: 16px; }
#subtitle { bottom: 84px; font-size: clamp(15px, 1.5vw, 19px); }
#subtitle { pointer-events: auto; cursor: pointer; } #subtitle::after { content: "▸"; position: absolute; right: 10px; bottom: 6px; opacity: .5; font-size: 12px; }
@media (max-height: 520px), (max-width: 620px) { #subtitle { bottom: 78px; font-size: 14px; padding: 9px 13px; } #objective { font-size: 13px; padding: 7px 12px; } }

#view { cursor: grab; } #view.grab { cursor: grabbing; }
#markers { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.mk { position: absolute; left: 0; top: 0; width: 48px; margin: -24px 0 0 -24px; display: flex; flex-direction: column; align-items: center; gap: 0; overflow: visible; background: none; border: 0; padding: 0; color: var(--bone); font: bold 13px var(--text); letter-spacing: .08em; pointer-events: auto; cursor: pointer; text-shadow: 0 0 6px #000, 0 0 2px #000; -webkit-tap-highlight-color: transparent; white-space: nowrap; --c: var(--gold); }
.mk i { flex: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 20px; position: relative; color: var(--c); z-index: 0; }
.mk i::before { content: ""; position: absolute; inset: 9px; border: 2px solid var(--c); border-radius: 50%; background: rgba(7,6,13,.5); box-shadow: 0 0 12px var(--c); z-index: -1; transition: transform .12s; }
.mk:hover i::before, .mk:active i::before { transform: scale(1.3); background: var(--c); } .mk:hover i, .mk:active i { color: #000; }
.mk b { background: rgba(7,6,13,.78); padding: 3px 7px; text-transform: uppercase; border-bottom: 2px solid var(--c); margin-top: -4px; font-size: 12px; }
.mk.primary { z-index: 3; } .mk.use { z-index: 2; }
.mk.door { --c: var(--cyan); } .mk.spot { --c: var(--bone); } .mk.spot i::before { inset: 14px; }
.mk.spot i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--c); }
.mk.ghost i::before { border-style: dashed; animation: spin 6s linear infinite; } .mk.ghost.p-hermetic { --c: #ffc94d; } .mk.ghost.p-cyber { --c: #25f4ee; } .mk.ghost.p-discord { --c: #ffb347; }
.mk.locked { --c: #77738a; opacity: .7; }
.mk.primary i::before { inset: 4px; border-width: 3px; animation: mkpulse 1.4s ease-in-out infinite; } .mk.primary b { font-size: 14px; background: var(--c); color: #000; text-shadow: none; }
@keyframes mkpulse { 50% { transform: scale(1.18); } } @keyframes spin { to { transform: rotate(360deg); } }

#corner { position: fixed; left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 6; display: flex; gap: 8px; }
#corner button { font: bold 11px var(--text); letter-spacing: .14em; color: var(--bone); background: rgba(7,6,13,.7); border: 1px solid rgba(243,234,215,.4); padding: 9px 12px; }
#corner button:hover { border-color: var(--accent); color: var(--accent); }
#paradigm { pointer-events: auto; } #paradigm span { cursor: pointer; padding: 7px 11px; font-size: 13px; background: rgba(7,6,13,.6); }
body[data-need="hermetic"] #paradigm span[data-p="hermetic"], body[data-need="cyber"] #paradigm span[data-p="cyber"], body[data-need="discord"] #paradigm span[data-p="discord"] { opacity: 1; border-color: #fff; color: #fff; animation: need .35s steps(2) infinite; transform: scale(1.25); }
@keyframes need { 50% { background: var(--mag); } }

#actions { position: fixed; left: 0; right: 0; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 6; display: flex; justify-content: center; gap: 12px; pointer-events: none; padding: 0 14px; }
#actions:empty { display: none; }
#actions button { pointer-events: auto; touch-action: none; font: 900 16px/1 var(--display); letter-spacing: .14em; color: var(--bone); background: rgba(7,6,13,.8); border: 2px solid var(--accent); height: 56px; min-width: 96px; padding: 0 20px; border-radius: 30px; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
#actions button.on, #actions button:active { background: var(--accent); color: #000; } #actions button.gold { border-color: var(--gold); color: var(--gold); }
#actions button kbd { font: bold 11px var(--text); opacity: .6; margin-left: 8px; } .is-touch #actions kbd { display: none; }
#actions.k-breath button.big { height: 96px; min-width: 62vw; font-size: 20px; }
#actions.k-drum { justify-content: space-between; align-items: flex-end; } #actions.k-drum button.pad { width: 34vw; height: 120px; font-size: 44px; border-radius: 18px; } #actions.k-drum .pad.l { border-color: var(--mag); order: 1; } #actions.k-drum .mid { order: 2; } #actions.k-drum .pad.r { border-color: var(--cyan); order: 3; }
body:not(.is-touch) #actions.k-drum button.pad, body:not(.is-touch) #actions.k-breath button.big { height: 56px; width: auto; min-width: 120px; font-size: 16px; }

.is-touch #paradigm { bottom: 96px; } .is-touch #paradigm span { padding: 11px 13px; font-size: 14px; font-weight: bold; }
@media (orientation: portrait) {
  #actions { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 48px); } #actions.k-drum button.pad { height: 96px; }
  #subtitle { bottom: 190px; width: 92vw; }
  #paradigm { left: auto; right: 10px; bottom: auto; top: 42%; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; } #paradigm b, #paradigm br { display: none; } #paradigm span { margin: 0; }
}
#coach .keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0; font-size: 15px; align-items: center; } #coach .keys b { background: #111; color: #efe6cf; padding: 3px 9px; font: 900 13px var(--display); letter-spacing: .12em; text-align: center; white-space: nowrap; }

/* phones: no double-tap zoom, no text-selection callouts while dragging the view */
html, body { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
input, #zine-page { -webkit-user-select: text; user-select: text; }

/* ---------- the "tune in" gate: browsers only allow sound after a tap, so the title powers on from one */
#gate { background: #030208; z-index: 12; transition: opacity .8s; } #gate.off { opacity: 0; pointer-events: none; }
#btn-gate { padding: 18px 44px; background: transparent; color: var(--bone); border: 2px solid var(--bone); font: 900 22px var(--display); letter-spacing: .3em; cursor: pointer; animation: gatepulse 2s ease-in-out infinite; }
#btn-gate:hover { background: var(--bone); color: #000; }
@keyframes gatepulse { 50% { box-shadow: 0 0 34px var(--mag), 0 0 0 6px rgba(37,244,238,.25); } }
#logo { animation: none; } #logo.twitch { animation: twitch .32s steps(1); }
@keyframes twitch { 0% { transform: translate(-5px,2px) skewX(-7deg); } 33% { transform: translate(6px,-2px) skewX(5deg); filter: hue-rotate(40deg); } 66% { transform: translate(-2px,0); } 100% { transform: none; } }

/* ---------- cards on a short, wide screen (phone held sideways): compact type, no tilt, and the action buttons never scroll out of reach */
#modal-box .actions { position: sticky; bottom: -30px; margin: 18px -34px -30px; padding: 12px 34px 20px; background: linear-gradient(transparent, #efe6cf 30%); }
#modal.side #modal-box .actions { bottom: -20px; margin: 12px -22px -20px; padding: 10px 22px 16px; }
@media (max-height: 520px) and (orientation: landscape) {
  #modal-box { width: min(880px, 94vw); max-height: 94vh; padding: 14px 20px; transform: none; box-shadow: 6px 6px 0 var(--mag), -4px -4px 0 var(--cyan); }
  #modal-box h2 { font-size: 22px; margin-bottom: 2px; } #modal-box .sub { font-size: 10px; } #modal-box p { font-size: 13px; margin: 6px 0; line-height: 1.35; }
  #modal-box .row { margin: 8px 0; gap: 8px; flex-wrap: nowrap; } #modal-box .opt { padding: 8px 10px; font-size: 12px; flex: 1 1 0; min-width: 0; } #modal-box .opt b { font-size: 14px; margin-bottom: 2px; }
  #modal-box input[type=text] { padding: 8px 10px; font-size: 18px; } #modal-box .zbtn { padding: 9px 18px; font-size: 13px; } #modal-box .err { min-height: 0; }
  #modal-box .actions { bottom: -14px; margin: 8px -20px -14px; padding: 8px 20px 12px; }
  .letters { margin: 6px 0; gap: 3px; min-height: 0; } .letters span { width: 26px; height: 32px; font-size: 19px; }
  #coach .keys { grid-template-columns: auto 1fr auto 1fr; gap: 6px 12px; font-size: 13px; margin: 8px 0; }
  /* the servitor builder becomes a wide two-column sheet */
  #modal.side { padding-right: 2vw; } #modal.side #modal-box { width: 66vw; padding: 12px 16px; }
  #modal.side #modal-box h2 { font-size: 19px; } #modal.side .secs { columns: 2; column-gap: 18px; } #modal.side .secs section { break-inside: avoid; }
  #modal.side h4 { margin: 4px 0 0; font-size: 11px; letter-spacing: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #modal.side .row.tight { margin: 4px 0; gap: 4px; } #modal.side .opt { padding: 5px 6px; font-size: 10.5px; line-height: 1.25; } #modal.side .opt b { font-size: 12px; margin: 0; }
  #modal.side .opt .d { display: none; } #modal-box .sw { width: 28px; height: 28px; }
  #modal.side #modal-box .actions { bottom: -12px; margin: 4px -16px -12px; padding: 6px 16px 10px; }
  #zine { height: 96vh; width: 97vw; transform: none; } #zine-page h1 { font-size: 24px; margin: 2px 0 8px; } #zine-page p, #zine-page li { font-size: 14px; line-height: 1.5; }
}

/* ---------- cutscene: cinema bars say "the camera is being directed"; they retract when the view is yours again */
#bars i { position: fixed; left: 0; right: 0; height: 9vh; background: #000; z-index: 3; transition: transform .45s ease; pointer-events: none; }
#bars i:first-child { top: 0; transform: translateY(-100%); } #bars i:last-child { bottom: 0; transform: translateY(100%); }
body.cut #bars i { transform: none; } body.cut #view { cursor: pointer; } body.cut #corner, body.cut #paradigm, body.cut #actions { opacity: .25; pointer-events: none; }
body.cut #subtitle { bottom: 11vh; } body.cut #topstack { top: calc(9vh + 8px); }

/* ---------- cards on a narrow phone: headings and buttons stay on one line */
#modal-box h2 { font-size: clamp(19px, 6vw, 34px); } #modal-box h2 span { white-space: nowrap; padding: 0 4px; }
#modal-box .zbtn { white-space: nowrap; }
@media (max-width: 520px) {
  #modal-box { padding: 22px 18px; } #modal-box .sub { letter-spacing: .08em; font-size: 11px; white-space: nowrap; }
  #modal-box .zbtn { letter-spacing: .1em; font-size: 13px; padding: 12px 14px; } #modal-box .actions { margin: 14px -18px -22px; padding: 10px 18px 16px; bottom: -22px; gap: 8px; }
  #coach .keys { gap: 8px 12px; font-size: 14px; } #coach .keys b { font-size: 12px; padding: 3px 7px; }
}
/* ---------- a new objective arrives like a quest: drops in, flashes, chimes */
#objective.pop { animation: quest .9s cubic-bezier(.2,1.5,.4,1); }
@keyframes quest { 0% { transform: translateY(-140%) scale(1.25); opacity: 0; } 55% { transform: translateY(6px) scale(1.06); opacity: 1; background: var(--accent); color: #000; box-shadow: 0 0 40px var(--accent); } 100% { transform: none; } }
.mk.quiet i::before { inset: 13px; } .mk.quiet { --c: var(--bone); opacity: .85; }

/* ---------- exercise card (after Vitimus's workbook): a tilted index card while you do an activity */
#excard { position: fixed; left: max(14px, env(safe-area-inset-left)); top: max(14px, env(safe-area-inset-top)); z-index: 5; width: 150px; padding: 8px 10px 9px; color: #1b1b22; font-family: Georgia, "Times New Roman", serif;
  background: #fbf7ea repeating-linear-gradient(0deg, transparent 0 17px, rgba(60,110,200,.28) 17px 18px); border-top: 14px solid #d8452f; box-shadow: 3px 4px 0 rgba(0,0,0,.55); transform: rotate(-3deg); pointer-events: none; }
#excard small { display: block; font: bold 9px var(--text); letter-spacing: .3em; margin-top: -1px; } #excard b { font: 900 30px/1 var(--display); display: block; }
#excard span { display: block; font-size: 12.5px; line-height: 18px; font-style: italic; } #excard i { display: block; font: bold 11px var(--text); font-style: normal; margin-top: 2px; letter-spacing: .08em; }
#excard.done { border-top-color: #2f9a4a; animation: stampin .35s cubic-bezier(.2,1.8,.4,1); } #excard.done i { color: #2f9a4a; }
@keyframes stampin { 0% { transform: rotate(-3deg) scale(1.3); } 100% { transform: rotate(-3deg); } }
@media (max-width: 760px) { #excard { display: none; } } /* on phones the exercise number rides in the progress label instead */

/* ---------- the Hine page: a 1992 photocopied fanzine. Black toner, typewriter, crooked paste-up. */
#zine-page.xerox { background: #e4e4df radial-gradient(circle at 80% 12%, rgba(0,0,0,.2), transparent 28%), repeating-linear-gradient(92deg, rgba(0,0,0,.06) 0 1px, transparent 1px 7px); background-blend-mode: multiply; color: #0a0a0a; font-family: var(--text); filter: grayscale(1) contrast(1.25); }
#zine-page.xerox::before { content: "▮  ▮"; position: absolute; left: 10px; top: 8px; letter-spacing: 34px; font-size: 13px; opacity: .55; transform: rotate(90deg); transform-origin: left top; } /* staples */
#zine-page.xerox h1 { font: 900 46px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; transform: rotate(-1.5deg); text-shadow: 2px 1px 0 rgba(0,0,0,.35); }
#zine-page.xerox h1 span { background: #0a0a0a !important; color: #e4e4df !important; } #zine-page.xerox h1 span:nth-child(even) { background: transparent !important; color: #0a0a0a !important; border: 3px solid #0a0a0a; }
#zine-page.xerox .kick { color: #0a0a0a; border-bottom: 2px solid #0a0a0a; display: inline-block; }
#zine-page.xerox p, #zine-page.xerox li { font-size: 14.5px; line-height: 1.55; } #zine-page.xerox p:nth-of-type(odd) { transform: rotate(.35deg); } #zine-page.xerox p:nth-of-type(even) { transform: rotate(-.3deg); }
#zine-page.xerox ul { list-style: none; padding-left: 0; } #zine-page.xerox li { padding: 5px 0 5px 28px; position: relative; border-bottom: 1px dashed #0a0a0a; } #zine-page.xerox li::before { content: "✂"; position: absolute; left: 2px; }
#zine-page.xerox blockquote { background: #0a0a0a; color: #e4e4df; box-shadow: none; outline: 3px solid #0a0a0a; outline-offset: 4px; transform: rotate(2deg); font: 900 26px/1.1 var(--display); text-transform: uppercase; text-align: center; }
#zine-page.xerox .do { background: #fff; border: 4px solid #0a0a0a; transform: rotate(-1deg); box-shadow: 6px 6px 0 #0a0a0a; } #zine-page.xerox mark { background: #0a0a0a; color: #e4e4df; }

/* ---------- the Vitimus page: a workbook. Ruled paper, margin line, boxes to tick. */
#zine-page.workbook { background: #fbf8ee linear-gradient(90deg, transparent 46px, rgba(216,69,47,.55) 46px 48px, transparent 48px), repeating-linear-gradient(0deg, transparent 0 27px, rgba(60,110,200,.25) 27px 28px); color: #1b1b22; font-family: Georgia, "Times New Roman", serif; padding-left: 64px; }
#zine-page.workbook::after { display: none; }
#zine-page.workbook h1 { font: 700 38px/1.1 Georgia, serif; } #zine-page.workbook h1 span { background: transparent !important; color: #1b1b22 !important; transform: none !important; padding: 0; margin-right: .25em; }
#zine-page.workbook h1::before { content: "Workbook"; font: bold 12px var(--text); letter-spacing: .2em; display: block; color: #d8452f; text-transform: uppercase; }
#zine-page.workbook .kick { color: #2f6ad8; } #zine-page.workbook p, #zine-page.workbook li { font-size: 15.5px; line-height: 28px; margin-top: 0; margin-bottom: 0; }
#zine-page.workbook ul { list-style: none; padding-left: 0; margin: 0; } #zine-page.workbook li { padding-left: 30px; position: relative; } #zine-page.workbook li::before { content: "☐"; position: absolute; left: 2px; font-size: 19px; color: #2f6ad8; }
#zine-page.workbook .do { background: #fff; border: 2px solid #1b1b22; border-radius: 3px; box-shadow: 3px 3px 0 rgba(0,0,0,.25); margin: 28px 0; padding: 12px 16px; line-height: 24px; } #zine-page.workbook .do b:first-child { background: #d8452f; color: #fff; padding: 2px 8px; font: bold 12px var(--text); letter-spacing: .2em; }
#zine-page.workbook mark { background: #ffe680; } #zine-page.workbook .stamp { border-color: #2f9a4a; color: #2f9a4a; }
@media (max-width: 700px) { #zine-page.workbook { padding-left: 56px; } #zine-page.xerox h1 { font-size: 32px; } }

/* ================= UV: one look. Blacklight velvet, fluorescent ink, soft round shapes. Two typefaces, no tilts, no offset shadows. ================= */
@font-face { font-family: "Bagel Fat One"; src: url(../vendor/fonts/bagel-fat-one.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url(../vendor/fonts/space-grotesk.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }
:root { --display: "Bagel Fat One", "Arial Rounded MT Bold", system-ui, sans-serif; --text: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pink: #ff71ce; --cyan: #01cdfe; --mint: #05ffa1; --violet: #b967ff; --lemon: #fffb96; --ink: #0b0618; --bone: #fdeffc; --mag: #ff71ce; --gold: #fffb96;
  --glass: rgba(13, 7, 30, .74); --sun: linear-gradient(180deg, var(--lemon), var(--pink) 55%, var(--violet)); }
html, body { font-family: var(--text); font-synthesis: none; } h1, h2, h3, h4, button, b, kbd { font-synthesis: none; }
#hud { text-shadow: 0 1px 3px rgba(0,0,0,.8); }

/* objective: a single pill */
#objective { font: 400 clamp(15px, 1.6vw, 19px)/1.25 var(--display); letter-spacing: .02em; padding: 10px 22px; background: var(--glass); border: 1.5px solid var(--accent); border-radius: 999px; box-shadow: 0 0 22px -6px var(--accent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: opacity .3s; }
#objective::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); margin-right: 10px; vertical-align: 2px; }
@keyframes quest { 0% { transform: translateY(-140%) scale(1.2); opacity: 0; } 55% { transform: translateY(5px) scale(1.05); opacity: 1; background: var(--accent); color: var(--ink); text-shadow: none; } 100% { transform: none; } }
#hint { font-size: 13px; letter-spacing: .04em; background: none; padding: 0; opacity: .8; transition: opacity .3s; }
#toast { font: 600 13px var(--text); letter-spacing: .1em; padding: 7px 16px; border-radius: 999px; background: var(--mint); color: var(--ink); }
#meter { font: 600 11px var(--text); letter-spacing: .22em; } #meter .bar { height: 10px; border-radius: 99px; border: 0; background: rgba(255,255,255,.14); overflow: hidden; } #meter .bar i { border-radius: 99px; background: linear-gradient(90deg, var(--violet), var(--pink), var(--lemon)); box-shadow: none; }

/* speech: one rounded panel, one voice */
#subtitle { padding: 14px 22px 16px; background: var(--glass); border: 0; border-radius: 20px; font: 500 clamp(15px, 1.55vw, 19px)/1.45 var(--text); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.1); text-shadow: none; }
#subtitle b { font: 400 13px var(--display); letter-spacing: .12em; color: var(--accent); margin-bottom: 3px; } #subtitle.other b { color: var(--cyan); }
#subtitle::after { right: 16px; bottom: 10px; color: var(--accent); opacity: .8; }
/* while the camera is directed there is exactly one thing to read */
body.cut #objective, body.cut #hint, body.cut #toast, body.cut #excard, body.cut #meter { opacity: 0; }

/* markers */
.mk { font: 600 11px var(--text); letter-spacing: .12em; text-shadow: none; --c: var(--lemon); }
.mk i::before { background: rgba(11,6,24,.55); box-shadow: 0 0 14px -2px var(--c); }
.mk b { background: var(--glass); padding: 4px 10px; border: 0; border-radius: 999px; font-size: 11px; font-weight: 600; margin-top: -2px; }
.mk.primary b { font: 400 14px var(--display); letter-spacing: .04em; text-transform: none; background: var(--c); color: var(--ink); padding: 5px 13px; }
.mk.door { --c: var(--cyan); } .mk.spot { --c: var(--bone); } .mk.quiet { --c: var(--bone); }

/* buttons */
#corner button { font: 600 11px var(--text); letter-spacing: .14em; border-radius: 999px; border: 1px solid rgba(255,255,255,.22); background: var(--glass); padding: 9px 14px; }
#actions button { font: 400 17px/1 var(--display); letter-spacing: .06em; background: var(--glass); border: 2px solid var(--accent); box-shadow: 0 0 24px -8px var(--accent); }
#actions button.gold { border-color: var(--lemon); color: var(--lemon); box-shadow: 0 0 24px -8px var(--lemon); } #actions button kbd { font: 600 11px var(--text); }
#paradigm { font: 600 12px var(--text); } #paradigm span { border-radius: 999px; background: var(--glass); } #paradigm span.on { box-shadow: 0 0 14px -2px var(--accent); }

/* banner + exercise card */
#banner h2 { font: 400 clamp(34px, 6.5vw, 88px)/1 var(--display); letter-spacing: .02em; background: var(--sun); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 0 22px rgba(255,113,206,.55)); }
#banner p { font: 600 13px var(--text); letter-spacing: .3em; color: var(--bone); text-shadow: none; } @keyframes bannerIn { 0% { opacity: 0; transform: scale(1.1); } 12% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
#excard { width: auto; max-width: 190px; padding: 10px 14px 11px; color: var(--bone); font-family: var(--text); background: var(--glass); border: 0; border-radius: 16px; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.1); transform: none; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: opacity .3s; }
#excard small { font: 600 9px var(--text); letter-spacing: .28em; opacity: .7; } #excard b { font: 400 30px/1.05 var(--display); background: var(--sun); -webkit-background-clip: text; background-clip: text; color: transparent; }
#excard span { font: 500 12.5px/1.35 var(--text); font-style: normal; } #excard i { font: 600 11px var(--text); color: var(--lemon); }
#excard.done { animation: none; box-shadow: inset 0 0 0 1.5px var(--mint); } #excard.done i { color: var(--mint); }

/* title, pause, gate */
#title { background: radial-gradient(ellipse at center, rgba(11,6,24,.1), rgba(11,6,24,.8)); }
.kicker { font: 600 13px var(--text); letter-spacing: .5em; color: var(--cyan); }
#logo { font: 400 clamp(64px, 16vw, 210px)/1 var(--display); letter-spacing: .01em; background: var(--sun); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 0 34px rgba(255,113,206,.5)); }
@keyframes twitch { 0% { transform: translate(-4px,1px) skewX(-5deg); } 50% { transform: translate(4px,-1px) skewX(4deg); filter: hue-rotate(60deg) drop-shadow(0 0 34px rgba(1,205,254,.6)); } 100% { transform: none; } }
#pause h2 { font: 400 64px/1 var(--display); letter-spacing: .04em; background: var(--sun); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.tag { font-size: 17px; letter-spacing: .02em; } .fine { letter-spacing: .08em; }
.buttons button { font: 400 19px var(--display); letter-spacing: .08em; padding: 15px 38px; border-radius: 999px; background: linear-gradient(90deg, var(--pink), var(--violet)); color: #fff; box-shadow: 0 0 34px -8px var(--pink); text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.buttons button:hover { transform: translateY(-2px); background: linear-gradient(90deg, var(--lemon), var(--pink)); color: var(--ink); text-shadow: none; }
#btn-gate { font: 400 22px var(--display); letter-spacing: .12em; border-radius: 999px; border: 2px solid var(--pink); color: var(--bone); } #btn-gate:hover { background: var(--pink); color: var(--ink); }
@keyframes gatepulse { 50% { box-shadow: 0 0 40px -4px var(--pink); } }
#ticker { background: rgba(11,6,24,.85); color: var(--pink); font: 600 11px var(--text); letter-spacing: .2em; border-top: 1px solid rgba(255,113,206,.35); }
#hint { background: var(--glass); padding: 6px 14px; border-radius: 14px; opacity: 1; }

/* buttons are set in the text face; the display face is for titles only */
.buttons button, #btn-gate, #actions button, .zbtn { font-family: var(--text); font-weight: 700; letter-spacing: .16em; }
.buttons button { font-size: 16px; } #actions button { font-size: 14px; } #btn-gate { font-size: 17px; }
/* title: the words sit on their own dark pool so the room behind cannot fight them */
#title { background: radial-gradient(ellipse 70% 62% at center, rgba(11,6,24,.86), rgba(11,6,24,.62) 55%, rgba(11,6,24,.5)); }
.kicker { font-weight: 700; font-size: 14px; text-shadow: 0 0 12px #000; } .tag { font-weight: 600; font-size: 19px; text-shadow: 0 2px 10px #000; } .tag small { opacity: .8; font-size: 13px; font-weight: 500; }
/* the display face is for titles only: objective, marker labels and speaker names are set in the text face */
#objective { font: 600 clamp(14px, 1.45vw, 17px)/1.3 var(--text); letter-spacing: .01em; border-radius: 22px; text-wrap: balance; max-width: min(640px, 92vw); }
.mk.primary b { font: 700 12px var(--text); letter-spacing: .1em; text-transform: uppercase; }
#subtitle b { font: 700 11px var(--text); letter-spacing: .22em; }
#toast { text-wrap: balance; border-radius: 16px; } #hint { text-wrap: balance; }

/* ---------- the opening: the set is off. One tap and the tube warms up. */
#gate { background: #020106; cursor: pointer; flex-direction: column; gap: 18px; transition: opacity .5s .55s; }
#btn-gate { position: absolute; inset: 0; width: 100%; height: 100%; background: none; border: 0; padding: 0; animation: none; box-shadow: none; border-radius: 0; z-index: 2; }
#btn-gate:hover { background: none; }
#standby { width: 10px; height: 10px; border-radius: 50%; background: #ff5e7a; box-shadow: 0 0 14px #ff5e7a; animation: standby 2.4s ease-in-out infinite; }
@keyframes standby { 50% { opacity: .25; } }
#gate .fine { margin: 0; letter-spacing: .22em; text-transform: uppercase; opacity: .5; }
#crt { position: absolute; left: 0; right: 0; top: 50%; height: 100vh; margin-top: -50vh; background: #fdeffc; transform: scale(0, .004); opacity: 0; pointer-events: none; }
#gate.off #standby, #gate.off .fine { opacity: 0; animation: none; }
#gate.off #crt { animation: tube .75s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes tube { 0% { transform: scale(0, .004); opacity: 1; } 35% { transform: scale(1, .004); opacity: 1; } 70% { transform: scale(1, 1); opacity: 1; } 100% { transform: scale(1, 1); opacity: 0; } }

/* ---------- zine navigation: every page is a tile you can see; nothing hides below a scroll */
#zine-nav { overflow: visible; padding: 14px 0 10px; } #zine-nav h3 { font-size: 24px; margin: 0 14px 6px; transform: none; } #zine-nav h3 br { display: none; }
#zine-nav ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 2px; padding: 0 8px; }
#zine-nav li.sec { grid-column: 1 / -1; font: 700 9px var(--text); letter-spacing: .3em; opacity: .55; padding: 8px 6px 2px; cursor: default; border: 0; } #zine-nav li.sec:hover { background: none; }
#zine-nav li.zt { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border: 0; border-radius: 8px; font: 500 9.5px/1.15 var(--text); letter-spacing: 0; text-align: center; font-style: normal; position: relative; }
#zine-nav li.zt svg { width: 24px; height: 24px; flex: none; } #zine-nav li.zt span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#zine-nav li.zt.on { background: #efe6cf; color: #111; font-weight: 700; } #zine-nav li.zt.locked { opacity: .28; }
#zine-nav li.zt.new::after { content: ""; position: absolute; top: 4px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); }
#zine-nav .fine { margin: 6px 14px 0; }
@media (orientation: portrait) { #zine-nav { max-height: none; } #zine-nav ul { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); } #zine-nav li.zt { padding: 4px 1px; } #zine-nav li.zt svg { width: 20px; height: 20px; } }
@media (max-height: 520px) and (orientation: landscape) { #zine-nav { width: 230px; overflow: auto; } #zine-nav li.zt { padding: 3px 1px; font-size: 9px; } #zine-nav li.zt svg { width: 18px; height: 18px; } }
