/* ============================================================
   幕间 · AI 剧本杀
   视觉方向：冷纸色、松烟绿、印章红；剧场节目单与案卷票根。
   ============================================================ */

:root {
  --paper: #edf0e9;
  --paper-deep: #e1e6dc;
  --surface: #f8faf5;
  --surface-strong: #ffffff;
  --ink: #14211d;
  --ink-soft: #52615a;
  --ink-faint: #7d8a83;
  --pine: #1d4a3e;
  --pine-deep: #12352c;
  --pine-light: #dfe9e2;
  --brass: #b08a4e;
  --brass-light: #d8c198;
  --seal: #a64434;
  --seal-light: #f2e4df;
  --line: rgba(20, 33, 29, 0.14);
  --line-strong: rgba(20, 33, 29, 0.28);
  --white: #fbfcf8;
  --font-serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", STSong, SimSun, serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  --radius: 3px;
  --shadow: 0 18px 50px rgba(18, 53, 44, 0.10);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

::selection {
  background: var(--brass-light);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0.01em;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(20, 33, 29, 0.06);
  padding: 0.12em 0.35em;
  border-radius: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  transform: translateY(-150%);
  background: var(--pine-deep);
  color: var(--white);
  padding: 10px 14px;
  text-decoration: none;
  border-radius: var(--radius);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ------------------------------------------------------------
   顶部品牌
   ------------------------------------------------------------ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px clamp(20px, 4vw, 44px) 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  width: fit-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--pine);
  color: var(--paper);
  border: 1px solid var(--pine-deep);
  font-family: var(--font-serif);
  font-size: 1.4rem;
  line-height: 1;
  border-radius: 2px;
  box-shadow: inset 0 0 0 2px rgba(237, 240, 233, 0.12);
}

.brand-word {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  gap: 3px;
}

.brand-word strong {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.brand-word small {
  color: var(--ink-faint);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
}

.site-header-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.header-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brass);
}

.config-warning {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: baseline;
  max-width: 1320px;
  margin: 0 auto 4px;
  padding: 12px clamp(20px, 4vw, 44px);
  background: #f3e7e1;
  border-top: 1px solid rgba(166, 68, 52, 0.24);
  border-bottom: 1px solid rgba(166, 68, 52, 0.24);
  color: #71342a;
  font-size: 0.84rem;
}

.config-warning strong {
  font-weight: 650;
}

/* ------------------------------------------------------------
   首页
   ------------------------------------------------------------ */
.view {
  width: 100%;
}

.landing-view {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 44px);
}

.landing-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(370px, 0.82fr);
  gap: clamp(48px, 7vw, 112px);
  align-items: center;
  min-height: calc(100dvh - 150px);
  padding: clamp(48px, 8vh, 104px) 0 44px;
}

.hero {
  position: relative;
  max-width: 760px;
  padding-left: clamp(0px, 2vw, 24px);
}

.hero::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  width: 1px;
  height: 74px;
  background: var(--brass);
  display: none;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--seal);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.hero-kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--seal);
}

.hero h1 {
  margin: 0 0 28px;
  font-size: clamp(3.1rem, 6.4vw, 6.1rem);
  line-height: 1.03;
  letter-spacing: 0.005em;
  text-wrap: balance;
}

.hero-lede {
  max-width: 36em;
  margin-bottom: 34px;
  color: var(--ink-soft);
  font-size: clamp(0.96rem, 1.2vw, 1.06rem);
  line-height: 1.95;
}

.hero-cues {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 34px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.hero-cues span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 17px;
  border-right: 1px solid var(--line);
}

.hero-cues span:first-child {
  padding-left: 0;
}

.hero-cues span:last-child {
  border-right: 0;
}

.hero-cues i {
  color: var(--brass);
  font-family: var(--font-serif);
  font-style: normal;
  font-size: 0.72rem;
}

.hero-note {
  display: flex;
  gap: 14px;
  max-width: 36em;
  padding-top: 2px;
}

.hero-note-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  color: var(--seal);
  font-family: var(--font-serif);
  font-size: 0.92rem;
  border-radius: 50%;
}

.hero-note strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.86rem;
  font-weight: 650;
}

.hero-note p {
  margin-bottom: 0;
  color: var(--ink-faint);
  font-size: 0.8rem;
  line-height: 1.7;
}

