/* ==========================================================================
   暗将Bluff v7.0.1 · 前端样式（纯手写 CSS，无框架、无外部字体）
   配色沿用旧版暗金色调：深色底 + 金色点缀
   ========================================================================== */

:root {
  --gold: #d4af37;
  --gold-bright: #f0d060;
  --gold-dim: #8a7328;
  --bg: #0f0d0a;
  --bg2: #1a1611;
  --panel: #221c15;
  --panel2: #2b241b;
  --line: #3a3128;
  --text: #efe6d5;
  --muted: #9a8f7d;
  --danger: #c0503f;
  --danger-bg: #3a1d17;
  --ok: #4f9d6a;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .55);
  --card-w: 46px;
  --card-h: 66px;
  --card-overlap: 32px;
  /* 手牌叠层步进（由 JS 按张数覆盖，CSS 里给一个保守默认） */
  --hand-step: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 背景氛围：一团极暗的金色光晕，不抢内容 */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(760px 460px at 50% -8%, rgba(212, 175, 55, .13), transparent 68%),
    radial-gradient(560px 360px at 88% 104%, rgba(212, 175, 55, .06), transparent 70%);
  z-index: 0;
}

h1, h2, h3, h4 { margin: 0 0 10px; font-weight: 600; letter-spacing: .5px; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; color: var(--gold); }
p { margin: 0 0 10px; }
a { color: var(--gold); }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.gold { color: var(--gold); }
.center { text-align: center; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1 1 auto; }
.nowrap { white-space: nowrap; }

/* ── 顶栏 / 页脚 ───────────────────────────────────────────────── */
.topbar {
  /* 常驻顶部：对局页（议价 / 亮牌）很长，滚动时必须还能看到连接状态与退出入口 */
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(34, 28, 21, .97), rgba(15, 13, 10, .9));
  backdrop-filter: blur(6px);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  background: linear-gradient(160deg, #2b2318, #16120c);
  font-weight: 700;
  box-shadow: inset 0 0 12px rgba(212, 175, 55, .22);
}
.brand-text { font-size: 16px; letter-spacing: 1px; }
.brand-text em { color: var(--muted); font-style: normal; font-size: 12px; margin-left: 6px; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.conn-badge {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.conn-badge.is-ok { color: var(--ok); border-color: rgba(79, 157, 106, .5); }
.conn-badge.is-bad { color: var(--danger); border-color: rgba(192, 80, 63, .6); background: rgba(58, 29, 23, .6); }

.who-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px;
  padding: 3px 10px 3px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}
.who-badge .zodiac-mini {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--gold-dim);
  background: #14110c;
  font-size: 12px;
}

/* 页脚跟随文档流（不固定定位）：避免它盖住页面底部的可点击元素 */
.footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 22px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: rgba(15, 13, 10, .92);
}
.health-line.is-bad { color: var(--danger); }

/* 运营后台入口：刻意做得不显眼（玩家会看到，但服务端有口令硬校验，点进去也进不了）。
   若要给客户部署时彻底隐藏，删掉 index.html 页脚里的这个 <a> 即可（#/admin 仍可直接访问）。 */
.footer-admin {
  color: var(--muted);
  text-decoration: none;
  opacity: .45;
  transition: opacity .15s ease;
}
.footer-admin:hover { opacity: 1; color: var(--gold); }

/* ── 主视图与页面过渡 ─────────────────────────────────────────── */
.view {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 18px 30px;
}

