:root {
  --paper: #f2ecdf;
  --paper-2: #fbf7ee;
  --paper-3: #e9e1d1;
  --ink: #1b1c19;
  --muted: #6f6d62;
  --line: rgba(27, 28, 25, 0.13);
  --line-strong: rgba(27, 28, 25, 0.24);
  --navy: #1e3a5f;
  --green: #24563f;
  --brick: #9c4436;
  --gold: #a77b35;
  --shadow: 0 18px 50px rgba(35, 31, 22, 0.1);
  --radius: 14px;
  --font-display: "Noto Serif SC", "Songti SC", "SimSun", "Georgia", serif;
  --font-body: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

html.is-night {
  --paper: #12161d;
  --paper-2: #1a1f29;
  --paper-3: #232936;
  --ink: #ece7da;
  --muted: #98a0ad;
  --line: rgba(236, 231, 218, 0.13);
  --line-strong: rgba(236, 231, 218, 0.26);
  --navy: #7fa0c9;
  --green: #7fb79b;
  --brick: #d08c7e;
  --gold: #d6b073;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.8s ease, color 0.8s ease;
  background-image:
    radial-gradient(900px 620px at 12% -10%, rgba(156, 68, 54, 0.07), transparent 60%),
    radial-gradient(760px 560px at 92% 8%, rgba(36, 86, 63, 0.07), transparent 62%),
    radial-gradient(700px 500px at 50% 110%, rgba(30, 58, 95, 0.06), transparent 60%);
  background-attachment: fixed;
}

html.is-night body {
  background-image:
    radial-gradient(900px 600px at 16% -10%, rgba(70, 100, 140, 0.22), transparent 60%),
    radial-gradient(760px 540px at 90% 10%, rgba(30, 60, 95, 0.28), transparent 62%),
    radial-gradient(700px 500px at 50% 110%, rgba(9, 12, 18, 0.7), transparent 60%);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
}

a { color: inherit; }
button { font: inherit; }
::selection { background: rgba(167, 123, 53, 0.28); }

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 22px 72px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.brand-logo {
  height: 30px;
  width: auto;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}
@media (max-width: 720px) {
  .brand-logo { height: 24px; }
}
.brand-name {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.16em; }
.spacer { flex: 1; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
  background: color-mix(in srgb, var(--paper-2) 70%, transparent);
}
.pill b { font-variant-numeric: tabular-nums; }
.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 16px;
}
.icon-btn:hover { background: var(--paper-3); }
.conn {
  width: 8px; height: 8px; border-radius: 50%;
  background: #c9823a;
  display: inline-block;
}
.conn.on { background: #4f9b70; }

/* 在线 pill hover 退出登录 */
.conn-pill {
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  cursor: default;
}
.conn-pill.logout-hover {
  background: var(--brick);
  border-color: var(--brick);
  color: #fff;
  cursor: pointer;
}
.conn-pill.logout-hover .conn {
  background: #fff !important;
}
.conn-pill.logout-hover .small {
  font-weight: 600;
}

/* user-chip tooltip 气泡 */
.user-chip-wrap { position: relative; display: inline-flex; }
.user-chip-wrap .tooltip-bubble {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: var(--ink);
  color: var(--paper-2);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 50;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.user-chip-wrap .tooltip-bubble::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--ink);
}
.user-chip-wrap.show-tip .tooltip-bubble {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.hide { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: var(--paper-2);
  background: var(--ink);
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--navy); color: #f6f2e8; }
.btn-green { background: var(--green); color: #f6f2e8; }
.btn-brick { background: var(--brick); color: #fbf3ea; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--paper-3); }
.btn-danger { background: transparent; border-color: var(--brick); color: var(--brick); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-wide { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.card {
  background: color-mix(in srgb, var(--paper-2) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }
.card h3 {
  font-size: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h3 .dim { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; font-family: var(--font-body); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11px; letter-spacing: 0.06em; }
.serif { font-family: var(--font-display); }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: grid; gap: 12px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

label.field { display: block; }
label.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.08em; }
.input, textarea.input, select.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--paper) 60%, transparent);
  color: var(--ink);
  font: inherit;
  outline: none;
}
.input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 18%, transparent); }
textarea.input { min-height: 84px; resize: vertical; }

/* ---------- auth ---------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: stretch;
}
.auth-left {
  position: relative;
  padding: 48px clamp(28px, 6vw, 84px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.auth-left::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 55%, color-mix(in srgb, var(--paper-2) 60%, transparent));
  pointer-events: none;
}
.auth-logo { height: min(52vh, 460px); position: relative; }
.logo3d-canvas { display: block; width: 100%; height: 100%; }
.logo3d-fallback { width: 100%; height: 100%; object-fit: contain; }
.auth-title {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.1;
  margin-top: 12px;
}
.auth-tagline { color: var(--muted); letter-spacing: 0.22em; font-size: 12px; text-transform: uppercase; }
.auth-quote { margin-top: 18px; color: var(--muted); max-width: 34ch; }
.auth-right {
  border-left: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 26px;
  background: color-mix(in srgb, var(--paper-2) 55%, transparent);
}
.auth-card { width: min(380px, 100%); }
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  margin-bottom: 20px;
}
.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.08em;
}
.tabs button.on { background: var(--paper-2); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.auth-foot { margin-top: 18px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.form-err { color: var(--brick); font-size: 12.5px; min-height: 18px; margin-top: 8px; }

/* ---------- home ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 30px;
  align-items: center;
  padding: 40px 0 30px;
}
.hero-copy h1 {
  font-size: clamp(36px, 5.2vw, 62px);
  line-height: 1.06;
  letter-spacing: 0.04em;
}
.hero-kicker {
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.hero-copy p { color: var(--muted); max-width: 42ch; margin: 14px 0 22px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stage {
  height: clamp(280px, 40vh, 420px);
  position: relative;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--paper-2) 90%, transparent), transparent 64%);
  overflow: hidden;
}
.hero-stage::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 12%;
  width: 46%; height: 16px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0,0,0,.22), transparent 70%);
  filter: blur(6px);
}
.home-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
  align-items: start;
}
.acct-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--paper-2) 70%, transparent);
}
.stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; font-family: var(--font-display); }
.stat span { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; }
.ann-list { display: grid; gap: 10px; max-height: 270px; overflow: auto; }
.ann-item { border-left: 3px solid var(--gold); padding: 2px 0 2px 12px; }
.ann-item h4 { font-size: 14px; }
.ann-item p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.board { display: grid; gap: 6px; }
.board-row {
  display: grid;
  grid-template-columns: 26px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 7px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.board-row:last-child { border-bottom: 0; }
.board-rank { color: var(--muted); font-variant-numeric: tabular-nums; }
.board-rank.top { color: var(--gold); font-weight: 700; }
.board-pts { font-variant-numeric: tabular-nums; font-weight: 600; }
.quick-join { display: flex; gap: 8px; }
.quick-join .input { text-transform: uppercase; letter-spacing: 0.18em; }

/* ---------- home navigation (lobby → modes → rooms) ---------- */
.btn-lg { min-height: 52px; padding: 14px 30px; font-size: 15.5px; border-radius: 12px; }
.func-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 10px;
}
.func-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper-2) 72%, transparent);
  color: var(--ink);
  cursor: pointer;
  transition: transform .15s ease, border-color .2s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.func-card:nth-child(3n + 1) { border-top-color: var(--brick); }