/* 入场票根 */
.entry-ticket {
  position: relative;
  width: 100%;
  max-width: 480px;
  justify-self: end;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ticket-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 28px 20px;
}

.ticket-kicker {
  margin-bottom: 8px;
  color: var(--ink-faint);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
}

.ticket-head h2 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.1;
}

.dm-seal {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border: 1px solid var(--seal);
  color: var(--seal);
  font-family: var(--font-serif);
  font-size: 0.72rem;
  line-height: 1.1;
  text-align: center;
  letter-spacing: 0.05em;
  transform: rotate(3deg);
  box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 3px rgba(166, 68, 52, 0.36);
}

.entry-tabs {
  display: flex;
  gap: 24px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
}

.entry-tab {
  position: relative;
  padding: 10px 0 12px;
  background: none;
  border: 0;
  color: var(--ink-faint);
  font-size: 0.86rem;
}

.entry-tab::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
}

.entry-tab.is-active {
  color: var(--ink);
  font-weight: 600;
}

.entry-tab.is-active::after {
  background: var(--seal);
}

.ticket-cut {
  position: relative;
  height: 1px;
  margin: 0 28px;
  border-top: 1px dashed var(--line-strong);
}

.ticket-cut::before,
.ticket-cut::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 17px;
  height: 17px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.ticket-cut::before {
  left: -38px;
}

.ticket-cut::after {
  right: -38px;
}

.entry-body {
  padding: 22px 28px 24px;
}

.entry-form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  color: var(--ink-soft);
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.field-hint {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.71rem;
  line-height: 1.65;
}

input[type="text"],
input[type="password"],
input[type="url"],
textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="url"]::placeholder,
textarea::placeholder {
  color: #9aa49e;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
textarea:focus {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(29, 74, 62, 0.10);
}

.code-input {
  font-family: var(--font-serif);
  font-size: 1.55rem !important;
  letter-spacing: 0.42em;
  font-variant-numeric: tabular-nums;
}

.assist-field {
  margin: 0;
  padding: 0;
  border: 0;
}

.assist-field legend {
  margin-bottom: 7px;
  padding: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  overflow: hidden;
}

.segmented label {
  position: relative;
  display: block;
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: block;
  padding: 9px 10px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-align: center;
  border-right: 1px solid var(--line);
  transition: background 140ms ease, color 140ms ease;
}

.segmented label:last-child span {
  border-right: 0;
}

.segmented input:checked + span {
  background: var(--pine);
  color: var(--paper);
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--seal);
  outline-offset: -3px;
}

.field-hint {
  margin-top: 7px;
}

.advanced {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.advanced summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.75rem;
  cursor: pointer;
  list-style: none;
}

.advanced summary::-webkit-details-marker {
  display: none;
}

.advanced summary::after {
  content: "＋";
  color: var(--brass);
  font-size: 0.9rem;
}

.advanced[open] summary::after {
  content: "－";
}

.advanced summary span {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 0.68rem;
  font-weight: 400;
}

.advanced-body {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding-top: 15px;
}

.script-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 1px;
}

