/* =========================================================================
   伯明翰 · Brass: Birmingham —— 样式表
   配色：煤烟黑 + 黄铜 + 旧纸
   ========================================================================= */

:root {
  --bg: #0c0e11;
  --bg-2: #12151a;
  --panel: #171b21;
  --panel-2: #1d2229;
  --line: #2b323b;
  --line-soft: #232a32;
  --brass: #c9a227;
  --brass-2: #e5c973;
  --brass-dim: #7d6520;
  --ink: #e9e1cf;
  --ink-2: #b6ad99;
  --faint: #7d7566;
  --good: #5da97a;
  --bad: #c0553f;
  --coal: #3a3a3a;
  --iron: #c96f2a;
  --radius: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --font: "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --serif: Georgia, "Songti SC", "SimSun", serif;
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: .02em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--brass-2); text-decoration: none; }
[hidden] { display: none !important; }

/* ---------- 环境光 ---------- */
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ambient-glow { position: absolute; width: 60vw; height: 60vw; border-radius: 50%; filter: blur(90px); opacity: .35; }
.glow-a { top: -28vw; left: -10vw; background: radial-gradient(circle, rgba(201, 162, 39, .35), transparent 65%); }
.glow-b { bottom: -34vw; right: -12vw; background: radial-gradient(circle, rgba(90, 120, 150, .3), transparent 65%); }
.ambient-grid {
  position: absolute; inset: 0; opacity: .06;
  background-image: linear-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .5) 1px, transparent 1px);
  background-size: 46px 46px;
}

#app { position: relative; z-index: 1; }
.view { min-height: 100vh; }

/* ---------- 通用控件 ---------- */
.ghost-btn {
  background: transparent; border: 1px solid var(--line); color: var(--ink-2);
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; transition: .18s;
}
.ghost-btn:hover { border-color: var(--brass-dim); color: var(--brass-2); }
.ghost-btn.compact { padding: 5px 11px; }
.text-btn { background: none; border: none; color: var(--brass-2); font-size: 12.5px; padding: 0; }
.text-btn:hover { text-decoration: underline; }
.primary-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px 18px; border: none; border-radius: 8px;
  background: linear-gradient(160deg, #e0bd55, #b98d1c);
  color: #221a05; font-weight: 700; font-size: 15px; letter-spacing: .04em;
  transition: .18s; box-shadow: 0 8px 22px rgba(201, 162, 39, .22);
}
.primary-btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.primary-btn:disabled { opacity: .45; filter: grayscale(.4); cursor: not-allowed; transform: none; }
.btn-arrow { font-size: 17px; }

.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .22); border-top-color: var(--brass-2);
  animation: spin .8s linear infinite; display: inline-block;
}
.spinner.tiny { width: 10px; height: 10px; border-width: 1.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

.connection-banner {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; z-index: 90;
  background: rgba(20, 23, 28, .95); border: 1px solid var(--brass-dim);
  padding: 8px 18px; border-radius: 999px; font-size: 12.5px; color: var(--brass-2);
  box-shadow: var(--shadow);
}

/* =========================================================================
   首页
   ========================================================================= */
.home-view { padding-bottom: 40px; }
.home-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 54px);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(150deg, #2a3140, #171b21); border: 1px solid var(--brass-dim);
  color: var(--brass-2); font-size: 19px;
}
.brand-mark.small { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
.brand-words { display: flex; flex-direction: column; line-height: 1.15; }
.brand-words strong { font-family: var(--serif); font-size: 17px; letter-spacing: .12em; }
.brand-words small { font-size: 9px; letter-spacing: .3em; color: var(--faint); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.live-pill {
  display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
}
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }

.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, 460px);
  gap: clamp(24px, 5vw, 70px); align-items: center;
  padding: clamp(20px, 4vw, 60px) clamp(18px, 4vw, 54px);
}
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .18em; color: var(--brass-2); text-transform: uppercase; }
.eyebrow span { width: 26px; height: 1px; background: var(--brass-dim); }
.hero h1 {
  margin: 16px 0 18px; font-size: clamp(46px, 7vw, 88px); line-height: .95; letter-spacing: .06em;
  background: linear-gradient(175deg, #f4e7c0 10%, #c9a227 55%, #8b6d18 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.h1-latin {
  display: block; font-size: clamp(13px, 1.5vw, 17px); letter-spacing: .55em;
  color: var(--faint); -webkit-text-fill-color: var(--faint); margin-top: 10px;
}
.lead { color: var(--ink-2); font-size: 15px; line-height: 1.9; }
.feature-row { display: flex; gap: 34px; margin: 30px 0 22px; }
.feature { display: flex; align-items: baseline; gap: 8px; }
.feature b { font-family: var(--serif); font-size: 28px; color: var(--brass-2); }
.feature span { font-size: 12px; color: var(--faint); }
.hero-note { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--faint); }
.hero-note .line { width: 40px; height: 1px; background: var(--line); }

