:root {
  color-scheme: dark;
  --bg: #07101f;
  --bg-elevated: #0d192b;
  --surface: rgba(18, 32, 52, 0.92);
  --surface-strong: #14243b;
  --surface-soft: rgba(102, 223, 202, 0.08);
  --text: #f6f2e8;
  --text-soft: #b9c4d4;
  --text-dim: #8290a4;
  --teal: #66dfca;
  --teal-deep: #173f43;
  --gold: #f2bb67;
  --gold-deep: #573f20;
  --danger: #ff6b78;
  --danger-deep: #4b222d;
  --border: rgba(184, 209, 225, 0.14);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --ring: 0 0 0 3px rgba(102, 223, 202, 0.34);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --fast: 140ms;
  --normal: 240ms;
}

[data-theme='light'] {
  color-scheme: light;
  --bg: #edf3f3;
  --bg-elevated: #e4ecec;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --surface-soft: rgba(12, 115, 103, 0.08);
  --text: #13222d;
  --text-soft: #465963;
  --text-dim: #687881;
  --teal: #087d70;
  --teal-deep: #d4eeea;
  --gold: #9a6108;
  --gold-deep: #f8ead2;
  --danger: #c82f43;
  --danger-deep: #f9dbe0;
  --border: rgba(21, 53, 66, 0.14);
  --shadow: 0 24px 70px rgba(40, 68, 72, 0.16);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  overscroll-behavior: none;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -18%, rgba(102, 223, 202, 0.14), transparent 38%),
    var(--bg);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.16;
  pointer-events: none;
}

.ambient-one { top: -180px; right: -100px; background: var(--teal); }
.ambient-two { bottom: -220px; left: -120px; background: var(--gold); opacity: 0.1; }

#app {
  width: min(100%, 1120px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--safe-top) + 16px) 16px calc(var(--safe-bottom) + 24px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  margin-bottom: 20px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--teal);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
}
.brand-mark svg { width: 25px; height: 25px; }
.brand-title { margin: 0; font-size: 17px; line-height: 1.1; letter-spacing: .14em; }
.brand-kicker { margin: 4px 0 0; color: var(--text-dim); font-size: 11px; letter-spacing: .12em; }

.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  cursor: pointer;
  transition: color var(--fast), background var(--fast), border-color var(--fast);
}
.icon-button:active { background: var(--surface-soft); }
.icon-button svg { width: 21px; height: 21px; }

.content { min-width: 0; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(32px, 9vw, 58px); line-height: 1.06; letter-spacing: -.04em; }
h2 { margin: 0; font-size: clamp(24px, 6vw, 34px); line-height: 1.2; letter-spacing: -.025em; }
h3 { margin: 0; font-size: 17px; line-height: 1.3; }

.lead { max-width: 620px; margin: 16px 0 0; color: var(--text-soft); font-size: 16px; }
.muted { color: var(--text-dim); }
.small { font-size: 13px; }

.hero {
  position: relative;
  display: grid;
  gap: 24px;
  overflow: hidden;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.hero::after {
  content: '';
  position: absolute;
  top: -70px;
  right: -80px;
  width: 220px;
  height: 220px;
  border: 38px solid rgba(102, 223, 202, 0.06);
  border-radius: 50%;
  pointer-events: none;
}
.hero-title span { color: var(--gold); }
.hero-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 24px; }
.hero-point { padding: 14px 10px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 14px; text-align: center; }
.hero-point strong { display: block; color: var(--teal); font-size: 20px; }
.hero-point span { color: var(--text-dim); font-size: 11px; }

.setup-layout { display: grid; gap: 16px; }
.panel {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 45px rgba(0, 0, 0, .12);
}
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.step-number { color: var(--text-dim); font-size: 12px; font-variant-numeric: tabular-nums; }

.segmented { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.segment {
  min-height: 48px;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--fast), color var(--fast), border-color var(--fast);
}
.segment[aria-pressed='true'] { color: var(--bg); font-weight: 800; background: var(--teal); border-color: var(--teal); }

