/* /tv (visual-system 6, 7): a fixed 1920 x 1080 stage, letterboxed. 88 px top bar, 65% manor, 35% Pinboard. */
html:has(.tv) { background: #05070D; overflow: hidden; }
.tv { position: fixed; inset: 0; background: #05070D; }
.tv-frame {
  position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; overflow: hidden;
  transform: translate(-50%, -50%) scale(var(--tv-scale, 1)); transform-origin: 50% 50%;
  background-color: var(--velvet);
  background-image: var(--noise); /* the oil-paint grain; the closing-in edges live on .stage__night, tied to the manor-area box */
  background-blend-mode: overlay;
  display: flex; flex-direction: column;
}
.tv--connecting { display: grid; place-items: center; font: 700 2rem var(--f-display); color: var(--brass); }

/* 4.4 / 6: the slim top bar with the clock overhanging */
.topbar { position: relative; z-index: 5; flex: none; height: 88px; display: flex; align-items: center; padding: 0 64px; gap: 20px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.04), transparent), var(--velvet-deep);
  border-bottom: 2px solid var(--brass); box-shadow: 0 1px 0 rgb(240 215 122 / 0.5), 0 10px 24px rgba(0, 0, 0, 0.5); }
.topbar__hairlines { position: absolute; inset: 10px 24px; border-top: 1.5px solid rgb(212 175 55 / 0.55); border-bottom: 1.5px solid rgb(212 175 55 / 0.55); pointer-events: none; }
.topbar__left, .topbar__right { flex: 1; display: flex; align-items: center; gap: 16px; }
.topbar__right { justify-content: flex-end; }
.topbar__phase { white-space: nowrap; font: 700 28px var(--f-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--brass-hi); }
.chip--badge { background: linear-gradient(180deg, #F0D77A, #D4AF37 45%, #8A6A1E); color: var(--ink); border-color: var(--brass-line); }
.plaque { position: relative; display: inline-flex; align-items: center; height: 56px; padding: 0 34px; font: 700 36px var(--f-display); color: var(--cream); letter-spacing: 0.04em;
  background: linear-gradient(180deg, #1B4A3A, #0E2A20); border: 2px solid var(--brass); border-radius: 4px; box-shadow: inset 0 0 0 4px rgb(11 28 22), inset 0 0 0 5px rgb(212 175 55 / 0.6); }
.topbar__time { margin-right: -6px; }
.topbar__code { margin-left: -6px; color: var(--brass-hi); }
.topbar__face { width: 132px; height: 132px; flex: none; margin: 0 -4px; position: relative; top: 22px; z-index: 6; }
.topbar__countdown { width: 60px; height: 60px; }
.topbar__acts { display: inline-flex; gap: 10px; }
.act-pip { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--brass); background: radial-gradient(circle at 40% 35%, #3B3020, #120D08); }
.act-pip[data-lit='yes'] { background: radial-gradient(circle at 40% 35%, #FFE3A3, #E59A3C 55%, #8A4A12); box-shadow: 0 0 12px 2px rgb(229 154 60 / 0.7); }

.tv__body { flex: 1; display: grid; grid-template-columns: 1440px 480px; min-height: 0; } /* manor 75% / Pinboard 25% (visual-system 6, rev 2, Andrew) */

/* The stage: velvet, corners, the manor area 1344 x 832 (TV_AREA in shell.ts) and the 112 px guest rail */
.stage { position: relative; display: flex; flex-direction: column; padding: 24px 48px 0; overflow: hidden; }
.stage__light { position: absolute; inset: 0; pointer-events: none; z-index: 3; background: var(--grade); mix-blend-mode: multiply; transition: background 6s; }
[data-act='3'] .stage__light { box-shadow: inset 0 0 160px rgb(158 42 43 / 0.18); }
.stage__corners { inset: 16px; }

/* Night falls (TV ground): near-black painted edges closing on a warm emerald centre. Only the outer ~25% of the stage box darkens,
   so the whole house stays bright whatever its outline. Tied to the stage (manor-area) box, never to room positions. The act rides --velvet/--velvet-deep
   (base.css 1.2) plus --night-a below; no new timeline. Deliberately shapeless: no windows, paths or places that could read as clues. */
@property --night-a { syntax: '<number>'; inherits: true; initial-value: 0.8; }
@property --night-out { syntax: '<number>'; inherits: true; initial-value: 0; }
.tv { --night-a: 0.78; --night-out: 0; transition: --night-a 6s, --night-out 0.6s; }
.tv[data-act='2'] { --night-a: 0.9; }
.tv[data-act='3'] { --night-a: 0.97; }
.tv[data-power='out'] { --night-out: 0.74; }
.stage__night { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(ellipse closest-side at 50% 50%, transparent 0 74%, rgb(from var(--velvet-deep) r g b / calc(var(--night-a) * 0.55)) 88%, rgb(2 3 6 / var(--night-a)) 100%),
    radial-gradient(ellipse 62% 58% at 50% 50%, color-mix(in srgb, var(--velvet) 62%, #4E9A6A) 0%, transparent 100%);
  background-blend-mode: normal, soft-light; }
.stage__night::before { content: ''; position: absolute; inset: 0; background: rgb(2 3 6 / var(--night-out)); } /* Lights Out: the ground goes near-black */
.stage__night::after { content: ''; position: absolute; inset: 0; background: rgb(150 175 230); opacity: 0; } /* the rare, soft flash (Lights Out only) */
.stage__mist { position: absolute; inset: -10%; opacity: 0.1; mix-blend-mode: screen; filter: blur(30px);
  background: radial-gradient(ellipse 34% 22% at 20% 30%, #9FB4B0, transparent), radial-gradient(ellipse 30% 20% at 78% 68%, #9FB4B0, transparent), radial-gradient(ellipse 26% 18% at 55% 92%, #9FB4B0, transparent);
  -webkit-mask-image: radial-gradient(ellipse closest-side at 50% 50%, transparent 0 66%, #000 92%); mask-image: radial-gradient(ellipse closest-side at 50% 50%, transparent 0 66%, #000 92%);
  animation: mist-drift 140s ease-in-out infinite alternate; }
.tv[data-power='out'] .stage__mist { opacity: 0.05; }
@keyframes mist-drift { from { transform: translate3d(-3%, -1.5%, 0) scale(1); } to { transform: translate3d(3%, 1.5%, 0) scale(1.06); } }
@keyframes night-flash { 0%, 100% { opacity: 0; } 0.9% { opacity: 0.09; } 2.2% { opacity: 0.02; } 4.2% { opacity: 0; } } /* one slow swell per cycle: no strobe */
.tv[data-power='out'] .stage__night::after { animation: night-flash 53s linear infinite; }
@media (prefers-reduced-motion: reduce) { .stage__mist { animation: none; } .tv[data-power='out'] .stage__night::after { animation: none; } }
.stage__manor { position: relative; flex: 1; display: grid; place-items: center; min-height: 0; z-index: 1; }
.stage .banner--second, .stage .banner--chime { position: absolute; left: 96px; right: 96px; top: 28px; font-size: 28px; text-align: center; }
.stage .banner--chime { border-color: var(--crimson); top: auto; bottom: 140px; animation: pulse 1s ease-in-out infinite; }

/* The manor SVG (7) */
.manor { display: block; width: 1344px; height: 832px; overflow: visible; }
.manor--map { width: 100%; height: auto; }
.manor__ground polygon { fill: rgba(0, 0, 0, 0.5); }
.piece__dark { transition: opacity 6s ease-in-out; }
.piece__lightsout { transition: opacity 0.4s ease-in; }
[data-power='out'] .piece__lightsout { transition-duration: 120ms; }
[data-power='out'] .piece__dark { transition-duration: 120ms; }
.piece__mood { fill: #05070E; transition: fill-opacity 3s ease; }
.piece__cone { fill: #FFE9A8; opacity: 0.38; mix-blend-mode: soft-light; filter: url(#soft-blur); }
.cap__walnut { fill: none; stroke: #2A170C; stroke-width: 10; stroke-linecap: square; }
.cap__brass { fill: none; stroke: var(--brass); stroke-width: 3; transform: translateY(-5px); }
.coded-piece__slab-l { fill: #2A170C; }
.coded-piece__slab-r { fill: #1C0F07; }
.coded-piece__wall-r { filter: brightness(1.2); }
.coded-piece__flock { opacity: 0.25; mix-blend-mode: overlay; }
.coded-piece__boards { opacity: 0.45; mix-blend-mode: multiply; }
.coded-piece__trim { fill: none; stroke: var(--brass-lo); stroke-width: 4; }
.glyph { fill: rgb(20 12 6 / 0.35); stroke: #C9A43A; stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; }
.glyph--flame { fill: #E59A3C; stroke: #F0D77A; stroke-width: 2; }
.glyph--window { fill: #2A3B5E; }
[data-act='2'] .glyph--window, [data-act='3'] .glyph--window { fill: #5A70A0; }
.glyph--lamp { fill: rgb(242 179 90 / 0.35); }
.coded-piece__wainscot-l { fill: #3B2314; }
.coded-piece__wainscot-r { fill: #4A2C18; }
.coded-piece__window { fill: #0E1B33; stroke: #2A170C; stroke-width: 8; }
[data-act='2'] .coded-piece__window, [data-act='3'] .coded-piece__window { fill: #3A4F7A; }
.coded-piece__frame { fill: #2B1D12; stroke: var(--brass-lo); stroke-width: 6; }
.coded-piece__rug { stroke: #8A6A1E; stroke-width: 5; opacity: 0.85; }
.coded-piece__pool { mix-blend-mode: screen; transition: opacity 0.4s; }
[data-power='out'] .coded-piece__pool { opacity: 0; } /* Lights Out: the coded lamp pool is a lamp, so it goes out too; only fires, candles and moonlight stay lit */
.coded-piece__edge { fill: none; stroke: rgb(5 7 13 / 0.6); stroke-width: 2; }
.opening__runner { fill: #5A1620; stroke: #C9A43A; stroke-width: 3; }
.opening__threshold { stroke: var(--brass-hi); stroke-width: 6; stroke-linecap: round; }
.opening__jamb { stroke: #2A170C; stroke-width: 10; }
.opening__cap { fill: var(--brass); }
.plate__paper { fill: var(--parchment); filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.5)); }
.plate__line { fill: none; stroke: var(--brass-lo); }
.plate__hole { fill: #2B1D12; stroke: var(--brass); stroke-width: 3; }
.plate__text { font-family: var(--f-plate); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; fill: var(--ink); }
.plate__gone circle { fill: url(#g-brass); stroke: var(--brass-line); animation: pulse 2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.plate__gone text { font-family: var(--f-ui); font-weight: 700; fill: var(--ink); }
.token__shadow { fill: rgba(0, 0, 0, 0.45); filter: url(#soft-blur); }
.plate { opacity: 0.94; transition: opacity 0.6s; }
[data-power='out'] .plate { opacity: 0.72; }
.plate__more rect { fill: var(--brass); stroke: var(--brass-line); stroke-width: 2; }
.plate__more text { font-family: var(--f-ui); font-weight: 700; fill: var(--ink); }

/* Guest rail (6): every player in one row */
.guest-rail { position: relative; z-index: 4; flex: none; height: 128px; display: flex; justify-content: center; gap: 18px; padding: 8px 0 0; border-top: 1.5px solid rgb(212 175 55 / 0.45); }
.rail-guest { position: relative; width: 140px; display: flex; flex-direction: column; align-items: center; }
.rail-guest__name { max-width: 140px; margin-top: 4px; font: 700 22px/1.1 var(--f-display); color: var(--cream); text-shadow: 0 2px 4px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-guest__pocket { position: absolute; top: -2px; left: 34px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: var(--parchment); color: var(--ink); font: 700 20px/26px var(--f-ui); text-align: center; border: 1.5px solid var(--brass-lo); }
.rail-guest__pocket[data-count='0'] { display: none; }
.rail-guest__room, .rail-guest__away { display: none; }
.rail-guest[data-connected='no'] { opacity: 0.45; }
.whisper-feed { position: absolute; right: 64px; bottom: 150px; z-index: 4; display: grid; gap: 6px; font: 600 italic 30px var(--f-body); color: var(--brass-hi); text-align: right; }

/* The walnut Pinboard (6, 4.5, 4.6) */
.pinboard { position: relative; padding: 40px 24px; border-left: 6px solid #1A0F08; box-shadow: inset 10px 0 18px rgba(0, 0, 0, 0.55), inset 0 0 0 2px rgb(240 215 122 / 0.08);
  background-color: var(--wood); background-image: var(--grain), repeating-linear-gradient(90deg, var(--wood), var(--walnut-hi) 3px, var(--wood) 7px, var(--wood) 23px), linear-gradient(180deg, rgb(255 255 255 / 0.06), rgb(0 0 0 / 0.25)); background-blend-mode: overlay, normal, normal; }
.pinboard__empty { display: grid; place-items: center; height: 216px; border: 2px dashed rgb(212 175 55 / 0.45); border-radius: 20px; font: 600 italic 30px var(--f-body); color: rgb(243 231 201 / 0.7); }
.pinboard__cards { display: grid; gap: 16px; }
.pin-card { position: relative; height: 216px; display: grid; grid-template-columns: 144px 1fr; gap: 20px; align-items: center; padding: 32px 36px 26px 30px; color: var(--ink); isolation: isolate; animation: land 450ms ease-out; }
.pin-card__paper { position: absolute; inset: 0; z-index: -1; border-radius: 20px; filter: url(#deckle); box-shadow: var(--shadow-card); background-color: var(--parchment); background-image: radial-gradient(ellipse at 15% 15%, rgb(201 181 138 / 0.5), transparent 45%), radial-gradient(ellipse at 90% 85%, rgb(170 140 90 / 0.45), transparent 50%), var(--noise); background-blend-mode: normal, normal, multiply; }
.pin-card__pin { position: absolute; left: 50%; top: 6px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFF0B8, #D4AF37 50%, #6B4F14); box-shadow: 2px 3px 3px rgba(0, 0, 0, 0.5); z-index: 2; }
.pin-card__prop { width: 144px; height: 144px; border-radius: 50%; border: 3px solid var(--brass); background: radial-gradient(circle, #F6E7C1, #D9C08A); }
.pin-card__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pin-card__title { font: 700 36px/1.05 var(--f-display); text-transform: uppercase; letter-spacing: 0.02em; }
.pin-card__line { font: 600 28px/1.2 var(--f-body); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pin-card[data-tilt='-4'] { rotate: -2deg; } .pin-card[data-tilt='-3'] { rotate: -1.5deg; } .pin-card[data-tilt='-2'] { rotate: -1deg; } .pin-card[data-tilt='-1'] { rotate: -0.5deg; }
.pin-card[data-tilt='1'] { rotate: 0.5deg; } .pin-card[data-tilt='2'] { rotate: 1deg; } .pin-card[data-tilt='3'] { rotate: 1.5deg; } .pin-card[data-tilt='4'] { rotate: 2deg; }
.threads { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; overflow: visible; }
.thread__string { fill: none; stroke: var(--string); stroke-width: 3; filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, 0.5)); }
.thread__hi { fill: none; stroke: #E0636A; stroke-width: 1; opacity: 0.8; }
@keyframes land { from { translate: 0 -40px; rotate: -3deg; } }

/* The lobby (6, 11.4) */
.lobby { position: relative; height: 100%; display: grid; grid-template-columns: 620px 1fr; gap: 48px; padding: 72px 72px 64px; }
.lobby__head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; }
.lobby__emblem { width: 220px; height: 220px; }
.lobby__title { font: 700 64px/1.05 var(--f-display); color: var(--brass-hi); letter-spacing: 0.08em; text-shadow: 0 3px 12px rgba(0, 0, 0, 0.6); }
.lobby__rule { width: 420px; }
.lobby__code { margin-top: 12px; padding: 12px 40px; font: 700 96px/1 var(--f-display); color: var(--brass-hi); letter-spacing: 0.08em; border: 2px solid var(--brass); outline: 1.5px solid rgb(212 175 55 / 0.5); outline-offset: -10px; background: rgb(5 7 13 / 0.45); }
.lobby__url { font: 600 32px var(--f-ui); letter-spacing: 0.08em; color: var(--cream); }
.lobby__key-art { width: 520px; aspect-ratio: 16 / 9; margin-top: 12px; border: 2px solid var(--brass); }
.lobby__key-art[data-art='coded'] { display: none; }
.lobby__side { display: flex; flex-direction: column; gap: 28px; min-height: 0; }
.lobby__settings { display: grid; gap: 18px; padding: 24px 28px; border: 1.5px solid var(--brass); background: rgb(5 7 13 / 0.35); }
.seg { display: flex; align-items: center; gap: 20px; }
.seg__label { width: 210px; font: 700 28px var(--f-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--brass-hi); }
.seg__options { display: inline-flex; border: 2px solid var(--brass-line); border-radius: 999px; overflow: hidden; }
.seg__option { padding: 10px 26px; font: 700 30px var(--f-ui); letter-spacing: 0.04em; text-transform: uppercase; color: var(--cream); background: rgb(59 35 20 / 0.7); }
.seg__option + .seg__option { border-left: 1.5px solid var(--brass-line); }
.seg__option[data-on='yes'] { background: linear-gradient(180deg, #F0D77A, #D4AF37 45%, #8A6A1E); color: var(--ink); }
.gentle { display: grid; grid-template-columns: auto 160px; grid-template-areas: 'label lever' 'line line'; align-items: center; gap: 8px 28px; }
.gentle__label { grid-area: label; font: 700 40px var(--f-display); color: var(--cream); }
.gentle__line { grid-area: line; font: 500 28px var(--f-body); color: rgb(243 231 201 / 0.8); }
.lever { grid-area: lever; position: relative; width: 160px; height: 72px; border-radius: 36px; border: 3px solid var(--brass); background: #1A0F08; box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.7); }
.gentle[data-on='yes'] .lever { background: linear-gradient(90deg, #8A4A12, #E59A3C); }
.lever__knob { position: absolute; top: 3px; left: 4px; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #FFF0B8, #D4AF37 55%, #6B4F14); transition: left 300ms; }
.gentle[data-on='yes'] .lever__knob { left: 90px; }
.lever__flame { width: 20px; height: 28px; }
.gentle[data-on='no'] .lever__flame path { fill: none; stroke: #6B4F14; stroke-width: 1.5; }
.roster { flex: 1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px 12px; align-content: start; overflow: hidden; }
.roster__guest { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.roster__title { font: 700 22px/1.1 var(--f-ui); letter-spacing: 0.04em; text-transform: uppercase; color: var(--cream); }
.roster__player { font: 700 22px/1 var(--f-display); color: var(--brass-hi); min-height: 22px; }
.roster__guest[data-taken='yes'] .token-h { filter: saturate(0.4); }
.roster__guest[data-taken='yes'] .roster__title { opacity: 0.6; }
.lobby__generating { font: 600 italic 32px var(--f-body); color: var(--brass-hi); }

.tv-takeover { position: relative; height: 100%; overflow: auto; padding: 40px 120px; }
.tv-takeover .discovery__telling { font-size: 36px; }

/* ---------- A Surprise! on the TV (core-design 9, visual-system 4.11, 7.4) ---------- */
.tv-sound { position: absolute; right: 22px; top: 100px; z-index: 9; opacity: 0.9; }
.surprise { position: absolute; z-index: 6; left: 64px; right: 64px; top: 26px; display: grid; grid-template-columns: 96px 1fr auto; gap: 22px; align-items: center; padding: 12px 28px;
  border: 3px solid var(--brass); border-radius: 22px; background: linear-gradient(180deg, rgb(11 28 22 / 0.94), rgb(5 7 13 / 0.94)); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgb(240 215 122 / 0.25) inset;
  animation: surprise-in 450ms cubic-bezier(0.2, 0.8, 0.3, 1.2); }
.surprise__ring { width: 88px; height: 88px; }
.surprise__ring .countdown__n { font-size: 38px; }
.surprise__name { font: 700 44px/1 var(--f-display); color: var(--brass-hi); letter-spacing: 0.04em; text-transform: uppercase; }
.surprise__caption { margin-top: 4px; font: 600 italic 27px/1.2 var(--f-body); color: var(--cream); }
.surprise__seats { display: flex; gap: 10px; max-width: 340px; flex-wrap: wrap; justify-content: flex-end; }
.surprise__seats li { position: relative; opacity: 0.6; }
.surprise__seats li[data-done="yes"] { opacity: 1; }
.surprise__seats li[data-done="yes"]::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--brass); box-shadow: inset 0 0 0 4px var(--brass-hi); }
@keyframes surprise-in { from { transform: translateY(-40px) scale(0.96); opacity: 0; } }
.tv[data-power="out"] .surprise { border-color: #FFE9A8; box-shadow: 0 0 60px rgb(255 233 168 / 0.35), 0 14px 40px rgba(0, 0, 0, 0.7); }
/* Where Were You?: a spotlight sweeps the stage */
.tv[data-fx="gong"] .stage::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(100deg, transparent 30%, rgb(255 233 168 / 0.20) 46%, transparent 60%); background-size: 260% 100%; animation: sweep 5s ease-in-out infinite; }
@keyframes sweep { from { background-position: 120% 0; } to { background-position: -40% 0; } }

/* Lights Out: the beam is the brightest thing on the stage (7.4 item 3) */
.piece__cone { fill: #FFE9A8; opacity: 0.55; mix-blend-mode: soft-light; filter: url(#soft-blur); }
.piece__cone-lit { opacity: 1; filter: brightness(1.35) saturate(1.15) contrast(1.05); }
.piece__cone-edge { fill: none; stroke: rgb(255 233 168 / 0.85); stroke-width: 3; stroke-linejoin: round; filter: url(#soft-blur); }

/* Room flourishes (9.1 tv.fx) and the Look Around cues (9.2) */
.fx { pointer-events: none; }
.fx__glow { fill: rgb(255 140 40 / 0.55); mix-blend-mode: screen; filter: url(#soft-blur); animation: flare 1.1s ease-in-out infinite alternate; }
.fx__glow--brass { fill: rgb(240 215 122 / 0.45); animation-duration: 1.8s; }
.fx__ember { fill: #FFD27A; opacity: 0; animation: ember 2.2s ease-out infinite; }
.fx__ember[data-i="1"] { animation-delay: 0.3s; } .fx__ember[data-i="2"] { animation-delay: 0.7s; } .fx__ember[data-i="3"] { animation-delay: 1s; } .fx__ember[data-i="4"] { animation-delay: 1.4s; } .fx__ember[data-i="5"] { animation-delay: 1.8s; }
.fx__sweep { fill: rgb(255 244 194 / 0.5); mix-blend-mode: screen; filter: url(#soft-blur); animation: glint 1.6s ease-in-out infinite; }
.fx__smoke { fill: rgb(225 225 240 / 0.6); filter: url(#soft-blur); animation: smoke 4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.fx__smoke[data-i="1"] { animation-delay: 1.3s; } .fx__smoke[data-i="2"] { animation-delay: 2.6s; }
.fx__click { fill: none; stroke: var(--brass-hi); stroke-width: 4; opacity: 0; animation: clicking 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.fx__click[data-i="1"] { animation-delay: 0.5s; }
@keyframes flare { from { opacity: 0.45; } to { opacity: 1; } }
@keyframes ember { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-150px); } }
@keyframes glint { from { transform: translateX(-120px); opacity: 0; } 50% { opacity: 1; } to { transform: translateX(160px); opacity: 0; } }
@keyframes smoke { 0% { opacity: 0; transform: translateY(0) scale(0.6); } 25% { opacity: 0.8; } 100% { opacity: 0; transform: translateY(-120px) scale(1.5); } }
@keyframes clicking { 0% { opacity: 0.9; transform: scale(0.6); } 100% { opacity: 0; transform: scale(2.6); } }

/* What Really Happened: the seven beats (10.3) */
.tv-takeover--finale { padding: 28px 80px 24px; display: flex; flex-direction: column; overflow: hidden; }
.finale-tv { height: 100%; width: 100%; display: flex; flex-direction: column; gap: 18px; text-align: center; }
.finale-tv__title { font: 700 76px/1 var(--f-display); color: var(--brass-hi); letter-spacing: 0.05em; text-transform: uppercase; }
.finale-tv__beats { display: flex; justify-content: center; gap: 14px; margin-top: 14px; font: 700 20px var(--f-ui); letter-spacing: 0.08em; text-transform: uppercase; }
.finale-tv__beats li { padding: 4px 14px; border: 1.5px solid rgb(212 175 55 / 0.3); border-radius: 999px; color: rgb(243 231 201 / 0.45); }
.finale-tv__beats li[data-state="now"] { background: linear-gradient(180deg, #F0D77A, #D4AF37 45%, #8A6A1E); color: var(--ink); border-color: var(--brass-line); }
.finale-tv__beats li[data-state="done"] { color: var(--brass); border-color: rgb(212 175 55 / 0.6); }
.finale-tv__stage { flex: 1; min-height: 0; display: grid; align-items: center; justify-items: center; animation: fade 700ms ease; overflow: hidden; }
.beat { width: 100%; max-width: 1500px; }
.beat--verdict { display: grid; grid-template-columns: 420px 1fr; gap: 56px; align-items: center; text-align: left; }
.beat__guilty { width: 420px; border: 4px solid var(--crimson); border-radius: 24px; overflow: hidden; box-shadow: 0 0 60px rgb(158 42 43 / 0.5); }
.beat__verdict { font: 700 34px var(--f-ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass); }
.beat__name { font: 700 76px/1.05 var(--f-display); color: var(--cream); margin: 8px 0 16px; }
.beat__line { font: 500 38px/1.35 var(--f-body); color: var(--cream); }
.beat__because::first-letter { text-transform: uppercase; }
.beat__guilty .art-slot__fallback { font: 700 150px var(--f-display); color: var(--brass); background: radial-gradient(circle at 50% 40%, #2A2A1C, #07090C 75%); }
.beat__because { margin-top: 18px; font: 600 italic 34px/1.3 var(--f-body); color: var(--brass-hi); }
.beat__friend { margin-top: 12px; font: 700 28px var(--f-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--cream); }
.beat--happened, .beat--lie, .beat--notes { max-width: 1300px; text-align: left; }
.beat__lines { display: grid; gap: 14px; font: 500 31px/1.3 var(--f-body); }
.beat__lines li { padding: 4px 0; animation: fade 600ms ease backwards; }
.beat__lines li[data-n="1"] { animation-delay: 1.2s; } .beat__lines li[data-n="2"] { animation-delay: 2.4s; } .beat__lines li[data-n="3"] { animation-delay: 3.6s; } .beat__lines li[data-n="4"] { animation-delay: 4.8s; } .beat__lines li[data-n="5"] { animation-delay: 6s; }
.beat__connection-label { display: block; margin-bottom: 2px; font-size: 20px; }
.beat__cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; }
.beat__cards .evidence-card { width: 250px; }
.beat__notes { display: grid; gap: 14px; font: 500 italic 32px/1.3 var(--f-body); color: var(--brass-hi); }
.beat--honours { max-width: 1600px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.beat--honours .honour { grid-template-columns: 88px 1fr; }
.beat--honours .honour__title { font-size: 32px; }
.beat--honours .honour__text { font-size: 26px; }
.beat--honours .scoreboard { margin: 0; text-align: left; }
.beat--honours .scores__sharpest { font-size: 38px; text-align: left; }
.beat--honours .scores__list { font-size: 26px; }
.finale-tv .player-card { max-width: 1200px; padding: 26px 36px; border-radius: 24px; }
.finale-tv .player-card__head { grid-template-columns: 132px 1fr; }
.finale-tv .player-card__portrait { width: 132px; }
.finale-tv .player-card__name { font-size: 48px; }
.finale-tv .player-card__role { font-size: 24px; }
.finale-tv .player-card__facts { font-size: 28px; gap: 10px 22px; }
.finale-tv .player-card__facts dt { font-size: 20px; }
.finale-tv .player-card__route span { font-size: 22px; }

.stage[data-surprise="yes"] .stage__manor { transform: translateY(58px) scale(0.9); transform-origin: 50% 100%; transition: transform 600ms ease; }

/* The in-room cue (9.2): a line, a pulsing plate and a plume you cannot miss */
.cue-line { position: absolute; z-index: 6; left: 96px; right: 96px; top: 30px; padding: 12px 28px; text-align: center; font: 700 34px var(--f-display); color: var(--brass-hi); border: 2.5px solid var(--brass); border-radius: 18px; background: rgb(5 7 13 / 0.88); box-shadow: 0 0 34px rgb(255 210 122 / 0.35); }
.plate[data-cue="yes"] .plate__paper { filter: drop-shadow(0 0 22px #FFD27A) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.5)); stroke: #FFD27A; stroke-width: 8; animation: pulse 1.2s ease-in-out infinite; }
.fx__smoke { fill: rgb(235 235 245 / 0.75); }
/* Lights Out reveal, the finale's manor and the larger honours breakdown */
.finale-tv__manor { position: absolute; inset: 150px 0 0 0; z-index: 0; display: grid; place-items: center; opacity: 0.3; pointer-events: none; }
.finale-tv__stage { position: relative; z-index: 1; }
.beat--happened { padding: 26px 34px; border-radius: 22px; background: rgb(5 7 13 / 0.78); }
.beat--verdict { padding: 26px 34px; border-radius: 22px; background: rgb(5 7 13 / 0.6); }
.beat--lie { display: grid; grid-template-columns: 1fr 360px; gap: 48px; align-items: center; justify-content: center; max-width: 1500px; padding: 30px 40px; border-radius: 22px; background: rgb(5 7 13 / 0.7); }
.beat__lie-line { font: 700 52px/1.2 var(--f-display); color: var(--brass-hi); }
.beat--lie .beat__mischief { font: 500 36px/1.35 var(--f-body); }
.beat--lie .beat__mischief strong { font-family: var(--f-ui); letter-spacing: 0.08em; text-transform: uppercase; color: #E59A3C; }
.beat__lie-card .evidence-card { width: 340px; }
.beat--honours .scores__parts { font-size: 20px; padding-left: 60px; }
.beat__notes { font-size: 36px; }

/* Review 4: the Lie card is big and padded; the footer clears the bottom edge; the finale backdrop is only a hint */
.beat--lie { grid-template-columns: 1fr 640px; min-height: 560px; }
.beat__lie-card .evidence-card { width: 620px; min-height: 480px; padding: 36px 40px 40px; }
.beat__lie-card .evidence-card__title { font-size: 40px; padding-top: 8px; margin-bottom: 14px; }
.beat__lie-card .evidence-card__body { font-size: 30px; line-height: 1.4; }
.beat__lie-card .evidence-card__window { width: 150px; height: 150px; margin: 0 auto 12px; display: block; }
.guest-rail { height: 148px; padding-bottom: 30px; box-sizing: border-box; }
.tv__body { grid-template-rows: minmax(0, 1fr); }
.finale-tv__manor { opacity: 0.13; filter: blur(3px); }

/* Country-house print (review: ornament): printed double rule on the pinned cards, nameplate sizes on the TV */
.pin-card::after { content: ''; position: absolute; inset: 10px; z-index: 0; pointer-events: none; border: 2px solid rgb(107 79 20 / 0.75); outline: 1px solid rgb(107 79 20 / 0.75); outline-offset: -6px; }
.finale-tv .nameplate.player-card__name { font-size: 40px; }
.player-card__head .nameplate { grid-area: n; justify-content: flex-start; }

/* Review 5 */
.pin-card__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 32px; }
.pin-card__line { font-size: 26px; -webkit-line-clamp: 2; }
.guest-rail { padding-left: 24px; padding-right: 24px; gap: 10px; }
.rail-guest { width: 130px; }
.lobby__code { border-radius: 2px; background-image: linear-gradient(var(--brass), var(--brass)), linear-gradient(var(--brass), var(--brass)), linear-gradient(var(--brass), var(--brass)), linear-gradient(var(--brass), var(--brass)); background-repeat: no-repeat; background-size: 14px 14px; background-position: left -3px top -3px, right -3px top -3px, left -3px bottom -3px, right -3px bottom -3px; }
.roster__player.nameplate { padding: 2px 6px; font: 700 17px/1.1 var(--f-display); border-width: 1.5px; box-shadow: none; background-image: none; width: 100%; min-height: 28px; }
.roster__player .nameplate__leaf { display: none; }
.finale-tv .player-card__facts em, .finale-tv .player-card__secret em, .finale-tv .player-card__answer em { font-size: 20px; }
.beat__chip { font-size: 22px; }

.rail-guest__name { font-size: 19px; max-width: 128px; }
.rail-guest { width: 128px; }
.beat__cards .evidence-card { width: 340px; }
.beat__cards .evidence-card__title { font-size: 30px; }
.beat__chip { font-size: 24px; }

/* Pinboard cards, rev 2 (visual-system 6): one fixed 432 x 216 box. Header row 72 px: the disc beside a 2-line title; the body runs
   full width under both, 2 lines. Nothing on a card is smaller than 28 px, and no content can resize it. */
.pin-card { width: 432px; height: 216px; box-sizing: border-box; padding: 24px; display: grid; grid-template-columns: 72px 1fr; grid-template-rows: 72px auto; column-gap: 16px; row-gap: 12px; align-items: center; overflow: hidden; }
.pin-card__prop { width: 72px; height: 72px; grid-column: 1; grid-row: 1; border-width: 2.5px; }
.pin-card__text { display: contents; }
.pin-card__title { grid-column: 2; grid-row: 1; font: 700 32px/36px var(--f-display); text-transform: uppercase; letter-spacing: 0.02em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; word-break: normal; }
.pin-card__line { grid-column: 1 / -1; grid-row: 2; align-self: start; font: 600 28px/34px var(--f-body); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.pinboard__empty { width: 432px; box-sizing: border-box; }

/* The storey board (spec-storeys 4): storey labels on a brass rule, and the coded stair core under the pieces */
.storey-label__text { font-family: var(--f-display); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; fill: var(--brass); paint-order: stroke; stroke: rgb(5 7 13 / 0.7); stroke-width: 6px; }
.storey-label__rule { fill: none; stroke: var(--brass); stroke-linecap: round; opacity: 0.8; }
.stair__bed { fill: #2A1A10; stroke: #120B06; stroke-width: 6; }
.stair__runner { fill: #5A1620; stroke: #C9A43A; stroke-width: 3; }
.stair__tread { fill: none; stroke: rgb(201 164 58 / 0.55); stroke-width: 4; }
.stair__rail { fill: none; stroke: var(--brass); stroke-width: 9; stroke-linecap: round; }
.stair { transition: filter 0.3s; }
.stair[data-busy='yes'] { filter: drop-shadow(0 0 28px rgb(255 210 122 / 0.55)); }
.manor--mini .storey-band { fill: none; stroke: none; }
.manor--mini .storey-band[data-focus='yes'] { stroke: var(--brass); stroke-width: 40; }
.manor--mini .mini-guest { fill: var(--cream); stroke: #120B06; stroke-width: 6; }
.manor--mini .mini-guest[data-own='yes'] { fill: none; stroke: var(--brass-hi); stroke-width: 30; }
.manor--mini .manor__cue { fill: rgb(255 210 122 / 0.35); filter: drop-shadow(0 0 60px #FFD27A); }
@media (prefers-reduced-motion: reduce) { .stair { transition: none; } }
/* Guest rail in the 1440 px stage (visual-system 6): twelve fit in the 1344 px inner width. */
.guest-rail { gap: 8px; padding-left: 0; padding-right: 0; }
.rail-guest { width: 104px; }
.rail-guest__name { font-size: 17px; max-width: 104px; }

/* Responsive sweep (layout gate, npm run layout): the lobby fits all 24 guests on the 1080 stage, and the click-once hint
   lives in the top margin, clear of the settings. Nothing on the TV can scroll, so everything here must fit. */
.lobby { padding: 56px 72px 44px; }
.lobby__side { gap: 20px; }
.lobby__settings { padding: 18px 28px; gap: 12px; }
.gentle { grid-template-areas: 'label lever' 'line lever'; row-gap: 2px; }
.gentle__label { line-height: 1.15; }
.gentle__line { line-height: 1.2; }
.roster { gap: 12px; grid-auto-rows: max-content; }
.roster__guest { gap: 3px; }
.roster__title { font-size: 20px; }
.roster__player.nameplate, .roster__player { min-height: 26px; }
.tv[data-phase='LOBBY'] .tv-sound, .tv[data-phase='GENERATING'] .tv-sound, .tv[data-phase='PROLOGUE'] .tv-sound { top: 10px; right: 104px; }

/* The Discovery on the TV: sized in stage px. The shared rules size it by vw, which on a scaled stage changed the layout
   with the window (it ran off the bottom at 1920 wide and fitted at 1280). One fixed layout that fits the 1080 stage. */
.tv-takeover .discovery { max-width: 1240px; padding: 24px 32px 0; }
.tv-takeover .discovery__title { font-size: 76px; }
.tv-takeover .discovery__kind { margin: 14px auto; font-size: 52px; }
.tv-takeover .discovery__headline { font-size: 44px; margin-bottom: 10px; }
.tv-takeover .discovery__cameo { margin: 4px; gap: 4px; }
.tv-takeover .cameo { width: 118px; }
.tv-takeover .cameo__name { font-size: 26px; }
.tv-takeover .cameo__post { font-size: 20px; }
.tv-takeover .discovery__telling { font-size: 31px; line-height: 1.4; padding: 22px 34px; }
.tv-takeover .discovery__leads { font-size: 24px; gap: 6px; margin-top: 14px; }
.tv-takeover .discovery__mourning, .tv-takeover .discovery__close { font-size: 26px; margin-top: 12px; }

/* "And now...": the board steps down under the banner, as it does for a surprise, so no storey label or plate sits under it. */
.stage[data-banner='yes'] .stage__manor { transform: scale(0.86); transform-origin: 50% 100%; transition: transform 600ms ease; }
/* The Twelfth Chime is the whole message: the last whisper line, which sat under it, steps aside. */
.tv[data-phase='ACCUSE'] .whisper-feed { display: none; }

/* Guest-rail names read in full (12.x sweep): up to two balanced lines in the condensed face, never an ellipsis. */
.rail-guest__name { max-width: 104px; margin-top: 3px; font: 700 19px/1.02 var(--f-ui); letter-spacing: 0.02em; text-align: center; white-space: normal; overflow: visible; text-overflow: clip; text-wrap: balance; overflow-wrap: normal; }

/* The second discovery after round 3: one line in the top-right corner of the stage, the full text on hover-less TVs is in round 3 and on the phones. */
.stage .banner--compact { left: auto; right: 56px; top: 20px; max-width: 560px; padding: 8px 16px; font-size: 22px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
