:root {
  --bg-0: #14172B;
  --bg-1: #1E2238;
  --bg-2: #262B47;
  --text-0: #F5F7FA;
  --text-1: #9AA3BF;
  --gold: #FFC53D;
  --red: #FF6B6B;
  --green: #3DD68C;
  --blue: #4F8CFF;
  --purple: #9B7BFF;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: radial-gradient(1400px 800px at 20% -10%, #16122F 0%, transparent 55%),
              radial-gradient(1200px 700px at 90% 110%, #1B0C2E 0%, transparent 55%), #070613;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text-0); user-select: none;
}
body.night {
  background: radial-gradient(1400px 800px at 20% -10%, #100C26 0%, transparent 55%),
              radial-gradient(1200px 700px at 90% 110%, #130822 0%, transparent 55%), #040310;
}
.hidden { display: none !important; }
#app { width: 100vw; height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; }

/* ---------- 神秘动态背景 ---------- */
#bgFx {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: url('bg.png') center / cover no-repeat;
}
#bgFx::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(6,5,18,0.42); transition: background 1.2s;
}
body.night #bgFx::before { background: rgba(3,2,12,0.58); }
/* 图片自带月亮/树林/云层，隐藏对应的 CSS 元素 */
#moon, .forest, #sunGlow, .cloud { display: none; }
#bgFx::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,0.55) 100%);
}
.nebula { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.22; }
.nebula.n1 {
  width: 55vw; height: 55vw; left: -12%; top: -15%;
  background: radial-gradient(circle, rgba(88,54,180,0.35), transparent 65%);
  animation: drift1 26s ease-in-out infinite alternate;
}
.nebula.n2 {
  width: 48vw; height: 48vw; right: -10%; bottom: -18%;
  background: radial-gradient(circle, rgba(140,40,120,0.30), transparent 65%);
  animation: drift2 32s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(6vw, 4vh) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-5vw, -5vh) scale(1.12); } }
.mist {
  position: absolute; width: 150vw; height: 36vh; filter: blur(35px);
  background: linear-gradient(90deg, transparent, rgba(190,180,255,0.5), transparent);
}
.mist.m1 { top: 18%; opacity: 0.14; animation: mistmove 44s linear infinite alternate; }
.mist.m2 { top: 60%; opacity: 0.09; animation: mistmove 60s linear infinite alternate-reverse; }
@keyframes mistmove { from { transform: translateX(-28vw); } to { transform: translateX(28vw); } }
#sunGlow {
  position: absolute; left: 50%; top: -32%; width: 130vw; height: 85vh; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(216,150,80,0.09), transparent 60%);
  transition: opacity 1.2s;
}
body.night #sunGlow { opacity: 0; }
#moon {
  position: absolute; top: 56px; right: 7%; width: 68px; height: 68px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FDFBF3, #D9D4C0 60%, #B0AA96);
  box-shadow: 0 0 40px 12px rgba(230,230,255,0.22), 0 0 120px 44px rgba(155,123,255,0.12);
  opacity: 0.35; transition: opacity 1.2s;
  animation: moonhalo 6s ease-in-out infinite;
}
body.night #moon { opacity: 1; }
#moon::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 60% 55%, rgba(120,115,100,0.5) 0 8%, transparent 9%),
              radial-gradient(circle at 35% 65%, rgba(120,115,100,0.45) 0 6%, transparent 7%),
              radial-gradient(circle at 55% 30%, rgba(120,115,100,0.4) 0 5%, transparent 6%);
}
@keyframes moonhalo {
  0%, 100% { box-shadow: 0 0 40px 12px rgba(230,230,255,0.20), 0 0 120px 44px rgba(155,123,255,0.10); }
  50% { box-shadow: 0 0 58px 18px rgba(230,230,255,0.30), 0 0 150px 60px rgba(155,123,255,0.18); }
}
#stars { position: absolute; inset: 0; opacity: 0.22; transition: opacity 1.2s; }
body.night #stars { opacity: 0.45; }
/* 云层掠过 */
.cloud {
  position: absolute; width: 62vw; height: 17vh; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(8,6,20,0.9), transparent 70%);
  filter: blur(18px);
}
.cloud.c1 { top: 3%; animation: cloudmove 72s linear infinite; }
.cloud.c2 { top: 13%; opacity: 0.7; animation: cloudmove 96s linear infinite reverse; }
@keyframes cloudmove { from { transform: translateX(-68vw); } to { transform: translateX(106vw); } }
/* 鬼火漂浮 */
.wisp {
  position: absolute; border-radius: 50%; filter: blur(2px); opacity: 0;
  animation: wisprise linear infinite;
}
@keyframes wisprise {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  12% { opacity: 0.85; }
  55% { opacity: 0.45; }
  100% { transform: translate(4vw, -72vh) scale(0.55); opacity: 0; }
}
/* 幽林剪影 */
.forest {
  position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none;
  background-repeat: repeat-x; background-position: bottom;
}
.forest.f1 {
  height: 170px; opacity: 0.9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='170' viewBox='0 0 480 170'%3E%3Cpath fill='%23070513' d='M0 170 L0 115 L25 115 L45 55 L65 115 L90 115 L90 170 Z M110 170 L110 85 L130 85 L155 15 L180 85 L200 85 L200 170 Z M230 170 L230 105 L250 105 L270 45 L290 105 L315 105 L315 170 Z M340 170 L340 75 L360 75 L385 5 L410 75 L430 75 L430 170 Z'/%3E%3C/svg%3E");
  background-size: auto 100%;
}
.forest.f2 {
  height: 110px; opacity: 0.55; transform: scaleX(-1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='110' viewBox='0 0 480 110'%3E%3Cpath fill='%230A0819' d='M0 110 L0 70 L30 70 L50 20 L70 70 L100 70 L100 110 Z M130 110 L130 55 L155 55 L175 10 L200 55 L225 55 L225 110 Z M260 110 L260 65 L285 65 L305 25 L330 65 L355 65 L355 110 Z M385 110 L385 50 L410 50 L430 8 L455 50 L480 50 L480 110 Z'/%3E%3C/svg%3E");
  background-size: auto 100%;
}
.star {
  position: absolute; border-radius: 50%; background: #fff;
  animation: twinkle 2.5s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0.12; } 50% { opacity: 0.9; } }