.players-form { display: grid; grid-template-columns: 1fr; gap: 10px; }
.field { position: relative; }
.field label { display: block; margin: 0 0 6px; color: var(--text-soft); font-size: 12px; font-weight: 700; }
.field input, .select {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color var(--fast), background var(--fast);
}
.field input::placeholder { color: var(--text-dim); }
.field input:focus { border-color: var(--teal); }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.phase-actions { display: grid; gap: 10px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 12px 18px;
  color: #07101f;
  background: var(--teal);
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: filter var(--fast), background var(--fast), border-color var(--fast), color var(--fast), opacity var(--fast);
}
.button:hover { filter: brightness(1.05); }
.button:active { filter: brightness(.91); }
.button svg { width: 19px; height: 19px; }
.button.secondary { color: var(--text); background: var(--surface-strong); border-color: var(--border); }
.button.gold { color: #211506; background: var(--gold); }
.button.danger { color: #fff; background: var(--danger); }
.button.ghost { color: var(--text-soft); background: transparent; border-color: var(--border); }
.button.wide { width: 100%; }
.button:disabled { cursor: not-allowed; opacity: .42; filter: grayscale(.4); }

.privacy-wrap { display: grid; min-height: calc(100dvh - 116px); place-items: center; }
.privacy-card { width: min(100%, 480px); padding: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); text-align: center; }
.player-medallion {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  color: var(--teal);
  background: var(--teal-deep);
  border: 1px solid rgba(102, 223, 202, .28);
  border-radius: 50%;
  font-size: 27px;
  font-weight: 850;
}
.privacy-title { margin-bottom: 8px; }
.privacy-note { margin: 0 auto 24px; color: var(--text-soft); }
.role-panel { margin: 22px 0; padding: 22px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 18px; }
.role-panel.detective { border-color: rgba(242, 187, 103, .38); }
.role-panel.disguiser { border-color: rgba(255, 107, 120, .42); }
.role-name { color: var(--text-dim); font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.secret-word { margin: 8px 0; color: var(--teal); font-size: clamp(36px, 11vw, 52px); font-weight: 900; letter-spacing: .08em; }
.role-panel.detective .secret-word { color: var(--gold); font-size: 30px; }
.role-panel.disguiser .secret-word { color: var(--danger); }

.game-layout { display: grid; gap: 16px; }
.case-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.case-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.case-dot { width: 9px; height: 9px; flex: 0 0 auto; background: var(--teal); border-radius: 50%; box-shadow: 0 0 0 5px rgba(102, 223, 202, .1); }
.case-label { font-size: 13px; font-weight: 750; }
.case-round { color: var(--text-dim); font-size: 12px; white-space: nowrap; }

.table-panel { container-type: inline-size; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); }
.table {
  position: relative;
  width: min(100%, 620px);
  aspect-ratio: 1 / 1.04;
  margin: 0 auto;
  border: 1px solid rgba(102, 223, 202, .18);
  border-radius: 38%;
  background:
    radial-gradient(circle, rgba(102, 223, 202, .10), transparent 50%),
    rgba(4, 14, 26, .28);
}
[data-theme='light'] .table { background: radial-gradient(circle, rgba(8, 125, 112, .08), transparent 54%), rgba(229, 239, 238, .65); }
.table::before, .table::after { content: ''; position: absolute; pointer-events: none; }
.table::before { inset: 12%; border: 1px dashed rgba(102, 223, 202, .12); border-radius: 42%; }
.table::after { inset: 35%; border: 1px solid rgba(242, 187, 103, .12); border-radius: 50%; }

.seat {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  justify-items: center;
  width: 76px;
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(var(--table-radius) * -1)) rotate(calc(var(--angle) * -1));
  transition: opacity var(--normal), filter var(--normal);
}
.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 51px;
  height: 51px;
  color: var(--text);
  background: var(--surface-strong);
  border: 2px solid var(--border);
  border-radius: 50%;
  font-size: 15px;
  font-weight: 850;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}
