:root {
  --bg: #0c0b09;
  --bg-2: #14110d;
  --panel: rgba(24, 20, 15, 0.86);
  --panel-2: rgba(34, 28, 21, 0.9);
  --parchment: #e8dcc2;
  --parchment-dim: #c9b994;
  --gold: #d8b570;
  --gold-2: #f0d495;
  --gold-dim: #8f7242;
  --red: #b64b42;
  --red-bright: #e06a5c;
  --jade: #4e9270;
  --ink: #15120e;
  --line: rgba(216, 181, 112, 0.2);
  --line-strong: rgba(216, 181, 112, 0.42);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--parchment);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold); }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: rgba(216, 181, 112, 0.3); border-radius: 10px; }

/* ── 环境背景 ───────────────────────────────── */
.ambient {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(circle at 72% 18%, rgba(151, 96, 45, 0.13), transparent 42%),
    radial-gradient(circle at 18% 76%, rgba(110, 39, 34, 0.12), transparent 45%),
    linear-gradient(160deg, #100e0b 0%, #0a0907 55%, #120e0a 100%);
}
.ambient::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(216, 181, 112, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 181, 112, 0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}
.ambient-grid {
  position: absolute; inset: -20%;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(216,181,112,.025) 0deg 1deg, transparent 1deg 9deg);
  opacity: .5;
  mask-image: radial-gradient(circle at 50% 45%, black 0%, transparent 62%);
}
.ambient-glow {
  position: absolute; width: 46vw; height: 46vw; border-radius: 50%;
  filter: blur(80px); opacity: .25;
}
.glow-a { background: #6f3b24; right: -10vw; top: -14vw; }
.glow-b { background: #52342c; left: -16vw; bottom: -18vw; opacity: .18; }
.ambient-seal {
  position: absolute; right: 6vw; bottom: 4vh;
  font-size: 34vw; line-height: .8; color: rgba(182, 75, 66, 0.035);
  font-weight: 900; transform: rotate(-8deg); user-select: none;
}

#app { position: relative; z-index: 1; height: 100%; }
body[data-screen="game"] .site-head { display: none; }
.site-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: 70px; padding: 0 clamp(18px, 4vw, 54px);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(10, 9, 7, 0.92), rgba(10, 9, 7, 0));
  border-bottom: 1px solid transparent;
  transition: background .3s;
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand-seal, .mini-seal {
  display: inline-grid; place-items: center; color: #f3dfb1;
  background: linear-gradient(145deg, #a73830, #7c2824);
  border: 1px solid rgba(255, 220, 160, 0.36);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, .35), 0 4px 16px rgba(120, 30, 24, .3);
  font-weight: 800;
}
.brand-seal { width: 34px; height: 34px; border-radius: 6px; font-size: 20px; transform: rotate(-3deg); }
.brand-text { font-size: 20px; letter-spacing: .16em; display: flex; align-items: baseline; gap: 10px; }
.brand-text em { font-style: normal; font-size: 11px; letter-spacing: .22em; color: var(--parchment-dim); opacity: .75; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.nav-link {
  border: 0; background: none; color: var(--parchment-dim); font-size: 13px;
  letter-spacing: .14em; padding: 8px 2px; position: relative;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 2px; height: 1px;
  background: var(--gold); transition: right .25s;
}
.nav-link:hover { color: var(--gold-2); }
.nav-link:hover::after { right: 0; }
.online-dot {
  font-family: var(--sans); font-size: 11px; letter-spacing: .08em;
  color: var(--parchment-dim); padding-left: 17px; position: relative;
}
.online-dot::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 7px; height: 7px;
  border-radius: 50%; background: #8b6a3e; transform: translateY(-50%);
  box-shadow: 0 0 0 3px rgba(139, 106, 62, .12);
}
.online-dot.online::before { background: #61b98a; box-shadow: 0 0 0 3px rgba(97, 185, 138, .15), 0 0 10px rgba(97,185,138,.5); }

/* ── 通用 ───────────────────────────────── */
#screens { height: 100%; }
.screen { display: none; height: 100%; overflow-y: auto; }
.screen.active { display: block; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--line-strong); background: rgba(24, 20, 15, .7);
  color: var(--parchment); padding: 11px 22px; border-radius: 4px;
  letter-spacing: .1em; position: relative; transition: .22s ease;
  box-shadow: inset 0 0 20px rgba(0,0,0,.2);
}
.btn:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--gold); color: var(--gold-2); box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 0 24px rgba(216,181,112,.06); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(160deg, #f0d495, #c9a35d 58%, #a9823f);
  color: #241a0e; border-color: #e9cf96; font-weight: 700;
  text-shadow: 0 1px 0 rgba(255,255,255,.22);
  box-shadow: 0 8px 28px rgba(190, 145, 62, .22), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-primary:hover:not(:disabled) { color: #1c1308; filter: brightness(1.06); }
.btn-ghost { background: rgba(16, 13, 10, .62); }
.btn.wide { width: 100%; }
.btn-hero { min-width: 230px; padding: 16px 24px; align-items: center; text-align: left; }
.btn-hero .btn-icon { font-size: 24px; opacity: .9; }
.btn-hero b { display: block; font-size: 17px; letter-spacing: .16em; }
.btn-hero small { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .06em; opacity: .66; font-weight: 400; }
.btn-hero.btn-primary small { color: #4a3516; opacity: .8; }
.mini-btn {
  border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--parchment-dim);
  border-radius: 3px; padding: 5px 10px; font-family: var(--sans); font-size: 11px;
  letter-spacing: .06em; transition: .2s;
}
.mini-btn:hover { color: var(--gold-2); border-color: var(--line-strong); background: rgba(216,181,112,.07); }
.mini-btn.danger { color: #d99186; }
.mini-btn.danger:hover { border-color: rgba(214, 100, 86, .5); }
.back-link {
  border: 0; background: none; color: var(--parchment-dim); padding: 4px 0;
  font-family: var(--sans); font-size: 12px; letter-spacing: .08em;
}
.back-link:hover { color: var(--gold-2); }
.panel {
  background: linear-gradient(160deg, rgba(31, 26, 19, .88), rgba(17, 14, 11, .9));
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.03);
  position: relative;
}
.panel::before {
  content: ""; position: absolute; inset: 5px; border: 1px solid rgba(216,181,112,.07);
  border-radius: 3px; pointer-events: none;
}
.eyebrow { font-family: var(--sans); font-size: 11px; letter-spacing: .3em; color: var(--gold-dim); text-transform: uppercase; }
.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--sans); font-size: 12px; color: var(--parchment-dim); margin-bottom: 8px; letter-spacing: .08em; }
.field-hint { font-family: var(--sans); font-size: 11px; color: rgba(201,185,148,.55); margin: 12px 0 0; }
input[type="text"], input[type="password"], input:not([type]), .code-input {
  width: 100%; background: rgba(0,0,0,.28); border: 1px solid var(--line);
  border-radius: 3px; padding: 10px 12px; color: var(--parchment); outline: none;
  font-family: var(--sans); font-size: 14px; transition: .2s;
}
input:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px rgba(216,181,112,.06); }
.check { display: flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 13px; color: var(--parchment-dim); margin: 18px 0; cursor: pointer; }
.check input { accent-color: #b58f52; }

/* ── 首页 ───────────────────────────────── */
#screen-home { display: none; }
#screen-home.active { display: block; }
.home-wrap {
  width: min(1280px, 92vw); margin: 0 auto; min-height: 100%;
  padding: 110px 0 60px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
  align-items: center; gap: clamp(30px, 6vw, 90px);
}
.hero-kicker {
  display: flex; align-items: center; gap: 12px; color: var(--gold-dim);
  font-family: var(--sans); font-size: 11px; letter-spacing: .28em; margin-bottom: 24px;
}
.hero-kicker span { width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim)); }
.hero-kicker span:last-child { background: linear-gradient(90deg, var(--gold-dim), transparent); }
.hero-title { margin: 0 0 20px; line-height: 1; position: relative; }
.title-main {
  display: block; font-size: clamp(64px, 9vw, 128px); letter-spacing: .06em; font-weight: 800;
  background: linear-gradient(180deg, #f7e7bf 0%, #d8b570 42%, #a77c3d 88%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 12px 30px rgba(170, 122, 48, .16));
}
.title-sub {
  display: block; margin-top: 16px; font-family: var(--sans); font-size: 11px;
  letter-spacing: .6em; color: rgba(201, 185, 148, .52); padding-left: 6px;
}
.hero-copy { color: rgba(232, 220, 194, .72); font-size: 15px; letter-spacing: .05em; line-height: 1.9; margin: 0 0 28px; }
.profile-row { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.profile-row label { font-family: var(--sans); font-size: 12px; color: var(--gold-dim); letter-spacing: .12em; white-space: nowrap; }
.profile-row input { width: 180px; padding: 8px 12px; }
.profile-hint { font-family: var(--sans); font-size: 11px; color: rgba(201,185,148,.4); }
.mode-switch { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 4px; padding: 3px; background: rgba(0,0,0,.23); margin-bottom: 14px; margin-right: 10px; }
.mode-btn {
  border: 0; background: transparent; color: var(--parchment-dim); padding: 8px 20px;
  font-size: 13px; letter-spacing: .1em; border-radius: 2px; transition: .2s;
  display: flex; align-items: baseline; gap: 8px;
}
.mode-btn small { font-family: var(--sans); font-size: 10px; opacity: .5; letter-spacing: .05em; }
.mode-btn.active { background: linear-gradient(160deg, rgba(182,75,66,.24), rgba(182,75,66,.07)); color: #f0c9b8; box-shadow: inset 0 0 0 1px rgba(214,121,106,.28); }
.dd-note { font-family: var(--sans); font-size: 12px; color: rgba(201,185,148,.55); margin: -12px 0 24px; padding: 8px 12px; border-left: 2px solid rgba(214,121,106,.5); background: rgba(182,75,66,.06); }
.twin-config { margin: -12px 0 24px; padding: 12px 14px; border: 1px solid rgba(216,181,112,.18); background: rgba(0,0,0,.18); max-width: 720px; }
.twin-row { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.twin-label { font-family: var(--sans); font-size: 11px; letter-spacing: .12em; color: var(--gold-dim); width: 62px; flex: none; }
.twin-seats { display: flex; gap: 5px; flex-wrap: wrap; }
.twin-seats button { width: 34px; height: 30px; border: 1px solid var(--line); background: rgba(0,0,0,.2); color: var(--parchment-dim); font-family: var(--sans); font-size: 12px; border-radius: 2px; }
.twin-seats button.active { color: #f0c9b8; border-color: rgba(214,121,106,.6); background: rgba(182,75,66,.16); }
.twin-select { flex: 1; max-width: 300px; background: rgba(0,0,0,.28); color: var(--parchment); border: 1px solid var(--line); border-radius: 2px; padding: 7px 9px; font-family: var(--sans); font-size: 12px; }
.twin-config .dd-note { margin: 12px 0 0; }
.seat-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; padding: 3px; background: rgba(0,0,0,.23); margin-bottom: 26px; }
.seat-btn {
  border: 0; background: transparent; color: var(--parchment-dim); padding: 8px 20px;
  font-size: 13px; letter-spacing: .1em; border-radius: 2px; transition: .2s;
  display: flex; align-items: baseline; gap: 8px;
}
.seat-btn small { font-family: var(--sans); font-size: 10px; opacity: .5; letter-spacing: .05em; }
.seat-btn.active { background: linear-gradient(160deg, rgba(216,181,112,.18), rgba(216,181,112,.06)); color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(216,181,112,.25); }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-note { margin-top: 26px; font-family: var(--sans); font-size: 11px; letter-spacing: .16em; color: rgba(201,185,148,.42); }

.home-side { display: flex; flex-direction: column; gap: 14px; }
.feature-card {
  display: flex; gap: 16px; padding: 18px 20px; border: 1px solid rgba(216,181,112,.12);
  background: linear-gradient(100deg, rgba(255,255,255,.035), rgba(255,255,255,0));
  border-left: 2px solid rgba(216,181,112,.35); transition: .25s;
}
.feature-card:hover { border-left-color: var(--gold); transform: translateX(3px); background: linear-gradient(100deg, rgba(255,255,255,.055), rgba(255,255,255,0)); }
.feature-icon {
  flex: 0 0 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid rgba(216,181,112,.28); color: var(--gold); font-size: 22px;
  background: radial-gradient(circle at 35% 25%, rgba(216,181,112,.18), transparent 70%);
  transform: rotate(-3deg);
}
.feature-card h3 { margin: 0 0 4px; font-size: 15px; letter-spacing: .14em; color: var(--parchment); }
.feature-card p { margin: 0; font-family: var(--sans); font-size: 12px; color: rgba(201,185,148,.56); line-height: 1.7; }
.mini-quote { padding: 20px 4px 0; text-align: right; }
.mini-quote span { display: block; color: rgba(232,220,194,.5); font-size: 13px; letter-spacing: .08em; }
.mini-quote em { display: block; margin-top: 6px; font-style: normal; font-family: var(--sans); font-size: 11px; color: var(--gold-dim); }

/* ── 联机大厅 ───────────────────────────────── */
.screen:not(.game-screen) { padding: 96px clamp(18px, 4vw, 54px) 50px; }
.lobby-wrap { width: min(980px, 100%); margin: 0 auto; }
.lobby-head { margin: 28px 0 32px; }
.lobby-head h2, .select-head h2 { font-size: 38px; letter-spacing: .18em; margin: 0 0 8px; font-weight: 500; color: var(--parchment); }
.lobby-head p, .select-head p { margin: 0; font-family: var(--sans); font-size: 13px; color: rgba(201,185,148,.58); }
.lobby-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lobby-grid .panel { padding: 28px; }
.lobby-grid h3 { margin: 0 0 22px; font-size: 18px; letter-spacing: .16em; font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--parchment-dim); padding: 8px 22px; font-family: var(--sans); font-size: 13px; }
.seg button.active { background: rgba(216,181,112,.14); color: var(--gold-2); }
.code-input { letter-spacing: .4em; text-transform: uppercase; font-size: 20px; text-align: center; padding: 14px; }
.lobby-tip { margin-top: 24px; padding: 14px 18px; border: 1px dashed rgba(216,181,112,.18); font-family: var(--sans); font-size: 12px; color: rgba(201,185,148,.5); }
.lobby-tip span { color: var(--gold-dim); margin-right: 8px; letter-spacing: .1em; }

/* ── 房间 ───────────────────────────────── */
.room-wrap { width: min(1180px, 100%); margin: 0 auto; }
.room-top { display: flex; align-items: center; gap: 24px; margin-bottom: 20px; flex-wrap: wrap; }
.room-code-box { display: flex; align-items: baseline; gap: 10px; margin-left: auto; }
.room-code-box span { font-family: var(--sans); font-size: 11px; letter-spacing: .18em; color: var(--gold-dim); }
.room-code-box b { font-family: var(--sans); font-size: 22px; letter-spacing: .28em; color: var(--gold-2); }
.room-status { font-family: var(--sans); font-size: 12px; color: rgba(201,185,148,.55); border-left: 1px solid var(--line); padding-left: 20px; }
.room-mode-badge { font-family: var(--sans); font-size: 11px; letter-spacing: .1em; color: #e7c08e; border: 1px solid rgba(216,181,112,.28); padding: 3px 9px; border-radius: 2px; }
.room-mode-badge.dd { color: #e6a28d; border-color: rgba(214,121,106,.42); background: rgba(182,75,66,.08); }
.room-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; }
.room-main { padding: 26px; min-height: 420px; display: flex; flex-direction: column; }
.room-seats { display: grid; gap: 12px; flex: 1; align-content: center; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.room-seats.seats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.room-seats.seats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.room-seats.seats-8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.room-seats.seats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 760px; width: 100%; margin: 0 auto; }
.room-seats.seats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.room-seats.seats-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.room-seats.seats-7 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.seat-card {
  border: 1px solid rgba(216,181,112,.14); background: rgba(255,255,255,.025);
  min-height: 158px; padding: 15px 14px; border-radius: 4px; display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 8px; position: relative; transition: .2s;
}
.seat-card.empty { border-style: dashed; color: rgba(201,185,148,.28); justify-content: center; }
.seat-card.empty .plus { font-size: 28px; line-height: 1; }
.seat-card.you { border-color: rgba(216,181,112,.48); background: linear-gradient(160deg, rgba(216,181,112,.09), rgba(255,255,255,.015)); }
.seat-card.bot { opacity: .82; }
.seat-avatar {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font-size: 21px; color: #f2e4c4; border: 1px solid rgba(255,255,255,.18);
  background: linear-gradient(145deg, #393025, #1b1712);
}
.seat-name { font-size: 14px; letter-spacing: .06em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-tags { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; min-height: 18px; }
.tag { font-family: var(--sans); font-size: 10px; letter-spacing: .04em; border: 1px solid var(--line); border-radius: 2px; padding: 1px 5px; color: var(--parchment-dim); }
.tag.host { color: var(--gold); border-color: rgba(216,181,112,.4); }
.tag.bot { color: #8fb9a7; border-color: rgba(78,146,112,.35); }
.tag.ready { color: #74c49a; border-color: rgba(78,146,112,.45); }
.tag.wait { color: #b58b6b; }
.tag.role-lord { color: #e5bd6e; border-color: rgba(229,189,110,.5); }
.tag.role-rebel { color: #d6796a; border-color: rgba(214,121,106,.4); }
.tag.role-loyalist { color: #d6a06e; }
.tag.role-renegade { color: #a99ad8; }
.tag.role-landlord { color: #e5bd6e; border-color: rgba(229,189,110,.58); background: rgba(216,181,112,.06); }
.tag.role-farmer { color: #7fc59e; border-color: rgba(78,146,112,.42); }
.seat-general { font-family: var(--sans); font-size: 11px; color: var(--gold-dim); }
.seat-ready { position: absolute; top: 10px; right: 12px; font-family: var(--sans); font-size: 10px; }
.seat-ready.on { color: #6fc397; }
.seat-ready.off { color: rgba(201,185,148,.35); }
.room-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); align-items: center; }
.room-actions .spacer { flex: 1; }
.room-side { padding: 22px; display: flex; flex-direction: column; min-height: 420px; }
.side-title { font-size: 14px; letter-spacing: .18em; color: var(--gold-dim); margin-bottom: 14px; }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; font-family: var(--sans); font-size: 12px; }
.chat-line b { color: var(--gold-dim); font-weight: 500; margin-right: 6px; }
.chat-line span { color: rgba(232,220,194,.72); word-break: break-word; }
.chat-form { display: flex; gap: 8px; margin-top: 14px; }
.chat-form input { padding: 7px 10px; font-size: 12px; }

/* ── 选将 ───────────────────────────────── */
.select-wrap { width: min(1180px, 100%); margin: 0 auto; }
.select-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; }
.select-role { text-align: right; }
.role-chip {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong);
  padding: 8px 16px; border-radius: 3px; font-size: 14px; letter-spacing: .16em;
}
.role-chip small { display: block; font-family: var(--sans); font-size: 10px; color: rgba(201,185,148,.5); letter-spacing: .04em; }
.role-lord { color: #e5bd6e; }
.role-loyalist { color: #d6a06e; }
.role-rebel { color: #d6796a; }
.role-renegade { color: #a99ad8; }
.role-landlord { color: #e5bd6e; }
.role-farmer { color: #7fc59e; }
.select-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.select-grid:has(.general-card:nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.select-grid:has(.general-card:nth-child(5)) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.general-card {
  position: relative; padding: 0; overflow: hidden; cursor: pointer;
  border: 1px solid rgba(216,181,112,.16); border-radius: 5px;
  background: linear-gradient(170deg, rgba(38, 31, 23, .95), rgba(16, 13, 10, .98));
  transition: transform .22s, border-color .22s, box-shadow .22s;
  min-height: 280px; display: flex; flex-direction: column;
}
.general-card:hover { transform: translateY(-4px); border-color: rgba(216,181,112,.48); box-shadow: 0 18px 40px rgba(0,0,0,.4); }
.general-card.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-dim), 0 18px 45px rgba(0,0,0,.45); }
.general-card.selected::after {
  content: "已选"; position: absolute; bottom: 36px; right: 14px; font-family: var(--sans);
  font-size: 10px; letter-spacing: .1em; background: var(--gold); color: #21180c; padding: 2px 7px;
}
.general-card.twin-selected::after { content: none; }
.twin-order { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3; font-family: var(--sans); font-size: 10px; letter-spacing: .12em; color: #17120c; background: var(--gold); padding: 2px 7px; border-radius: 2px; }
.general-top { padding: 18px 18px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.general-kingdom {
  font-size: 11px; letter-spacing: .24em; color: rgba(255,255,255,.75); font-family: var(--sans);
  border: 1px solid rgba(255,255,255,.22); padding: 2px 8px; border-radius: 2px;
}
.general-hp { display: flex; gap: 2px; color: #d5675a; font-size: 13px; }
.general-hp .empty { color: rgba(255,255,255,.14); }
.general-name { font-size: 34px; letter-spacing: .1em; line-height: 1.15; margin: 0 18px; color: #f0e2c5; }
.general-title { margin: 3px 18px 12px; font-family: var(--sans); font-size: 11px; letter-spacing: .14em; color: rgba(201,185,148,.52); }
.general-skills { padding: 0 18px 16px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.skill-block { border-top: 1px solid rgba(216,181,112,.1); padding-top: 8px; }
.skill-block b { font-size: 14px; letter-spacing: .08em; color: var(--gold-2); font-weight: 500; }
.skill-block b .locked { font-family: var(--sans); font-size: 9px; color: rgba(201,185,148,.4); margin-left: 5px; }
.skill-block p { margin: 3px 0 0; font-family: var(--sans); font-size: 11px; line-height: 1.65; color: rgba(201,185,148,.62); }
.select-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.select-status { font-family: var(--sans); font-size: 12px; color: rgba(201,185,148,.55); }
.select-actions { display: flex; gap: 12px; }

/* ── 游戏框架 ───────────────────────────────── */
.game-screen { overflow: hidden; }
.game-screen.active { display: block; }
.game-shell { height: 100%; display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% 42%, #1a2119 0%, #0d0d0a 58%, #080706 100%); }
.game-top {
  flex: 0 0 52px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 14px; padding: 0 18px; border-bottom: 1px solid rgba(216,181,112,.14);
  background: linear-gradient(180deg, rgba(18,15,11,.96), rgba(12,10,8,.92));
  font-family: var(--sans); z-index: 5;
}
.game-top-left, .game-top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.game-top-right { justify-content: flex-end; }
.mini-seal { width: 26px; height: 26px; font-size: 15px; border-radius: 4px; }
.room-tag { font-size: 11px; letter-spacing: .12em; color: var(--gold-dim); }
.mode-tag { font-family: var(--sans); font-size: 10px; letter-spacing: .06em; color: #e0a08b; border: 1px solid rgba(214,121,106,.3); border-radius: 2px; padding: 2px 6px; }
.deck-tag { font-size: 11px; color: rgba(201,185,148,.5); border-left: 1px solid var(--line); padding-left: 10px; }
.deck-tag b { color: var(--parchment-dim); font-weight: 500; }
.game-top-center { display: flex; align-items: center; gap: 10px; justify-content: center; white-space: nowrap; }
.round-tag, .phase-tag, .turn-tag { font-size: 11px; letter-spacing: .08em; padding: 4px 9px; border: 1px solid rgba(216,181,112,.16); border-radius: 2px; }
.phase-tag { color: var(--gold-2); border-color: rgba(216,181,112,.35); background: rgba(216,181,112,.07); }
.turn-tag { color: rgba(232,220,194,.75); }
.game-body { flex: 1; min-height: 0; display: flex; }
.table-zone { flex: 1; min-width: 0; position: relative; overflow: hidden; }
.table-oval {
  position: absolute; left: 9%; right: 9%; top: 8%; bottom: 13%;
  border-radius: 50%; border: 1px solid rgba(216,181,112,.22);
  background:
    radial-gradient(ellipse at 50% 42%, rgba(61, 83, 56, .55), rgba(24, 38, 27, .72) 48%, rgba(13, 17, 12, .9) 80%),
    repeating-linear-gradient(35deg, rgba(255,255,255,.018) 0 2px, transparent 2px 6px);
  box-shadow: inset 0 0 100px rgba(0,0,0,.65), 0 0 0 8px rgba(216,181,112,.025), 0 0 0 9px rgba(216,181,112,.08), 0 30px 70px rgba(0,0,0,.55);
}
.table-oval::after {
  content: ""; position: absolute; inset: 14px; border-radius: 50%;
  border: 1px dashed rgba(216,181,112,.12);
}
.table-center {
  position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: clamp(30px, 4vw, 62px); z-index: 2;
}
.pile { width: 66px; height: 92px; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative; }
.deck-pile {
  background: linear-gradient(145deg, #3b3325, #1d1913); border: 1px solid rgba(216,181,112,.32);
  box-shadow: 4px 4px 0 rgba(0,0,0,.35), 8px 8px 0 rgba(20,16,11,.6), 0 14px 24px rgba(0,0,0,.35);
}
.deck-pile .pile-mark { font-size: 26px; color: rgba(216,181,112,.55); }
.discard-pile { background: rgba(0,0,0,.22); border: 1px dashed rgba(216,181,112,.18); }
.discard-pile .pile-mark { font-size: 20px; color: rgba(216,181,112,.28); }
.pile b { font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--parchment-dim); }
.pile small { font-family: var(--sans); font-size: 9px; color: rgba(201,185,148,.4); letter-spacing: .1em; }
.table-center-info { text-align: center; min-width: 150px; }
.center-phase { font-size: 11px; letter-spacing: .3em; color: var(--gold-dim); }
.center-turn { font-size: 21px; letter-spacing: .14em; color: var(--gold-2); margin: 3px 0; text-shadow: 0 0 24px rgba(216,181,112,.2); }
.center-tip { font-family: var(--sans); font-size: 10px; color: rgba(201,185,148,.42); max-width: 230px; margin: 0 auto; }
.played-card-slot { position: absolute; left: 50%; top: 14%; transform: translate(-50%, 0); z-index: 20; pointer-events: none; }
.players-top-node .played-card-slot { left: 62%; top: 31%; }
.players-6 .played-card-slot { display: none; }
.played-card-slot .card { animation: cardDrop .35s ease-out; box-shadow: 0 20px 50px rgba(0,0,0,.6); }
@keyframes cardDrop { from { transform: translateY(-26px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }

.opponents { position: absolute; inset: 0; z-index: 3; }
.self-node-wrap { position: absolute; left: 50%; top: 87%; transform: translate(-50%, -50%); z-index: 4; }
.self-node-wrap .player-node { width: 238px; position: relative; }
.self-node-wrap .player-node.targetable:hover { transform: none; }
.self-node-wrap .player-node .node-equips { flex-wrap: nowrap; overflow: hidden; }

/* ── 玩家节点 ───────────────────────────────── */
.player-node {
  position: absolute; width: 178px; padding: 9px 10px 8px; border-radius: 5px;
  background: linear-gradient(155deg, rgba(34, 29, 22, .94), rgba(14, 12, 9, .96));
  border: 1px solid rgba(216,181,112,.18); box-shadow: 0 12px 28px rgba(0,0,0,.42);
  transition: border-color .2s, box-shadow .2s, transform .2s; cursor: default;
  font-family: var(--sans);
}
.player-node.pos { position: absolute; transform: translate(-50%, -50%); }
.player-node:hover { border-color: rgba(216,181,112,.35); }
.players-8 .player-node { width: 150px; }
.players-8 .node-equips { display: none; }
.players-8 .played-card-slot, .players-8 .center-card-reveal { display: none; }
.player-node.current { border-color: rgba(240, 212, 149, .65); box-shadow: 0 0 0 1px rgba(216,181,112,.25), 0 0 30px rgba(216,181,112,.12), 0 12px 28px rgba(0,0,0,.42); }
.player-node.current::before {
  content: ""; position: absolute; inset: -1px; border-radius: 5px; pointer-events: none;
  border: 1px solid rgba(240,212,149,.5); animation: currentPulse 1.8s ease-in-out infinite;
}
@keyframes currentPulse { 0%,100% { opacity: .25; } 50% { opacity: .8; } }
.player-node.dead { filter: grayscale(1); opacity: .45; }
.player-node.targetable { cursor: pointer; border-color: rgba(224, 106, 92, .7); box-shadow: 0 0 0 1px rgba(224,106,92,.35), 0 0 30px rgba(190,70,60,.18); }
.player-node.targetable:hover { transform: translate(-50%, -50%) scale(1.02); }
.player-node.target-selected { border-color: #f08976; box-shadow: 0 0 0 2px rgba(224,106,92,.7), 0 0 34px rgba(190,70,60,.28); }
.player-node.target-selected::after {
  content: "目标"; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  background: #a94238; color: #ffe4d2; font-size: 9px; padding: 1px 6px; border-radius: 2px; letter-spacing: .1em;
}
.node-head { display: flex; align-items: center; gap: 8px; }
.node-avatar {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-size: 20px; color: #f2e5c7;
  border: 1px solid rgba(255,255,255,.16); position: relative;
}
.node-avatar .kingdom-mark {
  position: absolute; right: -4px; bottom: -3px; width: 15px; height: 15px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--sans); font-size: 8px;
  background: #1b1712; border: 1px solid rgba(216,181,112,.3); color: var(--gold);
}
.node-id { min-width: 0; flex: 1; }
.node-name { font-size: 12px; color: var(--parchment); letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-general { font-size: 10px; color: rgba(201,185,148,.48); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-general.twin-name { color: #e7c08e; letter-spacing: .02em; }
.twin-tag { margin-left: 5px; font-size: 8px; border: 1px solid rgba(216,181,112,.4); padding: 1px 3px; border-radius: 2px; color: #e7c08e; }
.judge-chip.chain { color: #9ec7e8; border-color: rgba(110,160,200,.5); }
.judge-chip.tian { color: #d8c08a; border-color: rgba(216,181,112,.5); }
.node-role {
  position: absolute; top: -8px; left: 8px; font-size: 9px; letter-spacing: .1em; padding: 1px 5px;
  border-radius: 2px; background: #17130e; border: 1px solid var(--line);
}
.role-badge-lord { color: #e5bd6e; border-color: rgba(229,189,110,.5); }
.role-badge-rebel { color: #d6796a; border-color: rgba(214,121,106,.4); }
.role-badge-loyalist { color: #d6a06e; }
.role-badge-renegade { color: #a99ad8; }
.role-badge-landlord { color: #e5bd6e; border-color: rgba(229,189,110,.58); }
.role-badge-farmer { color: #7fc59e; border-color: rgba(78,146,112,.42); }
.role-badge-hidden { color: rgba(201,185,148,.36); }
.node-hp { display: flex; align-items: center; gap: 3px; margin-top: 5px; }
.hp-pips { display: flex; gap: 1px; font-size: 10px; color: #d4685b; letter-spacing: 0; }
.hp-pips i { font-style: normal; line-height: 1; }
.hp-pips .empty { color: rgba(255,255,255,.12); }
.hp-num { font-size: 10px; color: rgba(232,220,194,.55); margin-left: 3px; }
.node-meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; font-size: 9px; color: rgba(201,185,148,.5); }
.node-meta .hand-chip { color: rgba(232,220,194,.72); }
.node-meta .distance-chip { color: rgba(224,169,110,.6); }
.node-equips { display: flex; gap: 3px; margin-top: 4px; min-height: 15px; flex-wrap: wrap; }
.equip-chip { font-size: 8px; padding: 1px 4px; border-radius: 2px; border: 1px solid rgba(216,181,112,.16); color: rgba(216,181,112,.75); max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.equip-chip.weapon { color: #d9a97d; }
.equip-chip.armor { color: #8db5c9; }
.equip-chip.horse { color: #9ec28d; }
.node-judge { display: flex; gap: 3px; margin-top: 3px; min-height: 14px; }
.judge-chip { font-size: 8px; padding: 0 4px; border-radius: 2px; background: rgba(93, 78, 151, .2); border: 1px solid rgba(151, 131, 214, .3); color: #b9a8eb; }
.judge-chip.lightning { background: rgba(126, 99, 42, .22); border-color: rgba(216,181,112,.35); color: #e2c27e; }
.node-bot-tag { position: absolute; bottom: 6px; right: 8px; font-size: 8px; color: rgba(140, 190, 165, .55); letter-spacing: .08em; }
.node-connect { position: absolute; top: 9px; right: 9px; width: 5px; height: 5px; border-radius: 50%; background: #62b78a; }
.node-connect.off { background: #8a5a4d; }
.player-node .role-hidden { color: rgba(201,185,148,.3); }

/* ── 战斗日志 ───────────────────────────────── */
.log-panel {
  width: 300px; flex: 0 0 300px; border-left: 1px solid rgba(216,181,112,.14);
  background: linear-gradient(180deg, rgba(17,14,10,.93), rgba(10,8,6,.96));
  display: flex; flex-direction: column; min-height: 0;
}
.panel-tabs { display: flex; border-bottom: 1px solid rgba(216,181,112,.12); }
.panel-tab { flex: 1; border: 0; background: none; color: rgba(201,185,148,.45); font-family: var(--sans); font-size: 11px; letter-spacing: .16em; padding: 12px 0; border-bottom: 1px solid transparent; }
.panel-tab.active { color: var(--gold-2); border-bottom-color: var(--gold); background: rgba(216,181,112,.04); }
.log-list { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; font-family: var(--sans); font-size: 11px; line-height: 1.55; }
.log-line { color: rgba(201,185,148,.6); padding-left: 8px; border-left: 2px solid transparent; word-break: break-word; }
.log-line.damage { color: #d68b7b; border-left-color: rgba(214,121,106,.4); }
.log-line.heal { color: #82c7a4; border-left-color: rgba(78,146,112,.4); }
.log-line.skill { color: #d8b570; border-left-color: rgba(216,181,112,.4); }
.log-line.judge { color: #b2a4d8; border-left-color: rgba(151,131,214,.4); }
.log-line.turn { color: #e7d4a8; border-left-color: rgba(216,181,112,.55); margin-top: 5px; font-size: 10px; letter-spacing: .06em; }
.log-line.system { color: #9d8f75; }
.log-line.death { color: #dc7566; border-left-color: rgba(214,90,75,.5); }
.log-line.reveal { color: #b8c9a5; }
.log-line.play { color: rgba(232,220,194,.76); }
.log-line.equip { color: #9db7a7; }
.chat-list { padding: 12px 14px; }
.game-chat-list { flex: 1; overflow-y: auto; }
.chat-line { font-family: var(--sans); }

/* ── 手牌区 ───────────────────────────────── */
.hand-zone {
  flex: 0 0 auto; min-height: 250px; max-height: 45vh;
  border-top: 1px solid rgba(216,181,112,.2);
  background:
    linear-gradient(180deg, rgba(22,18,13,.98), rgba(11,9,7,.99)),
    repeating-linear-gradient(90deg, transparent 0 40px, rgba(216,181,112,.02) 40px 41px);
  box-shadow: 0 -18px 40px rgba(0,0,0,.32);
  display: flex; flex-direction: column; padding: 0 18px 10px; position: relative; z-index: 10;
  overflow-y: auto;
}
.prompt-bar {
  flex: 0 0 auto; min-height: 62px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px 0 8px; border-bottom: 1px solid rgba(216,181,112,.09);
}
.prompt-main { min-width: 0; }
.prompt-title { font-size: 14px; letter-spacing: .14em; color: var(--gold-2); margin-bottom: 1px; }
.prompt-message { font-family: var(--sans); font-size: 11px; color: rgba(201,185,148,.58); }
.prompt-options { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; max-height: 84px; overflow-y: auto; }
.prompt-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto; }
.action-btn {
  border: 1px solid var(--line-strong); background: rgba(255,255,255,.03); color: var(--parchment);
  padding: 8px 15px; border-radius: 3px; font-family: var(--sans); font-size: 12px; letter-spacing: .06em;
  transition: .2s; white-space: nowrap;
}
.action-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-2); background: rgba(216,181,112,.08); }
.action-btn.primary { background: linear-gradient(160deg, #e8c883, #b98f4f); color: #21160a; border-color: #efd69b; font-weight: 700; }
.action-btn.primary:hover:not(:disabled) { filter: brightness(1.06); color: #21160a; }
.action-btn.danger { color: #d8897c; border-color: rgba(214,100,86,.3); }
.action-btn:disabled { opacity: .35; cursor: not-allowed; }
.option-btn { border: 1px solid rgba(216,181,112,.2); background: rgba(0,0,0,.24); color: var(--parchment); padding: 7px 12px; border-radius: 3px; font-family: var(--sans); font-size: 12px; text-align: left; max-width: 260px; }
.option-btn:hover { border-color: var(--gold); background: rgba(216,181,112,.08); }
.option-btn small { display: block; font-size: 10px; color: rgba(201,185,148,.45); }
.skill-bar { display: flex; gap: 7px; flex-wrap: wrap; padding: 6px 0 2px; min-height: 27px; }
.skill-btn {
  border: 1px solid rgba(216,181,112,.3); background: linear-gradient(160deg, rgba(216,181,112,.12), rgba(216,181,112,.02));
  color: var(--gold-2); border-radius: 3px; padding: 4px 11px; font-family: var(--sans); font-size: 11px;
  letter-spacing: .08em; transition: .2s;
}
.skill-btn:hover { background: rgba(216,181,112,.17); border-color: var(--gold); }
.skill-btn.active { background: var(--gold); color: #251a0d; border-color: var(--gold-2); }
.skill-btn small { margin-left: 4px; opacity: .55; font-size: 9px; }
.hand-row { flex: 1; display: flex; align-items: flex-end; gap: 10px; min-height: 0; padding-top: 6px; }
.hand-info { flex: 0 0 auto; display: flex; flex-direction: column; gap: 3px; padding-bottom: 10px; min-width: 68px; }
.hand-count, .hand-limit { font-family: var(--sans); font-size: 10px; color: rgba(201,185,148,.5); white-space: nowrap; }
.hand-count { color: var(--parchment-dim); }
.hand-tools { flex: 0 0 auto; padding-bottom: 10px; }
.hand-cards {
  flex: 1; min-width: 0; display: flex; justify-content: center; align-items: flex-end;
  padding: 20px 4px 4px; min-height: 142px; overflow: visible;
}
.hand-cards .card { margin-left: var(--card-overlap, -24px); }
/* ── 卡牌 ───────────────────────────────── */
.card {
  position: relative; flex: 0 0 auto; width: 92px; height: 132px; margin-left: -24px;
  border-radius: 6px; cursor: pointer; user-select: none;
  background:
    linear-gradient(160deg, rgba(255,255,255,.9), rgba(232,220,194,.96) 42%, rgba(202,186,154,.95)),
    repeating-linear-gradient(45deg, rgba(90,70,40,.06) 0 1px, transparent 1px 5px);
  color: #2b2115; border: 1px solid #8f7a54;
  box-shadow: 0 8px 18px rgba(0,0,0,.45), inset 0 0 0 3px rgba(255,255,255,.24), inset 0 0 0 4px rgba(100,80,45,.2);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s;
  overflow: hidden;
}
.card:first-child { margin-left: 0; }
.card::before {
  content: ""; position: absolute; inset: 5px; border: 1px solid rgba(80,60,30,.18); border-radius: 3px; pointer-events: none;
}
.card:hover { transform: translateY(-12px); z-index: 30; box-shadow: 0 16px 32px rgba(0,0,0,.55); }
.card.selected { transform: translateY(-20px); z-index: 35; box-shadow: 0 0 0 2px #d8b570, 0 20px 40px rgba(0,0,0,.6); }
.card.unplayable { filter: brightness(.82) saturate(.8); opacity: .92; }
.card.unselectable { cursor: not-allowed; filter: brightness(.66) saturate(.65); opacity: .78; }
.card.playable::after {
  content: ""; position: absolute; inset: 0; border: 2px solid rgba(216,181,112,.85); border-radius: 5px;
  box-shadow: inset 0 0 16px rgba(216,181,112,.2); pointer-events: none;
}
.card-corner { position: absolute; top: 6px; left: 7px; line-height: 1; font-family: var(--sans); font-size: 12px; font-weight: 700; }
.card-corner.right { left: auto; right: 7px; top: auto; bottom: 6px; transform: rotate(180deg); }
.card-suit { display: block; font-size: 14px; }
.card-rank { display: block; font-size: 11px; letter-spacing: -.02em; }
.card.red { color: #a73c33; }
.card.black { color: #29241d; }
.card-name {
  position: absolute; top: 38px; left: 50%; transform: translateX(-50%);
  font-family: var(--serif); font-size: 23px; letter-spacing: .04em; white-space: nowrap;
  font-weight: 700; text-shadow: 0 1px 0 rgba(255,255,255,.3);
}
.card-name.long { font-size: 15px; letter-spacing: 0; }
.card-type {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  font-family: var(--sans); font-size: 9px; letter-spacing: .18em; color: rgba(60,45,25,.55); white-space: nowrap;
}
.card-seal {
  position: absolute; top: 48%; left: 50%; transform: translate(-50%, -50%) rotate(-12deg);
  font-family: var(--serif); font-size: 44px; color: rgba(120, 75, 50, .08); pointer-events: none;
}
.card-conv {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  background: rgba(90, 55, 32, .88); color: #f5e6c8; font-family: var(--sans); font-size: 8px;
  padding: 1px 6px; border-radius: 8px; white-space: nowrap; letter-spacing: .04em;
}
.card-tooltip {
  position: fixed; z-index: 200; max-width: 280px; background: rgba(16,13,9,.97);
  border: 1px solid rgba(216,181,112,.35); border-radius: 4px; padding: 10px 12px;
  font-family: var(--sans); font-size: 11px; color: rgba(232,220,194,.78); line-height: 1.6;
  box-shadow: 0 16px 40px rgba(0,0,0,.6); pointer-events: none;
}
.card-tooltip b { color: var(--gold-2); display: block; font-family: var(--serif); font-size: 14px; margin-bottom: 3px; }

/* ── 弹窗 ───────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(4,3,2,.72); backdrop-filter: blur(7px); padding: 20px; animation: fadeIn .2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(920px, 94vw); max-height: 88vh; overflow-y: auto; position: relative;
  background: linear-gradient(160deg, #201a13, #0e0b08 72%);
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 30px;
  box-shadow: 0 30px 90px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.04);
  animation: modalIn .24s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: 14px; right: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.2);
  width: 30px; height: 30px; border-radius: 50%; color: var(--parchment-dim); font-size: 16px;
}
.modal-close:hover { color: var(--gold-2); border-color: var(--gold); }
.modal .node-avatar { flex: 0 0 auto; }
.modal h2 { margin: 0 0 6px; font-size: 28px; letter-spacing: .16em; font-weight: 500; }
.modal .modal-sub { font-family: var(--sans); font-size: 12px; color: rgba(201,185,148,.5); margin-bottom: 22px; }
.compendium-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-btn { border: 1px solid var(--line); background: transparent; color: var(--parchment-dim); padding: 4px 12px; border-radius: 2px; font-family: var(--sans); font-size: 11px; }
.filter-btn.active { color: var(--gold-2); border-color: var(--gold-dim); background: rgba(216,181,112,.08); }
.compendium-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.comp-card { border: 1px solid rgba(216,181,112,.14); padding: 12px 14px; border-radius: 4px; background: rgba(255,255,255,.02); cursor: pointer; transition: .2s; }
.comp-card:hover { border-color: rgba(216,181,112,.4); background: rgba(216,181,112,.04); }
.comp-head { display: flex; align-items: baseline; gap: 8px; }
.comp-name { font-size: 20px; letter-spacing: .08em; color: var(--gold-2); }
.comp-meta { font-family: var(--sans); font-size: 10px; color: rgba(201,185,148,.45); }
.comp-skills { margin: 6px 0 0; font-family: var(--sans); font-size: 10px; color: rgba(201,185,148,.55); }
.rules-body { font-family: var(--sans); font-size: 13px; color: rgba(232,220,194,.72); line-height: 1.85; }
.rules-body h3 { font-family: var(--serif); font-size: 18px; letter-spacing: .1em; color: var(--gold-2); margin: 24px 0 8px; font-weight: 500; }
.rules-body h3:first-child { margin-top: 0; }
.rules-body ul { margin: 6px 0; padding-left: 20px; }
.rules-body li { margin: 4px 0; }
.rules-body b { color: var(--parchment); font-weight: 500; }
.rules-body .rule-note { border-left: 2px solid var(--gold-dim); background: rgba(216,181,112,.05); padding: 10px 14px; margin: 14px 0; color: rgba(201,185,148,.6); font-size: 12px; }
.arrange-grid { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0; justify-content: center; }
.arrange-card { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.arrange-card .card { margin-left: 0; cursor: pointer; }
.arrange-card.bottom .card { opacity: .55; filter: grayscale(.5); }
.arrange-card .arrange-toggle { font-family: var(--sans); font-size: 10px; padding: 3px 8px; border: 1px solid var(--line); background: transparent; color: var(--parchment-dim); border-radius: 2px; }
.arrange-card.bottom .arrange-toggle { color: var(--gold-2); border-color: var(--gold-dim); }
.arrange-legend { font-family: var(--sans); font-size: 11px; color: rgba(201,185,148,.5); text-align: center; margin-bottom: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ── 结算 ───────────────────────────────── */
.gameover-backdrop { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(ellipse at center, rgba(18,14,9,.72), rgba(3,2,1,.94)); backdrop-filter: blur(8px); animation: fadeIn .3s; }
.gameover-panel { width: min(760px, 94vw); text-align: center; padding: 36px 34px 30px; position: relative; background: linear-gradient(160deg, #241d14, #0e0b08); border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: 0 30px 100px rgba(0,0,0,.75); }
.gameover-kicker { font-family: var(--sans); font-size: 11px; letter-spacing: .4em; color: var(--gold-dim); }
.gameover-title { font-size: clamp(42px, 7vw, 66px); letter-spacing: .14em; margin: 8px 0 4px; background: linear-gradient(180deg, #f6e3b8, #c79b52); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gameover-sub { font-family: var(--sans); font-size: 12px; color: rgba(201,185,148,.55); margin-bottom: 24px; }
.gameover-roles { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 20px 0 26px; }
.gameover-role { border: 1px solid var(--line); border-radius: 3px; padding: 8px 13px; font-family: var(--sans); font-size: 11px; text-align: left; min-width: 108px; }
.gameover-role b { display: block; color: var(--parchment); font-family: var(--serif); font-size: 15px; letter-spacing: .06em; }
.gameover-role span { color: rgba(201,185,148,.5); }
.gameover-role.win { border-color: rgba(216,181,112,.5); background: rgba(216,181,112,.06); }
.gameover-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ── Toast / 特效 ───────────────────────────────── */
.toast-root { position: fixed; top: 78px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  min-width: 180px; max-width: 360px; padding: 10px 15px; border-radius: 3px;
  background: rgba(20,16,11,.96); border: 1px solid var(--line-strong); color: var(--parchment);
  font-family: var(--sans); font-size: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.55);
  animation: toastIn .24s ease-out, toastOut .3s 2.8s forwards; border-left: 3px solid var(--gold);
}
.toast.success { border-left-color: #5aa87f; }
.toast.warn { border-left-color: #c4904e; }
.toast.error { border-left-color: #b64b42; color: #f0c5bd; }
.toast.damage { border-left-color: #c75a4b; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }
.effect-float {
  position: fixed; z-index: 150; pointer-events: none; font-family: var(--sans); font-weight: 700;
  font-size: 24px; color: #e06a5c; text-shadow: 0 2px 12px rgba(0,0,0,.8);
  animation: floatUp .9s ease-out forwards;
}
.effect-float.heal { color: #72ca9a; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 0) scale(.8); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -52px) scale(1.15); } }
.shake { animation: shake .4s; }
@keyframes shake { 0%,100% { transform: translate(-50%, -50%) translateX(0); } 20% { transform: translate(-50%, -50%) translateX(-5px); } 40% { transform: translate(-50%, -50%) translateX(5px); } 60% { transform: translate(-50%, -50%) translateX(-3px); } 80% { transform: translate(-50%, -50%) translateX(3px); } }
.center-flash { position: fixed; inset: 0; z-index: 140; pointer-events: none; background: radial-gradient(circle at 45% 42%, rgba(190,60,45,.26), transparent 45%); animation: flash .5s forwards; }
@keyframes flash { to { opacity: 0; } }
.center-card-reveal { position: fixed; left: 55%; top: 30%; transform: translate(-50%, 0); z-index: 160; pointer-events: none; }
.center-card-reveal .card { margin: 0; animation: cardDrop .3s; box-shadow: 0 30px 80px rgba(0,0,0,.7); }
.center-card-reveal .label { text-align: center; font-family: var(--sans); font-size: 11px; color: var(--gold-2); margin-top: 8px; letter-spacing: .1em; }

/* ── 响应式 ───────────────────────────────── */
@media (max-width: 1180px) {
  .home-wrap { grid-template-columns: 1fr; gap: 40px; }
  .home-side { display: grid; grid-template-columns: repeat(3, 1fr); }
  .mini-quote { grid-column: 1 / -1; text-align: left; padding-top: 4px; }
  .select-grid, .select-grid:has(.general-card:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .select-grid:has(.general-card:nth-child(5)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .room-seats.seats-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .room-seats.seats-8 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .room-seats.seats-4, .room-seats.seats-6, .room-seats.seats-7 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .log-panel { width: 260px; flex-basis: 260px; }
  .player-node { width: 156px; padding: 8px; }
  .self-node-wrap .player-node { width: 210px; }
}
@media (max-width: 980px) {
  .game-top { grid-template-columns: auto 1fr auto; padding: 0 10px; }
  .game-top-left .deck-tag, .game-top-right .mini-btn[data-action="rules"] { display: none; }
  .log-panel { width: 230px; flex-basis: 230px; }
  .player-node { width: 140px; }
  .node-equips { display: none; }
  .card { width: 82px; height: 118px; margin-left: -28px; }
  .card-name { font-size: 19px; top: 34px; }
  .card-name.long { font-size: 13px; }
  .hand-zone { flex-basis: 238px; }
  .prompt-bar { min-height: 56px; }
}
@media (max-width: 820px) {
  .site-head { height: 58px; padding: 0 14px; }
  .site-nav { gap: 12px; }
  .brand-text em { display: none; }
  .home-wrap { padding-top: 88px; }
  .title-main { font-size: 64px; }
  .home-side { grid-template-columns: 1fr; }
  .lobby-grid { grid-template-columns: 1fr; }
  .room-layout { grid-template-columns: 1fr; }
  .room-side { min-height: 280px; }
  .room-seats.seats-5, .room-seats.seats-8 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-body { flex-direction: column; }
  .log-panel { width: 100%; flex: 0 0 125px; border-left: 0; border-top: 1px solid var(--line); }
  .panel-tabs { display: none; }
  .log-list { padding: 8px 12px; font-size: 10px; }
  .game-chat-list, #game-chat-form { display: none !important; }
  .table-zone { min-height: 0; flex: 1; }
  .table-oval { left: 3%; right: 3%; top: 4%; bottom: 8%; }
  .player-node { width: 118px; padding: 6px; }
  .players-8 .player-node { width: 118px; }
  .node-avatar { width: 30px; height: 30px; flex-basis: 30px; font-size: 16px; }
  .node-name { font-size: 10px; }
  .node-general { font-size: 9px; }
  .node-hp { margin-top: 3px; }
  .hp-pips { font-size: 8px; }
  .node-meta { font-size: 8px; gap: 5px; }
  .node-role { font-size: 8px; }
  .node-judge { display: none; }
  .self-node-wrap .player-node { width: 160px; }
  .played-card-slot, .center-card-reveal { display: none; }
  .table-center { gap: 20px; }
  .pile { width: 50px; height: 70px; }
  .center-turn { font-size: 16px; }
  .center-tip { display: none; }
  .hand-zone { flex: 0 0 236px; padding: 0 8px 6px; }
  .hand-info { min-width: 48px; }
  .hand-tools { display: none; }
  .card { width: 68px; height: 98px; margin-left: -26px; border-radius: 5px; }
  .card-name { font-size: 16px; top: 29px; }
  .card-name.long { font-size: 11px; }
  .card-corner { font-size: 10px; }
  .card-suit { font-size: 11px; }
  .card-rank { font-size: 9px; }
  .card-type { font-size: 7px; bottom: 12px; }
  .card-conv { font-size: 7px; bottom: 2px; }
  .prompt-title { font-size: 12px; }
  .prompt-message { font-size: 10px; }
  .action-btn { padding: 6px 10px; font-size: 11px; }
  .select-head { flex-direction: column; align-items: flex-start; }
  .select-role { text-align: left; }
  .select-footer { flex-direction: column; align-items: stretch; }
  .select-actions { justify-content: flex-end; }
}
@media (max-width: 560px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn-hero { width: 100%; min-width: 0; }
  .select-grid, .select-grid:has(.general-card:nth-child(4)) { grid-template-columns: 1fr; }
  .select-grid:has(.general-card:nth-child(5)) { grid-template-columns: 1fr; }
  .general-card { min-height: 240px; }
  .room-code-box { margin-left: 0; }
  .room-status { border-left: 0; padding-left: 0; }
  .game-top { height: 54px; grid-template-columns: auto 1fr auto; gap: 5px; padding: 0 7px; white-space: nowrap; }
  .game-top-left { gap: 4px; }
  .game-top-left .room-tag, .game-top-left .deck-tag { display: none; }
  .game-top-center { gap: 4px; min-width: 0; overflow: hidden; }
  .game-top-center .round-tag { display: none; }
  .game-top-center .phase-tag { padding: 3px 6px; font-size: 10px; flex: 0 0 auto; }
  .game-top-center .turn-tag { padding: 3px 6px; font-size: 10px; overflow: hidden; text-overflow: ellipsis; max-width: 118px; }
  .game-top-right { gap: 4px; }
  .game-top-right .mini-btn[data-action="my-general"],
  .game-top-right .mini-btn[data-action="rules"],
  .game-top-right #btn-sound { display: none; }
  .game-top-right .mini-btn { padding: 4px 7px; font-size: 10px; }
  .self-node-wrap .player-node { width: 158px; }
  .self-node-wrap { top: 84%; }
  .player-node { width: 102px; }
  .players-8 .player-node { width: 80px; padding: 4px; }
  .players-8 .node-avatar { width: 22px; height: 22px; flex-basis: 22px; font-size: 11px; }
  .players-8 .node-name { font-size: 9px; }
  .players-8 .node-general, .players-8 .node-equips, .players-8 .node-judge { display: none; }
  .players-8 .node-general.twin-name { display: block; font-size: 8px; max-width: 120px; }
  .players-8 .node-general.twin-name .twin-tag { display: none; }
  .players-8 .node-meta { font-size: 7px; gap: 3px; }
  .players-8 .node-role { font-size: 7px; }
  .players-8 .node-hp { margin-top: 1px; }
  .players-8 .hp-pips { font-size: 7px; }
  .node-avatar { width: 25px; height: 25px; flex-basis: 25px; font-size: 13px; }
  .node-general { display: none; }
  .node-hp .hp-num { display: none; }
  .node-meta .distance-chip { display: none; }
  .table-center-info { min-width: 90px; }
  .table-center { gap: 10px; }
  .pile { width: 42px; height: 58px; }
  .card { width: 58px; height: 84px; margin-left: -30px; }
  .card-name { font-size: 14px; top: 26px; }
  .card-name.long { font-size: 10px; }
  .card-type { display: none; }
  .hand-zone { flex-basis: 218px; }
  .prompt-bar { gap: 8px; }
  .prompt-actions { gap: 5px; }
  .action-btn { padding: 5px 8px; }
  .modal { padding: 22px 16px; }
}

/* ============================================================
   v3 卡牌插画 / 出牌动画 / 卡牌说明
   ============================================================ */
.card-art {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; z-index: 0; pointer-events: none; border-radius: inherit;
}
.card .card-seal { z-index: 1; opacity: .55; }
.card .card-corner, .card .card-name, .card .card-type, .card .card-conv { z-index: 2; }
.card::before { z-index: 3; }
.card.playable::after { z-index: 3; }
.card-name { text-shadow: 0 0 7px rgba(247,238,217,.96), 0 0 14px rgba(247,238,217,.75); }
.card-type { text-shadow: 0 0 6px rgba(247,238,217,.9); }
.card-corner { text-shadow: 0 0 6px rgba(247,238,217,.9); }

/* 发牌动画 */
.hand-cards.deal .card { animation: dealIn .3s backwards; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes dealIn {
  from { opacity: 0; transform: translateY(18px) scale(.93); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 卡牌说明浮层 */
.card-tooltip {
  max-width: min(330px, 92vw); padding: 10px 11px; border-radius: 6px;
  background: rgba(14,10,7,.97); border: 1px solid rgba(216,181,112,.4);
  box-shadow: 0 18px 44px rgba(0,0,0,.7); z-index: 210;
}
.card-tooltip .tt-top { display: flex; gap: 9px; align-items: stretch; }
.card-tooltip .tt-art {
  position: relative; flex: 0 0 46px; width: 46px; height: 66px;
  border-radius: 4px; overflow: hidden; border: 1px solid rgba(216,181,112,.35);
}
.card-tooltip .tt-head { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.card-tooltip .tt-head b {
  display: block; margin: 0; font-size: 13px; color: #f0d59b;
}
.card-tooltip .tt-head span { font-size: 9px; color: rgba(201,185,148,.7); }
.card-tooltip .tt-head .tt-use { color: #d8b570; margin-top: 2px; }
.card-tooltip .tt-desc { margin: 8px 0 0; font-size: 10.5px; line-height: 1.7; color: rgba(232,220,194,.82); }
.card-tooltip .tt-hint { margin-top: 6px; font-size: 8.5px; color: rgba(201,185,148,.45); }
.card-tooltip.pinned {
  position: fixed; animation: tipIn .16s ease-out;
  max-height: 46vh; overflow: hidden;
}
@keyframes tipIn { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 出牌飞行动画 */
.play-fx { position: fixed; inset: 0; z-index: 185; pointer-events: none; overflow: hidden; }
.play-fx-stage {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.play-fx-card { position: relative; filter: drop-shadow(0 22px 38px rgba(0,0,0,.7)); }
.play-fx-card .card { width: 100px; height: 144px; margin: 0; cursor: default; }
.play-fx-card .card:hover { transform: none; }
.play-fx-banner {
  display: flex; align-items: baseline; gap: 6px; padding: 6px 15px; border-radius: 999px;
  background: rgba(12,8,5,.9); border: 1px solid rgba(216,181,112,.55);
  color: #f2e3c4; font-size: 12px; white-space: nowrap;
  box-shadow: 0 10px 26px rgba(0,0,0,.55);
}
.play-fx-banner b { color: #efc982; font-weight: 600; }
.play-fx-banner em { font-style: normal; color: #fff; font-size: 13px; letter-spacing: .03em; }
.play-fx-banner i { font-style: normal; color: #c9b48a; font-size: 10px; }
.play-fx-banner .fx-tag {
  font-size: 9px; padding: 1px 5px; border-radius: 3px;
  background: rgba(216,181,112,.16); color: #e8c078;
}
.play-fx-flash {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 42%, rgba(255,215,140,.34), transparent 52%);
  animation: playFlash .6s ease-out forwards;
}
@keyframes playFlash { from { opacity: .95; transform: scale(.7); } to { opacity: 0; transform: scale(1.2); } }
.play-fx.text-only .play-fx-stage { top: 38%; }
.play-text-banner {
  padding: 10px 18px; border-radius: 8px; background: rgba(12,8,5,.92);
  border: 1px solid rgba(216,181,112,.5); color: #f2e3c4; font-size: 13px;
  display: flex; gap: 7px; align-items: baseline;
  animation: tipIn .2s ease-out;
}
.play-text-banner b { color: #efc982; }
.play-text-banner em { font-style: normal; color: #fff; }
.play-text-banner i { font-style: normal; color: #c9b48a; font-size: 10px; }

/* 技能 */
.skill-fx {
  position: fixed; transform: translate(-50%, -50%); z-index: 176;
  pointer-events: none; display: flex; flex-direction: column; align-items: center;
}
.skill-fx-ring {
  position: absolute; width: 76px; height: 76px; border-radius: 50%;
  border: 2px solid rgba(232,192,120,.85);
  box-shadow: 0 0 26px rgba(216,181,112,.45), inset 0 0 20px rgba(216,181,112,.2);
  animation: skillRing .85s ease-out forwards;
}
.skill-fx-text {
  position: relative; margin-top: -10px; padding: 4px 12px; border-radius: 5px;
  background: linear-gradient(90deg, rgba(120,80,30,.2), rgba(20,14,9,.94), rgba(120,80,30,.2));
  border: 1px solid rgba(232,192,120,.6); color: #f3d99c;
  font-family: var(--serif); font-size: 16px; letter-spacing: .12em; white-space: nowrap;
  animation: skillText 1s ease-out forwards;
}
@keyframes skillRing {
  0% { transform: scale(.35); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes skillText {
  0% { opacity: 0; transform: translateY(8px) scale(.9); }
  25% { opacity: 1; transform: translateY(0) scale(1.04); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}
.player-node.skill-glow { animation: skillGlow .8s ease-out; }
@keyframes skillGlow {
  0% { box-shadow: 0 0 0 2px rgba(232,192,120,.9), 0 0 34px rgba(232,192,120,.5); }
  100% { box-shadow: 0 0 0 0 rgba(232,192,120,0); }
}

/* 回合横幅 */
.turn-fx {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%);
  z-index: 172; display: flex; align-items: baseline; gap: 7px;
  padding: 7px 20px; border-radius: 999px; pointer-events: none;
  background: linear-gradient(90deg, rgba(12,8,5,0), rgba(12,8,5,.94), rgba(12,8,5,0));
  border-top: 1px solid rgba(216,181,112,.4);
  border-bottom: 1px solid rgba(216,181,112,.4);
  color: #efe1c2; font-size: 12px; white-space: nowrap;
  animation: turnIn .4s ease-out;
}
.turn-fx-round { font-size: 9px; color: rgba(201,185,148,.75); letter-spacing: .1em; }
.turn-fx b { font-family: var(--serif); font-size: 17px; color: #f0cf8f; letter-spacing: .04em; }
@keyframes turnIn {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* 伤害 */
.impact-fx {
  position: fixed; transform: translate(-50%, -50%); z-index: 168;
  width: 90px; height: 90px; pointer-events: none;
}
.impact-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(210,70,58,.85);
  animation: impactRing .62s ease-out forwards;
}
.impact-slash {
  position: absolute; left: 50%; top: 50%; width: 128px; height: 3px;
  background: linear-gradient(90deg, transparent, #e0574a, rgba(255,220,180,.9), #e0574a, transparent);
  transform: translate(-50%, -50%) rotate(-28deg);
  animation: impactSlash .48s ease-out forwards;
}
@keyframes impactRing {
  0% { transform: scale(.3); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
@keyframes impactSlash {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-28deg) scaleX(.2); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(-28deg) scaleX(1.2); }
}

/* 摸牌 */
.draw-fx {
  position: fixed; width: 34px; height: 48px; margin: 0;
  transform: translate(-50%, -50%); z-index: 165; pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.55));
}
.draw-fx svg { width: 100%; height: 100%; display: block; }

/* 移动端：出牌动画仍显示；名牌位置微调 */
@media (max-width: 820px) {
  .played-card-slot { display: none; }
  .center-card-reveal { left: 50%; top: 22%; }
  .play-fx-stage { top: 34%; }
  .play-fx-card .card { width: 84px; height: 121px; }
  .play-fx-banner { font-size: 10.5px; padding: 5px 11px; max-width: 88vw; flex-wrap: wrap; justify-content: center; }
  .play-fx-banner em { font-size: 11.5px; }
  .turn-fx { top: 54px; padding: 6px 14px; }
  .turn-fx b { font-size: 15px; }
  .skill-fx-text { font-size: 14px; }
  .card-tooltip { font-size: 10px; }
  .card-tooltip .tt-desc { font-size: 10px; }
}

/* 调整：回合横幅放到左上，避开右侧 toast */
.turn-fx {
  left: 14px; top: 62px; transform: none;
  padding: 5px 12px; border-radius: 5px;
  background: rgba(12,8,5,.9); border: 1px solid rgba(216,181,112,.35);
  border-top: 1px solid rgba(216,181,112,.45);
  border-bottom: 1px solid rgba(216,181,112,.45);
  animation: turnInLeft .35s ease-out;
}
.turn-fx b { font-size: 14px; }
.turn-fx-round { font-size: 8.5px; }
@keyframes turnInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
@media (max-width: 820px) {
  .turn-fx { left: 8px; top: 56px; }
  .center-card-reveal { display: block; }
  .center-card-reveal .card { width: 76px; height: 109px; }
}

/* 卡面插画再提一点对比度 */
.card-art .card-art-ink { filter: drop-shadow(0 1px 0 rgba(255, 248, 230, .45)); }

/* 角色节点右侧：技能名 */
.node-head { align-items: flex-start; }
.node-skills {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin-left: auto;
  padding-right: 8px;
  max-width: 52px;
  max-height: 42px;
  overflow: hidden;
}
.node-skill {
  max-width: 100%;
  padding: 0 3px;
  border-radius: 2px;
  border: 1px solid rgba(216,181,112,.28);
  background: rgba(10,7,4,.5);
  color: #d9c08a;
  font-family: var(--sans);
  font-size: 7px;
  line-height: 1.45;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 820px) {
  .node-skills { max-width: 38px; padding-right: 4px; max-height: 36px; }
  .node-skill { font-size: 6.5px; padding: 0 2px; }
}

/* 技能发动提示：屏幕正中 */
.skill-fx {
  left: 50%;
  top: 36%;
  transform: translate(-50%, -50%);
  z-index: 180;
}
.skill-fx-ring {
  width: 176px;
  height: 176px;
  border-width: 2px;
  box-shadow: 0 0 40px rgba(216,181,112,.45), inset 0 0 32px rgba(216,181,112,.16);
}
.skill-fx-title {
  position: relative;
  margin-top: -8px;
  padding: 4px 12px;
  border-radius: 4px;
  background: rgba(10,7,4,.7);
  color: #d9c08a;
  font-size: 12px;
  letter-spacing: .08em;
  white-space: nowrap;
}
.skill-fx-title b { color: #f0cf8f; font-size: 15px; margin-right: 3px; }
.skill-fx-name {
  position: relative;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 30px;
  color: #ffe4a8;
  letter-spacing: .1em;
  text-shadow: 0 0 20px rgba(232,192,120,.6), 0 2px 8px rgba(0,0,0,.8);
  animation: skillName 1.55s ease-out forwards;
}
@keyframes skillName {
  0% { opacity: 0; transform: scale(.78); }
  22% { opacity: 1; transform: scale(1.06); }
  78% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: translateY(-8px); }
}
@media (max-width: 820px) {
  .skill-fx { top: 32%; }
  .skill-fx-ring { width: 142px; height: 142px; }
  .skill-fx-name { font-size: 24px; }
  .skill-fx-title { font-size: 10.5px; }
}

/* ============================================================
   v4 UI：仿三国杀立绘牌桌
   ============================================================ */
.game-screen {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(36, 30, 22, .55), transparent 65%),
    linear-gradient(180deg, #0b0907, #070605 60%, #0b0806);
}
.table-zone {
  background:
    radial-gradient(ellipse at 50% 38%, #1b2a20, #0a100c 72%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.012) 0 2px, transparent 2px 7px);
}
.table-oval {
  border: 2px solid rgba(190, 158, 100, .22);
  background:
    radial-gradient(ellipse at 50% 40%, rgba(78, 112, 86, .32), transparent 62%),
    radial-gradient(ellipse at 50% 50%, #22392a, #0e1712 78%);
  box-shadow:
    inset 0 0 90px rgba(0, 0, 0, .78),
    inset 0 0 0 1px rgba(255, 225, 170, .05),
    0 28px 70px rgba(0, 0, 0, .55);
}
.table-oval::before {
  content: "";
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  border: 1px solid rgba(190, 158, 100, .14);
  pointer-events: none;
}
.table-oval::after {
  background:
    radial-gradient(ellipse at 50% 46%, transparent 55%, rgba(0, 0, 0, .35) 82%);
}

/* 玩家立绘卡 */
.player-node {
  width: 108px;
  padding: 0;
  border-radius: 8px;
  overflow: visible;
  background: linear-gradient(180deg, #14100c, #0a0806);
  border: 1px solid rgba(205, 175, 115, .42);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 230, 180, .05);
}
.player-node.self { width: 122px; }
.player-node.current {
  border-color: rgba(240, 206, 140, .9);
  box-shadow: 0 0 0 1px rgba(232, 192, 120, .45), 0 0 30px rgba(232, 192, 120, .2), 0 12px 26px rgba(0, 0, 0, .55);
}
.player-node.targetable { border-color: rgba(224, 106, 92, .8); }
.node-portrait {
  position: relative;
  height: 98px;
  padding-left: 16px;
  border-radius: 7px 7px 0 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.node-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 244, 215, .22), transparent 58%),
    linear-gradient(180deg, transparent 50%, rgba(6, 5, 4, .9));
  pointer-events: none;
}
.portrait-initial {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: 42px;
  color: #fff4dc;
  text-shadow: 0 4px 18px rgba(0, 0, 0, .7);
}
.portrait-kingdom {
  position: absolute;
  z-index: 3;
  top: 5px;
  left: 5px;
  padding: 0 3px;
  border: 1px solid rgba(216, 181, 112, .4);
  border-radius: 2px;
  background: rgba(8, 6, 4, .58);
  color: #efd9a8;
  font-size: 8px;
  line-height: 1.5;
}
.portrait-hp {
  position: absolute;
  z-index: 3;
  left: 4px;
  top: 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hp-cell {
  width: 7px;
  height: 7px;
  border-radius: 1.5px;
  background: #352e25;
  border: 1px solid rgba(0, 0, 0, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.hp-cell.on { background: #4fae74; }
.hp-cell.on.mid { background: #d0a84f; }
.hp-cell.on.low { background: #cf5f4d; }
.node-skills {
  position: absolute;
  z-index: 4;
  right: 3px;
  top: 18px;
  width: 32px;
  max-height: 66px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.node-skill {
  max-width: 100%;
  padding: 0 2px;
  border: 1px solid rgba(216, 181, 112, .3);
  border-radius: 2px;
  background: rgba(6, 5, 4, .72);
  color: #e6cb96;
  font-size: 6.5px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.node-bot-tag {
  position: absolute;
  z-index: 3;
  right: 4px;
  bottom: 4px;
  font-size: 6.5px;
  color: rgba(160, 205, 180, .6);
  letter-spacing: .06em;
}
.portrait-turn {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  padding: 0 4px;
  border-radius: 2px;
  background: rgba(20, 14, 8, .72);
  color: #f0cf8f;
  font-size: 6.5px;
  letter-spacing: .1em;
  white-space: nowrap;
}
.node-info {
  padding: 3px 6px 4px;
  border-top: 1px solid rgba(205, 175, 115, .3);
  border-radius: 0 0 7px 7px;
  background: linear-gradient(180deg, rgba(12, 9, 6, .95), #0a0806);
}
.node-info .node-name {
  font-size: 9.5px;
  color: #f2e4c6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.node-info .node-general {
  font-size: 7.5px;
  color: rgba(210, 190, 155, .62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.node-info .node-meta {
  margin-top: 1px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 6.5px;
  color: rgba(200, 185, 150, .55);
}
.node-info .node-equips { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 2px; }
.node-info .equip-chip { font-size: 6px; padding: 0 2px; }
.node-info .node-judge { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 2px; }
.node-info .judge-chip { font-size: 6px; padding: 0 2px; }
.self-node-wrap .player-node { width: 118px; }
.self-node-wrap .player-node .node-portrait { height: 108px; }

/* 桌面端：稍大一些 */
@media (min-width: 1100px) {
  .player-node { width: 118px; }
  .self-node-wrap .player-node { width: 132px; }
  .node-portrait { height: 110px; }
  .portrait-initial { font-size: 48px; }
  .node-info .node-name { font-size: 10.5px; }
}

/* 移动端：立绘卡缩小 */
@media (max-width: 820px) {
  .player-node { width: 80px; }
  .player-node.self, .self-node-wrap .player-node { width: 92px; }
  .node-portrait { height: 72px; padding-left: 12px; }
  .self-node-wrap .player-node .node-portrait { height: 86px; }
  .portrait-initial { font-size: 30px; }
  .portrait-kingdom { font-size: 6.5px; top: 3px; left: 3px; }
  .portrait-hp { left: 3px; top: 16px; gap: 1.5px; }
  .hp-cell { width: 5px; height: 5px; border-radius: 1px; }
  .node-skills { width: 24px; top: 14px; max-height: 48px; gap: 1.5px; }
  .node-skill { font-size: 5.5px; padding: 0 1px; }
  .portrait-turn { font-size: 5.5px; bottom: 2px; }
  .node-bot-tag { font-size: 5.5px; right: 3px; bottom: 2px; }
  .node-info { padding: 2px 4px 3px; }
  .node-info .node-name { font-size: 7.5px; }
  .node-info .node-general { font-size: 6px; }
  .node-info .node-meta { font-size: 5.5px; gap: 3px; }
  .node-info .equip-chip, .node-info .judge-chip { font-size: 5px; }
  .node-role { font-size: 6.5px; top: -7px; left: 4px; padding: 0 3px; }
}

/* 手牌铺开与桌面大卡 */
.hand-cards { justify-content: center; }
@media (min-width: 1100px) {
  .card { width: 100px; height: 142px; }
  .card-name { font-size: 24px; top: 38px; }
  .card-name.long { font-size: 15px; }
  .card-type { font-size: 9px; }
  .hand-zone { min-height: 260px; }
}
@media (max-width: 820px) {
  .node-skill { font-size: 6px; }
  .node-skills { width: 26px; }
}

/* ============================================================
   v5 打击感：追踪线、拖影、火花、受击、阵亡
   ============================================================ */
.link-fx { position: fixed; inset: 0; z-index: 170; pointer-events: none; overflow: visible; }
.link-fx line {
  stroke: rgba(232, 192, 120, .85); stroke-width: 2;
  stroke-dasharray: 10 8;
  filter: drop-shadow(0 0 6px rgba(232, 192, 120, .75));
  animation: linkDash .45s linear infinite, linkFade .25s .8s forwards;
}
.link-fx .link-dot {
  fill: none; stroke: rgba(224, 106, 92, .9); stroke-width: 2;
  animation: linkPulse .7s ease-out infinite;
}
@keyframes linkDash { to { stroke-dashoffset: -18; } }
@keyframes linkFade { to { opacity: 0; } }
@keyframes linkPulse {
  0% { r: 4; opacity: 1; }
  100% { r: 12; opacity: 0; }
}
.play-ghost {
  position: absolute; left: 50%; top: 50%;
  width: 100px; height: 144px; margin: -72px 0 0 -50px;
  border-radius: 6px; opacity: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(160deg, #f7eed9, #e2d1ad);
  border: 1px solid rgba(216, 181, 112, .45);
  box-shadow: 0 0 26px rgba(232, 192, 120, .45);
}
.play-fx-card { position: relative; z-index: 2; }
.fx-spark {
  position: fixed; z-index: 188; width: 5px; height: 5px; border-radius: 50%;
  pointer-events: none; box-shadow: 0 0 8px currentColor;
}
.table-zone.fx-shake { animation: fxShake .42s cubic-bezier(.36, .07, .19, .97); }
@keyframes fxShake {
  10% { transform: translate(calc(var(--shake, 6px) * -.6), 2px); }
  20% { transform: translate(var(--shake, 6px), -2px); }
  30% { transform: translate(calc(var(--shake, 6px) * -.8), 1px); }
  40% { transform: translate(calc(var(--shake, 6px) * .7), -1px); }
  50% { transform: translate(calc(var(--shake, 6px) * -.5), 0); }
  60% { transform: translate(calc(var(--shake, 6px) * .4), 0); }
  100% { transform: translate(0, 0); }
}
.player-node.hit .node-portrait { animation: hitFlash .45s ease-out; }
@keyframes hitFlash {
  0% { filter: brightness(2.2) saturate(1.8); }
  35% { filter: brightness(1.5) saturate(1.4); }
  100% { filter: none; }
}
.player-node.hit {
  border-color: rgba(224, 80, 64, .95) !important;
  box-shadow: 0 0 0 2px rgba(224, 80, 64, .6), 0 0 26px rgba(200, 60, 40, .5) !important;
}
.damage-number {
  position: fixed; z-index: 190; transform: translate(-50%, -50%);
  font-family: var(--serif); font-size: 40px; color: #ff6b52;
  text-shadow: 0 0 18px rgba(255, 70, 50, .7), 0 3px 8px rgba(0, 0, 0, .8);
  pointer-events: none; animation: damagePop .95s ease-out forwards;
}
@keyframes damagePop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); }
  60% { transform: translate(-50%, -70%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(.9); }
}
.skill-fx-backdrop {
  position: fixed; inset: 0; z-index: 177; pointer-events: none;
  background: radial-gradient(circle at 50% 36%, rgba(0, 0, 0, .12) 0 18%, rgba(0, 0, 0, .62) 68%);
  animation: fadeIn .25s ease-out;
}
.skill-fx-ring.slow {
  animation: skillRing 1.35s .15s ease-out forwards;
  border-color: rgba(240, 200, 130, .4);
}
.player-node.dead-fx .node-portrait { filter: grayscale(1) brightness(.7); }
.death-fx {
  position: fixed; z-index: 191; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  pointer-events: none; animation: fadeIn .3s;
}
.death-stamp {
  font-family: var(--serif); font-size: 34px; color: #d84a3a;
  letter-spacing: .2em; border: 3px solid rgba(216, 74, 58, .8);
  padding: 2px 10px; transform: rotate(-12deg);
  text-shadow: 0 0 18px rgba(216, 74, 58, .5);
}
.death-role { font-size: 10px; color: rgba(232, 220, 194, .8); letter-spacing: .15em; }
@media (max-width: 820px) {
  .play-ghost { width: 84px; height: 121px; margin: -60px 0 0 -42px; }
  .damage-number { font-size: 30px; }
  .death-stamp { font-size: 26px; }
}

/* 自己立绘上移，避免被提示栏裁切 */
.self-node-wrap { top: 80%; }
@media (max-width: 980px) {
  .self-node-wrap { top: 80%; }
}
@media (max-width: 820px) {
  .self-node-wrap { top: 80%; }
  .self-node-wrap .player-node { width: 88px; }
  .self-node-wrap .player-node .node-portrait { height: 80px; }
}

/* 身份徽标移到立绘右上，避免被相邻节点遮挡 */
.player-node .node-role {
  left: auto;
  right: 4px;
  top: 4px;
  z-index: 6;
  padding: 0 3px;
  font-size: 7px;
  line-height: 1.6;
  border-color: rgba(216, 181, 112, .35);
  background: rgba(8, 6, 4, .62);
}
@media (max-width: 820px) {
  .player-node .node-role { font-size: 6px; right: 3px; top: 3px; padding: 0 2px; }
  .node-skills { top: 21px; }
}

/* ============================================================
   v6 修复：居中技能确认 / 完整武将名 / 桃治疗
   ============================================================ */
.portrait-name {
  position: relative; z-index: 1;
  max-width: calc(100% - 30px);
  padding-right: 6px;
  font-family: var(--serif);
  color: #fff4dc;
  text-align: center;
  line-height: 1.06;
  word-break: break-all;
  text-shadow: 0 3px 16px rgba(0, 0, 0, .75), 0 0 3px rgba(0, 0, 0, .5);
}
.portrait-name.name-1, .portrait-name.name-2 { font-size: 38px; }
.portrait-name.name-3 { font-size: 25px; letter-spacing: .02em; }
.portrait-name.name-4 { font-size: 20px; letter-spacing: 0; }
.portrait-name.name-5 { font-size: 16px; letter-spacing: 0; }
.portrait-name.name-6 { font-size: 13px; letter-spacing: 0; }

/* 居中技能/选择确认 */
.choice-backdrop {
  position: fixed; inset: 0; z-index: 195;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(circle at 50% 40%, rgba(20, 14, 9, .55), rgba(4, 3, 2, .8));
  backdrop-filter: blur(5px);
  animation: fadeIn .18s ease-out;
}
.choice-panel {
  width: min(430px, 92vw);
  padding: 18px 20px 16px;
  border: 1px solid rgba(216, 181, 112, .5);
  border-radius: 9px;
  background: linear-gradient(180deg, #19130d, #0c0906);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .75), inset 0 0 0 1px rgba(255, 230, 180, .05);
  text-align: center;
  animation: choiceIn .22s cubic-bezier(.2, .8, .25, 1);
}
@keyframes choiceIn {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.choice-kicker {
  font-size: 8.5px; letter-spacing: .32em; color: rgba(201, 185, 148, .55);
}
.choice-panel h3 {
  margin: 4px 0 6px; font-family: var(--serif); font-size: 23px;
  color: #f0cf8f; letter-spacing: .08em;
}
.choice-panel p {
  margin: 0 0 14px; font-size: 11px; line-height: 1.7; color: rgba(232, 220, 194, .82);
}
.choice-options { display: flex; flex-direction: column; gap: 8px; }
.choice-option {
  display: block; width: 100%; padding: 10px 14px; text-align: left; cursor: pointer;
  border: 1px solid rgba(216, 181, 112, .28); border-radius: 5px;
  background: rgba(216, 181, 112, .05); color: #f2e3c4;
  transition: border-color .15s, background .15s, transform .15s;
}
.choice-option:hover, .choice-option:focus-visible {
  border-color: rgba(232, 192, 120, .8);
  background: rgba(216, 181, 112, .14);
  transform: translateY(-1px);
}
.choice-option b { display: block; font-family: var(--serif); font-size: 14px; letter-spacing: .06em; }
.choice-option small { display: block; margin-top: 3px; font-size: 9px; color: rgba(201, 185, 148, .68); }
.choice-hint { margin-top: 10px; font-size: 8px; color: rgba(201, 185, 148, .38); }
@media (max-width: 820px) {
  .choice-panel { padding: 15px 14px 13px; }
  .choice-panel h3 { font-size: 19px; }
  .choice-panel p { font-size: 10.5px; }
  .choice-option { padding: 9px 11px; }
  .choice-option b { font-size: 13px; }
}

/* 桃 / 治疗 */
.heal-fx {
  position: fixed; transform: translate(-50%, -50%); z-index: 186;
  width: 84px; height: 84px; pointer-events: none;
}
.heal-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(120, 224, 150, .85);
  box-shadow: 0 0 26px rgba(100, 220, 140, .55);
  animation: healRing .95s ease-out forwards;
}
.heal-ring.slow { animation-delay: .16s; border-color: rgba(255, 180, 200, .55); }
@keyframes healRing {
  0% { transform: scale(.3); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: scale(1.75); opacity: 0; }
}
.player-node.heal-glow .node-portrait { animation: healGlow .9s ease-out; }
@keyframes healGlow {
  0% { filter: brightness(1.7) saturate(1.25); }
  100% { filter: none; }
}
.petal {
  position: fixed; z-index: 187; width: 7px; height: 5px;
  border-radius: 60% 40% 60% 40%;
  background: linear-gradient(135deg, #ffd0dd, #e77f9a);
  box-shadow: 0 0 6px rgba(255, 150, 180, .55);
  pointer-events: none;
}
@media (max-width: 820px) {
  .portrait-name.name-1, .portrait-name.name-2 { font-size: 27px; }
  .portrait-name.name-3 { font-size: 19px; }
  .portrait-name.name-4 { font-size: 15px; }
  .portrait-name.name-5 { font-size: 12px; }
  .portrait-name.name-6 { font-size: 10px; }
  .heal-fx { width: 64px; height: 64px; }
  .petal { width: 6px; height: 4px; }
}

/* 完整武将名尺寸修正：3 字尽量一行，长名两行 */
.portrait-name.name-3 { font-size: 20px; letter-spacing: 0; }
.portrait-name.name-4 { font-size: 15.5px; letter-spacing: 0; }
.portrait-name.name-5 { font-size: 12.5px; letter-spacing: 0; }
.portrait-name.name-6 { font-size: 10.5px; letter-spacing: 0; }
.portrait-name { line-height: 1.08; max-height: 2.3em; overflow: hidden; }
@media (max-width: 820px) {
  .portrait-name.name-3 { font-size: 16px; }
  .portrait-name.name-4 { font-size: 12.5px; }
  .portrait-name.name-5 { font-size: 10.5px; }
  .portrait-name.name-6 { font-size: 9px; }
}

/* 短名强制单行，避免「吕蒙」竖排成两行 */
.portrait-name { white-space: nowrap; }
.portrait-name.name-5, .portrait-name.name-6 { white-space: normal; }
.portrait-name.name-1, .portrait-name.name-2 { font-size: 30px; }
@media (max-width: 820px) {
  .portrait-name.name-1, .portrait-name.name-2 { font-size: 23px; }
}

/* 名字与右侧技能列分区，避免重叠 */
.node-portrait { padding-left: 16px; padding-right: 28px; }
.portrait-name { max-width: 100%; padding-right: 0; }
.portrait-name.name-1, .portrait-name.name-2 { font-size: 26px; }
.portrait-name.name-3 { font-size: 18px; }
.portrait-name.name-4 { font-size: 14px; }
.portrait-name.name-5 { font-size: 11.5px; }
.portrait-name.name-6 { font-size: 9.5px; }
@media (max-width: 820px) {
  .node-portrait { padding-left: 12px; padding-right: 22px; }
  .portrait-name.name-1, .portrait-name.name-2 { font-size: 20px; }
  .portrait-name.name-3 { font-size: 14px; }
  .portrait-name.name-4 { font-size: 11px; }
  .portrait-name.name-5 { font-size: 9px; }
  .portrait-name.name-6 { font-size: 8px; }
}

/* ============================================================
   v7 横屏牌桌 / 古风音乐 / 竖屏提示
   ============================================================ */
.music-link.music-on { color: #f0cf8f; }
.music-link.music-on::before {
  content: "●"; font-size: 7px; margin-right: 4px; color: #e8c078;
  animation: musicPulse 1.6s ease-in-out infinite;
}
@keyframes musicPulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

#rotate-tip {
  display: none; position: fixed; inset: 0; z-index: 500;
  flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 24px; text-align: center;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(60, 48, 30, .35), transparent 60%),
    linear-gradient(180deg, #0a0806, #070605);
}
body[data-screen="game"]:not(.allow-portrait) #rotate-tip { display: none; }
@media (max-width: 900px) and (orientation: portrait) {
  body[data-screen="game"]:not(.allow-portrait) #rotate-tip { display: flex; }
}
.rotate-glyph {
  width: 86px; height: 50px; border: 2px solid rgba(216, 181, 112, .8);
  border-radius: 9px; position: relative; margin-bottom: 6px;
  animation: rotateHint 2.4s ease-in-out infinite;
  box-shadow: 0 0 24px rgba(216, 181, 112, .25);
}
.rotate-glyph::before {
  content: ""; position: absolute; left: 50%; top: 6px; width: 10px; height: 2px;
  transform: translateX(-50%); background: rgba(216, 181, 112, .8); border-radius: 2px;
}
.rotate-glyph span {
  position: absolute; left: 50%; top: 50%; width: 24px; height: 24px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(232, 192, 120, .9); border-right-color: transparent;
  border-radius: 50%;
}
@keyframes rotateHint {
  0%, 20% { transform: rotate(0deg); }
  55%, 75% { transform: rotate(90deg); }
  100% { transform: rotate(90deg); }
}
#rotate-tip b {
  font-family: var(--serif); font-size: 22px; letter-spacing: .18em; color: #f0cf8f;
}
#rotate-tip p { margin: 0; font-size: 11px; color: rgba(201, 185, 148, .65); }
#rotate-tip .btn { margin-top: 8px; }

/* 桌面横屏：官方式排版 */
@media (min-width: 900px) {
  .game-body { position: relative; }
  .log-panel {
    position: absolute; left: 10px; top: 10px; z-index: 16;
    width: 238px; height: 160px; flex: none;
    background: linear-gradient(180deg, rgba(10, 8, 6, .74), rgba(10, 8, 6, .5));
    border: 1px solid rgba(216, 181, 112, .22); border-radius: 6px;
    backdrop-filter: blur(4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  }
  .log-panel .panel-tabs { border-bottom-color: rgba(216, 181, 112, .16); }
  .log-panel .panel-tab { padding: 6px 10px; font-size: 10px; }
  .log-panel .log-list { padding: 6px 10px; font-size: 9.5px; line-height: 1.6; }
  .log-panel .log-list .log-item { padding: 2px 0; }
  .log-panel .chat-list, .log-panel .chat-form { display: none !important; }
  .self-node-wrap { left: 86%; top: 76%; }
  .self-node-wrap .player-node { width: 124px; }
  .game-body { overflow: visible; }
}

/* 手机横屏：压缩牌桌、手牌、提示条 */
@media (orientation: landscape) and (max-height: 600px) {
  .game-shell { position: relative; }
  .game-top { flex: 0 0 42px; padding: 0 8px; gap: 8px; }
  .game-top-left .deck-tag, .game-top-left .mode-tag { display: none; }
  .game-top-right .mini-btn { padding: 3px 6px; font-size: 9px; }
  .game-body { position: relative; flex: 1; min-height: 0; }
  .table-zone { overflow: hidden; }
  .table-oval { left: 2%; right: 2%; top: 1%; bottom: 1%; }
  .table-center { gap: 14px; transform: translate(-50%, -50%) scale(.88); }
  .center-tip { display: none; }
  .log-panel { display: none; }
  .hand-zone { flex: 0 0 136px; padding: 0 8px 4px; }
  .hand-info { min-width: 44px; font-size: 9px; }
  .hand-tools { display: none; }
  .hand-cards .card { width: 60px; height: 86px; margin-left: -22px; }
  .hand-cards .card-name { font-size: 13px; top: 24px; }
  .card-type { display: none; }
  .prompt-bar {
    position: absolute; left: 50%; bottom: 132px; transform: translateX(-50%);
    width: min(560px, 82vw); min-height: 0; padding: 5px 10px; z-index: 22;
    background: rgba(9, 7, 5, .86); border: 1px solid rgba(216, 181, 112, .25);
    border-radius: 5px; backdrop-filter: blur(5px);
  }
  .prompt-message { display: none; }
  .prompt-title { font-size: 11px; }
  .action-btn { padding: 4px 8px; font-size: 10px; }
  .player-node { width: 78px; }
  .node-portrait { height: 58px; }
  .portrait-name.name-1, .portrait-name.name-2 { font-size: 18px; }
  .portrait-name.name-3 { font-size: 13px; }
  .portrait-name.name-4 { font-size: 10.5px; }
  .node-skills { top: 12px; width: 22px; max-height: 40px; }
  .node-skill { font-size: 5.5px; }
  .portrait-hp { top: 14px; }
  .hp-cell { width: 4.5px; height: 4.5px; }
  .self-node-wrap { left: 87%; top: 72%; }
  .self-node-wrap .player-node { width: 88px; }
  .self-node-wrap .player-node .node-portrait { height: 64px; }
  .node-info .node-name { font-size: 7.5px; }
  .node-info .node-general { font-size: 6px; }
  .node-info .node-meta { font-size: 5.5px; }
  .node-info .node-equips, .node-info .node-judge { display: none; }
  .turn-fx { top: 46px; left: 8px; }
  .play-fx-stage { top: 46%; }
  .play-fx-card .card { width: 72px; height: 104px; }
}

/* 横屏细节修正 */
@media (min-width: 900px) {
  .log-panel { width: 224px; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .game-top { flex: 0 0 36px; padding: 0 6px; gap: 6px; }
  .game-top-left .room-tag, .game-top-left .mode-tag, .game-top-left .deck-tag { display: none; }
  .game-top-center .round-tag { display: none; }
  .game-top-center { gap: 5px; }
  .game-top-center .phase-tag, .game-top-center .turn-tag { font-size: 9px; padding: 2px 6px; }
  .game-top-right .mini-btn { padding: 2px 5px; font-size: 8px; }
  .game-body { flex: 1; min-height: 0; }
  .hand-zone { flex: 0 0 122px; padding: 0 6px 2px; }
  .hand-cards .card { width: 54px; height: 78px; margin-left: -20px; }
  .hand-cards .card-name { font-size: 11px; top: 20px; }
  .hand-cards .card-name.long { font-size: 8px; }
  .hand-cards .card-corner { font-size: 8px; top: 3px; left: 4px; }
  .hand-cards .card-suit { font-size: 8px; }
  .hand-cards .card-rank { font-size: 7px; }
  .hand-cards .card-type { display: none; }
  .hand-info { position: absolute; left: 8px; bottom: 4px; z-index: 5; font-size: 8px; }
  .hand-zone { position: relative; }
  .prompt-bar {
    bottom: 118px; width: max-content; min-width: 0; max-width: 72vw;
    padding: 3px 9px; border-radius: 4px;
  }
  .prompt-title { font-size: 10px; }
  .prompt-message { display: none; }
  .prompt-actions { gap: 4px; }
  .action-btn, .skill-btn { padding: 3px 6px; font-size: 9px; }
  .player-node { width: 66px; }
  .node-portrait { height: 48px; padding-left: 9px; padding-right: 18px; }
  .portrait-name.name-1, .portrait-name.name-2 { font-size: 14px; }
  .portrait-name.name-3 { font-size: 11px; }
  .portrait-name.name-4 { font-size: 9px; }
  .portrait-name.name-5 { font-size: 8px; }
  .portrait-name.name-6 { font-size: 7px; }
  .node-skills { top: 9px; width: 18px; max-height: 36px; gap: 1px; }
  .node-skill { font-size: 4.8px; line-height: 1.35; padding: 0 1px; }
  .portrait-kingdom { font-size: 5px; top: 2px; left: 2px; }
  .portrait-hp { left: 2px; top: 12px; gap: 1px; }
  .hp-cell { width: 4px; height: 4px; }
  .node-role { font-size: 5px; top: 2px; right: 2px; padding: 0 1px; }
  .node-bot-tag { font-size: 4.5px; }
  .node-info { padding: 1px 3px 2px; }
  .node-info .node-name { font-size: 6.5px; }
  .node-info .node-general { font-size: 5.5px; }
  .node-info .node-meta { font-size: 5px; gap: 2px; }
  .node-info .node-equips, .node-info .node-judge { display: none; }
  .self-node-wrap { left: 88%; top: 70%; }
  .self-node-wrap .player-node { width: 74px; }
  .self-node-wrap .player-node .node-portrait { height: 52px; }
  .table-center { gap: 8px; transform: translate(-50%, -50%) scale(.66); }
  .table-center-info { min-width: 90px; }
  .center-phase { font-size: 8px; }
  .center-turn { font-size: 13px; }
  .center-tip { display: none; }
  .pile { width: 38px; height: 52px; }
  .turn-fx { top: 40px; left: 6px; padding: 3px 8px; }
  .turn-fx b { font-size: 11px; }
  .play-fx-stage { top: 42%; }
  .play-fx-card .card { width: 64px; height: 92px; }
  .play-fx-banner { font-size: 9px; padding: 3px 8px; }
  .play-fx-banner em { font-size: 10px; }
  .log-panel { display: none; }
}

/* 横屏手机：解除手牌区 250px 最小高度，避免牌桌被压扁 */
@media (orientation: landscape) and (max-height: 600px) {
  .hand-zone { min-height: 0; max-height: none; }
  .table-zone { min-height: 0; }
  .self-node-wrap { left: 88%; top: 70%; }
}