.func-card:nth-child(3n + 2) { border-top-color: var(--navy); }
.func-card:nth-child(3n + 3) { border-top-color: var(--green); }
.func-card:hover { transform: translateY(-2px); background: var(--paper-3); }
.func-card:disabled { opacity: .5; cursor: default; transform: none; }
.func-card b { font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.func-card span { font-size: 11.5px; color: var(--muted); }

.page-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 30px 0 18px;
}
.page-head h2 { font-size: clamp(22px, 3vw, 32px); }
.page-head .muted { margin-left: auto; }
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 26px 24px;
  min-height: 208px;
  text-align: left;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background:
    radial-gradient(420px 220px at 12% 0%, color-mix(in srgb, var(--navy) 9%, transparent), transparent 70%),
    color-mix(in srgb, var(--paper-2) 88%, transparent);
  color: var(--ink);
  box-shadow: var(--shadow);
}
button.mode-card { cursor: pointer; transition: transform .16s ease, border-color .2s ease; }
button.mode-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.mode-card b { font-family: var(--font-display); font-size: 24px; }
.mode-card > span:not(.mode-badge) { color: var(--muted); font-size: 12.5px; max-width: 34ch; }
.mode-card em { font-style: normal; font-size: 12px; letter-spacing: .12em; color: var(--navy); margin-top: auto; }
.mode-card.mode-match em { color: var(--brick); }
.mode-card.mode-room em { color: var(--green); }
.mode-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 17px;
  color: #f7f2e7;
  background: var(--navy);
}
.mode-match .mode-badge { background: var(--brick); }
.mode-room .mode-badge { background: var(--green); }
.mode-badge.brick { background: var(--brick); }
.mode-card .btn { margin-top: auto; align-self: flex-start; }
.mode-card .quick-join { margin-top: auto; }
.rooms .mode-card { min-height: 220px; }

