:root{
  --red:#e63232;
  --steel:#96c6ee;
  --ink:#0e1b2b;
  --white:#f4f6f8;
  --fade:520ms;
  --scene1:url('assets/scenes/00/shot-01.webp');
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  background:#000;color:var(--white);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
  font-weight:300;overflow:hidden;
}

/* screens */
.screen{position:fixed;inset:0;display:none;align-items:center;justify-content:center}
.screen.active{display:flex}
#game.active{display:block}

/* ---- MENU (city background + zoom-in) ---- */
.menu-bg{position:fixed;inset:0;width:100%;height:100%;object-fit:cover;
  transform:scale(1.05);transition:transform 1200ms ease-in,opacity 700ms ease;will-change:transform}
.menu-vignette{position:fixed;inset:0;pointer-events:none;
  background:radial-gradient(120% 90% at 50% 42%,rgba(0,0,0,.25) 0%,rgba(0,0,0,.55) 55%,rgba(0,0,0,.82) 100%)}
.menu-inner{position:relative;text-align:center;padding:2rem;animation:rise var(--fade) ease both;transition:opacity 600ms ease}
#menu.zooming .menu-bg{transform:scale(1.7)}
#menu.zooming .menu-inner{opacity:0}
#menu.zooming .menu-vignette{opacity:0;transition:opacity 800ms ease}
#menu.fading{opacity:0;transition:opacity 500ms ease}

.title{font-size:clamp(3.5rem,11.5vw,7.4rem);font-weight:200;letter-spacing:.1em;text-align:center;
  display:flex;flex-direction:column;align-items:center;gap:.1em;line-height:1.02;
  text-shadow:0 2px 30px rgba(0,0,0,.7)}
.title .l1{display:inline-block;border-bottom:3px solid var(--red);padding-bottom:.08em}
.title .l2{display:inline-block;border-bottom:3px solid var(--red);padding-bottom:.08em}
.title.small{font-size:clamp(1.8rem,5vw,3rem);border-bottom:none}
.subtitle{margin-top:1.2rem;letter-spacing:.3em;font-size:1rem;font-weight:700;color:#e3e9ef;text-transform:uppercase;text-shadow:0 2px 12px rgba(0,0,0,.85)}
.menu-buttons{margin-top:2.6rem;display:flex;gap:1rem;justify-content:center;flex-wrap:wrap}
.btn{background:var(--red);color:#fff;border:none;padding:1.05em 3em;font-size:1.1rem;
  letter-spacing:.22em;font-weight:500;cursor:pointer;transition:transform .15s}
.btn:hover{transform:translateY(-2px)}
.disclaimer{position:fixed;left:0;right:0;bottom:2.4vh;margin:0;padding:0 1.4rem;text-align:center;
  font-size:.85rem;color:#d8dee5;letter-spacing:.05em;line-height:1.5;text-shadow:0 1px 10px rgba(0,0,0,.95)}
.to-be-continued{margin:1.4rem 0 2.2rem;color:#aab2bc;letter-spacing:.04em}

/* ---- STAGE ---- */
#stage{position:fixed;inset:0;background:#000;overflow:hidden}
#shot-img{width:100%;height:100%;object-fit:cover;opacity:0;transform:scale(1.04);
  transition:opacity var(--fade) ease, transform 6s ease-out}
#shot-img.show{opacity:1;transform:scale(1)}
#game.arriving #shot-img{animation:stepIn 1100ms ease-out both}
#scrim{display:none}

/* ---- TEXT ENCART + NAV ---- */
#textwrap{position:fixed;left:0;right:0;bottom:5.5vh;z-index:5;
  display:flex;flex-direction:row;align-items:flex-end;justify-content:center;gap:16px;
  opacity:0;transition:opacity var(--fade) ease}
#textwrap.show{opacity:1}
#textbox{position:relative;width:min(94vw,560px);padding:18px 24px;color:var(--ink);
  background:rgba(64,96,142,.9);   /* 90% opacity blue */
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);
  border-left:3px solid var(--red);
  clip-path:polygon(0 0,calc(100% - 22px) 0,100% 22px,100% 100%,0 100%);   /* chamfered top-right (ME) */
  box-shadow:0 22px 55px rgba(0,0,0,.55)}
#textbox::before{content:"";position:absolute;top:0;left:0;width:56%;height:3px;background:var(--red)}   /* red top rule */
#textbox::after{content:"";position:absolute;top:0;right:0;width:22px;height:22px;background:var(--red);
  clip-path:polygon(100% 0,0 0,100% 100%)}                                  /* red chamfer accent */