.file-button,
.text-button {
  padding: 0;
  background: none;
  border: 0;
  color: var(--pine);
  font-size: 0.73rem;
  text-decoration: underline;
  text-decoration-color: rgba(29, 74, 62, 0.3);
  text-underline-offset: 3px;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.script-area {
  min-height: 166px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  line-height: 1.65;
  tab-size: 2;
}

.script-preview {
  min-height: 1.3em;
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.71rem;
  line-height: 1.55;
}

.script-preview.is-valid {
  color: var(--pine);
}

.script-preview.is-invalid {
  color: var(--seal);
}

.primary-button,
.confirm-button,
.send-button,
.ghost-button,
.light-button {
  border-radius: 2px;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.primary-button {
  min-height: 48px;
  padding: 12px 18px;
  background: var(--pine);
  border: 1px solid var(--pine);
  color: var(--paper);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.primary-button:hover:not(:disabled) {
  background: var(--pine-deep);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.form-note {
  margin: -4px 0 0;
  color: var(--ink-faint);
  font-size: 0.7rem;
  line-height: 1.65;
  text-align: center;
}

.form-error {
  margin: 0;
  padding: 9px 11px;
  color: #7a3025;
  background: var(--seal-light);
  border-left: 2px solid var(--seal);
  font-size: 0.76rem;
  line-height: 1.55;
}

.resume-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  align-items: center;
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.resume-card span {
  color: var(--ink-faint);
  font-size: 0.71rem;
}

.resume-card strong {
  grid-column: 1;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  letter-spacing: 0.15em;
}

.resume-card .text-button {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.ticket-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 28px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
}

.landing-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.7rem;
}

/* ------------------------------------------------------------
   房间顶部
   ------------------------------------------------------------ */
.room-view {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 44px) 36px;
}

body.in-room .site-header {
  display: none;
}

.room-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 54dvh;
  gap: 14px;
  color: var(--ink-faint);
}

.room-loading p {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.loading-seal {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  background: var(--pine);
  color: var(--paper);
  border: 1px solid var(--pine-deep);
  font-family: var(--font-serif);
  font-size: 1.7rem;
  box-shadow: inset 0 0 0 3px rgba(237, 240, 233, 0.12);
  animation: seal-breathe 1.8s ease-in-out infinite;
}

@keyframes seal-breathe {
  0%, 100% { opacity: 0.62; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

.room-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 52px;
  padding: 4px 0 10px;
}

.room-topbar-left,
.room-topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.room-script-name {
  overflow: hidden;
  max-width: 38vw;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 0.96rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.brand-compact .brand-mark {
  width: 31px;
  height: 31px;
  font-size: 1.1rem;
}

.brand-compact .brand-word strong {
  font-size: 1rem;
}

.topbar-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
}

.room-code-button {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--ink-soft);
  font-size: 0.68rem;
  white-space: nowrap;
}

.room-code-button strong {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
}

.copy-hint {
  color: var(--brass);
  font-size: 0.64rem;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-faint);
  font-size: 0.68rem;
  white-space: nowrap;
}

.sync-status i {
  width: 6px;
  height: 6px;
  background: var(--brass);
  border-radius: 50%;
}

.sync-status.is-live i {
  background: #3e7a5e;
  box-shadow: 0 0 0 3px rgba(62, 122, 94, 0.12);
}

.sync-status.is-error i {
  background: var(--seal);
}

.text-button {
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-decoration: none;
}

.text-button:hover {
  color: var(--seal);
}

.topbar-leave {
  padding: 6px 0;
}

/* 幕次轨道 */
.stage-rail {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.stage-rail::-webkit-scrollbar {
  display: none;
}

.stage-step {
  display: flex;
  align-items: center;
  flex: 1 0 auto;
  gap: 7px;
  min-width: 96px;
  color: var(--ink-faint);
  font-size: 0.65rem;
  white-space: nowrap;
}

.stage-step:not(:last-child)::after {
  content: "";
  flex: 1;
  min-width: 12px;
  height: 1px;
  margin: 0 9px;
  background: var(--line);
}

.stage-step .step-num {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-faint);
  font-family: var(--font-serif);
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
}

.stage-step.is-done {
  color: var(--ink-soft);
}

.stage-step.is-done .step-num {
  background: var(--paper-deep);
  color: var(--ink-soft);
}

.stage-step.is-active {
  color: var(--ink);
  font-weight: 600;
}

.stage-step.is-active .step-num {
  background: var(--seal);
  border-color: var(--seal);
  color: var(--white);
}

/* ------------------------------------------------------------
   选角门厅
   ------------------------------------------------------------ */
.role-gate {
  padding: clamp(30px, 5vw, 62px) 0 40px;
}

.role-gate-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  margin-bottom: 9px;
  color: var(--seal);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
}

.role-gate h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.12;
}

.role-gate-intro {
  max-width: 40em;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.87rem;
  line-height: 1.8;
}

.role-gate-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  color: var(--ink-faint);
  font-size: 0.72rem;
}

.mini-roster {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.mini-avatar {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0.8rem;
  line-height: 1;
}

.mini-avatar.is-me {
  border-color: var(--brass);
  box-shadow: 0 0 0 1px var(--brass);
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.role-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 248px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.role-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--paper-deep);
}

.role-card.is-mine {
  border-color: var(--pine);
  box-shadow: inset 0 0 0 1px var(--pine);
}

