/* ==========================================================
   狼人杀 · 月夜烛桌
   烛光桌游风：墨黑卡纸 + 金色细描边 + 羊皮纸文字
   ========================================================== */

:root {
  --gold: #c5a059;
  --gold-bright: #fcd34d;
  --gold-deep: #854d0e;
  --ink: #141210;
  --ink-raised: #1c1913;
  --parchment: #ece1c8;
  --parchment-dim: #b8ac92;
  --human: #38bdf8;
  --wolf: #dc2626;
  --good: #10b981;
  --border-gilded: rgba(197, 160, 89, 0.35);
  --border-gilded-strong: rgba(197, 160, 89, 0.55);
  --glow-warm: 0 0 16px rgba(197, 160, 89, 0.32);
  --glow-warm-inset: inset 0 0 14px rgba(197, 160, 89, 0.12);
  --radius-panel: 10px;
  --radius-input: 4px;
  --font-display: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(ellipse at 50% 20%, #201b13 0%, #0c0a08 70%);
  color: var(--parchment);
  min-height: 100vh;
  overflow: hidden;
}

.screen { min-height: 100vh; }
.hidden { display: none !important; }
.muted { color: var(--parchment-dim); font-size: 13px; }
.error { color: #f2a6a6; font-size: 13px; min-height: 18px; margin-top: 8px; }

/* ---------- 开始界面 ---------- */
#start-screen {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: 100vh;
  overflow-y: auto;
  padding: 28px 16px;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(197, 160, 89, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 60%, #1a160f 0%, #0b0907 75%);
}

.start-card {
  position: relative;
  margin: auto 0;
  background: linear-gradient(180deg, #1d1913, #15120d);
  border: 1px solid var(--border-gilded);
  border-radius: var(--radius-panel);
  padding: 40px 40px 32px;
  width: 360px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), var(--glow-warm-inset);
}

.crest {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 1px solid var(--border-gilded-strong);
  background: radial-gradient(circle at 50% 40%, rgba(252, 211, 77, 0.35), rgba(133, 77, 14, 0.15) 60%, transparent 70%);
  box-shadow: 0 0 24px rgba(197, 160, 89, 0.35);
  position: relative;
}
.crest::after {
  content: '狼';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--gold-bright);
}

.start-card h1 {
  font-family: var(--font-display);
  font-size: 38px;
  letter-spacing: 10px;
  color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(197, 160, 89, 0.45);
  margin-bottom: 6px;
}
.start-card .subtitle {
  color: var(--parchment-dim);
  font-size: 13px;
  letter-spacing: 3px;
  margin-bottom: 26px;
}

.start-card label {
  display: block;
  text-align: left;
  font-size: 13px;
  margin-bottom: 14px;
  color: var(--parchment-dim);
  letter-spacing: 1px;
}
.start-card select {
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  border-radius: var(--radius-input);
  border: 1px solid rgba(197, 160, 89, 0.22);
  background: rgba(10, 9, 7, 0.8);
  color: var(--parchment);
  font-size: 14px;
}
.start-card input[type="text"] {
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  border-radius: var(--radius-input);
  border: 1px solid rgba(197, 160, 89, 0.22);
  background: rgba(10, 9, 7, 0.8);
  color: var(--parchment);
  font-size: 14px;
  outline: none;
}
.start-card input[type="text"]::placeholder { color: var(--parchment-dim); opacity: 0.6; }
.start-card input[type="text"]:focus {
  border-color: var(--border-gilded-strong);
  box-shadow: 0 0 0 1px var(--border-gilded), var(--glow-warm);
}
.start-card select:focus { border-color: var(--border-gilded-strong); box-shadow: 0 0 0 1px var(--border-gilded); outline: none; }

.board-line {
  color: var(--parchment);
  font-size: 13px;
  letter-spacing: 1px;
  margin: 0 0 22px;
  padding: 8px 0;
  border-top: 1px solid rgba(197, 160, 89, 0.16);
  border-bottom: 1px solid rgba(197, 160, 89, 0.16);
}

.start-card .muted { margin: 4px 0 14px; }

.rules-hint {
  color: var(--parchment-dim);
  font-size: 12px;
  line-height: 1.8;
  margin: 0 0 18px;
  text-align: left;
  background: rgba(197, 160, 89, 0.05);
  border: 1px solid rgba(197, 160, 89, 0.14);
  border-radius: var(--radius-panel);
  padding: 10px 12px;
}

.avatar-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  text-align: left;
}
.avatar-pick .avatar-label {
  color: var(--parchment-dim);
  font-size: 13px;
  letter-spacing: 1px;
}
.avatar-opt {
  position: relative;
  cursor: pointer;
  display: inline-flex;
}
.avatar-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.avatar-opt img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(197, 160, 89, 0.25);
  object-fit: cover;
  display: block;
  transition: all 0.15s;
}
.avatar-opt:hover img { border-color: var(--border-gilded-strong); }
.avatar-opt input:checked + img {
  border-color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(252, 211, 77, 0.5);
}