/* ---------- 桌面中央页签 ---------- */
#feltTabs { display: flex; gap: 8px; flex: none; }
.felt-tab {
  padding: 4px 16px; border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 700;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: var(--text-1);
  transition: all .15s;
}
.felt-tab:hover { color: var(--text-0); }
.felt-tab.active { background: rgba(255,197,61,0.18); color: var(--gold); border-color: rgba(255,197,61,0.45); }

/* ---------- MVP/SVP 面板 ---------- */
#mvpPanel {
  width: 64%; height: 62%; overflow-y: auto; padding: 4px 14px 10px;
  font-size: 12px; line-height: 1.8; color: var(--text-1); scrollbar-width: thin;
}
.mvp-rules b { color: var(--gold); }
.mvp-rules .rl-head { color: var(--text-0); font-weight: 700; letter-spacing: 2px; }
.mvp-live-title { font-weight: 700; color: var(--text-0); margin: 8px 0 6px; letter-spacing: 2px; }
.mvp-live-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 8px; margin-bottom: 4px;
  background: rgba(255,255,255,0.05); border: 1px solid transparent;
}
.mvp-live-row.self { border-color: rgba(255,197,61,0.45); background: rgba(255,197,61,0.07); }
.mvp-live-row.dead { opacity: 0.5; }
.mvp-live-row .lv-no { width: 20px; font-weight: 800; color: var(--text-1); }
.mvp-live-row:nth-child(1) .lv-no { color: var(--gold); }
.mvp-live-row .lv-cand { width: 64px; font-size: 10px; font-weight: 800; }
.mvp-live-row .lv-cand.m1 { color: var(--gold); }
.mvp-live-row .lv-cand.m2 { color: #C9D2EC; }
.mvp-live-row .lv-seat { color: var(--text-1); width: 32px; }
.mvp-live-row .lv-name { flex: 1; color: var(--text-0); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mvp-live-row .lv-score { font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.mvp-live-row .lv-score.neg { color: var(--red); }

/* ---------- 顶栏 ---------- */
#topbar {
  height: 52px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; background: rgba(30,34,56,0.85); border-bottom: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(10px); z-index: 10;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.tb-right { justify-content: flex-end; }
.tb-center { font-size: 20px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
#phaseBadge {
  padding: 4px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: rgba(79,140,255,0.16); color: #9CC0FF;
}
body.night #phaseBadge { background: rgba(155,123,255,0.2); color: #C4B0FF; }
#dayBadge { font-size: 13px; color: var(--text-1); }
#myRoleChip {
  padding: 4px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: rgba(255,197,61,0.15); color: var(--gold); border: 1px solid rgba(255,197,61,0.3);
}
#myRoleChip.wolf { background: rgba(255,107,107,0.15); color: var(--red); border-color: rgba(255,107,107,0.35); }
#onlineCount { font-size: 13px; color: var(--text-1); }

/* ---------- 主区域 ---------- */
#main { flex: 1; display: flex; min-height: 0; }
#tableWrap { flex: 1; position: relative; min-width: 0; }
#tableFelt {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 56%; height: 52%; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(61,214,140,0.10), rgba(20,23,43,0.0) 70%),
    var(--bg-1);
  border: 2px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 0 60px rgba(0,0,0,0.45), 0 20px 60px rgba(0,0,0,0.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  transition: background .6s;
}
body.night #tableFelt { background: radial-gradient(ellipse at center, rgba(155,123,255,0.10), rgba(11,14,30,0) 70%), #151A33; }
#log {
  width: 64%; height: 62%; overflow-y: auto; padding: 4px 14px 10px;
  font-size: 13px; line-height: 1.8; color: var(--text-1);
  scrollbar-width: thin; flex: none;
}
#log .l-sys { color: #C9D2EC; }
#log .l-important { color: var(--gold); font-weight: 600; }
#log .l-death { color: var(--red); font-weight: 600; }
#log .l-good { color: var(--green); }

/* ---------- 座位 ---------- */
#seats { position: absolute; inset: 0; pointer-events: none; }
.seat {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  pointer-events: auto; cursor: default; width: 76px;
  transition: transform .15s;
}
.seat.selectable { cursor: pointer; }
.seat.selectable:hover { transform: translate(-50%, -50%) scale(1.12); }
.seat .avatar {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #fff;
  border: 2.5px solid rgba(255,255,255,0.18);
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  position: relative;
}
.seat .num {
  position: absolute; top: -7px; left: -7px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-2); border: 1.5px solid rgba(255,255,255,0.25);
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  color: var(--text-0);
}
.seat .sname {
  font-size: 12px; color: var(--text-0); max-width: 76px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 3px #000;
}
.seat .tags { display: flex; gap: 3px; height: 16px; }
.seat .tag {
  font-size: 10px; padding: 1px 6px; border-radius: 999px; font-weight: 700;
  background: rgba(255,255,255,0.12); color: var(--text-0);
}
.seat .tag.sheriff { background: rgba(255,197,61,0.25); color: var(--gold); }
.seat .tag.wolf { background: rgba(255,107,107,0.3); color: #FFB3B3; }
.seat .tag.god { background: rgba(79,140,255,0.3); color: #B9D3FF; }
.seat .tag.villager { background: rgba(61,214,140,0.28); color: #A9F0D2; }
.seat.self .avatar { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255,197,61,0.25), 0 6px 18px rgba(0,0,0,0.4); }
.seat.dead .avatar { filter: grayscale(1) brightness(0.55); }
.seat.dead .avatar::after {
  content: '✕'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #FF3B3B; font-size: 30px; font-weight: 900;
  text-shadow: 0 0 8px rgba(0,0,0,0.7);
}
.seat.dead .sname { color: var(--text-1); text-decoration: line-through; }
.seat.empty .avatar { background: rgba(255,255,255,0.05) !important; border-style: dashed; color: rgba(255,255,255,0.2); }

/* ---------- 侧栏聊天 ---------- */
#sidebar {
  width: 300px; flex: none; display: flex; flex-direction: column;
  background: rgba(30,34,56,0.7); border-left: 1px solid rgba(255,255,255,0.07);
}
#chatLog { flex: 1; overflow-y: auto; padding: 12px; font-size: 13px; line-height: 1.6; scrollbar-width: thin; }
.chat-line { margin-bottom: 8px; word-break: break-all; }
.chat-line .c-name { font-weight: 700; margin-right: 6px; }
.chat-line .c-channel {
  font-size: 10px; padding: 1px 6px; border-radius: 999px; margin-right: 6px; font-weight: 700;
}
.chat-line .c-channel.wolf { background: rgba(255,107,107,0.25); color: #FFB3B3; }
.chat-line .c-channel.dead { background: rgba(255,255,255,0.14); color: var(--text-1); }
.chat-line .c-channel.day, .chat-line .c-channel.room { background: rgba(79,140,255,0.2); color: #9CC0FF; }
.chat-sys { color: var(--text-1); font-style: italic; margin-bottom: 8px; }
#chatInputWrap { flex: none; padding: 10px; border-top: 1px solid rgba(255,255,255,0.07); display: flex; gap: 8px; align-items: center; }
#chatInputWrap #chatInput { flex: 1; }
#micBtn {
  flex: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.07);
  font-size: 17px; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
#micBtn:hover { background: rgba(255,255,255,0.14); }
#micBtn.recording {
  border-color: var(--red); background: rgba(255,107,107,0.25);
  animation: micpulse 1s ease-in-out infinite;
}
#micBtn:disabled { opacity: 0.35; cursor: not-allowed; }
@keyframes micpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,107,0.5); }
  50% { box-shadow: 0 0 0 8px rgba(255,107,107,0); }
}
#chatInput {
  width: 100%; padding: 10px 12px; border-radius: 10px; font-size: 13px;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.05);
  color: var(--text-0); outline: none;
}
#chatInput:focus { border-color: var(--blue); }

