/* ============ 三国杀 · 经典身份场 ============ */
:root {
  --ink: #0a0f0c;
  --ink-2: #0f1712;
  --ink-3: #16211a;
  --paper: #eadfc7;
  --paper-deep: #d9c8a6;
  --gold: #c9a45c;
  --gold-soft: #a98746;
  --gold-bright: #f0d18a;
  --cinnabar: #a83a32;
  --cinnabar-bright: #d9574a;
  --jade: #4d8a72;
  --wei: #4f78a8;
  --shu: #b5473c;
  --wu: #4f8a63;
  --qun: #8a6a9e;
  --text: #eee6d3;
  --text-dim: #b8ae98;
  --line: rgba(201, 164, 92, .3);
  --font-display: "STKaiti", "KaiTi", "Kaiti SC", "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  --font-body: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
  user-select: none;
}

button { font-family: inherit; }
b { font-weight: 700; }

/* ---------- 背景 ---------- */
#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 12px 16px 10px;
  gap: 10px;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(72, 96, 76, .18), transparent 55%),
    radial-gradient(ellipse at 12% 80%, rgba(33, 54, 43, .22), transparent 50%),
    linear-gradient(180deg, #0a100d 0%, #070b09 55%, #050806 100%);
}

.bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0, rgba(255,255,255,.012) 1px, transparent 1px, transparent 4px),
    radial-gradient(circle at 50% 40%, transparent 0, rgba(0,0,0,.55) 78%);
  pointer-events: none;
}

.bg-moon {
  position: absolute;
  top: 4%;
  right: 13%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #f4e6be, #d9c391 48%, #98855a 100%);
  opacity: .13;
  filter: blur(2px);
  box-shadow: 0 0 120px 60px rgba(224, 200, 145, .08);
}

.bg-ridge {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 0;
  height: 52%;
  background: #101a14;
  opacity: .55;
}

.ridge-far {
  clip-path: polygon(0 72%, 7% 58%, 13% 64%, 22% 42%, 30% 58%, 39% 35%, 48% 56%, 58% 44%, 66% 60%, 77% 38%, 86% 57%, 94% 47%, 100% 62%, 100% 100%, 0 100%);
  filter: blur(2px);
  transform: translateY(12%);
  background: #17231b;
}

.ridge-near {
  clip-path: polygon(0 82%, 8% 70%, 17% 78%, 25% 62%, 34% 76%, 44% 60%, 55% 78%, 64% 67%, 74% 80%, 84% 65%, 93% 77%, 100% 70%, 100% 100%, 0 100%);
  background: #0c130f;
  opacity: .8;
}

.bg-mist {
  position: absolute;
  left: 0; right: 0;
  bottom: 16%;
  height: 22%;
  background: linear-gradient(180deg, transparent, rgba(180, 200, 185, .045), transparent);
  filter: blur(18px);
}

/* ---------- 顶栏 ---------- */
.topbar {
  flex: 0 0 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  z-index: 5;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-seal {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(217, 87, 74, .75);
  background: linear-gradient(145deg, #8f2e28, #6e211d);
  color: #f2dfc0;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
  transform: rotate(-3deg);
  box-shadow: 0 3px 14px rgba(0,0,0,.35), inset 0 0 0 2px rgba(255,235,200,.12);
}

.brand-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--gold-bright);
  font-weight: 600;
}

.brand-text h1 span { color: var(--cinnabar-bright); margin: 0 2px; }

.brand-text p {
  margin: 2px 0 0;
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--text-dim);
}

.status-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 7px 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(28, 38, 31, .72), rgba(12, 18, 14, .72));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
}