.start-card button {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-gilded-strong);
  background: var(--ink-raised);
  color: var(--gold-bright);
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.start-card button:hover {
  background: #241d10;
  box-shadow: var(--glow-warm), var(--glow-warm-inset);
}

/* ---------- 游戏界面 ---------- */
#game-screen {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* 左：圆桌 */
#table-area {
  position: relative;
  flex: 1;
  overflow: hidden;
  transition: filter 1s ease;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(197, 160, 89, 0.09) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, #191510 0%, #0b0907 75%);
}
body.night #table-area { filter: brightness(0.62) saturate(0.85); }

#seats { position: absolute; inset: 0; }

/* 中心光环 */
#table-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 240px;
  height: 240px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(197, 160, 89, 0.25);
}
.ring-outer {
  border-style: dashed;
  animation: ringRotate 60s linear infinite;
}
.ring-inner {
  inset: 18px;
  border-color: rgba(197, 160, 89, 0.16);
  border-style: dotted;
  animation: ringRotate 30s linear infinite reverse;
}
@keyframes ringRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.center-lamp {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 130px;
  height: 130px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(252, 211, 77, 0.16) 0%, rgba(197, 160, 89, 0.05) 45%, transparent 70%);
  box-shadow: 0 0 60px rgba(197, 160, 89, 0.12);
}

.center-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-display);
  letter-spacing: 3px;
}
#center-day { font-size: 22px; color: var(--parchment); text-shadow: 0 0 14px rgba(197, 160, 89, 0.5); }
#center-phase { font-size: 14px; color: var(--gold); letter-spacing: 4px; }

/* 夜晚水印 */
#night-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 3.5%;
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 14px;
  color: #8fb2ff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
}
body.night #night-watermark { opacity: 0.1; }

/* 座位 */
.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 96px;
  text-align: center;
  transition: transform 0.25s ease, opacity 0.3s ease;
  z-index: 10;
}
.seat.clickable { cursor: pointer; }
.seat.clickable:hover { transform: translate(-50%, -50%) scale(1.1); z-index: 20; }
.seat.selected { z-index: 20; }

.seat .avatar {
  width: 58px;
  height: 58px;
  line-height: 56px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 32%, hsl(var(--hue, 210) 34% 40%), hsl(var(--hue, 210) 38% 22%));
  border: 2px solid rgba(255, 255, 255, 0.12);
  font-size: 22px;
  color: #f3efe6;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  font-family: var(--font-display);
  transition: all 0.25s;
  overflow: hidden;
}
.seat .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.seat.me .avatar {
  border-color: var(--human);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35), 0 6px 16px rgba(0, 0, 0, 0.5);
  animation: breathe 3.2s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 14px rgba(56, 189, 248, 0.3), 0 6px 16px rgba(0, 0, 0, 0.5); }
  50% { box-shadow: 0 0 26px rgba(56, 189, 248, 0.5), 0 6px 16px rgba(0, 0, 0, 0.5); }
}

