:root {
  --ink: #080604;
  --ink-2: #100b07;
  --paper: #ece2cd;
  --dim: rgba(236, 226, 205, 0.62);
  --dim-2: rgba(236, 226, 205, 0.38);
  --gold: #c9a35e;
  --gold-2: #e7d09b;
  --gold-soft: rgba(201, 163, 94, 0.14);
  --line: rgba(201, 163, 94, 0.2);
  --red: #8e2f2a;
  --red-2: #c05a4e;
  --jade: #6f8b6a;
  --blue: #5c7d92;
  --panel: linear-gradient(180deg, rgba(22, 16, 11, 0.74), rgba(9, 7, 5, 0.84));
  --panel-soft: rgba(10, 8, 6, 0.58);
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  -webkit-tap-highlight-color: transparent;
}

body { overflow: hidden; }

button, input { font-family: inherit; }

.screen {
  position: fixed;
  inset: 0;
  display: none;
  overflow: hidden;
}

.screen.is-active { display: block; }

#screen-game.is-active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

/* ---------- background ---------- */

.bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.56) saturate(0.9);
  transform: scale(1.04);
  transition: background-image 1s ease, filter 1s ease;
  animation: kenburns 32s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes kenburns {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.13) translate3d(-1.6%, -1.2%, 0); }
}

.bg-fade {
  opacity: 0;
  transition: opacity 1.4s ease;
  transform: scale(1.08);
}
.bg-fade.is-on { opacity: 1; }

/* ---------- first-person layer ---------- */

.pov-fx {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.pov-col {
  position: absolute;
  top: -5%;
  bottom: -5%;
  width: clamp(38px, 7vw, 130px);
  background: linear-gradient(90deg, rgba(4, 3, 2, 0.92), rgba(4, 3, 2, 0.42) 55%, transparent);
  filter: blur(3px);
}
.pov-col-l { left: -1%; }
.pov-col-r { right: -1%; transform: scaleX(-1); }

.pov-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24%;
  background: linear-gradient(180deg, transparent, rgba(4, 3, 2, 0.62) 56%, rgba(4, 3, 2, 0.88));
}
.pov-floor::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: 38%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 163, 94, 0.34), transparent);
}

.pov-grain {
  position: absolute;
  inset: -20%;
  opacity: 0.14;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='0.55'/></svg>");
  animation: grain 0.9s steps(2) infinite;
}
@keyframes grain {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-1.5%, 1%, 0); }
  100% { transform: translate3d(1.5%, -1%, 0); }
}

.speaker-layer {
  position: absolute;
  right: clamp(300px, 27vw, 470px);
  bottom: 0;
  z-index: 4;
  width: clamp(210px, 25vw, 360px);
  height: min(72vh, 620px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.4s ease, transform 0.5s ease;
  will-change: opacity, transform;
}
.speaker-layer.is-on { opacity: 1; transform: translateY(0) scale(1); }

.speaker-layer .sp-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 14%;
  filter: brightness(0.98) contrast(1.06);
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(ellipse 64% 70% at 50% 40%, #000 46%, rgba(0, 0, 0, 0.72) 68%, transparent 92%);
  mask-image: radial-gradient(ellipse 64% 70% at 50% 40%, #000 46%, rgba(0, 0, 0, 0.72) 68%, transparent 92%);
}

.speaker-layer .sp-shade {
  position: absolute;
  inset: auto 0 0 0;
  height: 24%;
  background: linear-gradient(180deg, transparent, rgba(5, 4, 3, 0.66));
}

.speaker-layer .sp-plate {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9%;
  padding-left: 2px;
  text-align: left;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}
.speaker-layer .sp-tag {
  display: inline-block;
  margin-bottom: 5px;
  padding: 1px 6px;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--gold-2);
  background: rgba(8, 6, 5, 0.7);
  border: 1px solid rgba(201, 163, 94, 0.4);
}
.speaker-layer .sp-name {
  display: block;
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: #f7ecd4;
}
.speaker-layer .sp-seat {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--gold);
}
.speaker-layer .sp-line {
  display: block;
  margin-top: 9px;
  max-width: 320px;
  font-size: 12px;
  line-height: 1.85;
  color: rgba(240, 231, 212, 0.9);
}

.bg-lobby { background-image: url("assets/gate.jpg?v=4"); filter: brightness(0.46) saturate(0.84); }
.bg-room { background-image: url("assets/peach.jpg?v=4"); filter: brightness(0.42) saturate(0.82); }
.bg-dawn { background-image: url("assets/dawn.jpg?v=4"); filter: brightness(0.5) saturate(0.86); }
#game-bg, #game-bg2 { filter: brightness(0.72) saturate(0.98) contrast(1.02); }

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 65% at 50% 0%, rgba(6, 5, 4, 0.14), rgba(6, 5, 4, 0.66) 82%),
    linear-gradient(180deg, rgba(6, 5, 4, 0.18), rgba(6, 5, 4, 0.5));
}

/* ---------- shared ---------- */

.kicker {
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--gold);
}

.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(201, 163, 94, 0.62);
  color: var(--gold-2);
  font-size: 23px;
  letter-spacing: 0;
  background: rgba(142, 47, 42, 0.2);
  box-shadow: inset 0 0 20px rgba(201, 163, 94, 0.12);
}

.primary,
.ghost,
.text-btn,
.force-btn,
.chat-tab,
.act-btn,
.kind-chip,
.mini-btn,
.secret-fab,
.seat-card {
  font-family: inherit;
  cursor: pointer;
  border-radius: 2px;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.primary {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  letter-spacing: 0.22em;
  color: #1a1207;
  background: linear-gradient(180deg, #e6c887, #b98f45);
  border: 1px solid #f0dda8;
  box-shadow: 0 10px 26px rgba(201, 163, 94, 0.18);
}

.primary:disabled { opacity: 0.36; cursor: not-allowed; box-shadow: none; }
.primary:not(:disabled):active,
.ghost:active,
.act-btn:active,
.kind-chip:active { transform: translateY(1px) scale(0.995); }

.ghost {
  padding: 11px 18px;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--gold-2);
  background: rgba(201, 163, 94, 0.08);
  border: 1px solid rgba(201, 163, 94, 0.42);
}

.ghost.sm { padding: 8px 12px; font-size: 11px; }

.text-btn {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.16em;
  padding: 6px;
}

.text-btn.sm { font-size: 10px; }

.field { display: block; margin: 18px 0 12px; }
.field span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--dim-2);
  margin-bottom: 7px;
}
.field input,
.join-row input,
.composer input {
  width: 100%;
  padding: 12px 13px;
  color: var(--paper);
  background: rgba(8, 6, 5, 0.72);
  border: 1px solid rgba(201, 163, 94, 0.28);
  outline: none;
  font-size: 14px;
}
.field input:focus,
.join-row input:focus,
.composer input:focus { border-color: rgba(201, 163, 94, 0.7); }