.status-item { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.status-label { font-size: 10px; letter-spacing: 2px; color: var(--text-dim); }
.status-item b { font-family: var(--font-display); font-size: 16px; color: var(--gold-bright); font-weight: 600; }
.status-divider { width: 1px; height: 16px; background: var(--line); }

.top-actions { display: flex; gap: 8px; }

/* ---------- 按钮 ---------- */
.btn {
  position: relative;
  border: 1px solid rgba(201, 164, 92, .5);
  background: linear-gradient(180deg, rgba(55, 48, 34, .6), rgba(24, 25, 19, .85));
  color: var(--gold-bright);
  padding: 8px 20px;
  font-size: 13px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all .18s ease;
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
}

.btn:hover {
  background: linear-gradient(180deg, rgba(201, 164, 92, .24), rgba(75, 57, 31, .7));
  border-color: var(--gold-bright);
  color: #fff2cf;
  box-shadow: 0 0 20px rgba(201, 164, 92, .18);
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .35; cursor: not-allowed; filter: grayscale(.5); }
.btn.ghost { background: rgba(10, 14, 11, .55); border-color: rgba(201, 164, 92, .28); color: var(--text-dim); }
.btn.ghost:hover { color: var(--gold-bright); }
.btn.primary { background: linear-gradient(180deg, #a83a32, #77251f); border-color: #d06a5e; color: #ffead2; }
.btn.primary:hover { background: linear-gradient(180deg, #c34a40, #8b2c25); box-shadow: 0 0 28px rgba(185, 66, 55, .35); }
.btn.small { padding: 4px 12px; font-size: 12px; letter-spacing: 1px; }
.btn.large { padding: 13px 36px; font-size: 15px; letter-spacing: 4px; }

/* ---------- 主区域 ---------- */
.main-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 308px;
  gap: 12px;
}

.table-wrap { position: relative; min-width: 0; min-height: 0; }

.board {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 340px;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(89, 119, 91, .26), transparent 64%),
    radial-gradient(circle at 82% 18%, rgba(201, 164, 92, .08), transparent 30%),
    radial-gradient(ellipse at 50% 50%, #1b2b20 0%, #111c15 52%, #0a110d 100%);
  border: 1px solid rgba(201, 164, 92, .34);
  box-shadow:
    inset 0 0 0 6px rgba(4, 7, 5, .7),
    inset 0 0 0 7px rgba(201, 164, 92, .14),
    inset 0 0 90px rgba(0, 0, 0, .62),
    0 22px 50px rgba(0, 0, 0, .35);
  overflow: hidden;
}

.board-grain {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(115deg, rgba(255,255,255,.012) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(25deg, rgba(0,0,0,.06) 0 1px, transparent 1px 9px);
  pointer-events: none;
  opacity: .6;
}

.board-rim {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(201, 164, 92, .12);
  border-radius: 16px;
  pointer-events: none;
}

.board-rim::before, .board-rim::after {
  content: "◆";
  position: absolute;
  color: rgba(201, 164, 92, .3);
  font-size: 9px;
}
.board-rim::before { top: -5px; left: 50%; transform: translateX(-50%); }
.board-rim::after { bottom: -5px; left: 50%; transform: translateX(-50%); }

.seat-layer { position: absolute; inset: 0; }

/* ---------- 座位 ---------- */
.seat {
  position: absolute;
  width: 218px;
  min-height: 104px;
  z-index: 10;
  transition: transform .22s ease, filter .22s ease;
}

.seat-0 { left: 50%; bottom: 1.5%; transform: translateX(-50%); }
.seat-1 { right: 1.4%; top: 43%; }
.seat-2 { right: 21%; top: 2.5%; }
.seat-3 { left: 21%; top: 2.5%; }
.seat-4 { left: 1.4%; top: 43%; }

.seat-layer.seats-8 .seat { width: 168px; }
.seat-layer.seats-8 .seat-card { padding: 7px 9px; gap: 7px; }
.seat-layer.seats-8 .seat-avatar { flex-basis: 40px; width: 40px; height: 40px; }
.seat-layer.seats-8 .avatar-glyph { font-size: 25px; }
.seat-layer.seats-8 .seat-name { font-size: 13px; }
.seat-layer.seats-8 .seat-title { font-size: 8px; }
.seat-layer.seats-8 .seat-skills { max-height: 30px; overflow: hidden; }
.seat-layer.seats-8 .seat-skill { font-size: 8px; padding: 0 4px; }
.seat-layer.seats-8 .identity-badge { font-size: 8px; }
.seat-layer.seats-8 .seat-stats { font-size: 8px; }

.seat-card {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 9px 10px 8px;
  min-height: 102px;
  background:
    linear-gradient(135deg, rgba(38, 48, 39, .88), rgba(15, 22, 17, .93) 58%, rgba(25, 31, 24, .9));
  border: 1px solid rgba(201, 164, 92, .3);
  border-radius: 6px;
  box-shadow: 0 7px 20px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 240, 200, .055);
  transition: all .22s ease;
}

.seat-card::before, .seat-card::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border-color: rgba(201, 164, 92, .62);
  border-style: solid;
  pointer-events: none;
}
.seat-card::before { top: 3px; left: 3px; border-width: 1px 0 0 1px; }
.seat-card::after { bottom: 3px; right: 3px; border-width: 0 1px 1px 0; }

.seat-card.current {
  border-color: rgba(240, 209, 138, .85);
  box-shadow: 0 0 0 1px rgba(240, 209, 138, .25), 0 0 26px rgba(201, 164, 92, .28), 0 7px 20px rgba(0,0,0,.4);
}

.seat-card.current .seat-name { color: #ffe6ac; }

.seat-card.current::after {
  border-color: var(--gold-bright);
  filter: drop-shadow(0 0 4px rgba(240, 209, 138, .55));
}

.seat-card.dead {
  filter: grayscale(1) brightness(.62);
  opacity: .72;
}

.seat-card.selectable {
  cursor: pointer;
  border-color: rgba(217, 87, 74, .65);
  animation: targetPulse 1.5s ease-in-out infinite;
}

.seat-card.selectable:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px rgba(217, 87, 74, .6), 0 0 28px rgba(168, 58, 50, .32);
}

.seat-card.selected-target {
  border-color: var(--cinnabar-bright);
  box-shadow: 0 0 0 2px rgba(217, 87, 74, .4), 0 0 30px rgba(168, 58, 50, .38);
  background: linear-gradient(135deg, rgba(80, 41, 34, .92), rgba(32, 19, 16, .94));
}

@keyframes targetPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 87, 74, .05), 0 7px 20px rgba(0,0,0,.42); }
  50% { box-shadow: 0 0 0 3px rgba(217, 87, 74, .13), 0 0 22px rgba(168, 58, 50, .18); }
}

.seat-avatar {
  position: relative;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-top: 3px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,.2), transparent 42%),
    radial-gradient(circle at 50% 65%, var(--kc, #54705f), #17211a 78%);
  border: 1px solid rgba(230, 208, 160, .55);
  box-shadow: 0 3px 10px rgba(0,0,0,.4), inset 0 0 0 3px rgba(7, 10, 8, .55);
  overflow: hidden;
}

.seat-avatar::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(255, 240, 210, .2);
}

.avatar-glyph {
  font-family: var(--font-display);
  font-size: 30px;
  color: rgba(255, 246, 224, .9);
  text-shadow: 0 2px 8px rgba(0,0,0,.65);
  line-height: 1;
  transform: translateY(-1px);
}

.avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px dashed rgba(201, 164, 92, .4);
  animation: slowSpin 26s linear infinite;
}

@keyframes slowSpin { to { transform: rotate(360deg); } }

.seat-main { flex: 1 1 auto; min-width: 0; }