.seat.selected .avatar {
  border-color: var(--gold-bright);
  box-shadow: 0 0 22px rgba(252, 211, 77, 0.55);
}

.seat .sname {
  font-size: 12px;
  color: var(--parchment);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seat .srole {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 1px;
  min-height: 15px;
}

.seat.dead { opacity: 0.5; }
.seat.dead .avatar { filter: grayscale(0.85); border-color: rgba(244, 63, 94, 0.35); }
.seat.dead .sname { text-decoration: line-through; color: var(--parchment-dim); }
.seat .xmark {
  position: absolute;
  top: 2px;
  right: 8px;
  color: #f2a6a6;
  font-size: 17px;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(220, 38, 38, 0.6);
}

/* 右侧讨论栏 */
#side-panel {
  width: 408px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #17140f, #12100c);
  border-left: 1px solid var(--border-gilded);
  min-height: 0;
}

#topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(197, 160, 89, 0.18);
}
.role-label {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--gold);
  letter-spacing: 2px;
}
.status { color: var(--gold-bright); font-size: 12px; margin-left: auto; letter-spacing: 1px; }
.teammate-box { color: #fca5a5; font-size: 12px; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-btn {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(197, 160, 89, 0.3);
  background: var(--ink-raised);
  color: var(--parchment-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.topbar-btn:hover {
  color: var(--gold-bright);
  border-color: var(--border-gilded-strong);
  box-shadow: var(--glow-warm);
}

/* 聊天流 */
#chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 14px 8px;
  scrollbar-width: thin;
  scrollbar-color: #3a3226 #141210;
}
#chat::-webkit-scrollbar { width: 5px; }
#chat::-webkit-scrollbar-track { background: #141210; }
#chat::-webkit-scrollbar-thumb { background: #3a3226; border-radius: 3px; }
#chat::-webkit-scrollbar-thumb:hover { background: #57492f; }

.msg {
  margin-bottom: 9px;
  line-height: 1.65;
  font-size: 13.5px;
  word-break: break-word;
  color: var(--parchment);
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  border-left: 2px solid rgba(255, 255, 255, 0.08);
}
.msg .who {
  display: block;
  font-size: 11px;
  color: var(--parchment-dim);
  margin-bottom: 2px;
  letter-spacing: 1px;
}
.msg.speech {
  background: rgba(197, 160, 89, 0.045);
  border-left-color: rgba(197, 160, 89, 0.35);
}
.msg.speech.me {
  background: rgba(56, 189, 248, 0.07);
  border-left-color: rgba(56, 189, 248, 0.45);
}
.msg.speech .who { color: hsl(var(--hue, 210) 55% 66%); }
.msg.speech.me .who { color: var(--human); }

.msg.system { text-align: center; color: var(--parchment-dim); font-size: 12px; background: transparent; border-left: none; padding: 4px 6px; letter-spacing: 1px; }
.msg.private { background: rgba(197, 160, 89, 0.08); border-left-color: rgba(197, 160, 89, 0.5); color: #ead9ae; }
.msg.death { background: rgba(220, 38, 38, 0.09); border-left-color: rgba(220, 38, 38, 0.55); color: #f2b8b8; }
.msg.vote { color: var(--parchment-dim); font-size: 12px; background: transparent; border-left-color: rgba(197, 160, 89, 0.2); padding: 4px 10px; }

/* 打字气泡 */
.msg.typing { background: rgba(197, 160, 89, 0.05); border-left-color: rgba(197, 160, 89, 0.3); }
.msg.typing .partial { color: var(--parchment-dim); font-style: italic; }
.msg.typing .partial::after { content: '▌'; color: var(--gold); animation: blink 0.8s infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* 操作栏 */
#actionbar {
  border-top: 1px solid rgba(197, 160, 89, 0.18);
  padding: 12px 14px;
  min-height: 86px;
  background: rgba(10, 9, 7, 0.5);
}
#actionbar .hint { color: var(--parchment-dim); font-size: 13px; margin-bottom: 9px; line-height: 1.5; }
#actionbar .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

#actionbar button {
  padding: 8px 16px;
  border-radius: var(--radius-input);
  border: 1px solid rgba(197, 160, 89, 0.25);
  background: var(--ink-raised);
  color: var(--parchment-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s;
}
#actionbar button:hover {
  background: #241d10;
  border-color: var(--border-gilded);
  color: var(--parchment);
  box-shadow: var(--glow-warm);
}
#actionbar button.primary {
  background: var(--ink-raised);
  border-color: var(--border-gilded-strong);
  color: var(--gold-bright);
  font-weight: bold;
}
#actionbar button.primary:hover {
  background: #241d10;
  box-shadow: var(--glow-warm), var(--glow-warm-inset);
}
#actionbar button:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