.hud{position:absolute;width:13px;height:13px;border:2px solid rgba(255,255,255,.6);pointer-events:none}
.hud.bl{left:9px;bottom:9px;border-top:none;border-right:none}
.hud.br{right:9px;bottom:9px;border-top:none;border-left:none}
.scan{position:absolute;left:0;top:0;width:100%;height:2px;pointer-events:none;opacity:0;
  background:linear-gradient(90deg,transparent,rgba(230,50,50,.95),transparent)}
#textwrap.show .scan{animation:scan 850ms ease-out}                          /* one red sweep per beat */

#blocks>:first-child{margin-top:0}
/* DESKTOP ONLY: cap the text area at ~the shot-21_7 height; scroll longer beats with a red
   scrollbar matching the box. Mobile (portrait) is untouched — #textbox owns its 36vh scroll. */
@media (orientation: landscape){
  #blocks{max-height:190px;overflow-y:auto;padding-right:10px;
    scrollbar-width:thin;scrollbar-color:var(--red) rgba(0,0,0,.22)}
  #blocks::-webkit-scrollbar{width:6px}
  #blocks::-webkit-scrollbar-track{background:rgba(0,0,0,.22)}
  #blocks::-webkit-scrollbar-thumb{background:var(--red)}
  #blocks::-webkit-scrollbar-thumb:hover{background:#ff5252}
}
/* NARRATION — neutral world-voice */
.nar{font-size:clamp(.92rem,1.6vw,1.2rem);line-height:1.6;font-weight:400;color:#f4f6f8;text-shadow:0 1px 3px rgba(0,0,0,.55);text-wrap:pretty}
/* DIALOGUE — red speaker name, then the line: NOAH: "..."; inline flow so wrapped lines
   return to the LEFT margin (under the speaker name), not indented under the quote */
.dlg{margin-top:.6rem;display:block;font-size:clamp(.94rem,1.65vw,1.24rem);line-height:1.55;text-shadow:0 1px 3px rgba(0,0,0,.55);text-wrap:pretty}
.who{color:#ff5a5a;font-weight:700;font-size:.95em;letter-spacing:.04em;margin-right:.4em}
.who::after{content:":"}
.line{color:#fff}
/* THOUGHT — Faith's interior voice: cool italic, red-washed block */
.tho{margin-top:.6rem;font-style:italic;color:#eaf3fd;font-size:clamp(.96rem,1.65vw,1.24rem);line-height:1.5;text-wrap:pretty;
  padding:6px 12px;border-left:3px solid var(--red);background:rgba(230,50,50,.12);text-shadow:0 1px 3px rgba(0,0,0,.6)}
/* CHOICES — the A/B/C branch */
#choices{display:none;flex-direction:column;gap:8px;margin-top:6px}
.choice-prompt{color:#ff8a8a;font-style:italic;margin-bottom:8px;font-size:clamp(.85rem,1.4vw,1.05rem)}
.choice{display:block;text-align:left;width:100%;cursor:pointer;color:#f4f6f8;font-family:inherit;
  font-size:clamp(.86rem,1.45vw,1.08rem);line-height:1.4;
  background:rgba(255,255,255,.06);border:1px solid rgba(150,198,238,.35);border-left:3px solid var(--red);
  padding:10px 14px;transition:background .15s,border-color .15s,transform .15s;text-shadow:0 1px 3px rgba(0,0,0,.55)}
.choice:hover{background:rgba(230,50,50,.22);border-color:var(--red);transform:translateX(3px)}
#narration:empty,#thought:empty{display:none}
.pd{visibility:hidden}
.cr{display:none;width:0;overflow:visible;color:var(--red);animation:blink .8s steps(1) infinite}

#nav{display:flex;flex-direction:column;gap:12px;align-items:center;align-self:flex-end}
.navarrow{width:56px;height:40px;color:#fff;font-size:1.4rem;line-height:1;cursor:pointer;border:none;
  background:var(--red);
  clip-path:polygon(14% 0,100% 0,86% 100%,0 100%);                          /* slanted = kinetic */
  display:flex;align-items:center;justify-content:center;transition:transform .15s,background .15s,box-shadow .15s}
.navarrow:hover{background:#ff5252;transform:translateY(-3px);box-shadow:0 6px 20px rgba(230,50,50,.55)}
.navarrow.hidden{opacity:0;pointer-events:none}
#next-btn.ready{animation:pulse 1.8s ease-in-out infinite}
/* back arrow: discrete, not red */
#back-btn{background:rgba(28,38,54,.42);color:rgba(238,242,246,.65)}
#back-btn:hover{background:rgba(28,38,54,.7);color:#fff;box-shadow:none;transform:translateY(-2px)}

/* ---- LEFT layout variant: encart pinned left, vertically centered ---- */
body[data-layout="left"] #textwrap{left:4vw;right:auto;top:0;bottom:0;justify-content:center;align-items:flex-start}
body[data-layout="left"] #textbox{width:min(42vw,470px)}
body[data-layout="left"] #nav{align-self:flex-start}

/* ---- progress / sound ---- */
#progress{position:fixed;top:2.2vh;left:0;right:0;display:flex;gap:8px;justify-content:center;z-index:6}
#progress .dot{width:26px;height:3px;background:rgba(255,255,255,.32);transition:background .3s}
#progress .dot.on{background:var(--red)}
.sound{position:fixed;z-index:7;width:44px;height:44px;border-radius:50%;
  background:rgba(10,12,15,.5);border:1px solid #5a626c;color:#e7ebef;cursor:pointer;
  display:flex;align-items:center;justify-content:center;opacity:.8;transition:opacity .2s,border-color .15s}
.sound:hover{border-color:var(--red);opacity:1}
.sound .slash{display:none}
.sound.muted .slash{display:block}
#sound-toggle{right:2vw;bottom:3vh}                  /* music (note icon) */
#sound-toggle.muted .note{opacity:.4}
#vo-toggle{right:2vw;bottom:calc(3vh + 54px)}        /* voices (speaker icon), just above the music icon */
#vo-toggle.muted .wave{display:none}

#fade{position:fixed;inset:0;background:#000;opacity:0;pointer-events:none;z-index:30;transition:opacity .6s ease}
#fade.on{opacity:1}

@keyframes rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes pulse{0%,100%{opacity:.55}50%{opacity:1}}
@keyframes blink{0%,50%{opacity:1}51%,100%{opacity:0}}
@keyframes stepIn{from{transform:scale(1.5);opacity:.2}to{transform:scale(1);opacity:1}}
@keyframes scan{0%{opacity:.9;top:0}85%{opacity:.5}100%{opacity:0;top:calc(100% - 2px)}}

/* ---- SCENE / SHOT LABEL (top-left HUD: spot which shot to replace) ---- */
#scene-label{
  position:fixed; top:14px; left:16px; z-index:40; pointer-events:none;
  font-family:"SFMono-Regular",ui-monospace,Menlo,Consolas,monospace;
  line-height:1.25; text-shadow:0 1px 6px rgba(0,0,0,.92);
  opacity:0; transition:opacity 400ms ease;
}
#game.active #scene-label{opacity:1; pointer-events:auto; cursor:pointer}   /* clickable -> dev scene-jump menu */

/* ---- in-game swipe/tilt hint (mobile, shown on the first scene) ---- */
#swipe-hint{
  position:fixed; left:50%; top:38%; transform:translate(-50%,-50%); z-index:9;
  display:none; opacity:0; pointer-events:none; transition:opacity .45s ease;
  padding:11px 20px; border-radius:999px; white-space:nowrap;
  background:rgba(12,16,22,.74); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
  border:1px solid rgba(150,198,238,.45); box-shadow:0 8px 28px rgba(0,0,0,.55);
  color:#eaf1f8; font-size:.95rem; letter-spacing:.04em; text-shadow:0 1px 6px rgba(0,0,0,.8);
  animation:pulse 2s ease-in-out infinite;
}
#swipe-hint .sw{ color:var(--steel); font-size:1.15em; margin-right:.35em; }
#swipe-hint.show{ opacity:1; }
@media (orientation: portrait){ #swipe-hint{ display:block; } }

/* ---- DEV scene-jump drawer (remove for release) ---- */
#scene-nav-backdrop{position:fixed;inset:0;z-index:44;background:rgba(0,0,0,.45);
  opacity:0;pointer-events:none;transition:opacity .25s ease}
#scene-nav-backdrop.on{opacity:1;pointer-events:auto}
#scene-nav{position:fixed;top:0;left:0;bottom:0;z-index:45;width:min(50%,460px);
  background:rgba(12,16,22,.97);border-right:2px solid var(--red);
  transform:translateX(-100%);transition:transform .28s ease;
  overflow-y:auto;padding:18px 0;
  font-family:"SFMono-Regular",ui-monospace,Menlo,Consolas,monospace}
#scene-nav.open{transform:translateX(0)}
#scene-nav .sn-head{padding:6px 18px 12px;color:rgba(244,246,248,.5);font-size:.62rem;letter-spacing:.18em;text-transform:uppercase}
.sn-item{display:block;width:100%;text-align:left;background:none;border:none;border-left:3px solid transparent;
  cursor:pointer;padding:10px 18px;font-family:inherit}
.sn-item:hover,.sn-item.cur{background:rgba(230,50,50,.14);border-left-color:var(--red)}
.sn-item .sn-id{display:block;font-size:.82rem;font-weight:600;letter-spacing:.12em;color:var(--steel);text-transform:uppercase}
.sn-item .sn-title{display:block;font-size:.64rem;letter-spacing:.06em;margin-top:2px;color:rgba(244,246,248,.55);text-transform:uppercase}
.sn-shots{display:flex;flex-wrap:wrap;gap:5px;padding:2px 14px 12px}
.sn-shot{font-family:inherit;font-size:.66rem;letter-spacing:.04em;color:rgba(244,246,248,.62);background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.09);border-radius:4px;padding:3px 7px;cursor:pointer;transition:background .15s,color .15s,border-color .15s}
.sn-shot:hover{background:rgba(255,255,255,.14);color:#fff}
.sn-shot.cur{color:#fff;border-color:var(--red);background:rgba(230,50,50,.2)}
#scene-label .sl-id{
  display:block; font-size:.82rem; font-weight:600; letter-spacing:.14em;
  color:var(--steel); text-transform:uppercase;
}
#scene-label .sl-title{
  display:block; font-size:.64rem; letter-spacing:.07em; margin-top:2px;
  color:rgba(244,246,248,.55); text-transform:uppercase;
}

/* ============ MOBILE / PORTRAIT ============ */
/* image fills the top ~64% of the screen; the text encart owns the bottom ~36%
   as its own band so it never eats into the picture. Next/back arrows sit just
   ABOVE the encart; the sound icon moves to the top-right. */
@media (orientation: portrait){
  #stage{ inset:0 0 auto 0; height:64vh; background:#000; }
  #shot-img{ width:100%; height:100%; object-fit:cover; }

  #textwrap{ left:0; right:0; top:auto; bottom:0; height:36vh;
             display:block; gap:0; padding:0; }

  #textbox{ position:absolute; left:0; right:0; bottom:0; top:48px;
            width:auto; max-width:none; margin:0; padding:16px 18px 18px;
            overflow-y:auto; clip-path:none;
            background:rgba(64,96,142,.94); box-shadow:0 -10px 30px rgba(0,0,0,.5); }
  #textbox::after{ display:none; }                 /* drop the desktop chamfer accent */

  /* nav arrows in the 48px band just above the encart */
  #back-btn, #next-btn{ position:absolute; top:4px; width:54px; height:40px; z-index:8; }
  #next-btn{ right:14px; }
  #back-btn{ left:14px; }

  /* sound icon top-right, voices icon just below it */
  #sound-toggle{ top:34px; right:14px; bottom:auto; }   /* aligned with the scene label, below the progress dashes */
  #vo-toggle{ top:86px; right:14px; bottom:auto; }

  /* bigger, comfortable reading on phones */
  .nar{ font-size:1.06rem; line-height:1.5; }
  .dlg{ font-size:1.06rem; line-height:1.45; }
  .tho{ font-size:1.04rem; }
  .line{ font-size:1.02em; }
  .choice{ font-size:1rem; padding:12px 14px; }
  .choice-prompt{ font-size:1rem; }

  /* scene label dropped below the progress dots so they don't overlap */
  #scene-label{ top:34px; left:12px; }

  /* mobile-only menu hint: teach the swipe-to-pan + tap-to-continue gestures */
  .mobile-hint{ display:flex; }

  /* keep the title lines ("MIRROR'S EDGE" / "REBORN") each on ONE line on phones */
  .title{ font-size:clamp(2.3rem,9.8vw,3.9rem); letter-spacing:.03em; }
  .title .l1, .title .l2{ white-space:nowrap; }
}

