/* LATCHDIAL landing v2. Act 1: one fixed WebGL world under a tall scroll track, chapters fade in at each stop,
   field-note callouts pinned to objects, a depth gauge on the right. Act 2: the vault wall as a machine.
   .gl = 3D path, .no-gl = flat path (same content as plain sections). .mob = ≤768 px. */

html { scroll-behavior: auto; }
body.home { background: var(--bg); }
.topbar { position: fixed; left: 0; right: 0; top: 0; background: linear-gradient(180deg, rgba(12,9,10,.82), rgba(12,9,10,.35) 70%, transparent); border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.nav .nav-vault { color: var(--gold-2); }
.nav a.btn-buy { color: var(--amber-ink); }
.nav a.btn-buy:hover { color: var(--amber-ink); background: #F2B254; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 17px; }
.dot { opacity: .55; margin: 0 .45em; }
.small { font-size: 13px; }
.lbl { font: 600 11px/1 var(--f-label); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
em { font-style: italic; }

/* ---------- the world (fixed behind everything) ---------- */
.world { position: fixed; inset: 0; z-index: 0; pointer-events: none; will-change: transform; }
.backdrop { position: absolute; inset: 0; background: radial-gradient(90% 70% at 62% 40%, #2a1714 0%, #140d0d 45%, var(--bg) 80%); }
.gl .backdrop::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 40% at 62% 46%, rgba(232,163,60,.12), transparent 70%); }
.world .gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s ease; }
.gl-ready .world .gl { opacity: 1; }
.no-gl .world .gl { display: none; }
.shade { position: absolute; inset: 0; transition: opacity .8s ease; background: linear-gradient(90deg, rgba(8,6,7,.78) 0%, rgba(8,6,7,.42) 30%, rgba(8,6,7,0) 55%); }
html[data-stop="1"] .shade, html[data-stop="3"] .shade { background: linear-gradient(270deg, rgba(8,6,7,.78) 0%, rgba(8,6,7,.42) 30%, rgba(8,6,7,0) 55%); }
html.in-vault .shade { opacity: 0; }

/* ---------- Act 1 chapters ---------- */
main { position: relative; z-index: 2; }
.track { position: relative; }
.gl .ch { position: fixed; z-index: 3; top: 50%; width: min(500px, 40vw); opacity: var(--o, 0); transform: translate3d(0, calc(-50% + var(--dy, 0px)), 0); pointer-events: none; }
.gl .ch.on { pointer-events: auto; }
.gl .ch-hero { --o: 1; left: max(var(--gut), 5vw); width: min(620px, 46vw); }
.gl .ch-l { left: max(var(--gut), 5vw); }
.gl .ch-r { right: max(96px, 8vw); }
.ch-n { font: 600 12px/1 var(--f-label); letter-spacing: .22em; text-transform: uppercase; color: var(--mute); display: flex; gap: 12px; align-items: baseline; padding-bottom: 12px; border-bottom: 1px solid color-mix(in srgb, var(--gold) 34%, transparent); margin-bottom: 18px; }
.ch-n span { font: italic 400 20px/1 var(--f-display); letter-spacing: 0; color: var(--gold); text-transform: none; }
.ch-h { font-size: clamp(40px, 4.2vw, 62px); line-height: 1; margin-bottom: 18px; text-wrap: balance; text-shadow: 0 2px 30px rgba(0,0,0,.6); }
.ch-h em, .pitch em { color: var(--gold-2); }
.ch-p { font-size: 16.5px; line-height: 1.6; color: #D9D0C0; margin-bottom: 16px; text-shadow: 0 1px 12px rgba(0,0,0,.7); }
.ch-live { font-size: 14px; line-height: 1.7; padding: 12px 14px; border-left: 2px solid var(--gold); background: rgba(12,9,10,.55); margin-bottom: 14px; }
.ch-live small { color: var(--mute); font-size: 12px; }
.ch-s { font-size: 13.5px; color: var(--mute); margin: 0; }
.ch-s a { color: var(--gold-2); }
.kicker { font: 600 13px/1 var(--f-label); letter-spacing: .24em; text-transform: uppercase; color: var(--gold); margin-bottom: 22px; display: flex; align-items: center; gap: 10px; }
.kicker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.pitch { font-size: clamp(56px, 6.6vw, 108px); line-height: .92; letter-spacing: -.012em; margin-bottom: 22px; text-shadow: 0 4px 40px rgba(0,0,0,.7); }
.pitch em { display: block; }
.lede { color: #DDD4C4; font-size: 17.5px; line-height: 1.6; max-width: 470px; margin-bottom: 22px; text-shadow: 0 1px 14px rgba(0,0,0,.8); }
.hero-live { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ivory); margin-bottom: 24px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--gold) 28%, transparent); background: rgba(12,9,10,.5); max-width: 470px; }
.hero-live .lbl { margin-right: 8px; }
.hero-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.hero-scroll { font: 600 12px/1 var(--f-label); letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
.btn-amber { box-shadow: 0 0 0 1px rgba(232,163,60,.4), 0 8px 30px rgba(232,163,60,.22); }
.rules-text { font-size: 17.5px; line-height: 1.6; }
.legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--mute); font-size: 14px; }
.legend li { display: flex; gap: 8px; align-items: center; }