.role-card.is-mine::before {
  background: var(--pine);
}

.role-card.is-claimed {
  background: #eff2eb;
  color: var(--ink-faint);
}

.role-card.is-claimed::before {
  background: var(--line-strong);
}

.role-seat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
  color: var(--ink-faint);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
}

.role-card h3 {
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.25;
}

.role-card.is-claimed h3 {
  color: var(--ink-soft);
}

.role-profile {
  flex: 1;
  margin-bottom: 20px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.8;
}

.role-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
}

.role-state {
  color: var(--ink-faint);
  font-size: 0.7rem;
}

.role-state.is-mine {
  color: var(--pine);
  font-weight: 600;
}

.role-claim-button {
  padding: 7px 13px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--ink);
  font-size: 0.72rem;
}

.role-claim-button:hover:not(:disabled) {
  background: var(--pine);
  border-color: var(--pine);
  color: var(--paper);
}

.role-claim-button:disabled {
  cursor: default;
  color: var(--ink-faint);
  border-color: var(--line);
}

.role-gate-note {
  margin: 20px 0 0;
  color: var(--ink-faint);
  font-size: 0.7rem;
}

/* ------------------------------------------------------------
   游戏主布局
   ------------------------------------------------------------ */
.room-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 372px);
  grid-template-rows: auto auto;
  gap: 16px;
  align-items: start;
  padding-top: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.chat-panel {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 214px);
  min-height: 560px;
  overflow: hidden;
}

.stage-panel {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.clues-panel {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 19px 14px;
  border-bottom: 1px solid var(--line);
}

.chat-head {
  padding-bottom: 15px;
}

.panel-kicker {
  margin-bottom: 5px;
  color: var(--seal);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.15em;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
}

.panel-meta {
  padding-top: 4px;
  color: var(--ink-faint);
  font-size: 0.68rem;
  white-space: nowrap;
}

.panel-copy {
  margin: 0;
  padding: 13px 19px 2px;
  color: var(--ink-faint);
  font-size: 0.72rem;
  line-height: 1.65;
}

/* 聊天 */
.chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 19px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.chat-list::-webkit-scrollbar {
  width: 8px;
}

.chat-list::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 2px solid var(--surface);
  border-radius: 8px;
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 180px;
  padding: 24px;
  color: var(--ink-faint);
  text-align: center;
}

.chat-empty strong {
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
}

.chat-empty span {
  max-width: 24em;
  font-size: 0.74rem;
  line-height: 1.7;
}

.chat-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(20, 33, 29, 0.07);
}

.chat-item:last-child {
  border-bottom: 0;
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0.95rem;
  line-height: 1;
}

.chat-avatar.is-ai {
  background: var(--pine);
  border-color: var(--pine);
  border-radius: 2px;
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: 0.62rem;
  letter-spacing: 0.02em;
}

.chat-body {
  min-width: 0;
}

.chat-item.is-ai .chat-body,
.chat-item.is-clue .chat-body {
  padding: 11px 13px;
  border-left: 2px solid var(--pine);
  background: var(--pine-light);
}

.chat-item.is-clue .chat-body {
  border-left-color: var(--seal);
  background: var(--seal-light);
}

.chat-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 4px;
}

.chat-name {
  color: var(--ink);
  font-size: 0.73rem;
  font-weight: 650;
}

.chat-item.is-mine .chat-name {
  color: var(--pine);
}

.chat-time {
  color: var(--ink-faint);
  font-size: 0.6rem;
  font-variant-numeric: tabular-nums;
}