/* mobile menu hint — hidden by default (desktop), shown only in portrait above */
.mobile-hint{
  display:none; align-items:center; justify-content:center; gap:.5em; flex-wrap:wrap;
  margin-top:1.6rem; font-size:.8rem; letter-spacing:.04em; color:#cfd9e6;
  text-shadow:0 1px 8px rgba(0,0,0,.9); animation:pulse 2.4s ease-in-out infinite;
}
.mobile-hint .sw{ font-size:1.15em; color:var(--steel); }
.mobile-hint .ar{ color:var(--red); font-weight:700; }

/* ============ ACCOUNT (Lot 1): auth / profile / admin panels ============ */
/* the scene-jump drawer is contributor/admin only: no pointer affordance for players */
body:not(.devnav) #scene-label{ cursor:default; }

.btn-ghost{
  background:rgba(255,255,255,.06); color:#eaf1f8; border:1px solid rgba(150,198,238,.4);
  padding:.6em 1.4em; font-size:.82rem; letter-spacing:.16em; font-weight:500; cursor:pointer;
  font-family:inherit; transition:background .15s,border-color .15s;
}
.btn-ghost:hover{ background:rgba(230,50,50,.2); border-color:var(--red); }
.menu-account{ margin-top:1.1rem; }
.privacy-link{ color:#d8dee5; text-decoration:underline; }

#account-chip{
  position:fixed; top:14px; right:16px; z-index:8; display:flex; align-items:center; gap:10px;
  background:rgba(10,12,15,.55); border:1px solid rgba(150,198,238,.4); color:#eaf1f8;
  padding:7px 14px; cursor:pointer; font-family:inherit; font-size:.82rem; letter-spacing:.1em;
  clip-path:polygon(0 0,calc(100% - 12px) 0,100% 12px,100% 100%,0 100%);
  transition:border-color .15s;
}
#account-chip:hover{ border-color:var(--red); }
#chip-avatar{ width:26px; height:26px; border-radius:50%; object-fit:cover; display:none; }
#chip-initial{ width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:rgba(230,50,50,.32); border:1px solid rgba(230,50,50,.55); font-weight:600; font-size:.8rem; }
/* portrait in-game: compact circle stacked under the sound/voice icons (right column) */
@media (orientation: portrait){
  #account-chip{ top:138px; right:14px; padding:0; width:44px; height:44px; gap:0;
    border-radius:50%; clip-path:none; justify-content:center; }
  #chip-name{ display:none; }
  #chip-avatar{ width:32px; height:32px; }
  #chip-initial{ width:32px; height:32px; }
}