.entry-panel {
  position: relative; background: linear-gradient(165deg, rgba(28, 33, 40, .96), rgba(17, 20, 25, .98));
  border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-ornament {
  position: absolute; inset: 0 0 auto; height: 2px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent); opacity: .8;
}
.entry-tabs { display: flex; gap: 6px; background: #10131a; border-radius: 10px; padding: 5px; margin-bottom: 20px; }
.entry-tab {
  flex: 1; background: transparent; border: none; color: var(--ink-2); padding: 9px 6px;
  border-radius: 7px; font-size: 12.5px; transition: .16s;
}
.entry-tab.active { background: #222a34; color: var(--brass-2); box-shadow: inset 0 0 0 1px #333d4a; }
.entry-form { display: flex; flex-direction: column; gap: 15px; }
.form-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.form-kicker { font-size: 9.5px; letter-spacing: .28em; color: var(--faint); }
.form-heading h2 { font-size: 20px; margin-top: 4px; }
.form-seal { color: var(--brass-dim); font-size: 22px; }
.field { display: flex; flex-direction: column; gap: 7px; border: none; padding: 0; margin: 0; }
.field > span, .field legend { font-size: 11.5px; color: var(--ink-2); letter-spacing: .06em; padding: 0; }
.field input {
  background: #0f1218; border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 13px; color: var(--ink); font-size: 14px; font-family: inherit; transition: .16s;
}
.field input:focus { outline: none; border-color: var(--brass-dim); box-shadow: 0 0 0 3px rgba(201, 162, 39, .1); }
.code-input { letter-spacing: .35em; font-size: 17px !important; text-transform: uppercase; }

.segmented { display: flex; gap: 6px; }
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label span {
  display: block; text-align: center; padding: 9px 4px; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); transition: .16s;
}
.segmented input:checked + span { border-color: var(--brass); color: #221a05; background: var(--brass); font-weight: 600; }

.difficulty-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.difficulty-option input { position: absolute; opacity: 0; pointer-events: none; }
.difficulty-card {
  display: flex; flex-direction: column; gap: 2px; padding: 11px 8px; text-align: center;
  border: 1px solid var(--line); border-radius: 8px; transition: .16s; background: #0f1218;
}
.difficulty-card b { font-size: 13px; }
.difficulty-card small { font-size: 10px; color: var(--faint); }
.difficulty-option input:checked + .difficulty-card { border-color: var(--brass); background: #241d08; }
.difficulty-option input:checked + .difficulty-card b { color: var(--brass-2); }

.info-block { display: flex; gap: 10px; background: #10141a; border: 1px dashed var(--line); border-radius: 8px; padding: 11px 13px; }
.info-icon { color: var(--brass-dim); }
.info-block p { font-size: 11.5px; color: var(--ink-2); line-height: 1.7; }
.form-footnote { font-size: 11px; color: var(--faint); text-align: center; }
.panel-footer {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft);
  font-size: 11.5px; color: var(--faint);
}
.dot-sep { color: var(--line); }

/* 房间列表 */
.room-browser { margin-top: 6px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.room-browser-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 10px; }
.room-browser-head h3 { font-size: 15px; }
.room-list { display: flex; flex-direction: column; gap: 7px; max-height: 210px; overflow-y: auto; }
.room-empty { font-size: 11.5px; color: var(--faint); text-align: center; padding: 16px 6px; line-height: 1.8; }
.room-item {
  display: flex; align-items: center; gap: 10px; background: #10141a;
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
}
.room-item-code { font-family: ui-monospace, monospace; font-size: 12px; letter-spacing: .12em; color: var(--brass-2); }
.room-item-main { flex: 1; min-width: 0; }
.room-item-host { font-size: 12.5px; }
.room-item-meta { display: flex; gap: 8px; font-size: 10.5px; color: var(--faint); align-items: center; }
.room-badge { border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-size: 10px; }
.room-badge.locked { color: var(--brass-2); border-color: var(--brass-dim); }
.room-join-btn {
  background: #222a34; border: 1px solid var(--line); color: var(--ink);
  border-radius: 6px; padding: 6px 12px; font-size: 11.5px; transition: .16s;
}
.room-join-btn:hover:not(:disabled) { border-color: var(--brass); color: var(--brass-2); }
.room-join-btn:disabled { opacity: .4; cursor: not-allowed; }

.home-lower {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  padding: 0 clamp(18px, 4vw, 54px) 30px;
}
.lower-card {
  display: flex; gap: 14px; padding: 18px; border: 1px solid var(--line-soft);
  border-radius: 12px; background: linear-gradient(160deg, rgba(23, 27, 33, .7), transparent);
}
.lower-num { font-family: var(--serif); font-size: 22px; color: var(--brass-dim); }
.lower-card b { font-size: 13.5px; }
.lower-card p { font-size: 11.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.7; }
.home-footer {
  text-align: center; font-size: 11px; color: var(--faint);
  padding: 18px; border-top: 1px solid var(--line-soft);
}

/* =========================================================================
   大厅
   ========================================================================= */
.lobby-view { display: flex; flex-direction: column; }
.lobby-content { flex: 1; padding: 10px clamp(18px, 4vw, 54px) 40px; max-width: 1100px; margin: 0 auto; width: 100%; }
.room-status-pill {
  display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
}
.room-status-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--brass); }
.lobby-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.lobby-heading h1 { font-size: 34px; display: flex; align-items: center; gap: 14px; }
.room-code-wrap { display: inline-flex; align-items: center; gap: 8px; }
.room-code { font-family: ui-monospace, monospace; letter-spacing: .18em; color: var(--brass-2); }
.copy-code { background: none; border: 1px solid var(--line); color: var(--ink-2); border-radius: 6px; padding: 2px 8px; font-size: 12px; }
.lobby-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.room-mode-tag { border: 1px solid var(--brass-dim); color: var(--brass-2); border-radius: 4px; padding: 1px 6px; font-size: 10.5px; }
.lobby-actions { display: flex; gap: 9px; }
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .9fr); gap: 18px; }
.seat-panel { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: rgba(20, 24, 30, .7); }
.seat-panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.seat-panel-head h2 { font-size: 17px; }
.seat-count { font-size: 11.5px; color: var(--faint); }
.seat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seat-card {
  display: flex; align-items: center; gap: 11px; padding: 13px; border-radius: 9px;
  border: 1px solid var(--line-soft); background: #10141a; position: relative; min-height: 74px;
}
.seat-card.empty { border-style: dashed; opacity: .55; }
.seat-card.you { border-color: var(--brass-dim); }
.seat-avatar {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--avatar-a, #2a3140), var(--avatar-b, #171b21));
  font-family: var(--serif); font-size: 16px; color: #0d0f12;
}
.seat-avatar.bot { background: linear-gradient(150deg, #38404c, #1a1f26); color: var(--brass-2); font-size: 15px; }
.seat-info { min-width: 0; }
.seat-name { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: 9.5px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--ink-2); }
.tag.gold { border-color: var(--brass-dim); color: var(--brass-2); }
.tag.live { border-color: #2f5c43; color: #7bbd95; }
.tag.offline { opacity: .5; }
.seat-remove { position: absolute; top: 6px; right: 6px; background: none; border: none; color: var(--faint); font-size: 14px; }
.empty-slot-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 10px; color: var(--faint); }
.empty-slot-text { font-size: 12px; color: var(--faint); }
.lobby-side { display: flex; flex-direction: column; gap: 14px; }
.lobby-side-section { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: rgba(20, 24, 30, .7); }
.lobby-side-section h2 { font-size: 15px; margin-bottom: 8px; }
.hint { font-size: 11.5px; color: var(--ink-2); line-height: 1.7; }
.invite-row { display: flex; gap: 8px; margin-top: 11px; }
.invite-input {
  flex: 1; min-width: 0; background: #0f1218; border: 1px solid var(--line); border-radius: 7px;
  padding: 8px 10px; color: var(--ink-2); font-size: 11.5px;
}
.copy-invite { background: #222a34; border: 1px solid var(--line); color: var(--ink); border-radius: 7px; padding: 8px 12px; font-size: 11.5px; }
.add-bot-row { display: flex; gap: 8px; margin-top: 11px; }
.add-bot-row select {
  flex: 1; background: #0f1218; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); padding: 8px 10px; font-size: 12px;
}
.side-btn { background: #222a34; border: 1px solid var(--line); color: var(--ink); border-radius: 7px; padding: 8px 12px; font-size: 12px; }
.start-btn { margin-top: 4px; }
.lobby-tip { display: flex; gap: 9px; margin-top: 12px; font-size: 11px; color: var(--faint); line-height: 1.7; }
.lobby-tip span { color: var(--brass-dim); }
.lobby-waiting { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 20px 8px; text-align: center; }
.lobby-waiting b { font-size: 13.5px; }
.lobby-waiting p { font-size: 11.5px; color: var(--faint); line-height: 1.7; }
.room-code-inline { color: var(--brass-2); font-family: ui-monospace, monospace; }

/* =========================================================================
   牌桌
   ========================================================================= */
.game-view { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.game-topbar {
  display: flex; align-items: center; gap: 18px; padding: 10px 18px;
  border-bottom: 1px solid var(--line); background: rgba(14, 17, 21, .92);
}
.game-brand { display: flex; align-items: center; gap: 10px; }
.game-brand div { display: flex; flex-direction: column; line-height: 1.2; }
.game-brand strong { font-family: var(--serif); font-size: 14px; letter-spacing: .14em; }
.game-brand small { font-size: 9.5px; letter-spacing: .2em; color: var(--brass-2); }
.game-meta { display: flex; gap: 8px; flex: 1; justify-content: center; flex-wrap: wrap; }
.meta-chip {
  font-size: 11.5px; color: var(--ink-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; background: #10141a;
}
.meta-chip.room-chip { font-family: ui-monospace, monospace; letter-spacing: .1em; }
.game-actions { display: flex; gap: 7px; align-items: center; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: #131820; color: var(--ink-2); font-size: 14px; display: grid; place-items: center;
}
.icon-btn:hover { border-color: var(--brass-dim); color: var(--brass-2); }
.icon-btn.danger:hover { border-color: var(--bad); color: var(--bad); }

.game-shell { flex: 1; display: grid; grid-template-columns: 254px minmax(0, 1fr) 250px; gap: 12px; padding: 12px; min-height: 0; }
.left-rail, .right-rail { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; }
.board-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: rgba(20, 24, 30, .72); padding: 11px 12px; }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.panel-heading h2 { font-size: 13px; letter-spacing: .1em; }
.panel-sub { font-size: 9.5px; color: var(--faint); }
.log-panel { flex: 1; min-height: 120px; display: flex; flex-direction: column; }
.log-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; font-size: 11px; max-height: 100%; }
.log-entry { display: flex; gap: 6px; color: var(--ink-2); line-height: 1.6; }
.log-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line); margin-top: 6px; flex: none; }
.log-entry[data-kind="build"] .log-dot { background: var(--brass); }
.log-entry[data-kind="sell"] .log-dot { background: var(--good); }
.log-entry[data-kind="network"] .log-dot { background: #6a8fb5; }
.log-entry[data-kind="era"] .log-dot,
.log-entry[data-kind="end"] .log-dot { background: var(--brass-2); }
.log-entry[data-kind="income"] { color: var(--faint); }
.log-empty { font-size: 11px; color: var(--faint); }

.market-board { display: flex; flex-direction: column; gap: 7px; }
.market-row { display: flex; align-items: center; gap: 8px; }
.market-icon { width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; font-size: 11px; color: #0d0f12; }
.market-icon.coal { background: #6a6a6a; color: #eee; }
.market-icon.iron { background: var(--iron); }
.market-bar { flex: 1; height: 8px; border-radius: 4px; background: #0f1218; overflow: hidden; border: 1px solid var(--line-soft); }
.market-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brass-dim), var(--brass)); }
.market-count { font-size: 10.5px; color: var(--ink-2); min-width: 52px; text-align: right; }

.merchant-board { display: flex; flex-direction: column; gap: 6px; }
.merchant-item { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-2); }
.merchant-beer { width: 9px; height: 12px; border-radius: 2px; background: #c98f2c; opacity: .9; }
.merchant-beer.empty { background: #2b323b; }
.merchant-name { flex: 1; }
.merchant-buys { color: var(--faint); font-size: 10px; }

.players-list { display: flex; flex-direction: column; gap: 8px; }
.player-card {
  border: 1px solid var(--line-soft); border-radius: 9px; padding: 10px;
  background: #10141a; transition: .18s;
}
.player-card.is-current { border-color: var(--brass-dim); box-shadow: 0 0 0 1px rgba(201, 162, 39, .18); }
.player-card.is-me { background: #12171d; }
.player-head { display: flex; align-items: center; gap: 8px; }
.player-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.player-name { font-size: 12.5px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-vp { font-family: var(--serif); font-size: 19px; color: var(--brass-2); line-height: 1; }
.player-vp small { font-size: 9px; color: var(--faint); margin-left: 2px; }
.player-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; }
.stat { background: #0c0f14; border-radius: 5px; padding: 4px 5px; text-align: center; }
.stat b { display: block; font-size: 12px; font-weight: 600; }
.stat span { font-size: 8.5px; color: var(--faint); letter-spacing: .04em; }
.player-tiles { display: flex; gap: 3px; margin-top: 6px; flex-wrap: wrap; }
.tile-pip {
  font-size: 9px; padding: 1px 4px; border-radius: 3px; border: 1px solid var(--line);
  color: var(--ink-2); background: #0c0f14;
}

/* 地图 */
.phase-bar {
  display: flex; align-items: center; gap: 12px; padding: 9px 14px;
  border: 1px solid var(--brass-dim); border-radius: 9px;
  background: linear-gradient(120deg, rgba(48, 39, 12, .9), rgba(20, 24, 30, .9));
  font-size: 12.5px;
}
.phase-text { flex: 1; color: var(--brass-2); }
.phase-cancel { background: none; border: 1px solid var(--line); color: var(--ink-2); border-radius: 6px; padding: 4px 10px; font-size: 11px; }
.map-wrap {
  flex: 1; min-height: 0; border: 1px solid var(--line); border-radius: 12px;
  background: radial-gradient(circle at 50% 40%, #16202a, #0b0e12 75%);
  display: grid; place-items: center; overflow: hidden; padding: 6px;
}
#boardSvg { width: 100%; height: 100%; max-height: 100%; display: block; }

/* =========================================================================
   手牌与行动
   ========================================================================= */
.hand-area {
  border-top: 1px solid var(--line); background: rgba(14, 17, 21, .95);
  padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 9px;
}
.action-bar { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.action-btn {
  display: flex; align-items: center; gap: 6px; background: #1a2028; border: 1px solid var(--line);
  color: var(--ink); border-radius: 8px; padding: 8px 14px; font-size: 12.5px; transition: .16s;
}
.action-btn:hover:not(:disabled) { border-color: var(--brass); color: var(--brass-2); }
.action-btn.is-active { border-color: var(--brass); background: #2b2309; color: var(--brass-2); }
.action-btn:disabled { opacity: .38; cursor: not-allowed; }
.action-btn small { font-size: 9.5px; color: var(--faint); }
.action-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.turn-hint { margin-left: auto; font-size: 11.5px; color: var(--faint); }

.hand-list { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; }
.hand-list:empty::after { content: "等待发牌…"; font-size: 11.5px; color: var(--faint); }
.card {
  flex: none; width: 78px; height: 104px; border-radius: 7px; border: 1px solid var(--line);
  background: linear-gradient(165deg, #1d232b, #12161c); padding: 7px; display: flex;
  flex-direction: column; justify-content: space-between; cursor: pointer; transition: .16s; position: relative;
}
.card:hover { transform: translateY(-3px); border-color: var(--brass-dim); }
.card.is-valid { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(201, 162, 39, .25); }
.card.is-dim { opacity: .35; }
.card-kicker { font-size: 8px; letter-spacing: .14em; color: var(--faint); }
.card-title { font-size: 12px; line-height: 1.25; font-weight: 600; }
.card-sub { font-size: 9px; color: var(--ink-2); }
.card-glyph { position: absolute; right: 6px; top: 6px; font-size: 13px; opacity: .5; }
.card.location { background: linear-gradient(165deg, #22303c, #121820); }
.card.industry { background: linear-gradient(165deg, #2d2617, #17130b); }
.card.wild { background: linear-gradient(165deg, #2c1f38, #17111f); }

/* =========================================================================
   弹窗
   ========================================================================= */
.modal-root {
  position: fixed; inset: 0; z-index: 80; background: rgba(5, 7, 10, .78);
  display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px);
}
.modal {
  width: min(720px, 96vw); max-height: 90vh; display: flex; flex-direction: column;
  background: linear-gradient(165deg, #1b2027, #12151a); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.modal.rules-modal { width: min(860px, 96vw); }
.modal.card-modal { width: min(640px, 96vw); }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line-soft);
}
.modal-kicker { font-size: 9.5px; letter-spacing: .24em; color: var(--faint); }
.modal-head h2 { font-size: 19px; margin-top: 3px; }
.modal-head p { font-size: 11.5px; color: var(--ink-2); margin-top: 5px; }
.modal-close { background: none; border: 1px solid var(--line); color: var(--ink-2); border-radius: 7px; width: 28px; height: 28px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line-soft); display: flex; gap: 9px; justify-content: flex-end; }
.modal-btn {
  background: #222a34; border: 1px solid var(--line); color: var(--ink);
  border-radius: 7px; padding: 9px 18px; font-size: 12.5px;
}
.modal-btn.gold { background: linear-gradient(160deg, #e0bd55, #b98d1c); border: none; color: #221a05; font-weight: 600; }
.modal-btn.danger { border-color: var(--bad); color: var(--bad); }
.modal-btn:disabled { opacity: .4; cursor: not-allowed; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 9px; }
.choice {
  text-align: left; background: #10141a; border: 1px solid var(--line); border-radius: 9px;
  padding: 11px 12px; color: var(--ink); display: flex; flex-direction: column; gap: 3px; transition: .16s;
}
.choice:hover { border-color: var(--brass); }
.choice b { font-size: 13px; }
.choice span { font-size: 10.5px; color: var(--ink-2); }
.choice .choice-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.choice .chip { font-size: 9.5px; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--ink-2); }
.choice .chip.good { color: var(--brass-2); border-color: var(--brass-dim); }
.choice .chip.warn { color: var(--bad); border-color: #5b2b22; }

.prose { font-size: 12.5px; line-height: 1.85; color: var(--ink-2); }
.prose h3 { font-size: 14.5px; color: var(--brass-2); margin: 18px 0 8px; }
.prose h3:first-child { margin-top: 0; }
.prose p { margin: 6px 0; }
.prose ul, .prose ol { margin: 6px 0; padding-left: 20px; }
.prose li { margin: 4px 0; }
.prose strong { color: var(--ink); }
.prose table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 11.5px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.prose th { color: var(--brass-2); font-weight: 600; }
.rules-note { margin-top: 16px; font-size: 11px; color: var(--faint); border-top: 1px solid var(--line-soft); padding-top: 12px; }

.score-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.score-table th, .score-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); text-align: right; }
.score-table th:first-child, .score-table td:first-child { text-align: left; }
.score-table thead th { color: var(--faint); font-weight: 500; font-size: 10.5px; letter-spacing: .1em; }
.score-table tr.is-winner td { color: var(--brass-2); }
.score-total { font-family: var(--serif); font-size: 16px; }

/* Toast */
.toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(24, 28, 34, .97); border: 1px solid var(--line); color: var(--ink);
  padding: 10px 18px; border-radius: 999px; font-size: 12.5px; box-shadow: var(--shadow);
  animation: toast-in .22s ease-out;
}
.toast.error { border-color: var(--bad); color: #f0b3a4; }
.toast.success { border-color: #2f5c43; color: #9ed8b4; }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* =========================================================================
   响应式
   ========================================================================= */
@media (max-width: 1180px) {
  .game-shell { grid-template-columns: 220px minmax(0, 1fr) 210px; }
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .home-lower { grid-template-columns: 1fr; }
  .game-view { height: auto; min-height: 100vh; overflow: auto; }
  .game-shell { grid-template-columns: 1fr; }
  .left-rail { order: 2; flex-direction: row; overflow-x: auto; }
  .right-rail { order: 1; }
  .board-main { order: 0; }
  .map-wrap { min-height: 56vh; }
  .left-rail .panel { min-width: 240px; }
  .players-list { flex-direction: row; overflow-x: auto; }
  .player-card { min-width: 168px; }
  .hand-area { position: sticky; bottom: 0; z-index: 30; }
  .lobby-grid { grid-template-columns: 1fr; }
  .seat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .home-nav { padding: 14px 16px; }
  .hero { padding: 14px 16px 26px; }
  .entry-panel { padding: 16px; }
  .feature-row { gap: 20px; }
  .card { width: 68px; height: 92px; }
  .game-topbar { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .game-meta { order: 3; width: 100%; justify-content: flex-start; }
  .action-btn { padding: 7px 10px; font-size: 11.5px; }
  .modal { width: 96vw; }
}

/* 地图内部元素 */
.region-wash { opacity: .16; }
.city-body { fill: #1b2028; stroke: #3a4350; stroke-width: 1.2; }
.city-body.selectable { stroke: var(--brass); }
.city-name { fill: #e9e1cf; font-size: 10.5px; font-family: var(--font); }
.city-name.merchant { fill: #d9c78f; }
.slot { fill: #0d1116; stroke: #333c48; stroke-width: 1; }
.slot.target { stroke: var(--brass); stroke-width: 1.8; fill: #2a2308; cursor: pointer; }
.slot.target:hover { fill: #3a2f0a; }
.tile-rect.target { stroke: var(--brass-2); stroke-width: 2; cursor: pointer; }
.farm-body.target { stroke: var(--brass); stroke-width: 2; cursor: pointer; }
.slot-icon { fill: #6b7a8c; font-size: 7px; text-anchor: middle; }
.tile-rect { stroke: #0a0d11; stroke-width: 1.2; }
.tile-level { font-size: 8px; font-weight: 700; text-anchor: middle; }
.tile-cubes { font-size: 6.5px; text-anchor: middle; }
.link-line { stroke: #2f3a46; stroke-width: 2.4; stroke-linecap: round; }
.link-line.canal { stroke: #3d6172; stroke-dasharray: 4 3; }
.link-line.built { stroke-width: 3.6; }
.link-line.selectable { stroke: var(--brass); stroke-dasharray: 6 4; cursor: pointer; }
.link-line.selectable:hover { stroke: #f0d783; stroke-width: 5; }
.link-label { fill: #4b5867; font-size: 7px; }
.merchant-body { fill: #1a1f18; stroke: #4a5a3c; stroke-width: 1.2; }
.merchant-beer-dot { fill: #c98f2c; }
.merchant-beer-dot.empty { fill: #2b323b; }
.bonus-text { fill: #9fb08a; font-size: 7.5px; }
.farm-body { fill: #1f2418; stroke: #55663f; stroke-width: 1.2; stroke-dasharray: 3 2; }
.highlight-ring { fill: none; stroke: var(--brass-2); stroke-width: 1.6; opacity: .9; }
/* =========================================================================
   视觉升级：城市石板底座 / 牌面 / 黄铜边框 / 首页剪影
   ========================================================================= */

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- 首页剪影 ---------- */
.hero { position: relative; isolation: isolate; }
.hero::before {
  content: "";
  position: absolute;
  inset: -26px -8px;
  z-index: -1;
  border-radius: 24px;
  background: url('art/hero.jpg') center / cover no-repeat;
  opacity: .3;
  mask-image: linear-gradient(100deg, #000 8%, rgba(0, 0, 0, .7) 52%, transparent 86%);
  -webkit-mask-image: linear-gradient(100deg, #000 8%, rgba(0, 0, 0, .7) 52%, transparent 86%);
}
.hero-skyline {
  margin-top: 26px;
  width: 100%;
  max-width: 620px;
  height: 120px;
  opacity: .9;
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
.hero-skyline svg { width: 100%; height: 100%; display: block; }

/* ---------- 手牌：真正的「牌」 ---------- */
.hand-list .card {
  width: 84px;
  height: 110px;
  padding: 0;
  gap: 0;
  overflow: hidden;
  align-items: center;
  justify-content: flex-start;
  border-radius: 9px;
  border: 1px solid #313a46;
  background: linear-gradient(172deg, #1c222b 0%, #12161d 62%, #0d1015 100%);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.hand-list .card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}
.hand-list .card:hover { transform: translateY(-4px); box-shadow: 0 12px 22px rgba(0, 0, 0, .55); }
.card-band {
  width: 100%;
  height: 6px;
  background: var(--band, #4a5260);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .22);
  flex: none;
}
.card-icon {
  width: 44px;
  height: 44px;
  margin: 7px 0 3px;
  border-radius: 50%;
  background: center 42% / 168% no-repeat;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, .42), 0 2px 8px rgba(0, 0, 0, .6);
  flex: none;
  display: grid;
  place-items: center;
  filter: brightness(1.22) contrast(1.08) saturate(1.05);
}
.card-icon.svg-icon { box-shadow: none; background: none; }
.card-icon.svg-icon svg { width: 30px; height: 30px; color: var(--band, #c9a227); }
.art-cotton { background-image: url('art/icon-cotton.jpg'); }
.art-coal { background-image: url('art/icon-coal.jpg'); }
.art-iron { background-image: url('art/icon-iron.jpg'); }
.art-manufacturer { background-image: url('art/icon-manufacturer.jpg'); }
.art-pottery { background-image: url('art/icon-pottery.jpg'); }
.art-brewery { background-image: url('art/icon-brewery.jpg'); }
.hand-list .card-kicker {
  font-size: 7.5px;
  letter-spacing: .18em;
  color: #7d7566;
  flex: none;
}
.hand-list .card-title {
  font-size: 11.5px;
  line-height: 1.25;
  font-weight: 600;
  text-align: center;
  padding: 2px 7px 0;
  max-height: 2.6em;
  overflow: hidden;
}
.hand-list .card-sub { display: none; }
.card.location { background: linear-gradient(172deg, #20303d 0%, #131a21 62%, #0d1116 100%); }
.card.industry { background: linear-gradient(172deg, #241f14 0%, #15120c 62%, #0e0c08 100%); }
.card.wild { background: linear-gradient(172deg, #251a31 0%, #150f1d 62%, #0d0a12 100%); }

/* ---------- 地图纸面与边框 ---------- */
.board-paper { fill: #0e141a; }
.board-vignette { fill: url(#boardVignette); }
.board-frame { fill: none; stroke: #2b2416; stroke-width: 14; }
.board-frame-inner { fill: none; stroke: #7d6520; stroke-width: 1.4; opacity: .75; }
.board-frame-orter { fill: none; stroke: #14181d; stroke-width: 2; }

/* ---------- 城市石板底座 ---------- */
.plinth-shadow { fill: #05070a; opacity: .55; }
.city-body {
  fill: #1a212a;
  stroke: #3c4753;
  stroke-width: 1;
}
.city-body.selectable { stroke: var(--brass); }
.city-head { fill: #0c1218; opacity: .95; }
.city-head-line { stroke-width: 1.3; opacity: .9; fill: none; }
.city-label-bg { fill: #090d12; opacity: .72; }
.city-name { fill: #ece4d3; font-size: 9.5px; letter-spacing: .02em; }
.city-name.merchant { fill: #dcc98f; }

/* ---------- 空格与产业块 ---------- */
.slot { fill: #090d12; stroke: #2f3945; stroke-width: 1; }
.slot-icon { color: #8593a5; }
.slot.target { fill: #2a2308; stroke: var(--brass); stroke-width: 1.8; }
.slot.target .slot-icon { color: var(--brass-2); }
.tile-rect { stroke: #05080b; stroke-width: 1.2; }
.tile-shine { fill: #ffffff; opacity: .14; }
.tile-level { font-size: 8.5px; font-weight: 700; text-anchor: middle; }
.tile-cubes { font-size: 6.5px; text-anchor: middle; }
.tile-rect.target { stroke: var(--brass-2); stroke-width: 2; cursor: pointer; }
.farm-body { fill: #1c2216; stroke: #5a6a44; stroke-width: 1.1; }
.farm-body.target { stroke: var(--brass); stroke-width: 2; }
.merchant-body { fill: #191e16; stroke: #4e5c3e; stroke-width: 1.1; }

/* ---------- 交通线 ---------- */
.link-line { stroke: #4a5766; stroke-width: 2.3; stroke-linecap: round; opacity: .95; }
.link-line.canal { stroke: #3d7186; stroke-dasharray: 5 3; }
.link-line.rail-ties { stroke: #55616f; stroke-width: 1; stroke-dasharray: 1.5 5.5; opacity: .85; }
.link-line.built { stroke-width: 3.6; opacity: 1; filter: drop-shadow(0 0 3px rgba(255, 255, 255, .12)); }
.link-line.built.rail-ties { display: none; }
.link-line.selectable { stroke: var(--brass); stroke-dasharray: 7 4; stroke-width: 3; cursor: pointer; }
.link-line.selectable:hover { stroke: #f3dc93; stroke-width: 5; }

/* ---------- 顶栏与面板微调 ---------- */
.game-topbar { background: linear-gradient(180deg, rgba(18, 22, 28, .96), rgba(11, 14, 18, .92)); }
.panel { background: linear-gradient(165deg, rgba(24, 29, 36, .82), rgba(14, 18, 23, .82)); }
.player-card.is-current { box-shadow: 0 0 0 1px rgba(201, 162, 39, .22), 0 6px 16px rgba(0, 0, 0, .35); }
.action-btn { background: linear-gradient(180deg, #1e252e, #151a21); }
.action-btn:hover:not(:disabled) { box-shadow: 0 0 0 1px rgba(201, 162, 39, .25), 0 4px 10px rgba(0, 0, 0, .35); }

@media (max-width: 620px) {
  .hand-list .card { width: 74px; height: 98px; }
  .card-icon { width: 28px; height: 28px; margin: 7px 0 4px; }
  .hero-skyline { height: 84px; }
}


/* =========================================================================
   可读性：整体放大（用户在 2.5K 屏上反馈"太小，不能正常使用"）
   ========================================================================= */
body { font-size: 15px; }
.game-topbar .meta-chip { font-size: 12.5px; padding: 6px 13px; }
.panel-heading h2 { font-size: 14px; }
.panel-sub { font-size: 10.5px; }
.log-list { font-size: 12.5px; }
.log-entry { line-height: 1.7; }
.player-name { font-size: 13.5px; }
.player-vp { font-size: 21px; }
.stat b { font-size: 13.5px; }
.stat span { font-size: 9.5px; }
.tile-pip { font-size: 10px; padding: 1px 5px; }
.action-btn { font-size: 13.5px; padding: 9px 16px; }
.turn-hint { font-size: 12.5px; }
.phase-bar { font-size: 13.5px; }
.market-count { font-size: 11.5px; }
.merchant-item { font-size: 12px; }
.merchant-buys { font-size: 10.5px; }

.hand-list .card { width: 94px; height: 122px; }
.hand-list .card-title { font-size: 12.5px; }
.hand-list .card-kicker { font-size: 8.5px; }
.card-icon { width: 52px; height: 52px; margin: 8px 0 4px; }
.card-icon.svg-icon svg { width: 34px; height: 34px; }

.zoom-group { display: inline-flex; align-items: center; gap: 4px; }
.zoom-btn { cursor: pointer; font-family: inherit; line-height: 1; }
.zoom-btn:hover { border-color: var(--brass); color: var(--brass-2); }
.zoom-label { min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }

/* 地图可以放大并滚动 */
.map-wrap { display: block; overflow: auto; }
#boardSvg { display: block; height: auto; margin: 0 auto; max-height: none; }

/* =========================================================================
   图例
   ========================================================================= */
.legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 10px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); }
.legend-icon { width: 21px; height: 21px; color: var(--brass-2); flex: none; }
.legend-notes { margin-top: 11px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--faint); line-height: 1.55; }
.legend-notes div { display: flex; align-items: center; gap: 7px; }
.legend-swatch { width: 15px; height: 11px; border-radius: 2px; flex: none; }
.legend-swatch.city { background: #1a212a; border: 1px solid #3c4753; }
.legend-swatch.merchant { background: #191e16; border: 1px solid #4e5c3e; }
.legend-swatch.canal { background: none; border-top: 2px dashed #3d7186; border-radius: 0; height: 0; }
.legend-swatch.rail { background: none; border-top: 2px solid #4a5766; border-radius: 0; height: 0; }
.legend-swatch.beer { width: 10px; height: 10px; border-radius: 50%; background: #c98f2c; }
.legend-swatch.tile { background: #c0392b; border: 1px solid #05080b; }

/* =========================================================================
   外围 UI 再放大一档
   ========================================================================= */
body { font-size: 16px; }
@media (min-width: 1181px) {
  .game-shell { grid-template-columns: 288px minmax(0, 1fr) 276px; }
}
.game-topbar .meta-chip { font-size: 14px; padding: 7px 15px; }
.panel-heading h2 { font-size: 15.5px; }
.panel-sub { font-size: 12px; }
.log-list { font-size: 13.5px; }
.player-name { font-size: 15px; }
.player-vp { font-size: 24px; }
.stat b { font-size: 15px; }
.stat span { font-size: 11px; }
.tile-pip { font-size: 11px; padding: 2px 6px; }
.action-btn { font-size: 15px; padding: 10px 18px; }
.turn-hint { font-size: 14px; }
.phase-bar { font-size: 15px; padding: 11px 16px; }
.market-count { font-size: 13px; }
.merchant-item { font-size: 13.5px; }
.merchant-buys { font-size: 11.5px; }
.hand-list .card { width: 100px; height: 130px; }
.hand-list .card-title { font-size: 13.5px; }
.hand-list .card-kicker { font-size: 9px; }
.card-icon { width: 56px; height: 56px; }
.legend-panel .panel-heading { margin-bottom: 10px; }

/* 产业图标在 56px 下偏暗，提亮一档 */
.card-icon { filter: brightness(1.45) contrast(1.12) saturate(1.08); background-size: 150%; }

/* =========================================================================
   修复：装饰层挡住点击 + 按钮文字颜色
   ========================================================================= */

/* 卡面是 button，浏览器默认按钮文字是黑色，深色卡面上完全看不见 */
button { color: inherit; }
.hand-list .card, .hand-list .card-title, .hand-list .card-kicker { color: var(--ink); }
.hand-list .card-kicker { color: #9a9282; }

/* 地图上的纸面/暗角/边框/文字/阴影都不该拦截点击，只让空位和产业块可点 */
.board-paper,
.board-texture,
.board-vignette,
.board-frame,
.board-frame-inner,
.board-frame-orter,
.region-wash,
.plinth-shadow,
.city-body,
.city-head,
.city-head-line,
.city-name,
.slot-icon,
.plinth-lip,
.tile-shine,
.tile-level,
.tile-cubes,
.highlight-ring,
.merchant-body,
.merchant-beer-dot,
.farm-body,
.bonus-text { pointer-events: none; }

/* 可点区域明确给出手型 */
.slot.target,
.tile-rect.target,
.farm-body.target,
.link-line.selectable { pointer-events: auto; cursor: pointer; }

/* =========================================================================
   线路：河道 / 铁路纹理
   ========================================================================= */
.link-base { stroke: #0a0f14; stroke-width: 9; stroke-linecap: round; opacity: .85; pointer-events: none; }
.link-base.canal { stroke: #0c2028; }
.link-base.rail { stroke: #14100c; }
.link-tex { stroke-width: 7; stroke-linecap: butt; pointer-events: none; opacity: .92; }
.link-own { stroke-width: 2.6; stroke-linecap: round; pointer-events: none; opacity: .95; fill: none;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, .7)); }
.link-line.selectable { stroke: var(--brass); stroke-width: 4.5; stroke-dasharray: 8 5; fill: none;
  pointer-events: auto; cursor: pointer; opacity: .95; }
.link-line.selectable:hover { stroke: #f6e2a4; stroke-width: 6; }

/* 纹理略压暗，避免盖过城镇 */
.link-tex { stroke-width: 6.5; opacity: .78; }

/* 线路加粗，让纹理有空间 */
.link-base { stroke-width: 13; }
.link-tex { stroke-width: 11; opacity: .88; }
.link-own { stroke-width: 3; }

/* 水道颜色略压，避免抢过城镇 */
.link-tex { opacity: .74; }
.link-base { opacity: .7; }

/* =========================================================================
   城市卡：用地区实景做卡面背景
   ========================================================================= */
.hand-list .card.location {
  background-image:
    linear-gradient(180deg, rgba(8, 11, 16, .30) 0%, rgba(8, 11, 16, .68) 45%, rgba(6, 8, 12, .95) 100%),
    var(--card-bg, none);
  background-size: cover, cover;
  background-position: center, center 44%;
  background-repeat: no-repeat;
}
/* 有实景了就不需要图钉 */
.hand-list .card.location .card-icon.svg-icon { display: none; }
.hand-list .card.location { justify-content: flex-end; padding-bottom: 8px; }
.hand-list .card.location .card-title { text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }

/* =========================================================================
   兜底：棋盘基础样式强制覆盖（排查地图不显示）
   ========================================================================= */
.city-body { fill: #1a212a !important; stroke: #3c4753 !important; stroke-width: 1 !important; }
.city-head { fill: #0c1218 !important; opacity: 1 !important; }
.city-head-line { stroke-width: 1.3 !important; opacity: 1 !important; }
.city-name { fill: #ece4d3 !important; font-size: 10px !important; }
.plinth-shadow { fill: #05070a !important; opacity: .6 !important; }
.slot { fill: #0a0e13 !important; stroke: #38424f !important; stroke-width: 1 !important; }
.slot-icon { color: #8593a5 !important; }
.tile-rect { fill-opacity: 1 !important; stroke: #05080b !important; stroke-width: 1.2 !important; }
.tile-level { fill: #0b0e12 !important; }
.link-base { stroke: #0d1a22 !important; stroke-width: 10 !important; opacity: 1 !important; }
.link-tex { stroke: #2f7d8c !important; stroke-width: 7 !important; opacity: .9 !important; stroke-dasharray: none !important; }
.link-own { stroke-width: 3 !important; opacity: 1 !important; }
.merchant-body { fill: #191e16 !important; stroke: #4e5c3e !important; }
.farm-body { fill: #1c2216 !important; stroke: #5a6a44 !important; }
.bonus-text { fill: #9fb08a !important; }

/* =========================================================================
   修复：选牌时的高亮被后面的 .hand-list .card 覆盖掉了
   ========================================================================= */
.hand-list .card.is-valid {
  border-color: #e5c973 !important;
  box-shadow: 0 0 0 2px rgba(229, 201, 115, .5), 0 10px 20px rgba(0, 0, 0, .55) !important;
  transform: translateY(-5px) !important;
  opacity: 1 !important;
}
.hand-list .card.is-valid .card-title { color: #fff6d8 !important; }
.hand-list .card.is-dim { opacity: .25 !important; filter: grayscale(.5); }
.hand-list .card.is-valid:hover { transform: translateY(-7px) !important; }

/* 需要选牌时，阶段条更显眼 */
.phase-bar {
  border-color: #e5c973 !important;
  box-shadow: 0 0 0 1px rgba(229, 201, 115, .25), 0 6px 18px rgba(0, 0, 0, .45);
  position: sticky;
  top: 0;
  z-index: 5;
}

/* =========================================================================
   布局修复：市场回到可见区 / 地图按高度自适应 / 手牌区不被压扁
   ========================================================================= */
/* 左栏三段压缩，保证「市场」永远露出来 */
.left-rail { gap: 8px; }
.market-panel { flex: none; }
.merchant-panel { flex: none; }
.legend-panel { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.legend-notes { display: none; }
.legend-grid { gap: 4px 10px; }
.legend-item { font-size: 12px; gap: 6px; }
.legend-icon { width: 17px; height: 17px; }
.legend-panel .panel-heading { margin-bottom: 6px; }
.merchant-board { gap: 4px; }
.merchant-item { font-size: 12.5px; }
.log-panel { min-height: 90px; }

/* 地图：默认按容器高度铺满，放大时再滚动 */
.map-wrap { display: grid; place-items: center; overflow: auto; }
#boardSvg { height: 100%; width: auto; max-width: none; max-height: none; display: block; margin: 0 auto; }

/* 手牌区不参与压缩 */
.hand-area { flex: none; }
.hand-list { min-height: 0; }
.game-shell { min-height: 0; }

/* =========================================================================
   图例说明恢复（压缩版），并给日志设上限，避免再把市场挤出去
   ========================================================================= */
.legend-notes {
  display: flex !important;
  flex-direction: column;
  gap: 3px;
  margin-top: 7px;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--faint);
}
.legend-notes div { display: flex; align-items: center; gap: 5px; }
.legend-swatch { width: 12px; height: 9px; flex: none; }
.legend-notes .legend-swatch.canal,
.legend-notes .legend-swatch.rail { width: 14px; height: 0; }
.legend-panel .legend-grid { gap: 3px 8px; }
.legend-panel .legend-item { font-size: 11px; }

/* 日志不许无限长，保证市场/商栈/图例永远露出来 */
.log-panel { flex: 1 1 auto; min-height: 64px; max-height: 26vh; }
.log-list { overflow-y: auto; }

/* 放大地图时顶部被裁：居中布局在溢出时会把上沿推到滚动区之外 */
.map-wrap { display: grid; place-items: start center; align-content: start; overflow: auto; }
#boardSvg { margin: 0 auto; }

/* 返回门户按钮（两游戏共用，自包含样式） */
.home-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-right: 12px; padding: 7px 14px;
  border: 1px solid #3f4856; border-radius: 999px;
  background: rgba(18, 22, 28, .82);
  color: #e9e1cf !important; text-decoration: none;
  font-size: 13px; letter-spacing: .02em; white-space: nowrap;
  transition: border-color .16s, color .16s, background .16s;
}
.home-link:hover { border-color: #c9a227; color: #fff6d8 !important; background: rgba(201, 162, 39, .14); }
.home-link:active { transform: translateY(1px); }


/* 棋盘底图：走 CSS 背景，绕开 SVG <image> 的加载问题 */
#boardSvg {
  background-image: url('art/board-v6.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #0e141a;
}
