/* THE HOOK — graybox shell (spec §6 step 3). Layout contract: stage flexes,
   dialogue + choices claim space first, the action row can never be pushed
   off screen. All art is colored rectangles until the mechanics hold. */

*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
html,body{height:100%;overflow:hidden;overscroll-behavior:none;background:#07060d;
  font-family:-apple-system,"Segoe UI",Inter,system-ui,sans-serif;color:#f2eff8;}
:root{
  --mono:Consolas,"JetBrains Mono",ui-monospace,monospace;
  --good:#3fd18b; --bad:#e0455c; --warn:#f0b45c; --accent:#7c3aed; --accent2:#b79bf0;
}

#app{position:relative;width:100vw;height:100dvh;max-width:520px;margin:0 auto;
  overflow:hidden;background:#0b0912;display:flex;flex-direction:column;}

/* ---- stage ---- */
#stage{position:relative;flex:1;min-height:120px;overflow:hidden;}
#scene{position:absolute;inset:0;}

/* scenery, three layers — painted plates when present, graybox otherwise */
#bgplate{position:absolute;inset:0;background:linear-gradient(180deg,#26303f 0%,#33404f 60%,#3c4a58 100%);}
#bgimg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;
  opacity:0;transition:opacity .5s;}
#scene.has-bg #bgimg{opacity:1;animation:kenburns 38s ease-in-out infinite alternate;}
#scene.has-bg #midprops{display:none;}
@keyframes kenburns{from{transform:scale(1.05) translate(-1.2%,0)}to{transform:scale(1.1) translate(1.2%,-1%)}}

/* ambient life: light sweep + drifting bokeh over the stage */
#sweep{position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(115deg,transparent 30%,rgba(183,155,240,.09) 45%,transparent 60%);
  background-size:250% 100%;animation:sweep 11s linear infinite;}
@keyframes sweep{from{background-position:130% 0}to{background-position:-130% 0}}
.bokeh{position:absolute;border-radius:50%;filter:blur(6px);pointer-events:none;
  background:rgba(183,155,240,.13);animation:drift 14s ease-in-out infinite;}
