/* ============ 阿瓦隆 · 烛光圆桌 ============ */
:root {
  --page: #121411;
  --paper: #1d201a;
  --paper-2: #262a20;
  --paper-3: #2f3427;
  --edge: #3e4031;
  --edge-soft: rgba(240, 203, 132, .14);
  --line: rgba(240, 203, 132, .22);
  --ink: #f2eddf;
  --muted: #c1bbac;
  --faint: #8f8a7a;
  --gold: #f0cb84;
  --gold-hi: #ffe6ad;
  --darkgold: #b18a51;
  --good: #a8d2b2;
  --good-hi: #c8e8d0;
  --good-deep: #3f6b4a;
  --evil: #f2b5ad;
  --evil-hi: #ffd0c8;
  --evil-deep: #8a3a32;
  --amber: #e0a23c;
  --teal: #7fc8b8;
  --violet: #c0a8e8;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --serif-cn: "Noto Serif SC", "Songti SC", "STSong", SimSun, serif;
  --serif-latin: "Cinzel", "Noto Serif SC", serif;
  --sans: system-ui, -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--serif-cn);
  background: var(--page);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(240, 203, 132, .35); color: #fff8e6; }

/* 自定义滚动条（烛光语言） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #15170f; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6b5326, #3a2f16);
  border-radius: 6px; border: 2px solid #15170f;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--darkgold), #6b5326); }
* { scrollbar-width: thin; scrollbar-color: #6b5326 #15170f; }

svg { width: 1em; height: 1em; display: inline-block; vertical-align: -.14em; fill: none; }
use { pointer-events: none; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
b { font-weight: 700; }
.t-good { color: var(--good-hi); }
.t-evil { color: var(--evil-hi); }

/* ============ 烛光夜幕背景 ============ */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; background:
  radial-gradient(1100px 640px at 72% -12%, #2a2413 0%, transparent 60%),
  radial-gradient(900px 600px at 6% 110%, #241a12 0%, transparent 55%),
  linear-gradient(180deg, #14160f 0%, #121411 45%, #0e100c 100%);
}
.glow { position: absolute; border-radius: 50%; filter: blur(95px); opacity: .3; mix-blend-mode: screen; }
.g1 { width: 55vw; height: 44vh; left: -12vw; top: -12vh; background: radial-gradient(circle, #b18a51, transparent 70%); animation: drift1 28s ease-in-out infinite alternate; }
.g2 { width: 46vw; height: 40vh; right: -10vw; top: 14vh; background: radial-gradient(circle, #7a5a22, transparent 70%); animation: drift2 34s ease-in-out infinite alternate; }
.g3 { width: 52vw; height: 46vh; left: 22vw; bottom: -20vh; background: radial-gradient(circle, #5c2a22, transparent 70%); animation: drift3 40s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(9vw, 7vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-8vw, 9vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(-6vw, -7vh) scale(1.12); } }
.grain { position: absolute; inset: 0; opacity: .05; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E"); }
.vignette { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, .5) 100%); }
#embers { position: absolute; inset: 0; }
.ember { position: absolute; bottom: -12px; border-radius: 50%; pointer-events: none; animation: rise linear infinite; }
@keyframes rise {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  8% { opacity: var(--o); }
  85% { opacity: var(--o); }
  100% { transform: translate(var(--dx), -108vh) scale(.35); opacity: 0; }
}

/* ============ 顶栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px clamp(14px, 3.5vw, 34px);
  background: linear-gradient(180deg, rgba(16, 18, 13, .94), rgba(16, 18, 13, .8));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 30px; height: 30px; color: var(--gold-hi); filter: drop-shadow(0 0 9px rgba(240, 203, 132, .55)); animation: flicker 4s ease-in-out infinite; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-latin { font-family: var(--serif-latin); font-weight: 900; letter-spacing: .3em; font-size: 15px; color: var(--gold-hi); }
.brand-cn { font-size: 11px; color: var(--muted); letter-spacing: .18em; }
.topbar-right { display: flex; align-items: center; gap: 9px; }
.conn-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px;
  font-size: 11.5px; letter-spacing: .14em; border: 1px solid var(--edge-soft);
  background: rgba(14, 16, 12, .6); color: var(--muted); white-space: nowrap; font-family: var(--sans);
}
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.conn-pill.online { color: var(--teal); border-color: rgba(127, 200, 184, .4); }
.conn-pill.online .conn-dot { background: var(--teal); box-shadow: 0 0 8px rgba(127, 200, 184, .9); }
.conn-pill.connecting { color: var(--amber); border-color: rgba(224, 162, 60, .4); }
.conn-pill.connecting .conn-dot { background: var(--amber); animation: dot-b 1s infinite; }
.conn-pill.down { color: var(--evil-hi); border-color: rgba(242, 181, 173, .5); }
.conn-pill.down .conn-dot { background: var(--evil-hi); animation: pulse-evil 1s infinite; }
.file-notice {
  border: 1px solid rgba(224, 162, 60, .55); border-radius: 16px; padding: 18px 22px; margin-bottom: 20px;
  background: linear-gradient(165deg, rgba(224, 162, 60, .14), rgba(20, 22, 16, .85));
  color: var(--ink); font-size: 14px; line-height: 1.9; animation: screen-in .4s ease both;
}
.file-notice b { color: var(--amber); font-size: 15px; letter-spacing: .06em; }
.file-notice code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: rgba(14, 16, 12, .8); border: 1px solid var(--edge-soft); padding: 2px 7px; border-radius: 6px; color: var(--gold-hi); }
.conn-hint { color: var(--amber) !important; }
.conn-hint code { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--gold-hi); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(29, 32, 26, .7); color: var(--gold); font-size: 17px;
  display: grid; place-items: center; transition: all .18s;
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold-hi); box-shadow: 0 0 14px rgba(240, 203, 132, .25); transform: translateY(-1px); }
.icon-btn.muted { color: var(--faint); }
.icon-btn.danger-armed { border-color: var(--evil); color: var(--evil-hi); animation: pulse-evil 1s infinite; }
.room-chip {
  display: flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(29, 32, 26, .7); color: var(--gold-hi);
  font-family: var(--serif-latin); font-weight: 700; letter-spacing: .22em; font-size: 14px; transition: all .18s;
}
.room-chip:hover { border-color: var(--gold); box-shadow: 0 0 14px rgba(240, 203, 132, .3); }
.room-chip svg { color: var(--muted); }

/* ============ 通用 ============ */
#app { max-width: 1240px; margin: 0 auto; padding: clamp(16px, 3vw, 34px) clamp(14px, 3.5vw, 34px) 60px; }
.screen { animation: screen-in .5s ease both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.eyebrow { font-size: 12px; letter-spacing: .34em; color: var(--gold); text-transform: uppercase; margin-bottom: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 700;
  font-size: 15px; padding: 11px 20px; letter-spacing: .06em; transition: all .18s; position: relative;
  font-family: var(--serif-cn);
}
.btn:active { transform: scale(.97); }
.btn-gold {
  background: linear-gradient(160deg, #ffe6ad 0%, #f0cb84 52%, #b18a51 100%);
  color: #2a2008; border-color: #ffe6ad;
  box-shadow: 0 6px 22px rgba(240, 203, 132, .3), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn-gold:hover { box-shadow: 0 8px 30px rgba(255, 230, 173, .5), inset 0 1px 0 rgba(255, 255, 255, .6); transform: translateY(-2px); }
.btn-gold:disabled { filter: grayscale(.75) brightness(.6); cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: rgba(29, 32, 26, .6); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-hi); }
.btn-good { background: radial-gradient(120% 90% at 50% 0%, rgba(124, 185, 138, .5), transparent 60%), linear-gradient(160deg, #3f6b4a, #243f2c); color: #eafff0; border-color: #a8d2b2; box-shadow: 0 8px 26px rgba(63, 107, 74, .45), inset 0 0 24px rgba(168, 210, 178, .15); }
.btn-good:hover { box-shadow: 0 12px 34px rgba(168, 210, 178, .5), inset 0 0 30px rgba(168, 210, 178, .22); transform: translateY(-2px); }
.btn-evil { background: radial-gradient(120% 90% at 50% 0%, rgba(217, 138, 128, .5), transparent 60%), linear-gradient(160deg, #8a3a32, #43170f); color: #fff0ec; border-color: #f2b5ad; box-shadow: 0 8px 26px rgba(138, 58, 50, .45), inset 0 0 24px rgba(242, 181, 173, .15); }
.btn-evil:hover { box-shadow: 0 12px 34px rgba(242, 181, 173, .5), inset 0 0 30px rgba(242, 181, 173, .22); transform: translateY(-2px); }
.btn-big { padding: 14px 26px; font-size: 16px; width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

.text-input {
  width: 100%; padding: 12px 15px; border-radius: 12px; font-size: 15px;
  background: rgba(14, 16, 12, .75); border: 1px solid var(--edge-soft); color: var(--ink);
  outline: none; transition: all .18s; letter-spacing: .04em; font-family: var(--sans);
}
.text-input::placeholder { color: var(--faint); }
.text-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240, 203, 132, .15); }
.field-label { display: block; font-size: 12px; letter-spacing: .26em; color: var(--gold); margin-bottom: 8px; }

.panel {
  background: linear-gradient(170deg, rgba(38, 42, 32, .9), rgba(24, 27, 20, .94));
  border: 1px solid var(--line); border-radius: 18px; padding: 22px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.panel::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .5;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h3 { font-size: 16px; letter-spacing: .14em; color: var(--gold-hi); display: flex; align-items: center; gap: 8px; }
.panel-head h3 svg { color: var(--gold); }

/* ============ 首页 ============ */
.hero { text-align: center; padding: clamp(14px, 3vh, 34px) 0 26px; }
.hero-table { width: clamp(180px, 30vw, 300px); margin: 0 auto 14px; animation: emblem-in 1s ease both; }
.table-svg { width: 100%; height: auto; filter: drop-shadow(0 10px 30px rgba(240, 203, 132, .22)); }
.tbl-candle { animation: flicker 3.2s ease-in-out infinite; transform-origin: 110px 76px; }
.tbl-seats circle { animation: seat-glow 4s ease-in-out infinite; }
.tbl-seats circle:nth-child(2n) { animation-delay: 1.2s; }
.tbl-seats circle:nth-child(3n) { animation-delay: 2.1s; }
@keyframes seat-glow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes flicker { 0%, 100% { opacity: 1; filter: brightness(1); } 42% { opacity: .92; filter: brightness(1.12); } 58% { opacity: .97; filter: brightness(.95); } 74% { opacity: .9; filter: brightness(1.08); } }
@keyframes emblem-in { from { opacity: 0; transform: scale(.8) translateY(10px); } to { opacity: 1; transform: none; } }
.hero-title { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.hero-title .latin { font-family: var(--serif-latin); font-size: clamp(13px, 1.8vw, 17px); letter-spacing: .58em; color: var(--muted); font-weight: 500; text-indent: .58em; }
.hero-title .cn {
  font-size: clamp(46px, 8vw, 84px); font-weight: 900; letter-spacing: .16em; text-indent: .16em; line-height: 1.15;
  background: linear-gradient(175deg, #fff8e6 15%, #f0cb84 45%, #b18a51 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 22px rgba(240, 203, 132, .3));
}
.hero-sub { margin-top: 14px; color: var(--muted); font-size: clamp(14px, 1.7vw, 17px); line-height: 1.9; letter-spacing: .08em; }
.hero-meta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.hero-meta span {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--edge-soft); padding: 7px 14px; border-radius: 999px; background: rgba(24, 27, 20, .6); letter-spacing: .08em; font-family: var(--sans);
}
.hero-meta svg { color: var(--gold); }

.gate { display: grid; grid-template-columns: minmax(300px, 430px) 1fr; gap: 22px; align-items: start; margin-top: 8px; }
.gate-card {
  background: linear-gradient(170deg, rgba(38, 42, 32, .94), rgba(20, 22, 16, .96));
  border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden;
}
.gate-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold-hi), transparent); }
.gate-divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; letter-spacing: .2em; }
.gate-divider::before, .gate-divider::after { content: ""; flex: 1; height: 1px; background: var(--edge-soft); }
.join-row { display: flex; gap: 10px; }
.code-input { text-transform: uppercase; font-family: var(--serif-latin); letter-spacing: .4em; font-weight: 700; text-align: center; font-size: 18px; }
.join-row .btn { flex-shrink: 0; width: auto; padding-inline: 26px; }
.gate-hint { font-size: 12px; color: var(--faint); line-height: 1.8; font-family: var(--sans); }

.lore-card {
  border: 1px solid var(--edge-soft); border-radius: 20px; padding: 26px;
  background:
    radial-gradient(400px 200px at 100% 0%, rgba(138, 58, 50, .16), transparent 65%),
    radial-gradient(400px 220px at 0% 100%, rgba(63, 107, 74, .16), transparent 65%),
    rgba(20, 22, 16, .8);
}
.lore-title { font-size: 17px; letter-spacing: .22em; color: var(--gold-hi); margin-bottom: 16px; }
.lore-list { list-style: none; display: flex; flex-direction: column; gap: 13px; }
.lore-list li { position: relative; padding-left: 22px; font-size: 14px; line-height: 1.85; color: var(--muted); }
.lore-list li::before { content: "✦"; position: absolute; left: 0; color: var(--gold); font-size: 11px; top: 3px; }
.lore-list b { color: var(--ink); }

.intro-card {
  margin: 4px 0 26px; padding: 18px 22px; border-radius: 16px;
  border: 1px solid var(--edge-soft); border-left: 3px solid var(--gold);
  background: linear-gradient(120deg, rgba(240, 203, 132, .07), rgba(20, 22, 16, .72) 45%);
  animation: screen-in .4s ease both;
}
.intro-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.intro-head svg { width: 17px; height: 17px; color: var(--gold-hi); }
.intro-head b { font-size: 14.5px; letter-spacing: .14em; color: var(--gold-hi); }
.intro-text { font-size: 13.5px; line-height: 1.85; color: var(--muted); }
.intro-text b { color: var(--ink); }
.intro-text .t-good { color: var(--good-hi); }
.intro-text .t-evil { color: var(--evil-hi); }
.intro-steps { display: flex; gap: 10px; margin: 13px 0 11px; flex-wrap: wrap; }
.intro-steps span {
  display: flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(18, 20, 17, .6);
  font-size: 12.5px; letter-spacing: .04em; color: var(--ink); font-family: var(--sans);
}
.intro-steps i {
  font-style: normal; width: 19px; height: 19px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(240, 203, 132, .18); border: 1px solid rgba(240, 203, 132, .5);
  color: var(--gold-hi); font-size: 11px; font-weight: 700;
}
.intro-tip { font-size: 12px; line-height: 1.7; color: var(--faint); }

.rules-open {
  margin-top: 26px; width: 100%; border: 1px solid var(--edge-soft); border-radius: 18px; background: rgba(20, 22, 16, .72);
  cursor: pointer; padding: 17px 22px; display: flex; align-items: center; gap: 14px; text-align: left;
  color: var(--gold-hi); transition: border-color .18s, background .18s, transform .18s; font: inherit;
}
.rules-open:hover { border-color: var(--gold); background: rgba(240, 203, 132, .07); transform: translateY(-2px); }
.rules-open > svg { width: 22px; height: 22px; flex: none; color: var(--gold); }
.rules-open-text { display: flex; flex-direction: column; gap: 4px; }
.rules-open-text b { font-size: 15px; letter-spacing: .14em; }
.rules-open-text small { font-size: 11.5px; color: var(--faint); letter-spacing: .05em; line-height: 1.6; font-family: var(--sans); }
.rules-open-arrow { margin-left: auto; color: var(--gold); font-size: 14px; transition: transform .18s; }
.rules-open:hover .rules-open-arrow { transform: translateX(4px); }
.home-foot { margin-top: 34px; text-align: center; font-size: 11.5px; color: var(--faint); letter-spacing: .1em; font-family: var(--sans); }

/* ============ 大厅 ============ */
.lobby-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.lobby-title { font-size: clamp(26px, 4vw, 38px); font-weight: 900; letter-spacing: .14em; color: var(--ink); }
.invite-box { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; background: rgba(24, 27, 20, .8); flex-wrap: wrap; }
.invite-label { font-size: 11px; letter-spacing: .3em; color: var(--faint); }
.invite-code { font-family: var(--serif-latin); font-size: 30px; font-weight: 900; letter-spacing: .3em; color: var(--gold-hi); text-shadow: 0 0 18px rgba(255, 230, 173, .45); }
.lobby-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 22px; align-items: start; }
.seat-count { font-size: 13px; color: var(--muted); letter-spacing: .1em; font-family: var(--sans); }
.seat-hint { margin-top: 14px; font-size: 12px; color: var(--faint); letter-spacing: .06em; text-align: center; font-family: var(--sans); }

.fixed-roles { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 15px; }
.role-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 7px 13px; border-radius: 999px; letter-spacing: .08em; border: 1px solid; }
.role-pill.good { color: var(--good-hi); border-color: rgba(168, 210, 178, .45); background: rgba(63, 107, 74, .18); }
.role-pill.evil { color: var(--evil-hi); border-color: rgba(242, 181, 173, .5); background: rgba(138, 58, 50, .2); }
.config-toggles { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.cfg-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--edge-soft); background: rgba(14, 16, 12, .5); transition: border-color .18s; }
.cfg-row:hover { border-color: var(--line); }
.cfg-row .cfg-icon { font-size: 18px; width: 24px; text-align: center; }
.cfg-row.good .cfg-icon { color: var(--good-hi); }
.cfg-row.evil .cfg-icon { color: var(--evil-hi); }
.cfg-info { flex: 1; min-width: 0; }
.cfg-info b { display: block; font-size: 14px; letter-spacing: .08em; }
.cfg-info span { font-size: 11.5px; color: var(--faint); line-height: 1.5; display: block; margin-top: 2px; font-family: var(--sans); }
.switch { position: relative; width: 46px; height: 25px; flex-shrink: 0; border-radius: 999px; border: 1px solid var(--edge-soft); background: rgba(14, 16, 12, .8); transition: all .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: var(--faint); transition: all .22s cubic-bezier(.5, 1.6, .4, 1); }
.switch.on { background: linear-gradient(90deg, #6b5326, var(--gold)); border-color: var(--gold-hi); }
.switch.on::after { left: 23px; background: #fff6dd; box-shadow: 0 0 10px rgba(255, 230, 173, .8); }
.switch:disabled { opacity: .45; cursor: not-allowed; }
.faction-preview { display: flex; gap: 10px; margin-bottom: 16px; }
.faction-box { flex: 1; text-align: center; border-radius: 12px; padding: 10px; border: 1px solid; }
.faction-box.good { border-color: rgba(168, 210, 178, .4); background: rgba(63, 107, 74, .14); }
.faction-box.evil { border-color: rgba(242, 181, 173, .45); background: rgba(138, 58, 50, .16); }
.faction-box b { display: block; font-size: 22px; font-family: var(--serif-latin); }
.faction-box.good b { color: var(--good-hi); }
.faction-box.evil b { color: var(--evil-hi); }
.faction-box span { font-size: 11px; letter-spacing: .24em; color: var(--muted); }
.start-hint { margin-top: 10px; font-size: 12px; color: var(--faint); text-align: center; letter-spacing: .06em; min-height: 18px; font-family: var(--sans); }
.start-hint.warn { color: var(--amber); }

/* ============ 圆桌（大厅 + 对局共享） ============ */
.table-wrap { display: flex; justify-content: center; padding: 4px 0; }
.table { position: relative; width: 100%; max-width: 580px; aspect-ratio: 1 / 1; margin: 0 auto; }
.table::before {
  content: ""; position: absolute; inset: 13.5%; border-radius: 50%;
  border: 1px dashed rgba(240, 203, 132, .2);
  background: radial-gradient(circle at 50% 44%, rgba(240, 203, 132, .07), rgba(18, 20, 17, .35) 72%);
  box-shadow: inset 0 0 50px rgba(0, 0, 0, .4);
}
.table[data-dense="1"]::before { inset: 12%; }

.seat {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  width: clamp(62px, 21%, 98px); display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-align: center; animation: seat-fade .45s ease both; z-index: 2;
}
@keyframes seat-fade { from { opacity: 0; } to { opacity: 1; } }
.seat-medal {
  position: relative; width: clamp(40px, 62%, 56px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; border: 2px solid rgba(240, 203, 132, .4);
  background: radial-gradient(circle at 34% 28%, #3a3320, #1a160d);
  color: var(--gold-hi); font-weight: 900; font-size: clamp(15px, 2.3vw, 20px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5); transition: transform .18s, box-shadow .18s, border-color .18s;
  animation: medal-in .45s cubic-bezier(.3, 1.6, .5, 1) both;
}
@keyframes medal-in { from { transform: scale(.55); } to { transform: scale(1); } }
.seat-avatar { line-height: 1; }
.seat.clickable { cursor: pointer; }
.seat.clickable:hover .seat-medal { transform: scale(1.12); border-color: var(--gold-hi); box-shadow: 0 0 20px rgba(240, 203, 132, .45); }
.seat.is-leader .seat-medal { border-color: var(--gold-hi); box-shadow: 0 0 16px rgba(240, 203, 132, .4); }
.seat.known-evil .seat-medal { border-color: rgba(242, 181, 173, .75); }
.seat.selected .seat-medal { border-color: var(--gold-hi); box-shadow: 0 0 0 3px rgba(240, 203, 132, .5), 0 0 24px rgba(240, 203, 132, .5); transform: scale(1.1); }
.seat.selected-evil .seat-medal { border-color: var(--evil-hi); box-shadow: 0 0 0 3px rgba(242, 181, 173, .55), 0 0 24px rgba(242, 181, 173, .5); transform: scale(1.1); }
.seat.offline { opacity: .48; }
.seat.dead-target .seat-medal { outline: 2px dashed var(--evil-hi); outline-offset: 3px; }
.seat.side-good .seat-medal { border-color: var(--good); box-shadow: 0 0 14px rgba(168, 210, 178, .35); }
.seat.side-evil .seat-medal { border-color: var(--evil); box-shadow: 0 0 14px rgba(242, 181, 173, .35); }
.seat-crown { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); color: var(--gold-hi); font-size: 14px; filter: drop-shadow(0 0 6px rgba(255, 230, 173, .8)); animation: crown-bob 2.4s ease-in-out infinite; }
@keyframes crown-bob { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-2.5px); } }
.seat-name { font-size: clamp(11px, 1.6vw, 13.5px); font-weight: 700; letter-spacing: .02em; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.seat-badges { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; max-width: 110%; }
.seat-you { font-size: 9px; letter-spacing: .2em; color: #2a2008; background: linear-gradient(160deg, #ffe6ad, #f0cb84); padding: 1px 7px; border-radius: 999px; font-weight: 700; font-family: var(--sans); }
.seat-vote { position: absolute; bottom: -5px; right: -5px; width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; animation: stamp-in .3s cubic-bezier(.3, 1.8, .5, 1) both; }
.seat-vote.yes { background: rgba(63, 107, 74, .85); color: var(--good-hi); border: 1.5px solid var(--good-hi); }
.seat-vote.no { background: rgba(138, 58, 50, .85); color: var(--evil-hi); border: 1.5px solid var(--evil-hi); }
@keyframes stamp-in { from { transform: scale(2.2) rotate(-18deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* 大厅席位 */
.seat.lobby .seat-name { font-size: clamp(10.5px, 1.5vw, 13px); }
.seat.lobby.empty .seat-medal { border-style: dashed; border-color: rgba(240, 203, 132, .25); background: rgba(14, 16, 12, .4); color: var(--faint); font-size: 20px; font-weight: 400; }
.seat.lobby.empty .seat-name { color: var(--faint); font-weight: 400; font-size: clamp(9.5px, 1.3vw, 11.5px); letter-spacing: .1em; }
.seat.lobby .kick-btn {
  position: absolute; top: -2px; right: 2px; width: 20px; height: 20px; border-radius: 7px; border: 1px solid rgba(242, 181, 173, .4);
  background: rgba(138, 58, 50, .55); color: var(--evil-hi); font-size: 10px; display: grid; place-items: center; opacity: 0; transition: opacity .15s; z-index: 3;
}
.seat.lobby:hover .kick-btn { opacity: 1; }
.seat.lobby .kick-btn:hover { background: var(--evil-deep); }
.host-tag { color: var(--gold-hi); display: inline-flex; align-items: center; gap: 3px; }

/* 标签 */
.tag { font-size: 9.5px; padding: 2px 6px; border-radius: 999px; letter-spacing: .06em; border: 1px solid; display: inline-flex; align-items: center; gap: 3px; font-family: var(--sans); white-space: nowrap; }
.tag svg { font-size: 9px; }
.tag.evil-seen { color: var(--evil-hi); border-color: rgba(242, 181, 173, .55); background: rgba(138, 58, 50, .3); }
.tag.mate-seen { color: #f0a3ab; border-color: rgba(242, 181, 173, .4); background: rgba(138, 58, 50, .2); }
.tag.sage-seen { color: var(--violet); border-color: rgba(192, 168, 232, .5); background: rgba(192, 168, 232, .14); }
.tag.team { color: var(--gold-hi); border-color: rgba(240, 203, 132, .5); background: rgba(240, 203, 132, .12); }
.tag.voted, .tag.played, .tag.ready-tag { color: var(--teal); border-color: rgba(127, 200, 184, .45); background: rgba(127, 200, 184, .1); }
.tag.off { color: var(--faint); border-color: var(--edge-soft); background: rgba(14, 16, 12, .5); }
.tag.role-good { color: var(--good-hi); border-color: rgba(168, 210, 178, .55); background: rgba(63, 107, 74, .25); }
.tag.role-evil { color: var(--evil-hi); border-color: rgba(242, 181, 173, .6); background: rgba(138, 58, 50, .32); }

/* 中心烛台 */
.center-piece {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 33%; aspect-ratio: 1; border-radius: 50%; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
  background: radial-gradient(circle at 50% 38%, rgba(240, 203, 132, .18), rgba(18, 20, 17, .92) 72%);
  border: 1px solid rgba(240, 203, 132, .3);
  box-shadow: inset 0 0 30px rgba(240, 203, 132, .12), 0 0 44px rgba(240, 203, 132, .1);
  padding: 6px;
}
.cp-flame { color: var(--gold-hi); font-size: clamp(15px, 2.6vw, 22px); animation: flicker 3s ease-in-out infinite; line-height: 1; }
.cp-quest { font-family: var(--serif-latin); font-size: clamp(22px, 4.6vw, 38px); font-weight: 900; color: var(--gold-hi); line-height: 1; text-shadow: 0 0 18px rgba(255, 230, 173, .4); }
.cp-count { font-family: var(--serif-latin); font-size: clamp(26px, 5.4vw, 46px); font-weight: 900; color: var(--gold-hi); line-height: 1; }
.cp-label { font-size: clamp(8.5px, 1.3vw, 11.5px); color: var(--muted); letter-spacing: .08em; line-height: 1.3; }
.cp-sub { font-size: clamp(8.5px, 1.3vw, 11px); color: var(--gold); letter-spacing: .04em; font-family: var(--sans); }

/* ============ 对局 ============ */
.room-layout { display: grid; grid-template-columns: 1fr 330px; gap: 20px; align-items: start; }
.room-main { min-width: 0; }
.board { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.table-panel { padding: 16px 18px 18px; }

.track-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(170deg, rgba(38, 42, 32, .9), rgba(20, 22, 16, .94));
  border: 1px solid var(--line); border-radius: 18px; padding: 16px 22px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.track-panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .5; }
.quest-track { display: flex; gap: clamp(7px, 1.5vw, 16px); align-items: center; }
.quest-node { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }
.quest-num { font-family: var(--serif-latin); font-size: 11px; letter-spacing: .2em; color: var(--faint); }
.quest-medal {
  width: clamp(44px, 5.4vw, 58px); height: clamp(44px, 5.4vw, 58px); border-radius: 50%;
  display: grid; place-items: center; font-family: var(--serif-latin); font-weight: 700; font-size: clamp(16px, 2vw, 20px);
  border: 2px solid rgba(240, 203, 132, .35); color: var(--muted);
  background: radial-gradient(circle at 32% 28%, rgba(240, 203, 132, .14), rgba(14, 16, 12, .7));
  transition: all .3s; position: relative;
}
.quest-node.current .quest-medal {
  border-color: var(--gold-hi); color: var(--gold-hi);
  box-shadow: 0 0 22px rgba(255, 230, 173, .45), inset 0 0 14px rgba(255, 230, 173, .15);
  animation: medal-pulse 2s ease-in-out infinite;
}
.quest-node.current .quest-num { color: var(--gold-hi); }
@keyframes medal-pulse { 0%, 100% { box-shadow: 0 0 14px rgba(255, 230, 173, .3), inset 0 0 10px rgba(255, 230, 173, .1); } 50% { box-shadow: 0 0 30px rgba(255, 230, 173, .6), inset 0 0 18px rgba(255, 230, 173, .22); } }
.quest-node.good .quest-medal { border-color: var(--good-hi); background: radial-gradient(circle at 32% 28%, #7cb98a, #2c4d36); color: #eafff0; box-shadow: 0 0 18px rgba(168, 210, 178, .5); }
.quest-node.evil .quest-medal { border-color: var(--evil-hi); background: radial-gradient(circle at 32% 28%, #d98a80, #5c221c); color: #fff0ec; box-shadow: 0 0 18px rgba(242, 181, 173, .55); }
.quest-medal svg { font-size: 21px; }
.quest-double { position: absolute; top: -7px; right: -9px; font-size: 9.5px; background: var(--evil-deep); color: #ffd7da; border: 1px solid var(--evil-hi); padding: 2px 5px; border-radius: 999px; letter-spacing: .04em; font-family: var(--sans); }
.track-link { width: clamp(7px, 1.3vw, 15px); height: 2px; background: linear-gradient(90deg, rgba(240, 203, 132, .4), rgba(240, 203, 132, .15)); border-radius: 2px; }
.track-side { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.reject-track { display: flex; align-items: center; gap: 6px; }
.reject-label { font-size: 11px; letter-spacing: .18em; color: var(--faint); margin-right: 4px; }
.reject-pip { width: 15px; height: 17px; clip-path: polygon(50% 0, 100% 22%, 100% 62%, 50% 100%, 0 62%, 0 22%); background: rgba(242, 237, 223, .12); transition: all .25s; }
.reject-pip.lit { background: linear-gradient(180deg, var(--evil-hi), var(--evil-deep)); box-shadow: 0 0 10px rgba(242, 181, 173, .6); }
.reject-pip.last { animation: pulse-evil 1s infinite; }
@keyframes pulse-evil { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.6); } }
.my-role-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(14, 16, 12, .65); color: var(--ink); font-size: 13px; letter-spacing: .1em; transition: all .18s;
}
.my-role-btn:hover { border-color: var(--gold); box-shadow: 0 0 14px rgba(240, 203, 132, .3); }
.my-role-btn.good { border-color: rgba(168, 210, 178, .55); color: var(--good-hi); }
.my-role-btn.evil { border-color: rgba(242, 181, 173, .6); color: var(--evil-hi); }

/* 阶段面板 */
.phase-panel {
  border-radius: 18px; border: 1px solid var(--line); padding: 22px;
  background: linear-gradient(170deg, rgba(38, 42, 32, .92), rgba(20, 22, 16, .95));
  box-shadow: var(--shadow); position: relative; overflow: hidden; min-height: 148px;
}
.phase-panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .5; }
.phase-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 11px; position: relative; }
.phase-head::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: linear-gradient(90deg, rgba(240, 203, 132, .55), rgba(240, 203, 132, .14) 42%, transparent); }
.phase-head::before { content: ""; position: absolute; left: 0; bottom: -2px; width: 5px; height: 5px; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 8px rgba(240, 203, 132, .7); }
.phase-title { font-size: 19px; font-weight: 900; letter-spacing: .14em; color: var(--gold-hi); text-shadow: 0 0 16px rgba(240, 203, 132, .25); }
.phase-step { font-size: 11.5px; letter-spacing: .24em; color: var(--faint); }
.phase-timer { margin-left: auto; align-self: center; font-size: 11px; letter-spacing: .12em; color: var(--darkgold); font-variant-numeric: tabular-nums; padding: 2px 9px; border: 1px solid rgba(240, 203, 132, .28); border-radius: 999px; background: rgba(240, 203, 132, .06); white-space: nowrap; }
.phase-timer.urgent { color: var(--evil-hi); border-color: rgba(242, 181, 173, .5); background: rgba(138, 58, 50, .22); animation: timer-pulse 1s ease-in-out infinite; }
@keyframes timer-pulse { 0%, 100% { box-shadow: 0 0 0 rgba(242, 181, 173, 0); } 50% { box-shadow: 0 0 12px rgba(242, 181, 173, .45); } }
.phase-desc { font-size: 13.5px; color: var(--muted); line-height: 1.85; margin-bottom: 16px; }
.phase-desc b { color: var(--ink); }
.phase-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.phase-actions .btn { min-width: 150px; }
.waiting { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; letter-spacing: .08em; }
.waiting .dots { display: inline-flex; gap: 4px; }
.waiting .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: dot-b 1.2s infinite; }
.waiting .dots i:nth-child(2) { animation-delay: .2s; }
.waiting .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot-b { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
.vote-duo { display: flex; gap: 16px; flex-wrap: wrap; width: 100%; }
.vote-duo .btn { flex: 1; min-width: 160px; padding: 18px; font-size: 17px; position: relative; overflow: hidden; border-radius: 12px; }
.vote-duo .btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .14) 50%, transparent 65%); transform: translateX(-130%); transition: transform .55s ease; pointer-events: none; }
.vote-duo .btn:hover::after { transform: translateX(130%); }
.vote-duo .btn svg { filter: drop-shadow(0 0 6px rgba(255, 255, 255, .4)); }
.countdown { height: 4px; border-radius: 4px; background: rgba(242, 237, 223, .1); overflow: hidden; margin-top: 16px; }
.countdown i { display: block; height: 100%; background: linear-gradient(90deg, var(--darkgold), var(--gold-hi)); animation: cd linear forwards; }
@keyframes cd { from { width: 100%; } to { width: 0%; } }
.result-banner { display: flex; align-items: center; gap: 13px; padding: 14px 18px; border-radius: 11px; margin-bottom: 16px; border: 1px solid; font-size: 15px; font-weight: 700; letter-spacing: .1em; animation: screen-in .4s ease both; position: relative; font-family: var(--serif-cn); }
.result-banner::before { content: ""; position: absolute; inset: 4px; border-radius: 7px; border: 1px solid rgba(240, 203, 132, .22); pointer-events: none; }
.result-banner svg { font-size: 22px; }
.result-banner.good { border-color: rgba(168, 210, 178, .6); background: radial-gradient(120% 130% at 0% 0%, rgba(124, 185, 138, .28), transparent 55%), rgba(63, 107, 74, .18); color: var(--good-hi); box-shadow: 0 0 22px rgba(168, 210, 178, .18); }
.result-banner.evil { border-color: rgba(242, 181, 173, .62); background: radial-gradient(120% 130% at 0% 0%, rgba(217, 138, 128, .3), transparent 55%), rgba(138, 58, 50, .2); color: var(--evil-hi); box-shadow: 0 0 22px rgba(242, 181, 173, .18); }
.quest-cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.qcard {
  width: 58px; height: 80px; border-radius: 9px; display: grid; place-items: center; position: relative; overflow: hidden;
  border: 1px solid; animation: qcard-in .55s cubic-bezier(.3, 1.5, .5, 1) both;
}
.qcard::before { content: ""; position: absolute; inset: 3px; border-radius: 6px; border: 1px solid rgba(240, 203, 132, .4); pointer-events: none; }
.qcard svg { width: 34px; height: 34px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.qc-halo { position: absolute; inset: 0; background: radial-gradient(circle at 50% 36%, rgba(255, 255, 255, .18), transparent 66%); pointer-events: none; }
.qcard.success { border-color: rgba(168, 210, 178, .75); background: radial-gradient(120% 70% at 50% 0%, rgba(124, 185, 138, .45), transparent 60%), linear-gradient(165deg, #2c4633, #141d16); color: #d8f5e0; box-shadow: 0 6px 18px rgba(0, 0, 0, .45), 0 0 16px rgba(168, 210, 178, .3); }
.qcard.fail { border-color: rgba(242, 181, 173, .75); background: radial-gradient(120% 70% at 50% 0%, rgba(217, 138, 128, .45), transparent 60%), linear-gradient(165deg, #4a201a, #1d0f0c); color: #ffd7da; box-shadow: 0 6px 18px rgba(0, 0, 0, .45), 0 0 16px rgba(242, 181, 173, .32); }
@keyframes qcard-in { from { transform: rotateY(90deg) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.team-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.team-chip { font-size: 12.5px; padding: 7px 14px 7px 12px; border-radius: 7px; border: 1px solid rgba(240, 203, 132, .5); background: linear-gradient(160deg, rgba(240, 203, 132, .16), rgba(240, 203, 132, .05)); color: var(--gold-hi); letter-spacing: .08em; display: inline-flex; align-items: center; gap: 7px; box-shadow: inset 0 0 12px rgba(240, 203, 132, .08); font-family: var(--serif-cn); }
.team-chip svg { color: var(--gold); filter: drop-shadow(0 0 5px rgba(240, 203, 132, .5)); }

/* 秘密出牌（泥金塔罗牌） */
.play-cards { display: flex; gap: 18px; flex-wrap: wrap; width: 100%; justify-content: center; }
.play-card {
  flex: 1; min-width: 168px; max-width: 232px; aspect-ratio: 3 / 4.05; border-radius: 14px; border: 1px solid;
  padding: 20px 16px 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; transition: transform .2s cubic-bezier(.3, 1.3, .5, 1), box-shadow .2s; font-family: var(--serif-cn);
  position: relative; overflow: hidden; isolation: isolate;
}
.play-cards .play-card:only-child { max-width: 300px; aspect-ratio: 3 / 3.5; }
.play-card::before {
  content: ""; position: absolute; inset: 6px; border-radius: 9px; pointer-events: none; z-index: 2;
  border: 1px solid rgba(240, 203, 132, .42);
  background:
    radial-gradient(circle at 0 0, rgba(255, 230, 173, .85) 0 2px, transparent 2.6px),
    radial-gradient(circle at 100% 0, rgba(255, 230, 173, .85) 0 2px, transparent 2.6px),
    radial-gradient(circle at 0 100%, rgba(255, 230, 173, .85) 0 2px, transparent 2.6px),
    radial-gradient(circle at 100% 100%, rgba(255, 230, 173, .85) 0 2px, transparent 2.6px);
}
.play-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .16) 49%, transparent 64%);
  transform: translateX(-130%); transition: transform .6s ease;
}
.play-card:hover::after { transform: translateX(130%); }
.play-card:hover { transform: translateY(-5px); }
.play-card:active { transform: scale(.97); }
.pc-halo { position: absolute; top: 6%; left: 50%; width: 82%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; pointer-events: none; z-index: -1; }
.play-card.good .pc-halo { background: radial-gradient(circle, rgba(168, 210, 178, .36), transparent 68%); }
.play-card.evil .pc-halo { background: radial-gradient(circle, rgba(242, 181, 173, .34), transparent 68%); }
.play-card .pc-mark { font-size: 58px; line-height: 1; display: grid; place-items: center; }
.play-card .pc-mark svg { width: 58px; height: 58px; }
.play-card.good .pc-mark { filter: drop-shadow(0 0 14px rgba(168, 210, 178, .55)) drop-shadow(0 3px 8px rgba(0, 0, 0, .5)); }
.play-card.evil .pc-mark { filter: drop-shadow(0 0 14px rgba(242, 181, 173, .5)) drop-shadow(0 3px 8px rgba(0, 0, 0, .5)); }
.pc-rule { width: 60%; height: 1px; margin: 5px 0 3px; position: relative; background: linear-gradient(90deg, transparent, rgba(240, 203, 132, .65), transparent); }
.pc-rule::after { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; transform: translate(-50%, -50%) rotate(45deg); background: var(--gold); box-shadow: 0 0 8px rgba(240, 203, 132, .7); }
.pc-eyebrow { font-family: var(--serif-latin); font-size: 9.5px; letter-spacing: .34em; opacity: .68; }
.play-card .pc-label { font-size: 24px; font-weight: 900; letter-spacing: .22em; }
.play-card .pc-sub { font-size: 11.5px; letter-spacing: .08em; opacity: .85; font-family: var(--sans); }
.play-card.good { border-color: rgba(168, 210, 178, .72); color: #eafff0; background: radial-gradient(120% 80% at 50% 0%, rgba(124, 185, 138, .42), transparent 60%), linear-gradient(168deg, #2c4633, #141d16 72%); box-shadow: 0 10px 30px rgba(0, 0, 0, .5), inset 0 0 40px rgba(63, 107, 74, .3); }
.play-card.good:hover { box-shadow: 0 16px 44px rgba(168, 210, 178, .4), inset 0 0 52px rgba(63, 107, 74, .42); }
.play-card.good .pc-label { color: var(--good-hi); text-shadow: 0 0 18px rgba(168, 210, 178, .5); }
.play-card.evil { border-color: rgba(242, 181, 173, .72); color: #fff0ec; background: radial-gradient(120% 80% at 50% 0%, rgba(217, 138, 128, .42), transparent 60%), linear-gradient(168deg, #4a201a, #1d0f0c 72%); box-shadow: 0 10px 30px rgba(0, 0, 0, .5), inset 0 0 40px rgba(138, 58, 50, .32); }
.play-card.evil:hover { box-shadow: 0 16px 44px rgba(242, 181, 173, .4), inset 0 0 52px rgba(138, 58, 50, .42); }
.play-card.evil .pc-label { color: var(--evil-hi); text-shadow: 0 0 18px rgba(242, 181, 173, .5); }
.play-note { font-size: 12px; color: var(--faint); align-self: center; font-family: var(--sans); letter-spacing: .04em; }

/* 侧栏 */
.side {
  border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(170deg, rgba(34, 38, 29, .94), rgba(18, 20, 15, .96));
  box-shadow: var(--shadow); display: flex; flex-direction: column; height: min(760px, calc(100vh - 120px)); position: sticky; top: 76px; overflow: hidden;
}
.side-tabs { display: flex; border-bottom: 1px solid var(--edge-soft); flex-shrink: 0; }
.side-tab {
  flex: 1; padding: 13px 8px; background: none; border: none; color: var(--faint); font-size: 13.5px; letter-spacing: .16em;
  display: flex; align-items: center; justify-content: center; gap: 7px; position: relative; transition: color .18s;
}
.side-tab:hover { color: var(--ink); }
.side-tab.active { color: var(--gold-hi); }
.side-tab.active::after { content: ""; position: absolute; bottom: -1px; left: 22%; right: 22%; height: 2px; background: var(--gold-hi); border-radius: 2px; box-shadow: 0 0 10px rgba(255, 230, 173, .7); }
.log-badge { min-width: 17px; height: 17px; border-radius: 999px; background: var(--evil-deep); color: #fff; font-size: 10px; display: inline-grid; place-items: center; padding: 0 4px; font-family: var(--sans); }
.side-list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { animation: msg-in .25s ease both; max-width: 100%; }
@keyframes msg-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.msg .msg-name { font-size: 11px; color: var(--gold); letter-spacing: .12em; margin-bottom: 3px; }
.msg .msg-body {
  font-size: 13.5px; line-height: 1.7; color: var(--ink); background: rgba(14, 16, 12, .6);
  border: 1px solid var(--edge-soft); border-radius: 4px 13px 13px 13px; padding: 8px 12px; word-break: break-word; font-family: var(--sans);
}
.msg.mine .msg-name { color: var(--good-hi); text-align: right; }
.msg.mine .msg-body { background: rgba(63, 107, 74, .18); border-color: rgba(168, 210, 178, .3); border-radius: 13px 4px 13px 13px; }
.msg.sys .msg-body {
  background: none; border: none; border-left: 2px solid var(--gold); border-radius: 0; padding: 2px 0 2px 11px;
  color: var(--muted); font-size: 12.5px; font-style: italic; line-height: 1.75; font-family: var(--serif-cn);
}
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--edge-soft); flex-shrink: 0; }
.chat-form .text-input { padding: 10px 13px; font-size: 13.5px; }
.side-empty { color: var(--faint); font-size: 12.5px; text-align: center; padding: 30px 10px; letter-spacing: .1em; line-height: 2; }

/* ============ 规则书 ============ */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 9, 6, .88); backdrop-filter: blur(9px); padding: 20px; animation: ov-in .3s ease both; overflow-y: auto;
}
@keyframes ov-in { from { opacity: 0; } to { opacity: 1; } }
/* 规则书与身份牌需盖在结算浮层之上，保证顶栏随时可查阅。 */
#rules-overlay, #role-overlay { z-index: 110; }
.rules-panel {
  width: min(880px, 100%); max-height: min(86vh, 900px); display: flex; flex-direction: column;
  border: 1px solid rgba(240, 203, 132, .45); border-radius: 20px; overflow: hidden;
  background: linear-gradient(170deg, #232719, #14160f 60%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .7), 0 0 60px rgba(240, 203, 132, .12);
  animation: screen-in .3s ease both;
}
.rules-head {
  display: flex; align-items: center; gap: 14px; padding: 18px 22px;
  border-bottom: 1px solid var(--line); background: rgba(240, 203, 132, .05); flex: none;
}
.rules-head-icon { width: 30px; height: 30px; color: var(--gold-hi); filter: drop-shadow(0 0 12px rgba(255, 230, 173, .5)); flex: none; }
.rules-head-text h2 { font-size: 19px; letter-spacing: .18em; color: var(--gold-hi); }
.rules-head-text p { font-size: 11.5px; color: var(--faint); letter-spacing: .08em; margin-top: 3px; font-family: var(--sans); }
.rules-head .icon-btn { margin-left: auto; flex: none; }
.rules-tabs { display: flex; gap: 4px; padding: 10px 18px 0; border-bottom: 1px solid var(--edge-soft); flex: none; }
.rules-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 18px; background: none; border: none;
  color: var(--faint); font-size: 14px; letter-spacing: .12em; position: relative; transition: color .18s; border-radius: 10px 10px 0 0;
}
.rules-tab:hover { color: var(--ink); }
.rules-tab.active { color: var(--gold-hi); background: rgba(240, 203, 132, .06); }
.rules-tab.active::after { content: ""; position: absolute; bottom: -1px; left: 14%; right: 14%; height: 2px; background: var(--gold-hi); border-radius: 2px; box-shadow: 0 0 10px rgba(255, 230, 173, .7); }
.rules-scroll { overflow-y: auto; padding: 20px 24px 28px; }
.rules-sec { margin-bottom: 26px; }
.rules-sec:last-child { margin-bottom: 0; }
.rules-sec > h3 { font-size: 14.5px; letter-spacing: .2em; color: var(--gold-hi); margin-bottom: 12px; }
.win-cols { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px; }
.win-card { border-radius: 14px; padding: 15px 17px; border: 1px solid; }
.win-card.good { border-color: rgba(168, 210, 178, .45); background: linear-gradient(165deg, rgba(63, 107, 74, .22), rgba(20, 22, 16, .6)); }
.win-card.evil { border-color: rgba(242, 181, 173, .45); background: linear-gradient(165deg, rgba(138, 58, 50, .26), rgba(20, 22, 16, .6)); }
.win-card > b { display: flex; align-items: center; gap: 8px; font-size: 14.5px; letter-spacing: .12em; margin-bottom: 9px; }
.win-card > b svg { width: 17px; height: 17px; }
.win-card.good > b { color: var(--good-hi); }
.win-card.evil > b { color: var(--evil-hi); }
.win-card ul { list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 13px; line-height: 1.75; color: var(--muted); }
.win-card li { padding-left: 15px; position: relative; }
.win-card li::before { content: "✦"; position: absolute; left: 0; font-size: 10px; top: 3px; }
.win-card.good li::before { color: var(--good-hi); }
.win-card.evil li::before { color: var(--evil-hi); }
.win-card b { color: var(--ink); }
.know-list { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; line-height: 1.8; color: var(--muted); }
.know-list li { padding-left: 16px; position: relative; }
.know-list li::before { content: "✦"; position: absolute; left: 0; color: var(--gold); font-size: 11px; top: 3px; }
.know-list b { color: var(--ink); }
.know-list .t-good { color: var(--good-hi); }
.know-list .t-evil { color: var(--evil-hi); }
.rules-ol { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; line-height: 1.8; color: var(--muted); }
.rules-ol b { color: var(--ink); }
.cfg-table { width: 100%; border-collapse: collapse; font-size: 13px; font-family: var(--sans); }
.cfg-table th { text-align: left; color: var(--gold); font-weight: 600; letter-spacing: .1em; padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 12px; }
.cfg-table td { padding: 7px 8px; border-bottom: 1px solid var(--edge-soft); color: var(--muted); }
.cfg-table tr:hover td { background: rgba(240, 203, 132, .05); }
.cfg-note { margin-top: 10px; font-size: 12px; color: var(--faint); line-height: 1.7; }

/* 角色图鉴（立绘） */
.atlas-note { font-size: 12.5px; line-height: 1.8; color: var(--muted); margin-bottom: 16px; padding: 12px 15px; border-radius: 12px; border: 1px solid var(--edge-soft); background: rgba(240, 203, 132, .05); }
.atlas-note b { color: var(--gold-hi); }
.role-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.role-tile { border-radius: 14px; border: 1px solid; overflow: hidden; transition: transform .18s, box-shadow .18s; display: flex; flex-direction: column; background: rgba(14, 16, 12, .6); }
.role-tile:hover { transform: translateY(-4px); }
.role-tile.good { border-color: rgba(168, 210, 178, .4); }
.role-tile.good:hover { box-shadow: 0 10px 28px rgba(168, 210, 178, .25); }
.role-tile.evil { border-color: rgba(242, 181, 173, .42); }
.role-tile.evil:hover { box-shadow: 0 10px 28px rgba(242, 181, 173, .28); }
.rt-img-wrap { position: relative; aspect-ratio: 362 / 400; overflow: hidden; }
.rt-img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; display: block; transition: transform .4s; }
.role-tile:hover .rt-img { transform: scale(1.05); }
.rt-img-wrap::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(14, 16, 12, .85)); }
.rt-side { position: absolute; top: 8px; right: 8px; z-index: 2; font-size: 10px; padding: 3px 9px; border-radius: 999px; letter-spacing: .16em; font-family: var(--sans); backdrop-filter: blur(4px); }
.role-tile.good .rt-side { background: rgba(63, 107, 74, .7); color: var(--good-hi); border: 1px solid rgba(168, 210, 178, .5); }
.role-tile.evil .rt-side { background: rgba(138, 58, 50, .7); color: var(--evil-hi); border: 1px solid rgba(242, 181, 173, .5); }
.rt-body { padding: 12px 13px 14px; }
.rt-body b { display: block; font-size: 15.5px; letter-spacing: .1em; margin-bottom: 6px; }
.role-tile.good .rt-body b { color: var(--good-hi); }
.role-tile.evil .rt-body b { color: var(--evil-hi); }
.rt-body p { font-size: 11.5px; line-height: 1.7; color: var(--muted); }

/* ============ 身份牌（立绘翻牌） ============ */
.role-card-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.role-card { width: min(340px, 86vw); height: 520px; perspective: 1400px; cursor: pointer; }
.role-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.35, 1.2, .4, 1); }
.role-card.flipped .role-card-inner { transform: rotateY(180deg); }
.role-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 20px; border: 2px solid var(--gold); overflow: hidden;
  display: flex; flex-direction: column;
}
.role-back { align-items: center; justify-content: center; gap: 16px; background: radial-gradient(circle at 50% 38%, #33301c, #14160f 75%); box-shadow: 0 24px 70px rgba(0, 0, 0, .65), inset 0 0 60px rgba(240, 203, 132, .08); }
.role-back::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(240, 203, 132, .35); border-radius: 13px; }
.back-mark { width: 74px; height: 74px; color: var(--gold-hi); filter: drop-shadow(0 0 20px rgba(255, 230, 173, .6)); animation: flicker 3s infinite; }
.role-back p { font-size: 13px; letter-spacing: .4em; color: var(--muted); text-indent: .4em; }
.role-front { transform: rotateY(180deg); background: var(--paper); }
.role-front.good { border-color: var(--good-hi); box-shadow: 0 24px 70px rgba(0, 0, 0, .65), 0 0 46px rgba(168, 210, 178, .3); }
.role-front.evil { border-color: var(--evil-hi); box-shadow: 0 24px 70px rgba(0, 0, 0, .65), 0 0 46px rgba(242, 181, 173, .35); }
.rf-portrait-wrap { position: relative; height: 56%; flex: none; overflow: hidden; }
.rf-portrait { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.rf-portrait-wrap::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, var(--paper) 99%); }
.rf-info { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 22px 20px; display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.rf-side { font-size: 10.5px; letter-spacing: .4em; text-indent: .4em; padding: 4px 13px; border-radius: 999px; border: 1px solid; font-family: var(--sans); }
.role-front.good .rf-side { color: var(--good-hi); border-color: rgba(168, 210, 178, .6); background: rgba(63, 107, 74, .2); }
.role-front.evil .rf-side { color: var(--evil-hi); border-color: rgba(242, 181, 173, .6); background: rgba(138, 58, 50, .2); }
.rf-name { font-size: 30px; font-weight: 900; letter-spacing: .2em; text-indent: .2em; color: var(--ink); line-height: 1.2; }
.rf-latin { font-family: var(--serif-latin); font-size: 11px; letter-spacing: .32em; color: var(--faint); }
.rf-desc { font-size: 12.5px; line-height: 1.85; color: var(--muted); }
.rf-know { width: 100%; border-top: 1px solid var(--edge-soft); padding-top: 10px; margin-top: 3px; font-size: 12px; line-height: 1.8; color: var(--muted); }
.rf-know b { color: var(--gold-hi); }

/* ============ 终局（立绘结算） ============ */
.over-card {
  width: min(680px, 94vw); max-height: 88vh; overflow-y: auto; border-radius: 22px; padding: 34px 30px;
  border: 2px solid; position: relative; text-align: center; animation: over-in .55s cubic-bezier(.3, 1.3, .4, 1) both;
}
@keyframes over-in { from { opacity: 0; transform: scale(.82) translateY(26px); } to { opacity: 1; transform: none; } }
.over-card.good { border-color: var(--good-hi); background: radial-gradient(600px 340px at 50% -8%, rgba(168, 210, 178, .32), transparent 70%), linear-gradient(175deg, #1c2a1f, #10160f); box-shadow: 0 0 80px rgba(168, 210, 178, .3); }
.over-card.evil { border-color: var(--evil-hi); background: radial-gradient(600px 340px at 50% -8%, rgba(242, 181, 173, .34), transparent 70%), linear-gradient(175deg, #2c1410, #160a07); box-shadow: 0 0 80px rgba(242, 181, 173, .35); }
.over-eyebrow { font-size: 11.5px; letter-spacing: .5em; text-indent: .5em; color: var(--muted); margin-bottom: 12px; font-family: var(--serif-latin); }
.over-title { font-size: clamp(34px, 6vw, 50px); font-weight: 900; letter-spacing: .18em; text-indent: .18em; line-height: 1.3; }
.over-card.good .over-title { color: var(--good-hi); text-shadow: 0 0 34px rgba(200, 232, 208, .6); }
.over-card.evil .over-title { color: var(--evil-hi); text-shadow: 0 0 34px rgba(255, 208, 200, .6); }
.over-reason { margin: 14px auto 22px; font-size: 14px; line-height: 1.9; color: var(--muted); max-width: 460px; }
.over-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 11px; margin-bottom: 24px; text-align: left; }
.over-role { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid; font-size: 13px; }
.over-role.good { border-color: rgba(168, 210, 178, .4); background: rgba(63, 107, 74, .14); }
.over-role.evil { border-color: rgba(242, 181, 173, .45); background: rgba(138, 58, 50, .18); }
.or-img { width: 42px; height: 52px; object-fit: cover; object-position: center 20%; border-radius: 8px; flex-shrink: 0; border: 1px solid var(--edge-soft); }
.or-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.or-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.or-role { font-size: 11px; letter-spacing: .04em; }
.over-role.good .or-role { color: var(--good-hi); }
.over-role.evil .or-role { color: var(--evil-hi); }
.over-role.was-target { outline: 2px dashed var(--evil-hi); outline-offset: 2px; }
.over-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: linear-gradient(160deg, #3a1a14, #200d0a); border: 1px solid var(--evil-hi); color: #ffd7da;
  padding: 12px 22px; border-radius: 12px; font-size: 13.5px; letter-spacing: .06em;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .6); animation: toast-in .3s ease both; max-width: 88vw; text-align: center; font-family: var(--sans);
}
.toast.ok { background: linear-gradient(160deg, #1c2a1f, #101a12); border-color: var(--good-hi); color: #d8f5e0; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============ 响应式 ============ */
@media (max-width: 1020px) {
  .room-layout { grid-template-columns: 1fr; }
  .side { position: static; height: 420px; }
}
@media (max-width: 860px) {
  .gate, .lobby-grid, .win-cols { grid-template-columns: 1fr; }
  .lobby-head { flex-direction: column; align-items: stretch; }
  .invite-box { justify-content: space-between; }
  .role-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .brand-cn { display: none; }
  #conn-text { display: none; }
  .conn-pill { padding: 8px 9px; }
  .hero-sub .br-m { display: none; }
  .table { max-width: 100%; }
  .seat { width: clamp(56px, 22%, 84px); }
  .seat-badges { max-width: 120%; }
  .tag { font-size: 8.5px; padding: 1.5px 5px; }
  .track-panel { padding: 14px; }
  .quest-track { gap: 5px; }
  .quest-medal { width: 40px; height: 40px; font-size: 15px; }
  .quest-medal svg { font-size: 17px; }
  .track-link { width: 5px; }
  .track-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .phase-actions .btn, .vote-duo .btn { min-width: 0; flex: 1; }
  .vote-duo { width: 100%; gap: 12px; }
  .play-cards { gap: 12px; }
  .play-card { min-width: 0; max-width: none; padding: 16px 10px 14px; aspect-ratio: 3 / 4; }
  .play-cards .play-card:only-child { max-width: none; aspect-ratio: 3 / 3.2; }
  .play-card .pc-mark, .play-card .pc-mark svg { font-size: 46px; width: 46px; height: 46px; }
  .play-card .pc-label { font-size: 20px; }
  .pc-eyebrow { font-size: 8.5px; letter-spacing: .26em; }
  .qcard { width: 50px; height: 70px; }
  .qcard svg { width: 30px; height: 30px; }
  .role-card { height: 480px; }
  .rules-scroll { padding: 16px 16px 22px; }
  .rules-head { padding: 14px 16px; }
  .rules-head-text h2 { font-size: 16px; }
  .rules-tabs { padding: 8px 12px 0; }
  .rules-tab { padding: 9px 13px; font-size: 13px; }
  .intro-card { padding: 15px 16px; }
  .intro-steps { flex-direction: column; gap: 7px; }
  .intro-steps span { border-radius: 12px; }
  .over-card { padding: 26px 18px; }
  .over-roles { grid-template-columns: repeat(2, 1fr); }
  #app { padding-bottom: 34px; }
}
@media (max-width: 360px) {
  .seat { width: 54px; }
  .seat-name { font-size: 10px; }
  .seat-medal { width: 36px; }
  .cp-label { font-size: 8px; }
  .role-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .play-card .pc-mark, .play-card .pc-mark svg { font-size: 40px; width: 40px; height: 40px; }
  .play-card .pc-label { font-size: 18px; letter-spacing: .16em; }
  .play-card .pc-sub { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}