.seat.active .avatar { color: #06101a; background: var(--teal); border-color: var(--teal); box-shadow: 0 0 0 5px rgba(102, 223, 202, .14), 0 0 22px rgba(102, 223, 202, .28); }
.seat.detective .avatar { border-color: var(--gold); }
.seat.out { opacity: .42; filter: grayscale(.8); }
.seat.out .avatar::after { content: ''; position: absolute; width: 58px; height: 2px; background: var(--danger); transform: rotate(-42deg); }
.seat-name { max-width: 76px; margin-top: 4px; overflow: hidden; color: var(--text-soft); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.seat-chips { position: absolute; top: -7px; right: 5px; display: flex; gap: 2px; }
.chip-dot { width: 13px; height: 13px; background: var(--danger); border: 2px solid var(--surface-strong); border-radius: 50%; }

.center-stage {
  position: absolute;
  z-index: 1;
  inset: 27%;
  display: grid;
  place-content: center;
  padding: 8px;
  text-align: center;
}
.stage-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 8px; color: var(--teal); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 50%; }
.stage-icon svg { width: 21px; height: 21px; }
.stage-label { color: var(--text-dim); font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.stage-person { margin: 3px 0; font-size: clamp(15px, 4vw, 22px); font-weight: 850; }
.stage-caption { color: var(--text-soft); font-size: 10px; }
.timer { margin: 1px 0; color: var(--gold); font-size: clamp(25px, 7vw, 40px); font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }

.action-panel { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; }
.action-copy { margin: 8px 0 18px; color: var(--text-soft); font-size: 14px; }
.status-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.pill { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 5px 10px; color: var(--text-soft); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 99px; font-size: 11px; font-weight: 700; }
.pill-dot { width: 7px; height: 7px; background: var(--teal); border-radius: 50%; }

.select-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.player-select {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 9px 11px;
  color: var(--text-soft);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--fast), background var(--fast), color var(--fast);
}
.player-select[aria-pressed='true'] { color: var(--text); background: var(--surface-soft); border-color: var(--teal); }
.player-select:disabled { cursor: not-allowed; opacity: .36; }
.mini-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; color: var(--text); background: var(--surface-strong); border-radius: 50%; font-size: 11px; font-weight: 850; }
.player-select-meta { min-width: 0; }
.player-select-name { display: block; overflow: hidden; font-size: 13px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.player-select-note { display: block; color: var(--text-dim); font-size: 10px; }
.chip-grid .player-select[aria-pressed='true'] { border: 2px solid var(--gold); padding: 8px 10px; background: var(--gold-deep); }
.chip-grid .player-select[aria-pressed='true'] .mini-avatar { box-shadow: 0 0 0 2px var(--gold); }
.chip-grid .player-select-note { color: var(--text-soft); font-size: 12px; white-space: nowrap; }
.chip-preview { display: grid; gap: 6px; min-height: 76px; padding: 12px; margin: 12px 0; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elevated); color: var(--text-soft); font-size: 14px; overflow-wrap: anywhere; }
.chip-preview strong { color: var(--text); }
.chip-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-bottom: 16px; }
.chip-actions .button { min-width: 0; min-height: 48px; white-space: normal; }

.progress { height: 5px; overflow: hidden; margin: 16px 0 8px; background: var(--bg-elevated); border-radius: 99px; }
.progress-bar { height: 100%; width: var(--progress); background: var(--teal); border-radius: inherit; transition: width var(--normal); }

.word-input { display: flex; gap: 8px; margin: 16px 0; }
.word-input input { min-width: 0; flex: 1; min-height: 52px; padding: 12px 14px; color: var(--text); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; }