.b1{width:46px;height:46px;top:22%;left:7%;}
.b2{width:26px;height:26px;top:34%;right:11%;animation-delay:-4s;animation-duration:17s;}
.b3{width:34px;height:34px;top:60%;left:18%;animation-delay:-8s;}
@keyframes drift{0%,100%{transform:translate(0,0)}50%{transform:translate(14px,-18px)}}
#midprops{position:absolute;inset:0;}
.prop{position:absolute;background:#4b5a6b;border-radius:6px;}
.prop.car{right:6%;bottom:32%;width:38%;height:16%;border-radius:14px 22px 6px 6px;background:#8d9aab;}
.prop.platform{right:3%;bottom:28%;width:46%;height:5%;background:#5a6878;}
.prop.sign{left:7%;top:10%;width:26%;height:7%;background:#42506a;}

/* graybox antagonist */
#foewrap{position:absolute;inset:0;display:flex;align-items:flex-end;justify-content:center;}
#foe{position:relative;width:230px;height:82%;max-height:420px;
  transition:transform .18s ease-out, filter .25s;animation:idle 4.5s ease-in-out infinite;
  transform-origin:bottom center;}
#foeimg{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;
  object-position:center bottom;display:none;}
/* fidget: he shifts his weight and glances aside while you deliberate */
#foe.has-img #foeimg{animation:fidget 9s ease-in-out infinite;}
@keyframes fidget{
  0%,100%{transform:translate(0,0) rotate(0)}
  11%{transform:translate(1.5px,-1px) rotate(.35deg)}
  22%{transform:translate(0,0) rotate(0)}
  55%{transform:translate(-2.5px,0) rotate(-.45deg)}
  68%{transform:translate(0,0) rotate(0)}
  84%{transform:translate(1px,-.5px) rotate(.2deg)}
}
#foe.has-img{width:min(88%,400px);height:88%;max-height:520px;}
#foe.has-img #foeimg{display:block;}
#foe.has-img .fbody,#foe.has-img .fhead,#foe.has-img .farm{display:none;}
.fbody{position:absolute;bottom:0;left:50%;transform:translateX(-50%);
  width:210px;height:60%;background:#5c6d88;border-radius:44px 44px 0 0;}
.fhead{position:absolute;bottom:62%;left:50%;transform:translateX(-50%);
  width:104px;height:118px;background:#d9a276;border-radius:34px;}
.farm{position:absolute;bottom:34%;left:calc(50% + 78px);width:74px;height:26px;
  background:#5c6d88;border-radius:13px;transform:rotate(-14deg);}
@keyframes idle{0%,100%{transform:scale(1.0)}50%{transform:scale(1.015) translateY(3px)}}
.lean #foe{transform:scale(1.06) translateY(6px);}
.recoil #foe{transform:scale(.97) translateX(-10px);filter:brightness(1.18);}
.smug #foe{transform:scale(1.03);filter:saturate(1.35);}

/* player foreground: a featureless dark arc — your presence in the frame,
   deliberately not a depicted person (no head, no hair, no gender) */
#fgshoulder{position:absolute;bottom:-46px;left:50%;transform:translateX(-50%);
  width:120%;height:96px;background:#14101d;border-radius:100% 100% 0 0;
  filter:blur(2px);transition:transform .12s ease-out;}
.jab #fgshoulder{transform:translateX(-50%) translateY(-9px);}

#stage::after{content:'';position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(0deg,#0b0912 2%,rgba(11,9,18,.25) 40%,transparent 70%);}

/* ---- voice-only stage (Episode 2): no face, no tell ---- */
#stage[data-theme="call"] #bgplate{background:
  radial-gradient(120% 90% at 50% 18%,#1a1430 0%,#0d0a18 55%,#07060d 100%);}
#callvis{position:absolute;inset:0;display:none;flex-direction:column;
  align-items:center;justify-content:center;gap:20px;z-index:3;pointer-events:none;}
#scene.faceless #callvis{display:flex;}
#scene.faceless #foewrap,#scene.faceless #midprops{display:none;}
#callring{width:132px;height:132px;border-radius:50%;display:flex;align-items:center;
  justify-content:center;background:radial-gradient(circle,#241c42,#150f28);
  border:2px solid #4a3b7a;box-shadow:0 0 0 12px rgba(124,58,237,.07),0 0 44px rgba(124,58,237,.28);
  animation:ringpulse 2.6s ease-in-out infinite;}
#callglyph{font-size:54px;line-height:1;color:#b79bf0;opacity:.92;}
@keyframes ringpulse{
  0%,100%{box-shadow:0 0 0 10px rgba(124,58,237,.06),0 0 34px rgba(124,58,237,.22);}
  50%{box-shadow:0 0 0 20px rgba(124,58,237,.10),0 0 56px rgba(124,58,237,.38);}
}
#wave{display:flex;align-items:center;gap:5px;height:46px;}
#wave i{display:block;width:5px;border-radius:3px;background:linear-gradient(180deg,#c9b8f5,#7c3aed);
  height:12px;animation:wavebar 1.1s ease-in-out infinite;opacity:.85;}
#wave i:nth-child(2n){animation-duration:.86s;}
#wave i:nth-child(3n){animation-duration:1.34s;}
#wave i:nth-child(1){animation-delay:-.05s} #wave i:nth-child(2){animation-delay:-.22s}
#wave i:nth-child(3){animation-delay:-.4s}  #wave i:nth-child(4){animation-delay:-.13s}
#wave i:nth-child(5){animation-delay:-.61s} #wave i:nth-child(6){animation-delay:-.32s}
#wave i:nth-child(7){animation-delay:-.75s} #wave i:nth-child(8){animation-delay:-.18s}
#wave i:nth-child(9){animation-delay:-.52s} #wave i:nth-child(10){animation-delay:-.29s}
#wave i:nth-child(11){animation-delay:-.68s} #wave i:nth-child(12){animation-delay:-.41s}
#wave i:nth-child(13){animation-delay:-.09s}
@keyframes wavebar{0%,100%{height:9px}50%{height:40px}}
#calltime{font-family:var(--mono);font-size:10px;letter-spacing:.3em;color:#7d7496;}
/* the call reacts to verdicts even though it has no face to read */
.recoil #wave i{background:linear-gradient(180deg,#9ef2c6,#1f9e63);}
.smug #wave i{background:linear-gradient(180deg,#f5a8b6,#c0304a);}
@media (prefers-reduced-motion: reduce){#wave i,#callring{animation:none!important;}}
@media (prefers-reduced-motion: reduce){
  #foe,#foeimg,#bgimg,#sweep,.bokeh{animation:none!important;}
}

/* ---- HUD: the one meter ---- */
#hud{position:absolute;top:0;left:0;right:0;padding:10px 14px 0;z-index:20;
  background:linear-gradient(180deg,rgba(7,6,13,.92),transparent);}
#hudtop{display:flex;align-items:baseline;justify-content:space-between;}
#price{font-family:var(--mono);font-size:26px;font-weight:700;letter-spacing:-.5px;transition:color .3s;}
#delta{font-family:var(--mono);font-size:12px;letter-spacing:.1em;}
#pbar{position:relative;height:8px;background:#221d2f;border-radius:5px;overflow:hidden;margin:7px 0 4px;}
#pfill{height:100%;width:100%;background:linear-gradient(90deg,var(--good),var(--bad));transition:width .45s;}
#pmark{position:absolute;top:-3px;width:2px;height:14px;background:#f2eff8;opacity:.85;}
#hudsub{display:flex;justify-content:space-between;font-family:var(--mono);
  font-size:10px;letter-spacing:.14em;color:#7d7496;}

#mus{position:absolute;top:96px;right:12px;z-index:40;background:rgba(11,9,18,.75);
  border:1px solid #332b4a;color:var(--accent2);height:28px;padding:0 11px;border-radius:14px;
  font-size:10px;letter-spacing:.14em;cursor:pointer;font-family:var(--mono);}
#who{position:absolute;bottom:8px;left:14px;z-index:16;
  font-family:var(--mono);font-size:11px;letter-spacing:.22em;color:var(--accent2);
  background:rgba(11,9,18,.75);padding:4px 10px;border-radius:6px;border-left:3px solid var(--accent);}

/* ---- dialogue ---- */
#bubblewrap{flex:none;padding:9px 14px 0;z-index:18;}
#bubble{background:#1b1728;border:2px solid #352d4d;border-radius:20px;border-top-left-radius:4px;
  padding:15px 17px;font-size:18px;line-height:1.36;min-height:78px;
  box-shadow:0 14px 40px rgba(0,0,0,.6);opacity:0;transform:translateY(12px);
  transition:opacity .22s, transform .22s, border-color .2s;}
