/* 月下长夜 · 实时语音狼人杀 */
:root {
  --bg: #070a11;
  --bg-2: #0a0f1c;
  --bg-3: #111827;
  --panel: rgba(17, 23, 38, 0.72);
  --panel-solid: #121827;
  --line: rgba(232, 226, 212, 0.09);
  --line-strong: rgba(232, 226, 212, 0.18);
  --text: #eae6dc;
  --muted: #9aa0b2;
  --muted-2: #6f7689;
  --gold: #e4bf7f;
  --gold-2: #f6e0b4;
  --gold-dim: rgba(228, 191, 127, 0.14);
  --wolf: #d96b52;
  --wolf-dim: rgba(217, 107, 82, 0.15);
  --good: #82b9aa;
  --good-dim: rgba(130, 185, 170, 0.14);
  --danger: #d8695c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
::selection { background: rgba(228, 191, 127, 0.3); color: #fff; }
.hidden { display: none !important; }

/* ---------- atmosphere ---------- */
.atmosphere { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.atmosphere::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(900px 600px at 78% -10%, rgba(243, 217, 164, 0.14), transparent 60%),
    radial-gradient(1100px 700px at 12% 8%, rgba(89, 96, 156, 0.18), transparent 62%),
    linear-gradient(180deg, #070a11 0%, #0a0f1c 46%, #070a11 100%);
}
.moon-glow {
  position: absolute; top: -160px; right: 4vw; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(247, 229, 189, 0.34), rgba(247, 229, 189, 0.08) 42%, transparent 68%);
  filter: blur(6px);
}
.moon-glow::after {
  content: ""; position: absolute; inset: 150px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fbf1d8, #e8cf9e 55%, #c8a86c 100%);
  box-shadow: 0 0 90px rgba(243, 217, 164, 0.32);
  mask-image: radial-gradient(circle at 30% 24%, transparent 0 16%, #000 17%);
  -webkit-mask-image: radial-gradient(circle at 30% 24%, transparent 0 16%, #000 17%);
}
.grain {
  position: absolute; inset: 0; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
}
.fog {
  position: absolute; width: 70vw; height: 46vh; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(120, 135, 180, 0.13), transparent 65%);
  filter: blur(40px); animation: drift 28s ease-in-out infinite alternate;
}
.fog-a { bottom: -16vh; left: -18vw; }
.fog-b { bottom: -8vh; right: -14vw; animation-duration: 36s; animation-direction: alternate-reverse; }
@keyframes drift { to { transform: translate3d(8vw, -3vh, 0) scale(1.12); } }
.trees {
  position: absolute; left: 0; right: 0; bottom: 0; height: 22vh; opacity: 0.72;
  background:
    linear-gradient(180deg, transparent, #05070c 82%),
    repeating-linear-gradient(90deg, transparent 0 46px, #05070c 46px 58px, transparent 58px 104px);
  mask-image: linear-gradient(180deg, transparent 0, #000 72%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 72%);
  clip-path: polygon(0 100%, 0 72%, 5% 58%, 8% 74%, 12% 44%, 16% 76%, 21% 63%, 24% 80%, 30% 52%, 35% 78%, 41% 60%, 46% 82%, 52% 54%, 57% 76%, 63% 48%, 68% 78%, 74% 58%, 79% 80%, 85% 50%, 90% 74%, 95% 60%, 100% 78%, 100% 100%);
  background-color: #05070c;
}

/* ---------- topbar ---------- */
.topbar {
  position: relative; z-index: 10; display: flex; align-items: center; gap: 26px;
  width: min(1360px, calc(100% - 56px)); margin: 0 auto; padding: 22px 0;
}
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand-mark { width: 40px; height: 40px; color: var(--gold); display: grid; place-items: center; }
.brand-mark svg { width: 100%; height: 100%; filter: drop-shadow(0 0 14px rgba(228, 191, 127, 0.35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--serif); font-size: 20px; letter-spacing: 0.14em; font-weight: 600; }
.brand-text small { font-size: 9px; letter-spacing: 0.28em; color: var(--muted-2); margin-top: 4px; }
.topnav { display: flex; align-items: center; gap: 22px; font-size: 13.5px; color: var(--muted); }
.topnav a { position: relative; padding: 4px 0; transition: color 0.2s; }
.topnav a:hover { color: var(--gold-2); }
.topnav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px;
  background: var(--gold); transform: scaleX(0); transition: transform 0.25s; transform-origin: left;
}
.topnav a:hover::after { transform: scaleX(1); }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; background: rgba(255, 255, 255, 0.03);
  color: var(--muted); transition: 0.2s;
}
.icon-btn:hover { color: var(--gold-2); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); }
.conn {
  display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.08em;
  color: var(--muted-2); padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
}
.conn i { width: 6px; height: 6px; border-radius: 50%; background: #6b7280; transition: 0.3s; }
.conn.online i { background: #7fd0a8; box-shadow: 0 0 8px rgba(127, 208, 168, 0.8); }
.conn.online { color: #a8c9ba; }
.conn.offline i { background: var(--danger); }

/* ---------- shell / landing ---------- */
.shell { position: relative; z-index: 2; width: min(1360px, calc(100% - 56px)); margin: 0 auto; }
.landing { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(380px, 0.88fr); gap: 64px; align-items: center; min-height: calc(100vh - 178px); padding: 44px 0 70px; }
.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 26px; font-size: 11px; letter-spacing: 0.26em; color: var(--gold); text-transform: uppercase; }
.eyebrow i { width: 34px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
.hero h1 {
  margin: 0; font-family: var(--serif); font-weight: 600; font-size: clamp(56px, 7vw, 94px);
  line-height: 0.98; letter-spacing: 0.02em; text-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
.hero h1 em {
  font-style: normal; display: inline-block; margin-top: 4px;
  background: linear-gradient(100deg, #fff4d6 0%, var(--gold) 46%, #b98e52 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { max-width: 34em; margin: 28px 0 0; color: #b6b9c5; font-size: 16px; line-height: 1.9; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-tags span {
  font-size: 11px; letter-spacing: 0.12em; color: #c9c3b4; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.025);
}
.hero-actions { display: flex; gap: 14px; margin-top: 34px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 58px; }
.how article { border-top: 1px solid var(--line); padding-top: 16px; }
.how article span { font-size: 10px; letter-spacing: 0.2em; color: var(--gold); }
.how h3 { margin: 9px 0 6px; font-family: var(--serif); font-size: 17px; letter-spacing: 0.1em; }
.how p { margin: 0; font-size: 12.5px; line-height: 1.75; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent;
  font-size: 14px; letter-spacing: 0.06em; transition: 0.22s ease; white-space: nowrap;
}
.btn.primary {
  color: #1a150c; background: linear-gradient(120deg, #f4dfb2, #d9b06a 55%, #c79a52);
  box-shadow: 0 10px 32px rgba(201, 158, 88, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(201, 158, 88, 0.34); }
.btn.ghost { border-color: var(--line-strong); color: var(--text); background: rgba(255, 255, 255, 0.03); }
.btn.ghost:hover { border-color: rgba(228, 191, 127, 0.45); background: rgba(228, 191, 127, 0.08); }
.btn.danger { border-color: rgba(216, 105, 92, 0.4); color: #f0b3aa; background: rgba(216, 105, 92, 0.08); }
.btn.danger:hover { background: rgba(216, 105, 92, 0.16); }
.btn.small { min-height: 36px; padding: 0 16px; font-size: 12.5px; }
.btn.wide { width: 100%; }
.btn:disabled { transform: none; }
.tiny-btn {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--muted);
  border-radius: 8px; padding: 4px 10px; font-size: 11px; letter-spacing: 0.08em; transition: 0.2s;
}
.tiny-btn:hover { color: var(--gold-2); border-color: var(--line-strong); }
.tiny-btn.danger:hover { color: #f0b3aa; border-color: rgba(216, 105, 92, 0.4); }

/* ---------- entry panel ---------- */
.entry {
  position: relative; padding: 26px; border-radius: 24px; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(24, 31, 50, 0.86), rgba(11, 15, 26, 0.9));
  box-shadow: var(--shadow); backdrop-filter: blur(18px); overflow: hidden;
}
.entry::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(500px 220px at 100% 0, rgba(228, 191, 127, 0.09), transparent 60%);
}
.entry-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.entry-tabs { display: flex; gap: 4px; padding: 4px; background: rgba(0, 0, 0, 0.28); border-radius: 12px; border: 1px solid var(--line); }
.entry-tabs button {
  border: 0; background: transparent; color: var(--muted); padding: 7px 15px; border-radius: 9px;
  font-size: 13px; transition: 0.2s;
}
.entry-tabs button.active { background: rgba(228, 191, 127, 0.12); color: var(--gold-2); }
.entry-note { font-size: 10px; letter-spacing: 0.08em; color: var(--muted-2); }
.entry-pane { position: relative; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.field > span { font-size: 11.5px; letter-spacing: 0.1em; color: var(--muted); }
.field input, .field select {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, 0.24); color: var(--text);
  outline: none; transition: 0.2s; font-size: 14px;
}
.field input:focus, .field select:focus { border-color: rgba(228, 191, 127, 0.55); box-shadow: 0 0 0 3px rgba(228, 191, 127, 0.08); }
.field input::placeholder { color: #5c6376; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.field-row { display: flex; gap: 14px; }
.code-input { text-transform: uppercase; letter-spacing: 0.38em; font-family: var(--serif); font-size: 20px !important; text-align: center; }
.avatar-picker { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; }
.avatar-choice {
  position: relative; aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--line);
  background: radial-gradient(circle at 32% 26%, hsl(var(--h) 46% 46%), hsl(var(--h) 38% 18%));
  display: grid; place-items: center; color: #f7edd6; font-family: var(--serif); font-size: 15px;
  transition: 0.2s; overflow: hidden;
}
.avatar-choice:hover { transform: translateY(-2px); }
.avatar-choice.active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(228, 191, 127, 0.26), 0 6px 18px rgba(0, 0, 0, 0.3); }
.avatar-choice::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255, 255, 255, 0.2), transparent 46%); }
.board-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.board-picker button {
  border: 1px solid var(--line); background: rgba(0, 0, 0, 0.2); border-radius: 11px;
  padding: 10px 8px; text-align: left; transition: 0.2s; color: var(--muted);
}
.board-picker button strong { display: block; color: var(--text); font-size: 14px; letter-spacing: 0.06em; }
.board-picker button small { display: block; font-size: 10px; margin-top: 2px; color: var(--muted-2); }
.board-picker button em { display: block; font-style: normal; font-size: 9.5px; margin-top: 6px; color: var(--gold); letter-spacing: 0.1em; }
.board-picker button.active { border-color: rgba(228, 191, 127, 0.55); background: rgba(228, 191, 127, 0.09); }
.board-picker button.active small { color: #c8bda4; }
.fine { margin: 0; font-size: 11px; line-height: 1.7; color: var(--muted-2); }

/* ---------- room layout ---------- */
.room { padding: 8px 0 30px; }
.room-top {
  display: flex; align-items: center; gap: 18px; padding: 12px 16px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(12, 17, 29, 0.68);
  backdrop-filter: blur(12px);
}
.room-id { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
.room-id strong { font-family: var(--serif); font-size: 20px; letter-spacing: 0.22em; color: var(--gold-2); }
.room-phase { display: flex; align-items: center; gap: 8px; }
.phase-chip { font-size: 11.5px; letter-spacing: 0.12em; padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(228, 191, 127, 0.3); color: var(--gold-2); background: var(--gold-dim); }
.day-chip { font-size: 10.5px; color: var(--muted); letter-spacing: 0.08em; }
.room-timer { margin-left: auto; font-family: var(--serif); font-size: 20px; color: var(--text); letter-spacing: 0.08em; min-width: 58px; text-align: right; }
.room-timer.urgent { color: #f0a28f; animation: pulse 1s infinite; }
.room-actions { display: flex; gap: 8px; }
.room-body { display: grid; grid-template-columns: minmax(0, 1fr) 356px; gap: 16px; align-items: stretch; }
.table-col { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.table {
  position: relative; width: 100%; max-width: 820px; margin: 0 auto; aspect-ratio: 1 / 1;
  min-height: 600px;
}
.table-felt {
  position: absolute; inset: 4.5%; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(57, 74, 82, 0.5), rgba(13, 20, 28, 0.2) 62%, transparent 70%),
    radial-gradient(circle at 50% 50%, rgba(9, 14, 22, 0.2), rgba(4, 7, 12, 0.6));
  border: 1px solid rgba(228, 191, 127, 0.09);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.6), 0 30px 90px rgba(0, 0, 0, 0.35);
}
.table-felt::after {
  content: ""; position: absolute; inset: 14px; border-radius: 50%;
  border: 1px dashed rgba(228, 191, 127, 0.08);
}
.table-ring {
  position: absolute; inset: 12%; border-radius: 50%;
  background: conic-gradient(from -90deg, rgba(228, 191, 127, 0.07), transparent 30%, rgba(120, 140, 170, 0.05) 60%, transparent);
  filter: blur(12px);
}
.seats { position: absolute; inset: 0; }
.center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 290px; height: 290px; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 30px;
  background: radial-gradient(circle at 50% 42%, rgba(24, 31, 48, 0.92), rgba(8, 12, 20, 0.94));
  border: 1px solid rgba(228, 191, 127, 0.13);
  box-shadow: 0 0 0 10px rgba(228, 191, 127, 0.02), 0 0 60px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(0, 0, 0, 0.5);
}
.center-kicker { margin: 0 0 8px; font-size: 9.5px; letter-spacing: 0.3em; color: var(--gold); text-transform: uppercase; }
.center-title { margin: 0; font-family: var(--serif); font-size: 27px; font-weight: 600; letter-spacing: 0.1em; line-height: 1.2; }
.center-sub { margin: 10px 0 0; font-size: 11.5px; line-height: 1.65; color: var(--muted); max-width: 220px; }
.center-ring {
  position: absolute; inset: -7px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from -90deg, var(--gold) calc(var(--p, 0) * 1%), rgba(255, 255, 255, 0.05) 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  opacity: 0.75;
}
#centerRingText { display: none; }
.center .center-cta { margin-top: 14px; }

/* ---------- seats ---------- */
.seat {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  width: 104px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: opacity 0.3s;
}
.seat-avatar {
  position: relative; width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--serif); font-size: 17px; color: #f6ecd8;
  background: radial-gradient(circle at 32% 26%, hsl(var(--h, 40) 42% 44%), hsl(var(--h2, 220) 36% 16%));
  border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
  transition: 0.25s;
}
.seat-avatar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(150deg, rgba(255, 255, 255, 0.18), transparent 45%); }
.seat-me .seat-avatar { border-color: rgba(228, 191, 127, 0.6); box-shadow: 0 0 0 3px rgba(228, 191, 127, 0.12), 0 8px 22px rgba(0, 0, 0, 0.42); }
.seat.speaking .seat-avatar { animation: speakRing 1.4s ease-out infinite; border-color: rgba(228, 191, 127, 0.8); }
@keyframes speakRing {
  0% { box-shadow: 0 0 0 0 rgba(228, 191, 127, 0.5), 0 8px 22px rgba(0, 0, 0, 0.42); }
  100% { box-shadow: 0 0 0 14px rgba(228, 191, 127, 0), 0 8px 22px rgba(0, 0, 0, 0.42); }
}
.seat.dead { opacity: 0.46; }
.seat.dead .seat-avatar { filter: grayscale(0.85); }
.seat.dead .seat-avatar::before {
  content: "†"; position: absolute; right: -3px; top: -6px; font-size: 15px; color: #d9d2c4;
  text-shadow: 0 1px 4px #000; z-index: 2;
}
.seat.offline .seat-avatar { border-style: dashed; }
.seat-meta { display: flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 8px; border-radius: 999px; background: rgba(5, 8, 14, 0.72); border: 1px solid var(--line); font-size: 10px; line-height: 1.5; }
.seat-meta b { color: var(--gold); font-weight: 500; font-size: 9.5px; }
.seat-meta span { color: #d7d3c9; max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-flags { display: flex; gap: 4px; align-items: center; min-height: 14px; font-size: 8.5px; letter-spacing: 0.06em; }
.seat-flag { padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.05); color: var(--muted); border: 1px solid var(--line); }
.seat-flag.bot { color: #9fa9c9; }
.seat-flag.sheriff { color: #241b0c; background: var(--gold); border-color: var(--gold); font-weight: 700; }
.seat-flag.mic { color: #a9d6c3; border-color: rgba(130, 185, 170, 0.3); }
.seat-flag.dead { color: #d8a79f; border-color: rgba(216, 105, 92, 0.3); }
.seat-role { font-size: 9.5px; letter-spacing: 0.08em; color: var(--gold); min-height: 12px; }
.seat-role.wolf { color: var(--wolf); }
.seat-votes { position: absolute; top: -7px; right: 4px; display: flex; gap: 2px; }
.vote-pip { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); color: #241b0c; font-size: 8px; display: grid; place-items: center; font-weight: 700; border: 1px solid #f6e0b4; }
.seat-num { position: absolute; left: -4px; bottom: 12px; font-size: 8.5px; color: var(--muted-2); }

/* ---------- dock ---------- */
.dock { display: grid; grid-template-columns: 0.9fr 1.5fr 0.9fr; gap: 12px; }
.dock-card {
  border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(165deg, rgba(20, 27, 43, 0.8), rgba(10, 14, 24, 0.82));
  padding: 12px 14px; min-height: 104px; backdrop-filter: blur(12px);
}
.role-card { position: relative; cursor: pointer; overflow: hidden; }
.role-card.empty { cursor: default; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.role-card.empty .role-desc { max-height: none; }
.role-card .role-hint { font-size: 9px; letter-spacing: 0.18em; color: var(--muted-2); text-transform: uppercase; }
.role-name { margin: 4px 0 2px; font-family: var(--serif); font-size: 21px; letter-spacing: 0.12em; }
.role-name.wolf { color: var(--wolf); }
.role-name.good { color: var(--good); }
.role-desc { font-size: 10.5px; line-height: 1.55; color: var(--muted); max-height: 34px; overflow: hidden; }
.role-card .role-lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(8, 12, 20, 0.94); gap: 3px; z-index: 2; transition: 0.3s; }
.role-lock strong { font-family: var(--serif); font-size: 20px; letter-spacing: 0.28em; color: var(--gold); }
.role-lock small { font-size: 9px; color: var(--muted-2); letter-spacing: 0.14em; }
.role-card.revealed .role-lock { opacity: 0; pointer-events: none; }
.action-card { display: flex; flex-direction: column; gap: 8px; }
.action-title { font-size: 11px; letter-spacing: 0.14em; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.action-hint { font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.target-grid { display: flex; flex-wrap: wrap; gap: 6px; max-height: 92px; overflow-y: auto; }
.target-chip {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: #cfcbc2;
  border-radius: 8px; padding: 5px 9px; font-size: 11px; transition: 0.16s; display: inline-flex; gap: 5px; align-items: center;
}
.target-chip b { color: var(--gold); font-weight: 500; font-size: 10px; }
.target-chip:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); }
.target-chip.selected { border-color: var(--gold); background: rgba(228, 191, 127, 0.14); color: var(--gold-2); }
.target-chip:disabled { opacity: 0.35; }
.action-btns { display: flex; gap: 7px; flex-wrap: wrap; margin-top: auto; }
.wolf-vote-line { font-size: 10px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.wolf-vote-line b { color: #e4b2a5; font-weight: 500; }
.witch-kill { font-size: 11px; padding: 6px 9px; border-radius: 8px; background: rgba(216, 105, 92, 0.08); border: 1px solid rgba(216, 105, 92, 0.18); color: #e8b9ae; }
.voice-card { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.voice-line { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.mic-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04); display: grid; place-items: center; font-size: 18px; transition: 0.2s;
}
.mic-btn:hover { border-color: var(--gold); }
.mic-btn.on { background: linear-gradient(140deg, #f2ddb0, #cfa45f); color: #1b150a; border-color: transparent; box-shadow: 0 0 0 4px rgba(228, 191, 127, 0.1); }
.mic-btn.live { animation: micLive 1.4s ease-out infinite; }
@keyframes micLive { 0% { box-shadow: 0 0 0 0 rgba(130, 185, 170, 0.55); } 100% { box-shadow: 0 0 0 16px rgba(130, 185, 170, 0); } }
.voice-mode { display: flex; gap: 4px; background: rgba(0, 0, 0, 0.25); padding: 3px; border-radius: 8px; border: 1px solid var(--line); }
.voice-mode button { flex: 1; border: 0; background: transparent; color: var(--muted); font-size: 9.5px; padding: 4px 6px; border-radius: 6px; }
.voice-mode button.active { background: rgba(228, 191, 127, 0.12); color: var(--gold-2); }
.voice-reason { font-size: 9.5px; line-height: 1.45; color: var(--muted-2); }
.voice-volume { display: flex; align-items: center; gap: 7px; margin-top: 7px; color: var(--muted-2); font-size: 9px; letter-spacing: 0.04em; }
.voice-volume input { flex: 1; min-width: 0; height: 3px; accent-color: var(--good); cursor: pointer; }
.voice-volume b { min-width: 30px; text-align: right; color: var(--text); font-size: 9.5px; font-weight: 500; }
.mic-level {
  height: 5px; margin-top: 6px; border-radius: 99px; overflow: hidden;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.04);
}
.mic-level i {
  display: block; width: 4%; height: 100%; border-radius: inherit;
  background: rgba(130, 185, 170, 0.55); transition: width 0.08s linear, background 0.2s;
}
.mic-level i.active { background: var(--good); box-shadow: 0 0 8px rgba(130, 185, 170, 0.5); }
.mic-level-label { font-size: 8.5px; color: var(--muted-2); margin-top: 3px; letter-spacing: 0.02em; }
.ptt-hint { font-size: 9px; color: var(--muted-2); letter-spacing: 0.06em; }

/* ---------- side ---------- */
.side {
  display: flex; flex-direction: column; min-height: 0; height: calc(100vh - 150px);
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: linear-gradient(170deg, rgba(17, 23, 38, 0.82), rgba(9, 13, 22, 0.86));
  backdrop-filter: blur(14px);
}
.side-tabs { display: flex; padding: 6px; gap: 4px; border-bottom: 1px solid var(--line); flex: none; }
.side-tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 7px 4px; border-radius: 8px; font-size: 11px; letter-spacing: 0.04em; }
.side-tabs button.active { background: rgba(228, 191, 127, 0.1); color: var(--gold-2); }
.side-panel { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.chat-tabs { display: flex; gap: 4px; padding: 8px 10px 0; flex: none; }
.chat-tabs button { border: 0; background: transparent; color: var(--muted-2); font-size: 10px; padding: 4px 9px; border-radius: 6px; }
.chat-tabs button.active { color: var(--gold-2); background: rgba(228, 191, 127, 0.09); }
.chat-list, .log-list, .voice-roster { flex: 1; overflow-y: auto; padding: 10px 12px; min-height: 0; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.12) transparent; }
.chat-list::-webkit-scrollbar, .log-list::-webkit-scrollbar, .voice-roster::-webkit-scrollbar { width: 4px; }
.chat-list::-webkit-scrollbar-thumb, .log-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 4px; }
.chat-item { margin-bottom: 10px; display: flex; gap: 8px; }
.chat-avatar { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--serif); font-size: 9px; background: radial-gradient(circle at 32% 26%, hsl(var(--h, 40) 42% 44%), hsl(var(--h2, 220) 36% 16%)); color: #f6ecd8; }
.chat-body { min-width: 0; }
.chat-head { display: flex; gap: 6px; align-items: baseline; font-size: 9.5px; color: var(--muted-2); margin-bottom: 2px; }
.chat-head b { color: var(--gold); font-weight: 500; }
.chat-text { font-size: 12px; line-height: 1.55; color: #d8d4cb; word-break: break-word; white-space: pre-wrap; }
.chat-item.wolf .chat-text { color: #e7b0a4; }
.chat-item.dead .chat-text { color: #9ba0ad; font-style: italic; }
.chat-item.system { justify-content: center; }
.chat-item.system .chat-text { font-size: 10px; color: var(--muted-2); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }
.chat-empty, .log-empty { padding: 30px 12px; text-align: center; font-size: 11px; color: var(--muted-2); line-height: 1.8; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); flex: none; }
.chat-form input { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: rgba(0, 0, 0, 0.25); padding: 0 11px; font-size: 12px; outline: none; }
.chat-form input:focus { border-color: rgba(228, 191, 127, 0.4); }
.chat-form .icon-btn { width: 36px; height: 36px; border-radius: 9px; color: var(--gold); }
.log-item { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.05); font-size: 11px; line-height: 1.6; color: #b9b5ab; }
.log-item:last-child { border-bottom: 0; }
.log-time { flex: none; width: 34px; color: var(--muted-2); font-size: 9px; font-variant-numeric: tabular-nums; }
.log-text { min-width: 0; }
.log-item.kind-death .log-text { color: #e0a99e; }
.log-item.kind-vote .log-text { color: #d9c39a; }
.log-item.kind-system .log-text { color: var(--muted); }
.voice-roster { padding: 12px; }
.voice-row { display: flex; align-items: center; gap: 9px; padding: 7px 4px; border-bottom: 1px dashed rgba(255, 255, 255, 0.05); }
.voice-row:last-child { border-bottom: 0; }
.voice-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 10px; background: radial-gradient(circle at 32% 26%, hsl(var(--h, 40) 42% 44%), hsl(var(--h2, 220) 36% 16%)); color: #f6ecd8; flex: none; }
.voice-name { font-size: 11.5px; color: #d7d3c9; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-state { font-size: 9px; color: var(--muted-2); }
.voice-state.live { color: #8fd3b6; }
.voice-state.allowed { color: var(--gold); }
.info-note { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 10px; line-height: 1.7; color: var(--muted-2); }

/* ---------- footer ---------- */
.footer { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 10px; width: min(1360px, calc(100% - 56px)); margin: 0 auto; padding: 22px 0 26px; font-size: 10px; letter-spacing: 0.08em; color: var(--muted-2); }
.footer a:hover { color: var(--gold); }
.footer .dot { opacity: 0.4; }

/* ---------- modal / toast ---------- */
.modal-root { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 24px; background: rgba(3, 5, 9, 0.72); backdrop-filter: blur(10px); }
.modal-root.open { display: grid; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: min(520px, 100%); max-height: 86vh; overflow-y: auto; border-radius: 20px;
  border: 1px solid var(--line-strong); background: linear-gradient(165deg, #1a2235, #0b0f1a);
  box-shadow: var(--shadow); padding: 28px; position: relative; animation: rise 0.3s ease;
}
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.modal h2 { margin: 0 0 10px; font-family: var(--serif); font-size: 26px; letter-spacing: 0.1em; }
.modal p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.modal .modal-close { position: absolute; right: 14px; top: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.modal ul { margin: 8px 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.9; }
.modal li strong { color: var(--text); font-weight: 500; }
.role-reveal { text-align: center; }
.role-reveal .reveal-kicker { font-size: 10px; letter-spacing: 0.3em; color: var(--gold); }
.role-reveal .reveal-card {
  margin: 18px auto; width: 210px; height: 280px; border-radius: 16px; position: relative;
  background: radial-gradient(circle at 50% 30%, rgba(228, 191, 127, 0.2), rgba(10, 15, 26, 0.96) 68%);
  border: 1px solid rgba(228, 191, 127, 0.45); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(228, 191, 127, 0.06);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px;
}
.role-reveal .reveal-card.wolf { border-color: rgba(217, 107, 82, 0.55); background: radial-gradient(circle at 50% 30%, rgba(217, 107, 82, 0.24), rgba(12, 10, 14, 0.97) 68%); }
.reveal-symbol { font-family: var(--serif); font-size: 46px; color: var(--gold); line-height: 1; }
.reveal-name { font-family: var(--serif); font-size: 30px; letter-spacing: 0.2em; }
.reveal-team { font-size: 10px; letter-spacing: 0.24em; color: var(--muted); text-transform: uppercase; }
.reveal-desc { font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.reveal-mates { margin-top: 4px; font-size: 10.5px; color: #dfa99c; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: 16px; }
.result-player { border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; font-size: 10.5px; display: flex; justify-content: space-between; gap: 4px; align-items: center; background: rgba(255, 255, 255, 0.02); }
.result-player b { color: var(--gold); }
.result-player.wolf { border-color: rgba(217, 107, 82, 0.25); }
.result-player.wolf span { color: #e0a99e; }
.result-banner { text-align: center; padding: 6px 0 2px; }
.result-banner strong { display: block; font-family: var(--serif); font-size: 34px; letter-spacing: 0.14em; }
.result-banner.good strong { color: var(--good); }
.result-banner.wolf strong { color: var(--wolf); }
.result-banner small { color: var(--muted); font-size: 11px; }
.toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: min(420px, calc(100% - 32px)); }
.toast { padding: 10px 18px; border-radius: 999px; background: rgba(22, 29, 45, 0.96); border: 1px solid var(--line-strong); color: #e6e1d6; font-size: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); animation: toastIn 0.25s ease; text-align: center; }
.toast.error { border-color: rgba(216, 105, 92, 0.45); color: #f0b7ad; }
.toast.good { border-color: rgba(130, 185, 170, 0.45); color: #b7e0d1; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.audio-sink { position: fixed; width: 0; height: 0; overflow: hidden; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .landing { grid-template-columns: 1fr; gap: 46px; padding-top: 24px; min-height: 0; }
  .hero { max-width: 760px; }
  .entry { max-width: 720px; }
  .room-body { grid-template-columns: 1fr; }
  .side { height: 330px; }
  .table { max-width: 720px; min-height: 560px; }
}
@media (max-width: 960px) {
  .topbar, .shell, .footer { width: calc(100% - 36px); }
  .topnav { gap: 14px; }
  .brand-text small { display: none; }
  .dock { grid-template-columns: 1fr 1.4fr; }
  .voice-card { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; min-height: 66px; }
  .voice-card .voice-reason { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  .topbar { padding: 16px 0; gap: 12px; }
  .topnav a:first-child { display: none; }
  .hero h1 { font-size: 56px; }
  .lede { font-size: 14.5px; }
  .how { grid-template-columns: 1fr; gap: 14px; margin-top: 40px; }
  .entry { padding: 20px; border-radius: 18px; }
  .entry-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .avatar-picker { grid-template-columns: repeat(8, 1fr); gap: 5px; }
  .avatar-choice { font-size: 12px; }
  .board-picker { grid-template-columns: 1fr; }
  .board-picker button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; }
  .board-picker button strong { font-size: 13px; }
  .board-picker button em { margin-top: 0; margin-left: auto; }
  .room-top { flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px; }
  .room-id strong { font-size: 17px; }
  .room-timer { font-size: 17px; }
  .room-actions { margin-left: auto; }
  .table { min-height: 0; aspect-ratio: auto; padding-top: 4px; }
  .table-felt, .table-ring { display: none; }
  .center { position: relative; left: auto; top: auto; transform: none; margin: 8px auto 16px; width: 220px; height: 220px; padding: 20px; }
  .center-title { font-size: 22px; }
  .center-sub { font-size: 10.5px; }
  .seats { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 2px 6px; }
  .seat { position: relative; left: auto !important; top: auto !important; transform: none; width: auto; flex-direction: row; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 11px; background: rgba(13, 18, 30, 0.7); }
  .seat-avatar { width: 36px; height: 36px; font-size: 13px; }
  .seat-meta { background: transparent; border: 0; padding: 0; flex-direction: column; align-items: flex-start; gap: 0; }
  .seat-meta span { max-width: none; font-size: 10.5px; }
  .seat-flags { margin-left: auto; flex-direction: column; align-items: flex-end; gap: 2px; }
  .seat-role { display: none; }
  .seat-votes { top: 2px; right: 2px; }
  .seat.dead .seat-avatar::before { right: -4px; top: -5px; }
  .dock { grid-template-columns: 1fr; }
  .dock-card { min-height: 0; }
  .voice-card { grid-column: auto; }
  .side { height: 360px; }
  .modal { padding: 22px; }
  .role-reveal .reveal-card { width: 180px; height: 240px; }
  .footer { padding-bottom: 20px; }
}
@media (max-width: 420px) {
  .hero h1 { font-size: 46px; }
  .hero-actions .btn { flex: 1; padding: 0 12px; }
  .entry { padding: 16px; }
  .avatar-picker { grid-template-columns: repeat(4, 1fr); }
  .field-row { flex-direction: column; gap: 12px; }
  .seats { grid-template-columns: 1fr 1fr; }
  .seat { padding: 6px; }
  .seat-meta span { max-width: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- late additions ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.action-card .settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.action-card .mini-select select { padding: 4px 5px; font-size: 10px; }
.action-card .mini-select > span { font-size: 8px; letter-spacing: 0.1em; }
.mini-select { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mini-select > span { font-size: 8.5px; letter-spacing: 0.16em; color: var(--muted-2); }
.mini-select select {
  width: 100%; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, 0.04);
  color: #d9d4c9; font-size: 10.5px; padding: 5px 7px; outline: none;
  appearance: none; color-scheme: dark; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 11px) 52%, calc(100% - 7px) 52%;
  background-size: 4px 4px; background-repeat: no-repeat;
}
.mini-select select:focus { border-color: rgba(228, 191, 127, 0.45); }
.mini-select select option { background: #151c2b; color: #eae6dc; }
.role-desc { max-height: 48px; }
.dock .action-card .btn.small { white-space: nowrap; }
.role-card .role-lock { cursor: pointer; }
.action-card .btn.ghost { border-color: var(--line); color: var(--muted); }
.action-card .btn.ghost:hover { color: var(--text); border-color: var(--line-strong); }
@media (max-width: 420px) {
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .mini-select select { font-size: 10px; }
  .role-desc { max-height: 40px; }
}
@media (max-height: 720px) and (min-width: 761px) {
  .table { min-height: 520px; max-width: 660px; }
  .side { height: calc(100vh - 128px); }
}
@media (min-width: 1181px) {
  .table { max-width: min(820px, max(340px, calc(100vh - 425px))); min-height: 0; }
  .side { height: auto; min-height: 0; }
  .center { width: clamp(200px, 50%, 290px); height: clamp(200px, 50%, 290px); }
}
@media (min-width: 761px) and (max-height: 820px) {
  .seat { width: 96px; }
  .seat-avatar { width: 44px; height: 44px; }
  .seat-meta { margin-top: 4px; padding: 3px 7px; }
  .center-title { font-size: 26px; }
  .center-sub { font-size: 11px; }
  .dock-card { min-height: 96px; padding: 10px 12px; }
  .table { max-width: min(820px, calc(100vh - 360px)); }
  .voice-card { gap: 6px; }
  .voice-card .ptt-hint:last-child { display: none; }
}