#acct-backdrop{ position:fixed; inset:0; z-index:58; background:rgba(0,0,0,.6);
  opacity:0; pointer-events:none; transition:opacity .25s ease; }
#acct-backdrop.on{ opacity:1; pointer-events:auto; }
.acct-panel{
  position:fixed; z-index:60; top:50%; left:50%; transform:translate(-50%,-46%) scale(.98);
  width:min(92vw,420px); max-height:86vh; overflow-y:auto;
  background:rgba(12,16,22,.97); border-left:3px solid var(--red);
  clip-path:polygon(0 0,calc(100% - 22px) 0,100% 22px,100% 100%,0 100%);
  box-shadow:0 22px 55px rgba(0,0,0,.65); padding:26px 28px 30px;
  opacity:0; pointer-events:none; transition:opacity .22s ease,transform .22s ease;
}
.acct-panel.open{ opacity:1; pointer-events:auto; transform:translate(-50%,-50%) scale(1); }
.acct-panel.acct-wide{ width:min(94vw,760px); }
.acct-title{ font-weight:200; letter-spacing:.22em; font-size:1.4rem; margin-bottom:1.1rem;
  border-bottom:2px solid var(--red); padding-bottom:.35em; display:flex; align-items:baseline; gap:12px; }
.acct-role{ font-size:.62rem; letter-spacing:.2em; color:var(--steel); font-weight:600; }
.acct-close{ position:absolute; top:10px; right:14px; background:none; border:none; color:#eaf1f8;
  font-size:1.5rem; cursor:pointer; opacity:.7; }