/* profile modal */
.profile-head { display: flex; align-items: center; gap: 12px; }
.profile-head .avatar { width: 44px; height: 44px; font-size: 18px; }
.history-list { display: grid; gap: 2px; max-height: 230px; overflow: auto; }
.history-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
}
.history-row:last-child { border-bottom: 0; }
.hr-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.hr-mode { color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.hr-role.wolf { color: var(--brick); }
.hr-result.pos { color: var(--green); font-weight: 700; }
.hr-result.neg { color: var(--brick); }
.hr-friends { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }

/* ---------- room ---------- */
.room-head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 26px 0 18px;
}
.room-code {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: 0.3em;
  line-height: 1;
}
.room-tag { font-size: 11px; letter-spacing: 0.18em; color: var(--muted); text-transform: uppercase; }
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}
.member {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: color-mix(in srgb, var(--paper-2) 66%, transparent);
  min-height: 108px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  position: relative;
}
.member .seat-no { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; }
.member .m-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .m-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.member.ai { border-style: dashed; }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--navy) 16%, transparent);
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}
.tag.ai { border-style: dashed; }
.tag.owner { border-color: var(--gold); color: var(--gold); }
.tag.wolf { border-color: var(--brick); color: var(--brick); }
.tag.self { border-color: var(--navy); color: var(--navy); }
.tag.live { border-color: var(--green); color: var(--green); }
.room-grid { display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 18px; align-items: start; }
.config-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.config-row:last-child { border-bottom: 0; }
.switch {
  width: 42px; height: 24px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  position: relative; cursor: pointer; flex: 0 0 auto;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--paper-2); box-shadow: 0 1px 3px rgba(0,0,0,.22);
  transition: transform .18s ease;
}
.switch.on { background: var(--green); border-color: var(--green); }
.switch.on::after { transform: translateX(18px); }
.ai-list { display: grid; gap: 8px; }
.ai-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
}
.ai-row select { min-height: 34px; padding: 4px 8px; }
.add-ai { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.room-side .card + .card { margin-top: 14px; }

/* ---------- match ---------- */
.match-wrap { max-width: 640px; margin: 12vh auto 0; text-align: center; }
.match-ring {
  width: 148px; height: 148px;
  border-radius: 50%;
  margin: 0 auto 24px;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  position: relative;
}
.match-ring::before, .match-ring::after {
  content: "";
  position: absolute; inset: -1px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--brick);
  animation: spin 2.6s linear infinite;
}
.match-ring::after { inset: 12px; border-top-color: var(--navy); animation-duration: 1.8s; animation-direction: reverse; }
.match-count { font-family: var(--font-display); font-size: 38px; line-height: 1; }
.match-count span { font-size: 15px; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
.wait-dots::after { content: "…"; animation: dots 1.6s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "…"; } }

/* ---------- game ---------- */
.game-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 0 14px;
}
.phase-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.12em;
}
.phase-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.is-night .phase-chip .dot { background: #8fb2dd; }
.round-tag { font-size: 12px; color: var(--muted); letter-spacing: 0.1em; }
.timer-wrap { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 150px; }
.timer-bar { flex: 1; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 12%, transparent); overflow: hidden; }
.timer-fill { height: 100%; background: var(--navy); width: 100%; transition: width .25s linear; }
.timer-num { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; min-width: 48px; text-align: right; }
.timer-num.warn { color: var(--brick); }

.game-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.seat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.seat {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px 11px 10px;
  background: color-mix(in srgb, var(--paper-2) 84%, transparent);
  min-height: 116px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
  overflow: hidden;
}
.seat .s-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.seat .s-no { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .1em; }
.seat .s-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .s-meta { display: flex; gap: 4px; flex-wrap: wrap; }
.seat.self { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy) inset; }
.seat.speaking { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 45%, transparent); }
.seat.speaking::before {
  content: "发言中";
  position: absolute; right: 8px; top: 8px;
  font-size: 9.5px; color: var(--gold); letter-spacing: .08em;
}
.seat.dead { opacity: .48; filter: grayscale(.7); }
.seat.dead::after {
  content: "出局";
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 20px; letter-spacing: .3em;
  color: var(--brick);
  background: color-mix(in srgb, var(--paper) 24%, transparent);
  pointer-events: none;
}
.seat .vote-badge {
  position: absolute; right: 8px; bottom: 8px;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--brick); color: #fff;
  font-size: 11px; display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.seat .wolf-mark {
  position: absolute; left: 10px; bottom: 8px;
  font-family: var(--font-display); font-size: 13px; color: var(--brick);
  opacity: .8;
}
.seat.pick { cursor: pointer; }
.seat.pick:hover { transform: translateY(-2px); border-color: var(--gold); }
.seat.picked { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--paper-2)); }
.seat.mic-on {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green), 0 0 14px color-mix(in srgb, var(--green) 32%, transparent);
}
.seat.mic-off {
  border-color: var(--brick);
  box-shadow: inset 0 0 0 1px var(--brick), 0 0 10px color-mix(in srgb, var(--brick) 24%, transparent);
}
.mic-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  margin-left: auto;
}
.mic-dot.on { background: var(--green); box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 28%, transparent); }
.mic-dot.off { background: var(--brick); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brick) 24%, transparent); }
.mic-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.preset-select { width: auto; min-width: 96px; min-height: 34px; padding: 4px 8px; }
.wolf-votes { display: grid; gap: 4px; margin-top: 10px; }
.warn-text { color: var(--brick); }
.rv-contact {
  font-size: 10.5px;
  color: var(--navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-side { display: grid; gap: 14px; }
.role-card {
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  padding: 16px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--navy) 12%, transparent), transparent 60%),
    color-mix(in srgb, var(--paper-2) 88%, transparent);
  position: relative;
}
.role-card .rc-camp { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.role-card .rc-name { font-family: var(--font-display); font-size: 26px; line-height: 1.2; margin: 4px 0 6px; }
.role-card .rc-desc { font-size: 12.5px; color: var(--muted); }
.role-card.wolf { background: linear-gradient(160deg, color-mix(in srgb, var(--brick) 16%, transparent), transparent 62%), color-mix(in srgb, var(--paper-2) 88%, transparent); }
.role-card .rc-seat { position: absolute; right: 14px; top: 14px; font-size: 11px; color: var(--muted); }
.checks { display: grid; gap: 5px; margin-top: 10px; font-size: 12px; }
.check-line { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--line); padding-bottom: 4px; }
.check-line .wolf { color: var(--brick); font-weight: 700; }
.check-line .good { color: var(--green); font-weight: 700; }