.page { animation: page-in .22s ease-out both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.page-head .sub { color: var(--muted); font-size: 13px; }

/* ── 卡片 / 面板 ──────────────────────────────────────────────── */
.card {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: -2px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}
.card-title h2, .card-title h3 { margin: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-login { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(320px, 1.05fr); gap: 18px; align-items: start; }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-login { grid-template-columns: 1fr; }
}

/* ── 表单 ─────────────────────────────────────────────────────── */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  background: #14110c;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212, 175, 55, .14); }
input::placeholder { color: #6b6152; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: right 14px 50%, right 9px 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

/* ── 按钮 ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--gold-dim);
  background: linear-gradient(180deg, #3a2f1c, #241d12);
  color: var(--gold-bright);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .16s ease, background .16s ease, opacity .16s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: linear-gradient(180deg, #4a3c22, #2c2415); box-shadow: 0 0 0 1px rgba(212, 175, 55, .35), 0 6px 18px rgba(0, 0, 0, .4); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #1a1408;
  font-weight: 700;
  border-color: var(--gold-bright);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffe98a, var(--gold-bright)); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: rgba(212, 175, 55, .08); }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-danger { border-color: rgba(192, 80, 63, .7); color: #f0a99c; background: linear-gradient(180deg, #3a1d17, #241210); }
.btn-pulse { animation: pulse-gold 1.5s ease-in-out infinite; }
@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 208, 96, .5); }
  50% { box-shadow: 0 0 0 7px rgba(240, 208, 96, 0); }
}

/* ── Tab ──────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab {
  flex: 1 1 0;
  padding: 8px;
  text-align: center;
  border: 1px solid var(--line);
  background: #14110c;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
.tab.is-active { color: var(--gold-bright); border-color: var(--gold-dim); background: linear-gradient(180deg, #2f2718, #1c1710); }

/* ── 徽标 / 标签 ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #14110c;
}
.badge-gold { color: var(--gold-bright); border-color: var(--gold-dim); }
.badge-ok { color: var(--ok); border-color: rgba(79, 157, 106, .55); }
.badge-warn { color: #e0a33c; border-color: rgba(224, 163, 60, .55); }
.badge-bad { color: #e08878; border-color: rgba(192, 80, 63, .6); }
.badge-mode { color: var(--gold-bright); border-color: var(--gold-dim); background: rgba(212, 175, 55, .09); }

.kv { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed rgba(58, 49, 40, .7); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv b { color: var(--gold-bright); font-weight: 600; }

/* ── 提示条 ───────────────────────────────────────────────────── */
.note {
  padding: 10px 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(43, 36, 27, .55);
  font-size: 13px;
  color: var(--muted);
}
.note-warn { border-color: rgba(224, 163, 60, .45); color: #e6c489; background: rgba(60, 46, 20, .5); }
.note-bad { border-color: rgba(192, 80, 63, .5); color: #eaa798; background: var(--danger-bg); }
.note-ok { border-color: rgba(79, 157, 106, .5); color: #9ed8b2; background: rgba(24, 48, 33, .5); }

/* ── Toast ───────────────────────────────────────────────────── */
.toasts {
  position: fixed;
  top: 64px; right: 18px;
  z-index: 50;
  display: flex; flex-direction: column; gap: 8px;
  width: min(380px, calc(100vw - 36px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 11px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(34, 28, 21, .97);
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: toast-in .2s ease-out both;
  display: flex; gap: 9px; align-items: flex-start;
}
.toast .toast-icon { flex: 0 0 auto; }
.toast-error { border-color: rgba(192, 80, 63, .75); background: linear-gradient(180deg, #3a1d17, #2a1512); color: #f5c3b8; }
.toast-ok { border-color: rgba(79, 157, 106, .7); background: linear-gradient(180deg, #1b3024, #16241c); color: #b6e3c6; }
.toast-info { border-color: var(--gold-dim); background: linear-gradient(180deg, #2f2718, #221c15); color: var(--gold-bright); }
.toast.is-out { animation: toast-out .18s ease-in both; }
@keyframes toast-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(18px); } }

/* ── 生肖头像选择器 ───────────────────────────────────────────── */
.zodiac-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  /* 行间距留够，让圆形下方的生肖名（绝对定位）不压到下一行 */
  gap: 24px 8px;
}
.zodiac {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: radial-gradient(circle at 35% 28%, #2c2418, #14110c 72%);
  font-size: 22px;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
  padding: 0;
  font-family: inherit;
  color: var(--text);
}
.zodiac:hover { transform: translateY(-2px); border-color: var(--gold-dim); }
.zodiac.is-active {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, .28), 0 0 16px rgba(212, 175, 55, .3);
  transform: translateY(-2px);
}
.zodiac .z-name {
  position: absolute; bottom: -17px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--muted); white-space: nowrap;
}
.zodiac-grid { margin-bottom: 20px; }

/* ── 付款区块 ─────────────────────────────────────────────────── */
.qr-box {
  display: grid; place-items: center;
  width: 188px; height: 188px;
  border-radius: 10px;
  border: 1px dashed var(--gold-dim);
  background: #14110c;
  overflow: hidden;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; display: block; }
.qr-placeholder { text-align: center; color: var(--muted); font-size: 12px; padding: 10px; }
.qr-placeholder .qr-glyph {
  display: grid; grid-template-columns: repeat(5, 12px); gap: 4px;
  margin: 0 auto 8px; width: max-content;
}
.qr-placeholder .qr-glyph i { width: 12px; height: 12px; background: #2a2317; border: 1px solid var(--line); }
.qr-placeholder .qr-glyph i.on { background: var(--gold-dim); }

.price-line { font-size: 30px; color: var(--gold-bright); font-weight: 700; letter-spacing: 1px; }
.price-line span { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 4px; }

/* ── 座位（房间页）───────────────────────────────────────────── */
.seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .seats { grid-template-columns: repeat(2, 1fr); } }
.seat {
  position: relative;
  padding: 14px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(43, 36, 27, .8), rgba(20, 17, 12, .9));
  text-align: center;
  min-height: 132px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.seat.is-empty { border-style: dashed; color: var(--muted); }
.seat.is-me { border-color: var(--gold-dim); box-shadow: inset 0 0 22px rgba(212, 175, 55, .12); }
.seat.is-off { opacity: .5; }
.seat .seat-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; font-size: 24px;
  border: 1.5px solid var(--gold-dim);
  background: radial-gradient(circle at 35% 28%, #2c2418, #14110c 72%);
}
.seat .seat-name { font-size: 14px; word-break: break-all; }
.seat .seat-tags { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }

/* ── 倒计时（数字 + 进度条）──────────────────────────────────── */
.countdown {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(20, 17, 12, .8);
}
.countdown .cd-num {
  font-size: 24px; font-weight: 700; letter-spacing: 1px;
  color: var(--gold-bright);
  min-width: 74px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.countdown .cd-body { flex: 1 1 auto; min-width: 120px; }
.countdown .cd-label { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.countdown .cd-bar { height: 7px; border-radius: 999px; background: #14110c; border: 1px solid var(--line); overflow: hidden; }
.countdown .cd-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright)); transition: width .25s linear; }
.countdown.is-urgent .cd-num { color: #e88a6a; }
.countdown.is-urgent .cd-bar i { background: linear-gradient(90deg, #7a3524, #d4684a); }
.countdown.is-expired { border-color: rgba(192, 80, 63, .6); background: rgba(58, 29, 23, .55); }
.countdown.is-expired .cd-num { color: #e08878; }
.countdown.is-expired .cd-bar i { background: #7a3524; }

/* ── 手牌（斗地主式叠层）────────────────────────────────────── */
.hand-wrap {
  padding: 16px 12px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 50% 120%, rgba(212, 175, 55, .07), transparent 60%),
    #14110c;
  overflow-x: auto;
  overflow-y: hidden;
}
.hand {
  position: relative;
  height: calc(var(--card-h) + 20px);
  min-width: max-content;
  padding-top: 18px;
}
.pcard {
  position: absolute;
  top: 18px;
  left: calc(var(--i) * var(--hand-step));
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 6px;
  border: 1px solid #4a4030;
  background: linear-gradient(160deg, #f3ece0, #ded2bd);
  color: #21190f;
  cursor: pointer;
  padding: 3px 0 0 4px;
  text-align: left;
  font-family: inherit;
  display: flex; flex-direction: column; align-items: flex-start;
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
  box-shadow: -1px 0 3px rgba(0, 0, 0, .5), 0 2px 5px rgba(0, 0, 0, .45);
  overflow: hidden;
  z-index: calc(var(--i) + 1);
}
.pcard .pc-rank { font-size: 15px; font-weight: 700; line-height: 1; }
.pcard .pc-suit { font-size: 15px; line-height: 1.2; }
.pcard.is-red { color: #a3251b; }
.pcard.is-black { color: #1c1712; }
.pcard:hover { filter: brightness(1.06); }
.pcard.is-picked {
  transform: translateY(-16px);
  box-shadow: 0 0 0 2px var(--gold-bright), 0 10px 18px rgba(0, 0, 0, .6);
  z-index: 60;
  background: linear-gradient(160deg, #fff7e2, #e8dcc2);
}
.pcard.is-picked::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 6px;
  box-shadow: inset 0 0 12px rgba(212, 175, 55, .55);
}
.pcard.is-dim { opacity: .42; }
.pcard.is-disabled { cursor: not-allowed; opacity: .55; }

.hand-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.hand-legend i { display: inline-block; width: 10px; height: 14px; border-radius: 2px; vertical-align: -2px; margin-right: 5px; border: 1px solid #4a4030; background: linear-gradient(160deg, #f3ece0, #ded2bd); }
.hand-legend i.picked { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--gold-bright); }

/* ── 桌面（议价 / 亮牌）───────────────────────────────────────── */
.table-area {
  display: grid; grid-template-columns: 1fr; gap: 14px;
}
.table-side {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(43, 36, 27, .5), rgba(15, 13, 10, .6));
  padding: 12px;
}
.table-side.is-opponent { border-color: #46392a; }
.table-side.is-mine { border-color: var(--line); }
.table-side .side-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px; font-size: 14px;
}
.playzone {
  min-height: 84px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px;
  border-radius: 8px;
  border: 1px dashed var(--line);
  background: rgba(20, 17, 12, .7);
}
.playzone .stat-cards { display: flex; }
.playzone .pc-mini {
  width: 34px; height: 48px;
  border-radius: 5px;
  border: 1px solid #4a4030;
  background: linear-gradient(160deg, #f3ece0, #ded2bd);
  color: #21190f;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  padding-left: 4px;
  font-size: 12px; font-weight: 700;
  margin-left: -16px;
  box-shadow: -1px 0 2px rgba(0, 0, 0, .5);
}
.playzone .pc-mini:first-child { margin-left: 0; }
.playzone .pc-mini.is-red { color: #a3251b; }
.playzone .pc-mini.is-black { color: #1c1712; }
.playzone .pc-mini.is-picked { transform: translateY(-7px); box-shadow: 0 0 0 2px var(--gold-bright); }

.offer-box {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(20, 17, 12, .7);
  font-size: 14px;
}
.offer-box .offer-big { font-size: 18px; color: var(--gold-bright); font-weight: 700; }

.exchange-box {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: end;
}
@media (max-width: 700px) { .exchange-box { grid-template-columns: 1fr; } }

.rank-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.rank-pill {
  min-width: 40px;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #14110c;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
.rank-pill:hover { border-color: var(--gold-dim); }
.rank-pill.is-active { border-color: var(--gold-bright); color: var(--gold-bright); background: linear-gradient(180deg, #322917, #211a10); box-shadow: 0 0 0 1px rgba(212, 175, 55, .3); }

/* ── 结算 / 排名 ──────────────────────────────────────────────── */
table.grid-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid-table th, table.grid-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.grid-table th { color: var(--muted); font-weight: 500; font-size: 13px; }
table.grid-table tr.is-me td { background: rgba(212, 175, 55, .08); color: var(--gold-bright); }
table.grid-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank-1::before { content: '🥇 '; }
.rank-2::before { content: '🥈 '; }
.rank-3::before { content: '🥉 '; }

/* ── 报告 ─────────────────────────────────────────────────────── */
.radar-wrap { display: grid; place-items: center; }
.radar-svg { width: 100%; max-width: 460px; height: auto; }
.radar-svg text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.radar-svg .rd-grid { fill: none; stroke: #3a3128; stroke-width: 1; }
.radar-svg .rd-axis { stroke: #3a3128; stroke-width: 1; }
.radar-svg .rd-ring-label { fill: #6b6152; font-size: 9px; }
.radar-svg .rd-area { fill: rgba(212, 175, 55, .26); stroke: var(--gold-bright); stroke-width: 2; }
.radar-svg .rd-dot { fill: var(--gold-bright); }
.radar-svg .rd-area-alt { fill: rgba(120, 160, 200, .12); stroke: rgba(150, 190, 230, .8); stroke-width: 1.4; }

.score-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.score-ring {
  width: 116px; height: 116px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--gold-bright) var(--deg, 0deg), #14110c 0deg);
  position: relative;
}
.score-ring::after {
  content: ''; position: absolute; inset: 9px; border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
}
.score-ring .score-inner { position: relative; z-index: 1; text-align: center; }
.score-ring .score-val { font-size: 30px; font-weight: 700; color: var(--gold-bright); line-height: 1; }
.score-ring .score-grade { font-size: 12px; color: var(--muted); }

.dim-bar-row { display: grid; grid-template-columns: 96px 1fr 54px; gap: 10px; align-items: center; font-size: 13px; }
.dim-bar { height: 9px; border-radius: 999px; background: #14110c; border: 1px solid var(--line); overflow: hidden; }
.dim-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright)); }

.lock-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid var(--gold-dim);
  background: linear-gradient(120deg, rgba(212, 175, 55, .16), rgba(212, 175, 55, .04));
}
.lock-banner .lock-icon { font-size: 26px; }
.skeleton {
  display: block;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, #241d15, #2f2718, #241d15);
  background-size: 200% 100%;
  animation: sk 1.6s linear infinite;
  margin: 7px 0;
}
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skeleton-short { width: 42%; }
.skeleton-mid { width: 68%; }
.skeleton-card { border: 1px dashed var(--line); border-radius: 9px; padding: 14px; margin-bottom: 12px; background: rgba(20, 17, 12, .5); }
.skeleton-card h4 { color: var(--gold); margin-bottom: 8px; font-size: 14px; }

/* ── 陪练补位进度 ─────────────────────────────────────────────── */
.bots-progress { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.bot-slot {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 78px;
  font-size: 11px;
  color: var(--muted);
}
.bot-slot .bot-circle {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px;
  border: 1.5px dashed var(--line);
  background: #14110c;
  color: #55503f;
}
.bot-slot.is-in .bot-circle { border-style: solid; border-color: var(--gold-dim); color: var(--text); box-shadow: 0 0 14px rgba(212, 175, 55, .2); }
.bot-slot.is-in { color: var(--text); }

/* ── 房间列表 ─────────────────────────────────────────────────── */
.room-list { display: flex; flex-direction: column; gap: 8px; }
.room-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(20, 17, 12, .6);
  font-size: 14px;
}
.room-item:hover { border-color: var(--gold-dim); }

/* ── 事件流（调试与可观测，用户可见但不刺眼）──────────────────── */
.event-log {
  max-height: 190px;
  overflow-y: auto;
  font-size: 12px;
  font-family: ui-monospace, Consolas, monospace;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #100e0a;
}
.event-log div { padding: 1px 0; border-bottom: 1px dotted rgba(58, 49, 40, .5); }
.event-log b { color: var(--gold); font-weight: 500; }

.stack-tight > * + * { margin-top: 8px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.spacer { height: 10px; }