.acct-close:hover{ opacity:1; color:var(--red); }
.acct-tabs{ display:flex; gap:8px; margin-bottom:1.1rem; }
.acct-tab{ flex:1; background:rgba(255,255,255,.05); border:1px solid rgba(150,198,238,.3);
  color:#cfd9e6; padding:.55em 0; letter-spacing:.14em; font-size:.74rem; cursor:pointer; font-family:inherit; }
.acct-tab.cur{ background:rgba(230,50,50,.22); border-color:var(--red); color:#fff; }
.acct-view{ display:none; flex-direction:column; gap:10px; }
.acct-view.cur-view{ display:flex; }
.acct-panel input[type=email], .acct-panel input[type=password], .acct-panel input[type=text]{
  width:100%; background:rgba(255,255,255,.07); border:1px solid rgba(150,198,238,.35);
  color:#f4f6f8; padding:11px 13px; font-size:.95rem; font-family:inherit; outline:none;
}
.acct-panel input:focus{ border-color:var(--red); }
.acct-cta{ width:100%; padding:.85em 0; font-size:.95rem; letter-spacing:.18em; }
.acct-link{ color:var(--steel); font-size:.82rem; text-align:center; text-decoration:none; }
.acct-link:hover{ color:#fff; }
.acct-check{ display:flex; gap:10px; align-items:flex-start; font-size:.82rem; color:#cfd9e6;
  line-height:1.45; cursor:pointer; margin:.4rem 0; }
.acct-check input{ margin-top:2px; accent-color:var(--red); }
.acct-intro{ font-size:.84rem; color:#cfd9e6; line-height:1.55; margin:-.3rem 0 1rem;
  padding:8px 12px; border-left:3px solid var(--red); background:rgba(230,50,50,.1); }
.acct-note{ font-size:.76rem; color:#9aa6b2; line-height:1.5; }
.acct-note a{ color:var(--steel); }
.acct-msg{ min-height:1.2em; margin-top:.9rem; font-size:.82rem; color:var(--steel); line-height:1.45; }
.acct-msg.err{ color:#ff7a7a; }
.acct-avatar-row{ display:flex; align-items:center; gap:14px; margin-bottom:1rem; }
#profile-avatar{ width:58px; height:58px; border-radius:50%; object-fit:cover;
  border:2px solid rgba(150,198,238,.5); display:none; }
.acct-upload{ display:inline-block; }
.acct-field{ display:flex; gap:8px; margin-bottom:.7rem; }
.acct-field input{ flex:1; min-width:0; }
.acct-actions{ display:flex; gap:8px; margin:1rem 0 .6rem; flex-wrap:wrap; }
.acct-danger{ width:100%; margin-top:.6rem; background:none; border:1px solid rgba(230,50,50,.55);
  color:#ff8a8a; padding:.7em 0; font-size:.78rem; letter-spacing:.14em; cursor:pointer; font-family:inherit;
  transition:background .15s; }
.acct-danger:hover{ background:rgba(230,50,50,.18); color:#fff; }
.acct-table-wrap{ overflow-x:auto; margin-top:.4rem; }
.acct-table{ width:100%; border-collapse:collapse; font-size:.8rem; }
.acct-table th{ text-align:left; color:var(--steel); letter-spacing:.1em; font-size:.66rem;
  text-transform:uppercase; padding:6px 8px; border-bottom:1px solid rgba(150,198,238,.3); }
.acct-table td{ padding:7px 8px; border-bottom:1px solid rgba(255,255,255,.07); color:#e3e9ef; }
.acct-table select{ background:rgba(255,255,255,.08); color:#f4f6f8; border:1px solid rgba(150,198,238,.35);
  padding:4px 6px; font-family:inherit; }

/* ============ Lot 2: endings wall + choices journal + chapters ============ */
.acct-sub{ font-weight:400; letter-spacing:.18em; font-size:.78rem; color:var(--steel);
  text-transform:uppercase; margin:1.2rem 0 .55rem; display:flex; align-items:baseline; gap:10px; }
#wall-count{ color:#fff; font-weight:600; }
#endings-wall{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.end-card{ position:relative; aspect-ratio:16/9; overflow:hidden; display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.04); border:1px solid rgba(150,198,238,.25); }
.end-card img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.end-card.unlocked{ border-color:var(--red); }
.end-card .ec-title{ position:relative; z-index:1; font-size:.66rem; letter-spacing:.1em; text-transform:uppercase;
  color:#fff; text-shadow:0 1px 6px rgba(0,0,0,.9); text-align:center; padding:4px 6px;
  background:linear-gradient(transparent,rgba(0,0,0,.55)); position:absolute; left:0; right:0; bottom:0; }
.end-card .ec-q{ font-size:1.5rem; color:rgba(244,246,248,.35); letter-spacing:.2em; }
.end-card.stub .ec-title{ background:none; position:static; color:rgba(244,246,248,.4); }
.end-card.stub{ flex-direction:column; gap:2px; border-style:dashed; }
.journal-row{ font-size:.82rem; color:#e3e9ef; line-height:1.5; padding:7px 10px; margin-bottom:6px;
  background:rgba(255,255,255,.04); border-left:3px solid var(--red); }
.journal-row .jr-scene{ display:block; font-size:.62rem; letter-spacing:.14em; color:var(--steel); text-transform:uppercase; }
#chapters-list{ display:flex; flex-direction:column; gap:8px; margin-top:.8rem; }
.chapter-item{ display:flex; align-items:baseline; gap:12px; text-align:left; cursor:pointer; font-family:inherit;
  background:rgba(255,255,255,.05); border:1px solid rgba(150,198,238,.3); border-left:3px solid var(--red);
  color:#f4f6f8; padding:11px 14px; transition:background .15s,border-color .15s; }
.chapter-item:hover:not(.locked){ background:rgba(230,50,50,.2); border-color:var(--red); }
.chapter-item .ch-id{ font-weight:700; letter-spacing:.14em; color:var(--steel); min-width:2.2em; }
.chapter-item .ch-title{ letter-spacing:.06em; font-size:.9rem; text-transform:uppercase; }
.chapter-item.locked{ opacity:.45; cursor:default; border-left-color:rgba(255,255,255,.2); }

/* ============ Lot 3: credits roll ============ */
#credits{ position:fixed; inset:0; z-index:70; background:rgba(0,0,0,.96); overflow:hidden;
  opacity:0; pointer-events:none; transition:opacity .5s ease; cursor:pointer; }
#credits.on{ opacity:1; pointer-events:auto; }
#credits-roll{ position:absolute; left:50%; transform:translateX(-50%); top:0; width:min(88vw,640px);
  text-align:center; padding-bottom:20vh; }
@keyframes creditsRoll{ from{ transform:translate(-50%,100vh); } to{ transform:translate(-50%,-100%); } }
#credits-skip{ position:fixed; right:2.2vw; bottom:2.6vh; font-size:.72rem; letter-spacing:.18em;
  text-transform:uppercase; color:rgba(244,246,248,.45); animation:pulse 2.4s ease-in-out infinite; }
.cr-title{ font-weight:200; letter-spacing:.14em; font-size:2.2rem; margin-bottom:.3rem;
  border-bottom:3px solid var(--red); display:inline-block; padding-bottom:.15em; }
.cr-subtitle{ letter-spacing:.3em; font-size:.8rem; font-weight:700; color:#e3e9ef; margin:0.8rem 0 3rem; }
.cr-head{ font-weight:400; letter-spacing:.24em; font-size:.95rem; color:var(--steel);
  text-transform:uppercase; margin:3rem 0 1.2rem; }
.cr-line{ font-size:.98rem; line-height:1.75; color:#dfe6ee; margin:0 0 1.1rem; text-align:left; }
.cr-link a, .cr-mail{ color:var(--steel); word-break:break-all; }
.cr-person{ display:flex; gap:16px; align-items:center; text-align:left; margin:0 auto 1.3rem; max-width:480px; }
.cr-photo{ width:64px; height:64px; border-radius:50%; object-fit:cover; border:2px solid rgba(150,198,238,.5); }
.cr-name{ display:block; font-size:1.05rem; letter-spacing:.08em; }
.cr-role{ display:block; font-size:.74rem; letter-spacing:.16em; color:var(--red); text-transform:uppercase; margin:2px 0; }
.cr-oneline{ display:block; font-size:.85rem; color:#aab6c2; line-height:1.5; }
.cr-outro{ margin-top:4rem; font-size:.78rem; color:#8d99a5; line-height:1.7; }
.cr-thanks{ margin:5rem 0 2rem; letter-spacing:.34em; font-size:1.05rem; color:#fff; }

/* ============ Lot 4: options + auto/skip/backlog ============ */
#cfg-backdrop{ position:fixed; inset:0; z-index:58; background:rgba(0,0,0,.6);
  opacity:0; pointer-events:none; transition:opacity .25s ease; }
#cfg-backdrop.on{ opacity:1; pointer-events:auto; }
/* in-game comfort buttons: right column above the music/voice toggles */
.gamebtn{ right:2vw; }
#backlog-btn{ bottom:calc(3vh + 108px); }
#skip-btn{ bottom:calc(3vh + 162px); }
#auto-btn{ bottom:calc(3vh + 216px); }
#game-options-btn{ bottom:calc(3vh + 270px); font-size:1.2rem; }
.gamebtn.txt{ font-size:.56rem; letter-spacing:.08em; font-weight:700; font-family:inherit; }
.gamebtn.on{ border-color:var(--red); color:#fff; background:rgba(230,50,50,.4); opacity:1; }
@media (orientation: portrait){
  .gamebtn{ right:14px; }
  #game-options-btn{ top:190px; bottom:auto; }
  #auto-btn{ top:242px; bottom:auto; }
  #skip-btn{ top:294px; bottom:auto; }
  #backlog-btn{ top:346px; bottom:auto; }
}
.opt-row{ display:flex; flex-direction:column; gap:6px; margin-bottom:1.05rem; font-size:.82rem;
  letter-spacing:.08em; color:#cfd9e6; text-transform:uppercase; }
.opt-row em{ font-style:normal; color:var(--steel); margin-left:6px; }
.opt-row input[type=range]{ width:100%; accent-color:var(--red); }
#backlog-list{ max-height:60vh; overflow-y:auto; display:flex; flex-direction:column; gap:10px;
  padding-right:8px; scrollbar-width:thin; scrollbar-color:var(--red) rgba(0,0,0,.25); }
.bl-row{ display:flex; gap:10px; align-items:flex-start; padding:8px 10px;
  background:rgba(255,255,255,.04); border-left:3px solid rgba(150,198,238,.35); }
.bl-text{ flex:1; font-size:.88rem; line-height:1.55; color:#e9eef4; }
.bl-text .who{ color:#ff5a5a; font-weight:700; margin-right:.4em; }
.bl-text .who::after{ content:":"; }
.bl-tho{ font-style:italic; color:#dfeafd; border-left:none; }
.bl-nar{ color:#dbe2ea; }
.bl-play{ flex:0 0 auto; width:30px; height:30px; border-radius:50%; cursor:pointer;
  background:rgba(230,50,50,.25); border:1px solid rgba(230,50,50,.6); color:#fff; font-size:.7rem;
  display:flex; align-items:center; justify-content:center; transition:background .15s; }
.bl-play:hover{ background:var(--red); }

/* ============ Lot 5: accessibility ============ */
/* font-size setting: scales the whole text box (text, names, choices) */
#textbox{ zoom: var(--fs, 1); }
/* higher-contrast box (beats the portrait background override too) */
body.box-opaque #textbox{ background:rgba(28,46,74,.98) !important; }
/* reduce motion: no fades, no ken-burns zoom, no scan sweep, no menu drift.
   The gyro/tilt parallax is disabled in JS via OPTIONS.reduceMotionActive. */
body.reduced-motion #shot-img{ transition:opacity 1ms linear; transform:none; }
body.reduced-motion #shot-img.show{ transform:none; }
body.reduced-motion #game.arriving #shot-img{ animation:none; }
body.reduced-motion #textwrap{ transition:opacity 1ms linear; }
body.reduced-motion #fade{ transition:opacity 1ms linear; }
body.reduced-motion #textwrap.show .scan{ animation:none; }
body.reduced-motion #next-btn.ready{ animation:none; opacity:1; }
body.reduced-motion .menu-bg{ transition:none; transform:none; }
body.reduced-motion #menu.zooming .menu-bg{ transform:none; }

/* ============ Lot 6: CG gallery + scene loading ============ */
#gallery-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.cg-card{ position:relative; aspect-ratio:16/9; overflow:hidden; display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.04); border:1px solid rgba(150,198,238,.25); }
.cg-card.unlocked{ cursor:pointer; border-color:rgba(230,50,50,.6); }
.cg-card.unlocked:hover{ border-color:var(--red); }
.cg-card img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transition:transform .25s ease; }
.cg-card.unlocked:hover img{ transform:scale(1.06); }
#cg-viewer{ position:fixed; inset:0; z-index:75; background:rgba(0,0,0,.95); cursor:pointer;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px;
  opacity:0; pointer-events:none; transition:opacity .25s ease; }
#cg-viewer.on{ opacity:1; pointer-events:auto; }
#cg-img{ max-width:94vw; max-height:84vh; object-fit:contain; box-shadow:0 30px 80px rgba(0,0,0,.8); }
#cg-title{ font-size:.8rem; letter-spacing:.22em; text-transform:uppercase; color:#cfd9e6; }
#loading{ position:fixed; left:50%; top:50%; transform:translate(-50%,-50%); z-index:31;  /* above #fade */
  display:flex; align-items:center; gap:12px; color:#e3e9ef; font-size:.78rem; letter-spacing:.3em;
  opacity:0; pointer-events:none; transition:opacity .3s ease; }
#loading.on{ opacity:1; }
#loading span{ width:14px; height:14px; border:2px solid rgba(244,246,248,.25); border-top-color:var(--red);
  border-radius:50%; animation:ldspin .8s linear infinite; }
@keyframes ldspin{ to{ transform:rotate(360deg); } }