.seat-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.seat-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: #ede3cd;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kingdom-tag {
  flex: 0 0 auto;
  font-size: 9px;
  padding: 1px 4px;
  border: 1px solid currentColor;
  border-radius: 2px;
  opacity: .9;
}
.k-wei { color: #7fa6d4; }
.k-shu { color: #e0796d; }
.k-wu { color: #7fc094; }
.k-qun { color: #b99bd0; }

.identity-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  min-width: 26px;
  padding: 2px 6px;
  font-family: var(--font-display);
  font-size: 11px;
  text-align: center;
  letter-spacing: 1px;
  color: #f6e4bd;
  background: linear-gradient(135deg, #75302a, #431d19);
  border-left: 1px solid rgba(236, 196, 123, .35);
  border-bottom: 1px solid rgba(236, 196, 123, .35);
  border-radius: 0 5px 0 5px;
  z-index: 3;
}
.identity-badge.hidden { background: linear-gradient(135deg, #3d3a30, #211f19); color: #b6aa8f; }
.identity-badge.lord { background: linear-gradient(135deg, #b1893e, #6b4c1d); color: #fff4d4; }
.identity-badge.self { position: static; border-radius: 2px; border: 1px solid rgba(236,196,123,.3); }

.seat-title {
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hp-beads {
  display: flex;
  gap: 3px;
  align-items: center;
  margin-top: 5px;
  min-height: 13px;
}

.hp-bead {
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #d25b4e, #7e251f);
  border: 1px solid rgba(255, 190, 160, .4);
  transform: rotate(45deg);
  box-shadow: 0 0 5px rgba(190, 65, 50, .45);
}
.hp-bead.empty { background: rgba(255,255,255,.06); border-color: rgba(201, 164, 92, .18); box-shadow: none; }
.hp-bead.low { animation: hpLow 1.2s ease-in-out infinite; }
@keyframes hpLow { 50% { box-shadow: 0 0 9px rgba(230, 70, 55, .9); } }

.hp-text {
  font-size: 10px;
  color: #d8b9a0;
  margin-left: 3px;
  font-family: var(--font-display);
}

.seat-stats {
  display: flex;
  gap: 9px;
  margin-top: 4px;
  font-size: 9px;
  color: #9f967f;
}

.seat-stats b { color: #d8c9a8; font-weight: 600; }

.mini-card-icon {
  display: inline-block;
  width: 7px;
  height: 9px;
  border: 1px solid rgba(201, 164, 92, .5);
  margin-right: 3px;
  transform: translateY(1px);
  background: rgba(201, 164, 92, .15);
}

.seat-equips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 5px;
  min-height: 14px;
}

.equip-mini {
  font-size: 8.5px;
  line-height: 1.35;
  padding: 0 4px;
  border: 1px solid rgba(132, 167, 185, .3);
  background: rgba(52, 74, 83, .32);
  color: #b9d0d6;
  border-radius: 2px;
  white-space: nowrap;
}

.judge-mini {
  font-size: 8.5px;
  padding: 0 4px;
  border: 1px solid rgba(187, 133, 69, .45);
  background: rgba(90, 63, 34, .4);
  color: #e5c189;
  border-radius: 2px;
}

.flip-tag, .buqu-tag {
  font-size: 8.5px;
  padding: 0 4px;
  border: 1px solid rgba(195, 122, 190, .4);
  color: #e0b7db;
  background: rgba(85, 48, 82, .35);
}

.seat-skills {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.seat-skill {
  font-size: 8.5px;
  color: #b9a887;
  border-bottom: 1px dotted rgba(201, 164, 92, .35);
  cursor: help;
}

.turn-arrow {
  position: absolute;
  left: 50%;
  top: -16px;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--gold-bright);
  filter: drop-shadow(0 0 5px rgba(240, 209, 138, .6));
  animation: arrowBob 1.4s ease-in-out infinite;
}
@keyframes arrowBob { 50% { transform: translate(-50%, 3px); } }

.hand-back-fan {
  position: absolute;
  right: 7px;
  bottom: -8px;
  display: flex;
  pointer-events: none;
}
.hand-back {
  width: 11px;
  height: 16px;
  margin-left: -5px;
  border: 1px solid rgba(201, 164, 92, .38);
  background: linear-gradient(135deg, #29382d, #111a13);
  border-radius: 1px;
  box-shadow: 0 1px 2px rgba(0,0,0,.4);
}

/* ---------- 中央 ---------- */
.center-stage {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 2;
  pointer-events: none;
}

.turn-emblem {
  position: relative;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
}

.emblem-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(201, 164, 92, .24);
  box-shadow: inset 0 0 22px rgba(0,0,0,.55);
}
.emblem-ring::before, .emblem-ring::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1px dashed rgba(201, 164, 92, .22);
}
.emblem-ring::after {
  inset: -5px;
  border-style: solid;
  border-color: rgba(201, 164, 92, .12) transparent rgba(201, 164, 92, .12) transparent;
  animation: slowSpin 34s linear infinite reverse;
}

.emblem-core {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 45% 35%, rgba(55, 69, 55, .9), rgba(10, 16, 12, .96));
  border: 1px solid rgba(201, 164, 92, .35);
  box-shadow: 0 0 30px rgba(0,0,0,.5);
}

.emblem-core span {
  font-family: var(--font-display);
  font-size: 23px;
  color: var(--gold-bright);
  letter-spacing: 2px;
  line-height: 1;
}

.emblem-core small {
  margin-top: 5px;
  font-size: 7px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.piles { display: flex; align-items: flex-end; gap: 30px; }

.pile { position: relative; }

.deck-pile { width: 56px; height: 76px; }

.pile-stack {
  position: absolute;
  width: 50px;
  height: 68px;
  border: 1px solid rgba(201, 164, 92, .35);
  border-radius: 3px;
  background:
    repeating-linear-gradient(45deg, rgba(201, 164, 92, .13) 0 1px, transparent 1px 5px),
    linear-gradient(145deg, #24352a, #0c130f);
  box-shadow: 0 2px 5px rgba(0,0,0,.4);
}
.pile-stack.s1 { left: 5px; top: 7px; }
.pile-stack.s2 { left: 3px; top: 4px; opacity: .75; }
.pile-stack.s3 { left: 1px; top: 1px; opacity: .5; }

.pile-count {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
  text-shadow: 0 1px 5px #000;
}
.pile-count b { display: block; font-family: var(--font-display); font-size: 20px; color: var(--gold-bright); line-height: 1; }
.pile-count span { font-size: 8px; letter-spacing: 2px; color: var(--text-dim); }

.discard-pile { width: 50px; height: 68px; border: 1px dashed rgba(201, 164, 92, .2); border-radius: 3px; }
.discard-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: rgba(201, 164, 92, .3); font-family: var(--font-display); font-size: 13px; letter-spacing: 2px;
}

.discard-card {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: linear-gradient(160deg, #e7d8ba, #cdbb97);
  color: #221b13;
  border: 1px solid #8e7a58;
  box-shadow: 0 3px 9px rgba(0,0,0,.45);
  padding: 4px;
  font-size: 9px;
  transform: rotate(-4deg);
}
.discard-card .dc-rank { font-family: var(--font-display); font-weight: 700; }
.discard-card .dc-name { display: block; font-family: var(--font-display); font-size: 14px; text-align: center; margin-top: 12px; }
.discard-card.red { color: #9b3028; }

.board-caption {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  font-size: 9.5px;
  letter-spacing: 2px;
  color: rgba(201, 164, 92, .5);
  white-space: nowrap;
  z-index: 3;
}
.caption-dot {
  display: inline-block; width: 4px; height: 4px; background: var(--cinnabar-bright);
  border-radius: 50%; margin-right: 6px; vertical-align: 1px;
  box-shadow: 0 0 6px rgba(217, 87, 74, .8);
}

/* ---------- 战报 ---------- */
.log-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(24, 35, 28, .88), rgba(9, 15, 11, .94));
  border: 1px solid rgba(201, 164, 92, .25);
  border-radius: 5px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 10px 26px rgba(0,0,0,.22);
  overflow: hidden;
}

.log-head {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border-bottom: 1px solid rgba(201, 164, 92, .14);
  background: rgba(201, 164, 92, .035);
}

.log-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 4px;
  color: var(--gold);
  font-weight: 500;
}

.log-live { font-size: 7.5px; letter-spacing: 1.5px; color: #7b8f7d; display: flex; align-items: center; gap: 4px; }
.log-live i { width: 4px; height: 4px; border-radius: 50%; background: #8fbf8e; box-shadow: 0 0 5px #8fbf8e; animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: .3; } }

.log-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 164, 92, .3) transparent;
}
.log-list::-webkit-scrollbar { width: 5px; }
.log-list::-webkit-scrollbar-thumb { background: rgba(201, 164, 92, .25); border-radius: 3px; }

.log-entry {
  font-size: 11.5px;
  line-height: 1.7;
  color: #bcc5b7;
  padding: 3px 0 3px 9px;
  border-left: 1px solid rgba(201, 164, 92, .2);
  animation: logIn .24s ease;
  word-break: break-word;
}
@keyframes logIn { from { opacity: 0; transform: translateY(3px); } }

.log-entry.narr { color: #d5c6a6; border-left-color: rgba(201, 164, 92, .4); }
.log-entry.damage { color: #d98a7e; border-left-color: rgba(217, 87, 74, .6); }
.log-entry.heal { color: #8ec3a0; border-left-color: rgba(94, 170, 121, .5); }
.log-entry.skill { color: #d5bd88; border-left-color: rgba(201, 164, 92, .55); }
.log-entry.judge { color: #b2a1c9; border-left-color: rgba(151, 122, 191, .5); }
.log-entry.trick { color: #8fb3bb; border-left-color: rgba(95, 156, 166, .45); }
.log-entry.equip { color: #9eb5c8; border-left-color: rgba(111, 142, 168, .4); }
.log-entry.response { color: #c3b79a; }
.log-entry.system { color: #7f8a79; border-left-color: rgba(201, 164, 92, .18); }

.log-foot {
  flex: 0 0 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7.5px;
  letter-spacing: 1.5px;
  color: rgba(201, 164, 92, .32);
  border-top: 1px solid rgba(201, 164, 92, .1);
}

/* ---------- 底部 ---------- */
.bottom-area {
  flex: 0 0 206px;
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.player-panel {
  position: relative;
  padding: 10px 12px 8px;
  background: linear-gradient(145deg, rgba(31, 41, 33, .88), rgba(11, 17, 13, .92));
  border: 1px solid rgba(201, 164, 92, .28);
  border-radius: 5px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 9px 22px rgba(0,0,0,.28);
  overflow: hidden;
}

.player-panel::before {
  content: "";
  position: absolute;
  top: 0; left: 12px; right: 12px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 209, 138, .5), transparent);
}

.player-head { display: flex; gap: 10px; align-items: center; }

.mini-avatar {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 22px;
  color: #f3e5c7;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.17), transparent 45%), radial-gradient(circle at 50% 60%, #4c6855, #131c16 80%);
  border: 1px solid rgba(201, 164, 92, .55);
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.35), 0 3px 9px rgba(0,0,0,.35);
}

.player-id { flex: 1; min-width: 0; }
.player-name-row { display: flex; align-items: center; gap: 7px; }
.player-name-row b { font-family: var(--font-display); font-size: 19px; color: #f0e2c4; letter-spacing: 1px; }
.player-id > span { display: block; font-size: 9px; color: var(--text-dim); letter-spacing: .5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.identity-chip {
  font-family: var(--font-display);
  font-size: 10px;
  padding: 1px 5px;
  color: #f4dfb6;
  background: rgba(119, 48, 40, .7);
  border: 1px solid rgba(230, 171, 132, .32);
  white-space: nowrap;
}

.self-bars { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; }
.self-bars .hp-beads { margin: 0; }
.self-meta { display: flex; gap: 10px; font-size: 9px; color: #a79d86; }
.self-meta b { color: #d2c3a2; }

.self-equips { display: flex; flex-wrap: wrap; gap: 4px; min-height: 17px; margin-top: 6px; }
.self-equips .equip-mini { font-size: 9px; padding: 1px 5px; cursor: default; }

.self-skills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; max-height: 40px; overflow: hidden; }
.skill-chip {
  font-family: var(--font-display);
  font-size: 10px;
  padding: 1px 6px;
  border: 1px solid rgba(201, 164, 92, .35);
  color: #d4bd8d;
  background: rgba(201, 164, 92, .07);
  cursor: help;
}
.skill-chip.lord-skill { border-color: rgba(224, 175, 95, .6); color: #f0cf94; }

.hand-zone {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}

.prompt-bar {
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: linear-gradient(180deg, rgba(24, 33, 27, .88), rgba(10, 15, 12, .94));
  border: 1px solid rgba(201, 164, 92, .24);
  border-left: 2px solid var(--gold-soft);
  min-width: 0;
  position: relative;
  z-index: 20;
}

.prompt-icon {
  flex: 0 0 22px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 13px;
  color: #f0d9ac;
  background: #762b25;
  border: 1px solid rgba(231, 169, 126, .35);
  transform: rotate(-2deg);
}

.prompt-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  color: #cfc3a9;
  letter-spacing: .5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prompt-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }

.prompt-btn {
  border: 1px solid rgba(201, 164, 92, .45);
  background: rgba(201, 164, 92, .08);
  color: #e6cf9f;
  font-size: 11px;
  padding: 5px 11px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.prompt-btn:hover { background: rgba(201, 164, 92, .22); color: #fff0ce; border-color: var(--gold-bright); }
.prompt-btn.primary { background: linear-gradient(180deg, #9c3730, #6f241f); border-color: #c4685c; color: #ffe9cd; }
.prompt-btn.primary:hover { background: linear-gradient(180deg, #b8453b, #832a24); }
.prompt-btn.ghost { background: transparent; color: #928a77; border-color: rgba(201, 164, 92, .2); }
.prompt-btn:disabled { opacity: .35; cursor: not-allowed; }
.prompt-btn .pb-suit { margin-right: 3px; }
.prompt-btn.red { color: #e58c7d; }
.prompt-btn.black { color: #c8c1b0; }

.hand-scroll {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  padding: 4px 10px 4px 26px;
}

.hand {
  display: flex;
  align-items: flex-end;
  height: 156px;
  width: 100%;
  padding-bottom: 2px;
  overflow: visible;
}

.hand-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(201, 164, 92, .28);
  pointer-events: none;
}

/* ---------- 卡牌 ---------- */
.card-face {
  position: relative;
  flex: 0 0 92px;
  width: 92px;
  height: 132px;
  border-radius: 5px;
  background:
    linear-gradient(160deg, #efe4cd 0%, #e3d3b2 52%, #d4c19c 100%);
  border: 1px solid #8d7650;
  box-shadow:
    0 5px 12px rgba(0, 0, 0, .45),
    inset 0 0 0 2px rgba(255, 249, 232, .38),
    inset 0 0 18px rgba(120, 90, 45, .18);
  color: #251d13;
  padding: 6px 6px 5px;
  cursor: default;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
  transform-origin: bottom center;
}

.card-face::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(111, 84, 45, .26);
  border-radius: 3px;
  pointer-events: none;
}

.hand .card-face {
  margin-left: -26px;
  transform: rotate(var(--rot, 0deg)) translateY(var(--ty, 0px));
  z-index: var(--zi, 1);
}
.hand .card-face:first-child { margin-left: 0; }

.hand .card-face:hover {
  transform: rotate(0deg) translateY(-16px) scale(1.05);
  z-index: 60 !important;
  box-shadow: 0 11px 26px rgba(0,0,0,.55), 0 0 0 1px rgba(240, 209, 138, .5);
}

.hand .card-face.selected {
  transform: rotate(0deg) translateY(-25px) scale(1.04);
  z-index: 70 !important;
  box-shadow: 0 0 0 2px rgba(217, 87, 74, .8), 0 10px 26px rgba(0,0,0,.55);
}

.hand .card-face.playable { cursor: pointer; }
.hand .card-face.playable:hover { filter: brightness(1.06); }
.hand .card-face.unplayable { filter: grayscale(.5) brightness(.72); }
.hand .card-face.dimmed { filter: brightness(.55) grayscale(.35); }

.card-corner {
  position: absolute;
  top: 4px;
  left: 5px;
  display: flex;
  align-items: center;
  gap: 1px;
  line-height: 1;
  z-index: 2;
}
.card-suit { font-size: 13px; }
.card-rank { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -.5px; }
.card-face.red .card-corner { color: #a12f28; }
.card-face.black .card-corner { color: #24201a; }

.card-center-glyph {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 32px;
  color: rgba(58, 43, 25, .9);
  border: 1px solid rgba(112, 85, 49, .24);
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 68%);
}

.card-face.red .card-center-glyph { color: #8e2a24; }
.card-face.black .card-center-glyph { color: #2a251e; }

.card-name {
  position: absolute;
  left: 5px; right: 5px;
  bottom: 22px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #2b2115;
  z-index: 2;
}

.card-type {
  position: absolute;
  left: 4px; right: 4px; bottom: 4px;
  text-align: center;
  font-size: 7.5px;
  letter-spacing: 1px;
  color: #6f5a3d;
  border-top: 1px solid rgba(111, 84, 45, .22);
  padding-top: 2px;
  z-index: 2;
}

.card-face.equip-card { background: linear-gradient(160deg, #e4e1d3, #cfc7b2 55%, #b8ad94); }
.card-face.trick-card { background: linear-gradient(160deg, #e9ddc8, #dcc9aa 55%, #c6ad86); }

.card-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  width: 190px;
  padding: 8px 9px;
  background: rgba(9, 14, 11, .98);
  border: 1px solid rgba(201, 164, 92, .42);
  color: #d9ceb6;
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: .3px;
  opacity: 0;
  visibility: hidden;
  transition: all .15s;
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(0,0,0,.5);
}
.card-face:hover .card-tooltip { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.card-tooltip b { color: var(--gold-bright); display: block; font-family: var(--font-display); font-size: 12px; margin-bottom: 2px; }
.card-tooltip i { color: #9d8f76; font-style: normal; font-size: 9px; }

/* 装备栏里的可点击小牌 */
.equip-mini.selectable { cursor: pointer; border-color: var(--cinnabar-bright); box-shadow: 0 0 8px rgba(217,87,74,.45); }
.equip-mini.selected { background: rgba(168, 58, 50, .55); border-color: #ffb6a5; }

/* ---------- 覆盖层 ---------- */
.overlay, .modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay.hidden { display: none; }

.start-screen {
  background:
    radial-gradient(ellipse at 50% 108%, rgba(50, 80, 59, .42), transparent 62%),
    radial-gradient(ellipse at 50% 42%, rgba(34, 52, 40, .36), transparent 58%),
    linear-gradient(180deg, rgba(8, 13, 10, .96), rgba(4, 7, 5, .995));
  z-index: 300;
  overflow: hidden;
}

body.start-open .topbar,
body.start-open .main-grid,
body.start-open .bottom-area { visibility: hidden; }

.start-screen::after {
  content: "";
  position: absolute;
  right: -8%;
  top: -16%;
  width: 58vw;
  height: 62vh;
  border-radius: 50%;
  background: radial-gradient(ellipse at 55% 50%, rgba(232, 218, 185, .09), rgba(201, 164, 92, .025) 42%, transparent 68%);
  filter: blur(28px);
  pointer-events: none;
}

.start-screen::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    repeating-linear-gradient(115deg, transparent 0 32px, rgba(201, 164, 92, .022) 32px 33px),
    radial-gradient(circle at 50% 50%, transparent 0 30%, rgba(0,0,0,.5) 75%);
  pointer-events: none;
}

.start-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  width: min(680px, 100%);
  padding: 10px 24px;
  box-sizing: border-box;
  animation: startIn .7s cubic-bezier(.2,.8,.3,1);
}
@keyframes startIn { from { opacity: 0; transform: translateY(18px); } }

.start-sigil {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #8f2c26, #5c1c18);
  border: 1px solid rgba(230, 164, 121, .55);
  box-shadow: 0 0 0 4px rgba(143, 44, 38, .1), 0 10px 30px rgba(0,0,0,.5), inset 0 0 0 2px rgba(255,235,200,.12);
  transform: rotate(-4deg);
}
.start-sigil span {
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 1;
  color: #f2ddba;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}

.start-kicker { font-size: 9px; letter-spacing: 6px; color: rgba(201, 164, 92, .62); margin: 0 0 10px; }

.start-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(54px, 8vw, 84px);
  font-weight: 500;
  letter-spacing: 12px;
  color: #f1d79d;
  text-shadow: 0 2px 0 #5d4522, 0 0 38px rgba(201, 164, 92, .28), 0 12px 40px rgba(0,0,0,.7);
  line-height: 1.1;
  padding-left: 12px;
}

.start-sub {
  margin: 5px 0 0;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 9px;
  color: #b9a57e;
  padding-left: 9px;
}

.start-rule {
  width: 300px;
  max-width: 70%;
  height: 1px;
  margin: 24px auto 20px;
  background: linear-gradient(90deg, transparent, rgba(201, 164, 92, .65), transparent);
  position: relative;
}
.start-rule::after {
  content: "◆";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 7px;
  color: var(--gold);
  background: #060a07;
  padding: 0 7px;
}

.start-desc {
  font-size: 12px;
  line-height: 2.1;
  color: #9d927c;
  letter-spacing: .7px;
  margin: 0 auto;
  max-width: min(520px, 100%);
}

.start-features {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 22px 0 26px;
  color: #b5a47f;
  font-size: 10px;
  letter-spacing: 2px;
}
.start-features i { width: 3px; height: 3px; background: rgba(201, 164, 92, .45); transform: rotate(45deg); }

.start-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.start-tip { margin: 22px 0 0; font-size: 9px; letter-spacing: 2px; color: rgba(170, 158, 135, .45); }

/* ---------- 弹窗 ---------- */
.modal-layer { pointer-events: none; z-index: 400; }
.modal-layer.active { pointer-events: auto; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 4, .74);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }

.modal {
  position: relative;
  width: min(580px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(76, 92, 70, .17), transparent 55%),
    linear-gradient(160deg, #18231b, #0b110d 70%);
  border: 1px solid rgba(201, 164, 92, .45);
  box-shadow: 0 30px 80px rgba(0,0,0,.7), inset 0 0 0 5px rgba(0,0,0,.3), inset 0 0 0 6px rgba(201, 164, 92, .1);
  animation: modalIn .26s cubic-bezier(.2,.8,.3,1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }

.modal::before, .modal::after {
  content: "";
  position: absolute;
  width: 26px; height: 26px;
  border-color: rgba(201, 164, 92, .65);
  border-style: solid;
  pointer-events: none;
  z-index: 2;
}
.modal::before { top: 7px; left: 7px; border-width: 1px 0 0 1px; }
.modal::after { bottom: 7px; right: 7px; border-width: 0 1px 1px 0; }

.modal-head {
  flex: 0 0 auto;
  padding: 18px 24px 12px;
  border-bottom: 1px solid rgba(201, 164, 92, .14);
  text-align: center;
}
.modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 23px;
  letter-spacing: 5px;
  color: var(--gold-bright);
  font-weight: 500;
}
.modal-head p { margin: 5px 0 0; font-size: 10px; letter-spacing: 1px; color: var(--text-dim); }

.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 22px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 164, 92, .3) transparent;
}
.modal-body::-webkit-scrollbar { width: 5px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(201, 164, 92, .25); }

.modal-actions {
  flex: 0 0 auto;
  padding: 12px 22px 16px;
  display: flex;
  justify-content: center;
  gap: 10px;
  border-top: 1px solid rgba(201, 164, 92, .1);
}

/* 选将 */
.general-grid { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.general-grid.five .general-card { width: calc(20% - 10px); min-width: 130px; }

.general-card {
  position: relative;
  width: 170px;
  min-height: 300px;
  padding: 14px 12px 12px;
  border: 1px solid rgba(201, 164, 92, .3);
  background:
    radial-gradient(ellipse at 50% 18%, color-mix(in srgb, var(--kc) 32%, transparent), transparent 62%),
    linear-gradient(170deg, rgba(40, 51, 41, .96), rgba(12, 18, 14, .98));
  box-shadow: inset 0 0 40px rgba(0,0,0,.3), 0 7px 18px rgba(0,0,0,.28);
  cursor: pointer;
  transition: all .2s ease;
  text-align: center;
  overflow: hidden;
}

.general-card::before {
  content: "";
  position: absolute;
  top: 0; left: 15%; right: 15%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 209, 138, .5), transparent);
}

.general-card:hover {
  transform: translateY(-5px);
  border-color: rgba(240, 209, 138, .8);
  box-shadow: 0 16px 32px rgba(0,0,0,.45), 0 0 26px rgba(201, 164, 92, .12);
}

.general-avatar {
  width: 64px; height: 64px;
  margin: 0 auto 9px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 31px;
  color: #f7e9ca;
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,.22), transparent 45%),
    radial-gradient(circle at 50% 65%, var(--kc), #131b15 78%);
  border: 1px solid rgba(240, 209, 138, .55);
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.4), 0 5px 12px rgba(0,0,0,.35);
}

.general-name { font-family: var(--font-display); font-size: 24px; color: #f0e2c4; letter-spacing: 2px; line-height: 1.15; }
.general-title { font-size: 8.5px; letter-spacing: 1px; color: #9c9079; margin-top: 3px; min-height: 12px; }
.general-kingdom { display: inline-block; margin-top: 7px; font-size: 9px; letter-spacing: 2px; color: var(--kc); border: 1px solid color-mix(in srgb, var(--kc) 55%, transparent); padding: 1px 8px; }
.general-hp { margin: 8px 0 7px; display: flex; justify-content: center; gap: 3px; }
.general-hp .hp-bead { width: 7px; height: 7px; }
.general-skills { text-align: left; border-top: 1px solid rgba(201, 164, 92, .12); padding-top: 7px; margin-top: 2px; }
.general-skill { margin-bottom: 5px; }
.general-skill b { font-family: var(--font-display); font-size: 11px; color: #d9bd83; letter-spacing: 1px; }
.general-skill p { margin: 1px 0 0; font-size: 8.5px; line-height: 1.45; color: #978d79; }
.general-pick {
  position: absolute; left: 12px; right: 12px; bottom: 10px;
  padding: 5px 0; font-size: 10px; letter-spacing: 3px;
  border: 1px solid rgba(201, 164, 92, .35); color: #d9c294;
  background: rgba(201, 164, 92, .07);
}
.general-card:hover .general-pick { background: rgba(168, 58, 50, .75); border-color: #d58b7d; color: #ffe9cd; }

.general-hint { text-align: center; font-size: 10px; color: #8e8471; margin: 0 0 12px; letter-spacing: 1px; }

/* 通用小列表 */
.choice-list { display: flex; flex-direction: column; gap: 7px; }
.choice-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 11px;
  border: 1px solid rgba(201, 164, 92, .18);
  background: rgba(255,255,255,.018);
  font-size: 11px;
  color: #c9bda5;
}
.choice-row:hover { border-color: rgba(201, 164, 92, .4); background: rgba(201, 164, 92, .04); }
.choice-row .cr-name { font-family: var(--font-display); font-size: 14px; color: #e2ca97; }
.choice-row .cr-desc { font-size: 9px; color: #8f8572; }

.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }

/* 判定 / 观星等 */
.judge-display { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 4px 0 14px; }
.judge-card {
  width: 82px; height: 116px;
  padding: 7px;
  background: linear-gradient(160deg, #efe4cd, #d3c09d);
  border: 1px solid #8d7650;
  color: #261e14;
  box-shadow: 0 7px 18px rgba(0,0,0,.45);
  position: relative;
}
.judge-card .jc-corner { display: flex; gap: 3px; font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.judge-card.red .jc-corner { color: #9c2e27; }
.judge-card .jc-name { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 27px; }
.judge-arrow { color: rgba(201, 164, 92, .5); font-size: 20px; }

.arrange-cards { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; }
.arrange-card { position: relative; cursor: pointer; }
.arrange-card .card-face { width: 74px; height: 106px; flex-basis: 74px; }
.arrange-card .card-face .card-center-glyph { width: 42px; height: 42px; font-size: 25px; }
.arrange-card .card-face .card-name { font-size: 11px; }
.arrange-card.bottom .card-face { box-shadow: 0 0 0 2px rgba(111, 170, 195, .7); }
.arrange-card .bottom-tag {
  position: absolute; left: 50%; bottom: -17px; transform: translateX(-50%);
  font-size: 8px; color: #91b8c8; white-space: nowrap;
}
.arrange-card.selected .card-face { transform: translateY(-8px); }

/* 五谷 */
.wugu-grid { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.wugu-card { cursor: pointer; transition: transform .15s; }
.wugu-card:hover { transform: translateY(-5px); }
.wugu-card .card-face { width: 78px; height: 112px; flex-basis: 78px; }

/* 遗计分配 */
.distribute-list { display: flex; flex-direction: column; gap: 9px; }
.distribute-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 9px;
  border: 1px solid rgba(201, 164, 92, .14);
  background: rgba(255,255,255,.015);
}
.distribute-row .mini-card-name { flex: 0 0 120px; font-family: var(--font-display); font-size: 13px; color: #e1c997; }
.distribute-row select {
  flex: 1;
  background: #101711;
  color: #cfc2a5;
  border: 1px solid rgba(201, 164, 92, .3);
  padding: 5px 7px;
  font-size: 10px;
  outline: none;
}

/* ---------- 结算 ---------- */
.result-modal { text-align: center; }
.result-title {
  font-family: var(--font-display);
  font-size: 42px;
  letter-spacing: 10px;
  margin: 4px 0 3px;
  color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(201, 164, 92, .3);
}
.result-sub { font-size: 11px; letter-spacing: 3px; color: #a99d84; margin-bottom: 18px; }
.result-players { display: flex; flex-direction: column; gap: 5px; margin: 0 auto 16px; max-width: 380px; }
.result-row { display: flex; align-items: center; gap: 9px; padding: 5px 9px; border: 1px solid rgba(201,164,92,.12); font-size: 11px; }
.result-row .rr-name { width: 62px; text-align: left; font-family: var(--font-display); font-size: 14px; color: #e2d3b4; }
.result-row .rr-identity { width: 40px; font-size: 10px; color: #c9a45c; }
.result-row .rr-result { flex: 1; text-align: right; font-size: 9px; color: #8d8371; }
.result-row.win { background: rgba(201, 164, 92, .06); border-color: rgba(201, 164, 92, .26); }

/* ---------- toast ---------- */
.toast-layer { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast {
  padding: 8px 18px; background: rgba(12, 18, 14, .95); border: 1px solid rgba(201, 164, 92, .5);
  color: #e4d2ab; font-size: 11px; letter-spacing: 1px; box-shadow: 0 8px 24px rgba(0,0,0,.45);
  animation: toastIn .2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .main-grid { grid-template-columns: minmax(0, 1fr) 268px; }
  .seat { width: 196px; }
  .bottom-area { grid-template-columns: 264px minmax(0, 1fr); }
  .seat-1 { right: .6%; }
  .seat-4 { left: .6%; }
}

@media (max-width: 980px) {
  .main-grid { grid-template-columns: 1fr; }
  .log-panel { display: none; }
  .bottom-area { grid-template-columns: 226px minmax(0, 1fr); flex-basis: 196px; }
  .seat { width: 178px; }
  .seat-avatar { flex-basis: 48px; width: 48px; height: 48px; }
  .avatar-glyph { font-size: 25px; }
  .seat-name { font-size: 16px; }
  .status-strip { display: none; }
}

@media (max-width: 720px) {
  #app { padding: 6px; gap: 6px; }
  .topbar { flex-basis: 46px; padding: 0 7px; gap: 6px; }
  .brand-text h1 { font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
  .brand-text p { display: none; }
  .brand-seal { width: 34px; height: 34px; font-size: 22px; }
  .top-actions { gap: 3px; }
  .top-actions .btn { padding: 4px 7px; font-size: 10px; letter-spacing: 1px; }
  .bottom-area { grid-template-columns: 1fr; flex-basis: 212px; gap: 6px; }
  .player-panel { display: none; }

  .seat-layer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: center;
    gap: 6px;
    padding: 8px;
  }
  .seat {
    position: static;
    width: auto;
    min-height: 0;
    transform: none !important;
  }
  .seat-0 { order: 5; grid-column: 1 / -1; justify-self: center; width: 66%; margin-top: 2px; }
  .seat-1, .seat-2, .seat-3, .seat-4, .seat-5, .seat-6, .seat-7 { order: 1; }
  .seat-layer.seats-8 { grid-template-columns: 1fr 1fr; padding: 5px; gap: 4px; }
  .seat-layer.seats-8 .seat { width: auto; }
  .seat-layer.seats-8 .seat-card { padding: 4px 5px; }
  .seat-layer.seats-8 .seat-name { font-size: 11px; }
  .seat-layer.seats-8 .seat-avatar { flex-basis: 26px; width: 26px; height: 26px; }
  .seat-layer.seats-8 .avatar-glyph { font-size: 16px; }
  .seat-card { min-height: 0; padding: 5px 6px; gap: 6px; border-radius: 4px; }
  .seat-avatar { flex-basis: 32px; width: 32px; height: 32px; margin-top: 0; }
  .avatar-glyph { font-size: 20px; }
  .avatar-ring { display: none; }
  .seat-main { min-width: 0; }
  .seat-name-row { gap: 3px; }
  .seat-name { font-size: 13px; }
  .kingdom-tag { font-size: 7px; padding: 1px 2px; }
  .seat-title, .seat-stats, .seat-skills, .hand-back-fan { display: none; }
  .hp-beads { gap: 2px; margin: 2px 0; }
  .hp-bead { width: 7px; height: 7px; }
  .hp-text { font-size: 8px; }
  .seat-equips { font-size: 7px; gap: 3px; max-height: 15px; overflow: hidden; white-space: nowrap; }
  .equip-mini, .judge-mini { padding: 0 2px; }
  .identity-badge { font-size: 7px; padding: 1px 4px; }
  .dead-stamp { font-size: 18px; }
  .turn-arrow { left: 12px; }

  .center-stage, .board-caption { display: none; }
  .card-face { flex-basis: 76px; width: 76px; height: 110px; }
  .hand .card-face { margin-left: -34px; }
  .hand { height: 128px; }
  .start-inner { padding: 8px 14px; }
  .start-sigil { width: 62px; height: 62px; margin-bottom: 14px; }
  .start-sigil span { font-size: 40px; }
  .start-title { font-size: clamp(44px, 14vw, 64px); letter-spacing: 6px; padding-left: 6px; }
  .start-sub { letter-spacing: 6px; font-size: 13px; padding-left: 6px; }
  .start-desc { font-size: 11px; line-height: 1.9; }
  .start-features { gap: 9px; font-size: 9px; letter-spacing: 1px; }
  .start-actions { gap: 9px; }
  .start-actions .btn.large { padding: 11px 20px; font-size: 13px; letter-spacing: 2px; }
  .start-tip { margin-top: 16px; font-size: 8px; letter-spacing: 1px; }
}