/* ---------- 操作栏 ---------- */
#actBar {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  background: rgba(30,34,56,0.92); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,0.5); backdrop-filter: blur(12px);
  max-width: 90vw;
}
#actBar .act-text { font-size: 14px; color: var(--text-0); font-weight: 600; margin-right: 4px; }
#actBar .act-sub { font-size: 12px; color: var(--text-1); }
.act-btn {
  padding: 9px 18px; border: none; border-radius: 10px; cursor: pointer;
  font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: transform .12s, filter .15s;
}
.act-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.act-btn.secondary { background: rgba(255,255,255,0.12); }
.act-btn.danger { background: linear-gradient(90deg, #FF6B6B, #FF9F43); }

/* ---------- 覆盖层 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(155,123,255,0.16), transparent 60%),
              radial-gradient(900px 500px at 80% 110%, rgba(79,140,255,0.14), transparent 60%), var(--bg-0);
}
#roleModal, #overModal { background: rgba(10,12,24,0.82); backdrop-filter: blur(8px); }
.card {
  width: 440px; max-width: 92vw; text-align: center;
  background: rgba(30,34,56,0.7); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px; padding: 36px 32px; box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  animation: pop .35s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { transform: translateY(16px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.title {
  font-size: 40px; font-weight: 800; letter-spacing: 6px;
  background: linear-gradient(90deg, var(--purple), var(--blue), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.subtitle { color: var(--text-1); font-size: 13px; line-height: 1.9; margin: 12px 0 22px; }
/* 头像选择 */
.avatar-label { font-size: 13px; color: var(--text-1); letter-spacing: 3px; margin-bottom: 10px; }
.avatar-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin-bottom: 16px;
}
.avatar-opt {
  aspect-ratio: 1; border-radius: 12px; border: 2px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05); font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s, border-color .15s, background .15s;
}
.avatar-opt:hover { transform: scale(1.12); background: rgba(255,255,255,0.1); }
.avatar-opt.selected {
  border-color: var(--gold); background: rgba(255,197,61,0.15);
  box-shadow: 0 0 12px rgba(255,197,61,0.35); transform: scale(1.12);
}