.action-card { border: 1px solid var(--line-strong); border-radius: 13px; padding: 16px; background: color-mix(in srgb, var(--paper-2) 90%, transparent); }
.action-card h4 { font-size: 14px; margin-bottom: 4px; }
.action-hint { color: var(--muted); font-size: 12.5px; }
.target-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.chip {
  min-height: 36px; min-width: 44px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.chip:hover { border-color: var(--gold); }
.chip.on { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
.chip:disabled { opacity: .35; cursor: not-allowed; }
.action-foot { display: flex; gap: 8px; flex-wrap: wrap; }

.log-list { display: grid; gap: 8px; max-height: 300px; overflow: auto; }
.speech {
  border-left: 2px solid var(--line-strong);
  padding: 4px 0 4px 10px;
  font-size: 13px;
}
.speech.me { border-left-color: var(--navy); }
.speech .sp-head { display: flex; gap: 6px; align-items: baseline; font-size: 11.5px; color: var(--muted); }
.speech .sp-text { margin-top: 2px; }
.speech .sp-claim { color: var(--gold); font-size: 11px; margin-left: 4px; }

.banner {
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.banner.wolf { border-color: var(--brick); background: color-mix(in srgb, var(--brick) 10%, transparent); }
.banner.good { border-color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); }
.banner .big { font-family: var(--font-display); font-size: 17px; letter-spacing: .08em; }

.death-list { display: flex; gap: 8px; flex-wrap: wrap; }
.death-pill {
  border: 1px solid var(--brick); color: var(--brick);
  padding: 4px 10px; border-radius: 999px; font-size: 12.5px;
}

.night-note { color: var(--muted); font-size: 12.5px; }

/* ---------- settle ---------- */
.settle-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10, 12, 16, .62);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  padding: 22px;
  animation: fade .3s ease;
}
@keyframes fade { from { opacity: 0; } }
.settle-card {
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  box-shadow: 0 30px 90px rgba(0,0,0,.35);
  padding: clamp(20px, 4vw, 34px);
}
.settle-head { text-align: center; margin-bottom: 18px; }
.settle-title { font-family: var(--font-display); font-size: clamp(30px, 5vw, 46px); letter-spacing: .16em; }
.settle-title.good { color: var(--green); }
.settle-title.wolf { color: var(--brick); }
.settle-sub { color: var(--muted); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
.role-reveal { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 8px; }
.reveal {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  display: flex; flex-direction: column; gap: 3px;
  background: color-mix(in srgb, var(--paper) 50%, transparent);
}
.reveal .rv-top { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.reveal .rv-role { font-family: var(--font-display); font-size: 16px; }
.reveal.wolf { border-color: color-mix(in srgb, var(--brick) 45%, transparent); }
.reveal .rv-delta { font-size: 12px; font-variant-numeric: tabular-nums; }
.reveal .rv-delta.pos { color: var(--green); }
.reveal .rv-delta.neg { color: var(--brick); }
.reveal.dead { opacity: .62; }

/* ---------- modal / toast ---------- */
#modal {
  position: fixed; inset: 0; z-index: 80;
  display: none; place-items: center;
  background: rgba(15, 16, 20, .5);
  backdrop-filter: blur(5px);
  padding: 20px;
}
#modal.open { display: grid; }
.modal-card {
  width: min(560px, 100%);
  max-height: 84vh;
  overflow: auto;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  box-shadow: 0 24px 70px rgba(0,0,0,.3);
}
.modal-card h3 { font-size: 19px; margin-bottom: 12px; padding-right: 28px; }
.modal-x {
  position: absolute; right: 12px; top: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer;
}
.modal-body { font-size: 13.5px; color: var(--muted); line-height: 1.75; }
.modal-body strong { color: var(--ink); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.rule-role { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.rule-role:last-child { border-bottom: 0; }
.rule-role b { font-family: var(--font-display); font-size: 14px; color: var(--ink); }

#toasts {
  position: fixed; z-index: 90;
  left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
  width: min(92vw, 460px);
}
.toast {
  background: var(--ink); color: var(--paper-2);
  border-radius: 10px; padding: 10px 16px;
  font-size: 13px; opacity: 0; transform: translateY(8px);
  transition: opacity .22s ease, transform .22s ease;
  max-width: 100%; text-align: center;
}
.toast.show { opacity: .96; transform: none; }
.toast-warn { background: var(--brick); color: #fff; }
.toast-ok { background: var(--green); color: #fff; }

.loading {
  display: grid; place-items: center; min-height: 40vh; color: var(--muted);
  font-size: 13px; letter-spacing: .12em;
}

.phase-veil {
  position: fixed; inset: 0; z-index: 45; pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, transparent 30%, rgba(6,8,12,.5) 100%);
  opacity: 0; transition: opacity .8s ease;
}
.is-night .phase-veil { opacity: 1; }

/* ---------- topbar: points hover check-in / nickname / mixer ---------- */
.points-hover { position: relative; display: inline-flex; }
.checkin-mini {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
  white-space: nowrap;
}
.points-hover:hover .checkin-mini,
.points-hover.hot .checkin-mini,
#points-pill:hover ~ .checkin-mini,
#points-checkin:hover { opacity: 1; pointer-events: auto; }
.checkin-mini:disabled {
  background: var(--paper-3);
  border-color: var(--line-strong);
  color: var(--muted);
  cursor: default;
}
.user-chip {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 14px;
  background: color-mix(in srgb, var(--paper-2) 70%, transparent);
  color: var(--ink);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.user-chip:hover { background: var(--paper-3); }
.mixer-row {
  display: grid;
  grid-template-columns: 56px 1fr 46px;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
  font-size: 12.5px;
}
.mixer-row input[type="range"] { width: 100%; accent-color: var(--green); }
.mixer-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 11.5px; }

/* ---------- lobby ---------- */
.lobby {
  display: grid;
  grid-template-columns: minmax(220px, 0.88fr) minmax(300px, 1.4fr) minmax(236px, 0.95fr);
  grid-template-areas:
    "intro model board"
    "ann   model board";
  grid-template-rows: auto 1fr;
  gap: 16px 22px;
  align-items: start;
  min-height: calc(100vh - 128px);
  padding: 24px 0 46px;
}
.lobby-left {
  grid-area: intro;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.lobby-left h1 {
  font-size: clamp(30px, 3.5vw, 46px);
  line-height: 1.1;
  letter-spacing: 0.04em;
}
.lobby-left p { color: var(--muted); margin: 0; font-size: 13.5px; line-height: 1.8; }
.lobby-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; }
.lobby-tip { line-height: 1.75; max-width: 30ch; }
.link-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  cursor: pointer;
  padding: 4px 1px;
  border-bottom: 1px dotted transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.link-btn:hover { color: var(--ink); border-bottom-color: var(--line-strong); }

.lobby-center {
  grid-area: model;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  padding-top: 6px;
}
/* 固定高度的模型占位区：3D 画布挂载前后都不改变布局 */
.lobby-stage {
  position: relative;
  width: 100%;
  height: clamp(300px, 42vh, 430px);
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--paper-2) 88%, transparent), transparent 66%);
  opacity: 0.96;
}
.lobby-stage .logo3d-canvas { display: block; width: 100%; height: 100%; }
.lobby-stage .logo3d-fallback { width: 100%; height: 100%; object-fit: contain; }

