/* ============================================================
   狼人杀 · 样式
   ============================================================ */
:root {
  --bg: #0b0d16;
  --bg2: #12162a;
  --panel: #161b30;
  --panel2: #1c2340;
  --line: #2a3154;
  --text: #e8ecff;
  --dim: #8b93b8;
  --dim2: #5d6688;
  --red: #e8455f;
  --red-dark: #a52a41;
  --amber: #f0b429;
  --green: #3fbf7f;
  --blue: #4a8ff0;
  --purple: #9b6bf0;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0,0,0,.45);

  /* 语义色：夜晚/白天两套主题都会覆盖这些，组件里不要写死颜色 */
  --wolf: #ff8b9e;
  --good: #9fe6c2;
  --blue-lite: #a9c8ff;
  --purple-lite: #c9b3ff;
  --tint: rgba(255,255,255,.05);
  --pane-bg: rgba(0,0,0,.18);
  --chip-bg: rgba(155,107,240,.18);
  --text-shadow: 0 1px 3px rgba(0,0,0,.8);
}

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

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  overflow: hidden;
}

#app { height: 100%; position: relative; }

.screen {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.screen.active { display: flex; }

/* ============================================================
   场景背景（教堂 / 乌鸦 / 铁门）：夜晚与白天两套，交叉淡入淡出
   ============================================================ */

.scene-layer {
  position: absolute; inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.scene {
  position: absolute; inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .9s ease, visibility 0s linear .9s;
}
.scene.active {
  opacity: 1;
  visibility: visible;
  transition: opacity .9s ease, visibility 0s;
}
.scene svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* 隐藏的那一套不要白跑动画 */
.scene:not(.active) svg * { animation-play-state: paused !important; }

.bg-scrim { position: absolute; inset: 0; }
#screen-game[data-phase="night"] .bg-scrim {
  background:
    radial-gradient(ellipse 88% 72% at 52% 42%, rgba(4,6,13,0) 0%, rgba(4,6,13,.14) 58%, rgba(4,6,13,.52) 100%),
    linear-gradient(to bottom, rgba(4,6,13,.26) 0%, rgba(4,6,13,.04) 30%, rgba(4,6,13,.36) 100%);
}
#screen-game[data-phase="day"] .bg-scrim {
  background:
    radial-gradient(ellipse 88% 72% at 52% 42%, rgba(255,250,236,0) 0%, rgba(255,250,236,.05) 58%, rgba(255,246,224,.26) 100%),
    linear-gradient(to bottom, rgba(255,252,242,.16) 0%, rgba(255,255,255,.02) 32%, rgba(255,244,214,.22) 100%);
}

/* 游戏内容压在场景之上 */
#screen-game > .topbar,
#screen-game > .game-body,
#screen-game > .mybar,
#screen-game > .action-pane { position: relative; z-index: 1; }
#screen-game > .topbar { z-index: 2; }

/* 夜晚主题（默认）下，面板略带透明，让场景透出来 */
#screen-game {
  --panel: rgba(20,25,45,.84);
  --panel2: rgba(29,36,66,.90);
  --bg2: rgba(15,19,36,.93);
  --line: rgba(70,82,132,.55);
  /* 关键：body 上的 color 已经在根元素解析过了，子元素继承的是解析结果，
     不会重新取白天的 --text。必须在这里再声明一次，让白天变量生效。 */
  color: var(--text);
}

/* 白天主题：整体切成明亮配色 */
#screen-game[data-phase="day"] {
  --bg2: rgba(255,253,248,.88);
  --panel: rgba(255,255,255,.82);
  --panel2: rgba(255,255,255,.92);
  --line: rgba(146,116,72,.36);
  --text: #2c2418;
  --dim: #4a4136;
  --dim2: #6d6150;
  --amber: #97600a;
  --red: #c02740;
  --wolf: #b3243c;
  --good: #1c7a4c;
  --blue-lite: #2f5aa8;
  --purple-lite: #5b3bb5;
  --tint: rgba(92,70,40,.07);
  --pane-bg: rgba(255,255,255,.34);
  --chip-bg: rgba(155,107,240,.14);
  --text-shadow: 0 1px 1px rgba(255,255,255,.75);
}

/* ---------------- 动画 ---------------- */

