/* ══════════════════════════════════════════════════════════════════════
   MINESHAFT — twilight text-adventure. REX wordmark = lime #9DFF20 + Poppins.
   The drawing sits behind the prose; the searchlight reveals it; the text
   stays legible in the dark.
   ══════════════════════════════════════════════════════════════════════ */

/* SELF-HOSTED POPPINS (REQ-THRESHOLD-0003) — the wordmark/UI specify Poppins;
   we embed it rather than relying on a system fallback. Enclosed-app safe: the
   fonts are LOCAL, subsetted woff2 files under media/fonts/, referenced by a
   RELATIVE path (no external font URL). Built by build_poppins_fonts.py from the
   installed Poppins TTFs. The 700 face covers weights 700–900 so the wordmark's
   font-weight:800 resolves to real Poppins Bold (no faux-bold synthesis). */
@font-face{font-family:'Poppins';font-style:normal;font-weight:300;font-display:swap;
  src:url("media/fonts/poppins-300.woff2") format("woff2")}
@font-face{font-family:'Poppins';font-style:normal;font-weight:400;font-display:swap;
  src:url("media/fonts/poppins-400.woff2") format("woff2")}
@font-face{font-family:'Poppins';font-style:normal;font-weight:600 900;font-display:swap;
  src:url("media/fonts/poppins-700.woff2") format("woff2")}
:root{
  --lime:#9DFF20; --ink:#e8e4d8; --dim:#6b6659; --blood:#c0261f; --bg:#05060a;
  --light-r:190px; --lx:50%; --ly:50%;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--ink);
  font-family:Georgia,'Times New Roman',serif;overflow:hidden;
  -webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}
.screen{position:fixed;inset:0}
/* the [hidden] attribute must win over #threshold{display:grid} etc. */
[hidden]{display:none!important}
button{font-family:inherit;cursor:pointer}