.ann-carousel {
  grid-area: ann;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 206px;
  min-width: 0;
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper-2) 90%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.ann-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ann-label {
  font-size: 10.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}
/* 固定高度的公告占位区：轮播切换不撑开布局 */
.ann-track { position: relative; height: 118px; margin-top: 10px; flex: none; }
.ann-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}
.ann-slide.on { opacity: 1; transform: none; pointer-events: auto; }
.ann-slide h2 { font-size: clamp(15px, 1.5vw, 19px); line-height: 1.3; }
.ann-slide p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.ann-date { margin-top: auto; padding-top: 6px; font-size: 9.5px; letter-spacing: 0.14em; color: var(--muted); }
.ann-dots { display: flex; gap: 7px; margin-top: 8px; flex: none; }
.ann-dot {
  width: 26px;
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background 0.24s ease;
}
.ann-dot.on { background: var(--gold); }

/* 固定高度：按钮渐显/隐藏不会顶动模型 */
.lobby-start {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 108px;
  width: 100%;
}
.start-btn {
  opacity: 0;
  transform: translateY(12px) scale(0.94);
  pointer-events: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 0;
  border-radius: 999px;
  padding: 15px 48px;
  background: var(--green);
  color: #fff;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.16em;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(36, 86, 63, 0.32);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), background 0.25s ease;
}
.start-btn em {
  font-style: normal;
  font-family: var(--font-body);
  font-size: 9.5px;
  letter-spacing: 0.32em;
  opacity: 0.72;
  text-transform: uppercase;
}
.start-btn:hover { background: var(--navy); }
.lobby-start.near .start-btn { opacity: 1; transform: none; pointer-events: auto; }
.start-hint {
  font-size: 9.5px;
  letter-spacing: 0.28em;
  color: var(--muted);
  opacity: 0.6;
  transition: opacity 0.4s ease;
}
.lobby-start.near .start-hint { opacity: 0.9; }