.result-banner { padding: 18px; background: var(--surface-soft); border: 1px solid rgba(102, 223, 202, .24); border-radius: 18px; text-align: center; }
.result-banner.danger { background: rgba(255, 107, 120, .08); border-color: rgba(255, 107, 120, .24); }
.result-number { margin: 2px 0; color: var(--teal); font-size: 40px; font-weight: 900; }

.scoreboard { display: grid; gap: 8px; margin: 18px 0; }
.score-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; min-height: 54px; padding: 8px 12px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; }
.score-rank { color: var(--text-dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.score-name { min-width: 0; overflow: hidden; font-size: 14px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.score-value { color: var(--gold); font-size: 18px; font-weight: 900; }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: end center; padding: 16px; background: rgba(2, 8, 16, .76); backdrop-filter: blur(10px); }
.modal { width: min(100%, 500px); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; color: var(--text); background: var(--surface-strong); border: 1px solid var(--border); border-radius: 26px; box-shadow: var(--shadow); }
.modal h2 { margin-bottom: 8px; }
.modal p { color: var(--text-soft); }
.rules-list { display: grid; gap: 14px; margin: 20px 0; padding: 0; list-style: none; counter-reset: rules; }
.rules-list li { position: relative; padding-left: 42px; color: var(--text-soft); font-size: 14px; }
.rules-list li::before { counter-increment: rules; content: counter(rules); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 28px; height: 28px; color: var(--teal); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 9px; font-size: 12px; font-weight: 850; }

.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(var(--safe-bottom) + 24px); max-width: calc(100% - 32px); padding: 11px 16px; color: #07101f; background: var(--teal); border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; font-weight: 800; opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: opacity var(--normal), transform var(--normal); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 680px) {
  .app-shell { padding-right: 24px; padding-left: 24px; }
  .setup-layout { grid-template-columns: 1.1fr .9fr; align-items: start; }
  .hero { grid-column: 1 / -1; padding: 38px; }
  .players-form { grid-template-columns: repeat(2, 1fr); }
  .game-layout { grid-template-columns: minmax(430px, 1.2fr) minmax(290px, .8fr); align-items: start; }
  .case-strip { grid-column: 1 / -1; }
  .action-panel { position: sticky; top: calc(var(--safe-top) + 16px); }
  .modal-backdrop { place-items: center; }
}

@media (max-width: 420px) {
  .app-shell { padding-right: 12px; padding-left: 12px; }
  .hero, .panel, .action-panel { padding: 18px; }
  .table-panel { padding: 8px; }
  .table { --table-radius: 41cqw; }
  .seat { width: 64px; }
  .avatar { width: 45px; height: 45px; font-size: 13px; }
  .seat-name { max-width: 64px; font-size: 10px; }
  .center-stage { inset: 28%; }
}

@media (min-width: 421px) { .table { --table-radius: min(40cqw, 245px); } }

@media (orientation: landscape) and (max-height: 600px) {
  .app-shell { padding-top: calc(var(--safe-top) + 8px); }
  .topbar { margin-bottom: 10px; }
  .privacy-wrap { min-height: auto; }
  .privacy-card { padding: 18px 24px; }
  .player-medallion { width: 60px; height: 60px; margin-bottom: 10px; }
  .role-panel { margin: 12px 0; padding: 14px; }
  .secret-word { font-size: 34px; }
  .game-layout { grid-template-columns: minmax(420px, 1.25fr) minmax(280px, .75fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* v22: lightweight vector scenery and event-driven game feedback. */
:root { --motion-reveal: 440ms; --motion-feedback: 300ms; --scene-accent: var(--teal); }
:root[data-scene='detective'], :root[data-scene='caseResult'], :root[data-scene='gameOver'], :root[data-scene='result'] { --scene-accent: var(--gold); }
:root[data-scene='sabotage'], :root[data-scene='frame'], :root[data-scene='lastWords'] { --scene-accent: var(--danger); }
.motion-toggle { flex: 0 0 auto; }
.motion-toggle .motion-play { display: none; }
.motion-toggle[aria-pressed='false'] .motion-play { display: block; }
.motion-toggle[aria-pressed='false'] .motion-pause { display: none; }
.motion-toggle[aria-pressed='true'] { color: var(--teal); }
.clue-art { position: relative; width: min(100%, 440px); margin: 0 auto; color: var(--teal); pointer-events: none; }
.clue-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.art-orbit { opacity: .35; }
.art-thread { opacity: .28; }
.art-signal { fill: var(--gold); }
.art-card { stroke: var(--teal); stroke-width: 1.4; transform-box: fill-box; transform-origin: center; }
.art-card rect { fill: var(--bg-elevated); stroke: var(--border); }
.art-card-main { stroke: var(--gold); }
.art-card-main rect { fill: var(--surface-strong); stroke: var(--gold); }
.art-card text { fill: var(--text-soft); stroke: none; font-family: inherit; font-size: 12px; font-weight: 700; text-anchor: middle; letter-spacing: 2px; }
.art-scan { stroke: var(--teal); opacity: .65; animation: clue-scan 8s ease-in-out infinite; animation-delay: var(--motion-clock); }
.art-caption { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 4px; color: var(--text-soft); font-size: 12px; letter-spacing: .08em; }
.art-caption span { width: 22px; height: 1px; background: var(--border); }
.hero.motion-enter .art-card-left { animation: card-left-in 650ms cubic-bezier(.16,1,.3,1) both; }
.hero.motion-enter .art-card-right { animation: card-right-in 650ms 80ms cubic-bezier(.16,1,.3,1) both; }
.hero.motion-enter .art-card-main { animation: card-main-in 600ms 140ms cubic-bezier(.16,1,.3,1) both; }
.hero .clue-art { z-index: 1; }
.table-panel { position: relative; isolation: isolate; }
.table-atmosphere { position: absolute; inset: 19%; border: 1px dashed color-mix(in srgb, var(--scene-accent) 24%, transparent); border-radius: 50%; pointer-events: none; }
.table-sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0deg 300deg, color-mix(in srgb, var(--scene-accent) 12%, transparent) 360deg); animation: table-orbit 8s linear infinite; animation-delay: var(--motion-clock); }
.orbit-tick { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--scene-accent); opacity: .65; }
.orbit-tick-one { top: 14%; left: 14%; }
.orbit-tick-two { bottom: 14%; right: 14%; }
.center-stage { isolation: isolate; }
.stage-dial { position: absolute; inset: -8%; width: 116%; height: 116%; z-index: -1; pointer-events: none; fill: none; stroke-width: .6; transform: rotate(-90deg); }
.dial-track { stroke: var(--scene-accent); opacity: .15; }
.dial-progress { stroke: var(--scene-accent); stroke-width: 1; stroke-dasharray: 12 88; stroke-linecap: round; opacity: .65; }
[data-scene='free'] .dial-progress, [data-scene='lastWords'] .dial-progress { stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--time-left, 100)); transition: stroke-dashoffset 300ms linear; }
.time-urgent .timer { color: var(--danger); }
.time-urgent .dial-progress { stroke: var(--danger); }
.center-stage .stage-icon { color: var(--scene-accent); }
[data-theme='light'] .seat.active .avatar { color: #fff; }
.seat.active .avatar.active-cue::after { content: ''; position: absolute; inset: -6px; border: 1px solid var(--scene-accent); border-radius: inherit; pointer-events: none; animation: active-halo 2s ease-out 2; }
.avatar.chip-arrive { animation: chip-land 460ms cubic-bezier(.2,.8,.3,1); }
.avatar.chip-arrive .chip-dot:last-child { animation: chip-drop 460ms cubic-bezier(.2,.8,.3,1); }
.seat.out .avatar.chip-arrive { animation: chip-land 460ms cubic-bezier(.2,.8,.3,1); }
.action-panel.motion-enter, .privacy-card.motion-enter { animation: panel-reveal var(--motion-reveal) cubic-bezier(.16,1,.3,1) both; }
.center-stage.motion-enter { animation: stage-reveal 500ms cubic-bezier(.16,1,.3,1) both; }
.secret-card.motion-enter, .role-panel.motion-enter { animation: secret-reveal 600ms cubic-bezier(.16,1,.3,1) both; }
.choice-arrive { animation: choice-glow var(--motion-feedback) ease-out; }
.score-arrive { animation: panel-reveal 450ms var(--row-delay, 0ms) cubic-bezier(.16,1,.3,1) both; }
.score-row.score-winner { border-color: var(--gold); background: var(--gold-deep); }
.score-row.score-winner .score-rank, .score-row.score-winner .score-value { color: var(--gold); }
.celebration { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; z-index: 3; }
.celebration i { position: absolute; left: var(--x); top: 8%; width: 5px; height: 10px; background: var(--gold); opacity: 0; border-radius: 1px; animation: victory-fall 2100ms var(--fall-delay) ease-out both; }
.celebration i:nth-child(3n) { background: var(--teal); width: 5px; height: 5px; border-radius: 50%; }
.celebration i:nth-child(3n + 1) { background: var(--text-soft); }
.button:not(:disabled):active, .icon-button:not(:disabled):active { scale: .97; }
.button, .icon-button { transition: scale 120ms ease-out, background var(--fast), color var(--fast), border-color var(--fast), opacity var(--fast); }
.modal.motion-enter { animation: panel-reveal 240ms ease-out; }
.modal-backdrop.motion-enter { animation: backdrop-reveal 180ms ease-out; }

@keyframes clue-scan { 0%, 12% { transform: translateY(0); opacity: 0; } 20% { opacity: .65; } 60% { transform: translateY(95px); opacity: .65; } 72%, 100% { transform: translateY(95px); opacity: 0; } }
@keyframes card-left-in { from { opacity: 0; transform: translate(60px, 15px) rotate(12deg); } to { opacity: 1; transform: none; } }
@keyframes card-right-in { from { opacity: 0; transform: translate(-60px, 15px) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes card-main-in { from { opacity: 0; transform: translateY(20px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes table-orbit { to { transform: rotate(360deg); } }
@keyframes active-halo { from { opacity: .7; transform: scale(.93); } to { opacity: 0; transform: scale(1.3); } }
@keyframes panel-reveal { from { opacity: .4; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes stage-reveal { from { opacity: .3; transform: scale(.95); } to { opacity: 1; transform: none; } }
@keyframes secret-reveal { from { opacity: .2; transform: perspective(650px) rotateY(-12deg) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes choice-glow { from { box-shadow: inset 0 0 0 1px var(--gold); } to { box-shadow: inset 0 0 0 1px transparent; } }
@keyframes chip-land { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.12); } }
@keyframes chip-drop { from { opacity: 0; transform: translateY(-20px) scale(1.3); } to { opacity: 1; transform: none; } }
@keyframes victory-fall { 0% { opacity: 0; transform: translate(0, -16px) rotate(0deg); } 15% { opacity: .85; } 100% { opacity: 0; transform: translate(var(--drift), 280px) rotate(210deg); } }
@keyframes backdrop-reveal { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 760px) { .setup-layout .hero { grid-template-columns: 1.1fr 1fr; align-items: center; } }
@media (max-width: 420px) { .clue-art { max-width: 290px; } .art-caption { font-size: 11px; } .online-topbar-meta { flex-wrap: wrap; justify-content: flex-end; } }
@media (orientation: landscape) and (max-height: 600px) and (max-width: 739px) { .game-layout { grid-template-columns: minmax(0, 1fr); } }
[data-motion='off'] *, [data-motion='off'] *::before, [data-motion='off'] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
[data-motion='off'] .celebration { display: none; }
[data-motion-hidden='true'] *, [data-motion-hidden='true'] *::before, [data-motion-hidden='true'] *::after { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .celebration { display: none; } }
