:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #090d13;
  color: #f3efe6;
  --gold: #d7b36a;
  --muted: #999b9f;
  --panel: rgba(23, 28, 36, .92);
  --line: rgba(215, 179, 106, .22);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; background: #070a0f; }
body::before, body::after { content: ""; position: fixed; inset: 0; pointer-events: none; }
body::before { z-index: 0; background-position: center top; background-size: cover; opacity: .44; filter: saturate(.78) contrast(1.05); transition: opacity .7s ease, filter .7s ease; }
body::after { z-index: 0; background: linear-gradient(180deg, rgba(7,10,15,.18) 0, rgba(7,10,15,.58) 24%, rgba(7,10,15,.91) 62%, #070a0f 100%); }
body[data-scene="opening"]::before { background-image: url("./assets/boardroom-night.webp"); }
body[data-scene="crisis"]::before { background-image: url("./assets/due-diligence.webp"); opacity: .38; }
body[data-scene="finale"]::before { background-image: url("./assets/signing-dawn.webp"); opacity: .4; filter: saturate(.68) contrast(1.08); }
button { font: inherit; }
button:disabled { cursor: not-allowed; opacity: .42; }
#app { position: relative; z-index: 1; width: min(100%, 520px); min-height: 100svh; margin: auto; padding: max(22px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.lobby-link { align-self: flex-start; position: relative; z-index: 2; color: #c8bca6; text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; padding-right: 10px; font-size: 14px; }

.eyebrow { color: var(--gold); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; }
h1 { margin: 14px 0 8px; font-family: Georgia, "Songti SC", serif; font-size: clamp(36px, 10vw, 52px); font-weight: 500; line-height: 1.06; }
h2 { margin: 6px 0 12px; font-size: 25px; }
.role-title { font-size: clamp(30px, 8vw, 42px); margin-top: 18px; }
p { line-height: 1.65; }
.muted { color: var(--muted); }
.spacer { flex: 1; min-height: 30px; }
.panel { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(23,28,36,.84); box-shadow: 0 20px 70px rgba(0,0,0,.25); backdrop-filter: blur(10px); }
.primary, .choice, .quiet { width: 100%; min-height: 54px; border-radius: 14px; cursor: pointer; }
.primary { border: 0; background: var(--gold); color: #17130c; font-weight: 750; }
.quiet { border: 1px solid var(--line); background: transparent; color: #ddd5c6; margin-top: 10px; }
.choice { border: 1px solid var(--line); background: rgba(255,255,255,.035); color: #f3efe6; text-align: left; padding: 15px; margin-top: 11px; }
.choice strong { display: block; margin-bottom: 6px; }
.choice small { display: block; color: var(--muted); font-size: 14px; line-height: 1.55; }
.choice:hover, .choice:focus-visible { border-color: var(--gold); background: rgba(215,179,106,.09); }
.primary:active, .choice:active, .quiet:active { transform: scale(.985); }
.primary, .choice, .quiet { transition: transform .14s ease, border-color .2s ease, background-color .2s ease, box-shadow .2s ease; }
.status { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 22px; }
.metric { padding: 11px 7px; text-align: center; border-radius: 12px; background: rgba(255,255,255,.045); }
.metric b { display: block; color: var(--gold); font-size: 20px; margin-top: 3px; }
.status-concrete { grid-template-columns: repeat(2, 1fr); margin-top: 10px; }
.status-concrete .metric { min-height: 96px; padding: 13px 9px; display: flex; flex-direction: column; justify-content: center; }
.status-concrete .metric b { color: #f3efe6; font-size: 16px; line-height: 1.35; }
.role { --role-color: var(--gold); display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 6px; border: 1px solid color-mix(in srgb, var(--role-color) 34%, transparent); border-radius: 999px; color: var(--role-color); font-size: 13px; background: color-mix(in srgb, var(--role-color) 7%, transparent); }
.role > i, .statement-person b > i { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 6px; border-radius: 50%; background: color-mix(in srgb, var(--role-color) 16%, transparent); color: var(--role-color); font-size: 12px; font-style: normal; }
.role-ceo { --role-color: #dfb96d; }
.role-coo { --role-color: #78b9a8; }
.role-cto { --role-color: #7aa7d8; }
.role-investor { --role-color: #b898d5; }
.role-channel { --role-color: #d98f78; }
.act-progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 10px 0 24px; }
.act-progress span { display: grid; place-items: center; height: 4px; border-radius: 99px; overflow: hidden; color: transparent; background: #293039; font-size: 0; }
.act-progress span.active, .act-progress span.done { background: var(--gold); }
.phase-guide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 14px; }
.phase-guide span { padding: 7px 5px; border-radius: 8px; background: #20262d; color: #707984; text-align: center; font-size: 12px; }
.phase-guide span.on { background: rgba(215,179,106,.12); color: var(--gold); }
.round-clock { display: flex; align-items: center; justify-content: space-between; margin: 0 0 20px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.035); }
.round-clock small { color: var(--muted); }
.round-clock b { color: var(--gold); font-variant-numeric: tabular-nums; }
.round-clock.elapsed b { color: #e4a49e; font-size: 14px; }
.ai-host { margin: 0 0 8px; padding: 13px 14px; border: 1px solid #314153; border-radius: 13px; background: linear-gradient(135deg, rgba(39,69,96,.2), rgba(16,24,33,.8)); }
.ai-host span { color: #b9d3ea; font-size: 12px; letter-spacing: .09em; }
.ai-host p { margin: 6px 0 0; color: #e9edf1; font-size: 15px; line-height: 1.55; }
.role-brief { display: grid; gap: 10px; margin: 22px 0 16px; }
.role-brief div { padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.035); }
.role-brief[class*="role-"] div { border-color: color-mix(in srgb, var(--role-color) 24%, transparent); }
.role-brief small, .role-brief b { display: block; }
.role-brief small, .private-clue small { color: var(--gold); font-size: 12px; letter-spacing: .1em; }
.role-brief b { margin-top: 6px; font-size: 16px; line-height: 1.55; }
.privacy-note { color: var(--muted); font-size: 14px; }
.private-clue, .discussion { margin: 18px 0; padding: 14px 15px; border-radius: 14px; }
.private-clue { border: 1px solid var(--line); background: rgba(215,179,106,.06); }
.private-clue b { display: block; margin-top: 6px; line-height: 1.5; }
.discussion { background: rgba(255,255,255,.04); }
.discussion p { margin: 6px 0 0; color: #c7c1b7; }
.consequence-grid { display: grid; gap: 10px; margin: 22px 0; }
.consequence { padding: 15px 16px; border-radius: 14px; border-left: 3px solid #59616b; background: rgba(255,255,255,.04); }
.consequence.better { border-left-color: var(--gold); }
.consequence.worse { border-left-color: #a85d58; }
.consequence > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.consequence small, .consequence b { display: block; }
.consequence small { color: var(--muted); }
.consequence span { padding: 3px 7px; border-radius: 999px; color: #bdb7ad; background: rgba(255,255,255,.05); font-size: 12px; }
.consequence.better span { color: var(--gold); background: rgba(215,179,106,.1); }
.consequence.worse span { color: #e4a49e; background: rgba(168,93,88,.14); }
.consequence b { font-size: 16px; line-height: 1.5; }
.resolution-confirm { display: flex; align-items: center; gap: 12px; margin: 2px 0 20px; padding: 13px 14px; border-radius: 13px; background: rgba(255,255,255,.035); }
.resolution-confirm > span { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 50%; background: rgba(215,179,106,.13); color: var(--gold); font-weight: 800; }
.resolution-confirm small, .resolution-confirm b { display: block; }
.resolution-confirm small { margin-bottom: 3px; color: var(--muted); }
.news-update { margin: 0 0 24px; padding: 20px 18px; border: 1px solid #314153; border-radius: 18px; background: linear-gradient(145deg, rgba(39,69,96,.24), rgba(16,24,33,.88)); }
.news-source { display: flex; align-items: center; gap: 8px; color: #b9d3ea; font-size: 13px; letter-spacing: .06em; }
.news-source span { width: 7px; height: 7px; border-radius: 50%; background: #b9d3ea; box-shadow: 0 0 0 4px rgba(185,211,234,.09); }
.news-update h1 { margin: 14px 0 8px; font-family: inherit; font-size: clamp(28px, 8vw, 38px); font-weight: 720; line-height: 1.22; }
.news-update p { margin: 0; color: #c9c4ba; font-size: 16px; }
.interlude-label { margin-top: 6px; }
.interlude-privacy { margin: -8px 2px 22px; }
.latest-state { margin: 0 0 22px; }
.latest-state > small { color: var(--gold); font-size: 12px; letter-spacing: .08em; }
.spoken-promise { margin: 24px 0; padding: 22px 18px; border: 1px solid var(--gold); border-radius: 16px; background: rgba(215,179,106,.08); color: #f3ead8; font-size: 22px; line-height: 1.65; }
.public-recall { margin: 18px 0; padding: 14px 15px; border-radius: 14px; background: rgba(255,255,255,.04); }
.public-recall small, .public-recall b { display: block; }
.public-recall small { color: var(--muted); margin-bottom: 6px; }
.public-recall b { line-height: 1.55; }
.ledger { display: grid; gap: 10px; margin: 16px 0 24px; }
.ledger-role { border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.035); overflow: hidden; }
.ledger-role summary { display: flex; justify-content: space-between; gap: 12px; padding: 16px; cursor: pointer; }
.ledger-role summary span { font-weight: 700; }
.ledger-role summary small { color: var(--muted); text-align: right; }
.ledger-acts { padding: 0 12px 12px; display: grid; gap: 10px; }
.ledger-acts article { padding: 13px; border-radius: 12px; background: #111820; }
.ledger-acts article > small { color: var(--muted); }
.ledger-acts p { margin: 3px 0 10px; }
.ledger-acts em { display: block; color: #bdb7ad; font-size: 13px; line-height: 1.5; font-style: normal; }
.ledger-act { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ledger-act span { padding: 4px 8px; border-radius: 999px; font-size: 12px; }
.ledger-act .kept { color: var(--gold); background: rgba(215,179,106,.1); }
.ledger-act .changed { color: #e4a49e; background: rgba(168,93,88,.14); }
.ai-statements { margin: 20px 0; display: grid; gap: 9px; }
.section-heading p { margin: 5px 0 3px; color: var(--muted); font-size: 14px; }
.ai-statement { padding: 14px 15px; border-radius: 13px; border: 1px solid #314153; background: rgba(39,69,96,.13); }
.statement-person { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(185,211,234,.12); }
.statement-person b { display: flex; align-items: center; color: var(--role-color, #b9d3ea); }
.statement-person span { padding: 3px 7px; border-radius: 999px; background: rgba(185,211,234,.09); color: #8fa8bd; font-size: 12px; }
.statement-position { margin-top: 11px; }
.statement-position small, .statement-impact small, .scene-brief > small, .promise-choice > small, .decision-choice > small { display: block; color: var(--gold); font-size: 12px; letter-spacing: .08em; }
.statement-position strong { display: block; margin-top: 4px; font-size: 18px; line-height: 1.45; }
.statement-impact { margin-top: 10px; }
.statement-impact p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.scene-brief { margin: 16px 0 20px; }
.scene-brief h2 { margin-top: 7px; }
.promise-choice strong { margin: 5px 0; }
.promise-choice span { display: block; color: var(--muted); font-size: 14px; line-height: 1.5; }
.decision-choice strong { margin: 5px 0; }
.decision-choice span { display: block; color: var(--muted); font-size: 14px; line-height: 1.5; }
.decision-choice i { margin-right: 7px; color: #c8bca6; font-size: 12px; font-style: normal; }
.progress { height: 5px; overflow: hidden; border-radius: 5px; background: #262a30; margin: 14px 0 8px; }
.progress i { display: block; height: 100%; background: var(--gold); }
.outcome { margin: 18px 0; padding-left: 14px; border-left: 2px solid var(--gold); }
.outcome.story { margin-top: 24px; }
.outcome.story b { color: var(--gold); font-size: 14px; letter-spacing: .08em; }
.outcome.story p { margin-bottom: 0; font-size: 17px; line-height: 1.75; }
.outcome.principle { margin-top: 8px; border-color: rgba(215,179,106,.35); color: var(--muted); }
.result-label { margin-top: 28px; }
.situation-label { margin-top: 24px; }
.decision-note { margin: 7px 0 2px; color: var(--muted); font-size: 14px; }
.scene-screen { min-height: calc(100svh - 48px); display: flex; flex-direction: column; }
.scene-screen .act-progress { margin-bottom: 11svh; }
.act-number { margin: 4px 0 -18px; color: rgba(215,179,106,.18); font: 500 clamp(76px,24vw,126px)/1 Georgia,serif; letter-spacing: -.05em; }
.scene-screen > h1 { position: relative; margin-bottom: 28px; font-size: clamp(38px,11vw,56px); }
.scene-screen .scene-brief { padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.scene-screen .scene-brief h2 { font-size: clamp(22px,6.4vw,30px); line-height: 1.38; }
.scene-screen-footer { position: sticky; bottom: 0; margin-top: auto; padding: 18px 0 max(8px,env(safe-area-inset-bottom)); background: linear-gradient(180deg,transparent,#070a0f 28%); }
.scene-screen-footer span { display: block; margin: 0 0 9px; color: var(--muted); font-size: 13px; }
.round-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.round-head small { color: var(--gold); letter-spacing: .08em; }
.round-head h2 { margin-top: 5px; }
.seat-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(76px,1fr); gap: 8px; overflow-x: auto; padding: 2px 1px 10px; scrollbar-width: none; }
.seat-rail::-webkit-scrollbar { display: none; }
.seat { --role-color:var(--gold); min-height: 88px; padding: 9px 6px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(12,17,24,.72); color: #c8c5bf; }
.seat i { display: grid; place-items: center; width: 30px; height: 30px; margin: 0 auto 6px; border-radius: 50%; background: color-mix(in srgb,var(--role-color) 16%,transparent); color: var(--role-color); font-style: normal; }
.seat span,.seat small { display: block; white-space: nowrap; font-size: 11px; }
.seat small { margin-top: 2px; color: var(--muted); }
.seat.active { border-color: var(--role-color); background: color-mix(in srgb,var(--role-color) 9%,rgba(12,17,24,.8)); transform: translateY(-2px); }
.speaker-card { --role-color:var(--gold); min-height: 190px; margin-top: 6px; padding: 22px 19px; border: 1px solid color-mix(in srgb,var(--role-color) 28%,transparent); border-radius: 18px; background: linear-gradient(145deg,color-mix(in srgb,var(--role-color) 9%,rgba(15,21,29,.9)),rgba(15,21,29,.92)); }
.speaker-card small { color: var(--role-color); letter-spacing: .09em; }
.speaker-card h2 { margin: 13px 0 8px; font-size: 25px; }
.speaker-card p { margin: 0; color: #bbb8b1; }
.sticky-action { position: sticky; bottom: max(8px,env(safe-area-inset-bottom)); margin-top: 18px; box-shadow: 0 -16px 36px #070a0f; }
.choice-stack { margin-top: 16px; }
.delta { color: #c8bca6; font-variant-numeric: tabular-nums; }
.sound, .language { position: absolute; top: max(20px, env(safe-area-inset-top)); min-height: 40px; border: 0; background: transparent; color: var(--muted); padding: 8px; cursor: pointer; }
.sound { right: 18px; }
.language { right: 94px; color: var(--gold); font-weight: 750; }
.host-rescue { position: fixed; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 4; width: auto; min-height: 42px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: #18202a; color: #c9c4ba; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.28); }
.home-eyebrow { margin-top: 14px; }
.home-scene { position: relative; height: clamp(150px, 25svh, 220px); margin: 10px 0 20px; overflow: hidden; border: 1px solid rgba(215,179,106,.2); border-radius: 20px; background: linear-gradient(180deg, transparent 35%, rgba(7,10,15,.82)), url("./assets/boardroom-night.webp") center 38% / cover; box-shadow: 0 24px 70px rgba(0,0,0,.38); }
.home-scene::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(215,179,106,.08), transparent 45%); }
.home-scene span { position: absolute; z-index: 1; left: 16px; bottom: 14px; color: #e4c787; font-size: 13px; letter-spacing: .11em; }
.form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: #c9c4ba; font-size: 14px; }
input { width: 100%; min-height: 52px; border: 1px solid var(--line); border-radius: 12px; background: #0c1118; color: #fff; padding: 0 14px; font: inherit; }
input:focus { outline: 2px solid rgba(215,179,106,.35); border-color: var(--gold); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.text-button { align-self: center; border: 0; background: transparent; color: var(--muted); padding: 18px; }
.room-code { margin: 22px 0 8px; color: var(--gold); font-size: clamp(44px, 16vw, 74px); font-weight: 750; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.error { position: sticky; bottom: 14px; margin: 14px 0 0; padding: 12px 14px; border: 1px solid rgba(255,100,100,.35); border-radius: 12px; background: #351719; color: #ffd7d7; }
.offline { margin: 52px 0 16px; padding: 10px 12px; border-radius: 10px; background: rgba(168,93,88,.18); color: #f1c1bc; font-size: 14px; text-align: center; }
.recovery { margin-top: 28px; text-align: center; }
.recovery p { color: var(--muted); line-height: 1.6; }
.recovery-pulse { width: 18px; height: 18px; margin: 4px auto 15px; border: 2px solid rgba(215,179,106,.25); border-top-color: var(--gold); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) {
  .panel { animation: enter .35s ease both; }
  .interlude-sequence > * { opacity: 0; animation: reveal .52s ease forwards; }
  .interlude-sequence .reveal-lock { animation-delay: .05s; }
  .interlude-sequence .reveal-news { animation-delay: .55s; }
  .interlude-sequence .reveal-change { animation-delay: 1.05s; }
  .interlude-sequence .reveal-state { animation-delay: 1.4s; }
  .interlude-sequence .reveal-next { animation-delay: 1.75s; }
  .consequence.better { animation-name: reveal, warmPulse; }
  .consequence.worse { animation-name: reveal, riskPulse; }
  @keyframes enter { from { opacity: 0; transform: translateY(8px); } }
  @keyframes reveal { from { opacity: 0; transform: translateY(14px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
  @keyframes warmPulse { 50% { box-shadow: 0 0 24px rgba(215,179,106,.12); } }
  @keyframes riskPulse { 50% { box-shadow: 0 0 24px rgba(168,93,88,.12); } }
}