#nameInput {
  width: 100%; padding: 13px 16px; font-size: 15px; border-radius: 12px; text-align: center;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.05);
  color: var(--text-0); outline: none; margin-bottom: 14px;
}
#nameInput:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79,140,255,0.18); }
#joinBtn, #restartBtn {
  width: 100%; padding: 14px; border: none; border-radius: 12px; cursor: pointer;
  font-size: 16px; font-weight: 700; color: #fff;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  box-shadow: 0 12px 30px rgba(155,123,255,0.3); transition: transform .15s, filter .2s;
}
#joinBtn:hover:not(:disabled), #restartBtn:hover { transform: translateY(-2px); filter: brightness(1.08); }
#joinBtn:disabled { opacity: 0.45; cursor: not-allowed; }
.msg { min-height: 18px; margin-top: 12px; font-size: 13px; color: var(--gold); }

/* 身份卡：每个身份专属背景 */
.role-card { cursor: pointer; transition: background .3s, border-color .3s, box-shadow .3s; }
.role-icon { font-size: 54px; margin-bottom: 6px; filter: drop-shadow(0 4px 16px rgba(0,0,0,0.6)); }
.role-card.role-wolf {
  background: radial-gradient(circle at 50% -10%, rgba(255,60,60,0.35), transparent 60%),
              linear-gradient(160deg, #2A0E14, #140910);
  border-color: rgba(255,80,80,0.55); box-shadow: 0 0 60px rgba(255,40,40,0.22), 0 30px 80px rgba(0,0,0,0.5);
}
.role-card.role-seer {
  background: radial-gradient(circle at 50% -10%, rgba(155,123,255,0.45), transparent 60%),
              linear-gradient(160deg, #191338, #0D0920);
  border-color: rgba(155,123,255,0.6); box-shadow: 0 0 60px rgba(155,123,255,0.25), 0 30px 80px rgba(0,0,0,0.5);
}
.role-card.role-witch {
  background: radial-gradient(circle at 50% -10%, rgba(61,214,140,0.35), transparent 60%),
              linear-gradient(160deg, #0E2418, #0A1410);
  border-color: rgba(61,214,140,0.55); box-shadow: 0 0 60px rgba(61,214,140,0.2), 0 30px 80px rgba(0,0,0,0.5);
}
.role-card.role-hunter {
  background: radial-gradient(circle at 50% -10%, rgba(255,159,67,0.4), transparent 60%),
              linear-gradient(160deg, #2A1B0C, #150E07);
  border-color: rgba(255,159,67,0.55); box-shadow: 0 0 60px rgba(255,159,67,0.22), 0 30px 80px rgba(0,0,0,0.5);
}
.role-card.role-guard {
  background: radial-gradient(circle at 50% -10%, rgba(79,140,255,0.4), transparent 60%),
              linear-gradient(160deg, #0E1B33, #080D1A);
  border-color: rgba(79,140,255,0.55); box-shadow: 0 0 60px rgba(79,140,255,0.22), 0 30px 80px rgba(0,0,0,0.5);
}
.role-card.role-villager {
  background: radial-gradient(circle at 50% -10%, rgba(200,200,220,0.22), transparent 60%),
              linear-gradient(160deg, #1B1B26, #0E0E14);
  border-color: rgba(200,200,220,0.35); box-shadow: 0 0 60px rgba(200,200,220,0.12), 0 30px 80px rgba(0,0,0,0.5);
}

/* 板子选择按钮 */
.act-btn.board-active {
  background: linear-gradient(90deg, rgba(255,197,61,0.9), rgba(255,159,67,0.9));
  box-shadow: 0 0 16px rgba(255,197,61,0.4);
}
.role-kicker { font-size: 14px; color: var(--text-1); letter-spacing: 4px; }
.role-name { font-size: 44px; font-weight: 800; margin: 14px 0; }
.role-name.wolf { color: var(--red); text-shadow: 0 0 30px rgba(255,107,107,0.5); }
.role-name.good { color: var(--blue); text-shadow: 0 0 30px rgba(79,140,255,0.5); }
.role-desc { font-size: 14px; color: var(--text-1); line-height: 1.9; }
.role-team { font-size: 13px; color: var(--gold); margin-top: 14px; min-height: 18px; }

/* 结算 */
.over-card { width: 560px; }
#overTitle { font-size: 34px; font-weight: 800; }
#overTitle.wolf { color: var(--red); }
#overTitle.good { color: var(--blue); }
.over-roles {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 20px 0;
  max-height: 260px; overflow-y: auto;
}
.over-role {
  padding: 8px 6px; border-radius: 10px; font-size: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
}
.over-role .r-seat { color: var(--text-1); }
.over-role .r-name { font-weight: 700; margin: 2px 0; }
.over-role .r-role { font-weight: 700; }
.over-role .r-role.wolf { color: var(--red); }
.over-role .r-role.good { color: var(--green); }
.over-role.dead { opacity: 0.55; }

/* MVP / SVP 与积分榜 */
.over-mvp { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.mvp-chip, .svp-chip {
  padding: 6px 16px; border-radius: 999px; font-size: 14px; font-weight: 800;
}
.mvp-chip {
  background: linear-gradient(90deg, rgba(255,197,61,0.3), rgba(255,159,67,0.3));
  color: var(--gold); border: 1px solid rgba(255,197,61,0.5);
  box-shadow: 0 0 20px rgba(255,197,61,0.25);
}
.svp-chip {
  background: rgba(192,200,220,0.15); color: #C9D2EC; border: 1px solid rgba(192,200,220,0.4);
}
.rank-title { font-size: 14px; font-weight: 700; color: var(--text-1); letter-spacing: 4px; margin: 16px 0 8px; }
.over-rank { max-height: 220px; overflow-y: auto; scrollbar-width: thin; margin-bottom: 16px; }
.rank-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 10px; font-size: 13px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 5px; text-align: left;
}
.rank-row.self { border-color: rgba(255,197,61,0.5); background: rgba(255,197,61,0.08); }
.rank-row.dead { opacity: 0.6; }
.rank-no { width: 22px; font-weight: 800; color: var(--text-1); font-variant-numeric: tabular-nums; }
.rank-row:nth-child(1) .rank-no { color: var(--gold); }
.rank-row:nth-child(2) .rank-no { color: #C9D2EC; }
.rank-row:nth-child(3) .rank-no { color: #D8975B; }
.rank-badge { width: 42px; }
.rank-badge em {
  font-style: normal; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 6px;
}
.rank-badge em.mvp { background: rgba(255,197,61,0.25); color: var(--gold); }
.rank-badge em.svp { background: rgba(192,200,220,0.2); color: #C9D2EC; }
.rank-seat { color: var(--text-1); width: 34px; }
.rank-name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-role { font-weight: 700; width: 52px; text-align: center; }
.rank-role.wolf { color: var(--red); }
.rank-role.good { color: var(--green); }
.rank-score { width: 40px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.rank-score.pos { color: var(--gold); }
.rank-score.neg { color: var(--red); }

/* ---------- 技能徽章（拖拽释放） ---------- */
.skill-badge {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: grab; user-select: none; touch-action: none; flex: none;
  transition: transform .12s;
}
.skill-badge:hover { transform: translateY(-3px) scale(1.06); }
.skill-badge:active { cursor: grabbing; }
.skill-badge .sk-icon {
  width: 54px; height: 54px; border-radius: 16px; font-size: 27px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(255,255,255,0.22);
}
.skill-badge .sk-name { font-size: 11px; font-weight: 700; color: var(--text-0); }
.skill-badge.clickable { cursor: pointer; }
/* 每个技能专属背景色与辉光 */
.sk-guard .sk-icon, .drag-ghost.sk-guard {
  background: linear-gradient(160deg, #2E6BE6, #152A5C);
  box-shadow: 0 0 20px rgba(79,140,255,0.55), inset 0 1px 0 rgba(255,255,255,0.25);
}
.sk-wolf .sk-icon, .drag-ghost.sk-wolf {
  background: linear-gradient(160deg, #E63232, #4A0D12);
  box-shadow: 0 0 20px rgba(255,59,59,0.55), inset 0 1px 0 rgba(255,255,255,0.2);
}
.sk-seer .sk-icon, .drag-ghost.sk-seer {
  background: linear-gradient(160deg, #8B5CF6, #2A1656);
  box-shadow: 0 0 20px rgba(155,123,255,0.6), inset 0 1px 0 rgba(255,255,255,0.25);
}
.sk-witch-save .sk-icon, .drag-ghost.sk-witch-save {
  background: linear-gradient(160deg, #22B573, #0A3D24);
  box-shadow: 0 0 20px rgba(61,214,140,0.55), inset 0 1px 0 rgba(255,255,255,0.25);
}
.sk-witch-poison .sk-icon, .drag-ghost.sk-witch-poison {
  background: linear-gradient(160deg, #6D28A8, #1B0B2E);
  box-shadow: 0 0 20px rgba(147,51,234,0.6), inset 0 1px 0 rgba(255,255,255,0.2);
}
.sk-vote .sk-icon, .drag-ghost.sk-vote {
  background: linear-gradient(160deg, #F59E0B, #5C3009);
  box-shadow: 0 0 20px rgba(255,159,67,0.55), inset 0 1px 0 rgba(255,255,255,0.25);
}
.sk-hunter .sk-icon, .drag-ghost.sk-hunter {
  background: linear-gradient(160deg, #C2622B, #3D1C08);
  box-shadow: 0 0 20px rgba(255,107,53,0.55), inset 0 1px 0 rgba(255,255,255,0.2);
}
.sk-sheriff .sk-icon, .drag-ghost.sk-sheriff {
  background: linear-gradient(160deg, #D9A821, #4A3607);
  box-shadow: 0 0 20px rgba(255,197,61,0.6), inset 0 1px 0 rgba(255,255,255,0.3);
}
.sk-badge .sk-icon, .drag-ghost.sk-badge {
  background: linear-gradient(160deg, #E3B93C, #5C4607);
  box-shadow: 0 0 22px rgba(255,197,61,0.65), inset 0 1px 0 rgba(255,255,255,0.3);
}
.sk-sheriffgun .sk-icon, .drag-ghost.sk-sheriffgun {
  background: linear-gradient(160deg, #D94F2B, #3A0F06);
  box-shadow: 0 0 22px rgba(255,90,40,0.6), inset 0 1px 0 rgba(255,255,255,0.25);
  border-color: rgba(255,197,61,0.5) !important;
}
/* 拖拽幽灵图标 */
.drag-ghost {
  position: fixed; z-index: 100; width: 56px; height: 56px; border-radius: 16px;
  font-size: 30px; display: flex; align-items: center; justify-content: center;
  pointer-events: none; transform: translate(-50%, -50%) scale(1.1);
  border: 1.5px solid rgba(255,255,255,0.35);
}
/* 可释放座位高亮 */
body.dragging .seat.selectable .avatar {
  outline: 2px dashed rgba(255,197,61,0.65); outline-offset: 3px;
  animation: droppulse 1s ease-in-out infinite;
}
.seat.drop-hover .avatar {
  outline: 3px solid var(--gold) !important; outline-offset: 3px;
  box-shadow: 0 0 24px rgba(255,197,61,0.7) !important;
}
@keyframes droppulse {
  0%, 100% { outline-color: rgba(255,197,61,0.35); }
  50% { outline-color: rgba(255,197,61,0.9); }
}

/* ---------- 平民任务面板 ---------- */
#taskPanel {
  position: fixed; top: 62px; left: 50%; transform: translateX(-50%); z-index: 35;
  padding: 12px 16px; border-radius: 16px; text-align: center;
  background: rgba(20,17,40,0.92); border: 1px solid rgba(61,214,140,0.4);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 24px rgba(61,214,140,0.12);
  backdrop-filter: blur(12px); animation: pop .3s ease;
}
.tp-title { font-size: 14px; font-weight: 800; color: var(--green); letter-spacing: 2px; }
.tp-sub { font-size: 11px; color: var(--text-1); margin: 2px 0 10px; }
#taskOpts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 560px; }
.task-opt {
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 12px; font-weight: 700;
  border: 1.5px solid rgba(61,214,140,0.35); background: rgba(61,214,140,0.08); color: var(--text-0);
  transition: all .15s;
}
.task-opt:hover {
  background: rgba(61,214,140,0.2); border-color: var(--green);
  transform: translateY(-2px); box-shadow: 0 6px 16px rgba(61,214,140,0.25);
}
/* 顶栏任务标签 */
#taskChip {
  padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(61,214,140,0.14); color: var(--green); border: 1px solid rgba(61,214,140,0.35);
  max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#taskChip.done {
  background: rgba(255,197,61,0.15); color: var(--gold); border-color: rgba(255,197,61,0.45);
}
/* 平民猎枪徽章 */
.sk-vgun .sk-icon, .drag-ghost.sk-vgun {
  background: linear-gradient(160deg, #2E8B57, #0B2E1B);
  box-shadow: 0 0 22px rgba(61,214,140,0.55), inset 0 1px 0 rgba(255,255,255,0.25);
  border-color: rgba(255,197,61,0.4) !important;
}

/* ---------- 清晨死讯大字通报 ---------- */
#deathBanner {
  position: fixed; inset: 0; z-index: 45; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.15), rgba(0,0,0,0.5));
  animation: dbfade .4s ease;
}
@keyframes dbfade { from { opacity: 0; } to { opacity: 1; } }
.db-peace {
  font-size: 108px; font-weight: 900; letter-spacing: 18px; color: var(--gold);
  text-shadow: 0 0 40px rgba(255,197,61,0.65), 0 0 110px rgba(255,197,61,0.3);
  animation: dbpop .6s cubic-bezier(.2,.9,.3,1.3);
}
.db-sub {
  font-size: 22px; color: rgba(255,197,61,0.85); letter-spacing: 8px; margin-top: 14px;
  animation: dbpop .6s .1s both;
}
.db-death {
  font-size: 66px; font-weight: 900; letter-spacing: 6px; color: #FF3B3B;
  text-shadow: 0 0 30px rgba(255,59,59,0.75), 0 0 90px rgba(255,0,0,0.35);
  animation: dbpop .5s cubic-bezier(.2,.9,.3,1.3);
}
.db-info {
  font-size: 24px; color: #FFB3B3; letter-spacing: 3px; margin: 8px 0 28px;
  animation: dbpop .5s .08s both;
}
@keyframes dbpop { from { transform: scale(0.55); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- 投票确认 ---------- */
.confirm-card { width: 360px; }
.confirm-text { font-size: 17px; font-weight: 700; line-height: 1.8; margin-bottom: 20px; }
.confirm-btns { display: flex; gap: 10px; }
.confirm-btns .act-btn { flex: 1; }

/* Toast */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 60;
  padding: 10px 22px; border-radius: 12px; font-size: 14px; font-weight: 600;
  background: rgba(30,34,56,0.95); border: 1px solid rgba(255,197,61,0.4); color: var(--gold);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4); animation: pop .25s ease;
}

/* 游戏大厅（房间列表） */
.lobby-card { width: 520px; }
.lobby-title { font-size: 24px; font-weight: 800; letter-spacing: 6px; margin-bottom: 18px; color: var(--text-0); }
.room-list { max-height: 340px; overflow-y: auto; scrollbar-width: thin; margin-bottom: 14px; }
.room-empty { color: var(--text-1); font-size: 14px; padding: 30px 0; }
.room-card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 16px; border-radius: 14px; margin-bottom: 8px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09);
  transition: border-color .15s, background .15s;
}
.room-card:hover { border-color: rgba(155,123,255,0.4); background: rgba(255,255,255,0.08); }
.rc-name { font-size: 15px; font-weight: 700; }
.rc-info { flex: 1; font-size: 12px; color: var(--text-1); }
.rc-join {
  padding: 8px 20px; border: none; border-radius: 10px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  transition: transform .12s, filter .15s;
}
.rc-join:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.1); }
.rc-join:disabled { opacity: 0.4; cursor: not-allowed; }
.code-box { display: flex; gap: 10px; margin-bottom: 10px; }
.code-box input {
  flex: 1; padding: 12px 14px; border-radius: 10px; font-size: 18px; font-weight: 800;
  letter-spacing: 8px; text-align: center; text-transform: uppercase;
  border: 1.5px solid rgba(255,197,61,0.35); background: rgba(255,197,61,0.06);
  color: var(--gold); outline: none;
}
.code-box input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255,197,61,0.15); }
.code-box input::placeholder { letter-spacing: 2px; font-size: 13px; font-weight: 400; color: var(--text-1); }
.code-box button {
  padding: 11px 22px; border: none; border-radius: 10px; cursor: pointer;
  font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  transition: transform .12s, filter .15s;
}
.code-box button:hover { transform: translateY(-1px); filter: brightness(1.1); }
.lobby-divider {
  display: flex; align-items: center; gap: 10px; margin: 4px 0 12px;
  font-size: 12px; color: var(--text-1);
}
.lobby-divider::before, .lobby-divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.1);
}
.rc-code {
  font-size: 13px; font-weight: 800; letter-spacing: 2px; color: var(--gold);
  background: rgba(255,197,61,0.12); border: 1px solid rgba(255,197,61,0.35);
  padding: 3px 10px; border-radius: 8px;
}
.create-box { display: flex; gap: 10px; }
.create-box input {
  flex: 1; padding: 11px 14px; border-radius: 10px; font-size: 14px;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.05);
  color: var(--text-0); outline: none;
}
.create-box input:focus { border-color: var(--purple); }
.create-box button {
  padding: 11px 22px; border: none; border-radius: 10px; cursor: pointer;
  font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap;
  background: linear-gradient(90deg, var(--gold), #FF9F43);
  box-shadow: 0 8px 20px rgba(255,197,61,0.25); transition: transform .12s, filter .15s;
}
.create-box button:hover { transform: translateY(-1px); filter: brightness(1.08); }

/* 顶栏房间名与离开按钮 */
#roomNameChip { font-size: 13px; color: var(--purple); font-weight: 700; }
#leaveBtn {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.07);
  color: var(--text-1); font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
#leaveBtn:hover { background: rgba(255,107,107,0.25); color: #fff; border-color: var(--red); }

@media (max-width: 900px) {
  #sidebar { display: none; }
}