/* ---------- callouts (field notes) ---------- */
.callouts { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.leaders { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.leaders polyline { fill: none; stroke: var(--gold); stroke-width: 1; opacity: 0; }
.leaders circle { fill: none; stroke: var(--gold-2); stroke-width: 1; opacity: 0; }
.leaders circle.dot { fill: var(--gold-2); stroke: none; }
.co { position: absolute; left: 0; top: 0; opacity: 0; max-width: 240px; padding: 8px 12px 9px; background: rgba(12,9,10,.74); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); will-change: transform, opacity; }
.co b { display: block; font: italic 400 19px/1.1 var(--f-display); color: var(--gold-2); }
.co small { display: block; margin-top: 3px; font: 400 12px/1.4 var(--f-mono); color: var(--ivory); }
.co small a { color: var(--ivory); }
.no-gl .callouts, .no-gl .leaders { display: none; }

/* ---------- depth gauge ---------- */
.depth { position: fixed; z-index: 4; right: max(18px, 2vw); top: 50%; transform: translateY(-50%); width: 76px; text-align: right; transition: opacity .5s; }
.depth.away, .zoomed .depth, .in-vault .depth { opacity: 0; pointer-events: none; }
.depth-k { margin: 0; font: 600 10px/1 var(--f-label); letter-spacing: .26em; text-transform: uppercase; color: var(--mute); }
.depth-v { margin: 6px 0 14px; font-size: 18px; color: var(--gold-2); white-space: nowrap; }
.depth-stops { list-style: none; margin: 0; padding: 0 16px 0 0; display: grid; gap: 4px; position: relative; }
.depth-stops button { width: 100%; display: flex; justify-content: flex-end; gap: 8px; align-items: baseline; padding: 7px 0; border: 0; background: none; cursor: pointer; color: var(--dim); font: 600 12px/1 var(--f-label); letter-spacing: .14em; text-transform: uppercase; }
.depth-stops .d-m { font-size: 10px; letter-spacing: 0; }
.depth-stops button:hover, .depth-stops button.cur { color: var(--ivory); }
.depth-stops button.cur .d-n { color: var(--gold-2); }
.depth-rail { position: absolute; right: 0; top: 68px; bottom: 4px; width: 1px; background: color-mix(in srgb, var(--gold) 30%, transparent); }
.depth-rail i { position: absolute; right: -4px; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); top: calc(var(--p, 0) * (100% - 9px)); }
.no-gl .depth { display: none; }

/* ---------- Act 2: the vault ---------- */
.vault { position: relative; height: 100vh; height: 100svh; min-height: 560px; outline: none; overflow: hidden; overflow: clip; }
.machine { position: absolute; inset: 0; z-index: 2; pointer-events: none; --u: 3px; opacity: var(--o, 0); will-change: transform; }
.machine.live { pointer-events: auto; }
.machine [data-anchor], .cab { position: absolute; left: 0; top: 0; will-change: transform; }
.door-flat { position: absolute; left: 0; top: 0; display: none; border-radius: 50%; }
.wheel-flat { position: absolute; display: none; overflow: visible; }