.chat-tag {
  padding: 1px 5px;
  border: 1px solid rgba(166, 68, 52, 0.3);
  border-radius: 2px;
  color: var(--seal);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.chat-content {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.chat-item.is-ai .chat-content {
  color: var(--pine-deep);
}

.ai-thinking {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 19px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.72rem;
}

.dm-monogram {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: var(--pine);
  color: var(--paper);
  border-radius: 2px;
  font-family: var(--font-serif);
  font-size: 0.55rem;
}

.thinking-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 1px;
}

.thinking-dots i {
  width: 3px;
  height: 3px;
  background: var(--brass);
  border-radius: 50%;
  animation: dot-pulse 1.2s infinite ease-in-out;
}

.thinking-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.thinking-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes dot-pulse {
  0%, 65%, 100% { opacity: 0.28; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

/* 搜证地点 */
.search-tray {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 10px 19px;
  border-top: 1px solid var(--line);
  background: rgba(29, 74, 62, 0.035);
}

.search-tray-label {
  margin-right: 2px;
  color: var(--ink-faint);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

.search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.search-chip {
  padding: 3px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--pine);
  font-size: 0.68rem;
}

.search-chip:hover {
  border-color: var(--pine);
}

/* 输入区 */
.composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 8px;
  border-top: 1px solid var(--line);
}

.composer input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 8px 12px;
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  outline: none;
  font-size: 0.82rem;
}

.composer input:focus {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(29, 74, 62, 0.10);
}

.ghost-button,
.send-button {
  flex: 0 0 auto;
  height: 42px;
  padding: 0 13px;
  font-size: 0.76rem;
  white-space: nowrap;
}

.ghost-button {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
}

.ghost-button:hover:not(:disabled) {
  border-color: var(--pine);
  color: var(--pine);
}

.send-button {
  background: var(--pine);
  border: 1px solid var(--pine);
  color: var(--paper);
  font-weight: 600;
}

.send-button:hover:not(:disabled) {
  background: var(--pine-deep);
}

.ghost-button:disabled,
.send-button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.composer-hint {
  margin: 0;
  padding: 0 18px 12px;
  color: var(--ink-faint);
  font-size: 0.62rem;
  line-height: 1.4;
}

/* ------------------------------------------------------------
   侧栏：当前幕
   ------------------------------------------------------------ */
.stage-card {
  position: relative;
  overflow: hidden;
  padding: 21px 21px 20px;
  background: var(--pine-deep);
  border-radius: var(--radius);
  color: #e7eee7;
}

.stage-card::after {
  content: "幕";
  position: absolute;
  right: 10px;
  bottom: -35px;
  color: rgba(237, 240, 233, 0.045);
  font-family: var(--font-serif);
  font-size: 11rem;
  line-height: 1;
  pointer-events: none;
}

.stage-card > * {
  position: relative;
  z-index: 1;
}

.stage-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.stage-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  height: 23px;
  padding: 0 8px;
  background: var(--seal);
  border-radius: 2px;
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}

.stage-assist {
  color: rgba(231, 238, 231, 0.58);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

.stage-card h2 {
  margin-bottom: 9px;
  color: var(--white);
  font-size: 1.65rem;
  line-height: 1.25;
}

.stage-description {
  margin-bottom: 18px;
  color: rgba(231, 238, 231, 0.68);
  font-size: 0.76rem;
  line-height: 1.75;
}

.my-role-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-top: 13px;
  border-top: 1px solid rgba(231, 238, 231, 0.14);
  color: rgba(231, 238, 231, 0.55);
  font-size: 0.66rem;
}

.my-role-line strong {
  color: var(--brass-light);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
}

.ready-block {
  margin-bottom: 18px;
}

.ready-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: rgba(231, 238, 231, 0.55);
  font-size: 0.65rem;
}

