  /* ------- self-hosted type (assets/fonts) — no CDN dependency, no flaky-network
     fallback glyphs. Variable Bricolage carries the whole 200–800 weight range. ------- */
  @font-face{ font-family:'Bricolage Grotesque'; font-style:normal; font-weight:200 800; font-display:swap;
    src:url('assets/fonts/bricolagegrotesque-200-800-normal-latin-ext.woff2') format('woff2');
    unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
  @font-face{ font-family:'Bricolage Grotesque'; font-style:normal; font-weight:200 800; font-display:swap;
    src:url('assets/fonts/bricolagegrotesque-200-800-normal-latin.woff2') format('woff2');
    unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
  @font-face{ font-family:'IBM Plex Mono'; font-style:normal; font-weight:400; font-display:swap;
    src:url('assets/fonts/ibmplexmono-400-normal-latin-ext.woff2') format('woff2');
    unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
  @font-face{ font-family:'IBM Plex Mono'; font-style:normal; font-weight:400; font-display:swap;
    src:url('assets/fonts/ibmplexmono-400-normal-latin.woff2') format('woff2');
    unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
  @font-face{ font-family:'IBM Plex Mono'; font-style:normal; font-weight:500; font-display:swap;
    src:url('assets/fonts/ibmplexmono-500-normal-latin-ext.woff2') format('woff2');
    unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
  @font-face{ font-family:'IBM Plex Mono'; font-style:normal; font-weight:500; font-display:swap;
    src:url('assets/fonts/ibmplexmono-500-normal-latin.woff2') format('woff2');
    unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
  @font-face{ font-family:'IBM Plex Mono'; font-style:normal; font-weight:600; font-display:swap;
    src:url('assets/fonts/ibmplexmono-600-normal-latin-ext.woff2') format('woff2');
    unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
  @font-face{ font-family:'IBM Plex Mono'; font-style:normal; font-weight:600; font-display:swap;
    src:url('assets/fonts/ibmplexmono-600-normal-latin.woff2') format('woff2');
    unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
  @font-face{ font-family:'Instrument Serif'; font-style:italic; font-weight:400; font-display:swap;
    src:url('assets/fonts/instrumentserif-400-italic-latin-ext.woff2') format('woff2');
    unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
  @font-face{ font-family:'Instrument Serif'; font-style:italic; font-weight:400; font-display:swap;
    src:url('assets/fonts/instrumentserif-400-italic-latin.woff2') format('woff2');
    unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
  @font-face{ font-family:'Instrument Serif'; font-style:normal; font-weight:400; font-display:swap;
    src:url('assets/fonts/instrumentserif-400-normal-latin-ext.woff2') format('woff2');
    unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
  @font-face{ font-family:'Instrument Serif'; font-style:normal; font-weight:400; font-display:swap;
    src:url('assets/fonts/instrumentserif-400-normal-latin.woff2') format('woff2');
    unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

  :root{
    --ink:#0C0D11; --coal:#15161C; --line:#262832; --bone:#EAE3D3; --smoke:#8D8E99;
    --carmine:#D8434F; --brass:#C2A265; --violet:#9D8CF0; --ash:#8E939E; --azure:#4FC1D9;
    --carmine-deep:#A93341; --brass-deep:#7E6535; --violet-deep:#5A48B0; --ash-deep:#5A5F69; --azure-deep:#1F6E80;
    /* one safe stack per family — every font-family in the app routes through these */
    --font-display:'Bricolage Grotesque','Segoe UI',system-ui,sans-serif;
    --font-mono:'IBM Plex Mono',ui-monospace,'Cascadia Mono',Consolas,monospace;
    --font-serif:'Instrument Serif',Georgia,'Times New Roman',serif;
    --hold-ms:520ms;
    --ease-out:cubic-bezier(.16,1,.3,1);
    --ease-snap:cubic-bezier(.2,.9,.25,1);
    --ease-mech:cubic-bezier(.66,0,.22,1.28);
    /* asymmetric hairline frames: surfaces are stroked on the lit edges only */
    --frame:rgba(234,227,211,.22);
    --space-1:4px; --space-2:8px; --space-3:16px; --space-4:24px;
    --gutter:clamp(16px, 2.5vw, 44px);
    --z-chrome:40; --z-paper:60; --z-overlay:65; --z-inter:70;
  }
  *{ -webkit-tap-highlight-color:transparent; box-sizing:border-box; }
  html,body{ height:100%; margin:0; }
  body{
    background:var(--ink); color:var(--bone);
    font-family:var(--font-display);
    overscroll-behavior:none;
    user-select:none; -webkit-user-select:none; -webkit-touch-callout:none;
    height:100vh; height:100dvh; overflow:hidden;
    display:grid;
    grid-template-areas:"mast" "stage" "tick";
    grid-template-rows:auto minmax(0,1fr) auto;
    grid-template-columns:minmax(0,1fr);
  }
  @media (min-width:721px){
    body{
      grid-template-areas:"mast mast" "brief stage" "tick tick";
      grid-template-columns:clamp(180px,22vw,240px) minmax(0,1fr);
    }
  }
  @media (min-width:1101px){
    body{
      grid-template-areas:"mast mast mast" "brief stage log" "tick tick tick";
      grid-template-columns:clamp(200px,17vw,260px) minmax(0,1fr) clamp(240px,21vw,320px);
    }
  }
  input, textarea, select{ user-select:text; -webkit-user-select:text; }
  button, [data-act], [role="button"]{ touch-action:manipulation; }
  :focus-visible{ outline:1px solid var(--bone); outline-offset:3px; border-radius:2px; }
  ::-webkit-scrollbar{ width:0; height:0; }

  /* ------- atmosphere: WebGL scenes and per-skin static backdrops -------
     Layering: body::before (skin backdrop, z-3) → body::after (film grain, z-2)
     → the active atmosphere canvas (z-1). Every skin backdrop remains painted
     underneath, so reduced motion or renderer failure degrades in place. */
  #atmosphere{ position:fixed; inset:0; width:100%; height:100%; z-index:-1; pointer-events:none; transition:opacity .22s ease; }
  #atmosphere.scene-dip{ opacity:0; }
  body.atmo-static #atmosphere{ display:none; }
  body::before{ content:''; position:fixed; inset:0; z-index:-3; pointer-events:none; background:var(--ink); }
  body::after{ content:''; position:fixed; inset:0; z-index:-2; pointer-events:none; opacity:.022;
    background-image:url("data:image/svg+xml,%3Csvg width='220' height='220' viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size:220px 220px; background-repeat:repeat; }
  @media (max-width:720px){ body::after{ opacity:.012; } }

  /* ------- utility classes ------- */
  button{ appearance:none; -webkit-appearance:none; background:none; border:none; color:inherit; font:inherit; padding:0; }
  .flex{ display:flex; } .flex-col{ flex-direction:column; } .flex-wrap{ flex-wrap:wrap; }
  .items-center{ align-items:center; } .items-baseline{ align-items:baseline; }
  .justify-between{ justify-content:space-between; } .justify-center{ justify-content:center; }
  .gap-2{ gap:8px; } .gap-3{ gap:12px; }
  .hidden{ display:none !important; }
  .w-full{ width:100%; } .block{ display:block; }
  .uppercase{ text-transform:uppercase; }
  .select-all{ user-select:all; -webkit-user-select:all; } .font-bold{ font-weight:700; }
  .leading-relaxed{ line-height:1.65; }
  .text-smoke{ color:var(--smoke); }
  .border{ border:1px solid var(--line); } .border-line{ border-color:var(--line); }
  .rounded-2{ border-radius:2px; }
  .grid{ display:grid; } .grid-cols-2{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  /* 44px-minimum touch target without changing visual weight: an invisible
     centered pseudo-element extends the hit area past the drawn control.
     (Positioned controls like .sc-eye keep their own position — declared later, they win.) */
  .hit-44{ position:relative; }
  .hit-44::after{ content:''; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
    width:max(100%, 44px); height:max(100%, 44px); }

  /* ------- type system ------- */
  .eyebrow{ font-family:var(--font-mono); font-size:10px; letter-spacing:.32em; text-transform:uppercase; color:var(--smoke); font-weight:500; }
  .display{ font-family:var(--font-display); font-weight:800; text-transform:uppercase; letter-spacing:-.015em; line-height:.92; }
  .whisper{ font-family:var(--font-serif); font-style:italic; text-transform:none; letter-spacing:0; color:var(--smoke); }
  .mono{ font-family:var(--font-mono); }

  .c-carmine{ color:var(--carmine); } .c-brass{ color:var(--brass); } .c-violet{ color:var(--violet); } .c-smoke{ color:var(--smoke); } .c-bone{ color:var(--bone); }

  /* ------- masthead ------- */
  header{ grid-area:mast; height:calc(56px + env(safe-area-inset-top)); padding-top:env(safe-area-inset-top);
    display:flex; align-items:center; justify-content:space-between;
    padding-left:calc(var(--gutter) + env(safe-area-inset-left, 0px));
    padding-right:calc(var(--gutter) + env(safe-area-inset-right, 0px));
    border-bottom:1px solid var(--line); background:rgba(12,13,17,.6); backdrop-filter:blur(10px); z-index:var(--z-chrome); }
  .wordmark{ font-family:var(--font-display); font-weight:800; font-size:13px; letter-spacing:.14em; text-transform:uppercase; }
  .wordmark em{ color:var(--carmine); font-style:normal; }

  /* ------- the broadsheet stage ------- */
  main{ grid-area:stage; overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; position:relative; }
  .wrap{ max-width:440px; margin:0 auto; padding:28px 20px 48px; }
  
  /* Desktop Layout Fix: Replaced container queries with standard viewport media queries to fix iOS crashes & center dashboard */
  @media (min-width:721px){
    .wrap{ max-width:820px; margin:0 auto; padding:44px clamp(28px,6vw,84px) 72px; }
    .wrap > *{ max-width:640px; }
    .wrap > .hero{ max-width:960px; }
    .wrap.ritual{ max-width:560px; margin:0 auto; }
    .wrap.ritual > *{ max-width:none; }
    .wrap.home{ max-width:1020px; padding-left:clamp(24px,3.5vw,48px); padding-right:clamp(24px,3.5vw,48px); }
    .wrap.home > *{ max-width:none; }
  }

  /* ------- setup dashboard ------- */
  .wrap.home > .hero{ text-align:center; }
  /* masthead strap: the magazine folio line above the hero */
  .masthead-strap{ display:flex; justify-content:space-between; gap:12px;
    font-family:var(--font-mono); font-size:8.5px; font-weight:400; letter-spacing:.3em; text-transform:uppercase; color:var(--smoke);
    border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding:9px 2px; }
  /* desktop: the hero breaks from center — giant flush-left display, the tag
     line pushed off-axis with a leading dash (editorial collage, not a column) */
  @media (min-width:781px){
    .wrap.home > .hero{ text-align:left; }
    .hero-tag{ margin-left:42%; position:relative; }
    .hero-tag::before{ content:''; position:absolute; left:-34px; top:.72em; width:24px; height:1px; background:var(--smoke); }
  }
  /* the setup dashboard: one fluid grid — a single column on phones, two
     tracks the moment the viewport affords them, no hand-tuned breakpoints */
  .dashboard{ --dashboard-gap:clamp(14px, 2vw, 20px); display:grid;
    grid-template-columns:repeat(auto-fit, minmax(min(100%, 330px), 1fr));
    gap:var(--dashboard-gap); margin-top:clamp(30px, 4.5vw, 44px); align-items:start; }
  .dashboard > .panel-sceno{ grid-column:1 / -1; }
  /* Each desktop column stacks independently. Together and Scenography form the
     shorter left rail beneath Players while Roles keeps the full right rail. */
  @media (min-width:781px){
    .dashboard{ display:block; }
    .dashboard::after{ content:''; display:block; clear:both; }
    .dashboard > .panel{ width:calc((100% - var(--dashboard-gap)) / 2); margin-bottom:var(--dashboard-gap); }
    .dashboard > .panel-players,
    .dashboard > .panel-together,
    .dashboard > .panel-sceno{ float:left; clear:left; }
    .dashboard > .panel-roles{ float:right; clear:right; }
  }
  /* panels: no box outline — a hairline gradient stroke on the lit edges (top +
     left) only, and a three-tier ambient shadow that floats them off the glass */
  .panel{ min-width:0; position:relative; border:0; border-radius:2px; padding:clamp(16px,2.5vw,22px);
    background:linear-gradient(180deg, rgba(234,227,211,.03), rgba(21,22,28,.45) 22%);
    box-shadow:0 1px 2px rgba(0,0,0,.25), 0 18px 44px -18px rgba(0,0,0,.42), 0 70px 160px -60px rgba(0,0,0,.5); }
  .panel::before{ content:''; position:absolute; inset:0; pointer-events:none; border-radius:inherit;
    background:
      linear-gradient(90deg, var(--frame), transparent 72%) top left/100% 1px no-repeat,
      linear-gradient(180deg, var(--frame), transparent 78%) top left/1px 100% no-repeat; }
  .panel > .sect{ margin:0 0 16px; }
  .cta-row{ max-width:560px; margin:28px auto 0; }
  .empty-state{ text-align:center; padding:34px 16px; border:1px dashed var(--line); border-radius:2px; margin-top:10px; }
  .empty-state p{ margin:0; }
  .empty-state p + p{ margin-top:10px; }

  /* ------- rails: the game brief (left) and the live log (right) ------- */
  .rail-brief, .rail-log{ display:none; }
  @media (min-width:721px){
    .rail-brief{ grid-area:brief; display:flex; flex-direction:column; gap:20px; padding:26px 18px 26px var(--gutter);
      border-right:1px solid var(--line); overflow:hidden; position:relative; min-height:0; }
  }
  @media (min-width:1101px){
    .rail-log{ grid-area:log; display:flex; flex-direction:column; gap:20px; padding:26px var(--gutter) 26px 22px;
      border-left:1px solid var(--line); overflow-y:auto; min-height:0; position:relative; }
  }
  /* the ghost containers stroke NUMERIC text only; the ※ mark is an inline SVG
     (.ghost-mark) with its own explicit stroke — no font dependency, no fallback
     glyph explosions. min(vh,vw) keeps Android desktop-mode viewports honest. */
  .brief-ghost{ font-family:var(--font-display); font-weight:800; line-height:.78; letter-spacing:-.03em;
    font-size:clamp(96px, min(16vh, 11vw), 190px); color:transparent; -webkit-text-stroke:1px var(--line); user-select:none;
    text-align:center; max-width:100%; overflow:hidden; }
  .ghost-mark{ display:block; margin:0 auto; fill:none; stroke:var(--line); stroke-width:1px; stroke-linecap:round; }
  .ghost-mark path, .ghost-mark circle{ vector-effect:non-scaling-stroke; }
  .brief-ghost .ghost-mark{ width:clamp(96px, min(13vh, 9vw), 160px); height:auto; }
  .brief-ghost.swell{ animation:ghostSwell .9s var(--ease-out); }
  @keyframes ghostSwell{ 0%{ transform:scale(1.14); opacity:.2; } 100%{ transform:none; opacity:1; } }
  .brief-meta{ display:flex; flex-direction:column; }
  .fm-row{ display:flex; justify-content:space-between; gap:10px; padding:9px 0; border-bottom:1px solid var(--line); }
  .fm-row:first-child{ border-top:1px solid var(--line); }
  .fm-k{ font-family:var(--font-mono); font-size:8.5px; letter-spacing:.22em; text-transform:uppercase; color:var(--smoke); }
  .fm-v{ font-family:var(--font-mono); font-size:8.5px; letter-spacing:.22em; text-transform:uppercase; color:var(--bone); text-align:right; }
  .brief-foot{ margin-top:auto; }
  .lc-row{ display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); }
  .lc-num{ font-family:var(--font-mono); font-size:9px; color:var(--smoke); opacity:.6; width:20px; letter-spacing:.1em; }
  .lc-name{ font-family:var(--font-display); font-weight:500; font-size:12px; letter-spacing:.04em; text-transform:uppercase; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .lc-state{ font-family:var(--font-mono); font-size:8px; letter-spacing:.18em; text-transform:uppercase; color:var(--smoke); }
  .lc-row.dead .lc-name{ text-decoration:line-through; opacity:.4; }
  .lc-row.dead .lc-state{ color:var(--carmine); }
  .wire-item{ font-family:var(--font-mono); font-size:9px; line-height:1.7; letter-spacing:.14em; text-transform:uppercase; color:var(--smoke);
    padding:10px 0; border-bottom:1px solid var(--line); }
  .wire-item:first-child{ color:var(--bone); }

  /* registration marks at grid intersections (desktop) */
  @media (min-width:1101px){
    .rail-brief::after, .rail-log::after{ content:''; position:absolute; width:13px; height:13px; pointer-events:none; opacity:.5; z-index:1;
      background:
        linear-gradient(var(--line),var(--line)) center/100% 1px no-repeat,
        linear-gradient(var(--line),var(--line)) center/1px 100% no-repeat; }
    .rail-brief::after{ right:-7px; bottom:14px; }
    .rail-log::after{ left:-7px; top:14px; }
  }

  /* entrance choreography */
  .anim{ animation:fadeUp .55s var(--ease-out) both; }
  @keyframes fadeUp{ from{ opacity:0; transform:translateY(14px);} to{ opacity:1; transform:none; } }
  .hero-mask{ display:block; overflow:hidden; }
  .hero-line{ display:block; animation:riseIn .7s var(--ease-out) both; }
  .breath{ animation:riseIn .7s var(--ease-out) both, breath 7s ease-in-out 1.4s infinite; }
  @keyframes breath{ 0%,100%{ font-variation-settings:'wght' 800; } 50%{ font-variation-settings:'wght' 620; } }
  /* same-screen repaints must not replay entrance animations; body.settled is set by render().
     .breath override stays non-important so body.no-anim's kill-switch keeps final say. */
  body.settled .hero-line{ animation:none !important; }
  body.settled .breath{ animation:breath 7s ease-in-out infinite; }

  /* ------- section headers: radical scale contrast — a razor micro index
     against a heavy display title, ruled off by a fading hairline ------- */
  .sect{ display:flex; align-items:baseline; gap:12px; margin:34px 0 14px; }
  .sect-index{ font-family:var(--font-mono); font-size:8.5px; font-weight:400; letter-spacing:.34em; color:var(--smoke); }
  .sect-title{ font-family:var(--font-display); font-weight:800; font-size:17px; letter-spacing:.02em; text-transform:uppercase; line-height:1; }
  .sect .rule{ flex:1; height:1px; background:linear-gradient(90deg, var(--line) 0%, transparent 100%); align-self:center; transform-origin:left; }
  .anim.sect .rule, .anim .rule{ animation:ruleIn .9s var(--ease-out) both; }
  @keyframes ruleIn{ from{ transform:scaleX(0); } to{ transform:scaleX(1); } }

  /* ------- index rows ------- */
  .idx{ border-top:1px solid var(--line); }
  .idx-row{ display:flex; align-items:center; gap:14px; padding:13px 2px; border-bottom:1px solid var(--line);
    min-height:52px; cursor:pointer; transition:background .15s, transform .1s; position:relative; }
  .idx-row:active{ background:rgba(234,227,211,.04); }
  .idx-num{ font-family:var(--font-mono); font-size:10px; color:var(--smoke); opacity:.6; width:22px; flex:none; letter-spacing:.1em; }
  .idx-name{ font-family:var(--font-display); font-weight:500; font-size:16px; letter-spacing:.02em; text-transform:uppercase; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .idx-row.picked{ background:rgba(234,227,211,.05); }
  .idx-row.picked::before{ content:''; position:absolute; left:-20px; top:0; bottom:0; width:3px; background:var(--bone); }
  .idx-row.picked.p-carmine::before{ background:var(--carmine); }
  .idx-row.picked.p-brass::before{ background:var(--brass); }
  .tick{ width:16px; height:16px; border:1px solid var(--line); border-radius:50%; flex:none; transition:.15s; }
  .picked .tick{ border-color:var(--bone); background:var(--bone); box-shadow:inset 0 0 0 4px var(--ink); }

  /* ------- editorial variants ------- */
  .notices{ display:flex; flex-direction:column; gap:10px; }
  @media (min-width:781px){
    .notices{ display:grid; grid-template-columns:1fr 1fr; gap:10px; align-items:start; }
    .notices > .span2{ grid-column:1 / -1; }
  }
  .ballot .idx-row{ min-height:60px; }
  .ballot .idx-num{ font-family:var(--font-display); font-weight:800; font-size:24px; width:46px; opacity:1;
    color:transparent; -webkit-text-stroke:1px var(--smoke); letter-spacing:0; }
  @media (min-width:721px){
    .wrap > .paper.static{ max-width:820px; }
  }

  /* ------- buttons ------- */
  .btn{ display:flex; align-items:center; justify-content:center; gap:10px; width:100%; height:56px;
    font-family:var(--font-mono); font-size:11px; font-weight:600; letter-spacing:.28em; text-transform:uppercase;
    border:1px solid transparent; border-radius:2px; cursor:pointer; transition:transform .12s var(--ease-out), opacity .2s, background .2s; }
  .btn:active{ transform:scale(.977); }
  .btn[disabled]{ opacity:.25; pointer-events:none; }
  .btn-primary{ background:var(--bone); color:var(--ink); }
  .btn-ghost{ background:transparent; color:var(--bone); border-color:var(--line); }
  .btn-ghost:active{ background:rgba(234,227,211,.05); }
  .btn-danger{ background:transparent; color:var(--carmine); border-color:rgba(216,67,79,.4); }
  .btn-sm{ height:44px; font-size:10px; letter-spacing:.22em; }

  /* ------- cards / chips ------- */
  /* asymmetric frame: stroked on top + left only (inline border-colors from the
     views still tint those edges), floated by a wide low-alpha ambient shadow */
  .card{ background:var(--coal); border:1px solid var(--line); border-width:1px 0 0 1px; border-radius:2px; padding:18px;
    box-shadow:0 1px 2px rgba(0,0,0,.22), 0 16px 40px -18px rgba(0,0,0,.4); }
  .chip{ display:inline-flex; align-items:center; gap:6px; font-family:var(--font-mono); font-size:9px; font-weight:500;
    letter-spacing:.18em; text-transform:uppercase; padding:5px 9px; border:1px solid var(--line); border-radius:2px; color:var(--smoke); }
  .chip.a-mafia{ color:var(--carmine); border-color:rgba(216,67,79,.35); }
  .chip.a-town{ color:var(--brass); border-color:rgba(194,162,101,.35); }
  .chip.a-neutral{ color:var(--violet); border-color:rgba(157,140,240,.35); }
  .chip.a-forger{ color:var(--ash); border-color:rgba(142,147,158,.35); }
  .chip.a-modifier{ color:var(--azure); border-color:rgba(79,193,217,.35); }

  /* ------- deck toggles ------- */
  .role-card{ border:1px solid var(--line); border-width:1px 0 0 1px; border-radius:2px; padding:14px; cursor:pointer; position:relative;
    transition:border-color .2s, opacity .2s, background .2s, transform .18s var(--ease-out), box-shadow .3s var(--ease-out);
    background:transparent; text-align:left; width:100%; color:var(--bone);
    box-shadow:inset -1px -1px 0 rgba(234,227,211,.05); }
  /* flip faces are excluded: their transform slot belongs to the marquee roll (the wrap scales instead) */
  .role-card:not(.flip-face):active{ transform:scale(.975); }
  /* header grid: the name owns the fluid column and wraps; the state sits in
     reserved space — long roles (Investigator, Serial Killer) can never collide */
  .rc-head{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 10px; align-items:start; }
  .role-card .rc-name{ font-family:var(--font-display); font-weight:800; font-size:13px; text-transform:uppercase; letter-spacing:.04em; line-height:1.25;
    overflow-wrap:anywhere; } /* a single long word must never escape its column */
  /* long single-word names (Detective, Investigator…) scale down instead of
     colliding with the state — measured in the template, not guessed here */
  .role-card .rc-name.rc-name-long{ font-size:11.5px; letter-spacing:.03em; padding-top:1px; }
  /* narrow viewports: the 2-col deck leaves no side-by-side room, so the state
     reflows into a micro-label above the name — hierarchy instead of collision */
  @media (max-width:480px){
    .grid-cols-2 .rc-head{ grid-template-columns:1fr; gap:3px; }
    .grid-cols-2 .rc-head .rc-state{ order:-1; text-align:left; padding-top:0; }
    .grid-cols-2 .role-card .rc-name.rc-name-long{ font-size:13px; letter-spacing:.04em; }
  }
  .role-card .rc-desc{ font-family:var(--font-mono); font-size:8.5px; letter-spacing:.12em; text-transform:uppercase; color:var(--smoke); margin-top:5px; line-height:1.6; }
  .role-card.off{ opacity:.38; }
  .role-card.on{ background:var(--coal); }
  .role-card.on::before{ content:''; position:absolute; left:-1px; top:-1px; bottom:0; width:3px; transform-origin:top; }
  .role-card.on.a-mafia::before{ background:var(--carmine); }
  .role-card.on.a-town::before{ background:var(--brass); }
  .role-card.on.a-neutral::before{ background:var(--violet); }
  .role-card.on.a-forger::before{ background:var(--ash); }
  .role-card.on.a-modifier::before{ background:var(--azure); }
  .rc-state{ font-family:var(--font-mono); font-size:8px; letter-spacing:.2em; color:var(--smoke); white-space:nowrap; text-align:right; padding-top:3px; }
  .role-card.on .rc-state{ color:var(--bone); }
  /* one shared state-change settle for EVERY card's in-play/benched flip —
     applied post-render to the toggled card only; the next rebuild drops it */
  .role-card.state-flip .rc-state{ animation:stateSettle .38s var(--ease-out) both; }
  .role-card.state-flip.on::before{ animation:barIn .38s var(--ease-out) both; }
  @keyframes stateSettle{ from{ opacity:0; transform:translateY(-4px); } to{ opacity:1; transform:none; } }
  @keyframes barIn{ from{ transform:scaleY(0); } to{ transform:scaleY(1); } }
  @media (hover:hover){
    .role-card:not(.flip-face):hover{ border-color:var(--smoke); transform:translateY(-2px);
      box-shadow:inset -1px -1px 0 rgba(234,227,211,.08), 0 12px 28px -16px rgba(0,0,0,.6), 0 3px 9px rgba(0,0,0,.28); }
    .role-card:not(.flip-face):active{ transform:scale(.975); } /* press beats hover-lift */
    .idx-row:hover{ background:rgba(234,227,211,.03); }
    .btn-ghost:hover{ background:rgba(234,227,211,.05); }
    .btn-primary:hover{ transform:translateY(-1px); box-shadow:0 12px 30px -12px rgba(234,227,211,.28); }
  }

  /* ------- dev unrestricted roster: split touch zones (right +, left −) ------- */
  .rc-zone{ position:absolute; top:0; bottom:0; width:50%; z-index:1; cursor:pointer; }
  .rc-zone.dec{ left:0;  border-radius:2px 0 0 2px; background:rgba(216,67,79,.08);  box-shadow:inset 2px 0 0 rgba(216,67,79,.55); }
  .rc-zone.inc{ right:0; border-radius:0 2px 2px 0; background:rgba(92,184,120,.08); box-shadow:inset -2px 0 0 rgba(92,184,120,.55); }
  .rc-zone.dec:active{ background:rgba(216,67,79,.2);  box-shadow:inset 3px 0 0 var(--carmine); }
  .rc-zone.inc:active{ background:rgba(92,184,120,.2); box-shadow:inset -3px 0 0 #5CB878; }
  .rc-count{ position:absolute; bottom:10px; right:12px; z-index:0; font-family:var(--font-mono);
    font-size:10px; letter-spacing:.18em; color:var(--bone); }

  /* ------- Lovers/Haunt marquee roll: dashed frame sets it apart from a role
     (bench/arm by tapping the card; the tabs below pick which bond it is).
     Both faces live in one grid cell; the wrap's data-face drives three positions
     per face — enter from +105%, rest at 0, exit through -105% — so the roll is
     directional and continuous, and the overflow mask makes bleed impossible.
     Transition-driven (not keyframes): rapid re-taps reverse cleanly mid-travel. */
  .flip-wrap{ position:relative; display:grid; min-height:96px; overflow:hidden;
    border:1px dashed var(--line); border-radius:2px;
    transition:transform .08s var(--ease-out), border-color .3s var(--ease-snap); }
  .flip-wrap:active{ transform:scale(.985); }
  .flip-wrap.armed{ border-color:rgba(79,193,217,.55); }
  .flip-face{ grid-area:1 / 1; border:none; border-radius:0; will-change:transform;
    transition:transform .34s var(--ease-snap), opacity .2s, background .2s; }
  .flip-face.on::before{ left:0; top:0; bottom:0; }
  .flip-wrap[data-face="LOVERS"] .flip-face.face-lovers{ transform:translateY(0); }
  .flip-wrap[data-face="LOVERS"] .flip-face.face-haunt{ transform:translateY(105%); }
  .flip-wrap[data-face="HAUNT"] .flip-face.face-haunt{ transform:translateY(0); }
  .flip-wrap[data-face="HAUNT"] .flip-face.face-lovers{ transform:translateY(-105%); }

  .mod-switch{ display:flex; gap:6px; margin-top:var(--space-2); }
  .mod-switch-btn{ flex:1; padding:10px 8px; border:1px solid var(--line); border-radius:2px; background:transparent;
    color:var(--smoke); font-family:var(--font-mono); font-size:10px; letter-spacing:.18em; text-transform:uppercase;
    cursor:pointer; transition:.15s; }
  .mod-switch-btn.active{ border-color:var(--azure); color:var(--azure); background:rgba(79,193,217,.08); }
  .mod-switch-btn:active{ transform:scale(.97); }

  /* ------- stepper & switches ------- */
  .step-btn{ width:48px; height:48px; border:1px solid var(--line); border-radius:2px; background:transparent; color:var(--bone);
    font-family:var(--font-mono); font-size:16px; cursor:pointer; transition:.15s; flex:none; }
  .step-btn:active{ background:rgba(234,227,211,.06); transform:scale(.95); }
  .step-btn[disabled]{ opacity:.2; pointer-events:none; }

  .switch{ width:44px; height:24px; border:1px solid var(--line); border-radius:99px; position:relative; flex:none; transition:.2s; }
  .switch::after{ content:''; position:absolute; top:3px; left:3px; width:16px; height:16px; border-radius:50%; background:var(--smoke); transition:.2s var(--ease-out); }
  .sw-row.on .switch{ border-color:var(--bone); }
  .sw-row.on .switch::after{ left:23px; background:var(--bone); }
  
  /* Flexbox Pile-up Fix: Added flex:1, min-width:0, and padding to force text wrapping instead of control collisions */
  .sw-row{ display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 0; border-bottom:1px solid var(--line); cursor:pointer; }
  .text-left{ text-align:left; flex:1; min-width:0; padding-right:12px; }

  input.field, select.field{ width:100%; background:transparent; border:1px solid var(--line); border-radius:2px; color:var(--bone);
    font-family:var(--font-display); font-size:16px; letter-spacing:.04em; text-transform:uppercase; padding:0 16px; height:56px; outline:none; transition:border-color .2s; }
  input.field:focus, select.field:focus{ border-color:var(--smoke); }
  input.field::placeholder{ color:var(--smoke); opacity:.5; text-transform:none; font-family:var(--font-serif); font-style:italic; letter-spacing:0; }
  select.field{ appearance:none; -webkit-appearance:none; cursor:pointer; }
  select.field option{ background:var(--coal); color:var(--bone); }
  input.num{ width:84px; text-align:center; font-family:var(--font-mono); font-size:16px; text-transform:none; height:44px; padding:0 8px; }

  /* ------- ticker ------- */
  .ticker{ grid-area:tick; border-top:1px solid var(--line); background:rgba(12,13,17,.55); backdrop-filter:blur(8px); overflow:hidden;
    height:calc(34px + env(safe-area-inset-bottom)); padding-bottom:env(safe-area-inset-bottom); display:flex; align-items:center; z-index:var(--z-chrome); }
  .ticker-track{ display:inline-flex; white-space:nowrap; animation:marquee 36s linear infinite; will-change:transform; }
  .ticker-track span{ font-family:var(--font-mono); font-size:9px; letter-spacing:.3em; text-transform:uppercase; color:var(--smoke); padding-right:60px; }
  @keyframes marquee{ from{ transform:translateX(0);} to{ transform:translateX(-50%);} }

  /* ------- hold-to-unseal ------- */
  .hold-btn{ position:relative; overflow:hidden; }
  .hold-btn::after{ content:''; position:absolute; left:0; top:0; bottom:0; width:0; background:rgba(234,227,211,.16); }
  .hold-btn.arming::after{ animation:arm var(--hold-ms) linear forwards; }
  @keyframes arm{ from{ width:0;} to{ width:100%;} }

  /* ------- paper (dossier / verdict / curtain) ------- */
  .paper{ position:fixed; inset:0; z-index:var(--z-paper); background:var(--bone); color:var(--ink);
    transform:translateY(103%); transition:transform .42s var(--ease-out); display:flex; flex-direction:column; overflow:hidden;
    padding:calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); }
  @media (min-width:900px){
    .paper:not(.static){ padding-left:calc(50vw - 320px); padding-right:calc(50vw - 320px); }
    .paper:not(.static)::after{ content:''; position:absolute; top:0; bottom:0; left:calc(50vw - 344px); right:calc(50vw - 344px);
      border-left:1px solid rgba(12,13,17,.14); border-right:1px solid rgba(12,13,17,.14); pointer-events:none; }
  }
  .paper.open{ transform:translateY(0); }
  .paper::before{ content:''; position:absolute; inset:0; pointer-events:none; opacity:.5;
    background:linear-gradient(115deg, rgba(12,13,17,.05) 0%, transparent 30%, transparent 70%, rgba(12,13,17,.06) 100%); }
  .paper .eyebrow{ color:rgba(12,13,17,.55); }
  .paper .whisper{ color:rgba(12,13,17,.6); }
  .paper .p-rule{ height:1px; background:rgba(12,13,17,.18); }
  .paper.static{ position:relative; inset:auto; transform:none; transition:none; z-index:auto; min-height:0; }
  .noscroll-paper{ overflow-y:auto; }

  .seal{ display:inline-flex; align-items:center; justify-content:center; width:96px; height:96px; border-radius:50%;
    border:2px solid currentColor; box-shadow:inset 0 0 0 3px transparent, inset 0 0 0 5px currentColor; opacity:0;
    font-family:var(--font-mono); font-size:9px; font-weight:600; letter-spacing:.24em; text-transform:uppercase; text-align:center; line-height:1.5;
    transform:rotate(-12deg); }
  .open .seal, .stamp-now .seal{ animation:stamp .35s cubic-bezier(.2,.7,.3,1.2) .18s forwards; }
  @keyframes stamp{ from{ opacity:0; transform:scale(1.7) rotate(-4deg); filter:blur(2px);} to{ opacity:.9; transform:scale(1) rotate(-12deg); filter:none;} }

  .verdict-word{ animation:stampIn .4s cubic-bezier(.2,.7,.3,1.15) both; }
  @keyframes stampIn{ from{ opacity:0; transform:scale(1.5) rotate(-3deg); filter:blur(3px);} to{ opacity:1; transform:scale(1) rotate(-2deg); filter:none;} }

  /* ------- interstitial ------- */
  #inter{ position:fixed; inset:0; z-index:var(--z-inter); background:var(--ink); display:none; align-items:center; justify-content:center; flex-direction:column; overflow:hidden; }
  #inter.open{ display:flex; }
  .inter-ghost{ position:absolute; font-family:var(--font-display); font-weight:800; font-size:min(52vh, 40vw); line-height:1;
    color:transparent; -webkit-text-stroke:1px var(--line); pointer-events:none; user-select:none; max-width:100vw; overflow:hidden; }
  .inter-ghost .ghost-mark{ width:min(52vh, 40vw); height:auto; }
  .inter-mask{ overflow:hidden; }
  .inter-word{ font-family:var(--font-display); font-weight:800; text-transform:uppercase; letter-spacing:-.02em;
    font-size:clamp(64px, 22vw, 140px); line-height:.9; }
  .inter-word .ltr{ display:inline-block; animation:riseIn .6s var(--ease-out) both; }
  @keyframes riseIn{ from{ transform:translateY(110%);} to{ transform:none; } }
  .inter-sub{ animation:fadeUp .5s var(--ease-out) .25s both; }

  /* ------- overlay (confirms) ------- */
  #overlay{ position:fixed; inset:0; z-index:var(--z-overlay); background:rgba(12,13,17,.8); backdrop-filter:blur(6px);
    display:none; align-items:flex-end; justify-content:center; padding:20px; padding-bottom:calc(20px + env(safe-area-inset-bottom)); }
  #overlay.open{ display:flex; }
  .sheet{ width:100%; max-width:440px; background:var(--coal); border:1px solid var(--line); border-width:1px 0 0 1px; border-radius:2px; padding:24px;
    box-shadow:0 -10px 34px rgba(0,0,0,.35), 0 30px 70px -24px rgba(0,0,0,.55); animation:fadeUp .3s var(--ease-out) both; }

  .pulse-dot{ width:6px; height:6px; border-radius:50%; background:var(--carmine); animation:pulse 1.4s ease-in-out infinite; }
  @keyframes pulse{ 0%,100%{opacity:1; transform:scale(1);} 50%{opacity:.35; transform:scale(.7);} }
  .timer-hot{ color:var(--carmine) !important; animation:pulse 1s ease-in-out infinite; }

  .strike{ text-decoration:line-through; text-decoration-thickness:2px; opacity:.35; }

  /* USER OVERRIDE: Cinematic Animations Off (prefers-reduced-motion is honoured in JS via the same path) */
  body.no-anim *, body.no-anim *::before, body.no-anim *::after {
    animation:none !important;
    transition:none !important;
  }
  body.no-anim .ticker-track { animation:none !important; }

  ::view-transition-old(root){ animation-duration:.26s; }
  ::view-transition-new(root){ animation-duration:.26s; }

  /* ============================================================
     CHAT, TALLY & RECONNECT VEIL
     ============================================================ */
  .chat-log{ border:1px solid var(--line); border-width:1px 0 0 1px; border-radius:2px; padding:10px 12px; max-height:200px; overflow-y:auto; background:rgba(21,22,28,.45);
    box-shadow:0 10px 28px -14px rgba(0,0,0,.35); }
  .chat-row{ display:flex; gap:8px; padding:4px 0; line-height:1.5; }
  .chat-name{ font-family:var(--font-mono); font-size:9px; letter-spacing:.14em; text-transform:uppercase; flex:none; padding-top:3px; }
  .chat-text{ font-family:var(--font-display); font-size:13.5px; overflow-wrap:anywhere; }
  .chat-mafia .chat-log{ border-color:rgba(216,67,79,.3); background:rgba(216,67,79,.06); }

  /* ------- tribunal tally bars: a thin carmine bar per accused, scaled against
     the current leader; the ballot rebuild replays the grow-in — deliberate,
     every fresh ballot lands with a pulse of drama ------- */
  .tally{ display:inline-flex; align-items:center; gap:8px; margin-right:8px; flex:none; }
  .tally-track{ width:clamp(36px, 9vw, 64px); height:2px; background:rgba(216,67,79,.16); border-radius:1px; overflow:hidden; }
  .tally-fill{ display:block; height:100%; width:100%; background:var(--carmine); transform-origin:left;
    animation:tallyIn .55s var(--ease-out) both; }
  .tally-n{ font-family:var(--font-mono); font-size:10px; letter-spacing:.18em; color:var(--carmine); }
  .tally.tally-skip .tally-track{ background:rgba(141,142,153,.16); }
  .tally.tally-skip .tally-fill{ background:var(--smoke); }
  .tally.tally-skip .tally-n{ color:var(--smoke); }
  @keyframes tallyIn{ from{ transform:scaleX(0); } }
  /* ballots-cast progress hairline under the ballot */
  .ballot-progress{ height:1px; background:var(--line); overflow:hidden; margin-top:14px; }
  .ballot-progress-fill{ display:block; height:100%; width:100%; background:var(--carmine); transform-origin:left;
    animation:tallyIn .55s var(--ease-out) both; }

  /* ------- the playbill: in-game role reference overlay ------- */
  .playbill{ position:fixed; inset:0; z-index:calc(var(--z-inter) + 5); background:rgba(12,13,17,.8);
    backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
    display:flex; align-items:flex-end; justify-content:center;
    padding:20px; padding-bottom:calc(20px + env(safe-area-inset-bottom)); }
  .pb-sheet{ max-height:min(78vh, 640px); overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }
  .pb-list{ margin-top:10px; }
  .pb-row{ padding:13px 0; border-bottom:1px solid var(--line); }
  .pb-row:last-child{ border-bottom:none; }
  .pb-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
  .pb-name{ font-family:var(--font-display); font-weight:800; font-size:13px; text-transform:uppercase; letter-spacing:.04em; }
  .pb-card{ font-family:var(--font-display); font-size:13px; line-height:1.55; color:var(--smoke); margin:7px 0 0; }

  /* ------- ghost view: this device's players are all dead — quiet gallery
     dressing plus the wire feed inline (phones have no ledger rail) ------- */
  .wire-inline{ margin:26px auto 0; max-width:360px; text-align:left; border-top:1px solid var(--line); }
  .host-desk{ margin:34px auto 0; max-width:360px; padding:14px 14px 12px; text-align:center;
    border:1px dashed var(--line); border-radius:2px; display:flex; flex-direction:column; gap:10px; }
  .host-desk .btn{ margin:0; }

  .reconnect-veil{ position:fixed; inset:0; z-index:90; display:flex; flex-direction:column; align-items:center; justify-content:center;
    text-align:center; padding:24px; background:rgba(12,13,17,.72); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); }

  /* ============================================================
     SKIN SYSTEM — six sets, any of which can dress either slot.
     Each skin paints its own body::before backdrop and re-tokens its
     surfaces; placed last so they win the cascade. The transition
     block below keeps mid-game skin swaps cinematic.
     ============================================================ */
  header, .ticker, .panel, .card, .sheet, .chat-log, .idx.ballot, .btn, .chip, .idx-row, .sc-card, .sceno-summary{
    transition:background-color .6s ease, color .5s ease, border-color .5s ease, box-shadow .6s ease;
  }

  /* ------- SMOKY FOG (night · animated) — static fallback for the ink wash ------- */
  body.skin-smoky-fog::before{
    background:
      radial-gradient(82% 62% at 16% 24%, rgba(141,142,153,.13), transparent 68%),
      radial-gradient(92% 72% at 86% 5%, rgba(141,142,153,.11), transparent 66%),
      radial-gradient(105% 78% at 52% 108%, rgba(141,142,153,.08), transparent 70%),
      linear-gradient(180deg, #0C0D11, #11131A); }
  body.skin-smoky-fog.atmo-static::before{
    transform:scale(1.1) translate3d(-2%,1%,0); transform-origin:center; will-change:transform;
    animation:fogFallbackDrift 18s ease-in-out infinite alternate; }
  @keyframes fogFallbackDrift{
    from{ transform:scale(1.1) translate3d(-2%,1%,0); }
    to{ transform:scale(1.16) translate3d(3%,-2%,0); }
  }
  @media (prefers-reduced-motion:reduce){
    body.skin-smoky-fog.atmo-static::before{ animation:none; transform:scale(1.1); }
  }

  /* ------- STILL GLASS (night · static) — frosted monochrome, zero color ------- */
  body.skin-still-glass{ --coal:#1A1C20; --line:#31343B; --frame:rgba(255,255,255,.17); }
  body.skin-still-glass::before{
    background:
      radial-gradient(110% 80% at 50% -20%, rgba(255,255,255,.06), transparent 60%),
      radial-gradient(130% 90% at 88% 115%, rgba(255,255,255,.035), transparent 55%),
      linear-gradient(180deg, #101114, #17181C); }
  body.skin-still-glass .panel, body.skin-still-glass .card, body.skin-still-glass .sheet,
  body.skin-still-glass .chat-log, body.skin-still-glass .idx.ballot{
    background:rgba(255,255,255,.045); border-color:rgba(255,255,255,.09);
    backdrop-filter:blur(14px) saturate(.85); -webkit-backdrop-filter:blur(14px) saturate(.85); }
  body.skin-still-glass header, body.skin-still-glass .ticker{ background:rgba(16,17,20,.55); }

  /* ------- RAINY GLASS (night · animated) — grey night behind a wet pane;
     heavy frosted panels deliberately obscure the rain running behind them ------- */
  body.skin-rainy-glass{ --coal:#191B1F; --line:#33363D; --frame:rgba(255,255,255,.15); }
  body.skin-rainy-glass::before{
    background:
      radial-gradient(100% 70% at 30% -10%, rgba(255,255,255,.05), transparent 55%),
      radial-gradient(120% 80% at 80% 110%, rgba(255,255,255,.04), transparent 55%),
      linear-gradient(180deg, #121317, #191B20); }
  body.skin-rainy-glass .panel, body.skin-rainy-glass .card, body.skin-rainy-glass .sheet,
  body.skin-rainy-glass .chat-log, body.skin-rainy-glass .idx.ballot{
    background:rgba(20,22,26,.36); border-color:rgba(255,255,255,.08);
    backdrop-filter:blur(18px) saturate(.9); -webkit-backdrop-filter:blur(18px) saturate(.9);
    box-shadow:0 18px 40px -22px rgba(0,0,0,.6); }
  body.skin-rainy-glass header, body.skin-rainy-glass .ticker{
    background:rgba(14,15,18,.5); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); }

  /* ------- DAYTIME WOOD (day · static) — the cabin bulletin board ------- */
  body.skin-daytime-wood{ --line:#57422C; --frame:rgba(240,228,198,.32); }
  body.skin-daytime-wood::before{
    background:
      radial-gradient(120% 80% at 50% -10%, rgba(0,0,0,.42), transparent 60%),
      repeating-linear-gradient(90deg, rgba(0,0,0,.16) 0 3px, transparent 3px 128px),
      repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 2px, transparent 2px 6px),
      linear-gradient(180deg, #4E3826, #34240F); }
  body.skin-daytime-wood header, body.skin-daytime-wood .ticker{ background:rgba(30,20,10,.82); }
  /* Paper pinned to the board: local token overrides keep ink-dark text on parchment. */
  body.skin-daytime-wood .card, body.skin-daytime-wood .sheet, body.skin-daytime-wood .chat-log, body.skin-daytime-wood .idx.ballot{
    --bone:#2B1D10; --smoke:#7A6248; --line:rgba(43,29,16,.22); --carmine:#A93341; --brass:#7E6535;
    background:#F0E4C6; color:#2B1D10; border-color:rgba(43,29,16,.3);
    box-shadow:0 14px 28px rgba(0,0,0,.42), 0 3px 8px rgba(0,0,0,.32);
    position:relative;
  }
  body.skin-daytime-wood .idx.ballot{ padding:4px 16px 8px; border:1px solid rgba(43,29,16,.3); border-radius:2px; }
  body.skin-daytime-wood .card::after, body.skin-daytime-wood .idx.ballot::after{
    content:''; position:absolute; top:7px; left:50%; margin-left:-5px; width:10px; height:10px; border-radius:50%;
    background:radial-gradient(circle at 35% 30%, #E8B24A, #8F5A1D 72%);
    box-shadow:0 2px 3px rgba(0,0,0,.45); }
  body.skin-daytime-wood .notices .card:nth-child(odd){ transform:rotate(-.5deg); }
  body.skin-daytime-wood .notices .card:nth-child(even){ transform:rotate(.45deg); }
  body.skin-daytime-wood .idx-row:active{ background:rgba(43,29,16,.06); }
  body.skin-daytime-wood .idx-row.picked{ background:rgba(43,29,16,.08); }
  body.skin-daytime-wood .chip{ border-color:rgba(240,228,198,.35); }
  body.skin-daytime-wood .btn-primary{ background:#F0E4C6; color:#2B1D10; box-shadow:0 8px 18px rgba(0,0,0,.35); }
  body.skin-daytime-wood .whisper{ color:rgba(240,228,198,.75); }
  body.skin-daytime-wood .card .whisper, body.skin-daytime-wood .idx.ballot .whisper, body.skin-daytime-wood .sheet .whisper{ color:#6B5236; }

  /* ------- THE TRIBUNAL (day · animated) — the interrogation room.
     A dark day: crushed warm blacks under one hot lamp. Surfaces go
     near-black with heated hairlines, the primary action glows like
     the bulb, and the static fallback paints the cone itself. ------- */
  body.skin-the-tribunal{
    --coal:#191410; --line:#3B3226; --frame:rgba(255,215,150,.28);
    --brass:#D8B36A; --smoke:#97897A;
  }
  body.skin-the-tribunal::before{
    background:
      /* the lamp head and its halo, dead centre above the frame */
      radial-gradient(56% 88% at 50% -10%, rgba(255,223,168,.22), rgba(255,214,150,.05) 55%, transparent 74%),
      /* the cone: a hard-edged wedge falling through the dust */
      conic-gradient(from 180deg at 50% -14%, transparent 41.5%, rgba(255,220,160,.07) 47%, rgba(255,226,178,.16) 50%, rgba(255,220,160,.07) 53%, transparent 58.5%),
      /* the pool where the light lands */
      radial-gradient(50% 16% at 50% 102%, rgba(255,206,138,.11), transparent 70%),
      linear-gradient(180deg, #0B0907, #131009); }
  body.skin-the-tribunal header, body.skin-the-tribunal .ticker{ background:rgba(13,10,7,.72); }
  body.skin-the-tribunal .panel, body.skin-the-tribunal .card, body.skin-the-tribunal .sheet,
  body.skin-the-tribunal .chat-log, body.skin-the-tribunal .idx.ballot{
    background:linear-gradient(180deg, rgba(255,219,158,.05), rgba(16,12,8,.6) 26%);
    border-color:rgba(255,215,150,.15);
    box-shadow:0 1px 2px rgba(0,0,0,.5), 0 22px 50px -20px rgba(0,0,0,.66); }
  body.skin-the-tribunal .btn-primary{ background:#F2D8A8; color:#16100A; box-shadow:0 12px 30px -12px rgba(242,216,168,.4); }
  body.skin-the-tribunal .idx-row:active{ background:rgba(255,219,158,.05); }
  body.skin-the-tribunal .idx-row.picked{ background:rgba(255,219,158,.06); }
  body.skin-the-tribunal .picked .tick{ box-shadow:inset 0 0 0 4px #0B0907; }
  body.skin-the-tribunal .chip{ border-color:rgba(255,215,150,.24); }
  body.skin-the-tribunal .empty-state, body.skin-the-tribunal input.field,
  body.skin-the-tribunal select.field{ border-color:rgba(255,215,150,.24); }

  /* ------- developer options panel (hidden; 5 taps on the wordmark) ------- */
  .dev-panel{ position:fixed; top:72px; right:16px; width:min(300px, calc(100vw - 24px));
    max-height:calc(100dvh - 88px); overflow-y:auto;
    z-index:calc(var(--z-inter) + 5); display:none; border:1px solid var(--line); border-radius:2px;
    background:rgba(21,22,28,.96); backdrop-filter:blur(10px); box-shadow:0 18px 44px rgba(0,0,0,.5); }
  .dev-panel.open{ display:block; }
  .dev-head{ display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding:10px 12px; border-bottom:1px solid var(--line); cursor:grab; touch-action:none; user-select:none; }
  .dev-head:active{ cursor:grabbing; }
  .dev-close{ color:var(--smoke); font-size:13px; width:28px; height:28px; flex:none;
    border:1px solid var(--line); border-radius:2px; cursor:pointer; }
  .dev-close:hover{ color:var(--bone); border-color:var(--smoke); }
  .dev-body{ padding:4px 12px 12px; }
  .dev-row{ display:flex; align-items:center; justify-content:space-between; gap:14px;
    padding:12px 0; border-bottom:1px solid var(--line); }
  .dev-row:last-child{ border-bottom:none; }
  .dev-label{ font-family:var(--font-mono); font-size:10px; letter-spacing:.18em;
    text-transform:uppercase; color:var(--bone); }
  .dev-hint{ display:block; font-size:8.5px; letter-spacing:.12em; color:var(--smoke); margin-top:4px; }
  .dev-toggle{ cursor:pointer; flex:none; display:flex; }
  .dev-toggle.on .switch{ border-color:var(--bone); }
  .dev-toggle.on .switch::after{ left:23px; background:var(--bone); }
  .dev-sect{ padding:12px 0; border-bottom:1px solid var(--line); }
  .dev-sect:last-child{ border-bottom:none; }
  .dev-btn{ flex:1; min-width:0; height:36px; border:1px solid var(--line); border-radius:2px; cursor:pointer;
    font-family:var(--font-mono); font-size:9px; letter-spacing:.16em; text-transform:uppercase; color:var(--bone);
    background:rgba(234,227,211,.04); transition:background .15s, border-color .15s; }
  .dev-btn:active{ background:rgba(234,227,211,.1); }
  .dev-select{ flex:1; min-width:0; height:36px; font-size:11px; padding:0 8px; font-family:var(--font-mono); }

  /* ------- god mode overlay (dev; host/local only) ------- */
  .god-panel{ position:fixed; bottom:52px; left:12px; width:min(340px, calc(100vw - 24px)); max-height:46vh; overflow-y:auto;
    z-index:calc(var(--z-inter) + 4); border:1px solid var(--line); border-radius:2px; padding:10px 12px;
    background:rgba(21,22,28,.96); backdrop-filter:blur(10px); box-shadow:0 18px 44px rgba(0,0,0,.5); }
  .god-row{ display:flex; gap:8px; align-items:baseline; padding:6px 0; border-bottom:1px solid var(--line);
    font-family:var(--font-mono); font-size:9px; letter-spacing:.08em; text-transform:uppercase; color:var(--bone); }
  .god-row:last-child{ border-bottom:none; }

  /* Fixed-dark chrome keeps its own ink tokens no matter the skin — a light
     skin's inverted --bone must never darken text sitting on these surfaces. */
  #inter, .dev-panel, .god-panel, .reconnect-veil, .audio-fly, .settings-fly{
    --bone:#EAE3D3; --smoke:#8D8E99; --line:#262832; --coal:#15161C; color:var(--bone);
  }

  /* ------- header audio flyout: volume lives with the SND control ------- */
  .audio-fly{ position:fixed; top:calc(62px + env(safe-area-inset-top)); right:calc(var(--gutter) + env(safe-area-inset-right, 0px));
    width:min(260px, calc(100vw - 32px)); z-index:calc(var(--z-inter) + 5);
    border:1px solid var(--line); border-radius:6px; padding:12px 14px;
    background:rgba(18,19,24,.92); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);
    box-shadow:0 1px 2px rgba(0,0,0,.3), 0 18px 44px rgba(0,0,0,.5);
    animation:fadeUp .25s var(--ease-out) both; }

  .header-icon-btn{ width:36px; height:32px; display:grid; place-items:center; cursor:pointer; }
  .header-icon-btn svg{ width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.4;
    stroke-linecap:round; stroke-linejoin:round; }
  .settings-fly{ position:fixed; top:calc(62px + env(safe-area-inset-top));
    right:calc(var(--gutter) + 56px + env(safe-area-inset-right, 0px));
    width:min(340px, calc(100vw - 24px)); max-height:calc(100dvh - 80px); overflow-y:auto;
    z-index:calc(var(--z-inter) + 5); border:1px solid var(--line); border-radius:6px;
    background:rgba(18,19,24,.96); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
    box-shadow:0 1px 2px rgba(0,0,0,.3), 0 22px 54px rgba(0,0,0,.55); animation:fadeUp .2s ease both; }
  .settings-fly-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:14px;
    padding:14px; border-bottom:1px solid var(--line); }
  .settings-fly-kicker{ display:block; margin-top:5px; color:var(--smoke); font:8px/1.4 var(--mono);
    letter-spacing:.12em; text-transform:uppercase; }
  .settings-fly-close{ width:30px; height:30px; flex:none; color:var(--smoke); border:1px solid var(--line);
    border-radius:2px; cursor:pointer; }
  .settings-fly-body{ padding:2px 14px 14px; }
  .settings-fly-row{ min-height:64px; }
  .settings-fly-row:disabled{ opacity:.42; cursor:not-allowed; }
  .settings-fly-label{ font-size:9px; letter-spacing:.17em; }
  .settings-fly-hint{ font-size:8px; letter-spacing:.1em; margin-top:4px; }
  .settings-seconds{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 0 2px;
    border-top:1px solid var(--line); }
  .settings-seconds > span{ font-size:8.5px; letter-spacing:.16em; }
  .settings-seconds .field{ width:78px; height:38px; }
  @media (max-width:520px){
    .settings-fly{ top:calc(60px + env(safe-area-inset-top)); right:12px; width:calc(100vw - 24px); }
  }
  @media (max-width:380px){
    header .gap-3{ gap:8px; }
    .wordmark{ font-size:11px; }
    .header-icon-btn{ width:32px; }
  }
  .fly-mute{ flex:none; width:72px; height:32px; border:1px solid var(--line); border-radius:2px; cursor:pointer;
    font-family:var(--font-mono); font-size:9px; letter-spacing:.16em; text-transform:uppercase; color:var(--bone);
    background:rgba(234,227,211,.04); transition:background .15s, border-color .15s, color .15s; }
  .fly-mute.muted{ color:var(--carmine); border-color:rgba(216,67,79,.4); }

  /* ============================================================
     SCENOGRAPHY — the backdrop library.
     One native <details> disclosure finished as a real component:
     live swatches of the current assignment ride the summary bar,
     a hairline chevron pivots on open, and the body unfolds into a
     fluid card grid. Soft radii + layered ambient depth mark these
     as tactile objects against the razor-edged broadsheet around.
     ============================================================ */
  .sceno{ margin-top:4px; }
  .sceno-summary{ display:flex; align-items:center; gap:14px; min-height:68px; padding:12px 16px 12px 13px;
    cursor:pointer; list-style:none; border:1px solid var(--line); border-radius:5px;
    background:linear-gradient(180deg, rgba(234,227,211,.05), rgba(234,227,211,.015));
    transition:border-color .25s var(--ease-out), background-color .25s ease; }
  .sceno-summary::-webkit-details-marker{ display:none; }
  .sceno-summary::marker{ content:''; }
  .sceno-deck{ position:relative; width:62px; height:42px; flex:none; }
  .sceno-swatch{ position:absolute; display:grid; place-items:center; width:38px; height:38px; border-radius:50%;
    color:var(--theme-accent); border:1px solid currentColor; background:var(--coal); box-shadow:0 3px 10px rgba(0,0,0,.35); }
  .sceno-swatch:first-child{ left:22px; top:4px; opacity:.82; }
  .sceno-swatch:last-child{ left:0; top:0; }
  .sceno-swatch svg{ width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.35;
    stroke-linecap:round; stroke-linejoin:round; }
  .sceno-copy{ flex:1; min-width:0; display:flex; flex-direction:column; gap:5px; }
  .sceno-title{ font-family:var(--font-display); font-weight:800; font-size:13px; letter-spacing:.04em; text-transform:uppercase; }
  .sceno-state{ font-family:var(--font-mono); font-size:8.5px; letter-spacing:.18em; text-transform:uppercase; color:var(--smoke);
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .sceno-chevron{ width:9px; height:9px; flex:none; margin-right:5px; margin-top:-4px;
    border-right:1.5px solid var(--smoke); border-bottom:1.5px solid var(--smoke); transform:rotate(45deg);
    transition:transform .32s var(--ease-mech), border-color .25s ease, margin .32s var(--ease-mech); }
  .sceno[open] .sceno-summary{ border-color:var(--smoke); background:rgba(234,227,211,.06);
    border-bottom-left-radius:0; border-bottom-right-radius:0; }
  .sceno[open] .sceno-chevron{ transform:rotate(225deg); margin-top:4px; border-color:var(--bone); }
  @media (hover:hover){ .sceno-summary:hover{ border-color:var(--smoke); background:rgba(234,227,211,.055); } }
  .sceno-body{ border:1px solid var(--smoke); border-top:0; border-radius:0 0 5px 5px; padding:15px 15px 17px;
    background:rgba(0,0,0,.16); }
  .sceno[open] .sceno-body{ animation:scenoReveal .5s var(--ease-out) both; }
  @keyframes scenoReveal{ from{ opacity:0; transform:translateY(-7px); } to{ opacity:1; transform:none; } }
  .sceno-note{ font-size:13.5px; margin:0 0 14px; }

  .sceno-grid{ display:grid; grid-template-columns:1fr; gap:8px; }
  .sc-card{ position:relative; overflow:hidden; border:1px solid var(--line); border-left:3px solid var(--theme-accent);
    border-radius:4px; background:rgba(21,22,28,.78); box-shadow:0 1px 2px rgba(0,0,0,.22);
    transition:border-color .25s ease, background-color .25s ease; }
  .sc-card-main{ display:grid; grid-template-columns:46px minmax(0,1fr) auto; align-items:center; gap:12px; padding:12px 12px 10px; }
  .sc-theme-icon{ display:grid; place-items:center; width:46px; height:46px; color:var(--theme-accent);
    border:1px solid currentColor; border-radius:50%; background:rgba(255,255,255,.018); }
  .sc-theme-icon svg{ width:25px; height:25px; fill:none; stroke:currentColor; stroke-width:1.35;
    stroke-linecap:round; stroke-linejoin:round; }
  .sc-meta{ min-width:0; display:flex; flex-direction:column; gap:3px; padding:0; }
  .sc-kind{ font-family:var(--font-mono); font-size:7.5px; letter-spacing:.18em; text-transform:uppercase; color:var(--theme-accent); }
  .sc-name{ font-family:var(--font-display); font-weight:800; font-size:15px; line-height:1.05; text-transform:uppercase; letter-spacing:.045em; }
  .sc-blurb{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-family:var(--font-serif); font-style:italic;
    font-size:12px; line-height:1.35; color:var(--smoke); }
  .sc-eye{ min-width:86px; height:34px; display:flex; align-items:center; justify-content:center; gap:7px; cursor:pointer;
    border:1px solid var(--line); border-radius:3px; padding:0 10px; background:transparent; color:var(--bone);
    font-family:var(--font-mono); font-size:7.5px; font-weight:600; letter-spacing:.15em; text-transform:uppercase;
    transition:border-color .2s ease, background-color .2s ease, color .2s ease; }
  .sc-eye svg{ width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.45; stroke-linecap:round; stroke-linejoin:round; }
  .sc-eye:active{ transform:scale(.97); }
  .sc-eye.on{ background:var(--theme-accent); border-color:var(--theme-accent); color:#101116;
    box-shadow:0 0 0 1px color-mix(in srgb, var(--theme-accent) 35%, transparent); }
  .sc-card-actions{ display:flex; align-items:center; gap:12px; padding:8px 12px 10px 70px; border-top:1px solid rgba(141,142,153,.13); }
  .sc-accent-rule{ flex:1; height:1px; opacity:.5; background:var(--theme-accent); }
  .sc-slots{ display:flex; gap:6px; flex:none; padding:0; margin:0; }
  .sc-assign{ width:82px; height:32px; cursor:pointer; border:1px solid var(--line); border-radius:3px;
    background:transparent; color:var(--smoke); font-family:var(--font-mono); font-size:8.5px; font-weight:600;
    letter-spacing:.2em; text-transform:uppercase;
    transition:background .2s, color .2s, border-color .2s, transform .12s var(--ease-out); }
  .sc-assign:active{ transform:scale(.95); }
  .sc-assign.on{ background:var(--bone); color:var(--ink); border-color:var(--bone); }
  @media (hover:hover){
    .sc-card:hover{ border-color:var(--smoke); background:rgba(26,27,34,.86); }
    .sc-eye:not(.on):hover{ border-color:var(--theme-accent); color:var(--theme-accent); background:rgba(255,255,255,.025); }
    .sc-assign:not(.on):hover{ border-color:var(--smoke); color:var(--bone); }
  }

  @media (max-width:520px){
    .sc-card-main{ grid-template-columns:40px minmax(0,1fr) auto; gap:10px; padding:11px 10px 9px; }
    .sc-theme-icon{ width:40px; height:40px; }
    .sc-theme-icon svg{ width:22px; height:22px; }
    .sc-eye{ min-width:34px; width:34px; padding:0; }
    .sc-eye span{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
    .sc-card-actions{ padding-left:60px; }
    .sc-assign{ width:76px; }
  }

  /* ------- thumbnails: compact film stills built from the same visual cues as
     the live scenes. Motion stays cheap and pauses off-hover on pointer devices. */
  .th-rainy-glass{
    background:
      radial-gradient(circle at 22% 76%, rgba(244,157,65,.92) 0 2%, rgba(244,157,65,.36) 7%, transparent 25%),
      radial-gradient(circle at 76% 36%, rgba(80,148,215,.76) 0 2%, rgba(80,148,215,.25) 7%, transparent 25%),
      linear-gradient(145deg, #151D27 0%, #0B1017 58%, #06080C 100%); }
  .th-rainy-glass::before{ content:''; position:absolute; z-index:0; inset:0;
    background:
      linear-gradient(180deg, transparent 0 7%, rgba(220,232,242,.13) 22%, rgba(196,210,222,.04) 72%, transparent 100%) 23% -18px/2px 132px no-repeat,
      linear-gradient(180deg, transparent 0 11%, rgba(220,232,242,.10) 27%, rgba(196,210,222,.03) 70%, transparent 100%) 58% -34px/2px 150px no-repeat,
      linear-gradient(180deg, transparent 0 6%, rgba(220,232,242,.12) 24%, rgba(196,210,222,.04) 66%, transparent 100%) 84% -12px/1px 124px no-repeat,
      linear-gradient(105deg, rgba(206,219,230,.04), transparent 30%, rgba(206,219,230,.035) 62%, transparent);
    filter:blur(.35px); }
  .th-rainy-glass::after{ content:''; position:absolute; z-index:2; inset:0; pointer-events:none;
    background:
      linear-gradient(112deg, rgba(219,231,240,.06), transparent 34%, rgba(219,231,240,.025) 68%, transparent),
      radial-gradient(105% 92% at 50% 47%, transparent 36%, rgba(3,5,8,.58) 100%);
    box-shadow:inset 0 0 28px rgba(7,9,13,.38); }
  .th-rainy-glass .th-motion{ inset:-7% 0 -7%; opacity:.94;
    background:
      radial-gradient(circle 2px at 13% 17%, rgba(255,255,255,.94), transparent 72%),
      radial-gradient(circle 2px at 49% 49%, rgba(255,255,255,.90), transparent 72%),
      radial-gradient(circle 1.5px at 79% 17%, rgba(255,255,255,.88), transparent 72%),
      radial-gradient(ellipse 22px 30px at 18% 30%, rgba(246,250,253,.30) 0 4%, rgba(230,239,246,.08) 9%, transparent 18% 48%, rgba(205,220,231,.30) 54%, rgba(3,6,10,.34) 61%, transparent 70%),
      radial-gradient(ellipse 30px 40px at 54% 63%, rgba(246,250,253,.26) 0 4%, rgba(230,239,246,.07) 9%, transparent 18% 48%, rgba(205,220,231,.28) 54%, rgba(3,6,10,.36) 61%, transparent 70%),
      radial-gradient(ellipse 18px 25px at 83% 28%, rgba(246,250,253,.28) 0 4%, rgba(230,239,246,.07) 9%, transparent 18% 47%, rgba(205,220,231,.28) 54%, rgba(3,6,10,.34) 61%, transparent 70%),
      radial-gradient(ellipse 38px 48px at 99% 91%, rgba(246,250,253,.22) 0 4%, rgba(230,239,246,.06) 9%, transparent 18% 48%, rgba(205,220,231,.25) 54%, rgba(3,6,10,.36) 61%, transparent 70%);
    filter:drop-shadow(0 2px 2px rgba(0,0,0,.32)); animation:thRain 7.5s ease-in-out infinite alternate; }
  @keyframes thRain{ from{ transform:translateY(-2%); } to{ transform:translateY(3%); } }

  .th-smoky-fog{ background:
      radial-gradient(95% 85% at 82% -8%, rgba(117,125,148,.22), transparent 62%),
      linear-gradient(145deg, #090A0E, #131620 54%, #08090D); }
  .th-smoky-fog::after{ content:''; position:absolute; z-index:2; inset:0; pointer-events:none;
    background:radial-gradient(100% 95% at 50% 50%, transparent 36%, rgba(3,4,7,.62) 100%); }
  .th-smoky-fog .th-motion{ inset:-24%; opacity:.92; mix-blend-mode:screen;
    background:
      radial-gradient(42% 32% at 18% 66%, rgba(126,135,158,.34), transparent 72%),
      radial-gradient(54% 36% at 48% 47%, rgba(97,105,128,.30), transparent 72%),
      radial-gradient(45% 34% at 79% 30%, rgba(145,149,166,.25), transparent 72%),
      radial-gradient(48% 30% at 75% 75%, rgba(77,84,105,.28), transparent 72%);
    filter:blur(10px) contrast(1.18); animation:thFog 9s ease-in-out infinite alternate; }
  @keyframes thFog{ from{ transform:translate(-5%,3%) scale(1); } to{ transform:translate(6%,-4%) scale(1.14); } }

  .th-still-glass{ background:
      radial-gradient(55% 62% at 22% 72%, rgba(255,255,255,.05), transparent 72%),
      linear-gradient(118deg, transparent 30%, rgba(226,232,238,.04) 43%, rgba(255,255,255,.13) 50%, rgba(226,232,238,.035) 57%, transparent 70%),
      radial-gradient(100% 80% at 50% -14%, rgba(255,255,255,.10), transparent 64%),
      linear-gradient(180deg, #101216, #1A1D22); }
  .th-still-glass::after{ content:''; position:absolute; inset:0; pointer-events:none;
    border:1px solid rgba(255,255,255,.035); box-shadow:inset 0 0 28px rgba(255,255,255,.025); }

  .th-the-tribunal{ background:
      radial-gradient(2px 2px at 29% 53%, rgba(255,229,179,.65), transparent 70%),
      radial-gradient(1.5px 1.5px at 63% 42%, rgba(255,229,179,.55), transparent 70%),
      radial-gradient(2px 2px at 72% 69%, rgba(255,229,179,.5), transparent 70%),
      radial-gradient(58% 90% at 50% -12%, rgba(255,224,170,.7), rgba(255,214,150,.14) 55%, transparent 74%),
      radial-gradient(46% 20% at 50% 96%, rgba(255,208,140,.30), transparent 70%),
      linear-gradient(180deg, #17130D, #090705); }
  .th-the-tribunal .th-motion{ background:
      conic-gradient(from 180deg at 50% -20%, transparent 42%, rgba(255,226,172,.40) 50%, transparent 58%);
    transform-origin:50% -20%; animation:thSweep 7s ease-in-out infinite alternate; }
  @keyframes thSweep{ from{ transform:rotate(-9deg); } to{ transform:rotate(9deg); } }

  .th-daytime-wood{ background:
      radial-gradient(ellipse 9px 6px at 17% 64%, rgba(46,24,10,.56) 0 18%, rgba(120,75,36,.22) 36%, transparent 66%),
      radial-gradient(ellipse 7px 5px at 73% 31%, rgba(46,24,10,.48) 0 18%, rgba(120,75,36,.18) 36%, transparent 66%),
      radial-gradient(120% 80% at 50% -10%, rgba(255,221,161,.12), transparent 62%),
      repeating-linear-gradient(90deg, transparent 0 24%, rgba(29,16,8,.32) 24.2% 24.8%, transparent 25% 49%, rgba(255,228,180,.05) 49.2% 49.7%, transparent 50% 74%, rgba(29,16,8,.28) 74.2% 74.8%, transparent 75% 100%),
      repeating-linear-gradient(5deg, rgba(255,255,255,.018) 0 1px, transparent 1px 5px),
      linear-gradient(180deg, #5B412A, #34230F); }
  /* stillness by default (mobile perf); a resting desktop pointer wakes the loop */
  .sceno-grid .th-motion{ animation-play-state:paused; }
  @media (hover:hover){ .sc-card:hover .th-motion{ animation-play-state:running; } }
  /* touch devices have no hover to resume with — let the thumbs run; they're
     cheap CSS layers and only exist on the setup screen */
  @media (hover:none){ .sceno-grid .th-motion{ animation-play-state:running; } }