.lobby-right {
  grid-area: board;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  padding-bottom: 24px;
}
.board-panel {
  padding: 16px 16px 14px;
  border-top: 3px solid var(--navy);
}
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.board-head h3 { font-size: 16.5px; margin: 0; }
.board-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper-3) 60%, transparent);
}
.board-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.board-tabs button.on { background: var(--paper-2); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }
.board-note { font-size: 10px; letter-spacing: 0.1em; color: var(--muted); margin: 8px 0 6px; }
.lb-board { max-height: 292px; overflow: auto; }
.lb-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 6px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.lb-row:last-child { border-bottom: 0; }
.lb-rank { color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-rank.top { color: var(--gold); font-weight: 700; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.lb-val small { margin-left: 3px; font-size: 10px; font-weight: 400; color: var(--muted); }
.board-me {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--navy) 8%, transparent);
}
.bm-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.bm-row b { font-family: var(--font-display); font-size: 21px; font-variant-numeric: tabular-nums; }
.bm-row span { font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted); }
.bm-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; font-size: 10.5px; color: var(--muted); }
.bm-stats b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 2px; }
.lobby-side-foot { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* ---------- swarm transition ---------- */
.swarm-veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.35s ease;
}
.swarm-veil.out { opacity: 0; }

/* rename */
.rename-box { margin-top: 12px; }
#pf-name-err, #pf-err { margin-top: 4px; }