.join-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

.or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--dim-2);
  font-size: 10px;
  letter-spacing: 0.18em;
}
.or::before, .or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(201, 163, 94, 0.18);
}

.err {
  min-height: 18px;
  margin-top: 8px;
  font-size: 11px;
  color: #e3a091;
  letter-spacing: 0.06em;
}

/* ---------- lobby ---------- */

.lobby {
  position: relative;
  z-index: 2;
  max-width: 560px;
  margin: 0 auto;
  height: 100%;
  overflow-y: auto;
  padding: 46px 26px 60px;
}

.brand { text-align: center; margin-bottom: 18px; }
.brand .kicker { display: block; margin-bottom: 12px; }
.brand h1 {
  margin: 12px 0 4px;
  font-size: 54px;
  letter-spacing: 0.26em;
  font-weight: 500;
  color: #f6ead1;
  text-shadow: 0 0 46px rgba(201, 163, 94, 0.34);
}
.brand h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.4em;
  color: var(--gold);
}

.poem {
  margin: 22px 0 16px;
  padding: 16px 18px;
  border-left: 2px solid rgba(201, 163, 94, 0.42);
  background: rgba(8, 6, 5, 0.42);
  font-size: 12px;
  line-height: 2.1;
  letter-spacing: 0.08em;
  color: rgba(236, 226, 205, 0.78);
}

.intro {
  font-size: 11px;
  line-height: 2;
  color: var(--dim);
  letter-spacing: 0.03em;
}
.intro p { margin: 0 0 6px; }

/* ---------- room ---------- */

.room {
  position: relative;
  z-index: 2;
  max-width: 1040px;
  margin: 0 auto;
  height: 100%;
  overflow-y: auto;
  padding: 34px 24px 60px;
}

.room-head { text-align: center; margin-bottom: 22px; }
.room-code {
  margin: 8px 0 6px;
  font-size: 44px;
  letter-spacing: 0.32em;
  color: #f4e7ca;
  text-shadow: 0 0 30px rgba(201, 163, 94, 0.28);
}
.room-head p { margin: 0; font-size: 11px; color: var(--dim); letter-spacing: 0.08em; }

.seat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.room-seat {
  position: relative;
  min-height: 190px;
  border: 1px solid rgba(201, 163, 94, 0.2);
  background: rgba(8, 6, 5, 0.62);
  overflow: hidden;
}

.room-seat .rs-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  filter: brightness(0.62) saturate(0.86);
}

.room-seat .rs-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 6, 5, 0.05) 20%, rgba(8, 6, 5, 0.94) 92%);
}

.room-seat .rs-body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 10px 11px 11px;
}

.room-seat .rs-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 6px;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--gold-2);
  background: rgba(10, 8, 6, 0.72);
  border: 1px solid rgba(201, 163, 94, 0.32);
}

.room-seat .rs-title { display: block; font-size: 13px; color: #f4e8d1; letter-spacing: 0.08em; }
.room-seat .rs-name { display: block; margin-top: 3px; font-size: 10px; color: var(--dim); }
.room-seat .rs-power { display: block; margin-top: 2px; font-size: 9px; color: var(--gold); letter-spacing: 0.1em; }

.room-seat.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim-2);
  font-size: 11px;
  letter-spacing: 0.2em;
  border-style: dashed;
  background: rgba(8, 6, 5, 0.34);
}

.room-actions { max-width: 420px; margin: 0 auto 18px; }
.room-actions .hint {
  margin-top: 9px;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--dim-2);
}

.feed {
  max-width: 560px;
  margin: 0 auto;
  border-left: 2px solid rgba(201, 163, 94, 0.22);
  padding-left: 12px;
}
.feed-item {
  font-size: 10px;
  line-height: 1.9;
  color: var(--dim-2);
  letter-spacing: 0.02em;
}

/* ---------- game: topbar ---------- */

.topbar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(260px, 1.5fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: linear-gradient(180deg, rgba(8, 6, 5, 0.94), rgba(8, 6, 5, 0.74));
  border-bottom: 1px solid rgba(201, 163, 94, 0.16);
  backdrop-filter: blur(8px);
}

.round-line { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
#round-kicker { font-size: 10px; letter-spacing: 0.18em; color: var(--dim-2); }
#round-name { font-size: 19px; letter-spacing: 0.22em; color: #f5e8cd; font-weight: 500; }

.phase-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.phase-name { font-size: 14px; letter-spacing: 0.28em; color: var(--gold-2); }
.phase-step { font-size: 10px; letter-spacing: 0.16em; color: var(--dim-2); }

.phase-bar {
  position: relative;
  height: 2px;
  margin: 6px 0 5px;
  background: rgba(201, 163, 94, 0.16);
  overflow: hidden;
}
.phase-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: linear-gradient(90deg, rgba(142, 47, 42, 0.9), var(--gold));
  transition: width 0.4s linear;
}

.phase-desc {
  font-size: 9px;
  color: var(--dim-2);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-right { display: flex; align-items: center; gap: 9px; }

.clock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(201, 163, 94, 0.4);
  border-radius: 50%;
  font-size: 15px;
  color: var(--gold-2);
  background: radial-gradient(circle, rgba(201, 163, 94, 0.1), transparent 70%);
  font-variant-numeric: tabular-nums;
}
.clock.is-low { color: #e3a091; border-color: rgba(192, 90, 78, 0.6); }

.room-code-mini { font-size: 10px; letter-spacing: 0.16em; color: var(--dim); }

.force-btn {
  padding: 6px 9px;
  font-size: 10px;
  color: var(--gold-2);
  background: rgba(201, 163, 94, 0.1);
  border: 1px solid rgba(201, 163, 94, 0.4);
}

/* ---------- game: stage ---------- */

.stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 352px;
  gap: 12px;
  min-height: 0;
  padding: 12px 16px 14px;
  overflow: hidden;
}

.stage-main {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 163, 94, 0.3) transparent;
}