/* ── THRESHOLD ─────────────────────────────────────────────────────── */
#threshold{display:grid;place-items:center;text-align:center;padding:6vh 6vw;z-index:20;
  background:radial-gradient(120% 90% at 50% -10%, #17100c 0%, #05060a 55%)}
.bulb{position:absolute;top:0;left:50%;width:2px;height:15vh;background:linear-gradient(#3a2a12,#0000);transform:translateX(-50%)}
.bulb::after{content:"";position:absolute;bottom:-9px;left:50%;width:15px;height:15px;margin-left:-7px;border-radius:50%;
  background:var(--blood);box-shadow:0 0 26px 10px rgba(192,38,31,.55),0 0 90px 40px rgba(192,38,31,.16);animation:flick 5s infinite}
@keyframes flick{0%,97%,100%{opacity:1}98%{opacity:.6}99%{opacity:.9}}
.thresh-inner{max-width:880px}
/* ── REQ-THRESHOLD-0017: "What are you about to see" entry intro ───────── */
#threshold{overflow-y:auto;place-items:safe center}   /* scroll (not clip) if the intro is taller than the viewport */
.ms-intro{display:flex;gap:26px;align-items:flex-start;text-align:left;margin:.6em auto 1.8em;max-width:840px}
.ms-crew{flex:0 0 40%;max-width:360px;margin:0}
.ms-crew img{width:100%;height:auto;display:block;border:1px solid rgba(157,255,32,.35);border-radius:3px;box-shadow:0 0 34px rgba(0,0,0,.6)}
.ms-crew figcaption{margin-top:.5em;font-size:11.5px;letter-spacing:.02em;color:#b8c0c9;font-family:system-ui,sans-serif}
.ms-copy{flex:1 1 auto}
.ms-h{font-family:'Poppins',system-ui,sans-serif;color:var(--lime);font-weight:700;letter-spacing:.05em;font-size:16px;margin:.1em 0 .7em;text-transform:uppercase}
.ms-copy p{color:#e6ebf1;font-size:14px;line-height:1.6;margin:0 0 .9em;font-family:'Poppins','Helvetica Neue',system-ui,sans-serif}
.ms-copy p b{color:var(--lime);font-weight:700}
@media (max-width:640px){ .ms-intro{flex-direction:column;gap:16px} .ms-crew{flex-basis:auto;max-width:100%;align-self:center} }
.wordmark{font-family:'Poppins',system-ui,sans-serif;color:var(--lime);font-weight:800;letter-spacing:.14em;font-size:clamp(34px,7vw,64px);margin:0 0 -.1em}
.thresh-title{font-family:'Poppins',system-ui,sans-serif;font-weight:300;letter-spacing:.6em;font-size:clamp(15px,3.4vw,26px);margin:.4em 0 0;padding-left:.6em}
.thresh-sub{color:var(--dim);font-style:italic;margin:1.4em 0 2.2em;font-family:'Poppins','Helvetica Neue',system-ui,sans-serif}
.gate-warn{color:#b7ada0;font-size:15px;line-height:1.6;max-width:46ch;margin:0 auto 1.6em}
.gate-btns{display:flex;gap:14px;justify-content:center;flex-wrap:wrap}
.btn-enter{background:transparent;color:var(--lime);border:1px solid var(--lime);padding:14px 30px;font-size:15px;letter-spacing:.06em;border-radius:2px;font-family:'Poppins',system-ui,sans-serif;transition:.25s}
.btn-enter:hover{background:var(--lime);color:#05130a;box-shadow:0 0 30px rgba(157,255,32,.5)}
.btn-leave{color:var(--dim);text-decoration:none;padding:14px 18px;font-size:14px;align-self:center;border-bottom:1px solid transparent}
.btn-leave:hover{color:var(--ink);border-bottom-color:var(--dim)}
.gate-hint{color:#4f4a40;font-size:12.5px;font-style:italic;margin-top:2em}

/* ── THREE-OPTION FIRST SCREEN (REQ-THRESHOLD-0009) ─────────────────── */
#choose{margin-top:.5em}
.choose-lead{color:#b7ada0;font-size:15px;line-height:1.6;margin:0 auto 1.6em;max-width:40ch;font-family:'Poppins','Helvetica Neue',system-ui,sans-serif}
/* REQ-THRESHOLD-0011: the entry options ARE the landing, always in a SINGLE horizontal row
   (the row scrolls sideways on a very narrow screen rather than stacking). */
/* REQ-THRESHOLD-0019: the four entry blocks WRAP to fit the viewport — never scroll off horizontally */
.choose-btns{display:flex;gap:14px;justify-content:center;align-items:stretch;flex-wrap:wrap;max-width:100%;padding-bottom:4px}
.btn-choose{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:4px;background:transparent;color:var(--lime);border:1px solid var(--lime);padding:14px 16px;min-width:120px;max-width:150px;flex:0 0 auto;font-size:16px;letter-spacing:.05em;border-radius:2px;font-family:'Poppins',system-ui,sans-serif;cursor:pointer;transition:.25s}
.leave-link{color:var(--lime);opacity:.75;text-decoration:none;border-bottom:1px dotted currentColor}
.leave-link:hover{opacity:1}
.btn-choose:hover{background:var(--lime);color:#05130a;box-shadow:0 0 30px rgba(157,255,32,.5)}
.btn-choose .btn-sub{font-size:11.5px;letter-spacing:.02em;opacity:.7;font-style:italic;font-family:system-ui,sans-serif;white-space:normal;text-align:center;line-height:1.25}
.btn-choose.btn-play{border-width:2px}
#help-panel{max-width:52ch;margin:1.8em auto 0;text-align:left;color:#b7ada0;font-family:system-ui,sans-serif;font-size:14px;line-height:1.6}
#help-panel h3{color:var(--lime);font-family:'Poppins',system-ui,sans-serif;font-weight:600;margin:0 0 .5em;text-align:center}
#help-panel b{color:var(--ink)}
#help-panel .btn-choose{min-width:0;flex-direction:row;padding:8px 18px;font-size:13px;margin:1em auto 0}
.disclosure{position:fixed;bottom:12px;left:0;right:0;max-width:660px;margin:0 auto;color:#6b6659;font-family:system-ui,sans-serif;font-size:12px;padding:0 16px}
.disclosure summary{cursor:pointer;color:#8a8474;text-align:center}
.disclosure ul{text-align:left;line-height:1.55;margin:.8em 0 0;padding-left:1.1em}
.disclosure b{color:#b7ada0}.disclosure code{color:#9a9384}

/* ── STAGE ─────────────────────────────────────────────────────────── */
#stage{background:#000;overflow:hidden;z-index:10;cursor:crosshair}
#art{position:absolute;inset:0 0 128px 0;background-position:center;background-repeat:no-repeat;background-size:contain;   /* DEF-0118: reserve the bottom command zone so the art doesn't sit under the input */
  opacity:0;transition:opacity 1.2s ease;filter:contrast(1.05) brightness(.62) saturate(.9)}
/* ARRIVAL: the incoming room's drawing COMES INTO VIEW through a dark iris that
   opens, blur→sharp — a door/focus resolve, never a snap (REQ-RENDER-0008).
   Uses #art's own clip-path + filter (distinct from the reveal cycle's --light-r
   and body.reveal-art opacity), so the two never fight. */
#art.arriving{animation:artArrive 1.15s cubic-bezier(.22,.61,.36,1) both}
@keyframes artArrive{
  0%  {clip-path:circle(3% at 50% 46%);filter:contrast(1.05) brightness(.30) saturate(.7) blur(9px)}
  60% {clip-path:circle(85% at 50% 46%);filter:contrast(1.05) brightness(.55) saturate(.85) blur(2px)}
  100%{clip-path:circle(150% at 50% 46%);filter:contrast(1.05) brightness(.62) saturate(.9) blur(0)}}
#shroud{position:absolute;inset:0;pointer-events:none;background:#000;
  -webkit-mask-image:radial-gradient(circle var(--light-r) at var(--lx) var(--ly),transparent 0%,transparent 34%,rgba(0,0,0,.86) 72%,#000 100%);
          mask-image:radial-gradient(circle var(--light-r) at var(--lx) var(--ly),transparent 0%,transparent 34%,rgba(0,0,0,.86) 72%,#000 100%)}
#stage::after{content:"";position:absolute;inset:0;pointer-events:none;mix-blend-mode:overlay;z-index:1;
  background:radial-gradient(circle calc(var(--light-r)*.9) at var(--lx) var(--ly),rgba(255,214,140,.15) 0%,rgba(255,180,90,.05) 55%,transparent 72%)}
body.steady #shroud{-webkit-mask-image:none;mask-image:none;background:radial-gradient(120% 120% at 50% 45%,transparent 62%,rgba(0,0,0,.5))}
body.steady #stage::after{display:none}body.steady #stage{cursor:default}
#grain{position:absolute;inset:0;pointer-events:none;opacity:.045;mix-blend-mode:overlay;z-index:2;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");animation:grain .5s steps(2) infinite}
@keyframes grain{0%{transform:translate(0,0)}50%{transform:translate(-4%,3%)}100%{transform:translate(3%,-2%)}}

/* a man's face, flashed in a corner under a brief red spotlight */
.face{position:absolute;width:clamp(84px,13vw,150px);aspect-ratio:3/4;z-index:6;
  opacity:0;overflow:hidden;border-radius:2px;pointer-events:none;background:#0a0708}
#face-tl{top:16px;left:16px}                 /* upper-left */
#face-tr{bottom:92px;right:16px}             /* lower-right — clear of the top-right menu + the prompt row */
.face.spot{aspect-ratio:1;border-radius:50%;background-repeat:no-repeat;background-color:#000}
.face.spot img{display:none}
/* DEF-0047: an animated side-image (the moving webp) plays LIVE inside a red
   CIRCULAR peep-hole. The <img> stays visible (unlike .spot); .face's overflow
   clips it to the circle, the red ::after tints it, and an inset ring sells the
   bored hole. Square box + 50% radius = circle. */
.face.anim{aspect-ratio:1;border-radius:50%;box-shadow:inset 0 0 0 2px rgba(0,0,0,.55),inset 0 0 14px 4px rgba(0,0,0,.6)}
/* one flat colour of light (red): a uniform red multiply over the photo — no gradient, no yellow */
.face img,.face video{width:100%;height:100%;object-fit:cover;filter:brightness(1.08) contrast(1.06)}
.face::after{content:"";position:absolute;inset:0;pointer-events:none;background:#c0261f;mix-blend-mode:multiply}
.face.lit{animation:faceReveal 5s ease forwards}
/* authored room side-images (DEF-0020/0043) stay visible — no flash-and-fade */
.face.persist{opacity:1}
/* REQ-ARTREVEAL-0011 / DEF-0045: authored side-images rest VERTICALLY CENTERED on
   their side (keep left/right), and float UP into that centered position. ID+class
   specificity is needed to beat #face-tl/#face-tr's corner top/bottom. */
#face-tl.persist,#face-tr.persist{top:50%;bottom:auto}
/* REQ-ARTREVEAL-0011 / DEF-0056: the side image starts in the CORNER of its side and
   glides to the VERTICAL CENTER over ~10s (slow enough to see); the image DOUBLES in
   size (1x -> 2x) as it travels in, and — on the circular (red peep-hole) faces — the
   mask DILATES from a small aperture to full over the same move. */
/* --drift-dur (default 10s) is set live by the debug red-circle-delay control (REQ-DEMO-0017) */
.face.persist.from-top{animation:floatCenterTop var(--drift-dur,10s) ease forwards}
.face.persist.from-bottom{animation:floatCenterBottom var(--drift-dur,10s) ease forwards}
/* circular faces (animated webp / spotlit ellipse) also dilate their aperture as they come in */
.face.persist.anim.from-top,.face.persist.spot.from-top{animation:floatCenterTop var(--drift-dur,10s) ease forwards,maskDilate var(--drift-dur,10s) ease forwards}
.face.persist.anim.from-bottom,.face.persist.spot.from-bottom{animation:floatCenterBottom var(--drift-dur,10s) ease forwards,maskDilate var(--drift-dur,10s) ease forwards}
.face.persist.anim,.face.persist.spot{box-shadow:none}   /* the fixed inset ring would mismatch the dilating aperture */
/* DEF-0057: as the circle doubles (scale 2), pull it INWARD toward center so the
   enlarged circle stays on-screen and is never cropped at the edge. from-top is the
   LEFT image (shift right), from-bottom is the RIGHT image (shift left). translateX
   is applied outside scale, so the ~78px inward shift is in real (unscaled) pixels —
   enough to clear the widest face's half-width at 2x. */
@keyframes floatCenterTop{from{opacity:.4;transform:translateY(calc(-50% - 42vh)) translateX(0) scale(1)}to{opacity:1;transform:translateY(-50%) translateX(78px) scale(2)}}
@keyframes floatCenterBottom{from{opacity:.4;transform:translateY(calc(-50% + 38vh)) translateX(0) scale(1)}to{opacity:1;transform:translateY(-50%) translateX(-78px) scale(2)}}
@keyframes maskDilate{from{clip-path:circle(24% at 50% 50%)}to{clip-path:circle(50% at 50% 50%)}}
/* REQ-ARTREVEAL-0012: outgoing side image glides off its own edge (a floating ghost
   clone; the real slot is free to paint the next room). left→left, right→right. */
/* z-index 11 keeps the gliding ghost ABOVE the #transition fade (z9) so the slide-off
   is actually visible instead of hidden behind the black room-change fade (DEF-0058). */
.face-ghost{position:fixed;overflow:hidden;border-radius:50%;pointer-events:none;z-index:11;
  background:#0a0708;background-repeat:no-repeat}
.face-ghost img,.face-ghost video{width:100%;height:100%;object-fit:cover;filter:brightness(1.08) contrast(1.06)}
.face-ghost::after{content:"";position:absolute;inset:0;background:#c0261f;mix-blend-mode:multiply}
.face-ghost.exit-left{animation:faceExitLeft .55s ease forwards}
.face-ghost.exit-right{animation:faceExitRight .55s ease forwards}
@keyframes faceExitLeft{from{transform:translateX(0);opacity:1}to{transform:translateX(-135vw);opacity:.1}}
@keyframes faceExitRight{from{transform:translateX(0);opacity:1}to{transform:translateX(135vw);opacity:.1}}
@media (prefers-reduced-motion:reduce){.face-ghost{display:none}}
/* REQ-DEMO-0019: red countdown clock — appears while the image-hold timer runs (debug only) */
#dbg-clock{position:fixed;top:14px;left:50%;transform:translateX(-50%);z-index:11;width:46px;height:46px;pointer-events:none}
#dbg-clock[hidden]{display:none}
#dbg-clock svg{width:100%;height:100%;transform:rotate(-90deg)}
.dbg-ring-bg{fill:none;stroke:rgba(192,38,31,.25);stroke-width:4}
.dbg-ring-fg{fill:none;stroke:#e0261f;stroke-width:4;stroke-linecap:round;filter:drop-shadow(0 0 4px rgba(224,38,31,.6))}
#dbg-num{position:absolute;inset:0;display:grid;place-items:center;font:700 14px/1 Poppins,system-ui;color:#ff5a4d}
@media (prefers-reduced-motion:reduce){
  .face.persist.from-top{animation:none;opacity:1;transform:translateY(-50%) translateX(78px) scale(2)}
  .face.persist.from-bottom{animation:none;opacity:1;transform:translateY(-50%) translateX(-78px) scale(2)}
  .face.persist.anim.from-top,.face.persist.anim.from-bottom,.face.persist.spot.from-top,.face.persist.spot.from-bottom{clip-path:circle(50% at 50% 50%)}
}
@keyframes faceReveal{
  0%{opacity:0;box-shadow:none}
  8%{opacity:1;box-shadow:0 0 46px 10px rgba(192,38,31,.9)}
  30%{opacity:1;box-shadow:0 0 22px 5px rgba(192,38,31,.45)}
  80%{opacity:.9;box-shadow:0 0 10px 2px rgba(192,38,31,.18)}
  100%{opacity:0;box-shadow:none}}
@media (prefers-reduced-motion:reduce){.face.lit{animation:faceReveal 5s linear forwards}}

/* room-to-room transition effects (keyed to how you move) */
#transition{position:absolute;inset:0;z-index:9;pointer-events:none;opacity:0;background:#000}
#transition.move{animation:trFade .5s ease}
#transition.down{animation:trDown .6s ease}
#transition.up{animation:trUp .6s ease}
#transition.tele{animation:trTele .75s ease}
@keyframes trFade{0%{opacity:0}45%{opacity:.7}100%{opacity:0}}
@keyframes trDown{0%{opacity:0;transform:translateY(-100%)}45%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(100%)}}
@keyframes trUp{0%{opacity:0;transform:translateY(100%)}45%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-100%)}}
@keyframes trTele{0%{opacity:0;background:#c0261f}25%{opacity:.9;background:#c0261f}55%{opacity:.5;background:#2a0806}100%{opacity:0;background:#000}}
@media (prefers-reduced-motion:reduce){#transition{animation:none!important}
  /* reduced motion: no iris/blur — the drawing simply appears (REQ-RENDER-0003) */
  #art.arriving{animation:none!important;clip-path:none!important}}

/* the reveal cycle: spotlight opens to bare the whole drawing while the text fades out */
@property --light-r{syntax:"<length>";inherits:true;initial-value:190px}
html{transition:--light-r 1.3s ease}
#scroll,#exits,#hud,#art-cap{transition:opacity .8s ease}
/* DEF-0122: the transcript (#scroll) stays readable through the art reveal — freshly-printed
   narration must not be hidden and then blink on. Only the exits/hud/caption fade. */
body.reveal-art #exits,body.reveal-art #hud,body.reveal-art #art-cap{opacity:0}

/* HUD */
#hud{position:absolute;top:0;left:0;right:0;padding:18px 22px;z-index:5;pointer-events:none;
  font-family:'Poppins',system-ui,sans-serif;letter-spacing:.26em;font-size:12.5px;color:#9a9384;text-transform:uppercase;text-shadow:0 2px 10px #000}
#turns{color:#4f4a40;margin-left:14px;font-size:11px;letter-spacing:.1em}
#art-cap{position:absolute;top:44px;left:22px;z-index:5;font-style:italic;color:#e6dfce;font-size:12.5px;text-shadow:0 2px 10px #000,0 0 4px #000;pointer-events:none}
/* REQ-ARCH-0007: other players present ("X is in the room with you") — a warm,
   atmospheric line under the caption; stays legible even during the art reveal. */
#mp-presence{position:absolute;top:66px;left:22px;z-index:6;font-family:'Poppins',system-ui,sans-serif;
  font-size:12.5px;font-style:italic;letter-spacing:.02em;color:#e0a94a;
  text-shadow:0 2px 12px #000,0 0 6px #000;pointer-events:none}
#mp-presence[hidden]{display:none}

/* REQ-CHAT-0005: the floating image-description + "I'm Interested" card is DROPPED —
   the drawing's info and the interested action now live in the LIGHTBOX (click the
   drawing, REQ-COMMERCE-0007/0008). Keeps the left display area simple. */
#art-card{display:none!important}
#art-card-name{color:var(--ink);font-size:13.5px;font-weight:600;letter-spacing:.04em;
  display:flex;align-items:center;gap:7px;line-height:1.35}
#art-card-dot{width:9px;height:9px;border-radius:50%;background:var(--blood);flex:none;
  box-shadow:0 0 8px rgba(192,38,31,.85)}
#art-card-meta{color:#cfc8b6;font-size:11.5px;letter-spacing:.03em;margin-top:4px}
/* per-drawing commentary note (REQ-COMMENTARY) — readable italic, high-contrast */
#art-card-note{color:#e6dfce;font-size:12px;line-height:1.45;font-style:italic;margin-top:8px;
  padding-top:8px;border-top:1px solid #34302a}
#art-card-note[hidden]{display:none}
/* debug: the drawing's keyword list, below the image info (REQ-DEMO) */
#art-card-keywords{color:var(--dbg,#4da6ff);font:600 11px/1.5 Poppins,system-ui;
  letter-spacing:.03em;margin-top:8px;padding-top:8px;border-top:1px solid #27435f}
#art-card-keywords[hidden]{display:none}
#art-card-room{color:var(--dbg,#4da6ff);font:700 12px/1.4 Poppins,system-ui;
  letter-spacing:.04em;margin-top:8px}
#art-card-room[hidden]{display:none}
#art-card-likes{color:#e0a94a;font:600 11.5px/1.4 Poppins,system-ui;letter-spacing:.03em;margin-top:6px}
#art-card-likes[hidden]{display:none}
#art-card-btn{margin-top:10px;background:transparent;border:1px solid var(--lime);color:var(--lime);
  font-family:'Poppins',system-ui,sans-serif;font-size:11.5px;letter-spacing:.05em;
  padding:6px 12px;border-radius:2px;transition:.2s}
#art-card-btn:hover{background:var(--lime);color:#05130a}
#art-card-btn.on{border-color:#6a6454;color:#9a9384}

/* click-to-enlarge lightbox (REQ-COMMERCE-0007): full-screen dark backdrop, the
   drawing shown large and centered with its registered info; above all game UI */
#lightbox{position:fixed;inset:0;z-index:80;display:flex;align-items:center;justify-content:center;
  padding:clamp(18px,5vh,56px);background:rgba(4,5,8,.9);backdrop-filter:blur(4px);
  opacity:0;transition:opacity .25s ease;cursor:zoom-out}
#lightbox[hidden]{display:none}
#lightbox.show{opacity:1}
#lightbox-panel{position:relative;display:flex;flex-direction:column;gap:14px;align-items:center;
  max-width:min(1100px,94vw);max-height:90vh;cursor:auto}
#lightbox-img{max-width:100%;max-height:70vh;object-fit:contain;border:1px solid #2c2a24;border-radius:4px;
  box-shadow:0 0 60px rgba(0,0,0,.7),0 0 0 1px rgba(157,255,32,.12)}
#lightbox-info{max-width:min(760px,92vw);text-align:center;font-family:'Poppins',system-ui,sans-serif}
#lightbox-title{color:var(--lime);font-size:clamp(16px,2.6vw,22px);font-weight:700;letter-spacing:.04em}
#lightbox-meta{color:var(--ink);font-size:13px;letter-spacing:.03em;margin-top:6px}
#lightbox-meta[hidden]{display:none}
#lightbox-note{color:#e6dfce;font-size:13.5px;line-height:1.5;font-style:italic;margin-top:10px;
  padding-top:10px;border-top:1px solid #34302a}
#lightbox-note[hidden]{display:none}
#lightbox-close{position:absolute;top:-14px;right:-14px;z-index:2;width:34px;height:34px;border-radius:50%;
  background:#12161c;border:1px solid var(--lime);color:var(--lime);font-size:15px;line-height:1;cursor:pointer;
  display:flex;align-items:center;justify-content:center;transition:.2s}
#lightbox-close:hover{background:var(--lime);color:#05130a;box-shadow:0 0 22px rgba(157,255,32,.5)}
@media (max-width:560px){#lightbox-close{top:6px;right:6px}}

/* narration scrollback — a phone text-message transcript (REQ-CHAT-0001/2/3):
   each message is a .row = tiny speaker avatar + a .bubble carrying the text.
   The message class still lands on the bubble, so the color rules below keep
   working; DEF-0119 stays honoured — the whole column is LEFT-aligned in the
   reading gutter, only the player's own (echo) rows swing to the right. */
/* DEF-0120: a LEFT-docked panel, at most ~25% of the screen to start; drag the right edge
   (resize handle) to widen/narrow it. */
/* DEF-0123: a LEFT-docked, narrow column spanning (near) full screen HEIGHT so the
   whole history scrolls into view. Drag the right edge (resize:horizontal) to widen. */
#scroll{position:absolute;left:clamp(14px,4vw,60px);top:54px;bottom:118px;z-index:4;
  width:min(440px,32vw);max-width:calc(100vw - 30px);overflow:auto;resize:horizontal;
  padding:0 2px 0 0;display:flex;flex-direction:column;gap:.55em;align-items:stretch;
  -webkit-mask-image:linear-gradient(#0000,#000 30px);mask-image:linear-gradient(#0000,#000 30px)}
/* DEF-0130: newest message sits at the BOTTOM, older ones scroll up. margin-top:auto on the
   first row anchors the stack to the bottom when short, yet lets it OVERFLOW & scroll up when
   tall (unlike justify-content:flex-end, which caps scrollHeight and traps old messages). */
#scroll .row:first-child{margin-top:auto}
/* a chat row: a speaker LABEL over the bubble (REQ-CHAT-0001 revised — text labels, no icons).
   Narrator/cast/system sit LEFT; the player (echo, incl. AUTO-PLAY commands) sits RIGHT. */
#scroll .row{display:flex;flex-direction:column;gap:2px;max-width:100%}
#scroll .row-left{align-items:flex-start}
#scroll .row-right{align-items:flex-end}   /* player's own side */
#scroll .sender{font:700 12px/1 'Poppins',system-ui,sans-serif;letter-spacing:.07em;text-transform:uppercase;
  color:#c4ccd4;padding:0 .5em;text-shadow:0 1px 6px #000}
#scroll .speaker-player .sender,#scroll .speaker-oracle .sender{color:var(--lime)}
/* tiny (~24px) self-contained design-asset avatars — no external images */
#scroll .avatar{flex:0 0 auto;width:32px;height:32px;border-radius:50%;display:flex;
  align-items:center;justify-content:center;font-family:'Poppins',system-ui,sans-serif;
  font-weight:700;font-size:10.5px;letter-spacing:.02em;line-height:1;user-select:none;
  box-shadow:0 1px 5px #000,0 0 0 1px #0008}
#scroll .av-oracle{background:var(--lime);color:#08120a}                 /* lime REX monogram */
#scroll .av-player{background:#0b1005;color:var(--lime);border:1.5px solid var(--lime);font-size:15px;font-weight:400}
#scroll .av-cast{background:#20242c;color:#c9d98a}                        /* placeholder silhouette */
#scroll .av-system{background:#181818;color:#b7ada0}                      /* subtle gear */
/* the message bubble: a translucent dark panel so it reads as chat yet stays
   legible over the art; text colours per message class are set further down. */
/* DEF-0126/0127: transcript bubbles use the standard Poppins font (Oracle + System).
   DEF-0128: lighter bubble background so the Oracle/left bubbles are clearly visible. */
#scroll .bubble{max-width:60ch;line-height:var(--rex-msg-line-height,1.5);font-size:var(--rex-msg-font-size,13px);font-family:'Poppins',system-ui,sans-serif;
  text-shadow:0 2px 16px #000,0 0 30px #000;
  padding:.5em .8em;border-radius:13px;background:#20242cE0;border:1px solid #ffffff22;
  backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}
/* REQ-CHAT-0006: the drawing IMAGE BLOCK — thumbnail (left) + title / date·source / anecdote */
#scroll .imgblock{display:flex;gap:12px;align-items:flex-start}
/* DEF-0135: NATURAL-aspect thumbnail capped at 50px (was a forced 75x75 object-fit:cover
   square). Let the intrinsic ratio show; CSS sizes it, so no width/height attrs are set. */
#scroll .imgblock-thumb{flex:0 0 auto;max-width:50px;max-height:50px;width:auto;height:auto;border-radius:4px;
  border:1px solid rgba(157,255,32,.4);background:#000}
#scroll .imgblock[data-clickable]{cursor:pointer}   /* REQ-CHAT-0007: a chat image opens its own lightbox */
#scroll .imgblock-text{min-width:0;display:flex;flex-direction:column;gap:2px;text-shadow:0 2px 12px #000}
#scroll .imgblock-title{color:var(--lime);font-weight:700;font-size:16px;letter-spacing:.02em}
#scroll .imgblock-meta{color:#c3bbac;font-size:12.5px;letter-spacing:.02em}
#scroll .imgblock-note{color:#e8e4d8;font-size:14px;font-style:italic;margin-top:3px}
/* REQ-CHAT-0008/0009/0010: a VIDEO block in the log — thumbnail with a ▶ PLAY overlay,
   opens in the GENERAL video window (#peep) on click. Mirrors the image block layout. */
#scroll .vidblock{display:flex;gap:12px;align-items:flex-start;cursor:pointer}
#scroll .vidblock-thumbwrap{flex:0 0 auto;position:relative;width:64px;height:48px;border-radius:4px;
  overflow:hidden;border:1px solid rgba(157,255,32,.4);background:#000;display:flex;align-items:center;justify-content:center}
#scroll .vidblock-thumb{max-width:100%;max-height:100%;width:auto;height:auto;display:block}
#scroll .vidblock-play{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  color:#fff;font-size:20px;text-shadow:0 0 8px #000;background:rgba(0,0,0,.28)}
#scroll .vidblock-play::before{content:"▶"}
#scroll .vidblock:hover .vidblock-play{color:var(--lime);background:rgba(0,0,0,.12)}
#scroll .vidblock-text{min-width:0;display:flex;flex-direction:column;gap:2px;text-shadow:0 2px 12px #000}
#scroll .vidblock-title{color:var(--lime);font-weight:700;font-size:15px;letter-spacing:.02em}
#scroll .vidblock-note{color:#e8e4d8;font-size:13px;font-style:italic;margin-top:2px}
#scroll .row-left  .bubble{border-bottom-left-radius:4px}
#scroll .row-right .bubble{border-bottom-right-radius:4px;background:#12200acc;border-color:#9dff2033;text-align:left}
#scroll .room{color:#e8e4d8}
#scroll .obj{color:#cbb88a;font-style:italic}
#scroll .cast{color:#c9d98a}#scroll .cast::first-line{color:var(--lime)}
#scroll .sys{color:#c3bbac}
#scroll .dark{color:#a8635c}
#scroll .echo{color:var(--lime);letter-spacing:.02em}
#scroll .hint,#scroll .line.hint{color:#a49d8a;font-style:italic}

/* exits */
/* DEF-0119: direction buttons sit below the log, LEFT-aligned to the reading column */
#exits{position:absolute;left:0;right:0;bottom:64px;z-index:6;display:flex;gap:9px;justify-content:flex-start;flex-wrap:wrap;padding:0 clamp(18px,6vw,90px)}
/* DEF-0117: direction shortcuts are visible, design-system chips (REX lime + Poppins,
   hover fill) — not the old invisible dark-grey-on-black. */
.exit{background:rgba(157,255,32,.06);border:1px solid var(--lime);color:var(--lime);padding:7px 15px;font-size:12.5px;
  font-family:'Poppins',system-ui,sans-serif;letter-spacing:.04em;border-radius:2px;cursor:pointer;transition:.22s;
  text-shadow:0 2px 10px #000}
.exit:hover{background:var(--lime);color:#05130a;box-shadow:0 0 18px rgba(157,255,32,.45)}

/* command prompt */
/* DEF-0118/0119: a CONTAINED command bar, LEFT-aligned to the reading column below the log. */
#prompt-row{position:absolute;left:clamp(18px,6vw,90px);bottom:14px;width:min(620px,72vw);z-index:7;
  display:flex;align-items:center;gap:10px;padding:0}
.caret{color:var(--lime);font-family:'Poppins',sans-serif;font-size:18px}
#cmd{flex:1;background:rgba(12,13,18,.72);border:1px solid rgba(157,255,32,.42);border-radius:3px;color:var(--ink);
  font-family:'Poppins',system-ui,sans-serif;font-size:15px;padding:11px 14px;outline:none;backdrop-filter:blur(3px)}
#cmd:focus{border-color:var(--lime);box-shadow:0 0 20px rgba(157,255,32,.2)}
#cmd::placeholder{color:rgba(157,255,32,.58)}   /* DEF-0117: visible on-theme placeholder (was invisible #4f4a40) */
/* REQ-MESSAGE-0020: clickable → send button, so the type-and-send semantics are obvious */
#cmd-send{flex:0 0 auto;width:44px;height:44px;display:grid;place-items:center;
  background:rgba(157,255,32,.08);border:1px solid var(--lime);color:var(--lime);border-radius:3px;
  font-size:20px;line-height:1;cursor:pointer;transition:.22s}
#cmd-send:hover{background:var(--lime);color:#05130a;box-shadow:0 0 18px rgba(157,255,32,.45)}

/* controls */
/* REQ-MESSAGE-0012: circle controls locked to the upper-right corner, fixed so they never scroll off */
#controls{position:fixed;top:14px;right:16px;z-index:8;display:flex;gap:6px}
#controls button{width:34px;height:34px;border-radius:50%;font-size:14px;background:rgba(20,20,26,.5);
  border:1px solid #2c2a24;color:#9a9384;display:grid;place-items:center;transition:.2s;backdrop-filter:blur(3px)}
#controls button:hover{color:var(--ink);border-color:#6a6454}
#controls button.off{color:#5d3a37;border-color:#3a1f1c}
/* master-volume slider (REQ-AUDIO-0007) — sits inline with the round buttons */
#c-vol{-webkit-appearance:none;appearance:none;width:70px;height:4px;align-self:center;
  background:#2c2a24;border-radius:3px;outline:none;cursor:pointer}
#c-vol::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:12px;height:12px;
  border-radius:50%;background:var(--lime);box-shadow:0 0 8px rgba(157,255,32,.5);cursor:pointer}
#c-vol::-moz-range-thumb{width:12px;height:12px;border:none;border-radius:50%;
  background:var(--lime);box-shadow:0 0 8px rgba(157,255,32,.5);cursor:pointer}
#c-vol::-moz-range-track{height:4px;background:#2c2a24;border-radius:3px}
/* REQ-DEMO-0015/0017: image-hold + red-circle-drift circle controls, each with a
   vertical slider that pops below it. REQ-DEMO-0018: debug controls are BLUE. */
:root{--dbg:#4da6ff}
#c-dur-wrap,#c-drift-wrap{position:relative;display:inline-grid;place-items:center}
/* blue debug controls (toggle + image-hold + drift), distinct from the play controls */
#controls button.dbg{color:var(--dbg);border-color:#27435f}
#controls button.dbg:hover{color:#8fc9ff;border-color:var(--dbg)}
#controls button.dbg.on{color:var(--dbg);border-color:var(--dbg);box-shadow:0 0 9px rgba(77,166,255,.45)}
.ctl-pop{position:absolute;top:40px;left:50%;transform:translateX(-50%);z-index:9;
  display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px 10px 10px;
  background:rgba(16,16,22,.94);border:1px solid #27435f;border-radius:10px;backdrop-filter:blur(4px);
  box-shadow:0 6px 20px rgba(0,0,0,.5)}
.ctl-pop[hidden]{display:none}
#c-dur,#c-driftv{-webkit-appearance:none;appearance:none;width:6px;height:120px;background:#2c2a24;
  border-radius:3px;outline:none;cursor:pointer;writing-mode:vertical-lr;direction:rtl}
#c-dur::-webkit-slider-thumb,#c-driftv::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;
  width:15px;height:15px;border-radius:50%;background:var(--dbg);box-shadow:0 0 8px rgba(77,166,255,.5);cursor:pointer}
#c-dur::-moz-range-thumb,#c-driftv::-moz-range-thumb{width:15px;height:15px;border:none;border-radius:50%;
  background:var(--dbg);box-shadow:0 0 8px rgba(77,166,255,.5);cursor:pointer}
#c-dur::-moz-range-track,#c-driftv::-moz-range-track{width:6px;background:#2c2a24;border-radius:3px}
#dur-val,#drift-val{font:600 12px/1 Poppins,system-ui;color:var(--dbg);min-width:3ch;text-align:center}
/* REQ-DEMO-0016/0017: debug log lines in the message list, blue and high-contrast */
.line.debug{color:var(--dbg);font:600 12px/1.5 ui-monospace,monospace;opacity:.95}

/* DEF-0116: controls legend + settings — gear opener (top-right, left of ◱ MAP)
   and the dark, lime-accented panel it opens. Above the map button (z30) at z40+. */
#c-settings{position:fixed;top:12px;right:86px;z-index:40;background:#12161c;color:var(--lime);
  border:1px solid #333a44;border-radius:8px;padding:6px 11px;font:700 14px/1 'IBM Plex Sans',system-ui,sans-serif;
  cursor:pointer;transition:.2s}
#c-settings:hover{border-color:var(--lime);box-shadow:0 0 9px rgba(157,255,32,.35)}
#settings-panel{position:fixed;top:52px;right:12px;z-index:41;width:min(320px,92vw);max-height:min(70vh,560px);
  overflow-y:auto;background:#0c0d12;border:1px solid #2c2a24;border-radius:10px;padding:8px 10px 12px;
  box-shadow:0 24px 70px rgba(0,0,0,.75);backdrop-filter:blur(4px);
  font-family:system-ui,sans-serif;color:#e8e4d8}
#settings-panel[hidden]{display:none}
#settings-head{display:flex;align-items:center;justify-content:space-between;
  padding:4px 4px 8px;border-bottom:1px solid #23211b;margin-bottom:6px}
#settings-title{font-family:'Poppins',system-ui,sans-serif;font-weight:600;color:var(--lime);
  letter-spacing:.08em;font-size:14px}
#settings-close{width:26px;height:26px;border-radius:50%;background:rgba(20,20,26,.5);border:1px solid #2c2a24;
  color:#cfc8ba;font-size:16px;line-height:1;cursor:pointer;display:grid;place-items:center;transition:.2s}
#settings-close:hover{color:var(--lime);border-color:var(--lime)}
.set-row{display:grid;grid-template-columns:26px 1fr auto;align-items:center;gap:10px;
  padding:8px 4px;border-bottom:1px solid #1a1914}
.set-row:last-child{border-bottom:none}
.set-icon{font-size:16px;text-align:center;color:#e8e4d8}
.set-row.dbg .set-icon,.set-row.dbg .set-name{color:var(--dbg)}
.set-name{font-family:'Poppins',system-ui,sans-serif;font-weight:600;font-size:13px;color:#f0ece1}
.set-desc{font-size:11.5px;color:#a49c8c;line-height:1.35;margin-top:1px}
/* toggle switch — lime when ON, high-contrast track when OFF (never grey-on-black text) */
.set-toggle{position:relative;width:40px;height:22px;border-radius:11px;background:#2c2a24;border:1px solid #3a382f;
  cursor:pointer;transition:.2s;flex:0 0 auto;padding:0}
.set-toggle::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;
  background:#cfc8ba;transition:.2s}
.set-toggle[aria-checked="true"]{background:var(--lime);border-color:var(--lime)}
.set-toggle[aria-checked="true"]::after{left:20px;background:#0c0d12}
.set-toggle.dbg[aria-checked="true"]{background:var(--dbg);border-color:var(--dbg)}
#settings-note{margin:10px 4px 0;font-size:11px;line-height:1.4;color:#8f8877}

/* info panel */
#info-panel{position:absolute;inset:0;margin:auto;width:min(90vw,520px);height:max-content;z-index:30;
  background:#0c0d12;border:1px solid #2c2a24;border-radius:6px;padding:24px 26px;color:#b7ada0;
  font-family:system-ui,sans-serif;font-size:14px;line-height:1.6;box-shadow:0 30px 90px #000}
#info-panel h3{font-family:'Poppins',sans-serif;color:var(--lime);margin:0 0 12px;letter-spacing:.1em}
#info-panel .mini{font-size:12.5px;color:#8a8474}
#info-panel .disc{border-top:1px solid #23211b;padding-top:12px;margin-top:14px}
#info-close{margin-top:14px;background:transparent;border:1px solid #3a382f;color:#9a9384;padding:8px 18px;border-radius:2px}
#info-close:hover{border-color:#6a6454;color:var(--ink)}

@media (prefers-reduced-motion:reduce){.bulb::after,#grain{animation:none}#art{transition-duration:.2s}}

/* ══ 8mm peep-hole room ══════════════════════════════════════════════════
   Your eye to a hole bored in the plywood: a circular aperture of silent
   film in a field of black, the rest of the world shut out. */
#peep{position:fixed;inset:0;z-index:60;background:#000;
  display:flex;align-items:center;justify-content:center;
  opacity:0;transition:opacity .22s ease;pointer-events:none}   /* black field snaps in; the circle then dilates */
#peep.open,#peep.closing{opacity:1}
#peep.open{pointer-events:auto}
#peep-vid{width:74vmin;height:74vmin;object-fit:cover;border-radius:50%;
  /* feather the circle's edge into the dark — an eye pressed to a hole */
  -webkit-mask:radial-gradient(circle at 50% 50%,#000 60%,rgba(0,0,0,.5) 78%,transparent 92%);
          mask:radial-gradient(circle at 50% 50%,#000 60%,rgba(0,0,0,.5) 78%,transparent 92%);
  filter:contrast(1.12) brightness(.92) sepia(.28) saturate(.8);   /* aged film cast */
  transform:scale(1.01);
  /* REQ-FILM-0007: the peepshow aperture dilates open over the running video */
  clip-path:circle(0% at 50% 50%)}
#peep.open #peep-vid{animation:peepDilate 1s cubic-bezier(.18,.7,.15,1) forwards}
#peep.closing #peep-vid{animation:peepIris .5s ease forwards}
@keyframes peepDilate{0%{clip-path:circle(0% at 50% 50%)}100%{clip-path:circle(75% at 50% 50%)}}
@keyframes peepIris{0%{clip-path:circle(75% at 50% 50%)}100%{clip-path:circle(0% at 50% 50%)}}
/* projector flicker + a breathing vignette ring around the aperture */
#peep-flicker{position:absolute;width:78vmin;height:78vmin;border-radius:50%;
  box-shadow:0 0 22vmin 10vmin #000 inset, 0 0 0 100vmax #000;
  pointer-events:none;animation:peepFlick .09s steps(2) infinite}
@keyframes peepFlick{0%{opacity:.34}50%{opacity:.44}100%{opacity:.38}}
#peep-close{position:absolute;top:18px;right:18px;z-index:2;
  background:transparent;border:1px solid #3a382f;color:#9a9384;
  width:38px;height:38px;border-radius:50%;font-size:15px;cursor:pointer}
#peep-close:hover{border-color:#c0261f;color:#e7e2d6}
/* reward film: fullscreen payoff at the winning walk's victory */
#reward{position:fixed;inset:0;z-index:70;background:#000;
  display:flex;align-items:center;justify-content:center;
  opacity:0;transition:opacity .6s ease;pointer-events:none}
#reward.open{opacity:1;pointer-events:auto}
#reward-vid{max-width:100vw;max-height:100vh;width:auto;height:auto;object-fit:contain;
  filter:contrast(1.05) saturate(.96)}
#reward-close{position:absolute;top:18px;right:18px;z-index:2;
  background:transparent;border:1px solid #3a382f;color:#9a9384;
  width:38px;height:38px;border-radius:50%;font-size:15px;cursor:pointer}
#reward-close:hover{border-color:#c0261f;color:#e7e2d6}
/* the hint that a hole is here, shown only in the film room */
#peep-hint,#resume-hint{color:#c9a24b;cursor:pointer;text-decoration:underline dotted;
  text-underline-offset:3px}
#peep-hint:hover,#resume-hint:hover{color:#e7c777}
/* the running score can grow long — let the HUD wrap gracefully on narrow screens */
#turns{white-space:normal}
@media (prefers-reduced-motion:reduce){#peep-flicker{animation:none;opacity:.4}
  #peep.open #peep-vid,#peep.closing #peep-vid{animation:none;clip-path:circle(75% at 50% 50%)}}
/* DEF-0138: inserted "action" videos play full-frame with the SAME red colour
   treatment as their attached corner (.face) version — the clips are black-and-white,
   so the red multiply (#c0261f) is their intended look. Drops the peep's aged/sepia
   cast, circular mask/clip and projector flicker; keeps the clean red. */
#peep.action #peep-vid{width:auto;height:auto;max-width:94vw;max-height:90vh;
  object-fit:contain;border-radius:0;-webkit-mask:none;mask:none;
  filter:brightness(1.08) contrast(1.06);transform:none;clip-path:none}
#peep.action.open #peep-vid,#peep.action.closing #peep-vid{animation:none;clip-path:none}
#peep.action #peep-flicker{display:none}
#peep.action::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:#c0261f;mix-blend-mode:multiply;z-index:1}   /* matches .face::after */

/* ══ VISUAL-EFFECTS LAYER (REQ-FX-0001) ════════════════════════════════════
   Shared full-screen layer above everything (reward is z70; we sit at z80). The
   layer itself is inert; each effect overlay inside it turns on with `.run`. All
   display-only, non-interactive (pointer-events:none) so the turn loop underneath
   is never blocked. */
#fx-layer{position:fixed;inset:0;z-index:80;pointer-events:none}
.fx-overlay{position:absolute;inset:0;opacity:0;pointer-events:none;overflow:hidden}
.fx-overlay.run{opacity:1}
/* DEF-0059: placeholder-effect stub card — transparent (game shows through), high-contrast */
#fx-placeholder{display:grid;place-items:center;transition:opacity .3s ease}
#fx-placeholder .fxph-card{text-align:center;padding:24px 34px;border-radius:14px;
  background:rgba(10,8,10,.62);backdrop-filter:blur(3px);
  border:1px solid hsl(var(--fxph-hue,300) 80% 55% / .8);
  box-shadow:0 0 40px hsl(var(--fxph-hue,300) 85% 55% / .45)}
#fx-placeholder.run .fxph-card{animation:fxphPulse .5s ease}
#fx-placeholder .fxph-name{font:800 34px/1 Poppins,system-ui;letter-spacing:.02em;
  color:hsl(var(--fxph-hue,300) 90% 72%);text-shadow:0 2px 14px rgba(0,0,0,.7)}
#fx-placeholder .fxph-sub{margin-top:8px;font:600 13px/1.3 Poppins,system-ui;
  letter-spacing:.06em;text-transform:uppercase;color:#e6dfce}
@keyframes fxphPulse{from{transform:scale(.82);opacity:.2}to{transform:scale(1);opacity:1}}
@media (prefers-reduced-motion:reduce){#fx-placeholder.run .fxph-card{animation:none}}

/* ── POPPERS! (REQ-SURPRISE-0002) ─────────────────────────────────────────
   1) white strobe, 2) fading multicolour off-centre rotating circles,
   3) gigantic gradient "Poppers!" worm travelling lower-right → upper-left.
   The per-fire total duration comes in as --pop-ms (default 15s). */
/* ITC Candice Pro — self-hosted subset for the Poppers word (build_candice_font.py).
   LICENSING: ITC commercial font; enclosed personal build only — a public/shipped
   release needs a proper web-font licence. */
@font-face{font-family:'Candice Pro';font-style:normal;font-weight:400;font-display:swap;
  src:url("media/fonts/candice-pro.woff2") format("woff2")}

/* DEF-0060: transparent so the game shows THROUGH the effect (the opaque backdrop,
   when an effect is configured transparent:false, is painted on #fx-layer by the
   registry's _setBackdrop — NOT baked into the effect div). */
#fx-poppers{background:transparent;--pop-ms:15000ms}
#fx-poppers.run{animation:popShell var(--pop-ms) ease forwards}
@keyframes popShell{0%{opacity:0}5%{opacity:1}88%{opacity:1}100%{opacity:0}}

/* (1) white strobe over the first ~1.2s */
#fx-poppers .pop-strobe{position:absolute;inset:0;background:#fff;opacity:0}
#fx-poppers.run .pop-strobe{animation:popStrobe 1.2s steps(1) forwards}
@keyframes popStrobe{
  0%,20%,40%{opacity:1}10%,30%,55%{opacity:0}100%{opacity:0}}

/* (2) the orbiting translucent circle-groups bloom AND (3) the 20-step diagonal
   Candice-Pro "Poppers!" word extrusion are BOTH drawn on this canvas — see
   engine/effects/poppers.js (exact reference: docs/reference/poppers-circles-reference.html).
   Params: 6 circles/6 colours/6 groups, nest 77%, offset 11%, radius 87 fit,
   hard-light blend; groups fade outermost->innermost over ~15s. */
#fx-poppers .pop-canvas{position:absolute;inset:0;width:100%;height:100%}

/* ── MOLLY ROLL (REQ-SURPRISE-0003) ───────────────────────────────────────
   The screen fades to a drifting canvas point-network; fades out after ~15s. */
#fx-molly{background:transparent;--molly-ms:15000ms}   /* DEF-0060: game shows through (backdrop via #fx-layer) */
#fx-molly.run{animation:mollyShell var(--molly-ms) ease forwards}
@keyframes mollyShell{0%{opacity:0}12%{opacity:1}86%{opacity:1}100%{opacity:0}}
#fx-molly .molly-canvas{position:absolute;inset:0;width:100%;height:100%}

/* honour reduced-motion: keep the overlays but drop the churning animations */
@media (prefers-reduced-motion:reduce){
  /* the Poppers/Molly interstitials are brief and canvas-drawn; nothing to disable here. */
}

/* ══ MESSAGE-PRIMARY SPRINT (REQ-MESSAGE-0010..0016) ═══════════════════════
   The scrolling message buffer is the primary, default surface. Images are
   inserted INLINE in the transcript instead of a separate #art pane; the map
   is an optional second pane (off by default). */

/* 0010: no separate/dedicated image pane — the room drawing goes inline in the buffer */
body.msg-primary #art{display:none!important}
body.msg-primary #art-cap{display:none!important}

/* 0010: the message buffer is the primary column — centred and wide, filling the page.
   0018: the scroll column and the command input share the SAME width + centre, so the
   scroll area sits exactly on top of the input. */
body.msg-primary #scroll{
  left:50%;transform:translateX(-50%);right:auto;
  width:min(760px,94vw);max-width:none}
body.msg-primary #prompt-row{
  left:50%;transform:translateX(-50%);right:auto;
  width:min(760px,94vw);max-width:none}
/* 0020: the move (exit) buttons sit directly ON TOP of the input, aligned to the same column */
body.msg-primary #exits{
  left:50%;transform:translateX(-50%);right:auto;
  width:min(760px,94vw);max-width:none;padding:0;bottom:70px;justify-content:flex-start}

/* 0010/0014/0015: an INLINE drawing row in the transcript (Oracle side) */
#scroll .row .inline-art{padding:0;background:none;border:none}
.inline-art-img{display:block;max-width:100%;height:auto;border-radius:9px;
  box-shadow:0 6px 26px rgba(0,0,0,.5);background:#0a0c0f}
.inline-art-cap{margin-top:4px;font-size:12px;color:#c9d2dc;opacity:.85}

/* 0014: while its announce speech plays, the image is LOCKED in place (sticky at the
   top of the buffer) while later text prints below; released when speech ends so it
   scrolls up normally. 0015: capped to 50% of the buffer height (set in JS). */
#scroll .row.art-locked{position:sticky;top:6px;z-index:6;
  background:linear-gradient(#0b0d10 82%,rgba(11,13,16,0));padding-bottom:8px}

/* 0016: MOBILE — the locked image is (near) full-screen with the text beneath it;
   the JS height cap uses ~92% of the buffer on mobile instead of 50%. */
body.art-locked-mobile #scroll .row.art-locked{top:0;background:#0b0d10}
body.art-locked-mobile #scroll .row.art-locked .inline-art-cap{position:absolute;left:8px;bottom:6px;
  background:rgba(0,0,0,.5);padding:2px 7px;border-radius:6px}

/* ══ MAP EXPOSURE (REQ-MESSAGE-0021) ═══════════════════════════════════════
   Desktop: an exposed map is a 50/50 split — map on the right half, the message
   list (scroll + exits + input) confined to the left half. Mobile: the map
   SUPERIMPOSES over the message area (full width) for its 6-second peek. */
body.map-open #ms-proj{-webkit-mask-image:none;mask-image:none;pointer-events:auto}

/* Desktop 50/50: confine the message column to the left half, kept mutually aligned */
@media (min-width:641px){
  body.msg-primary.map-open #scroll,
  body.msg-primary.map-open #exits,
  body.msg-primary.map-open #prompt-row{
    left:0;right:auto;transform:none;width:50vw;max-width:none;
    padding-left:clamp(14px,3vw,40px);padding-right:18px}
}

/* Mobile: the map is drawn OVER the message area, full width, for the 6s peek */
@media (max-width:640px){
  body.map-open #ms-proj{left:0;right:0;width:100vw;max-width:none;z-index:12}
}