/* responsive */
@media (max-width: 980px) {
  .home-grid, .room-grid, .game-grid { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: 1fr; }
  .page-head .muted { margin-left: 0; width: 100%; }
  .hero { grid-template-columns: 1fr; padding-top: 26px; }
  .hero-stage { height: 300px; order: -1; }
  .game-side { grid-template-columns: 1fr 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-left { min-height: 42vh; padding: 26px 24px 6px; }
  .auth-logo { height: 30vh; }
  .auth-right { border-left: 0; border-top: 1px solid var(--line); padding: 26px 20px 40px; }
  .seat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lobby {
    grid-template-columns: 1fr;
    grid-template-areas:
      "ann"
      "intro"
      "model"
      "board";
    grid-template-rows: auto auto auto auto;
    min-height: 0;
    gap: 12px;
    padding: 14px 0 44px;
  }
  /* 小屏：公告压成顶部横条，固定高度不撑动页面 */
  .ann-carousel {
    height: 122px;
    min-height: 0;
    margin: 0;
    padding: 10px 14px 9px;
    border-radius: 14px;
  }
  .ann-track { height: 62px; margin-top: 6px; }
  .ann-slide h2 { font-size: 16px; }
  .ann-slide p {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.55;
    -webkit-line-clamp: 2;
  }
  .ann-date { display: none; }
  .ann-dots { margin-top: 4px; }
  .ann-dot { width: 18px; }
  .lobby-center { padding-top: 0; min-height: 0; }
  .lobby-stage { height: clamp(220px, 32vh, 320px); }
  .lobby-start { height: 96px; }
  .lobby-start .start-btn { opacity: 1; transform: none; pointer-events: auto; }
  .start-hint { display: none; }
  .lobby-right { padding-bottom: 0; }
  .lb-board { max-height: 240px; }
  .lobby-side-foot { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .shell { padding: 0 14px 90px; }
  .topbar-in { padding: 8px 14px; gap: 8px; }
  .brand-sub { display: none; }
  .brand-name { display: none; }
  .conn-pill { padding: 6px 9px; }
  .conn-pill .small { display: none; }
  .user-chip { max-width: 84px; padding: 6px 10px; font-size: 11.5px; }
  .icon-btn { width: 34px; height: 34px; font-size: 14px; }
  .acct-strip { grid-template-columns: repeat(2, 1fr); }
  .seat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .seat { min-height: 104px; padding: 10px; }
  .game-side { grid-template-columns: 1fr; }
  .timer-wrap { width: 100%; margin-left: 0; order: 3; }
  .game-top { gap: 8px; }
  .hero-copy h1 { font-size: 38px; }
  .member-grid { grid-template-columns: repeat(2, 1fr); }
  .role-reveal { grid-template-columns: repeat(2, 1fr); }
  .modal-card { padding: 20px 16px; }
  .lobby { gap: 10px; padding-top: 10px; }
  .lobby-left h1 { font-size: 28px; }
  .ann-carousel { height: 118px; padding: 9px 12px 8px; }
  .ann-track { height: 62px; }
  .ann-slide h2 { font-size: 15px; }
  .lobby-stage { height: clamp(200px, 30vh, 280px); }
  .lobby-start { height: 88px; }
  .start-btn { padding: 12px 34px; font-size: 16px; }
}
@media (hover: none) {
  .lobby-start .start-btn { opacity: 1; transform: none; pointer-events: auto; }
  .lobby-start .start-hint { display: none; }
  .points-hover .checkin-mini { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- assets: role / camp icons ---------- */
.role-card .rc-icon {
  position: absolute;
  right: 14px;
  top: 36px;
  width: 64px;
  height: 64px;
  object-fit: contain;
  opacity: .9;
  pointer-events: none;
}
.role-card .rc-name { padding-right: 76px; }
.role-card .rc-camp-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: -3px;
  margin-right: 5px;
}
.seat .s-role-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: -2px;
  margin-right: 4px;
}
.reveal .rv-role img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: -4px;
  margin-right: 4px;
}
.reveal .rv-camp-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  vertical-align: -2px;
  margin-right: 4px;
}

/* ---------- medals ---------- */
.medal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 0 8px;
}
.medal-wall {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.medal {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 6px 7px;
  background: color-mix(in srgb, var(--paper) 45%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  min-height: 92px;
  justify-content: center;
  position: relative;
  transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.medal:hover { transform: translateY(-1px); }
.medal img { width: 40px; height: 40px; object-fit: contain; }
.medal.locked { opacity: .42; filter: grayscale(.65); }
.medal.equipped {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold) inset;
  background: color-mix(in srgb, var(--gold) 10%, var(--paper-2));
}
.medal.equipped::after {
  content: "";
  position: absolute;
  top: 4px; right: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gold);
}
.medal-name { font-size: 11.5px; font-weight: 600; line-height: 1.3; }
.medal-sub { font-size: 10px; color: var(--muted); letter-spacing: .04em; }
.medal-mini { width: 22px; height: 22px; object-fit: contain; flex: 0 0 auto; }
.medal-unlock-note { font-size: 11px; color: var(--muted); margin-top: 8px; }
.medal-equip-btn {
  margin-top: 4px;
  min-height: 22px;
  padding: 1px 8px;
  font-size: 10px;
  letter-spacing: .04em;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.medal-equip-btn:hover { border-color: var(--gold); color: var(--gold); }
.medal-equip-btn.on {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}
/* 对局/房间里的已佩戴奖章 */
.medal-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 15%, transparent);
  font-size: 10px;
  color: var(--gold);
  font-family: var(--font-display);
}

/* 房间成员 / 对局座位上的佩戴奖章 */
.m-medals { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 2px; }
.m-medals:empty { display: none; }
.seat .medal-mini { width: 18px; height: 18px; margin-right: 2px; vertical-align: middle; }
.seat .medal-chip { font-size: 9px; padding: 0 4px; margin-right: 2px; }

/* ---------- share ---------- */
.share-preview {
  display: block;
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  margin-bottom: 10px;
}

