/* Stage 1–2: living world + characters. Loaded after styles.css and overrides it. */

/* ───────── sharp, layered backgrounds (no blur echo, no heavy darkening) */
.bg { inset: -3%; filter: brightness(.8) saturate(1.06) contrast(1.06); transition: opacity 1.8s ease, filter 2.5s ease; }
.bg.on { animation: drift-cam 70s ease-in-out infinite alternate; }
.bg-echo { display: none; }
@keyframes drift-cam { from { transform: scale(1.03); } to { transform: scale(1.09) translate(-1.2%, -.8%); } }
#stage[data-mood="void"] .bg { filter: brightness(.35); }
#stage[data-mood="null"] .bg { filter: brightness(.5) saturate(.55) hue-rotate(10deg); }
#stage[data-mood="candle"] .bg { filter: brightness(.62) saturate(1.05) sepia(.1); }
#stage[data-mood="gold"] .bg { filter: brightness(.78) saturate(1.12); }
#stage[data-mood="mischief"] .bg { filter: brightness(.72) saturate(1.1); }
#stage[data-mood="alarm"] .bg { filter: brightness(.74) saturate(1.05); }
#stage.dim .bg { filter: brightness(.42) saturate(.9); }
#stage.null-near .bg { filter: brightness(.38) saturate(.35) !important; transition: filter 4s ease; }
#vignette { box-shadow: inset 0 0 16vmin rgba(0,0,0,.85), inset 0 0 40vmin rgba(0,0,0,.35); }
#stage.alarm-pulse #vignette { animation: alarm 2.4s ease-in-out infinite; }
@keyframes alarm { 0%,100% { box-shadow: inset 0 0 16vmin rgba(0,0,0,.85), inset 0 0 40vmin rgba(150,30,20,.15); } 50% { box-shadow: inset 0 0 16vmin rgba(0,0,0,.85), inset 0 0 40vmin rgba(190,40,20,.4); } }
#fog { opacity: .35; }

/* light shafts + slow illumination breathing, tinted by realm */
#stage::before { content: ""; position: absolute; inset: -10% 0 0; pointer-events: none; z-index: 1; opacity: .5; will-change: transform, opacity;
  background: linear-gradient(105deg, transparent 18%, var(--shaft, rgba(255,220,150,.10)) 24%, transparent 31%),
              linear-gradient(98deg, transparent 52%, var(--shaft, rgba(255,220,150,.08)) 57%, transparent 63%),
              linear-gradient(112deg, transparent 72%, var(--shaft, rgba(255,220,150,.06)) 76%, transparent 82%);
  animation: shafts 22s ease-in-out infinite alternate; }
@keyframes shafts { from { transform: translateX(-2%) skewX(-2deg); opacity: .35; } to { transform: translateX(2%) skewX(2deg); opacity: .6; } }
#stage[data-realm="spire"] { --shaft: rgba(160,220,255,.09); }
#stage[data-realm="abyss"] { --shaft: rgba(255,180,90,.12); }
#stage[data-realm="observatory"] { --shaft: rgba(200,190,255,.08); }
#stage[data-realm="null"]::before, #stage[data-realm="void"]::before { opacity: 0; }
#stage.respond::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2; background: linear-gradient(100deg, transparent 30%, rgba(255,230,170,.14) 48%, transparent 66%); animation: sweep 2.8s ease-out forwards; }
@keyframes sweep { from { transform: translateX(-70%); } to { transform: translateX(70%); opacity: 0; } }

.rings { inset: -20% -10%; opacity: .55; pointer-events: none; }
.rings svg { width: 100%; height: 100%; }
#stage[data-realm="null"] .rings, #stage[data-realm="void"] .rings { opacity: .15; }

/* ───────── clock: hands turn about the true centre (SVG), nothing slides */
.clock .r1, .clock .r2, .clock .r3, .clock .hand-m, .clock .hand-h { animation: none; }
.clock.fractured .half-a, .clock.fractured .half-b { transform: none; }
.clock.fractured svg { filter: drop-shadow(0 0 12px rgba(243,207,122,.35)) drop-shadow(0 0 30px rgba(255,255,255,.2)); }
#voiceSigil { position: absolute; left: 50%; top: 8vh; width: 22vmin; aspect-ratio: 1; translate: -50% 0; opacity: 0; transition: opacity 2s, filter .8s; z-index: 2; }
#voiceSigil.show { opacity: .7; }
#voiceSigil.speaking { opacity: 1; filter: drop-shadow(0 0 24px rgba(243,207,122,.8)); }
#voiceSigil svg { width: 100%; height: 100%; overflow: visible; }

/* ───────── end of an act (?act=) */
#actEnd { position: absolute; inset: 0; z-index: 25; display: grid; place-content: center; text-align: center; gap: .6rem; opacity: 0; pointer-events: none; transition: opacity 1.4s;
  background: radial-gradient(circle at 50% 45%, rgba(40,22,70,.85), rgba(5,3,10,.96) 70%); }
#actEnd.in { opacity: 1; pointer-events: auto; }
#actEnd small { letter-spacing: .4em; text-transform: uppercase; color: var(--gold); font: 600 .78rem system-ui, sans-serif; }
#actEnd h2 { margin: .2rem 0; font-weight: 400; font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: .08em; color: #fff3d0; text-shadow: 0 0 30px rgba(243,207,122,.4); }
#actEnd p { margin: 0; color: #d9ccb2; font-style: italic; }
#actEnd .ae-btns { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }
#actEnd a { color: var(--gold); text-decoration: none; letter-spacing: .14em; text-transform: uppercase; font: 600 .8rem system-ui, sans-serif; padding: .7rem 1.3rem; border-radius: 99px; border: 1px solid rgba(243,207,122,.55); background: rgba(20,12,30,.7); }
#actEnd a:first-child { background: var(--gold); color: #2a1a08; }
/* ---- app session: the gates ("Enter" after the Prologue, "Enter Clockspire" at the end) and Skip intro ---- */
#actEnd.gate-enter, #actEnd.gate-spire { overflow: hidden; isolation: isolate; }
#actEnd .gate-art, #actEnd .gate-rays { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
#actEnd.gate-enter .gate-art { background: radial-gradient(ellipse at 50% 50%, rgba(120, 80, 200, .28), rgba(6, 4, 14, .92) 62%); }
#actEnd.gate-spire .gate-art { background: linear-gradient(180deg, rgba(6, 6, 16, .55), rgba(6, 6, 16, .2) 40%, rgba(6, 6, 16, .85)), url(assets/bg/spire.webp) center 30% / cover no-repeat;
  transform: scale(1.12); opacity: 0; transition: transform 6s ease-out, opacity 1.4s ease; }