.scene-caption {
  position: relative;
  flex: none;
  padding: 9px 12px 9px 13px;
  border-left: 2px solid rgba(201, 163, 94, 0.45);
  background: linear-gradient(90deg, rgba(6, 5, 4, 0.7), rgba(6, 5, 4, 0));
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85);
}
.scene-caption::after {
  content: "第一视角";
  position: absolute;
  top: 9px;
  right: 0;
  font-size: 8px;
  letter-spacing: 0.3em;
  color: rgba(201, 163, 94, 0.5);
}
.scene-caption .sc-round {
  display: block;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--gold);
}
.scene-caption .sc-line {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: 0.06em;
  color: rgba(246, 234, 209, 0.94);
  animation: pov-in 0.9s ease both;
}
@keyframes pov-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.scene-caption .sc-phase {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: var(--dim-2);
  letter-spacing: 0.04em;
}

.seat-rail {
  flex: none;
  display: grid;
  grid-template-columns: repeat(var(--seat-cols, 6), minmax(0, 1fr));
  gap: 6px;
}

.seat-card {
  position: relative;
  height: 168px;
  padding: 0;
  border: none;
  border-bottom: 1px solid rgba(201, 163, 94, 0.14);
  background: transparent;
  overflow: hidden;
  text-align: left;
  color: var(--paper);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.seat-card .st-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  filter: brightness(0.78) saturate(0.9);
  transition: filter 0.25s ease, transform 0.4s ease;
  -webkit-mask-image: linear-gradient(180deg, #000 58%, rgba(0, 0, 0, 0.5) 82%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 58%, rgba(0, 0, 0, 0.5) 82%, transparent 100%);
}

.seat-card .st-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(8, 6, 5, 0.88) 92%);
}

.seat-card .st-top {
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3px;
}