/* ---------- privacy ---------- */
.privacy-frame {
  display: block;
  width: 100%;
  height: min(62vh, 560px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

/* ---------- credits / about ---------- */
.credits {
  position: relative;
  height: 420px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 26px, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 26px, #000 calc(100% - 26px), transparent);
}
.credits-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  padding: 0 8px;
  animation: credits-scroll 52s linear infinite;
}
.credits.paused .credits-track { animation-play-state: paused; }
@keyframes credits-scroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
.credit-block {
  padding: 12px 6px 18px;
  border-bottom: 1px dashed var(--line);
  text-align: center;
}
.credit-role {
  font-size: 11.5px;
  letter-spacing: .16em;
  color: var(--muted);
  margin-top: 6px;
}
.credit-name {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: .1em;
  line-height: 1.3;
}
.credit-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: .18em;
  margin-bottom: 6px;
}
.credit-text {
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--muted);
  margin: 4px 0;
}
.credit-note { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ---------- 全屏关于页 ---------- */

/* ---------- 阵营倾向弹窗 ---------- */
.pref-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: radial-gradient(circle at 50% 50%, rgba(20,24,30,.75), rgba(6,8,12,.92));
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 22px;
  animation: fade .25s ease;
}
.pref-card {
  width: min(580px, 100%);
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 28px clamp(18px, 4vw, 36px);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  text-align: center;
}
.pref-title {
  font-size: clamp(20px, 2.6vw, 28px);
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.pref-sub {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 14px;
}
.pref-countdown {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .1em;
  margin-bottom: 18px;
}
.pref-pick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.pref-pick {
  min-height: 90px;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  font-family: var(--font-display);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: transform .15s ease, border-color .2s ease, background .2s ease, color .2s ease;
}
.pref-pick:hover { transform: translateY(-2px); }
.pref-pick.wolf { border-color: color-mix(in srgb, var(--brick) 45%, transparent); color: var(--brick); }
.pref-pick.wolf:hover, .pref-pick.wolf.picked { background: color-mix(in srgb, var(--brick) 20%, var(--paper-2)); border-color: var(--brick); }
.pref-pick.god { border-color: color-mix(in srgb, var(--gold) 50%, transparent); color: var(--gold); }
.pref-pick.god:hover, .pref-pick.god.picked { background: color-mix(in srgb, var(--gold) 20%, var(--paper-2)); border-color: var(--gold); }
.pref-pick.neutral { border-color: color-mix(in srgb, var(--navy) 45%, transparent); color: var(--navy); }
.pref-pick.neutral:hover, .pref-pick.neutral.picked { background: color-mix(in srgb, var(--navy) 18%, var(--paper-2)); border-color: var(--navy); }
.pref-pick.sage { border-color: color-mix(in srgb, var(--green) 45%, transparent); color: var(--green); }
.pref-pick.sage:hover, .pref-pick.sage.picked { background: color-mix(in srgb, var(--green) 18%, var(--paper-2)); border-color: var(--green); }
.pref-pick.picked { opacity: .9; }
.pref-pick:not(.picked) { filter: brightness(1); }

.about-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(ellipse at center, #1a2236 0%, #0a0d14 70%);
  color: #fff;
  overflow: hidden;
  cursor: pointer;
}
.about-fullscreen .about-track {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  padding: 10vh 20% 10vh;
  animation: about-scroll 52s linear infinite;
  will-change: transform;
}
.about-fullscreen.fast-scroll .about-track {
  animation-duration: 8s;
}
@keyframes about-scroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
.about-fullscreen .credit-block {
  padding: 36px 16px 48px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.about-fullscreen .credit-role {
  font-size: 18px;
  letter-spacing: .22em;
  color: #a0aec0;
}
.about-fullscreen .credit-name {
  font-family: var(--font-display);
  font-size: 48px;
  letter-spacing: .14em;
  margin-top: 8px;
  background: linear-gradient(135deg, #e0e7ff, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.about-fullscreen .credit-title {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: .2em;
  color: #fbbf24;
}
.about-fullscreen .credit-text,
.about-fullscreen .credit-note {
  font-size: 18px;
  line-height: 2;
  color: #cbd5e0;
}
.about-fullscreen .about-tip {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: rgba(255,255,255,.4);
  letter-spacing: .1em;
  pointer-events: none;
}

/* ---------- voice input ---------- */
.voice-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--green);
}
.voice-live[hidden] { display: none; }
.voice-live .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: voice-pulse 1.1s ease-in-out infinite;
}
@keyframes voice-pulse {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.18); }
}
#speech-voice.on {
  background: var(--brick);
  border-color: var(--brick);
  color: #fff;
}

/* ---------- unlimited timer ---------- */
.timer-bar.unlimited {
  background: transparent;
  border: 1px dashed var(--line-strong);
}
.timer-bar.unlimited .timer-fill {
  background: linear-gradient(90deg, var(--green), var(--gold));
  opacity: .55;
}

/* ---------- settle unlock strip ---------- */
.unlock-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 12px 0 4px;
}
.unlock-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
  letter-spacing: .04em;
}
.unlock-pill img { width: 16px; height: 16px; object-fit: contain; }

/* ---------- room kick ---------- */
.member .kick-btn { margin-top: auto; align-self: flex-start; }

@media (max-width: 640px) {
  .medal-wall { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .medal { min-height: 82px; padding: 6px 4px; }
  .medal img { width: 32px; height: 32px; }
  .credits { height: 340px; }
  .role-card .rc-icon { width: 52px; height: 52px; top: 34px; }
}