#speak-input { flex: 1; min-width: 200px; }
#speak-input input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-input);
  border: 1px solid rgba(197, 160, 89, 0.22);
  background: rgba(10, 9, 7, 0.8);
  color: var(--parchment);
  font-size: 14px;
  outline: none;
}
#speak-input input::placeholder { color: var(--parchment-dim); opacity: 0.7; }
#speak-input input:focus {
  border-color: var(--border-gilded-strong);
  box-shadow: 0 0 0 1px var(--border-gilded), var(--glow-warm);
}

/* 结局横幅 */
#banner {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  background: rgba(6, 5, 4, 0.92);
  z-index: 50;
  padding: 30px 24px;
  overflow-y: auto;
}
#banner .result {
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: 8px;
  color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(197, 160, 89, 0.5);
}
#banner button {
  padding: 12px 30px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-gilded-strong);
  background: var(--ink-raised);
  color: var(--gold-bright);
  font-size: 15px;
  letter-spacing: 2px;
  cursor: pointer;
}
#banner button:hover { background: #241d10; box-shadow: var(--glow-warm); }

#banner .review {
  max-width: 620px;
  width: 100%;
  background: rgba(23, 20, 15, 0.95);
  border: 1px solid var(--border-gilded);
  border-radius: var(--radius-panel);
  padding: 16px 20px;
  font-size: 13px;
}
#banner .review h3 {
  font-family: var(--font-display);
  color: var(--gold-bright);
  font-size: 16px;
  letter-spacing: 3px;
  margin-bottom: 10px;
}
.sec {
  border-top: 1px solid rgba(197, 160, 89, 0.22);
  padding-top: 12px;
  margin-top: 12px;
}
.sec:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.sec h3 {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 15px;
  letter-spacing: 3px;
  margin-bottom: 10px;
}
.rcards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.rcard {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(197, 160, 89, 0.14);
  border-left: 3px solid var(--good);
}
.rcard.wolf { border-left-color: var(--wolf); }
.rcard.good { border-left-color: var(--good); }
.rcard.me { background: rgba(56, 189, 248, 0.08); }
.rcard.dead { opacity: 0.72; }
.rcard .rav {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rcard .rav img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rcard .rav .fa { font-size: 15px; color: var(--parchment); }
.rcard .rinfo { flex: 1; text-align: left; min-width: 0; }
.rcard .rname { font-size: 13px; color: var(--parchment); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcard.me .rname { color: var(--human); }
.rcard .rrole { font-size: 12px; color: var(--gold); }
.rcard.wolf .rrole { color: #fca5a5; }
.rcard .rstate { font-size: 12px; color: var(--parchment-dim); flex-shrink: 0; }

.judge {
  color: #d9cfb7;
  line-height: 1.8;
}

#banner .review .mvp-top {
  color: var(--gold-bright);
  font-size: 14px;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
#banner .review .mvline {
  color: #d9cfb7;
  font-size: 12px;
  line-height: 1.8;
}
#banner .review .mvline .mvname { color: var(--parchment); }
#banner .review .mvline .mvtgt { color: var(--gold); }

#banner .review .vday {
  margin-bottom: 10px;
}
#banner .review .vday .vtitle {
  color: var(--gold-bright);
  font-size: 13px;
  margin-bottom: 3px;
}
#banner .review .vday .vlist {
  color: #d9cfb7;
  font-size: 12px;
  line-height: 1.7;
}
#banner .review .pr {
  color: #d9cfb7;
  line-height: 1.7;
  margin-bottom: 6px;
}
#banner .review .pr .prname {
  color: var(--gold-bright);
}
#banner .review .pr img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 6px;
}