#bubble.show{opacity:1;transform:translateY(0);}
#bubble.caught{border-color:var(--good);box-shadow:0 0 0 4px rgba(63,209,139,.25),0 14px 40px rgba(0,0,0,.6);}
#bubble.missed{border-color:var(--bad);box-shadow:0 0 0 4px rgba(224,69,92,.25),0 14px 40px rgba(0,0,0,.6);}
#bubble.wrong{border-color:var(--warn);box-shadow:0 0 0 4px rgba(240,180,92,.22),0 14px 40px rgba(0,0,0,.6);}
#bubble .why{margin-top:10px;padding-top:9px;border-top:1px solid #352d4d;
  font-size:15.5px;line-height:1.5;color:#d3cbe6;}
/* the counter — the line the player should actually say next time */
#bubble .why.counterline{font-size:17px;line-height:1.45;color:#9fe9c4;font-weight:600;}

#verdict{flex:none;height:20px;line-height:20px;margin-top:5px;text-align:center;
  font-family:var(--mono);font-size:13px;letter-spacing:.12em;
  opacity:0;transition:opacity .2s;white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis;padding:0 12px;}
#verdict.show{opacity:1;}
.v-good{color:var(--good);} .v-bad{color:var(--bad);} .v-warn{color:var(--warn);}