@keyframes twinkle { 0%, 100% { opacity: .18 } 50% { opacity: 1 } }
@keyframes drift { from { transform: translateX(-150px) } to { transform: translateX(150px) } }
@keyframes fogDrift { from { transform: translateX(-100px) } to { transform: translateX(100px) } }
@keyframes wingFlap { 0%, 100% { transform: scaleY(1) } 50% { transform: scaleY(-.45) } }
@keyframes crowBob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-10px) } }
@keyframes birdBob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-9px) } }
@keyframes softPulse { 0%, 100% { opacity: .7 } 50% { opacity: 1 } }
@keyframes batFlap { 0%, 100% { transform: scaleY(1) } 50% { transform: scaleY(-.35) } }
@keyframes batBob {
  0%, 100% { transform: translateY(0) rotate(-2deg) }
  50% { transform: translateY(-13px) rotate(3deg) }
}
@keyframes eyeBlink { 0%, 88%, 100% { opacity: .95 } 92% { opacity: 0 } 96% { opacity: .8 } }
@keyframes wispFloat {
  0%, 100% { opacity: .32; transform: translateY(0) }
  50% { opacity: .72; transform: translateY(-9px) }
}

.scene .bat { animation: batBob 4.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.scene .bat .bwing { animation: batFlap .34s ease-in-out infinite; transform-box: fill-box; }
.scene .bat .bwing-l { transform-origin: right center; }
.scene .bat .bwing-r { transform-origin: left center; }
.scene .eyes { animation: eyeBlink 7.5s ease-in-out infinite; }
.scene .wisp { animation: wispFloat 6.5s ease-in-out infinite; transform-box: fill-box; }

.scene .tw { animation: twinkle 3s ease-in-out infinite; }
.scene .cloud { animation: drift 120s linear infinite alternate; }
.scene .fog { animation: fogDrift 90s linear infinite alternate; }
.scene .moon-glow { animation: softPulse 7s ease-in-out infinite; }
.scene .pulse { animation: softPulse 9s ease-in-out infinite; }
.scene .lantern { animation: softPulse 3.4s ease-in-out infinite; }
.scene .crow { animation: crowBob 3.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.scene .crow .wing { animation: wingFlap .58s ease-in-out infinite; transform-box: fill-box; }
.scene .crow .wing-l { transform-origin: right center; }
.scene .crow .wing-r { transform-origin: left center; }
.scene .bird { animation: birdBob 3.2s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .scene svg * { animation: none !important; }
  .scene { transition: none; }
}

.hidden { display: none !important; }
.muted { color: var(--dim); }
.dot { color: var(--dim2); margin: 0 8px; }

/* ---------------- 首页 ---------------- */

#screen-home { justify-content: center; align-items: center; }
.home-bg { position: absolute; inset: 0; background: var(--bg); overflow: hidden; }
.home-bg .scene { opacity: 1; visibility: visible; }
.home-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 58% 46% at 50% 44%, rgba(8,10,20,.72) 0%, rgba(8,10,20,.34) 72%, rgba(8,10,20,.62) 100%),
    linear-gradient(to bottom, rgba(8,10,20,.55) 0%, rgba(8,10,20,.15) 45%, rgba(8,10,20,.72) 100%);
}
.home-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: 560px;
  padding: 24px;
  display: flex; flex-direction: column; gap: 28px;
}
.logo { text-align: center; }
.logo-moon { font-size: 52px; filter: drop-shadow(0 0 24px rgba(240,180,41,.6)); animation: float 4s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
.logo h1 {
  margin: 6px 0 2px; font-size: 40px; letter-spacing: 6px; font-weight: 800;
  background: linear-gradient(180deg, #fff, #b9c4ff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.subtitle { margin: 0; color: var(--dim2); letter-spacing: 4px; font-size: 12px; text-transform: uppercase; }

.mode-cards { display: flex; flex-direction: column; gap: 14px; }
.mode-card {
  display: flex; align-items: center; gap: 16px;
  padding: 18px; text-align: left; cursor: pointer;
  background: linear-gradient(135deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); font-family: inherit; font-size: inherit;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow);
}
.mode-card:hover { transform: translateY(-2px); border-color: var(--purple); }
.mode-card:active { transform: scale(.985); }
.mc-icon { font-size: 34px; flex: 0 0 auto; }
.mc-body { flex: 1; min-width: 0; }
.mc-title { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.mc-desc { font-size: 12.5px; color: var(--dim); line-height: 1.45; }
.mc-arrow { color: var(--dim2); font-size: 20px; }
.home-foot { text-align: center; color: var(--dim); font-size: 13px; }
.link-btn {
  background: none; border: none; color: var(--dim); cursor: pointer;
  font-family: inherit; font-size: 13px; padding: 4px 2px;
}
.link-btn:hover { color: var(--text); }

/* ---------------- 顶栏 ---------------- */

.topbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
  padding-top: calc(10px + env(safe-area-inset-top));
}
.tb-title { flex: 1; font-weight: 700; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.tb-right { width: 36px; }
.icon-btn {
  width: 36px; height: 36px; flex: 0 0 auto;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text);
  font-size: 17px; cursor: pointer; line-height: 1;
}
.icon-btn:hover { background: var(--panel2); }

.chip {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  background: var(--chip-bg); color: var(--purple-lite);
  font-size: 12px; font-weight: 600; border: 1px solid rgba(155,107,240,.3);
}
.chip-dim { background: rgba(139,147,184,.12); color: var(--dim); border-color: var(--line); }

/* ---------------- 配置页 ---------------- */

.setup-scroll { flex: 1; overflow-y: auto; padding: 18px 18px 40px; -webkit-overflow-scrolling: touch; }
.setup-scroll > * { max-width: 640px; margin-left: auto; margin-right: auto; }

.field { margin-bottom: 26px; }
.field-label { display: block; font-size: 13px; font-weight: 700; color: var(--dim); margin-bottom: 10px; letter-spacing: .5px; }
.field-hint { font-size: 12px; color: var(--dim2); margin-top: 8px; }

.count-row { display: flex; gap: 8px; flex-wrap: wrap; }
.count-btn {
  width: 46px; height: 46px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font-size: 16px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: all .12s;
}
.count-btn:hover { border-color: var(--purple); }
.count-btn.active { background: var(--purple); border-color: var(--purple); color: #fff; box-shadow: 0 0 18px rgba(155,107,240,.5); }

.board-list { display: flex; flex-direction: column; gap: 9px; }
.board-card {
  text-align: left; padding: 13px 15px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text); font-family: inherit;
  transition: all .12s;
}
.board-card:hover { border-color: var(--purple); }
.board-card.active { border-color: var(--purple); background: linear-gradient(135deg, rgba(155,107,240,.16), var(--panel)); }
.bc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.bc-name { font-weight: 700; font-size: 15px; }
.bc-tag {
  font-size: 10px; padding: 2px 7px; border-radius: 6px;
  background: rgba(240,180,41,.15); color: var(--amber); font-weight: 700;
}
.bc-desc { font-size: 12px; color: var(--dim); line-height: 1.45; }
.bc-ratio { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pill {
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  border: 1px solid var(--line); color: var(--dim); background: rgba(255,255,255,.02);
}
.pill.wolf { color: #ff8b9e; border-color: rgba(232,69,95,.4); background: rgba(232,69,95,.1); }
.pill.god { color: #a9c8ff; border-color: rgba(74,143,240,.4); background: rgba(74,143,240,.1); }
.pill.civ { color: #9fe6c2; border-color: rgba(63,191,127,.35); background: rgba(63,191,127,.08); }

.seg { display: flex; flex-direction: column; gap: 9px; }
.seg-btn {
  text-align: left; padding: 13px 15px; cursor: pointer; font-family: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); transition: all .12s;
}
.seg-btn b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.seg-btn span { font-size: 12px; color: var(--dim); }
.seg-btn.active { border-color: var(--purple); background: linear-gradient(135deg, rgba(155,107,240,.16), var(--panel)); }

.names-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 9px; }
.name-item { position: relative; }
.name-item .seat-tag {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 700; color: var(--dim2); pointer-events: none;
}
.name-item input {
  width: 100%; padding: 10px 10px 10px 40px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font-family: inherit; font-size: 14px;
}
.name-item input:focus { outline: none; border-color: var(--purple); }
.name-item input.mine { border-color: var(--amber); }

.collapse-head {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 13px 15px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text); font-family: inherit;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.adv-body { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.adv-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 8px;
}
.adv-row .ar-text { flex: 1; min-width: 0; }
.adv-row .ar-name { font-size: 13.5px; font-weight: 600; }
.adv-row .ar-desc { font-size: 11.5px; color: var(--dim2); line-height: 1.4; }
.switch {
  flex: 0 0 auto; width: 46px; height: 26px; border-radius: 20px;
  background: var(--line); position: relative; cursor: pointer; transition: background .18s;
  border: none;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform .18s;
}
.switch.on { background: var(--purple); }
.switch.on::after { transform: translateX(20px); }
select.ar-select {
  flex: 0 0 auto; background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-family: inherit; font-size: 13px;
}

.setup-actions { padding-top: 6px; }
.btn-primary {
  width: 100%; padding: 15px; border-radius: 12px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #9b6bf0, #6b4ae0);
  color: #fff; font-size: 16px; font-weight: 700; font-family: inherit;
  box-shadow: 0 6px 24px rgba(155,107,240,.4);
  transition: transform .12s, box-shadow .12s;
}
.btn-primary:hover { box-shadow: 0 8px 30px rgba(155,107,240,.6); }
.btn-primary:active { transform: scale(.985); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  width: 100%; padding: 14px; border-radius: 12px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--dim);
  font-size: 15px; font-family: inherit; font-weight: 600;
}
.btn-ghost:hover { color: var(--text); border-color: var(--purple); }
.setup-err { color: var(--red); font-size: 13px; text-align: center; margin-top: 10px; min-height: 18px; }

/* ---------------- 游戏页 ---------------- */

.game-body { flex: 1; display: flex; min-height: 0; }

.players-pane {
  flex: 0 0 132px; overflow-y: auto; padding: 10px;
  border-right: 1px solid var(--line); background: var(--pane-bg);
  display: flex; flex-direction: column; gap: 7px;
}
.pcard {
  padding: 8px 9px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); position: relative; transition: all .18s;
}
.pcard .pc-top { display: flex; align-items: center; gap: 6px; }
.pcard .pc-seat {
  font-size: 11px; font-weight: 800; color: var(--dim2);
  background: var(--tint); border-radius: 5px; padding: 0 5px;
}
.pcard .pc-name { font-size: 12.5px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .pc-role { font-size: 11px; margin-top: 3px; }
.pcard.me { border-color: var(--amber); box-shadow: 0 0 0 1px rgba(240,180,41,.3); }
.pcard.dead { opacity: .38; }
.pcard.dead .pc-name { text-decoration: line-through; }
.pcard.speaking { border-color: var(--green); box-shadow: 0 0 14px rgba(63,191,127,.35); }
.pcard.targetable { cursor: pointer; }
.pcard.targetable:hover { border-color: var(--red); background: rgba(232,69,95,.12); }
.pcard.picked { border-color: var(--red); background: rgba(232,69,95,.2); box-shadow: 0 0 14px rgba(232,69,95,.4); }
.pcard .pc-badges { display: flex; gap: 3px; margin-top: 3px; flex-wrap: wrap; }
.badge { font-size: 9.5px; padding: 1px 5px; border-radius: 4px; font-weight: 700; }
.badge.wolf { background: rgba(232,69,95,.22); color: var(--wolf); }
.badge.good { background: rgba(63,191,127,.18); color: var(--good); }
.badge.idiot { background: rgba(240,180,41,.2); color: var(--amber); }
.badge.ai { background: rgba(139,147,184,.15); color: var(--dim); }

/* 中间栏压在场景之上，用磨砂面板保证文字可读，同时还能看见背景 */
.center-pane {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background: rgba(9,11,22,.30);
  backdrop-filter: blur(2px) saturate(1.06);
  -webkit-backdrop-filter: blur(2px) saturate(1.06);
}
#screen-game[data-phase="day"] .center-pane { background: rgba(255,253,247,.40); }
.log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; -webkit-overflow-scrolling: touch; }

.entry { font-size: 13.5px; line-height: 1.55; animation: fadeIn .22s ease; text-shadow: var(--text-shadow); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }
.entry.phase {
  text-align: center; color: var(--dim); font-size: 11.5px; font-weight: 700;
  letter-spacing: 2px; margin: 10px 0 4px; position: relative;
}
.entry.phase::before, .entry.phase::after {
  content: ''; position: absolute; top: 50%; width: 22%; height: 1px; background: var(--line);
}
.entry.phase::before { left: 0; } .entry.phase::after { right: 0; }
.entry.dawn {
  text-align: center; padding: 9px 12px; border-radius: 10px;
  background: rgba(240,180,41,.10); border: 1px solid rgba(240,180,41,.28);
  color: var(--amber); font-weight: 600; font-size: 13px;
}
#screen-game[data-phase="day"] .entry.dawn {
  background: rgba(240,180,41,.22);
  border-color: rgba(176,128,16,.42);
  color: #7d4e02;
}
.entry.death { color: var(--wolf); font-weight: 600; }
.entry.vote { color: var(--blue-lite); font-size: 12.5px; }
.entry.over {
  text-align: center; padding: 12px; border-radius: 10px; font-size: 16px; font-weight: 800;
  background: var(--chip-bg); border: 1px solid rgba(155,107,240,.4); color: var(--purple-lite);
}
.entry.speech { display: flex; gap: 8px; }
.spk-seat {
  flex: 0 0 auto; font-size: 11px; font-weight: 800; color: var(--dim);
  background: var(--tint); border-radius: 6px; padding: 1px 6px; height: fit-content; margin-top: 2px;
}
.spk-body { flex: 1; min-width: 0; }
.spk-name { font-size: 11.5px; color: var(--dim2); font-weight: 700; margin-bottom: 1px; }
.spk-text { background: var(--panel); border: 1px solid var(--line); border-radius: 4px 10px 10px 10px; padding: 8px 11px; word-break: break-word; }

.mybar {
  flex: 0 0 auto; padding: 8px 12px; border-top: 1px solid var(--line);
  background: var(--bg2); display: flex; align-items: center; gap: 10px; font-size: 12.5px;
}
.mybar .mb-role { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.mybar .mb-icon { font-size: 18px; }
.mybar .mb-desc { flex: 1; color: var(--dim2); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mybar .mb-alert { color: var(--amber); font-weight: 700; font-size: 12px; }

.action-pane {
  flex: 0 0 auto; border-top: 1px solid var(--line); background: var(--panel);
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  max-height: 46vh; overflow-y: auto;
}
.ap-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.ap-title { font-weight: 800; font-size: 15px; color: var(--amber); }
.ap-who { font-size: 12px; color: var(--dim); }
.ap-note { font-size: 12.5px; color: var(--dim); margin-bottom: 10px; }
.ap-targets { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.tbtn {
  padding: 9px 13px; border-radius: 10px; cursor: pointer; font-family: inherit;
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  font-size: 13.5px; transition: all .12s;
}
.tbtn:hover { border-color: var(--red); }
.tbtn.picked { background: var(--red); border-color: var(--red); color: #fff; }
.tbtn:disabled { opacity: .35; cursor: not-allowed; }
.ap-controls { display: flex; gap: 9px; flex-wrap: wrap; }
.ap-controls .btn-primary, .ap-controls .btn-ghost { width: auto; flex: 1; min-width: 110px; padding: 12px; font-size: 14.5px; }
.ap-controls .btn-danger {
  flex: 1; min-width: 110px; padding: 12px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, #e8455f, #b32a45); color: #fff; border: none;
  font-size: 14.5px; font-weight: 700; font-family: inherit;
}
.ap-text { width: 100%; min-height: 76px; padding: 11px; border-radius: 10px; resize: vertical;
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  font-family: inherit; font-size: 14px; line-height: 1.5; }
.ap-text:focus { outline: none; border-color: var(--purple); }
.quick-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.quick {
  font-size: 11.5px; padding: 5px 10px; border-radius: 20px; cursor: pointer;
  background: var(--chip-bg); border: 1px solid rgba(155,107,240,.3);
  color: var(--purple-lite); font-family: inherit;
}
.quick:hover { background: rgba(155,107,240,.25); }
.ap-info {
  font-size: 12.5px; padding: 9px 11px; border-radius: 10px; margin-bottom: 10px;
  background: rgba(74,143,240,.1); border: 1px solid rgba(74,143,240,.25); color: var(--blue-lite);
}
.ap-info.warn { background: rgba(232,69,95,.1); border-color: rgba(232,69,95,.3); color: var(--wolf); }
.ap-info.good { background: rgba(63,191,127,.1); border-color: rgba(63,191,127,.3); color: var(--good); }
.waiting { text-align: center; color: var(--dim); font-size: 13px; padding: 8px; }
.waiting .dots::after { content: ''; animation: dots 1.4s steps(4, end) infinite; }
@keyframes dots { 0% { content: '' } 25% { content: '.' } 50% { content: '..' } 75% { content: '...' } }

/* ---------------- 遮挡层 / 结算 ---------------- */

.gate {
  position: fixed; inset: 0; z-index: 100;
  background: linear-gradient(160deg, #0b0d16, #1a1030);
  display: flex; align-items: center; justify-content: center;
}
.gate-inner { text-align: center; padding: 32px; max-width: 420px; }
.gate-icon { font-size: 56px; margin-bottom: 12px; }
.gate-title { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.gate-sub { color: var(--dim); font-size: 14px; margin-bottom: 28px; }
.gate-inner .btn-primary { padding: 15px 40px; width: auto; min-width: 200px; }

.over {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(6,8,16,.94); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; overflow-y: auto;
}
.over-inner { text-align: center; padding: 28px 22px; max-width: 520px; width: 100%; }
.over-icon { font-size: 64px; margin-bottom: 6px; }
.over-inner h2 { margin: 0 0 6px; font-size: 26px; }
.over-sub { color: var(--dim); font-size: 13.5px; margin-bottom: 20px; }
.over-reveal { display: flex; flex-direction: column; gap: 7px; margin-bottom: 24px; text-align: left; }
.rv-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px;
  border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 13px;
}
.rv-row.wolf { border-color: rgba(232,69,95,.45); background: rgba(232,69,95,.1); }
.rv-seat { font-weight: 800; color: var(--dim2); font-size: 12px; }
.rv-name { flex: 1; font-weight: 600; }
.rv-role { font-weight: 700; font-size: 12.5px; }
.rv-state { font-size: 11px; color: var(--dim2); }
.over-actions { display: flex; flex-direction: column; gap: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(30,36,60,.96); border: 1px solid var(--line); color: var(--text);
  padding: 10px 18px; border-radius: 24px; font-size: 13.5px; z-index: 200;
  box-shadow: var(--shadow); animation: fadeIn .2s;
}

/* ---------------- 规则页 ---------------- */
.rule-role {
  display: flex; gap: 12px; padding: 14px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); margin-bottom: 10px;
}
.rule-role .rr-icon { font-size: 26px; }
.rule-role .rr-name { font-weight: 800; font-size: 15px; margin-bottom: 3px; }
.rule-role .rr-desc { font-size: 12.5px; color: var(--text); opacity: .85; }
.rule-role .rr-detail { font-size: 12px; color: var(--dim2); margin-top: 5px; }
.rule-role.wolf { border-color: rgba(232,69,95,.4); background: rgba(232,69,95,.07); }
.rule-role.god { border-color: rgba(74,143,240,.35); }
.rule-section { margin-bottom: 26px; }
.rule-section h3 { font-size: 15px; margin: 0 0 12px; color: var(--amber); }
.rule-section p, .rule-section li { font-size: 13px; color: var(--dim); line-height: 1.7; }
.rule-section ol, .rule-section ul { padding-left: 20px; margin: 0; }
.rule-section b { color: var(--text); }

/* ---------------- 移动端 ---------------- */
@media (max-width: 560px) {
  /* 手机上新版浏览器对大面积 backdrop-filter 很吃力，改用不透明底色 */
  .center-pane {
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: rgba(9,11,22,.46);
  }
  #screen-game[data-phase="day"] .center-pane { background: rgba(255,253,247,.62); }
  .players-pane { flex: 0 0 104px; padding: 7px; gap: 5px; }
  .pcard { padding: 6px 7px; }
  .pcard .pc-name { font-size: 11.5px; }
  .logo h1 { font-size: 32px; }
  .home-inner { padding: 18px; gap: 20px; }
  .mc-icon { font-size: 28px; }
  .mc-title { font-size: 16px; }
  .ap-controls .btn-primary, .ap-controls .btn-ghost { min-width: 90px; font-size: 13.5px; }
}