.review-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 0 6px;
  margin-top: 8px;
  border-top: 1px dashed rgba(197, 160, 89, 0.25);
  color: var(--parchment-dim);
  font-size: 13px;
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(197, 160, 89, 0.3);
  border-top-color: var(--gold-bright);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  #game-screen { flex-direction: column; }
  #table-area { min-height: 38vh; }
  #side-panel {
    width: 100%;
    height: 56vh;
    border-left: none;
    border-top: 1px solid var(--border-gilded);
  }
  #seats { position: static; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 14px; }
  .seat { position: static !important; transform: none !important; }
  .seat.clickable:hover { transform: none; }
  #table-center { width: 150px; height: 150px; opacity: 0.7; }
  #center-day { font-size: 17px; }
  #night-watermark { font-size: 30px; letter-spacing: 10px; }
  .rcards { grid-template-columns: 1fr; }
}


/* ==========================================================
   双人模式：模式切换 / 房间面板 / 等待房间
   ========================================================== */
.mode-switch { display: flex; gap: 8px; margin-bottom: 14px; }
.mode-switch .mode-btn {
  flex: 1; width: auto; padding: 9px 12px; letter-spacing: 2px;
  font-size: 13px; font-weight: normal; border-radius: 8px;
  background: transparent; border: 1px solid rgba(197, 160, 89, 0.3);
  color: var(--parchment-dim); cursor: pointer;
}
.mode-switch .mode-btn:hover {
  border-color: var(--border-gilded-strong);
  color: var(--parchment); background: transparent; box-shadow: none;
}
.mode-switch .mode-btn.active {
  border-color: var(--gold-bright); color: var(--gold-bright);
  background: rgba(197, 160, 89, 0.08);
}

.duo-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.duo-tabs .duo-tab {
  flex: 1; width: auto; padding: 8px; font-size: 13px; font-weight: normal;
  letter-spacing: 1px; border-radius: 8px; background: transparent;
  border: 1px solid rgba(197, 160, 89, 0.22); color: var(--parchment-dim);
  cursor: pointer;
}
.duo-tabs .duo-tab.active {
  border-color: var(--gold); color: var(--gold-bright);
  background: rgba(197, 160, 89, 0.06); box-shadow: none;
}

#duo-panel { margin-top: 4px; }
#duo-panel #btn-duo-submit { margin-top: 4px; }