.ready-meta strong {
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.ready-bar {
  height: 3px;
  overflow: hidden;
  background: rgba(231, 238, 231, 0.14);
  border-radius: 4px;
}

.ready-bar span {
  display: block;
  height: 100%;
  background: var(--brass);
  transition: width 260ms ease;
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.light-button {
  min-height: 35px;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid rgba(231, 238, 231, 0.23);
  color: rgba(231, 238, 231, 0.8);
  font-size: 0.69rem;
}

.light-button:hover:not(:disabled) {
  background: rgba(231, 238, 231, 0.08);
  border-color: rgba(231, 238, 231, 0.4);
}

.confirm-button {
  flex: 1 1 100%;
  min-height: 40px;
  padding: 9px 12px;
  background: var(--brass);
  border: 1px solid var(--brass);
  color: var(--pine-deep);
  font-size: 0.76rem;
  font-weight: 600;
}

.confirm-button:hover:not(:disabled) {
  background: var(--brass-light);
  border-color: var(--brass-light);
}

.confirm-button:disabled {
  cursor: default;
  opacity: 0.5;
}

.roster-block,
.vote-panel {
  padding: 16px 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.mini-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
  color: var(--ink-soft);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.mini-heading > span:last-child {
  color: var(--ink-faint);
  font-weight: 400;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.player-roster {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-row {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 31px;
}

.player-row .mini-avatar {
  width: 27px;
  height: 27px;
  font-size: 0.84rem;
}

.player-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.74rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.player-name small {
  margin-left: 4px;
  color: var(--ink-faint);
  font-size: 0.62rem;
}

.player-ready {
  color: var(--ink-faint);
  font-size: 0.62rem;
  white-space: nowrap;
}

.player-ready.is-ready {
  color: var(--pine);
}

.player-ready.is-ready::before {
  content: "✓";
  margin-right: 3px;
  color: var(--brass);
}

/* 投票 */
.vote-panel {
  border-color: rgba(166, 68, 52, 0.25);
}

.vote-copy {
  margin-bottom: 12px;
  color: var(--ink-faint);
  font-size: 0.69rem;
  line-height: 1.65;
}

.vote-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.vote-option {
  min-height: 37px;
  padding: 7px 8px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-align: left;
}

.vote-option:hover:not(:disabled) {
  border-color: var(--seal);
}

.vote-option.is-selected {
  background: var(--seal-light);
  border-color: var(--seal);
  color: var(--seal);
  font-weight: 600;
}

.vote-option:disabled {
  cursor: default;
  opacity: 0.72;
}

.vote-submit {
  width: 100%;
  min-height: 38px;
  flex: none;
}

.vote-note {
  min-height: 1.2em;
  margin: 9px 0 0;
  color: var(--ink-faint);
  font-size: 0.65rem;
  line-height: 1.5;
}

/* ------------------------------------------------------------
   线索清单
   ------------------------------------------------------------ */
.clue-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: min(43vh, 460px);
  overflow-y: auto;
  padding: 12px 19px 19px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.clue-empty {
  padding: 25px 18px;
  border: 1px dashed var(--line-strong);
  color: var(--ink-faint);
  font-size: 0.74rem;
  line-height: 1.7;
  text-align: center;
}

.clue-item {
  padding: 13px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brass);
  border-radius: 2px;
}

.clue-item.is-public {
  border-left-color: var(--pine);
  background: #f2f6ef;
}

.clue-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ink-faint);
  font-size: 0.62rem;
}

.clue-meta strong {
  color: var(--ink-soft);
  font-weight: 500;
}

.clue-content {
  margin: 0;
  color: var(--ink);
  font-size: 0.76rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.clue-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}

.clue-status {
  color: var(--pine);
  font-size: 0.64rem;
}

.clue-status.is-private {
  color: var(--ink-faint);
}

.clue-publish {
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--ink-soft);
  font-size: 0.64rem;
}

.clue-publish:hover:not(:disabled) {
  border-color: var(--seal);
  color: var(--seal);
}

.clue-publish:disabled {
  cursor: wait;
  opacity: 0.5;
}

/* ------------------------------------------------------------
   弹窗
   ------------------------------------------------------------ */
dialog {
  max-width: none;
  width: min(760px, calc(100% - 24px));
  max-height: 90dvh;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(8, 22, 18, 0.62);
  backdrop-filter: blur(2px);
}

.role-modal {
  width: min(940px, calc(100% - 24px));
}

.review-modal {
  width: min(820px, calc(100% - 24px));
}

.modal-inner {
  max-height: 88dvh;
  overflow-y: auto;
  padding: clamp(21px, 4vw, 36px);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(8, 22, 18, 0.28);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  line-height: 1.15;
}

.icon-button {
  flex: 0 0 auto;
  padding: 5px 0;
  background: none;
  border: 0;
  color: var(--ink-faint);
  font-size: 0.72rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.icon-button:hover {
  color: var(--seal);
}

.script-profile {
  margin-bottom: 20px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.8;
}

.script-body,
.preserve-lines {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.script-body {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.role-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-murderer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  padding: 17px 19px;
  background: var(--pine-deep);
  border-radius: 2px;
  color: rgba(231, 238, 231, 0.65);
  font-size: 0.72rem;
}

.review-murderer strong {
  color: var(--brass-light);
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 500;
}

.review-section {
  margin-bottom: 24px;
}

.review-section:last-child {
  margin-bottom: 0;
}

.review-section h3 {
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 1rem;
}

.review-section p {
  margin: 0;
}

.review-votes {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.review-vote {
  padding: 5px 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

/* ------------------------------------------------------------
   提示
   ------------------------------------------------------------ */
.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: min(360px, calc(100vw - 40px));
  padding: 11px 14px;
  background: var(--pine-deep);
  border-left: 2px solid var(--brass);
  border-radius: 2px;
  color: var(--paper);
  font-size: 0.76rem;
  line-height: 1.55;
  box-shadow: 0 12px 30px rgba(8, 22, 18, 0.18);
  animation: toast-in 180ms ease-out both;
}

.toast.is-error {
  border-left-color: var(--seal);
  background: #4a241e;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------
   移动端
   ------------------------------------------------------------ */
.mobile-tabs {
  display: none;
}

@media (max-width: 1080px) {
  .landing-shell {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
    gap: 44px;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 6vw, 4.8rem);
  }

  .room-grid {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 340px);
  }
}

@media (max-width: 900px) {
  .site-header {
    padding-top: 18px;
  }

  .site-header-meta {
    display: none;
  }

  .landing-shell {
    display: flex;
    flex-direction: column;
    gap: 34px;
    min-height: auto;
    padding: 42px 0 38px;
  }

  .hero {
    max-width: 650px;
    padding-left: 0;
  }

  .hero h1 {
    font-size: clamp(2.9rem, 10vw, 5rem);
  }

  .entry-ticket {
    align-self: stretch;
    max-width: 560px;
    justify-self: auto;
  }

  .landing-footer {
    margin-top: 0;
  }

  .room-view {
    padding-bottom: 26px;
  }

  .room-topbar {
    gap: 10px;
  }

  .room-script-name {
    max-width: 30vw;
  }

  .stage-rail {
    padding: 9px 0;
  }

  .stage-step {
    min-width: 78px;
    font-size: 0.6rem;
  }

  .stage-step .step-num {
    width: 20px;
    height: 20px;
    font-size: 0.6rem;
  }

  .mobile-tabs {
    display: flex;
    gap: 0;
    margin-top: 2px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-tab {
    flex: 1;
    padding: 11px 8px;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--ink-faint);
    font-size: 0.75rem;
  }

  .mobile-tab.is-active {
    border-bottom-color: var(--seal);
    color: var(--ink);
    font-weight: 600;
  }

  .tab-count {
    display: inline-block;
    min-width: 17px;
    margin-left: 2px;
    padding: 0 4px;
    background: var(--paper-deep);
    border-radius: 9px;
    color: var(--ink-soft);
    font-size: 0.58rem;
    line-height: 17px;
    text-align: center;
    vertical-align: 1px;
  }

  .room-grid {
    display: block;
    padding-top: 12px;
  }

  .room-grid > .panel {
    display: none;
    margin-bottom: 14px;
  }

  .room-grid > .panel.is-mobile-active {
    display: block;
  }

  .room-grid > .chat-panel.is-mobile-active {
    display: flex;
  }

  .room-grid > .stage-panel.is-mobile-active {
    display: flex;
  }

  .chat-panel {
    height: calc(100dvh - 250px);
    min-height: 430px;
  }

  .stage-panel,
  .clues-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .clue-list {
    max-height: none;
  }

  .role-gate-head {
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
  }

  .role-gate-status {
    align-items: flex-start;
  }

  .mini-roster {
    justify-content: flex-start;
  }

  .role-grid {
    grid-template-columns: 1fr;
  }

  .role-card {
    min-height: 210px;
  }

  .role-modal .role-grid-compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15px;
  }

  .site-header {
    padding: 16px 16px 8px;
  }

  .landing-view {
    padding-right: 16px;
    padding-left: 16px;
  }

  .hero-kicker {
    margin-bottom: 18px;
  }

  .hero h1 {
    margin-bottom: 20px;
    font-size: clamp(2.55rem, 13vw, 4rem);
  }

  .hero-lede {
    margin-bottom: 24px;
    font-size: 0.9rem;
    line-height: 1.85;
  }

  .hero-cues {
    gap: 9px 0;
    margin-bottom: 24px;
    padding: 12px 0;
  }

  .hero-cues span {
    padding: 0 10px;
    font-size: 0.68rem;
  }

  .hero-cues span:first-child {
    padding-left: 0;
  }

  .hero-note {
    gap: 11px;
  }

  .ticket-head {
    padding: 22px 20px 17px;
  }

  .ticket-head h2 {
    font-size: 1.55rem;
  }

  .dm-seal {
    width: 45px;
    height: 45px;
    font-size: 0.64rem;
  }

  .entry-tabs {
    padding: 0 20px;
  }

  .ticket-cut {
    margin: 0 20px;
  }

  .ticket-cut::before {
    left: -30px;
  }

  .ticket-cut::after {
    right: -30px;
  }

  .entry-body {
    padding: 20px;
  }

  .ticket-foot {
    padding: 11px 20px;
    font-size: 0.61rem;
  }

  .landing-footer {
    flex-direction: column;
    gap: 4px;
    padding-bottom: 18px;
  }

  .room-view {
    padding: 6px 12px 22px;
  }

  .room-topbar {
    padding-bottom: 7px;
  }

  .room-topbar-left,
  .room-topbar-right {
    gap: 8px;
  }

  .topbar-divider,
  .copy-hint,
  .sync-status span {
    display: none;
  }

  .room-script-name {
    max-width: 26vw;
    font-size: 0.8rem;
  }

  .brand-compact .brand-word {
    display: none;
  }

  .brand-compact .brand-mark {
    width: 29px;
    height: 29px;
    font-size: 1rem;
  }

  .room-code-button {
    padding: 5px 7px;
    gap: 5px;
  }

  .room-code-button strong {
    font-size: 0.95rem;
  }

  .topbar-leave {
    font-size: 0.7rem;
  }

  .sync-status i {
    width: 7px;
    height: 7px;
  }

  .stage-rail {
    margin: 0 -12px;
    padding: 8px 12px;
    border-top: 0;
  }

  .stage-step {
    min-width: 66px;
    gap: 4px;
    font-size: 0.56rem;
  }

  .stage-step:not(:last-child)::after {
    min-width: 6px;
    margin: 0 5px;
  }

  .stage-step .step-num {
    width: 18px;
    height: 18px;
    font-size: 0.55rem;
  }

  .mobile-tab {
    padding: 9px 5px;
    font-size: 0.7rem;
  }

  .chat-panel {
    height: calc(100dvh - 215px);
    min-height: 380px;
  }

  .panel-head {
    padding: 14px 14px 11px;
  }

  .panel-copy {
    padding-right: 14px;
    padding-left: 14px;
  }

  .chat-list {
    padding-right: 14px;
    padding-left: 14px;
  }

  .chat-item {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    padding: 10px 0;
  }

  .chat-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.84rem;
  }

  .chat-content {
    font-size: 0.8rem;
  }

  .composer {
    flex-wrap: wrap;
    gap: 6px;
    padding: 9px 10px 6px;
  }

  .composer input {
    flex: 1 1 0;
    min-width: 0;
    height: 39px;
  }

  .ghost-button,
  .send-button {
    height: 39px;
    padding: 0 10px;
    font-size: 0.7rem;
  }

  .composer-hint {
    padding-right: 11px;
    padding-left: 11px;
    font-size: 0.58rem;
  }

  .search-tray {
    padding: 8px 14px;
  }

  .stage-card {
    padding: 18px 17px;
  }

  .stage-card h2 {
    font-size: 1.5rem;
  }

  .stage-panel {
    gap: 11px;
  }

  .roster-block,
  .vote-panel {
    padding: 14px;
  }

  .vote-options {
    grid-template-columns: 1fr;
  }

  .clue-list {
    padding: 10px 14px 14px;
  }

  .role-gate {
    padding-top: 24px;
  }

  .role-gate h1 {
    font-size: 2rem;
  }

  .role-card {
    padding: 18px;
  }

  .modal-inner {
    padding: 20px 17px;
  }

  .script-body,
  .preserve-lines {
    font-size: 0.94rem;
    line-height: 1.9;
  }

  .review-murderer {
    align-items: flex-end;
    padding: 14px;
  }

  .review-murderer strong {
    font-size: 1.4rem;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
    left: 12px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }
}

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