#actEnd.gate-spire.in .gate-art { transform: scale(1); opacity: 1; }
#actEnd .gate-rays { background: conic-gradient(from 0deg at 50% 46%, transparent 0 8%, rgba(243, 207, 122, .10) 9% 11%, transparent 12% 30%, rgba(243, 207, 122, .08) 31% 33%, transparent 34% 58%, rgba(243, 207, 122, .09) 59% 61%, transparent 62% 84%, rgba(243, 207, 122, .07) 85% 87%, transparent 88%);
  -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 10%, transparent 60%); mask-image: radial-gradient(circle at 50% 46%, #000 10%, transparent 60%); animation: gate-turn 40s linear infinite; }
@keyframes gate-turn { to { transform: rotate(360deg); } }
#actEnd.gate-enter > small, #actEnd.gate-enter > h2, #actEnd.gate-enter > p, #actEnd.gate-enter > .ae-btns,
#actEnd.gate-spire > small, #actEnd.gate-spire > h2, #actEnd.gate-spire > p, #actEnd.gate-spire > .ae-btns { opacity: 0; transform: translateY(14px); transition: opacity .9s ease, transform .9s ease; }
#actEnd.in > small { transition-delay: .3s; } #actEnd.in > h2 { transition-delay: .6s; } #actEnd.in > p { transition-delay: 1s; } #actEnd.in > .ae-btns { transition-delay: 1.5s; }
#actEnd.in > small, #actEnd.in > h2, #actEnd.in > p, #actEnd.in > .ae-btns { opacity: 1; transform: none; }
#actEnd #gateGo { animation: gate-glow 2.6s ease-in-out infinite; }
@keyframes gate-glow { 50% { box-shadow: 0 0 26px rgba(243, 207, 122, .55); } }
/* walking in: the tower comes closer and the light swallows the card */
body.entering #actEnd > :not(.gate-art) { opacity: 0 !important; transition: opacity .5s ease !important; }
body.entering #actEnd.gate-spire .gate-art { transform: scale(1.35); filter: brightness(1.4); transition: transform 1.4s ease-in, filter 1.4s ease-in; }
body.entering #actEnd::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, rgba(255, 236, 190, .95), rgba(255, 236, 190, 0) 60%); animation: gate-flash 1.4s ease-in forwards; }
@keyframes gate-flash { from { opacity: 0; } to { opacity: 1; } }
#skipIntro { position: fixed; right: 16px; bottom: 16px; z-index: 70; padding: .55rem 1.1rem; border-radius: 99px; cursor: pointer;
  border: 1px solid rgba(243, 207, 122, .6); background: rgba(14, 10, 22, .82); color: #f3cf7a; font: 600 .82rem system-ui, sans-serif; letter-spacing: .08em; }
#skipIntro:hover, #skipIntro:focus-visible { background: rgba(40, 28, 12, .9); color: #fff3d0; outline: none; }
/* leaving a film: the scene sinks into night around one last golden glint */
body.leaving-film::after { content: ''; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background: radial-gradient(circle at 50% 46%, rgba(255, 228, 170, 0.0), rgba(4, 3, 9, 0.0) 30%), #040309; animation: film-out 1.3s ease-in forwards; }
body.leaving-film::before { content: ''; position: fixed; left: 50%; top: 46%; z-index: 91; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; pointer-events: none;
  background: #fff3d0; box-shadow: 0 0 40px 18px rgba(255, 214, 140, 0.55); animation: film-glint 1.3s ease-in-out forwards; }
@keyframes film-out { from { opacity: 0; } 55% { opacity: 0.85; } to { opacity: 1; } }
@keyframes film-glint { 0% { opacity: 0; transform: scale(0.4); } 50% { opacity: 1; transform: scale(1.4); } 100% { opacity: 0; transform: scale(0.2); } }
body.leaving-film #stage { transition: transform 1.3s ease-in, filter 1.3s ease-in; transform: scale(1.04); filter: blur(2px) brightness(0.6); }
body.reduce.leaving-film::before { display: none; }
#soundOn { position: fixed; left: 16px; bottom: 16px; z-index: 70; padding: .55rem 1.1rem; border-radius: 99px; cursor: pointer;
  border: 1px solid rgba(243, 207, 122, .9); background: var(--gold); color: #2a1a08; font: 600 .82rem system-ui, sans-serif; letter-spacing: .06em; }
body.reduce #actEnd .gate-rays { animation: none; }
/* the app session's "Enter" / "Enter Clockspire" gate button looks like the first act-end link */
#actEnd #gateGo { cursor: pointer; letter-spacing: .14em; text-transform: uppercase; font: 600 .85rem system-ui, sans-serif; padding: .8rem 1.6rem; border-radius: 99px; border: 1px solid rgba(243,207,122,.8); background: var(--gold); color: #2a1a08; }
#actEnd #gateGo:focus-visible { outline: 3px solid #fff3d0; outline-offset: 3px; }

/* ───────── cinematic scene transitions (transitions.js) */
@property --r { syntax: '<length>'; inherits: false; initial-value: 150vmax; }
#trans { position: fixed; inset: 0; z-index: 21; pointer-events: none; overflow: hidden; display: none; perspective: 900px; }
#trans.on { display: block; pointer-events: auto; }
.tr-iris { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, #0b0716, #030208 70%);
  mask-image: radial-gradient(circle at 50% 50%, transparent calc(var(--r) - 2px), #000 var(--r)); -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent calc(var(--r) - 2px), #000 var(--r)); }
#trans.gold .tr-iris { background: radial-gradient(circle at 50% 50%, #1a0e04, #070301 70%); }
.tr-ring { position: absolute; left: 50%; top: 50%; width: 300vmax; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%,-50%);
  border: .45vmax solid rgba(243,207,122,.95); box-shadow: 0 0 2.5vmax rgba(243,207,122,.7), inset 0 0 2.5vmax rgba(243,207,122,.5); }
#trans.blue .tr-ring { border-color: rgba(190,225,255,.9); box-shadow: 0 0 2.5vmax rgba(140,200,255,.6), 0 0 6vmax rgba(243,207,122,.35), inset 0 0 2.5vmax rgba(140,200,255,.45); }
.tr-back { position: absolute; inset: 0; background: radial-gradient(circle, #120b06, #030201 75%); opacity: 0; }
.tr-back.deep { background: radial-gradient(circle, #0d1638, #02030b 70%); }
.tr-gear { position: absolute; top: 50%; width: 125vmin; aspect-ratio: 1; filter: drop-shadow(0 0 30px rgba(0,0,0,.9)) drop-shadow(0 0 2px rgba(243,207,122,.6)); }
.tr-gear.l { left: 0; } .tr-gear.r { left: 100%; width: 105vmin; }
.tr-gear svg { width: 100%; height: 100%; }
.tr-zring { position: absolute; left: 50%; top: 50%; width: 80vmin; aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(243,207,122,.9); opacity: 0;
  box-shadow: 0 0 24px rgba(243,207,122,.6), inset 0 0 24px rgba(180,210,255,.35); }
.tr-zring.z1 { border-style: dashed; border-color: rgba(200,220,255,.8); } .tr-zring.z3 { border-width: 4px; } .tr-zring.z4 { border-color: rgba(215,184,255,.8); }
.tr-flash { position: absolute; inset: 0; background: radial-gradient(circle, rgba(235,244,255,1), rgba(150,190,255,.55) 35%, rgba(10,16,40,.95) 75%); opacity: 0; }
.tr-pane { position: absolute; inset: -2% 0; background: linear-gradient(180deg, #0b0703 0%, #1d1206 40%, #2b1906 55%, #0b0703 100%); transform: translateY(100%);
  box-shadow: 0 -30px 60px rgba(255,180,80,.25); }
.tr-pane::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent, #f3cf7a, transparent); box-shadow: 0 0 24px #f3cf7a; }
.tr-chain { position: absolute; left: 50%; top: 0; width: 30px; height: 100%; transform: translate(-50%,-100%);
  background: repeating-linear-gradient(180deg, transparent 0 6px, #f3cf7a 6px 10px, transparent 10px 26px), repeating-linear-gradient(180deg, transparent 0 13px, #a8792e 13px 30px);
  background-size: 8px 100%, 18px 100%; background-position: center; background-repeat: repeat-y; filter: drop-shadow(0 0 10px rgba(243,207,122,.8)); }
.tr-ink { position: absolute; width: 95vmax; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%,-50%) scale(0); opacity: 0;
  background: radial-gradient(circle, #000 0 48%, rgba(4,3,10,.96) 58%, rgba(10,6,22,.7) 66%, transparent 72%); }
.tr-bloom { position: absolute; inset: -10%; background: radial-gradient(circle at 50% 46%, #fffaf0 0%, #ffe6a8 22%, #f3b85a 45%, rgba(120,60,10,.95) 80%); opacity: 0; }

/* layered spinning parts: each square layer turns about its own centre (GPU-composited) */
@keyframes spinr { to { rotate: 360deg; } }
.cl { position: absolute; inset: 0; pointer-events: none; }
.cl svg { width: 100%; height: 100%; display: block; overflow: visible; }
.cl.r2 { animation: spinr 240s linear infinite reverse; } .cl.r3 { animation: spinr 90s linear infinite; }
.hands .cl.hh { animation: spinr 720s linear infinite reverse; } .hands .cl.hm { animation: spinr 60s linear infinite reverse; } .hands .cl.hs { animation: spinr 6s linear infinite reverse; }
.clock.forward .hands .cl { animation-direction: normal; }
.clock .cl svg { filter: drop-shadow(0 0 10px rgba(243,207,122,.3)); }
.ringl { position: absolute; left: 50%; top: 50%; width: 130vmax; aspect-ratio: 1; translate: -50% -50%; }
.ringl svg { width: 100%; height: 100%; }
.ringl.a { animation: spinr 300s linear infinite; } .ringl.b { animation: spinr 400s linear infinite reverse; } .ringl.c { animation: spinr 260s linear infinite; }
.actor .halo .cl.ha { animation: spinr 180s linear infinite; } .actor .halo .cl.hb { animation: spinr 90s linear infinite reverse; }
.actor .halo > svg { position: absolute; inset: 0; }

/* ───────── characters */
.actor { bottom: 0; height: 66vh; transform: translateX(-50%); opacity: 0; filter: none; transition: opacity 1.4s ease, transform 1.4s var(--ease); }
.actor.in { opacity: 1; }
.actor .body { position: relative; height: 100%; animation: breathe2 6.5s ease-in-out infinite; transform-origin: 50% 100%; z-index: 2;
  filter: brightness(.86) saturate(.92) drop-shadow(0 18px 24px rgba(0,0,0,.55)); transition: filter .8s ease; }
.actor .body img { height: 100%; width: 100%; object-fit: contain; display: block; animation: none !important; }
.actor .body img + img { position: absolute; left: 0; top: 0; }
.actor.speaking .body { filter: brightness(1.02) saturate(1.02) drop-shadow(0 0 14px color-mix(in srgb, var(--glow) 35%, transparent)) drop-shadow(0 18px 24px rgba(0,0,0,.55)); }
.actor.speaking { z-index: 3; }
@keyframes breathe2 { 0%,100% { transform: scale(1, 1); } 50% { transform: scale(1.004, 1.009); } }
.actor .aura { position: absolute; left: 50%; top: 20%; width: 120%; aspect-ratio: 1; translate: -50% 0; border-radius: 50%; z-index: 1; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--glow) 22%, transparent), transparent 62%); opacity: .45; transition: opacity 1s; animation: aura 7s ease-in-out infinite; }
.actor.speaking .aura { opacity: .85; }
@keyframes aura { 0%,100% { scale: 1; } 50% { scale: 1.06; } }
.actor .floor { position: absolute; left: 50%; bottom: -1.5vh; width: 80%; height: 5vh; translate: -50% 0; border-radius: 50%; background: radial-gradient(ellipse, rgba(0,0,0,.6), transparent 70%); z-index: 0; }
.actor[data-pos="left"]   { left: 15%; }
.actor[data-pos="right"]  { left: 85%; }
.actor[data-pos="center"] { left: 50%; height: 58vh; }
.actor[data-pos="far"]    { left: 50%; bottom: 30vh; height: 34vh; opacity: 0; }
.actor[data-pos="far"].in { opacity: .45; filter: blur(.6px); }
.actor[data-who="aevaryn"] { height: 70vh; }
.actor[data-who="aevaryn"][data-pos="center"] { height: 58vh; }
.actor .halo { position: absolute; left: 50%; top: -16%; width: 118%; aspect-ratio: 1; translate: -50% 0; z-index: 1; opacity: .6; transition: opacity 1s, filter 1s; }
.actor .halo svg { width: 100%; height: 100%; overflow: visible; }
#stage:has(.clock.show) .actor .halo { opacity: 0 !important; } /* one clock at a time */
.actor.speaking .halo { opacity: 1; filter: drop-shadow(0 0 16px rgba(243,207,122,.7)); }

/* Tick: a small raven on a brass perch, never person-sized */
.actor[data-who="tick"] { height: 21vh; bottom: 26vh; transition: opacity .6s, transform 2.2s cubic-bezier(.25,.8,.3,1); }
.actor[data-who="tick"][data-pos="right"] { left: 82%; }
.actor[data-who="tick"][data-pos="left"]  { left: 18%; }
.actor[data-who="tick"][data-pos="perch"] { left: 66%; top: 6vh; bottom: auto; height: 17vh; }
.actor[data-who="tick"] .body { animation: none; filter: drop-shadow(0 10px 12px rgba(0,0,0,.55)); }
.actor[data-who="tick"].speaking .body { filter: drop-shadow(0 0 10px rgba(120,220,255,.45)) drop-shadow(0 10px 12px rgba(0,0,0,.55)); }
.actor[data-who="tick"] .aura { top: 0; width: 140%; }
.actor[data-who="tick"] .floor { display: none; }
.actor .perch { position: absolute; left: 12%; right: 12%; bottom: 3%; height: 7px; border-radius: 4px; z-index: 1;
  background: linear-gradient(#f3d58a, #8a5f22); box-shadow: 0 4px 10px rgba(0,0,0,.6), 0 0 10px rgba(243,207,122,.3); }
.actor .perch::before, .actor .perch::after { content: ""; position: absolute; top: 4px; width: 5px; height: 4vh; background: linear-gradient(90deg, #6b4a1c, #c9973f, #6b4a1c); }
.actor .perch::before { left: 8%; } .actor .perch::after { right: 8%; }
.actor[data-who="tick"].flying { opacity: 1; }
.actor[data-who="tick"].flying .body { transform: translate(var(--fx), var(--fy)) scale(.8); transition: transform 2.3s cubic-bezier(.2,.75,.25,1); }
.actor[data-who="tick"].flying.arrive .body { transform: translate(0, 0) scale(1); }
.actor[data-who="tick"].flying .perch { opacity: 1; }
.actor[data-who="tick"].hop .body { animation: hop .45s ease-out 2; }
@keyframes hop { 50% { transform: translateY(-14%); } }

/* The Null: an absence. Light drains towards it; no flashy outline. */
.actor[data-who="null"] { height: 64vh; transition: opacity 3s ease; }
.actor[data-who="null"] .body { filter: brightness(.95) contrast(1.05) drop-shadow(0 0 40px rgba(0,0,0,.9)); animation: null-drift 9s ease-in-out infinite; }
.actor[data-who="null"] .body img { transition-timing-function: ease-in-out; filter: none !important; } /* no purple glow: an absence, not a spotlight */
.actor[data-who="null"] .aura { top: 5%; width: 170%; opacity: .95; background: radial-gradient(circle, rgba(0,0,0,.78) 0%, rgba(8,6,20,.55) 32%, transparent 64%); animation: absence 8s ease-in-out infinite; }
.actor[data-who="null"].speaking .aura { opacity: 1; scale: 1.1; }
.actor[data-who="null"] .floor { background: radial-gradient(ellipse, rgba(0,0,0,.85), transparent 70%); width: 120%; }
.actor[data-who="null"].gone { opacity: 0 !important; }
@keyframes null-drift { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1.6%); } }
@keyframes absence { 0%,100% { scale: 1; opacity: .85; } 50% { scale: 1.08; opacity: 1; } }
.silhouette { width: 26vmin; top: 46%; filter: none; }
.silhouette img { width: 100%; display: block; filter: brightness(.9) drop-shadow(0 0 30px rgba(0,0,0,.9)); }
.silhouette img.b { position: absolute; inset: 0; opacity: 0; animation: nfade 6s ease-in-out 1.5s infinite alternate; }
@keyframes nfade { to { opacity: 1; } }
.silhouette.show { opacity: .8; }
#stage[data-mood="null"] .astro { opacity: .3 !important; filter: saturate(.3); }
.bubble.null { background: linear-gradient(160deg, rgba(8,8,14,.88), rgba(2,2,6,.92)); border-color: rgba(176,166,201,.35); }

/* ───────── bubbles are placed by script beside the head; tails point at the speaker */
.bubble { max-width: min(36vw, 520px); min-width: 230px; transform: translateY(8px) scale(.98); }
.bubble[data-tail="left"]::after  { left: -13px; top: 26px; }
.bubble[data-tail="right"]::after { right: -13px; top: 26px; }
.bubble.distant { translate: none; }
.caption { top: auto; bottom: 7vh; }
#stage[data-mood="candle"] .caption { bottom: auto; top: 8vh; }
.actor.speaking { filter: none; }

/* ───────── props: keep the centre clear of characters */
.panel { top: 52%; width: min(32vw, 440px); }
.priority { top: 56%; }
.priority .col { width: 10vw; min-width: 120px; }
.dial { top: 52%; width: min(44vmin, 440px); }
.clock { width: min(70vmin, 700px); }
.astro { width: min(62vmin, 620px); top: 48%; }
.budget { width: min(40vmin, 400px); top: 52%; }
.choice-pair { top: 56%; }
.choice-pair .card { width: 15vw; min-width: 160px; }
.contracts { left: 50%; gap: 1.6vw; }
.contract { width: 7vw; min-width: 84px; }
.contract .sheet { height: 10vw; min-height: 110px; }
.contract.lift { transform: translateY(16vh) scale(1.6); }
.realms .portal { width: 16vmin; }
.realms .p-spire { left: 31%; top: 29%; }
.realms .p-obs   { left: 50%; top: 14%; width: 12vmin; }
.realms .p-abyss { left: 69%; top: 29%; }
.realms svg.thread path { opacity: .8; }
#stage[data-mood="dawn"] .realms .portal { width: 12vmin; top: 13%; }
#stage[data-mood="dawn"] .realms .p-spire { left: 8%; } #stage[data-mood="dawn"] .realms .p-abyss { left: 92%; } #stage[data-mood="dawn"] .realms .p-obs { display: none; }
#stage[data-mood="dawn"] .realms .thread { display: none; }
.gear { opacity: .22; }
.book { animation-duration: var(--d, 7s); }

/* ───────── drifters: paper-ribbon wraiths, task-linked */
.drifter { width: 17vmin; aspect-ratio: 1; cursor: pointer; filter: drop-shadow(0 0 12px rgba(255,214,140,.38)); left: 0; top: 0; will-change: transform; contain: layout style; } /* one shadow, no filter transition: smoother catching (owner 2026-12-04) */
.drifter img { position: absolute; inset: 0; width: 100%; height: 100%; animation: none; transition: opacity .9s ease; }
.drifter img.a { opacity: 0; }
.drifter .tag { position: absolute; left: 50%; bottom: -1.4rem; translate: -50% 0; white-space: nowrap; font-size: .7rem; letter-spacing: .08em; color: #f3dfb0; background: rgba(20,12,6,.75); border: 1px solid rgba(243,207,122,.35); padding: .1rem .5rem; border-radius: 99px; opacity: 0; transition: opacity .3s; pointer-events: none; }
.drifter:hover .tag, .drifter:focus-visible .tag, .drifter.caught .tag { opacity: 1; }
.drifter:focus-visible { outline: 2px dashed var(--gold); outline-offset: 4px; }
.drifter.caught { filter: drop-shadow(0 0 26px rgba(255,220,150,.75)); z-index: 4; }

/* ───────── candle: layered flame that leans with breath */
.candle { --fl: 1; --sk: 0deg; --gl: 1; bottom: 16vh; width: 7vmin; height: 26vmin; }
.candle .flame { width: 70%; height: 30%; bottom: 74%; background: none; animation: none; filter: none; transform: translateX(-50%) skewX(var(--sk)) scaleY(var(--fl)); transform-origin: 50% 95%; transition: none; }
.candle .flame i { position: absolute; left: 50%; bottom: 0; translate: -50% 0; border-radius: 50% 50% 38% 38% / 70% 70% 30% 30%; }
.candle .flame .outer { width: 100%; height: 100%; background: radial-gradient(ellipse at 50% 80%, rgba(255,170,60,.85), rgba(255,90,20,.45) 55%, transparent 72%); filter: blur(3px); }
.candle .flame .mid   { width: 66%; height: 78%; background: radial-gradient(ellipse at 50% 80%, #fff3b0, #ffc24a 55%, rgba(255,140,40,0) 75%); filter: blur(1px); }
.candle .flame .core  { width: 34%; height: 46%; background: radial-gradient(ellipse at 50% 70%, #fff, #fff6d0 60%, rgba(255,255,255,0) 80%); }
.candle .flame .blue  { width: 30%; height: 14%; bottom: -2%; background: radial-gradient(ellipse, rgba(90,140,255,.8), transparent 70%); filter: blur(1px); }
.candle .glow { opacity: var(--gl); animation: none; background: radial-gradient(circle, rgba(255,190,90,.38), rgba(255,140,40,.1) 32%, transparent 58%); }
.candle .wax { background: linear-gradient(90deg, #b9a47d, #fff3d8 38%, #e6d4ae 62%, #a8936b); }
.candle .wax .drip { position: absolute; top: 0; left: 62%; width: 12%; height: 30%; border-radius: 0 0 50% 50%; background: #fff1d0; box-shadow: inset -2px 0 3px rgba(0,0,0,.15); }
.candle.out .flame { animation: blowout2 1.1s ease-in forwards; }
@keyframes blowout2 { 0% { transform: translateX(-50%) skewX(-10deg) scaleY(1); opacity: 1; } 40% { transform: translateX(-30%) skewX(-35deg) scaleY(.55); opacity: .8; } 100% { transform: translateX(-10%) skewX(-45deg) scaleY(0); opacity: 0; } }
.mic { bottom: 4vh; flex-wrap: wrap; justify-content: center; max-width: 520px; gap: .5rem .8rem; background: rgba(10,6,18,.7); padding: .55rem .9rem; border-radius: 14px; border: 1px solid rgba(243,207,122,.2); }
.mic .meter { position: relative; width: 140px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.mic .meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #f3cf7a, #ff8a3a); transition: width .08s; }
.mic .meter b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #fff; left: 55%; opacity: .7; }
.mic label { font-size: .75rem; color: var(--dim); display: flex; gap: .4rem; align-items: center; }
.mic input { width: 90px; accent-color: var(--gold); }
.mic .msg { width: 100%; text-align: center; color: #e9dcc0; font-size: .78rem; }

/* ───────── controls: hidden for the show, appear at the bottom edge while editing */
#controls { opacity: 0; pointer-events: none; transform: translate(-50%, 20px); transition: opacity .3s, transform .3s; }
body.show-controls #controls, #controls:focus-within { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
#hud { opacity: 0; transition: opacity .3s; }
body.show-controls #hud { opacity: .8; }
body.present #controls, body.present #hud { display: none; }

/* ───────── Kiro ghost peeking in from the side */
.kghost.side { animation: ghost-side var(--d, 7s) ease-in-out forwards; }
@keyframes ghost-side { 0% { opacity: 0; transform: translateX(0) rotate(0); } 18% { opacity: var(--o, .55); transform: translateX(var(--dx)) rotate(-8deg); } 30% { transform: translateX(calc(var(--dx) * .8)) rotate(6deg); } 55% { opacity: var(--o, .55); transform: translateX(var(--dx)) translateY(-8px) rotate(-4deg); } 80% { opacity: calc(var(--o, .55) * .8); } 100% { opacity: 0; transform: translateX(0) translateY(-24px) rotate(0); } }
.kghost.side[data-side="right"] svg { transform: scaleX(-1); }

/* ───────── Stage 3 additions */
@keyframes drift-cam { from { transform: scale(1.01); } to { transform: scale(1.05) translate(-.8%, -.5%); } } /* less zoom = sharper */

/* prologue: bolder notifications, falling calendar pages, an endless feed */
.notif { background: rgba(14,10,28,.92); border: 1px solid rgba(215,184,255,.55); color: #fff; font-weight: 600; font-size: .92rem; padding: .55rem .95rem; border-radius: 12px;
  box-shadow: 0 0 18px rgba(160,120,255,.35), 0 8px 24px rgba(0,0,0,.6); letter-spacing: .01em; }
.cal { position: absolute; width: 58px; padding: .2rem 0 .35rem; border-radius: 6px; text-align: center; background: linear-gradient(#fff, #e8e1d4); color: #2a1a3a; font-family: system-ui, sans-serif; box-shadow: 0 8px 20px rgba(0,0,0,.6);
  animation: calfall 4.2s cubic-bezier(.4,.1,.7,1) forwards; }
.cal b { display: block; background: #b13a3a; color: #fff; font-size: .6rem; letter-spacing: .1em; border-radius: 6px 6px 0 0; margin: -.2rem 0 .1rem; padding: .15rem 0; }
.cal span { font-size: 1.4rem; font-weight: 700; }
@keyframes calfall { 0% { opacity: 0; transform: translateY(-20px) rotate(0); } 12% { opacity: .95; } 100% { opacity: 0; transform: translateY(70vh) rotate(var(--rot)); filter: blur(3px); } }
.feed { left: 8%; top: 0; width: 220px; height: 100%; overflow: hidden; opacity: .5; mask-image: linear-gradient(transparent, #000 20%, #000 80%, transparent); }
.feed p { margin: .5rem 0; padding: .4rem .6rem; border-radius: 8px; background: rgba(255,255,255,.06); color: #cfc6e6; font: 600 .78rem system-ui, sans-serif; animation: feed 6s linear forwards; }
@keyframes feed { from { transform: translateY(40vh); } to { transform: translateY(-120vh); } }

/* Act I: the Keeper seen far away as a veiled light */
.vision { left: 50%; top: 4vh; width: 24vmin; translate: -50% 0; opacity: 0; mix-blend-mode: screen; transition: opacity 3s ease, filter 1s; z-index: 1;
  mask-image: radial-gradient(ellipse 60% 55% at 50% 45%, #000 55%, transparent 100%); }
.vision.show { opacity: .7; animation: vision 9s ease-in-out infinite; }
.vision.speaking { opacity: 1; filter: brightness(1.25) drop-shadow(0 0 20px rgba(255,200,120,.6)); }
.vision img { width: 100%; display: block; }
@keyframes vision { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* Act II opens on Aevaryn's face: eyes closed, then open */
.closeup { left: 50%; top: 44%; width: min(48vmin, 460px); aspect-ratio: 760 / 694; translate: -50% -50%; opacity: 0; z-index: 3; transition: opacity 1.6s ease, transform 6s ease;
  mask-image: radial-gradient(ellipse 50% 52% at 50% 46%, #000 60%, transparent 100%); transform: scale(.94); }
.closeup.show { opacity: 1; transform: scale(1.04); }
.closeup.leave { opacity: 0; transform: scale(1.1); }
.closeup img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .9s ease; }
.closeup .op { opacity: 0; } .closeup.open .op { opacity: 1; } .closeup.open .cl { opacity: 0; }
.closeup::after { content: ""; position: absolute; inset: -6%; border-radius: 50%; border: 1px solid rgba(243,207,122,.35); box-shadow: 0 0 60px rgba(243,207,122,.25); }

/* little candle clusters that flicker on the floor */
.fcandles { display: flex; align-items: flex-end; gap: 10px; translate: -50% 0; z-index: 1; pointer-events: none; }
.fc { position: relative; width: 22px; height: var(--h); border-radius: 4px 4px 2px 2px; background: linear-gradient(90deg, #a8936b, #fff0d0 40%, #d9c49a); box-shadow: 0 6px 10px rgba(0,0,0,.5); }
.fc::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 2px; height: 6px; background: #222; translate: -50% 0; }
.fc .fl { position: absolute; left: 50%; bottom: calc(100% + 4px); width: 18px; height: 34px; translate: -50% 0; border-radius: 50% 50% 38% 38% / 70% 70% 30% 30%; transform-origin: 50% 100%;
  background: radial-gradient(ellipse at 50% 80%, #fff 0 18%, #ffe07a 40%, #ff9a2a 64%, rgba(255,80,0,0) 74%); animation: fcflick var(--dur, 1.4s) ease-in-out infinite; animation-delay: var(--dl, 0s); filter: drop-shadow(0 0 6px #ffc46b) drop-shadow(0 0 18px rgba(255,150,50,.85)); }
.fc .fl::after { content: ""; position: absolute; left: 50%; top: 40%; width: 220px; height: 220px; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, rgba(255,180,80,.34), transparent 60%); animation: inherit; }
@keyframes fcflick { 0%,100% { transform: scale(1) skewX(0); opacity: 1; } 30% { transform: scale(.94, 1.06) skewX(3deg); } 55% { transform: scale(1.05, .93) skewX(-4deg); opacity: .9; } 80% { transform: scale(.98, 1.03) skewX(2deg); } }

/* Tick flying between perches in the middle of a scene */
.actor[data-who="tick"].mid { transition: left 2.1s cubic-bezier(.35,.1,.25,1), top 2.1s cubic-bezier(.35,.1,.25,1), opacity .6s; translate: 0 0; }
.actor[data-who="tick"].mid .body { transform: scaleX(var(--flip, 1)); }
.actor[data-who="tick"].mid .perch { opacity: 0; transition: opacity .4s; }
.actor[data-who="tick"].mid.airborne .body { animation: glide 1.9s ease-in-out; }
@keyframes glide { 0% { translate: 0 0; } 40% { translate: 0 -5vh; } 100% { translate: 0 0; } }
.actor .perch { transition: opacity .8s; }

/* phone tail points at the speaker */
.bubble[data-tail="down"]::after { left: var(--tx, calc(50% - 13px)); }

/* ───────── small screens: fewer, smaller things */
@media (max-width: 820px) {
  .actor { height: 40vh; } .actor[data-pos="center"] { height: 36vh; }
  .actor[data-pos="left"] { left: 24%; } .actor[data-pos="right"] { left: 76%; }
  .actor[data-who="aevaryn"] { height: 42vh; } .actor[data-who="null"] { height: 40vh; }
  .actor[data-who="tick"] { height: 11vh; bottom: 38vh; } .actor[data-who="tick"][data-pos="perch"] { height: 10vh; top: 30vh; left: 80%; }
  .actor[data-who="tick"][data-pos="right"] { left: 80%; } .actor[data-who="tick"][data-pos="left"] { left: 20%; }
  .panel, .priority, .dial, .budget, .choice-pair, .astro { top: 44%; }
  .panel { width: 86vw; } .priority { gap: 6px; } .priority .col { width: 28vw; min-width: 0; padding: .5rem .3rem; } .priority .col .card { font-size: .7rem; }
  .dial { width: 62vw; } .budget { width: 52vw; } .astro { width: 76vw; } .clock { width: 86vw; top: 40%; }
  .choice-pair .card { width: 40vw; min-width: 0; font-size: .8rem; }
  .contracts { top: 22vh; gap: 2vw; } .contract { width: 17vw; min-width: 0; } .contract .sheet { height: 22vw; min-height: 0; font-size: .55rem; }
  .bubble { max-width: 90vw; min-width: 0; padding: .8rem 1rem; } .bubble p { font-size: 1rem; }
  .events span { font-size: .6rem; } .realms .portal { width: 22vw; } .fcandles { display: none; }
  .drifter { width: 22vw; } .mic { max-width: 92vw; } .gear { display: none; }
  .scene-card h2 { font-size: 2rem; } .caption { width: 90vw; }
  .vision { width: 34vw; } .closeup { width: 70vw; }
  /* phone: the speaker steps forward, the others step aside and dim */
  .actor { transition: opacity 1s, left .8s ease, filter .8s; }
  .actor.in:not(.speaking):not([data-who="tick"]) { opacity: .55; filter: brightness(.8); }
  .actor[data-pos="left"]:not(.speaking) { left: 14%; } .actor[data-pos="right"]:not(.speaking) { left: 86%; }
  .actor[data-who="tick"], .actor[data-who="tick"][data-pos="perch"] { top: 19vh; bottom: auto; height: 10vh; left: 84%; }
}
@media (max-width: 820px) { .rings { display: none; } }
body.reduce #stage::before, body.reduce .rings { animation: none !important; }

.fc .fl::after { display: none; }
/* candles: lit wax near the flame, heat shimmer, a soft pool of light on the floor */
.fc { background: linear-gradient(180deg, rgba(255,214,150,.95) 0%, rgba(255,236,200,.9) 14%, transparent 34%), linear-gradient(90deg, #8f7a55, #f6e6c4 40%, #cdb88d 70%, #8a7550); }
.fc::after { content: ""; position: absolute; left: -2px; right: -2px; top: -2px; height: 7px; border-radius: 50%; background: radial-gradient(ellipse, #fff4d6, #e9cf9c 70%); }
.fc .fl::before { content: ""; position: absolute; left: 50%; bottom: 80%; width: 160%; height: 160%; translate: -50% 0; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,220,170,.16), transparent 70%); filter: blur(4px); animation: haze 1.7s ease-in-out infinite; }
@keyframes haze { 0%,100% { transform: translateX(0) scaleY(1); opacity: .6; } 50% { transform: translateX(2px) scaleY(1.25); opacity: 1; } }
.fcandles::after { content: ""; position: absolute; left: 50%; bottom: -1.2vh; width: 22vmin; height: 4vh; translate: -50% 0; border-radius: 50%; background: radial-gradient(ellipse, rgba(255,170,70,.45), transparent 70%); filter: blur(2px); animation: pulse 1.9s ease-in-out infinite; }
.fcandles { filter: saturate(1.05); }
.fcandles::before { animation: candleglow 3.1s ease-in-out infinite; }
@keyframes candleglow { 0%,100% { opacity: .85; scale: 1; } 23% { opacity: 1; scale: 1.04; } 47% { opacity: .7; scale: .97; } 71% { opacity: .95; scale: 1.02; } }
.candle .flame .outer { animation: haze 1.3s ease-in-out infinite; }

/* Observatory records: readable plates with threads of light to the core */
.events span { font-size: .86rem; font-weight: 600; color: #ffe3a3; background: rgba(18,10,2,.86); border: 1px solid rgba(243,207,122,.75); padding: .38rem .85rem;
  box-shadow: 0 0 14px rgba(243,207,122,.35), 0 6px 16px rgba(0,0,0,.6); text-shadow: 0 0 8px rgba(243,207,122,.5); letter-spacing: .06em; }
.events span.on { opacity: 1; }
/* the pulse is a separate glow layer that only changes opacity (cheap), not an animated box-shadow */
.events span::after { content: ""; position: absolute; inset: -4px; border-radius: 99px; box-shadow: 0 0 22px rgba(243,207,122,.55); opacity: 0; animation: plate 3.2s ease-in-out infinite; pointer-events: none; }
.events span.proj::after { box-shadow: 0 0 22px rgba(150,190,255,.55); }
@keyframes plate { 50% { opacity: 1; } }
.events span.past { opacity: .55; filter: sepia(.8) brightness(.85); }
.events span.proj { color: #e2ecff; background: rgba(8,14,34,.82); border: 1px dashed rgba(190,215,255,.8); box-shadow: 0 0 16px rgba(150,190,255,.35); text-shadow: 0 0 8px rgba(150,190,255,.6); }
.events .threads { position: absolute; left: 0; top: 0; }
.events .threads line { stroke: rgba(243,207,122,.75); stroke-width: 1.4; stroke-dasharray: 3 7; opacity: 0; transition: opacity 1s; animation: flow 1.6s linear infinite; filter: drop-shadow(0 0 4px rgba(243,207,122,.8)); }
.events .threads line.pj { stroke: rgba(180,205,255,.7); stroke-dasharray: 2 9; }
.events .threads line.on { opacity: 1; }
@keyframes flow { to { stroke-dashoffset: -20; } }
.notif { font-size: 1rem; }
.cal { width: 66px; } .cal span { font-size: 1.6rem; }
.feed { opacity: .75; } .feed p { color: #efe8ff; background: rgba(30,20,60,.7); border: 1px solid rgba(215,184,255,.3); }

/* Morvex's eyes glow, blink and flare while he speaks */
.actor .eyes { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.actor .eyes i { position: absolute; width: 2.2%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; transition: left .5s ease, top .5s ease, opacity .4s, transform .12s;
  background: radial-gradient(circle, #e8fbff 0 22%, rgba(110,200,255,.85) 45%, transparent 72%); box-shadow: 0 0 10px 3px rgba(90,180,255,.55); animation: eyes 4s ease-in-out infinite; mix-blend-mode: screen; }
.actor .eyes.blink i { transform: scaleY(.1); }
.actor.speaking .eyes i { box-shadow: 0 0 16px 6px rgba(90,180,255,.75); }
@keyframes eyes { 0%,100% { opacity: .75; } 50% { opacity: 1; } }

/* hand tracking for the Drifters */
.hand-btn { right: 2vw; bottom: 3vh; display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; pointer-events: auto; z-index: 6; }
.hand-btn button { padding: .55rem 1rem; border-radius: 99px; background: rgba(20,14,30,.86); border: 1px solid var(--gold); color: var(--gold); cursor: pointer; font-size: .85rem; box-shadow: 0 0 18px rgba(243,207,122,.25); }
.hand-btn small { max-width: 280px; text-align: right; color: #e9dcc0; font-size: .72rem; text-shadow: 0 1px 6px #000; }
.hand-preview { position: absolute; right: 2vw; bottom: 13vh; width: 180px; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; border: 1px solid rgba(243,207,122,.45); box-shadow: 0 8px 24px rgba(0,0,0,.6); z-index: 13; opacity: .85; }
.hand-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.hand-cursor { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 14; pointer-events: none; transition: opacity .3s; }
/* while the tracker wakes up: the ring is already there, breathing, so the wait is visible */
.hand-cursor[data-state="waking"] i { animation: hand-waking 1.1s ease-in-out infinite alternate; }
@keyframes hand-waking { from { transform: scale(.8); opacity: .55; } to { transform: scale(1.12); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hand-cursor[data-state="waking"] i { animation: none; } }
/* hand ring: dark outline + strong gold glow so it reads on any background */
.hand-cursor i { position: absolute; left: -32px; top: -32px; width: 64px; height: 64px; border-radius: 50%; border: 4px solid #ffcf5a; transition: transform .15s;
  box-shadow: 0 0 0 3px rgba(0,0,0,.85), inset 0 0 0 2px rgba(0,0,0,.7), 0 0 22px 6px rgba(255,190,60,.9), 0 0 50px 14px rgba(255,160,40,.45); animation: ringpulse 1.4s ease-in-out infinite; }
.hand-cursor b { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%; background: #fff6d8; box-shadow: 0 0 0 3px rgba(0,0,0,.85), 0 0 16px 5px #ffc23a; }
@keyframes ringpulse { 50% { box-shadow: 0 0 0 3px rgba(0,0,0,.85), inset 0 0 0 2px rgba(0,0,0,.7), 0 0 30px 10px rgba(255,200,70,1), 0 0 70px 20px rgba(255,160,40,.55); } }
.caption.wait { opacity: 1 !important; font-style: normal; font-weight: 600; color: #fff3cf; font-size: clamp(1rem, 1.6vw, 1.3rem); padding: .6rem 1.2rem; border-radius: 99px; width: auto; max-width: 80vw;
  background: rgba(12,8,20,.82); border: 1px solid rgba(243,207,122,.7); box-shadow: 0 0 24px rgba(243,207,122,.35); animation: waitpulse 1.8s ease-in-out infinite; }
@keyframes waitpulse { 50% { box-shadow: 0 0 40px rgba(243,207,122,.65); } }
.actor .eyes { display: none; }
/* Morvex: coins orbit him, his shadow lags behind on the wall */
.actor .body img.mshadow { position: absolute; left: 0; top: 0; z-index: -1; opacity: .5; filter: brightness(0) blur(7px) !important;
  transform: translate(-9%, 1%) scale(1.07); transform-origin: 50% 100%; transition: transform 1.6s ease, opacity 1.6s ease; }
.actor.speaking .body img.mshadow { transform: translate(-13%, 0) scale(1.16); opacity: .62; }
.mcoin { position: absolute; left: 50%; top: 0; width: 3.4vmin; height: 3.4vmin; margin: -1.7vmin 0 0 -1.7vmin; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 0 30%, rgba(120,80,20,.55) 32% 36%, transparent 38%), radial-gradient(circle at 35% 30%, #fff6c8, #f3cf7a 42%, #c9973f 68%, #7a5218 92%);
  box-shadow: 0 0 12px rgba(255,200,90,.75), inset 0 0 0 2px rgba(110,70,15,.75), inset 0 0 0 4px rgba(255,236,170,.5); }
.mcoin::after { content: "₲"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 1.9vmin/1 Georgia, serif; color: rgba(110,70,15,.85); text-shadow: 0 1px 0 rgba(255,240,190,.6); }
.mcoin.back { filter: brightness(.55); box-shadow: none; }
.actor.speaking .mcoin { box-shadow: 0 0 16px rgba(255,210,110,.95), inset 0 0 0 1px rgba(120,80,20,.6); }
body.reduce .mcoin { display: none; }

canvas#fx2 { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }

.refrain { position: absolute; font-style: italic; font-size: clamp(1rem, 2vw, 1.6rem); color: rgba(240,220,170,.85); text-shadow: 0 0 12px rgba(255,210,140,.6), 0 2px 6px #000; pointer-events: none; animation: refrain 3.2s ease-out forwards; z-index: 3; }
@keyframes refrain { 0% { opacity: 0; transform: translateY(6px) scale(.9); filter: blur(3px); } 20% { opacity: 1; filter: blur(0); } 100% { opacity: 0; transform: translate(30px, -40px) scale(1.1); filter: blur(4px); } }

/* Tick's falling feathers */
.feather { position: absolute; left: 0; top: 0; margin: -40px 0 0 -11px; width: 22px; height: 80px; pointer-events: none; z-index: 4; opacity: 0; will-change: transform; filter: drop-shadow(1px 0 0 rgba(205,140,70,.75)) drop-shadow(-1px 0 0 rgba(150,95,45,.5)) drop-shadow(0 4px 6px rgba(0,0,0,.7)); }
.feather svg { width: 100%; height: 100%; }
@keyframes feather { 0% { opacity: 0; transform: translate(0, 0) rotate(0); } 8% { opacity: 1; } 25% { transform: translate(calc(var(--dx) * .7), 9vh) rotate(calc(var(--rot) * .25)); }
  45% { transform: translate(calc(var(--dx) * -.2), 18vh) rotate(calc(var(--rot) * -.15)); } 70% { transform: translate(calc(var(--dx) * .9), 29vh) rotate(calc(var(--rot) * .6)); opacity: .9; } 100% { opacity: 0; transform: translate(var(--dx), 42vh) rotate(var(--rot)); } }

/* Aevaryn: a ring of light ripples out from his halo when he speaks */
.actor .halo .pulse { position: absolute; inset: 12%; border-radius: 50%; border: 2px solid rgba(255,236,180,.9); box-shadow: 0 0 20px rgba(243,207,122,.8), inset 0 0 20px rgba(243,207,122,.4); animation: hpulse 2.5s ease-out forwards; pointer-events: none; }
@keyframes hpulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }

/* The Null: after-images drifting off it */
.actor .body img.necho { position: absolute; left: 0; top: 0; z-index: -1; opacity: .3; filter: grayscale(1) brightness(2.2) blur(2.5px) !important; pointer-events: none; }
.actor .body img.necho.e0 { animation: echo0 7s ease-in-out infinite; }
.actor .body img.necho.e1 { animation: echo1 9s ease-in-out infinite; }
@keyframes echo0 { 0%,100% { transform: translate(-6%, 0) scale(1.03); opacity: .14; } 50% { transform: translate(-18%, -3%) scale(1.14); opacity: .55; } }
@keyframes echo1 { 0%,100% { transform: translate(6%, 0) scale(1.03); opacity: .12; } 50% { transform: translate(19%, -4%) scale(1.16); opacity: .5; } }
.actor[data-who="null"].speaking .body img.necho { filter: grayscale(1) brightness(3.2) blur(3px) !important; }
body.reduce .necho, body.reduce .feather { display: none; }
@keyframes fcflick { 0%,100% { transform: scale(1) skewX(0); opacity: 1; } 22% { transform: scale(.95, 1.07) skewX(3deg); } 41% { transform: scale(1.04, .94) skewX(-3deg); opacity: .93; }
  63% { transform: scale(.97, 1.04) skewX(2deg); } 84% { transform: scale(.9, 1.13) skewX(-5deg); opacity: .8; } 90% { transform: scale(1.02, .97) skewX(1deg); opacity: 1; } }
.hand-cursor[data-state="pinch"] i { transform: scale(.55); border-color: #fff; box-shadow: 0 0 26px #fff, inset 0 0 14px #ffd27a; }
.drifter.locked { filter: drop-shadow(0 0 22px rgba(255,236,170,.95)) drop-shadow(0 10px 14px rgba(0,0,0,.5)); }
.drifter.locked .tag { opacity: 1; }
.fcandles::before { content: ""; position: absolute; left: 50%; bottom: 40%; width: 34vmin; height: 34vmin; translate: -50% 50%; border-radius: 50%; background: radial-gradient(circle, rgba(255,175,80,.32), rgba(255,140,40,.1) 35%, transparent 62%); animation: pulse 2.6s ease-in-out infinite; pointer-events: none; z-index: -1; }

/* Scene 15, The Two Realms: Clockspire on the left, the Gilded Abyss on the right, a golden seam where they meet */
.twoworlds { inset: 0; pointer-events: none; animation: twIn 2.4s var(--ease) both; }
.twoworlds .half { position: absolute; top: 0; bottom: 0; width: 58%; background-size: cover; background-position: center; filter: saturate(1.05) brightness(.82); }
.twoworlds .half.l { left: 0; -webkit-mask-image: linear-gradient(90deg, #000 55%, transparent); mask-image: linear-gradient(90deg, #000 55%, transparent); }
.twoworlds .half.r { right: 0; -webkit-mask-image: linear-gradient(270deg, #000 55%, transparent); mask-image: linear-gradient(270deg, #000 55%, transparent); }
.twoworlds .half b { position: absolute; top: 6%; font: 600 .8rem/1 var(--serif, serif); letter-spacing: .35em; text-transform: uppercase; color: #f3cf7a; text-shadow: 0 0 12px #000, 0 0 4px #000; }
.twoworlds .half.l b { left: 6%; } .twoworlds .half.r b { right: 6%; }
.twoworlds .seam { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-50%); background: linear-gradient(transparent, #f3cf7a 20%, #fff3c4 50%, #f3cf7a 80%, transparent); box-shadow: 0 0 18px 4px rgba(243, 207, 122, .45); opacity: .7; }
.realms.split .p-spire, .realms.split .p-abyss { display: none; }
@keyframes twIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .twoworlds { animation: none; } }
#stage[data-mood="dawn"] .twoworlds .half { filter: saturate(1) brightness(.6); } /* scene 18: the realms glow behind the opening clock */