.seat-card .st-power {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 4px;
  font-size: 9px;
  line-height: 1.2;
  color: var(--gold-2);
  background: rgba(10, 8, 6, 0.72);
  border: 1px solid rgba(201, 163, 94, 0.28);
  font-variant-numeric: tabular-nums;
}
.seat-card .st-hp {
  font-style: normal;
  font-size: 8px;
  letter-spacing: 0.02em;
  color: #9cb784;
}
.seat-card .st-hp.is-hurt { color: #e3a091; }

.seat-card .st-badges { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.seat-card .st-badge {
  padding: 1px 3px;
  font-size: 8px;
  letter-spacing: 0.06em;
  color: #f2e5c6;
  background: rgba(10, 8, 6, 0.74);
  border: 1px solid rgba(201, 163, 94, 0.35);
}
.seat-card .st-badge.b-empress { color: #1a1207; background: linear-gradient(180deg, #e6c887, #b98f45); border-color: #f0dda8; }
.seat-card .st-badge.b-muted { color: #9fc3d6; border-color: rgba(92, 125, 146, 0.6); }
.seat-card .st-badge.b-dismissed { color: #e3a091; border-color: rgba(192, 90, 78, 0.6); }
.seat-card .st-badge.b-pledge { color: #9cb784; border-color: rgba(111, 139, 106, 0.65); }

.seat-card .st-body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 5px 6px 6px;
}
.seat-card .st-title { display: block; font-size: 10px; letter-spacing: 0.06em; color: #f4e8d1; }
.seat-card .st-name {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-card.is-me { border-color: rgba(201, 163, 94, 0.72); box-shadow: inset 0 0 26px rgba(201, 163, 94, 0.16); }
.seat-card.is-me .st-art { filter: brightness(0.78) saturate(0.96); }
.seat-card.is-dead .st-art { filter: grayscale(0.9) brightness(0.34) saturate(0.4); }
.seat-card.is-dead::after {
  content: "出局";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  letter-spacing: 0.3em;
  color: rgba(236, 226, 205, 0.62);
  background: rgba(8, 6, 5, 0.42);
}
.seat-card.is-selectable { cursor: crosshair; border-color: rgba(201, 163, 94, 0.42); }
.seat-card.is-selectable:hover { border-color: var(--gold); }
.seat-card.is-picked { border-color: var(--gold-2); box-shadow: 0 0 0 1px var(--gold-2), inset 0 0 30px rgba(201, 163, 94, 0.22); }
.seat-card.is-submitted .st-power { color: #9cb784; border-color: rgba(111, 139, 106, 0.6); }

.phase-panel {
  flex: none;
  padding: 10px 12px;
  background: var(--panel-soft);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(201, 163, 94, 0.16);
  border-left: 2px solid rgba(201, 163, 94, 0.45);
  font-size: 11px;
  line-height: 1.8;
  color: var(--dim);
}
.phase-panel b { color: var(--gold-2); font-weight: 400; letter-spacing: 0.08em; }
.phase-panel .pp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.phase-panel .pp-count { font-size: 10px; color: var(--dim-2); }

.action-zone {
  flex: none;
  padding: 12px 13px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(201, 163, 94, 0.18);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.2);
}

.act-note { font-size: 10px; line-height: 1.8; color: var(--dim-2); margin-bottom: 9px; }
.act-note b { color: var(--gold-2); font-weight: 400; }

.act-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.act-row:last-child { margin-bottom: 0; }

.act-btn {
  padding: 9px 13px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #f2e6cf;
  background: rgba(16, 12, 9, 0.74);
  border: 1px solid rgba(201, 163, 94, 0.2);
}
.act-btn:hover { border-color: rgba(201, 163, 94, 0.5); }
.act-btn.is-sel {
  border-color: var(--gold);
  background: rgba(201, 163, 94, 0.14);
  box-shadow: inset 0 0 18px rgba(201, 163, 94, 0.1);
}
.act-btn.is-danger { color: #e5b7ac; border-color: rgba(192, 90, 78, 0.5); }
.act-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.act-btn.wide { flex: 1; text-align: center; }

.act-sub { margin-top: 8px; font-size: 10px; color: var(--dim-2); }

.mini-btn {
  padding: 4px 8px;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--gold-2);
  background: rgba(201, 163, 94, 0.1);
  border: 1px solid rgba(201, 163, 94, 0.36);
}
.mini-btn.is-danger {
  color: #e5b7ac;
  border-color: rgba(192, 90, 78, 0.5);
  background: rgba(142, 47, 42, 0.14);
}

.proposal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  margin-bottom: 6px;
  border: 1px solid rgba(201, 163, 94, 0.18);
  background: rgba(9, 7, 5, 0.6);
  font-size: 11px;
}
.proposal .pr-name { color: #f2e6cf; }
.proposal .pr-sub { font-size: 9px; color: var(--dim-2); }
.proposal .pr-btns { display: flex; gap: 5px; flex: none; }

.alliance-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 5px;
  border-left: 2px solid rgba(201, 163, 94, 0.4);
  background: rgba(9, 7, 5, 0.45);
  font-size: 11px;
}

.condemned-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  margin-bottom: 9px;
  border: 1px solid rgba(192, 90, 78, 0.4);
  background: rgba(94, 28, 24, 0.18);
  font-size: 11px;
  color: #e5b7ac;
}
.condemned-box b { font-size: 15px; color: #f3d8cf; font-weight: 400; letter-spacing: 0.12em; }
.condemned-box i {
  margin-left: auto;
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: rgba(229, 183, 172, 0.72);
}

/* ---------- game: side ---------- */

.stage-side {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  min-height: 0;
}

.me-card {
  position: relative;
  flex: none;
  padding: 9px 10px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(201, 163, 94, 0.2);
  overflow: hidden;
}
.me-card .mc-top { display: flex; align-items: center; gap: 9px; }
.me-card .mc-art {
  width: 42px;
  height: 52px;
  flex: none;
  background-size: cover;
  background-position: center 18%;
  border: 1px solid rgba(201, 163, 94, 0.3);
}
.me-card .mc-you {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--gold-2);
  letter-spacing: 0;
  background: radial-gradient(circle at 50% 40%, rgba(201, 163, 94, 0.18), rgba(10, 8, 6, 0.9) 72%);
  box-shadow: inset 0 0 20px rgba(201, 163, 94, 0.16);
}
.me-card .mc-id { min-width: 0; flex: 1; }
.me-card .mc-title { display: block; font-size: 12px; color: #f4e8d1; letter-spacing: 0.08em; }
.me-card .mc-name { display: block; margin-top: 2px; font-size: 9px; color: var(--dim); }
.me-card .mc-power {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 10px;
  line-height: 1.2;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(201, 163, 94, 0.32);
  padding: 3px 6px;
}
.me-card .mc-secret {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(201, 163, 94, 0.14);
  font-size: 10px;
  color: var(--dim-2);
  line-height: 1.7;
}
.me-card .mc-secret b { color: var(--gold-2); font-weight: 400; letter-spacing: 0.1em; }
.me-card .mc-progress { margin-top: 4px; font-size: 9px; color: rgba(236, 226, 205, 0.46); }

.chat-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border: 1px solid rgba(201, 163, 94, 0.18);
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(201, 163, 94, 0.14);
  flex: none;
}
.chat-tab {
  padding: 8px 9px;
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--dim-2);
  font-size: 11px;
  letter-spacing: 0.14em;
}
.chat-tab.is-on { color: var(--gold-2); border-bottom-color: var(--gold); }

.chat-target {
  margin-left: auto;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  color: var(--gold);
  border: 1px solid rgba(201, 163, 94, 0.3);
  padding: 2px 5px;
}

.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 9px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 163, 94, 0.3) transparent;
}

.sys-line {
  margin: 4px 0;
  font-size: 9px;
  line-height: 1.7;
  color: var(--dim-2);
  letter-spacing: 0.02em;
}
.sys-line.k-death { color: #e5b7ac; }
.sys-line.k-wound { color: #d9b892; }
.sys-line.k-night { color: #dcb9a6; }
.sys-line.k-verdict { color: var(--gold-2); }
.sys-line.k-round { color: var(--gold); letter-spacing: 0.08em; margin-top: 9px; }
.sys-line.k-betray { color: #e3a091; }
.sys-line.k-rumor { color: #cbb9a0; }

.msg {
  margin-bottom: 7px;
  padding: 6px 7px;
  background: rgba(236, 226, 205, 0.035);
  border-left: 2px solid rgba(201, 163, 94, 0.18);
}
.msg.is-mine { background: rgba(201, 163, 94, 0.075); border-left-color: rgba(201, 163, 94, 0.55); }
.msg.is-private { border-left-color: rgba(92, 125, 146, 0.7); background: rgba(92, 125, 146, 0.08); }

.msg-head {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  color: var(--dim-2);
  margin-bottom: 3px;
}
.msg-head b { color: var(--gold-2); font-weight: 400; letter-spacing: 0.05em; }
.msg-tag {
  padding: 0 3px;
  border: 1px solid rgba(201, 163, 94, 0.35);
  color: var(--gold-2);
  font-size: 8px;
}
.msg-tag.t-loyal { color: #9cb784; border-color: rgba(111, 139, 106, 0.6); }
.msg-tag.t-impeach { color: #e3a091; border-color: rgba(192, 90, 78, 0.6); }
.msg-tag.t-ally { color: #d9c08a; }
.msg-tag.t-sow { color: #cbb9a0; }
.msg-target { color: var(--dim); }
.msg-time { margin-left: auto; font-size: 8px; color: rgba(236, 226, 205, 0.28); }
.msg p { margin: 0; font-size: 11px; line-height: 1.7; color: rgba(236, 226, 205, 0.82); word-break: break-word; }

.composer {
  flex: none;
  padding: 7px 8px 8px;
  border-top: 1px solid rgba(201, 163, 94, 0.14);
  background: rgba(8, 6, 5, 0.5);
}

.kind-row {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 6px;
  scrollbar-width: none;
}
.kind-row::-webkit-scrollbar { display: none; }

.kind-chip {
  flex: none;
  padding: 3px 7px;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--dim);
  background: rgba(16, 12, 9, 0.7);
  border: 1px solid rgba(201, 163, 94, 0.18);
}
.kind-chip.is-on { color: #1a1207; background: linear-gradient(180deg, #e6c887, #b98f45); border-color: #f0dda8; }

.composer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.composer input { padding: 9px 10px; font-size: 12px; }

.secret-fab {
  display: none;
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 8;
  padding: 10px 14px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #1a1207;
  background: linear-gradient(180deg, #e6c887, #b98f45);
  border: 1px solid #f0dda8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ---------- modals ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 3, 2, 0.74);
  backdrop-filter: blur(4px);
}
.modal.is-on { display: flex; animation: fadeIn 0.25s ease both; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card,
.secret-card,
.player-card,
.open-card {
  position: relative;
  width: min(560px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px 24px 22px;
  background: linear-gradient(180deg, rgba(24, 18, 13, 0.98), rgba(10, 8, 6, 0.99));
  border: 1px solid rgba(201, 163, 94, 0.36);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 163, 94, 0.3) transparent;
}

.modal-card h3 {
  margin: 0 0 14px;
  font-size: 16px;
  letter-spacing: 0.24em;
  color: var(--gold-2);
  font-weight: 500;
}

.modal-x {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--dim);
  font-size: 22px;
  cursor: pointer;
}

.rule-block { margin-bottom: 13px; }
.rule-block b { display: block; font-size: 12px; letter-spacing: 0.12em; color: var(--gold-2); margin-bottom: 4px; font-weight: 400; }
.rule-block p { margin: 0; font-size: 11px; line-height: 1.9; color: var(--dim); }

/* secret card */

.secret-card { width: min(480px, 94vw); }
.secret-card .sk-kicker { font-size: 10px; letter-spacing: 0.3em; color: var(--gold); margin-bottom: 12px; }
.secret-card .sk-role {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.secret-card .sk-seal {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #f6ead1;
  border: 1px solid rgba(201, 163, 94, 0.55);
  background: rgba(142, 47, 42, 0.22);
  flex: none;
}
.secret-card .sk-role b { display: block; font-size: 22px; letter-spacing: 0.18em; color: #f6ead1; font-weight: 500; }
.secret-card .sk-role em { display: block; margin-top: 3px; font-style: normal; font-size: 10px; color: var(--dim); letter-spacing: 0.08em; }
.secret-card .sk-goal {
  padding: 12px 13px;
  background: rgba(201, 163, 94, 0.07);
  border-left: 2px solid rgba(201, 163, 94, 0.5);
  font-size: 12px;
  line-height: 1.9;
  color: rgba(236, 226, 205, 0.85);
}
.secret-card .sk-goal b { display: block; color: var(--gold-2); font-weight: 400; letter-spacing: 0.12em; margin-bottom: 4px; }
.secret-card .sk-progress { margin-top: 10px; font-size: 10px; color: var(--dim-2); }
.secret-card .sk-targets { margin-top: 10px; font-size: 11px; color: #e3a091; line-height: 1.8; }
.secret-card .sk-options { margin-top: 12px; border-top: 1px solid rgba(201, 163, 94, 0.16); padding-top: 10px; }
.secret-card .sk-opt { font-size: 10px; line-height: 1.8; color: var(--dim-2); }
.secret-card .sk-opt.is-pick { color: var(--gold-2); }
.secret-card .sk-foot { margin-top: 14px; font-size: 10px; color: var(--dim-2); line-height: 1.8; }

/* opening */

.open-card { width: min(620px, 95vw); text-align: center; padding: 30px 28px 26px; }
.open-kicker { font-size: 10px; letter-spacing: 0.4em; color: var(--gold); }
.open-poem {
  margin: 18px auto 16px;
  max-width: 460px;
  font-size: 13px;
  line-height: 2.2;
  letter-spacing: 0.12em;
  color: rgba(246, 234, 209, 0.88);
}
.open-empress {
  margin: 18px auto;
  padding: 14px;
  border-top: 1px solid rgba(201, 163, 94, 0.2);
  border-bottom: 1px solid rgba(201, 163, 94, 0.2);
}
.open-empress .oe-art {
  width: 92px;
  height: 120px;
  margin: 0 auto 10px;
  background-size: cover;
  background-position: center 16%;
  border: 1px solid rgba(201, 163, 94, 0.5);
  box-shadow: 0 0 40px rgba(201, 163, 94, 0.15);
}
.open-empress .oe-kicker { font-size: 9px; letter-spacing: 0.3em; color: var(--gold); }
.open-empress .oe-name { display: block; margin-top: 6px; font-size: 22px; letter-spacing: 0.2em; color: #f6ead1; }
.open-empress .oe-sub { display: block; margin-top: 4px; font-size: 10px; color: var(--dim); }
.open-card .primary { max-width: 300px; margin: 0 auto; }

/* player sheet */

.player-card { width: min(460px, 94vw); }
.player-card .pc-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.player-card .pc-art {
  width: 74px;
  height: 96px;
  background-size: cover;
  background-position: center 18%;
  border: 1px solid rgba(201, 163, 94, 0.4);
  flex: none;
}
.player-card .pc-id b { display: block; font-size: 18px; letter-spacing: 0.12em; color: #f6ead1; font-weight: 500; }
.player-card .pc-id span { display: block; margin-top: 3px; font-size: 10px; color: var(--dim); }
.player-card .pc-meta { font-size: 11px; line-height: 1.9; color: var(--dim); margin-bottom: 10px; }
.player-card .pc-meta b { color: var(--gold-2); font-weight: 400; }
.player-card .pc-act { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }

/* toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 60;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  padding: 9px 15px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #f3e7d0;
  background: rgba(10, 8, 6, 0.94);
  border: 1px solid rgba(201, 163, 94, 0.4);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- report ---------- */

.report {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  height: 100%;
  overflow-y: auto;
  padding: 38px 24px 60px;
  text-align: center;
}

.report h1 {
  margin: 10px 0 6px;
  font-size: 36px;
  letter-spacing: 0.16em;
  font-weight: 500;
  color: #f6ead1;
  text-shadow: 0 0 40px rgba(201, 163, 94, 0.3);
}
.rep-text { margin: 0 auto 10px; max-width: 560px; font-size: 12px; line-height: 1.9; color: var(--dim); }

.rep-award {
  display: inline-block;
  margin: 4px auto 12px;
  padding: 8px 20px;
  font-size: 14px;
  letter-spacing: 0.2em;
  color: #1a1207;
  background: linear-gradient(180deg, #e6c887, #b98f45);
  border: 1px solid #f0dda8;
  box-shadow: 0 10px 30px rgba(201, 163, 94, 0.18);
}
.rep-comment {
  max-width: 600px;
  margin: 0 auto 18px;
  font-size: 11px;
  line-height: 1.9;
  color: var(--gold-2);
  letter-spacing: 0.04em;
}

.rep-winners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
.rep-winner {
  padding: 7px 12px;
  font-size: 11px;
  color: #1a1207;
  background: linear-gradient(180deg, #e6c887, #b98f45);
  border: 1px solid #f0dda8;
}

.rep-players {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 24px;
  text-align: left;
}
.rep-player {
  display: flex;
  gap: 9px;
  padding: 8px;
  border: 1px solid rgba(201, 163, 94, 0.16);
  background: rgba(9, 7, 5, 0.6);
}
.rep-player .rp-art {
  width: 46px;
  height: 60px;
  flex: none;
  background-size: cover;
  background-position: center 18%;
  border: 1px solid rgba(201, 163, 94, 0.26);
}
.rep-player .rp-body { min-width: 0; flex: 1; }
.rep-player .rp-name { font-size: 11px; color: #f2e6cf; }
.rep-player .rp-role { font-size: 10px; color: var(--gold-2); margin-top: 2px; }
.rep-player .rp-goal { font-size: 9px; line-height: 1.7; color: var(--dim-2); margin-top: 3px; }
.rep-player .rp-tags { font-size: 9px; color: var(--dim); margin-top: 3px; }
.rep-player .rp-tags .done { color: #9cb784; }
.rep-player .rp-tags .dead { color: #e3a091; }

.rep-rounds {
  display: grid;
  gap: 5px;
  margin: 10px 0 26px;
  text-align: left;
}
.rep-round {
  padding: 7px 10px;
  border-left: 2px solid rgba(201, 163, 94, 0.3);
  background: rgba(9, 7, 5, 0.5);
  font-size: 10px;
  line-height: 1.7;
  color: var(--dim);
}
.rep-round b { color: var(--gold-2); font-weight: 400; }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: max-content;
    overflow-y: auto;
  }
  .stage-main { overflow: visible; }
  .stage-side { min-height: 380px; }
  .chat-box { min-height: 300px; }
  .secret-fab { position: fixed; right: 14px; bottom: 16px; }
  .speaker-layer {
    right: 6px;
    bottom: 34%;
    width: 182px;
    height: 300px;
  }
  .speaker-layer .sp-line { display: none; }
  .speaker-layer .sp-name { font-size: 16px; }
  .speaker-layer .sp-plate { bottom: 4%; }
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 7px;
    padding: 8px 11px;
  }
  .top-mid { grid-column: 1 / -1; grid-row: 2; }
  .phase-desc { display: none; }
  .room-code-mini { display: none; }
  #round-name { font-size: 16px; }

  .stage { padding: 9px 10px 104px; gap: 8px; }
  .seat-rail {
    display: flex;
    overflow-x: auto;
    gap: 5px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .seat-rail::-webkit-scrollbar { display: none; }
  .seat-card { flex: 0 0 96px; height: 136px; }
  .scene-caption .sc-line { font-size: 12px; }
  .scene-caption::after { display: none; }
  #screen-game.is-speaking .scene-caption { opacity: 0; }
  .scene-caption { transition: opacity 0.25s ease; }
  .speaker-layer {
    left: 10px;
    right: 10px;
    top: 92px;
    bottom: auto;
    width: auto;
    height: 76px;
    padding: 5px 9px 5px 68px;
    background: linear-gradient(90deg, #0a0806 0%, #13100b 100%);
    border: 1px solid rgba(201, 163, 94, 0.3);
    border-left: 2px solid rgba(201, 163, 94, 0.7);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  }
  .speaker-layer .sp-art {
    inset: 5px auto 5px 5px;
    width: 56px;
    height: auto;
    background-position: center 16%;
    border: 1px solid rgba(201, 163, 94, 0.3);
    filter: brightness(0.98);
    mix-blend-mode: normal;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .speaker-layer .sp-shade { display: none; }
  .speaker-layer .sp-plate {
    position: static;
    padding: 0;
    bottom: auto;
  }
  .speaker-layer .sp-tag { margin-bottom: 1px; font-size: 8px; padding: 0 4px; }
  .speaker-layer .sp-name { display: inline; font-size: 13px; letter-spacing: 0.1em; }
  .speaker-layer .sp-seat { display: inline; margin-left: 6px; font-size: 9px; letter-spacing: 0.1em; }
  .speaker-layer .sp-line {
    display: block;
    margin-top: 2px;
    max-width: none;
    font-size: 10px;
    line-height: 1.5;
    max-height: 30px;
    overflow: hidden;
  }
  .stage-side { min-height: 0; }
  .me-card { display: none; }
  .chat-box { flex: none; height: 232px; min-height: 0; }
  .chat-log { flex: 1; min-height: 0; padding-bottom: 4px; }
  .composer {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 8px;
    z-index: 30;
    padding: 7px 8px 8px;
    background: rgba(8, 6, 5, 0.97);
    border: 1px solid rgba(201, 163, 94, 0.34);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.65);
  }

  .lobby { padding: 30px 18px 50px; }
  .brand h1 { font-size: 40px; }
  .room { padding: 24px 14px 50px; }
  .room-code { font-size: 34px; }
  .seat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-seat { min-height: 160px; }
  .report { padding: 28px 14px 50px; }
  .report h1 { font-size: 27px; }
  .rep-players { grid-template-columns: 1fr; }
  .modal-card, .secret-card, .player-card, .open-card { padding: 20px 17px; }
}

@media (max-width: 420px) {
  .seat-card { flex-basis: 90px; height: 130px; }
  .secret-fab { padding: 8px 11px; font-size: 10px; }
  .report h1 { font-size: 24px; }
}

/* ================= 第一视角全屏 UI（覆盖旧布局） ================= */

#screen-game.is-active { display: block; }

#screen-game .topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 30;
  background: linear-gradient(180deg, rgba(5, 4, 3, 0.78), rgba(5, 4, 3, 0));
  border-bottom: none;
  backdrop-filter: none;
}

#screen-game .stage {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0;
  overflow: hidden;
}

#screen-game .stage-main {
  position: absolute;
  inset: 0;
  display: block;
  overflow: visible;
}

/* 你的所见：左上角第一视角文字 */
#screen-game .scene-caption {
  position: absolute;
  top: 96px;
  left: 24px;
  z-index: 8;
  max-width: min(430px, 58vw);
  padding: 12px 16px;
  border-left: 2px solid rgba(201, 163, 94, 0.55);
  background: linear-gradient(90deg, rgba(6, 5, 4, 0.66), rgba(6, 5, 4, 0));
}

/* 站在你面前的人 */
#screen-game .seat-rail {
  position: absolute;
  left: 0; right: 0;
  bottom: 208px;
  z-index: 7;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(4px, 1.6vw, 34px);
  padding: 0 10px;
  border: none;
  background: none;
  overflow: visible;
  pointer-events: none;
}

#screen-game .seat-card {
  position: relative;
  flex: none;
  width: clamp(96px, 11.5vw, 164px);
  height: clamp(210px, 33vh, 330px);
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
  pointer-events: auto;
  cursor: pointer;
}

#screen-game .seat-card .st-art {
  position: absolute;
  left: 0; right: 0; bottom: 30px;
  height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center bottom;
  -webkit-mask-image: linear-gradient(180deg, #000 76%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 76%, transparent 100%);
  filter: brightness(0.95) contrast(1.05) drop-shadow(0 16px 22px rgba(0, 0, 0, 0.62));
  transition: filter 0.25s ease, transform 0.25s ease;
}

#screen-game .seat-card:hover .st-art { filter: brightness(1.08) contrast(1.06) drop-shadow(0 16px 26px rgba(0, 0, 0, 0.7)); }

#screen-game .seat-card.is-empress {
  width: clamp(120px, 14vw, 196px);
  height: clamp(240px, 39vh, 380px);
}

#screen-game .seat-card.is-empress .st-art {
  filter: brightness(1.02) contrast(1.06) drop-shadow(0 0 26px rgba(201, 163, 94, 0.28)) drop-shadow(0 16px 24px rgba(0, 0, 0, 0.66));
}

/* 你自己不在你的视野里 */
#screen-game .seat-card.is-me { display: none; }
#screen-game .seat-card .st-shade { display: none; }
#screen-game .seat-card .st-top {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  text-align: center;
  z-index: 2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

#screen-game .seat-card .st-body {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  text-align: center;
  padding: 3px 10px 4px;
  background: rgba(8, 6, 5, 0.74);
  border: 1px solid rgba(201, 163, 94, 0.26);
  border-radius: 2px;
}

#screen-game .seat-card .st-title { font-size: 10px; letter-spacing: 0.12em; color: var(--gold-2); }
#screen-game .seat-card .st-name { font-size: 12px; color: var(--paper); }
#screen-game .seat-card .st-power { font-size: 10px; }

#screen-game .seat-card.is-dead .st-art { filter: grayscale(1) brightness(0.38); }
#screen-game .seat-card.is-dead { opacity: 0.62; }

#screen-game .seat-card.is-picked .st-art {
  filter: brightness(1.14) drop-shadow(0 0 20px rgba(192, 90, 78, 0.85));
}

/* 你面前的御阶与案几 */
#screen-game .stage-main::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 250px;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 3, 2, 0), rgba(4, 3, 2, 0.82) 58%, rgba(3, 2, 2, 0.96));
}

#screen-game .phase-panel {
  position: absolute;
  left: 50%;
  bottom: 158px;
  transform: translateX(-50%);
  z-index: 9;
  width: min(760px, 92vw);
  text-align: center;
  background: none;
  border: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

#screen-game .action-zone {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 9;
  width: min(820px, 94vw);
  max-height: 140px;
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: 4px;
}

#screen-game .me-card {
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 10;
  width: 212px;
  cursor: pointer;
}

/* 对话收成一只抽屉，不再常驻 */
#screen-game .stage-side {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  z-index: 40;
  width: 360px;
  min-height: 0;
  transform: translateX(105%);
  transition: transform 0.35s ease;
  pointer-events: none;
}

#screen-game .stage-side.is-open { transform: none; pointer-events: auto; }

#screen-game .stage-side .chat-box {
  height: 100%;
  border-radius: 0;
  border-right: none;
  background: linear-gradient(180deg, rgba(12, 9, 6, 0.95), rgba(6, 5, 4, 0.97));
  backdrop-filter: blur(10px);
}

#screen-game .stage-side .chat-log { flex: 1 1 auto; height: auto; }
#screen-game .stage-side .composer { position: static; }

.chat-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

#btn-chat { position: relative; }
.chat-dot {
  position: absolute;
  top: -3px; right: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #c05a4e;
  box-shadow: 0 0 8px rgba(192, 90, 78, 0.9);
}

@media (max-width: 720px) {
  #screen-game .scene-caption {
    top: 84px;
    left: 12px;
    right: 12px;
    max-width: none;
    padding: 8px 10px;
  }

  #screen-game .seat-rail {
    bottom: 286px;
    gap: 2px;
    padding: 0 4px;
  }

  #screen-game .seat-card { width: 74px; height: 168px; }
  #screen-game .seat-card.is-empress { width: 88px; height: 196px; }
  #screen-game .seat-card .st-body { padding: 2px 6px 3px; bottom: -4px; }
  #screen-game .seat-card .st-title { font-size: 9px; }
  #screen-game .seat-card .st-name { font-size: 10px; }
  #screen-game .seat-card .st-power { font-size: 9px; }

  #screen-game .me-card { display: none; }

  #screen-game .phase-panel { bottom: 236px; width: 96vw; font-size: 11px; }

  #screen-game .action-zone {
    bottom: 6px;
    width: 98vw;
    max-height: 224px;
    padding: 8px;
  }

  #screen-game .stage-side {
    top: auto;
    left: 0; right: 0; bottom: 0;
    width: auto;
    height: 74vh;
    transform: translateY(105%);
  }

  #screen-game .stage-side.is-open { transform: none; }
  #screen-game .stage-side .composer { position: static; }
}

/* ================= 沉浸感加强：面对面 + 站立呼吸 ================= */

@keyframes povBreathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

#screen-game .seat-card .st-art { animation: povBreathe 6.5s ease-in-out infinite; }
#screen-game .seat-card:nth-child(2n) .st-art { animation-delay: 1.4s; }
#screen-game .seat-card:nth-child(3n) .st-art { animation-delay: 2.6s; }

#screen-game .seat-card::after {
  content: "";
  position: absolute;
  left: 6%; right: 6%;
  bottom: 24px;
  height: 18px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.68), transparent 72%);
  pointer-events: none;
}

