:root {
  --bg: #0e1015;
  --panel: #171a22;
  --panel2: #1d212b;
  --line: #2a303c;
  --text: #e9edf4;
  --muted: #8a93a5;
  --gold: #c9a227;
  --gold-dim: #7a6520;
  --good: #4a86d8;
  --evil: #c0453c;
  --ok: #3f9c6b;
  --warn: #d08b2c;
  --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* overflow-x: hidden 是兜底：只要文档比视口宽，安卓 Chrome 就会放开「缩小」，
   右边露出一条 html 底色的黑边。真正撑宽文档的元凶（.fl-ability）已经在 style_ts.css 修掉了，
   这里再上一道保险，将来哪个绝对定位元素冒出去也不会再放开缩放。 */
html { background: #06080c; overflow-x: hidden; }
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: transparent;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

/* 夜色场景：顶部月晕 + 三处环境光，替代原来的纯黑底 */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1000px 620px at 50% -16%, rgba(126,148,196,.20), transparent 68%),
    radial-gradient(720px 520px at 6% 10%, rgba(92,112,152,.11), transparent 72%),
    radial-gradient(820px 620px at 96% 90%, rgba(58,70,102,.12), transparent 70%),
    linear-gradient(180deg, #0b0e15 0%, #0a0c12 46%, #06080c 100%);
}
body::after {
  content: ''; position: fixed; top: -74px; right: -56px; width: 252px; height: 252px;
  border-radius: 50%; z-index: -1; pointer-events: none;
  background: radial-gradient(circle at 36% 34%, rgba(255,248,228,.20), rgba(190,205,235,.06) 56%, transparent 74%);
}

#app { max-width: 520px; margin: 0 auto; padding: 14px 14px 16px; min-height: 100vh; position: relative; }

.boot { color: var(--muted); text-align: center; padding-top: 40vh; }

/* ---------------- 界面最下端的「本局规则」条 ----------------
   只有进了对局才显示（.on）。它是 #app 之外的独立元素，不会被各屏的 innerHTML 冲掉，
   所以大厅 / 夜晚 / 白天 / 房主魔典 / 大屏 的最下面都挂着这两条。
   房主端是满屏魔典（.fl-full，position:fixed），那条要盖在上面，所以 z-index 给高一点。 */
.rules-foot {
  display: none;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 14px 14px;
  position: relative;
  z-index: 60;
}
.rules-foot.on { display: block; }
/* 房主端魔典 / 大屏：整屏是 fixed 的，规则条得跟着钉在视口底部才看得见 */
.rules-foot.stuck {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: none;
  padding: 0 10px 8px;
  pointer-events: none;
}
.rules-foot.stuck .rules-in { max-width: 520px; margin: 0 auto; }
.rules-foot .rules-in {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-left: 3px solid rgba(224, 139, 46, .55);
  background: rgba(20, 24, 32, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.rules-foot .rules-h {
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(224, 139, 46, .9);
  font-weight: 600;
}
.rules-foot .rules-li { display: flex; gap: 6px; align-items: baseline; }
.rules-foot .rules-li i { font-style: normal; opacity: .7; }
.rules-foot .rules-li b { font-weight: 700; }
.rules-foot .rules-li b.bad { color: var(--evil); }
.rules-foot .rules-li b.good { color: var(--good); }

h1 { font-size: 22px; margin: 6px 0 2px; letter-spacing: 2px; font-weight: 600; }
h2 { font-size: 15px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; letter-spacing: 1px; }
p { margin: 6px 0; }

.sub { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.mono { font-family: "SF Mono", Consolas, monospace; letter-spacing: 2px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: rgba(26, 30, 39, .74);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .34);
}
.card.tight { padding: 10px 12px; }
.card.warn { border-color: var(--warn); }
.card.done { opacity: .55; }

.row { display: flex; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------- 按钮 ---------------- */
button, .btn {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .06s, background .15s, border-color .15s;
  display: inline-block;
  text-align: center;
}
button:active { transform: scale(.975); }
button:disabled { opacity: .38; cursor: not-allowed; }
button.primary { background: linear-gradient(180deg, #b8912a, #8f6f1c); border-color: #d4ab35; color: #111; font-weight: 700; }
button.danger { border-color: var(--evil); color: #f0a9a3; }
button.ghost { background: transparent; }
button.big { width: 100%; padding: 15px; font-size: 17px; font-weight: 600; }
button.sm { padding: 7px 11px; font-size: 13px; border-radius: 9px; }

input, select {
  font: inherit;
  width: 100%;
  background: #0b0d12;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px;
  border-radius: 11px;
}
input:focus, select:focus { outline: none; border-color: var(--gold-dim); }

/* ---------------- 顶部状态条 ---------------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; margin-bottom: 12px;
  background: rgba(26, 30, 39, .72);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px;
  font-size: 13px;
}
.phase-tag { padding: 3px 10px; border-radius: 20px; font-weight: 700; font-size: 12px; }
.phase-night { background: #1b2440; color: #8fb0ef; border: 1px solid #2b3a63; }
.phase-day { background: #3a3320; color: #e2c66a; border: 1px solid #5c5027; }
.phase-lobby { background: #242832; color: var(--muted); border: 1px solid var(--line); }
.phase-ended { background: #3a1f1d; color: #eb9b93; border: 1px solid #5c2b27; }

/* ---------------- 座位 ---------------- */
.seats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seat {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 6px; text-align: center; font-size: 13px; position: relative;
  overflow: hidden;
}
.seat .n { font-size: 11px; color: var(--muted); }
.seat .nm { font-weight: 600; word-break: break-all; }
.seat.dead { opacity: .45; }
.seat.dead .nm { text-decoration: line-through; }
.seat.me { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-dim) inset; }
.seat.good { border-left: 3px solid var(--good); }
.seat.evil { border-left: 3px solid var(--evil); }
.seat.nominated { background: #2a2130; }
.seat .tag { position: absolute; top: 3px; right: 5px; font-size: 10px; color: var(--muted); }

/* ---------------- 身份大卡 ---------------- */
.rolecard {
  border-radius: 16px; padding: 20px 16px; text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, #2b2416 0%, #15171d 60%);
  border: 2px solid var(--gold-dim);
  animation: reveal .5s ease;
}
@keyframes reveal { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.rolecard.good { border-color: #2f4f7c; background: radial-gradient(120% 90% at 50% 0%, #16233a 0%, #12151b 60%); }
.rolecard.evil { border-color: #7a2f2a; background: radial-gradient(120% 90% at 50% 0%, #351715 0%, #161113 60%); }
.rolecard .rn { font-size: 30px; font-weight: 700; letter-spacing: 3px; margin: 6px 0; }
.rolecard .team { font-size: 13px; color: var(--muted); letter-spacing: 2px; }
.rolecard .ab { margin-top: 14px; font-size: 14px; color: #cfd6e2; line-height: 1.7; text-align: left; }
.rolecard .hint { margin-top: 12px; font-size: 12px; color: var(--warn); }

/* ---------------- 夜晚 ---------------- */
.night-veil {
  position: fixed; inset: 0; background: #05070a; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
}
.night-veil .moon { font-size: 40px; color: #2f3a55; margin-bottom: 18px; }
.night-veil h2 { font-size: 18px; color: #6a7690; }
.night-veil p { color: #4e586b; font-size: 14px; }
.awake-card { border-color: var(--gold); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(201,162,39,.35); } 50% { box-shadow: 0 0 0 10px rgba(201,162,39,0); } }

.info-box {
  background: rgba(14, 18, 26, .78); border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px;
  padding: 14px; margin-top: 10px; line-height: 1.8;
}
/* 坏人相认：一眼能认出来的红边卡 */
.card.evil-card {
  border-color: rgba(192, 69, 60, .5);
  background: linear-gradient(180deg, rgba(52, 26, 24, .78), rgba(26, 30, 39, .76));
}
.info-box .big { font-size: 22px; font-weight: 700; color: var(--gold); letter-spacing: 1px; }

.pickgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.pick {
  padding: 14px 6px; border-radius: 12px;
  background: rgba(32, 37, 48, .82);
  border: 1px solid rgba(255, 255, 255, .08);
  text-align: center; font-size: 14px; cursor: pointer;
}
.pick .big { font-size: 19px; font-weight: 700; letter-spacing: 1px; }
.pick.sel { background: #3a3218; border-color: var(--gold); color: #ffe9a8; }
.pick.dis { opacity: .3; }
.pick.dead { opacity: .62; border-style: dashed; }

/* ---------------- 投票 ---------------- */
.votebar { height: 8px; border-radius: 5px; background: #232833; overflow: hidden; margin-top: 6px; }
.votebar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); }
.votecount { font-size: 26px; font-weight: 700; letter-spacing: 1px; }
.pass { color: var(--ok); }
.fail { color: var(--muted); }

/* 举手看板：投票期间实时列出「谁举手了 / 谁还没举手」（投票是公开行为） */
.voteboard { margin-top: 12px; border-top: 1px dashed #2a303c; padding-top: 10px; }
.voteboard .vb-row { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; }
.voteboard .vb-h { flex: 0 0 76px; font-size: 13px; color: #cfd7e4; font-weight: 600; }
.voteboard .vb-seats { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; }
.voteboard .vd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px;
  font-size: 13px; font-style: normal; font-weight: 700;
  background: rgba(42, 48, 60, .9); color: #7d8798; border: 1px solid rgba(255, 255, 255, .07);
}
.voteboard .vd.yes { background: #234a2b; color: #b8f0c4; border-color: #3f7a4d; }
.voteboard em.tiny { font-style: normal; }

/* 大屏顶栏里的举手状态条（大屏一屏不滚，投票信息得挤进顶部卡片） */
.screen-votes { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; align-items: center; }
.screen-votes .sv-nom { font-size: clamp(15px, 1.7vw, 21px); color: #ffe9a8; font-weight: 700; }
.screen-votes .sv-row { display: flex; align-items: center; gap: 10px; }
.screen-votes .sv-h { font-size: 14px; color: #cfd7e4; font-weight: 700; min-width: 78px; text-align: right; }
.screen-votes .vb-seats { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---------------- 旁白 ---------------- */
.feed { font-size: 13px; color: #b9c1d0; }
.feed .item { padding: 7px 0; border-bottom: 1px dashed #232833; white-space: pre-wrap; }
.feed .item:last-child { border-bottom: none; }

/* ---------------- 说书人 ---------------- */
.grim { font-size: 13px; }
.grim .g-row { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px solid #21262f; align-items: center; }
.grim .g-seat { width: 22px; color: var(--muted); }
.grim .g-name { width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grim .g-role { flex: 1; font-weight: 600; }
.grim .g-role.good { color: #86aede; }
.grim .g-role.evil { color: #e08a83; }
.badge { font-size: 10px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.badge.bad { border-color: #6b3a30; color: #e2a49b; }
.badge.drunk { border-color: #5a4a20; color: #d9bd6a; }
.q { font-size: 13px; padding: 8px 0; border-bottom: 1px solid #21262f; }
.q .ord { color: var(--muted); margin-right: 6px; }

/* ================= 城镇广场 · 说书人魔典主界面 =================
   布局对照 botcgrimoire：顶部工具条 → 中央令牌圆环 → 底部「恶魔的伪装身份」 */
.ts-top {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 9px; margin-bottom: 10px;
  background: rgba(16, 20, 28, .80);
  border: 1px solid rgba(255, 255, 255, .09); border-radius: 12px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
}
.ts-top button {
  padding: 6px 10px; border-radius: 9px; font-size: 13px;
  background: rgba(30, 36, 48, .85); border: 1px solid rgba(255, 255, 255, .08);
}
.ts-top .ts-title { flex: 1; text-align: center; font-weight: 700; letter-spacing: 1px; }
.ts-top .ts-tab { background: rgba(30, 36, 48, .85); }
.ts-top .ts-tab.on { background: #b8722a; border-color: #e0954a; color: #fff; }
.ts-top .ts-gear { padding: 6px 9px; }

.ts-stage {
  position: relative; margin: 4px auto 0; width: 100%; max-width: 560px;
  padding: 12px 0 30px;   /* 上下留白给「座位号」和「角色名/玩家名」 */
  border-radius: 16px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(38, 46, 62, .55), transparent 70%),
    radial-gradient(90% 70% at 50% 100%, rgba(20, 26, 38, .6), transparent 72%);
}
.ts-ring { position: relative; width: 100%; aspect-ratio: 1 / 1; }

/* 中央剧本徽标 */
.ts-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 34%; text-align: center; pointer-events: none;
}
.ts-center .ts-logo { width: 100%; max-height: 66px; object-fit: contain; margin-bottom: 2px; }
.ts-center .ts-script {
  font-size: 17px; font-weight: 800; letter-spacing: 1px; color: #f6ecd6;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
}
.ts-center .ts-sub { font-size: 9px; color: #9aa3b2; margin-top: 2px; line-height: 1.35; }
.ts-center .ts-stats { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; font-size: 11px; }
.ts-center .ts-stats .ln { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }
.ts-center .ts-stats .ln.comp { gap: 5px; }
.ts-center .ts-stats b { color: #e9edf4; font-weight: 700; }
.ts-center .ts-room { font-size: 10px; color: #8a93a5; margin-top: 4px; }
/* 阵营色：镇民深蓝 / 外来者浅蓝 / 爪牙橙 / 恶魔红 */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; vertical-align: middle; margin-right: 2px; }
.dot.tf { background: #2f5fd0; }
.dot.ou { background: #7fb6ea; }
.dot.mi { background: #e08b2e; }
.dot.de { background: #d0453c; }

/* ---------------- 座位令牌 ----------------
   位置用「令牌圆心落在圆环上」来定：外层盒子只有令牌一个在流内子元素，
   座位号/角色名/玩家名/提醒标记全部绝对定位挂在外侧 —— 这样放大圆环不会把立绘顶偏。 */
.ts-seatbox { position: absolute; transform: translate(-50%, -50%); width: 13.5%; text-align: center; }
.ts-token {
  position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 50%;
  padding: 0; cursor: pointer; overflow: hidden;
  background: radial-gradient(circle at 50% 32%, rgba(62, 70, 88, .96), rgba(14, 17, 24, .98));
  border: 2px solid rgba(255, 255, 255, .17);
  box-shadow: 0 5px 16px rgba(0, 0, 0, .55), inset 0 0 14px rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center;
}
.ts-token img { width: 84%; height: 84%; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.ts-token .fb { font-size: 15px; font-weight: 700; color: #cfd6e2; }
.ts-no {
  position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -1px);
  font-size: 11px; font-weight: 700; line-height: 1.1; color: #eef2f8;
  text-shadow: 0 1px 3px #000, 0 0 6px #000;
}
.ts-mks { position: absolute; left: -9%; top: -7%; display: flex; gap: 2px; z-index: 3; }
.ts-mks .tk {
  display: block; min-width: 15px; height: 15px; line-height: 14px; padding: 0 2px;
  border-radius: 8px; font-size: 8.5px; font-style: normal; font-weight: 700; color: #fff;
  border: 1px solid rgba(255, 255, 255, .55); box-shadow: 0 1px 4px rgba(0, 0, 0, .6);
  white-space: nowrap;
}
.ts-role {
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, 1px);
  font-size: 9px; line-height: 1.25; white-space: nowrap; color: #cbd3e0;
  text-shadow: 0 1px 3px #000;
}
.ts-role.t-townsfolk { color: #93b9f0; }
.ts-role.t-outsider { color: #adcff0; }
.ts-role.t-minion { color: #e8a45e; }
.ts-role.t-demon { color: #ea8b84; }
.ts-name {
  position: absolute; left: 50%; top: 100%; margin-top: 13px; transform: translate(-50%, 0);
  font-size: 9px; white-space: nowrap; color: #8a93a5; text-shadow: 0 1px 3px #000;
}
.ts-token.dead { opacity: .46; filter: grayscale(.7); }
.ts-token.manual { border-color: #d9bd6a; }
.ts-seatbox.me .ts-token { border-color: #4a86d8; }
.ts-seatbox.nom .ts-token { border-color: #d08b2c; box-shadow: 0 0 0 3px rgba(208,139,44,.35); }

/* 令牌之间的 ⊕ = 给顺时针下一位加提醒标记 */
.ts-plus {
  position: absolute; transform: translate(-50%, -50%);
  width: 22px; height: 22px; padding: 0; border-radius: 50%;
  background: rgba(22, 26, 36, .94); border: 1.5px solid rgba(224, 149, 74, .85);
  color: #e0954a; font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .55);
}
.ts-plus:active { background: #b8722a; color: #fff; }
.ts-top .ts-timer { margin-left: auto; }
.ts-bottom { display: flex; gap: 8px; margin-top: 10px; }
.ts-bottom button { flex: 1; padding: 10px; border-radius: 10px; font-size: 13px; }

/* 圆环再放大一点：往两侧吃掉页面留白（宽 362 → 374） */
.ts-stage { width: auto; margin: 4px -6px 0; }
/* 圆片 / 文字永远压在令牌之上，否则相邻令牌的圆会盖住它们 */
.ts-token { z-index: 1; }
.ts-mks, .ts-name, .ts-cap { z-index: 4; }

/* ---- 令牌：立绘尽量占满整个圆（放大 16%，多出来的边被圆裁掉） ----
   圈内下缘叠一行「座位号(高亮) + 角色名」；玩家名在圈外下方。 */
.ts-token img { width: 116%; height: 116%; object-fit: contain; }
.ts-token .fb { font-size: 20px; font-weight: 800; }
.ts-token .ts-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center; gap: 2px;
  padding: 2px 2px 2px; background: linear-gradient(rgba(6, 8, 12, 0), rgba(6, 8, 12, .9) 48%);
  font-size: 8.5px; line-height: 1.25; white-space: nowrap; overflow: hidden;
}
.ts-token .ts-no {
  position: static; left: auto; bottom: auto; transform: none;
  display: inline-block; min-width: 12px; padding: 0 2px; border-radius: 5px;
  background: #d9bd6a; color: #241d10; font-size: 8.5px; font-weight: 800;
  font-style: normal; text-shadow: none;
}
.ts-token .ts-rn {
  font-style: normal; font-weight: 700; color: #eef2f8; text-shadow: 0 1px 2px #000;
  overflow: hidden; text-overflow: ellipsis;
}
.ts-token .ts-rn.t-townsfolk { color: #9cc0f4; }
.ts-token .ts-rn.t-outsider { color: #b6d4f2; }
.ts-token .ts-rn.t-minion { color: #f0ae68; }
.ts-token .ts-rn.t-demon { color: #f09189; }

/* 圈外下方只有一行玩家名 */
.ts-name { position: absolute; left: 50%; top: 100%; margin-top: 1px; transform: translate(-50%, 0); }

/* ---- 玩家端「我给他标身份」的角色选择格 ---- */
.cghead { margin: 10px 0 4px; font-size: 11px; color: #8a93a5; }
.cgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cchar {
  padding: 4px 2px 3px; border-radius: 10px; background: rgba(24, 28, 38, .9);
  border: 1px solid rgba(255, 255, 255, .10); color: #dbe2ec; font-size: 10px; line-height: 1.15;
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer;
}
.cchar img { width: 40px; height: 40px; object-fit: contain; }
.cchar.on { border-color: #d9bd6a; background: rgba(64, 51, 20, .92); }
.cchar span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 玩家端：公示栏缩小一点，主角是圆环 */
.card.compact { padding: 10px 12px; }
.card.compact h2 { font-size: 13px; }
.card.compact .feed .item { font-size: 12px; line-height: 1.45; }

/* ---------------- 环形魔典（旧版 · 仍用于点选面板） ---------------- */
.clock {
  position: relative; width: 100%; max-width: 470px; margin: 10px auto 4px;
  aspect-ratio: 1 / 1;
}
.clock-hub {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 34%; height: 34%; border-radius: 50%;
  background: radial-gradient(circle at 50% 28%, rgba(42, 48, 63, .95), rgba(13, 16, 22, .96));
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, .55), 0 0 0 6px rgba(255, 255, 255, .02);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; font-size: 11px; color: var(--muted); line-height: 1.5; padding: 6px;
}
.clock-hub b { color: var(--gold); font-size: 15px; margin-bottom: 2px; letter-spacing: 1px; }
.cseat {
  position: absolute; transform: translate(-50%, -50%);
  width: 20.5%; aspect-ratio: 1 / 1; padding: 2px; border-radius: 50%;
  background: rgba(32, 37, 48, .86);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .34);
  color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; font-family: inherit;
}
.cseat:active { transform: translate(-50%, -50%) scale(.94); }
.cseat .cnum { font-size: 9px; color: var(--muted); line-height: 1.1; }
.cseat .cname { font-size: 11px; font-weight: 600; line-height: 1.25; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cseat .crole { font-size: 9.5px; color: #86aede; line-height: 1.2; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cseat.evil { border-color: #7a2f2a; }
.cseat.evil .crole { color: #e08a83; }
.cseat.me { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-dim) inset; }
.cseat.nom { border-color: var(--warn); background: #2a2130; }
.cseat.dead { opacity: .48; }
.cseat.dead .cname { text-decoration: line-through; }
.cseat .cmk { position: absolute; top: 3px; right: 5px; font-size: 8.5px; color: var(--muted); letter-spacing: -1px; }
.cseat .cmarks { position: absolute; bottom: 3px; display: flex; gap: 3px; }
.cseat .cmarks i { width: 5px; height: 5px; border-radius: 50%; display: block; }
.cm-bad { background: #e0524a; } .cm-warn { background: #d9bd6a; } .cm-good { background: #4ea87a; }

/* 底部弹层（点座位安身份） */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
  max-height: 82vh; overflow-y: auto;
  background: #171a21; border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0; padding: 16px 16px 30px;
  transform: translateY(105%); transition: transform .24s ease;
  box-shadow: 0 -14px 40px rgba(0,0,0,.5);
}
.sheet.on { transform: translateY(0); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-head b { font-size: 16px; }
.sheet .slabel { font-size: 11px; color: var(--muted); margin: 14px 0 6px; letter-spacing: 1px; }
.charlist { max-height: 38vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.charlist .crow {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px;
  border-bottom: 1px solid #21262f; font-size: 13px; cursor: pointer;
}
.charlist .crow:last-child { border-bottom: 0; }
.charlist .crow.on { background: #1e2836; }
.charlist .crow .tid { width: 30px; font-size: 10px; color: var(--muted); }
.charlist .crow .tnm { flex: 1; font-weight: 600; }
.charlist .crow .tab { font-size: 10px; color: var(--muted); }

/* ---------------- 大屏 ---------------- */
.screen-wrap { max-width: 1000px; margin: 0 auto; padding: 20px; }
.ring { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ring .seat { padding: 14px 8px; font-size: 15px; }

/* ---------------- 杂项 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #22262f; border: 1px solid var(--line); color: var(--text);
  padding: 11px 18px; border-radius: 12px; font-size: 14px; opacity: 0;
  transition: all .25s; pointer-events: none; z-index: 200; max-width: 88vw; text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.qr { background: #fff; padding: 8px; border-radius: 10px; display: inline-block; max-width: 100%; }
.qr img { display: block; width: auto; height: auto; max-width: 100%; }

.divider { height: 1px; background: var(--line); margin: 14px 0; }
.tiny { font-size: 12px; color: var(--muted); }
.code-input { font-size: 26px; letter-spacing: 10px; text-align: center; font-weight: 700; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { flex: 1; }
.tabs button.on { background: #33291a; border-color: var(--gold-dim); color: #f0d68a; }

/* ---------------- 角色图鉴 ---------------- */
details.char { border-top: 1px solid var(--line); padding: 9px 0; }
details.char summary { cursor: pointer; list-style: none; font-size: 14px; }
details.char summary::-webkit-details-marker { display: none; }
details.char summary::before { content: '▸ '; color: var(--muted); }
details.char[open] summary::before { content: '▾ '; }
details.char .cab { font-size: 13px; line-height: 1.7; color: var(--text); margin-top: 8px; }
details.char a.sm { display: inline-block; text-decoration: none; border-color: var(--gold-dim); color: var(--gold); }
/* 伪装身份：默认折叠。身份格一屏几十个角色，摊开会让人滚半天才找得到 */
details.fakebox { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
details.fakebox summary { cursor: pointer; list-style: none; font-size: 14px; color: var(--muted); }
details.fakebox summary::-webkit-details-marker { display: none; }
details.fakebox summary::before { content: '▸ '; }
details.fakebox[open] summary::before { content: '▾ '; }
details.fakebox summary b { color: var(--gold); }
details.fakebox[open] summary { margin-bottom: 6px; }
.wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.wrap button.on { background: #33291a; border-color: var(--gold-dim); color: #f0d68a; }

/* -------- 夜间倒计时条（少爷 2026-09-22：信息卡给 2 分钟，别一闪就跳过） -------- */
.cdbar {
  position: relative; overflow: hidden; height: 30px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .05);
  display: flex; align-items: center; justify-content: center; margin: 10px 0 12px;
}
/* 进度条：从满格往左退。宽度由 app.js 的 cdTick() 每 0.4s 写一次 */
.cdbar .cd-fill {
  position: absolute; left: 0; top: 0; height: 100%; width: 100%;
  background: linear-gradient(90deg, rgba(214, 178, 106, .35), rgba(214, 178, 106, .12));
  transition: width .4s linear;
}
.cdbar .cd-text { position: relative; font-size: 13px; color: var(--muted); letter-spacing: .3px; }
.cdbar .cd-text b { color: var(--gold); font-variant-numeric: tabular-nums; }
/* 最后 15 秒变红提示「要自动继续了」 */
.cdbar.soon .cd-fill { background: linear-gradient(90deg, rgba(214, 90, 70, .45), rgba(214, 90, 70, .15)); }
.cdbar.soon .cd-text b { color: #e2705a; }