.plate { text-align: center; white-space: nowrap; pointer-events: none !important; margin: 0; }
.plate p { margin: 0; }
.plate-top { color: var(--phos); text-shadow: 0 0 10px rgba(244,199,122,.55); }
.plate-l1, .plate-l2 { font: 500 max(11px, calc(var(--u) * 6.2))/1.35 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; }
.plate-l2 { color: color-mix(in srgb, var(--phos) 75%, transparent); }
.plate-top.is-resetting [data-r="lock"] { color: var(--amber); }
.plate-bottom { color: #241B0C; padding: calc(var(--u) * 3) calc(var(--u) * 8); background: linear-gradient(180deg, #E2C47F, var(--gold) 45%, #8a6c38); box-shadow: inset 0 1px 0 rgba(255,240,200,.5), 0 8px 24px rgba(0,0,0,.5); z-index: 1; }
.plate-k { font: 700 max(9px, calc(var(--u) * 4.4))/1.1 var(--f-label); letter-spacing: .22em; text-transform: uppercase; opacity: .8; }
.plate-v { font: 500 max(11px, calc(var(--u) * 6.2))/1.2 var(--f-mono); letter-spacing: -.01em; }
.plate-s { font: 600 max(9px, calc(var(--u) * 3.8))/1.2 var(--f-label); letter-spacing: .1em; text-transform: uppercase; opacity: .78; }
.plate-s a { color: inherit; }

.win { width: calc(var(--u) * 34); height: calc(var(--u) * 32); min-width: 30px; min-height: 28px; padding: 0; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--ivory); border-radius: 3px; }
.win-n { font: 500 max(15px, calc(var(--u) * 17))/1 var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; text-shadow: 0 0 8px rgba(239,231,214,.35); }
.win-n.flip { animation: flip .22s var(--ease); }
@keyframes flip { 0% { transform: translateY(-28%); opacity: .2; } 100% { transform: none; opacity: 1; } }
.win-k { position: absolute; left: 3px; top: 2px; font: 700 max(8px, calc(var(--u) * 5))/1 var(--f-label); letter-spacing: .16em; color: var(--mute); }
.win.is-active { box-shadow: 0 0 0 2px var(--amber), 0 0 18px rgba(232,163,60,.35); }
.win.is-active .win-k { color: var(--amber); }
.wheel-hit { border-radius: 50%; cursor: grab; touch-action: none; }
.wheel-hit:active { cursor: grabbing; }
.wheel-hit:focus-visible { outline: 2px dashed var(--amber); outline-offset: 6px; }
.door-hint { margin: 0; font: 600 max(11px, calc(var(--u) * 6))/1 var(--f-label); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-2); white-space: nowrap; pointer-events: none !important; transition: opacity .4s; text-shadow: 0 0 12px rgba(0,0,0,.9); }
.door-hint.is-done { opacity: 0; }
.door-hint.is-armed { opacity: 1; color: var(--amber); }
.tag-last { font: 400 12px/1.4 var(--f-mono); color: var(--mute); white-space: nowrap; padding: 6px 10px; border: 1px solid var(--line-2); background: rgba(12,9,10,.78); }
.tag-k { font: 700 11px/1 var(--f-label); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.tag-last a { color: var(--ivory); }
.sound { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(12,9,10,.7); color: var(--mute); display: grid; place-items: center; cursor: pointer; padding: 0; }
.sound svg { width: 16px; height: 16px; }
.sound .s-on { display: none; }
.sound[aria-pressed="true"] { color: var(--ivory); }
.sound[aria-pressed="true"] .s-on { display: inline; }
.sound[aria-pressed="true"] .s-off { display: none; }

/* cabinet switches: transparent over the CRT, the readout glows on the glass */
.cab { padding: 0; border: 0; background: transparent; cursor: pointer; color: var(--phos); text-align: left; --fs: 12px; transition: opacity .3s; }
.cab-scr { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: .35em; padding: 6% 8%; font-size: var(--fs); overflow: hidden; }
.cab-t { font: 700 1.25em/1 var(--f-label); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-2); text-shadow: 0 0 10px rgba(232,207,148,.5); }
.cab-v { font-size: .95em; line-height: 1.4; color: var(--phos); text-shadow: 0 0 8px rgba(244,199,122,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cab[data-cab="inside"] { color: var(--click); }
.cab[data-cab="inside"] .cab-v { color: #c4f7d2; text-shadow: 0 0 8px rgba(156,240,180,.5); }
.cab[data-cab="docs"] .cab-v { color: #c9dbe6; text-shadow: 0 0 8px rgba(169,200,218,.45); }
.cab::after { content: ""; position: absolute; inset: -3px; border: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.cab:hover::after, .cab:focus-visible::after { border-color: color-mix(in srgb, var(--gold-2) 70%, transparent); box-shadow: 0 0 24px rgba(232,207,148,.25); }
.cab:focus-visible { outline: none; }
.cab-knob { display: none; }
.zoomed .cab { opacity: 0; pointer-events: none; }
.zoomed:not(.z-try) .machine [data-anchor] { opacity: 0; pointer-events: none !important; }
.z-try .machine .tag-last, .z-try .machine .plate-bottom { opacity: 0; }

/* module panels */
.panels { position: absolute; inset: 0; z-index: 4; pointer-events: none; will-change: transform; }
.gl .panel { position: absolute; left: 0; top: 0; pointer-events: auto; overflow: auto; overscroll-behavior: contain; opacity: var(--k, 0); padding: 20px 24px 22px;
  background: linear-gradient(180deg, rgba(14,9,6,.94), rgba(10,7,6,.97)); border: 1px solid color-mix(in srgb, var(--phos) 30%, transparent);
  box-shadow: inset 0 0 60px rgba(244,199,122,.06), 0 30px 80px rgba(0,0,0,.6); color: var(--ivory); scrollbar-width: thin; scrollbar-color: var(--gold-3) transparent; }
.gl .panel::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(180deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; }
.panel-h { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid color-mix(in srgb, var(--phos) 24%, transparent); }
.panel-n { margin: 0; font-size: 12px; color: var(--phos); letter-spacing: .08em; }
.panel-h h3 { font-size: 30px; line-height: 1; flex: 1 1 auto; }
.panel-sub { margin: 22px 0 6px; font: 600 13px/1 var(--f-label); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.panel p { line-height: 1.55; }
.more { font: 600 13px/1 var(--f-label); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-2); text-decoration: none; white-space: nowrap; }
.more:hover { color: var(--ivory); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 14px 0 0; font-size: 14px; }
.kv dt { font: 600 12px/1.6 var(--f-label); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.kv dd { margin: 0; }
.kv a { color: var(--gold-2); }
.bul { margin: 0 0 12px; padding-left: 18px; color: #D9D0C0; font-size: 14.5px; line-height: 1.55; }
.bul li { margin-bottom: 6px; }
.panel code { font-size: 12.5px; color: var(--gold-2); }
.panel .rules-text { font-size: 16px; }

/* heat map 3 × 40 */
.heat { margin-bottom: 18px; }
.heat-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.heat-grid { display: grid; grid-template-columns: 22px repeat(40, minmax(11px, 1fr)); gap: 2px; min-width: 520px; }
.heat-grid .hk { font: 700 13px/18px var(--f-label); letter-spacing: .1em; color: var(--mute); }
.heat-grid .hk.is-listening { color: var(--amber); }
.heat-grid .hn { font: 400 8.5px/1 var(--f-mono); color: var(--dim); text-align: center; padding-bottom: 3px; }
.heat-grid i, .heat-key i { display: block; height: 18px; border-radius: 1px; background: #2a2120; }
.heat-grid i.c-ruled-out, .heat-key i.c-ruled-out { background: repeating-linear-gradient(45deg, #241c1b 0 2px, #120d0d 2px 5px); }
.heat-grid i.c-cold, .heat-key i.c-cold { background: var(--cold); }
.heat-grid i.c-warm, .heat-key i.c-warm { background: var(--warm); box-shadow: 0 0 8px rgba(232,163,60,.5); }
.heat-grid i.c-click, .heat-key i.c-click { background: var(--click); box-shadow: 0 0 8px rgba(156,240,180,.5); }
.heat-key { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--mute); }
.heat-key li { display: flex; align-items: center; gap: 6px; }
.heat-key i { width: 12px; height: 12px; }
.panel .tbl-wrap { border-color: color-mix(in srgb, var(--phos) 18%, transparent); }
.panel .tbl th { background: rgba(244,199,122,.06); }
.log td.c { color: var(--ivory); letter-spacing: .04em; }
.log td a { color: var(--ivory); }
.log tr.is-crack td { background: rgba(156,240,180,.06); }

.inside-row { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.inside-row .sym { font: 400 26px/1 var(--f-display); color: var(--gold-2); text-decoration: none; }
.inside-row .nm { color: var(--mute); font-size: 14px; }
.inside-row .am { font: 500 15px/1.2 var(--f-mono); text-align: right; }
.inside-row .us { grid-column: 3; text-align: right; color: var(--mute); font: 400 13px/1.2 var(--f-mono); }
.inside-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 4px; }
.inside-total b { font: 500 22px/1 var(--f-mono); color: var(--click); }
.inside-empty { font: italic 400 30px/1.1 var(--f-display); color: var(--gold-2); margin: 6px 0 8px; }
.refill { margin: 14px 0 0; font-size: 14px; color: var(--mute); }
.refill a { color: var(--gold-2); }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hist .r { font: italic 400 18px/1 var(--f-display); color: var(--gold-2); margin-right: 8px; }
.hist .mono { font-size: 13px; }
.stale-note { color: var(--amber); font: 400 12px/1.4 var(--f-mono); }

/* ---------- the operator's bar (Try) ---------- */
.try { position: absolute; z-index: 5; left: 50%; bottom: 64px; transform: translateX(-50%); width: min(980px, calc(100% - 2 * var(--gut)));
  background: linear-gradient(180deg, rgba(22,15,14,.9), rgba(14,10,10,.94)); border: 1px solid color-mix(in srgb, var(--gold) 34%, transparent);
  box-shadow: 0 20px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(232,207,148,.12); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: opacity .4s, transform .5s var(--ease), width .5s var(--ease); }
.gl .try { opacity: 0; pointer-events: none; }
.gl.in-vault .try { opacity: 1; pointer-events: auto; }
.try-grip { display: none; }
.try-body { padding: 12px 14px; }
.try-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.mode { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-2); flex: none; }
.mode-b { border: 0; background: transparent; padding: 10px 12px; font: 700 13px/1 var(--f-label); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); cursor: pointer; }
.mode-b[aria-checked="true"] { background: var(--gold); color: var(--gold-ink); }
.chips { display: flex; gap: 5px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 9px; min-height: 40px; border: 1px solid var(--line-2); background: #0b0808; cursor: pointer; }
.chip-k { font: 700 12px/1 var(--f-label); letter-spacing: .12em; color: var(--mute); }
.chip-n { font-size: 17px; }
.chip.is-active { border-color: var(--amber); }
.chip.is-active .chip-k { color: var(--amber); }
.steth-next { margin: 0; white-space: nowrap; }
.steth-next b { color: var(--amber); font-size: 16px; }
.pane { margin-left: auto; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wallet-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.wallet-addr { font-size: 14px; }
.real-off { margin: 0; color: var(--mute); font-size: 14px; max-width: 360px; }
.try-msg { margin: 10px 0 0; font-size: 14px; line-height: 1.45; }
.try-msg:empty { display: none; }
.try-msg.is-err { color: #F08A7D; }
.try-msg b { color: var(--ivory); }
.try-msg .reveal { font-family: var(--f-mono); font-size: 11.5px; color: var(--mute); word-break: break-all; display: block; margin-top: 6px; }
.try-more { display: none; }
.try-hint { font-size: 13.5px; line-height: 1.45; margin: 10px 0 0; }
.note { font-size: 13px; line-height: 1.45; margin: 10px 0 0; }
.quota { color: var(--ivory); }
.armed { margin: 10px 0 0; font: 500 14px/1.4 var(--f-mono); color: var(--amber); }
.mini-log { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font: 400 13px/1.3 var(--f-mono); max-height: 150px; overflow: auto; }
.mini-log:empty { display: none; }
.mini-log li { display: flex; gap: 12px; align-items: center; color: var(--mute); }
.mini-log .c { color: var(--ivory); }
.mode-real .try-more, .try:focus-within .try-more { display: block; }
/* zoomed on the door: the bar becomes a side panel */
.gl.z-try .try { left: auto; right: max(var(--gut), 4vw); bottom: auto; top: 50%; transform: translateY(-50%); width: min(440px, 40vw); }
.gl.z-try .try-row { flex-direction: column; align-items: stretch; }
.gl.z-try .pane { margin-left: 0; }
.gl.z-try .try-more { display: block; }
.gl.zoomed:not(.z-try) .try { opacity: 0; pointer-events: none; }

/* selector rail */
.rail { position: absolute; z-index: 5; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; flex-wrap: nowrap; }
.gl .rail { opacity: 0; pointer-events: none; transition: opacity .4s; }
.gl.in-vault .rail { opacity: 1; pointer-events: auto; }
.rail button { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--line-2); background: rgba(12,9,10,.82); color: var(--mute); cursor: pointer; font: 600 12.5px/1 var(--f-label); letter-spacing: .16em; text-transform: uppercase; }
.rail button .mono { font-size: 11px; color: var(--gold); letter-spacing: 0; }
.rail button:hover, .rail button[aria-pressed="true"] { color: var(--ivory); border-color: var(--gold); }
.rail .rail-back { border-color: color-mix(in srgb, var(--amber) 60%, transparent); color: var(--ivory); }
.no-gl .rail { display: none; }

/* ---------- desktop tweaks ---------- */
@media (min-width: 769px) and (max-height: 780px) {
  .pitch { font-size: clamp(48px, 5.6vw, 84px); margin-bottom: 14px; }
  .lede { font-size: 16px; margin-bottom: 14px; }
  .hero-live { margin-bottom: 16px; }
  .ch-h { font-size: clamp(36px, 3.6vw, 52px); }
}

/* ---------- phones ---------- */
@media (max-width: 768px) {
  .gl .ch, .gl .ch-hero, .gl .ch-l, .gl .ch-r { left: var(--gut); right: var(--gut); width: auto; top: auto; bottom: 16px; transform: translate3d(0, var(--dy, 0px), 0);
    padding: 16px; background: linear-gradient(180deg, rgba(12,9,10,.55), rgba(12,9,10,.9) 30%); border: 1px solid color-mix(in srgb, var(--gold) 24%, transparent); max-height: 62svh; overflow: hidden; }
  .gl .ch-hero { background: none; border: 0; padding: 0; bottom: 20px; }
  .pitch { font-size: clamp(44px, 13vw, 64px); margin-bottom: 14px; }
  .lede { font-size: 15.5px; margin-bottom: 14px; }
  .hero-live { font-size: 12.5px; margin-bottom: 16px; }
  .ch-h { font-size: 34px; margin-bottom: 10px; }
  .ch-p { font-size: 14.5px; margin-bottom: 10px; }
  .ch-n { margin-bottom: 10px; padding-bottom: 8px; }
  .ch .rules-text { font-size: 14.5px; }
  .ch-live { font-size: 12.5px; padding: 8px 10px; margin-bottom: 8px; }
  .shade { background: linear-gradient(0deg, rgba(8,6,7,.94) 0%, rgba(8,6,7,.78) 42%, rgba(8,6,7,.35) 62%, rgba(8,6,7,0) 78%) !important; }
  .depth { right: 8px; top: calc(var(--bar-h) + 8px); transform: none; width: auto; }
  .depth-stops, .depth-rail { display: none; }
  .depth-v { margin: 4px 0 0; font-size: 14px; }
  .co { max-width: 180px; padding: 6px 9px; }
  .co b { font-size: 16px; }
  .co small { font-size: 11px; }
  .btn-lg { min-height: 48px; font-size: 16px; }
  .vault { min-height: 0; }

  /* Act 2: door on top, the bar and the module sheet at the bottom */
  .plate-l1, .plate-l2 { font-size: 11px; }
  .plate-top { white-space: normal; width: calc(100vw - 2 * var(--gut)); }
  .plate-bottom { white-space: normal; }
  .tag-last, .sound { display: none; }
  .cab-v { display: none; }
  .try { left: 0; right: 0; bottom: 52px; transform: none; width: auto; border-left: 0; border-right: 0; }
  .try-body { padding: 10px var(--gut); }
  .try-row { gap: 8px 10px; }
  .mode { width: 100%; }
  .chips { flex: 1 1 auto; }
  .chip { flex: 1 1 0; justify-content: center; padding: 8px 4px; }
  .pane { margin-left: 0; width: 100%; }
  .pane .actions .btn-amber { flex: 1 1 auto; }
  .gl.z-try .try { left: 0; right: 0; width: auto; top: auto; bottom: 52px; transform: none; max-height: 70svh; overflow: auto; }
  .gl.z-try .try-row { flex-direction: row; align-items: center; }
  .rail { left: 0; right: 0; transform: none; bottom: 0; padding: 8px var(--gut) calc(8px + env(safe-area-inset-bottom)); gap: 4px; background: rgba(12,9,10,.95); border-top: 1px solid var(--line); overflow-x: auto; justify-content: space-between; }
  .rail button { padding: 0 8px; gap: 5px; font-size: 12px; letter-spacing: .1em; height: 34px; flex: 1 0 auto; justify-content: center; }
  .rail button .mono { display: none; }
  .rail .rail-back { display: none !important; }
  .gl .panel { position: fixed; left: 0; right: 0; bottom: 52px; top: auto; max-height: 64svh; width: auto; transform: translateY(calc((1 - var(--k, 0)) * 30px)); border-left: 0; border-right: 0; padding: 16px var(--gut) 18px; }
  .panel-h h3 { font-size: 24px; }
  .heat-grid { min-width: 640px; }
  .log th:nth-child(2), .log td:nth-child(2) { display: none; }
}

@media (max-width: 420px) { .nav .nav-vault { display: none; } }

/* ---------- flat path (no WebGL / reduced motion) ---------- */
.no-gl .topbar { background: rgba(12,9,10,.94); }
.no-gl main { padding-top: var(--bar-h); }
.no-gl .track { display: grid; gap: 0; }
.no-gl .ch { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 56px var(--gut) 40px; }
.no-gl .ch-hero { padding-top: clamp(40px, 10vh, 120px); min-height: 72svh; }
.no-gl .ch + .ch { border-top: 1px solid var(--line); }
.no-gl .ch > * { max-width: 680px; }
.no-gl .vault { height: auto; min-height: 0; padding: 24px 0 40px; border-top: 1px solid var(--line); display: flex; flex-direction: column; }
.no-gl .machine { order: 1; } .no-gl .try { order: 2; } .no-gl .panels { order: 3; }
.no-gl .machine { position: relative; opacity: 1; height: min(84vw, 620px); min-height: 420px; pointer-events: auto; }
.no-gl .door-flat { display: block; background: radial-gradient(circle at 50% 50%, #4a3b37 0%, #2f2524 46%, #1e1717 66%, #0b0808 70%, #6a5638 71%, #8a6c38 74%, #3a2f2e 76%, #1a1414 80%, transparent 81%); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.no-gl .wheel-flat { display: block; }
.no-gl .win { background: #0b0706; box-shadow: inset 0 2px 6px rgba(0,0,0,.8), 0 0 0 2px #7C6337; }
.no-gl .win.is-active { box-shadow: inset 0 2px 6px rgba(0,0,0,.8), 0 0 0 2px var(--amber); }
.no-gl .plate { position: absolute; left: 50% !important; transform: translateX(-50%) !important; padding: 8px 14px; }
.no-gl .plate-top { top: 0 !important; background: #0d0907; border: 1px solid var(--gold-3); }
.no-gl .plate-bottom { top: auto !important; bottom: 0; background: linear-gradient(180deg, #E2C47F, var(--gold) 45%, #8a6c38); }
.no-gl .plate-l1, .no-gl .plate-l2, .no-gl .plate-v { font-size: 13px; }
.no-gl .cab { display: none; }
.no-gl .panels { position: relative; display: grid; gap: 0; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }
.no-gl .panel { padding: 40px 0; border-top: 1px solid var(--line); }
.no-gl .try { position: relative; left: auto; bottom: auto; transform: none; margin: 24px auto; }
.no-gl .try-more { display: block; }
@media (max-width: 768px) { .no-gl .tag-last { display: none; } }

/* wallet picker (from the lazy wallet bundle) */
.wl-back { position: fixed; inset: 0; z-index: 1000; background: rgba(6,4,5,.74); display: grid; place-items: center; padding: 16px; }
.wl-modal { width: min(360px, 100%); background: var(--bg-2); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); padding: 18px; }
.wl-title { font: 400 26px/1 var(--f-display); margin: 0 0 14px; }
.wl-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.wl-item { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; background: var(--bg); border: 1px solid var(--line-2); cursor: pointer; text-align: left; }
.wl-item:hover { border-color: var(--amber); }
.wl-cancel { background: transparent; border: 0; color: var(--mute); cursor: pointer; padding: 8px 0; }
.footer { position: relative; z-index: 3; background: var(--bg); margin-top: 0; }