/* 点一个人，他站到你面前 */
#modal-player {
  background: rgba(4, 3, 2, 0.7);
  backdrop-filter: blur(7px);
}

#modal-player .player-card {
  position: relative;
  width: min(880px, 94vw);
  min-height: min(540px, 82vh);
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(16, 12, 8, 0.55), rgba(8, 6, 4, 0.95));
  border: 1px solid rgba(201, 163, 94, 0.3);
}

#modal-player .pc-head { position: absolute; inset: 0; pointer-events: none; }

#modal-player .pc-art {
  position: absolute;
  left: 0; bottom: 0;
  width: 56%;
  height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left bottom;
  -webkit-mask-image: linear-gradient(90deg, #000 72%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 72%, transparent 100%);
  filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.62));
}

#modal-player .pc-id {
  position: absolute;
  left: 26px;
  top: 24px;
  display: block;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

#modal-player .pc-id b { display: block; font-size: 26px; letter-spacing: 0.14em; color: #f6ead1; }
#modal-player .pc-id span { display: block; margin-top: 6px; font-size: 12px; color: var(--gold-2); letter-spacing: 0.12em; }

#modal-player .pc-meta,
#modal-player .player-card > .act-sub,
#modal-player .pc-act,
#modal-player .player-card > .act-row {
  position: relative;
  margin-left: 54%;
  padding-left: 20px;
  padding-right: 22px;
}