/* ---- choices ---- */
#action{flex:none;padding:6px 14px calc(11px + env(safe-area-inset-bottom));z-index:22;}
#choices{display:flex;gap:9px;}
#choices.stack{flex-direction:column;gap:7px;}
.ch{flex:1;border:none;border-radius:15px;padding:16px 10px;cursor:pointer;
  font-family:inherit;font-size:18px;font-weight:900;letter-spacing:.06em;color:#fff;
  background:linear-gradient(180deg,#8b5cf6,#6d28d9);box-shadow:0 7px 0 #4c1d95;
  transition:transform .07s, box-shadow .07s;}
.ch:active{transform:translateY(5px);box-shadow:0 2px 0 #4c1d95;}
.ch.ghost{flex:0 0 42%;background:#2b2544;border:2px solid #6f5fa8;color:#f2eefc;
  box-shadow:0 7px 0 #1b1730;font-size:15px;font-weight:800;letter-spacing:.04em;}
.ch.ghost:active{box-shadow:0 2px 0 #1b1730;}
.ch.name{background:linear-gradient(180deg,#34d189,#1f9e63);box-shadow:0 7px 0 #14724a;
  font-family:var(--mono);font-size:14px;font-weight:700;letter-spacing:.12em;padding:14px 10px;
  display:flex;flex-direction:column;align-items:center;gap:3px;}
.ch.name:active{box-shadow:0 2px 0 #14724a;}
.ch.name .def{display:none;font-family:inherit;font-size:11px;font-weight:400;
  letter-spacing:.02em;color:rgba(255,255,255,.85);line-height:1.3;text-transform:none;}
#choices.showdefs .ch.name .def{display:block;}
#choices.showdefs .ch.name{padding:11px 10px;}
.defsbtn{border:none;background:none;color:#8f7fc4;font-family:var(--mono);
  font-size:10px;letter-spacing:.16em;cursor:pointer;padding:6px;align-self:center;}
/* NEXT is the only way forward after a verdict — it should read as the action */
.ch.nextbtn{background:linear-gradient(180deg,#a78bfa,#7b34ec);border:none;color:#fff;
  box-shadow:0 7px 0 #4c1d95, 0 0 26px rgba(167,139,250,.38);
  font-size:19px;font-weight:900;letter-spacing:.14em;
  animation:nextpulse 1.7s ease-in-out infinite;}
.ch.nextbtn:active{box-shadow:0 2px 0 #4c1d95;}
@keyframes nextpulse{
  0%,100%{filter:brightness(1);box-shadow:0 7px 0 #4c1d95, 0 0 20px rgba(167,139,250,.30);}
  50%{filter:brightness(1.12);box-shadow:0 7px 0 #4c1d95, 0 0 34px rgba(167,139,250,.52);}
}

/* trophies */
#cabinet{max-width:360px;width:100%;margin:-6px 0 16px;text-align:center;}
.shelfhead{font-family:var(--mono);font-size:10px;letter-spacing:.24em;color:#8f7fc4;margin-bottom:5px;}
.shelfrow{font-size:22px;letter-spacing:.18em;line-height:1.4;}
.shelfprog{font-family:var(--mono);font-size:10px;letter-spacing:.16em;color:#6f6688;margin-top:5px;}
#gained{max-width:360px;width:100%;margin:10px 0 0;flex:none;}
.gainhead{font-family:var(--mono);font-size:10px;letter-spacing:.24em;color:var(--good);
  text-align:center;margin-bottom:7px;}
.trophy{display:grid;grid-template-columns:38px 1fr;grid-template-rows:auto auto;
  gap:0 10px;text-align:left;background:#10160f;border:1px solid #2c4a33;border-radius:12px;
  padding:9px 12px;margin-bottom:6px;animation:tpop .45s cubic-bezier(.2,1.6,.4,1) backwards;}
.trophy .temoji{grid-row:1/3;font-size:26px;align-self:center;}
.trophy .tname{font-family:var(--mono);font-size:12px;font-weight:700;letter-spacing:.1em;color:#7ce8b6;}
.trophy .thow{font-size:12px;color:#8d84a6;line-height:1.35;}
@keyframes tpop{from{transform:scale(.7);opacity:0}to{transform:scale(1);opacity:1}}

/* confetti (wins only) */
.confetti{position:absolute;top:-12px;width:8px;height:12px;border-radius:2px;z-index:70;
  pointer-events:none;animation:cfall linear forwards;}
@keyframes cfall{
  0%{transform:translateY(-10px) rotate(0) ;opacity:1}
  90%{opacity:1}
  100%{transform:translateY(105vh) rotate(560deg);opacity:0}
}
.ch:disabled{opacity:.45;}
#sub{text-align:center;font-family:var(--mono);font-size:10px;
  letter-spacing:.16em;color:#6f6688;margin-top:8px;min-height:12px;}

/* ---- overlays ---- */
.screen{position:absolute;inset:0;z-index:60;display:flex;flex-direction:column;
  align-items:center;justify-content:center;padding:26px;text-align:center;
  background:rgba(7,6,13,.97);backdrop-filter:blur(8px);}
.screen h1{font-size:44px;font-weight:900;letter-spacing:-1px;
  background:linear-gradient(180deg,#ffffff,#c9b8f5);
  -webkit-background-clip:text;background-clip:text;color:transparent;}
.screen h2{font-size:28px;font-weight:900;margin-bottom:8px;}
/* readability: light lavender, not saturated purple, over the dark ground */
.tagline{font-family:var(--mono);font-size:11px;letter-spacing:.3em;color:#c9b8f5;margin-bottom:14px;}
#subtitle{font-family:var(--mono);font-size:12px;letter-spacing:.26em;color:#e8e2f7;
  margin:6px 0 4px;font-weight:700;}
#blurb{font-size:15px;line-height:1.5;color:#d9d2ec;max-width:340px;margin:0 0 16px;}

/* cast strip */
#cast{width:100%;max-width:380px;margin:0 0 16px;}
.casthead{font-family:var(--mono);font-size:10px;letter-spacing:.24em;color:#9b8fc0;margin-bottom:8px;}
.castrow{display:flex;gap:10px;justify-content:center;}
.castchip{display:flex;flex-direction:column;align-items:center;gap:3px;width:76px;}
.castchip img{width:64px;height:64px;border-radius:50%;object-fit:cover;object-position:top;
  background:#1b1728;border:2px solid #4a3f6e;}
.castchip.locked img{filter:brightness(.45) saturate(.4);border-color:#2c2540;}
.castchip.noimg img{visibility:hidden;}
.castchip .castname{font-family:var(--mono);font-size:10px;letter-spacing:.12em;color:#e8e2f7;font-weight:700;}
.castchip.locked .castname{color:#8d84a6;}
.castchip .castep{font-family:var(--mono);font-size:9px;letter-spacing:.12em;color:#6f6688;}

/* attribution */
.credit{font-family:var(--mono);font-size:10px;letter-spacing:.14em;color:#9b8fc0;
  text-decoration:none;margin-top:16px;border-bottom:1px solid #3a2f52;padding-bottom:2px;}
.credit:hover{color:#c9b8f5;}
#credit-end{margin-top:20px;margin-bottom:8px;flex:none;}
.box{text-align:left;background:rgba(19,16,32,.88);border:1px solid #2a2340;border-radius:14px;
  padding:14px 16px;max-width:360px;margin-bottom:18px;backdrop-filter:blur(3px);}
.box div{font-size:15px;margin:7px 0;color:#cfc7e2;line-height:1.4;}
.btn{background:var(--accent);color:#fff;border:none;border-radius:14px;padding:15px 40px;
  font-size:18px;font-weight:800;cursor:pointer;font-family:inherit;}
.ghostbtn{background:#1f1a2e;border:1px solid #4a3f6e;color:#b0a6c9;font-weight:700;}
.stat{font-family:var(--mono);font-size:13px;color:#8d84a6;margin:3px 0;}
.hide{display:none!important;}
/* two buttons side by side when they fit, stacked full-width when they don't —
   never squeezed or clipped */
.endbtns{display:flex;gap:10px;margin-top:14px;flex-wrap:wrap;justify-content:center;
  width:100%;max-width:380px;}
.endbtns .btn{flex:1 1 150px;padding:14px 10px;font-size:15px;white-space:nowrap;}
/* next episode — the reason to keep going, so it outranks RUN IT BACK */
.btn.nextep{margin-top:18px;background:linear-gradient(180deg,#34d189,#1f9e63);
  box-shadow:0 6px 0 #14724a,0 0 26px rgba(52,209,137,.32);font-size:17px;
  letter-spacing:.08em;flex:none;animation:nexteppulse 1.9s ease-in-out infinite;}
.btn.nextep:active{box-shadow:0 2px 0 #14724a;}
@keyframes nexteppulse{
  0%,100%{box-shadow:0 6px 0 #14724a,0 0 20px rgba(52,209,137,.26);}
  50%{box-shadow:0 6px 0 #14724a,0 0 34px rgba(52,209,137,.48);}
}

/* episode row on the title screen (only once more than one is open) */
/* 11 chips: one scrollable row, so the cast poster keeps its room */
#episodes{display:flex;gap:7px;justify-content:flex-start;flex-wrap:nowrap;margin:12px 0 0;
  overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding:0 2px 4px;}
#episodes::-webkit-scrollbar{display:none;}
.epchip{flex:0 0 auto;}
.epchip{font-family:var(--mono);font-size:10px;letter-spacing:.14em;cursor:pointer;
  background:rgba(31,26,46,.85);border:1px solid #4a3f6e;color:#cfc7e2;
  padding:7px 11px;border-radius:13px;}
.epchip.on{background:linear-gradient(180deg,#8b5cf6,#6d28d9);border-color:#8b5cf6;color:#fff;font-weight:700;}
.epchip.locked{opacity:.4;cursor:default;}

#end{justify-content:flex-start;padding-top:22px;overflow-y:auto;}

/* ---- title screen: key art as a hero layer ---- */
#start{justify-content:space-between;padding:28px 22px calc(16px + env(safe-area-inset-bottom));
  overflow-y:auto;overflow-x:hidden;background:#07060d;}
#start > *{flex:none;position:relative;z-index:2;}
/* The cast fills the whole screen behind the UI — always visible on any
   screen size; the scrim keeps the type readable over the faces. */
#keyart{position:fixed;inset:0;width:100%;height:100%;object-fit:cover;
  object-position:center 32%;z-index:0;opacity:0;
  transition:opacity .9s ease-out;pointer-events:none;}
#start.art #keyart{opacity:.62;animation:posterdrift 40s ease-in-out infinite alternate;}
@keyframes posterdrift{
  from{transform:scale(1.0)}
  to{transform:scale(1.07)}
}
/* scrim: dark where text lives, near-clear across the faces */
#keyscrim{position:absolute;inset:0;z-index:1;pointer-events:none;
  background:
    linear-gradient(180deg,
      rgba(7,6,13,.86) 0%, rgba(7,6,13,.62) 22%,
      rgba(7,6,13,.14) 40%, rgba(7,6,13,.10) 56%,
      rgba(7,6,13,.52) 70%, rgba(7,6,13,.86) 82%,
      rgba(7,6,13,.94) 100%),
    radial-gradient(115% 50% at 50% 50%, rgba(124,58,237,.20), transparent 70%);}
.topblock,.botblock{display:flex;flex-direction:column;align-items:center;width:100%;}
.topblock{gap:0;padding-top:4px;}

/* big stacked wordmark — fills the dark headroom the poster leaves open */
/* scales with width AND height, so short screens don't lose the whole stage */
#start h1.wordmark{font-size:clamp(50px,min(23vw,12.5vh),112px);line-height:.85;
  letter-spacing:-.035em;margin:0;text-shadow:0 6px 34px rgba(124,58,237,.60);}
#start #subtitle{font-size:clamp(12px,3.3vw,14.5px);letter-spacing:.22em;color:#f2edff;
  margin:12px 0 5px;text-wrap:balance;}
#start .tagline{font-size:12px;letter-spacing:.34em;margin-bottom:12px;}
#start #blurb{font-size:clamp(15px,4.1vw,17px);line-height:1.5;max-width:358px;margin-bottom:0;}
/* glassier on the title screen so the poster still reads behind it */
#start .box{font-size:13.5px;padding:11px 14px;margin-bottom:12px;
  background:rgba(19,16,32,.80);backdrop-filter:blur(6px);}
#start .box div{font-size:13.5px;margin:5px 0;}
@media (prefers-reduced-motion: reduce){
  #start.art #keyart,.ch.nextbtn,.btn.nextep{animation:none!important;}
}

/* end panel: painted 16:9 art when present, flat color block otherwise */
#endart{position:relative;overflow:hidden;width:100%;max-width:290px;aspect-ratio:16/9;
  border-radius:14px;border:1px solid #2a2340;margin:0 0 12px;background:#131020;flex:none;}
#endartimg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;
  opacity:0;transition:opacity .4s;}
#endartimg.show{opacity:1;}
#endart[data-art="win-exit"]{background:linear-gradient(160deg,#1d4534,#0e2a1e);}
#endart[data-art="win-deal"]{background:linear-gradient(160deg,#1d3a52,#122435);}
#endart[data-art="mid-standoff"]{background:linear-gradient(160deg,#3d3a4e,#242130);}
#endart[data-art="lose-sold"]{background:linear-gradient(160deg,#4e2530,#2c1319);}

/* session log — the signature */
#slog{max-width:360px;width:100%;text-align:left;margin:14px 0 4px;
  background:#0e0b16;border:1px solid #3a2f52;border-radius:12px;padding:13px 15px;
  opacity:0;transform:translateY(8px);transition:opacity .5s, transform .5s;flex:none;}
#slog.show{opacity:1;transform:translateY(0);}
#slog h3{font-family:var(--mono);font-size:10px;letter-spacing:.24em;
  color:#8f7fc4;font-weight:700;margin-bottom:9px;}
#slog p{font-size:14px;line-height:1.45;color:#d4cce8;margin:8px 0;}
#slog p .ms{font-family:var(--mono);color:var(--warn);font-weight:700;}
#slog .quiet{font-size:12px;color:#7d7496;font-style:italic;margin-top:11px;}

#recap{max-width:380px;width:100%;margin:12px 0;text-align:left;flex:none;}
.rline{font-size:13px;padding:7px 10px;border-radius:8px;margin-bottom:5px;background:#141020;
  border-left:3px solid #333;}
.rline b{font-family:var(--mono);font-size:11px;letter-spacing:.1em;display:block;margin-bottom:2px;}
.rtell{margin-top:3px;color:#8d84a6;font-size:12px;}
.r-good{border-left-color:var(--good);} .r-good b{color:var(--good);}
.r-bad{border-left-color:var(--bad);} .r-bad b{color:var(--bad);}
.r-warn{border-left-color:var(--warn);} .r-warn b{color:var(--warn);}
/* nothing-was-idle reveals: the small talk, unmasked */
.r-reveal{border-left-color:var(--accent2);background:#151024;}
.r-reveal b{color:var(--accent2);font-weight:600;}
.r-reveal.rhead b{letter-spacing:.14em;}

/* ---- pre-start variant pick (THE FEED): one question, no branch ---- */
.variantq{font-family:var(--mono);font-size:10px!important;letter-spacing:.2em;
  color:#8f7fc4!important;margin-top:10px!important;}
.variantrow{display:flex;gap:7px;margin-top:2px;}
.varchip{flex:1;font-family:var(--mono);font-size:11px;letter-spacing:.08em;cursor:pointer;
  background:#1f1a2e;border:1px solid #4a3f6e;color:#cfc7e2;padding:9px 6px;border-radius:11px;}
.varchip.on{background:linear-gradient(180deg,#8b5cf6,#6d28d9);border-color:#8b5cf6;
  color:#fff;font-weight:700;}

/* ---- boss levels: the room gets meaner ---- */
#stage[data-boss="1"] #who{border-left-color:var(--bad);color:#f0a9b5;}
#stage[data-boss="1"] .bokeh{background:rgba(224,69,92,.10);}
#stage[data-boss="1"] #sweep{background:linear-gradient(115deg,transparent 30%,rgba(224,69,92,.07) 45%,transparent 60%);
  background-size:250% 100%;}

/* ---- chat theme (THE MATCH): the stolen photo in a profile card.
   The photo never leans, never reacts — that absence is the level. ---- */
#stage[data-theme="chat"] #bgplate{background:
  radial-gradient(120% 90% at 50% 16%,#2a1626 0%,#160d18 55%,#0a060d 100%);}
#stage[data-theme="chat"] #foe.has-img{width:min(62%,250px);height:auto;max-height:none;
  aspect-ratio:1/1;bottom:12%;position:relative;animation:none;}
#stage[data-theme="chat"] #foe.has-img #foeimg{border-radius:22px;object-fit:cover;
  object-position:center 18%;border:2px solid #6e3b63;box-shadow:0 0 44px rgba(224,69,150,.25);
  animation:none;}
#stage[data-theme="chat"] #foewrap{align-items:center;}
#stage[data-theme="chat"] .lean #foe,#stage[data-theme="chat"] .recoil #foe,
#stage[data-theme="chat"] .smug #foe{transform:none;filter:none;}
#stage[data-theme="chat"] #foe.has-img::after{content:"● ONLINE NOW";position:absolute;
  left:50%;bottom:-26px;transform:translateX(-50%);font-family:var(--mono);font-size:10px;
  letter-spacing:.22em;color:#58d68d;white-space:nowrap;}

/* ---- feed theme: the scroll that reads you back ---- */
#stage[data-theme="feed"] #bgplate{background:
  radial-gradient(120% 90% at 50% 14%,#101c2e 0%,#0a1220 55%,#06090f 100%);}
#stage[data-theme="feed"] #callring{border-color:#2f5d8a;background:radial-gradient(circle,#14283e,#0b1624);
  box-shadow:0 0 0 12px rgba(56,132,255,.06),0 0 44px rgba(56,132,255,.22);}
#stage[data-theme="feed"] #callglyph{color:#7db4f0;}
#stage[data-theme="feed"] #wave i{background:linear-gradient(180deg,#a8d0f5,#2f6fd0);}
#stage[data-theme="feed"] #calltime{color:#5f7d9c;}

/* ---- mirror theme: the game looks back ---- */
#stage[data-theme="mirror"] #bgplate{background:
  radial-gradient(120% 90% at 50% 20%,#241633 0%,#120a1c 55%,#07060d 100%);}
#stage[data-theme="mirror"] #callring{animation:ringpulse 2.6s ease-in-out infinite, mirrorhue 9s linear infinite;}
#stage[data-theme="mirror"] #callglyph{color:#e8e2f7;}
@keyframes mirrorhue{from{filter:hue-rotate(0)}to{filter:hue-rotate(360deg)}}
@media (prefers-reduced-motion: reduce){#stage[data-theme="mirror"] #callring{animation:none!important;}}