#lobby-screen {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-start; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #1d1810 0%, #0a0806 75%);
  padding: 28px 20px; overflow-y: auto;
}
.lobby-card {
  width: 440px; max-width: 94vw; margin: auto 0;
  background: linear-gradient(180deg, rgba(32, 27, 20, 0.97), rgba(18, 15, 11, 0.97));
  border: 1px solid var(--border-gilded-strong);
  border-radius: 16px; padding: 26px 26px 22px;
  text-align: center; box-shadow: var(--glow-warm);
}
.lobby-card h2 {
  font-family: var(--font-display); color: var(--gold-bright);
  font-size: 20px; letter-spacing: 3px; margin-bottom: 6px;
}
.lobby-sub { color: var(--parchment-dim); font-size: 12px; margin-bottom: 16px; }
.room-code-row {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 18px;
}
#lobby-code {
  font-size: 34px; letter-spacing: 8px; color: var(--gold-bright);
  font-family: Consolas, "Courier New", monospace;
  text-shadow: 0 0 18px rgba(252, 211, 77, 0.45);
}
#btn-copy-code {
  width: auto; padding: 6px 12px; font-size: 12px; font-weight: normal;
  letter-spacing: 1px; border-radius: 6px; background: transparent;
  border: 1px solid var(--border-gilded); color: var(--gold); cursor: pointer;
}
#btn-copy-code:hover {
  border-color: var(--gold-bright); color: var(--gold-bright); background: transparent;
}
.lobby-players { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.lobby-player {
  display: flex; align-items: center; gap: 12px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(197, 160, 89, 0.16);
  border-radius: 10px; padding: 10px 14px; min-height: 62px; text-align: left;
}
.lobby-player.ready { border-color: rgba(16, 185, 129, 0.45); }
.lobby-player .lp-avatar {
  width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: rgba(197, 160, 89, 0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-bright); font-size: 16px;
}
.lobby-player .lp-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lobby-player .lp-name { color: var(--parchment); font-size: 14px; }
.lobby-player .lp-seat { color: var(--gold); font-size: 12px; margin-left: 6px; }
.lobby-player .lp-state { color: var(--parchment-dim); font-size: 12px; margin-top: 2px; }
.lobby-player.ready .lp-state { color: var(--good); }
.lp-empty { color: var(--parchment-dim); font-size: 13px; }
.lobby-actions { display: flex; gap: 10px; }
.lobby-actions button {
  flex: 1; width: auto; padding: 11px; font-size: 15px; letter-spacing: 2px;
  border-radius: 8px; background: var(--ink-raised);
  color: var(--gold-bright); border: 1px solid var(--border-gilded-strong);
  cursor: pointer; transition: all 0.2s;
}
.lobby-actions button:hover { background: #241d10; box-shadow: var(--glow-warm); }
.lobby-actions button:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.lobby-actions .lobby-leave {
  background: transparent; border: 1px solid rgba(220, 38, 38, 0.4);
  color: #f87171; box-shadow: none;
}
.lobby-actions .lobby-leave:hover { background: rgba(220, 38, 38, 0.08); box-shadow: none; }
.lobby-hint { margin-top: 12px; color: var(--parchment-dim); font-size: 12px; min-height: 16px; }

/* 房间阵营设置 */
.lobby-mode {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 16px;
}
.lobby-mode .lobby-mode-label { color: var(--parchment-dim); font-size: 13px; }
.lobby-mode .lobby-mode-btn {
  padding: 5px 14px; font-size: 12px; border-radius: 6px;
  background: transparent; border: 1px solid rgba(197, 160, 89, 0.25);
  color: var(--parchment-dim); cursor: pointer;
}
.lobby-mode .lobby-mode-btn.active {
  border-color: var(--gold-bright); color: var(--gold-bright);
  background: rgba(197, 160, 89, 0.08);
}
.lobby-mode .lobby-mode-btn:disabled { opacity: 0.55; cursor: default; }
/* 彩蛋：偷看身份面板 */
#peek-box {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 60; min-width: 260px;
  background: linear-gradient(180deg, rgba(30, 25, 18, 0.98), rgba(16, 13, 10, 0.98));
  border: 1px solid var(--gold-bright); border-radius: 12px;
  padding: 16px 20px; box-shadow: 0 0 40px rgba(252, 211, 77, 0.35);
  color: var(--parchment); font-size: 13px;
}
#peek-box .peek-title {
  font-family: var(--font-display); color: var(--gold-bright);
  font-size: 15px; letter-spacing: 2px; text-align: center; margin-bottom: 10px;
}
#peek-box .peek-row {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 3px 0; border-bottom: 1px dashed rgba(197, 160, 89, 0.15);
}
#peek-box .peek-row:last-child { border-bottom: none; }
#peek-box .peek-name { color: var(--parchment-dim); }
#peek-box .peek-role { color: var(--gold-bright); }