#modal-player .pc-meta { padding-top: 26px; font-size: 13px; line-height: 2; }
#modal-player .player-card > .act-sub { padding-top: 12px; font-size: 11px; }
#modal-player .pc-act { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding-top: 16px; }
#modal-player .player-card > .act-row { padding-top: 14px; padding-bottom: 20px; }

@media (max-width: 720px) {
  #screen-game .seat-rail { bottom: 262px; gap: 4px; }
  #screen-game .seat-card { width: 84px; height: 198px; }
  #screen-game .seat-card.is-empress { width: 100px; height: 232px; }

  #modal-player .player-card { min-height: 0; max-height: 88vh; overflow-y: auto; }
  #modal-player .pc-head { position: relative; height: 250px; }
  #modal-player .pc-art {
    width: 100%;
    height: 100%;
    background-position: center bottom;
    -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 62%, transparent 100%);
  }
  #modal-player .pc-id { left: 18px; top: 16px; }
  #modal-player .pc-id b { font-size: 21px; }
  #modal-player .pc-meta,
  #modal-player .player-card > .act-sub,
  #modal-player .pc-act,
  #modal-player .player-card > .act-row { margin-left: 0; }
  #modal-player .pc-meta { padding-top: 4px; }
}

/* ================= 引导、实时反馈与联机状态 ================= */

.field small { color: var(--dim-2); font-size: 9px; font-weight: 400; letter-spacing: 0; }
.room-actions .ghost { margin: 8px auto 0; }
#room-lock { color: var(--gold-2); }

.game-fabs {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 22;
  display: flex;
  align-items: center;
  gap: 8px;
}
.game-fabs .secret-fab { position: static; }
.talk-fab {
  border: 1px solid rgba(238, 202, 126, 0.72);
  padding: 11px 18px;
  color: #201308;
  background: linear-gradient(180deg, #e3c37e, #a77a35);
  box-shadow: 0 8px 28px rgba(201, 163, 94, 0.24);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.12em;
  cursor: pointer;
}
.talk-fab:active { transform: translateY(1px); }
#btn-sound.is-off { opacity: 0.48; }

.phase-cue {
  position: absolute;
  left: 50%;
  top: 43%;
  z-index: 45;
  width: min(440px, 88vw);
  padding: 22px 26px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -46%) scale(0.96);
  color: #f6ead1;
  background: linear-gradient(90deg, transparent, rgba(8, 6, 4, 0.93) 18%, rgba(8, 6, 4, 0.93) 82%, transparent);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.phase-cue.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.phase-cue span { display: block; color: var(--gold); font-size: 10px; letter-spacing: 0.3em; }
.phase-cue b { display: block; margin: 9px 0 7px; font-size: 29px; font-weight: 500; letter-spacing: 0.24em; }
.phase-cue p { margin: 0; color: var(--dim); font-size: 11px; line-height: 1.8; }

.fx-hurt {
  position: absolute;
  inset: 0;
  z-index: 44;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 36%, rgba(128, 12, 9, 0.68) 100%);
  transition: opacity 0.16s ease;
}
.fx-hurt.is-on { opacity: 1; }
@keyframes cameraShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-7px, 2px); }
  40% { transform: translate(6px, -2px); }
  60% { transform: translate(-4px, 1px); }
  80% { transform: translate(3px, 0); }
}
@keyframes hurtZoom {
  0% { transform: scale(1); filter: none; }
  28% { transform: scale(1.025); filter: saturate(0.65); }
  100% { transform: scale(1); filter: none; }
}
#screen-game.fx-shake .stage-main { animation: cameraShake 0.42s linear; }
#screen-game.fx-hit .stage-main { animation: hurtZoom 0.7s ease-out; }

.connection-bar {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 200;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: 92vw;
  padding: 9px 12px;
  color: #f1d6c7;
  background: rgba(69, 23, 19, 0.96);
  border: 1px solid rgba(221, 137, 117, 0.55);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  font-size: 11px;
}
.connection-bar[hidden] { display: none; }
.connection-bar button { border: 1px solid rgba(241, 214, 199, 0.45); color: inherit; background: none; padding: 4px 8px; cursor: pointer; }

.guide-card { width: min(480px, 92vw); }
.guide-card h3 { margin-top: 12px; }
.guide-card > p { min-height: 78px; margin: 0; color: var(--dim); font-size: 13px; line-height: 2; }
.guide-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; }
.guide-actions .primary { width: auto; min-width: 150px; margin: 0; }

.msg.is-ghost { border-color: rgba(157, 137, 181, 0.32); background: rgba(61, 48, 73, 0.2); }
.msg.is-ghost .msg-head b, .msg-tag.t-ghost { color: #c0afd2; }
.kind-chip:disabled, .chat-tab:disabled { opacity: 0.28; cursor: not-allowed; }

.rep-chronicle {
  max-height: 520px;
  overflow-y: auto;
  margin: 10px 0 28px;
  padding: 4px 12px;
  text-align: left;
  background: rgba(8, 6, 4, 0.48);
  border-top: 1px solid rgba(201, 163, 94, 0.2);
  border-bottom: 1px solid rgba(201, 163, 94, 0.2);
}
.rep-event { display: grid; grid-template-columns: 58px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(201, 163, 94, 0.09); }
.rep-event:last-child { border-bottom: none; }
.rep-event > span { color: var(--gold); font-size: 9px; letter-spacing: 0.08em; padding-top: 2px; }
.rep-event p { margin: 0; color: var(--dim); font-size: 11px; line-height: 1.75; }
.rep-event.k-speech p { color: rgba(237, 226, 205, 0.9); }
.rep-event.k-death p, .rep-event.k-wound p { color: #dda292; }

@media (max-width: 720px) {
  .game-fabs { position: fixed; right: 8px; bottom: 236px; gap: 5px; }
  .talk-fab { padding: 9px 11px; font-size: 10px; }
  .game-fabs .secret-fab { padding: 8px 9px; }
  .phase-cue { top: 42%; padding: 18px 14px; }
  .phase-cue b { font-size: 23px; }
  .connection-bar { top: 6px; font-size: 10px; gap: 7px; }
  .guide-card > p { font-size: 12px; }
  .rep-event { grid-template-columns: 48px 1fr; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .phase-cue, .fx-hurt { transition: none; }
  #screen-game.fx-shake .stage-main, #screen-game.fx-hit .stage-main { animation: none; }
}
