/* 牌桌布局与组件。桌面：左玩家 · 中蜂窝盘 · 右报表；平板 / 手机：盘面在上，报表在下。 */
.screen { position: relative; z-index: 1; }
.pos { color: var(--good); }
.neg, .bad { color: var(--bad); }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 12px; }
.muted { color: var(--muted); }

/* ---------- 大厅 ---------- */
.lobby { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.lobby-card { position: relative; width: min(820px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: var(--shadow-lg); }
.lobby-brand { display: flex; gap: 16px; align-items: center; }
.brand-line { margin: 0; font-size: 12px; letter-spacing: .3em; color: var(--accent-ink); font-weight: 700; }
.lobby h1 { margin: 2px 0; font-family: var(--display); font-weight: 400; font-size: 44px; line-height: 1.05; color: var(--brand-ink); }
:root[data-theme="dark"] .lobby h1 { color: var(--text); }
.slogan { margin: 2px 0 0; color: var(--text-2); }
.lobby-steps { list-style: none; padding: 0; margin: 20px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; counter-reset: s; }
.lobby-steps li { counter-increment: s; position: relative; padding: 16px 12px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 4px; }
.lobby-steps li::before { content: counter(s); position: absolute; top: -11px; left: 12px; width: 24px; height: 24px; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); background: var(--accent); color: var(--on-accent); font: 700 12px/24px var(--mono); text-align: center; }
.lobby-steps b { font-family: var(--serif); }
.lobby-steps span { color: var(--text-2); font-size: 13px; }
.lobby-form fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.lobby-form legend { font-weight: 700; margin-bottom: 6px; color: var(--muted); font-size: 13px; letter-spacing: .08em; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 40px; padding: 4px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--raised); color: var(--text); cursor: pointer; font-weight: 700; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.seg button small { font-weight: 500; color: var(--muted); font-size: 11px; }
.seg button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.seg button[aria-checked="true"] small { color: inherit; opacity: .75; }
.lobby-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.lobby-error { color: var(--bad); background: var(--bad-soft); border: 1px solid var(--bad); padding: 8px 12px; border-radius: 10px; }

/* ---------- 牌桌框架 ---------- */
.game { height: 100dvh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand b { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--accent-ink); }
.status { display: flex; gap: 6px; flex: 1; min-width: 0; overflow: hidden; flex-wrap: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
.chip b { font-family: var(--mono); color: var(--hi); }
.chip.turn-me { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.chip.age b { font-size: 15px; }
.tools { display: flex; gap: 6px; }
.table { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr) 360px; gap: 10px; padding: 10px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.side { display: none; }
.side.open { display: flex; position: fixed; right: 10px; top: 60px; bottom: 120px; width: min(380px, calc(100vw - 20px)); z-index: 40; flex-direction: column; padding: 10px; }
.side-h { font-weight: 700; margin-bottom: 6px; }
.log { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; display: grid; gap: 4px; align-content: start; font-size: 12.5px; }
.log li { padding: 4px 8px; border-radius: 8px; background: var(--surface-2); border-left: 3px solid var(--line-2); }
.log li.turn { background: transparent; border-left-color: transparent; color: var(--muted); font-size: 11.5px; padding-top: 8px; }
.log li.good { border-left-color: var(--good); }
.log li.bad { border-left-color: var(--bad); }
.log li.world { border-left-color: var(--gold); }

/* ---------- 玩家 ---------- */
.players { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; overflow: auto; }
.pcard { --pc: #5A3F2C; text-align: left; display: grid; gap: 5px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); border-left: 4px solid var(--pc); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; box-shadow: var(--shadow); }
.pcard.cur { outline: 2px solid var(--accent); }
.pcard.sel { background: var(--surface-2); }
.pcard.flow { background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--gold) 18%, var(--surface))); }
.pc-top { display: flex; align-items: center; gap: 8px; }
.av { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #FAF8F2; color: #1A1410; font: 700 16px/1 var(--display); box-shadow: 2px 2px 0 rgba(0, 0, 0, .14), 0 0 0 1px rgba(0, 0, 0, .06); }
.pc-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pc-name b { font-size: 14px; }
.pc-name small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-cash { display: flex; flex-direction: column; align-items: flex-end; }
.pc-cash b { font: 700 14px var(--mono); color: var(--numeral); }
:root[data-theme="dark"] .pc-cash b { color: var(--text); }
.pc-cash small { font: 600 11px var(--mono); }
.pc-bar { position: relative; display: block; height: 20px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.pc-bar i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 70%, transparent); }
.pcard.flow .pc-bar i { background: var(--gold); }
.pc-bar em { position: relative; display: block; font: normal 600 11px/20px var(--sans); padding: 0 6px; color: var(--text); white-space: nowrap; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11px; color: var(--text-2); }
.pips { display: inline-flex; gap: 2px; }
.pips i { width: 6px; height: 10px; border-radius: 2px; background: var(--pip-off); }
.pips i.on { background: var(--pip-on); }

/* ---------- 蜂窝盘 ---------- */
.board-wrap { position: relative; min-height: 0; min-width: 0; display: grid; place-items: center; background: #4A3150; border-radius: 14px; }
#board { width: 100%; height: 100%; max-height: 100%; display: block; user-select: none; }
.ring-line { fill: none; stroke: var(--line-2); stroke-width: .06; stroke-dasharray: .15 .12; }
.ring-line.r-noble { stroke: var(--gold); }
.core-hex { fill: color-mix(in srgb, var(--brand) 92%, #000); stroke: var(--brand-ink); stroke-width: .08; }
.core-logo { color: var(--brand-ink); }
.hex { cursor: pointer; }
.hex .hx { fill: color-mix(in srgb, var(--tc) 22%, var(--raised)); stroke: color-mix(in srgb, var(--tc) 70%, var(--brand-ink)); stroke-width: .05; transition: fill .2s; }
.hex.z-noble .hx { fill: color-mix(in srgb, var(--tc) 30%, color-mix(in srgb, var(--gold) 25%, var(--raised))); }
.hex.t-risk .hx { fill: color-mix(in srgb, #3A2A2A 70%, var(--raised)); }
.hex .g { font: 400 .62px var(--display); text-anchor: middle; fill: color-mix(in srgb, var(--tc) 80%, var(--brand-ink)); pointer-events: none; }
.hex.t-risk .g, .hex.t-risk .n { fill: #F6EEE7; }
.hex .n { font: 600 .22px var(--sans); text-anchor: middle; fill: var(--text-2); pointer-events: none; }
:root[data-theme="dark"] .hex .g { fill: color-mix(in srgb, var(--tc) 60%, #fff); }
.hex.reach .hx { fill: color-mix(in srgb, var(--accent) 45%, var(--raised)); stroke: var(--accent); stroke-width: .12; animation: reach 1.1s ease-in-out infinite; }
.hex.reach.flow-enter .hx { fill: color-mix(in srgb, var(--gold) 60%, var(--raised)); stroke: var(--gold); }
.hex.path .hx { stroke: var(--accent); stroke-width: .1; stroke-dasharray: .12 .08; }
@keyframes reach { 50% { stroke-width: .2; } }
/* 棋子：白色圆片 + 黑字 + 浅色阴影 */
.pawn circle { fill: #F4F1EA; filter: drop-shadow(.1px .1px 0 rgba(0, 0, 0, .28)); }
.pawn text { font-family: var(--display); font-weight: 700; text-anchor: middle; fill: #1A1410; pointer-events: none; }
.pawn.cur circle { stroke: #FFC83D; stroke-width: .06; }
.pawn { transition: transform .15s; pointer-events: none; }
.board-hint { position: absolute; left: 8px; bottom: 6px; font-size: 11px; color: var(--muted); }

/* ---------- 财务报表 ---------- */
.sheet { min-height: 0; min-width: 0; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.sh-head { display: flex; align-items: center; gap: 8px; }
.sh-head > div { flex: 1; display: flex; flex-direction: column; }
.sh-head b { font-family: var(--serif); font-size: 16px; }
.sh-head small { color: var(--muted); font-size: 12px; }
.sh-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.sh-hero > div { display: flex; flex-direction: column; }
.sh-hero small { color: var(--muted); font-size: 11px; }
.sh-hero b { font: 700 26px/1.1 var(--mono); }
.sh-hero b.cash { color: var(--numeral); }
:root[data-theme="dark"] .sh-hero b.cash { color: var(--text); }
.sh-hero em { font-style: normal; font-size: 11px; color: var(--muted); }
.sh-goal { padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--raised); display: grid; gap: 4px; }
.g-head { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.g-head span { font-weight: 700; color: var(--text-2); }
.g-head b { font: 700 16px var(--mono); color: var(--accent-ink); }
.g-head small { margin-left: auto; color: var(--muted); }
.g-track { position: relative; height: 10px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.g-track::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 3px; background: var(--good); }
.g-track i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .5s; }
.sh-goal.ready .g-track i, .sh-goal.done .g-track i { background: var(--good); }
.sh-goal.done { background: color-mix(in srgb, var(--gold) 14%, var(--raised)); }
.sh-goal p { margin: 0; font-size: 12px; color: var(--text-2); }
.sh-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.sh-grid section { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: var(--surface); min-width: 0; }
.sh-grid h4 { margin: 0 0 4px; font-size: 12.5px; display: flex; justify-content: space-between; }
.sh-grid h4 b { font-family: var(--mono); }
.sh-grid ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; font-size: 12px; }
.sh-grid li { display: flex; justify-content: space-between; gap: 6px; border-top: 1px dashed var(--line); padding-top: 2px; }
.sh-grid li:first-child { border-top: 0; }
.sh-grid li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.sh-grid li span small { margin-left: 4px; color: var(--muted); }
.sh-grid li b { font: 600 12px var(--mono); white-space: nowrap; }
.sh-grid li.pas b { color: var(--good); }
.sh-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--text-2); }

/* ---------- 行动栏 ---------- */
.actionbar { border-top: 1px solid var(--line); background: var(--surface); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); display: grid; gap: 6px; }
.ab-hint { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; min-height: 20px; }
.ab-hint .ico { color: var(--accent); width: 16px; height: 16px; }
.ab-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.ab-main, .ab-free { display: flex; gap: 6px; flex-wrap: wrap; }
.ab-main { flex: 1; }
.abtn { min-height: 48px; padding: 4px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--raised); color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; text-align: left; font: inherit; min-width: 104px; touch-action: manipulation; }
.abtn b { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; }
.abtn b .ico { width: 16px; height: 16px; }
.abtn small { font-size: 11px; color: var(--muted); }
.abtn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.abtn.primary small { color: inherit; opacity: .8; }
.abtn:disabled { opacity: .45; cursor: not-allowed; }
.ab-free .abtn { min-width: 90px; min-height: 44px; }
@media (hover: hover) { .abtn:hover:not(:disabled) { border-color: var(--accent); } }

/* ---------- 卡面 ---------- */
.cardface { --cc: var(--accent); width: 220px; border-radius: 14px; overflow: hidden; background: #FFFAF3; color: #24150D; box-shadow: 0 0 0 1px color-mix(in srgb, var(--cc) 40%, transparent) inset, 0 12px 30px rgba(0, 0, 0, .25); display: flex; flex-direction: column; }
.cardface.big { width: 260px; }
.cf-band { display: flex; justify-content: space-between; padding: 4px 10px; background: var(--cc); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.cf-name { padding: 8px 12px 0; font: 800 19px/1.2 var(--serif); }
.cf-hero { padding: 6px 12px; display: flex; flex-direction: column; }
.cf-hero b { font: 700 28px/1 var(--mono); color: #03673B; }
.cf-hero.neg b { color: #B3122E; }
.cf-hero small { font-size: 11px; color: #6A5246; }
.cf-lines { list-style: none; margin: 0 12px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: 12px; }
.cf-lines li { display: flex; justify-content: space-between; border-bottom: 1px dashed rgba(74, 40, 26, .2); }
.cf-lines b { font-family: var(--mono); }
.cf-text { margin: 8px 12px 0; font-size: 12.5px; line-height: 1.45; }
.cf-lesson { margin: 8px 12px 10px; padding: 6px 8px; border-radius: 8px; background: rgba(240, 81, 41, .1); color: #8C3A1E; font-size: 12px; display: flex; gap: 6px; align-items: flex-start; }
.cf-lesson .ico { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.cf-figure { margin: 0 12px 12px; font-size: 11.5px; color: #4A3528; line-height: 1.4; }
.cf-figure b { display: block; color: #7E0029; }
.stage { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(10, 4, 0, .35); animation: fadeIn .15s; cursor: pointer; }
.stage.out { opacity: 0; transition: opacity .18s; }
.stage-in { display: grid; justify-items: center; gap: 10px; animation: pop .25s; }
.stage-banner { padding: 6px 14px; border-radius: 999px; background: var(--dark-chip); color: var(--dark-chip-text); font-weight: 700; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- 弹窗内容 ---------- */
.deal-wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.deal-side { flex: 1; min-width: 220px; display: grid; gap: 10px; }
.deal-nums { display: grid; gap: 8px; }
.deal-nums > div { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; }
.deal-nums small { color: var(--muted); font-size: 11px; }
.deal-nums b { font: 700 18px var(--mono); }
.deal-nums em { font-style: normal; font-size: 12px; color: var(--text-2); }
.lots, .stepper { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lots b, .stepper b { min-width: 80px; text-align: center; font: 700 20px var(--mono); }
.pick-list { display: grid; gap: 6px; margin: 10px 0; }
.pick { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--raised); color: var(--text); cursor: pointer; font: inherit; text-align: left; }
.pick.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.pick small { margin-left: auto; color: var(--muted); }
.prof-nums { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0; }
.prof-nums > div { padding: 6px; border-radius: 10px; background: var(--surface-2); text-align: center; display: flex; flex-direction: column; }
.prof-nums small { font-size: 11px; color: var(--muted); }
.prof-nums b { font: 700 15px var(--mono); }
.result-hero { text-align: center; padding: 6px 0 10px; }
.result-hero .big { font: 400 36px var(--display); color: var(--accent-ink); }
.rank { width: 100%; border-collapse: collapse; font-size: 13px; }
.rank th, .rank td { padding: 6px; border-bottom: 1px solid var(--line); text-align: right; }
.rank th:nth-child(2), .rank td:nth-child(2) { text-align: left; }
.rank td small { display: block; color: var(--muted); font-size: 11px; }
.rank tr.is-me { background: var(--accent-soft); }
.tips { margin: 12px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13px; display: grid; gap: 4px; }
.rules h3 { margin: 12px 0 4px; font-size: 15px; }
.rules ul, .rules ol { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 3px; }


/* ---------- 响应式 ---------- */
@media (max-width: 1280px) { .table { grid-template-columns: 200px minmax(0, 1fr) 320px; } }
@media (max-width: 1100px) {
  .game { height: auto; min-height: 100dvh; }
  .table { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); grid-template-rows: auto auto; align-content: start; grid-template-areas: "players players" "board sheet"; }
  .pcard { align-self: start; }
  .players { grid-area: players; flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .pcard { min-width: 200px; }
  .board-wrap { grid-area: board; aspect-ratio: 1 / 0.95; }
  .sheet { grid-area: sheet; overflow: visible; }
  .actionbar { position: sticky; bottom: 0; z-index: 30; }
}
@media (max-width: 900px) {
  .table { grid-template-columns: minmax(0, 1fr); grid-template-areas: "players" "board" "sheet"; }
  .board-wrap { aspect-ratio: auto; }
  #board { max-height: 70vh; }
}
@media (max-width: 760px) {
  .topbar { padding: 6px 10px; gap: 6px; }
  .brand b { display: none; }
  .status .chip:nth-child(n+4) { display: none; }
  .tools .icon-btn { width: 34px; height: 34px; }
  .table { grid-template-columns: minmax(0, 1fr); grid-template-areas: "players" "board" "sheet"; padding: 8px; }
  .pcard { min-width: 170px; }
  .lobby-steps { grid-template-columns: 1fr; }
  .lobby h1 { font-size: 36px; }
  .ab-row { flex-direction: column; gap: 6px; }
  .ab-main, .ab-free { width: 100%; }
  .ab-main .abtn { flex: 1 1 calc(50% - 6px); min-width: 0; min-height: 44px; }
  .ab-free .abtn { flex: 1 1 0; min-width: 0; min-height: 38px; padding: 2px 8px; }
  .ab-free .abtn small { display: none; }
  .ab-hint { font-size: 12px; }
  .prof-nums { grid-template-columns: repeat(3, 1fr); }
  .sh-grid { grid-template-columns: minmax(0, 1fr); }
  .cardface.big { width: 240px; }
}

/* 特效层（fx.js） */
#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 55; }
.float-text { position: fixed; z-index: 57; font: 700 14px var(--sans); color: #FFE2B0; white-space: nowrap; padding: 2px 9px; border-radius: 8px; background: var(--dark-chip); box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
.float-text.bad { color: #FFB3AA; }
.float-text.good { color: #A8F0D6; }
.banner {
  position: fixed; top: 70px; left: 50%; z-index: 58; padding: 10px 20px; border-radius: 12px; background: var(--dark-chip); color: var(--dark-chip-text);
  border: 1px solid var(--gold); font-weight: 600; display: flex; align-items: center; gap: 8px; box-shadow: 0 12px 30px rgba(0, 0, 0, .3); white-space: nowrap;
}
.banner.bad { border-color: #FF8A80; }
.banner.world { border-color: #8ED8F5; }
.banner .ico { width: 20px; height: 20px; color: #FFB45E; }
@media (max-width: 760px) { .banner { white-space: normal; max-width: calc(100vw - 32px); font-size: 13px; } }
.ab-hint > span { min-width: 0; }
.ab-hint > span .ico { vertical-align: -3px; margin-right: 2px; }
@media (max-width: 760px) { .toasts { top: 58px; bottom: auto; left: 8px; right: 8px; max-width: none; } }
/* 资金方案（项目牌里：现金 → 银行贷款 → 找人借） */
.fund { border: 1px solid var(--accent); border-radius: 12px; padding: 8px 10px; background: var(--accent-soft); display: grid; gap: 6px; }
.fund-h { font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fund-h small { font-weight: 400; color: var(--text-2); }
.fund ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fund li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.fund li span { display: flex; flex-direction: column; }
.fund li small { color: var(--muted); font-size: 11px; }
.fund li b { font: 700 14px var(--mono); white-space: nowrap; }
.fund li.off { opacity: .5; }
.fund li.gap b { color: var(--bad); }
.fund .btn { justify-self: start; }
.fund p { margin: 0; font-size: 12.5px; }
/* 财富报表（简化版：三行 + 资产） */
.sh-lines, .sh-exp, .sh-assets ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.sh-lines { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--raised); }
.sh-lines li, .sh-exp li, .sh-assets li { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 13px; }
.sh-lines li span, .sh-assets li span { min-width: 0; color: var(--text-2); }
.sh-lines li b, .sh-exp li b, .sh-assets li b { font: 700 14px var(--mono); white-space: nowrap; }
.sh-lines li.pas b { color: var(--good); }
.sh-lines li.exp b { color: var(--bad); }
.sh-lines li.tot { border-top: 2px solid var(--line-2); margin-top: 4px; padding-top: 4px; font-weight: 700; }
.sh-lines li.tot b { font-size: 16px; }
.sh-exp { padding: 4px 12px 6px 22px; font-size: 12px; }
.sh-exp li { font-size: 12px; color: var(--text-2); }
.sh-exp li b { font-size: 12px; }
.link { border: 0; background: none; color: var(--accent-ink); text-decoration: underline; cursor: pointer; font: inherit; font-size: 11.5px; padding: 0 2px; }
.sh-assets { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--surface); }
.sh-assets h4 { margin: 0 0 4px; font-size: 12.5px; }
.sh-assets li { border-top: 1px dashed var(--line); padding-top: 3px; }
.sh-assets li:first-child { border-top: 0; }
.sh-assets li span small { margin-left: 6px; color: var(--muted); font-size: 11px; }
.fund p { line-height: 1.5; }
/* 负圈（内环）整体压暗一点，和贯圈区分开 */
.hex.z-inner .hx { stroke-dasharray: none; filter: saturate(.85) brightness(.96); }
:root[data-theme="dark"] .hex.z-inner .hx { filter: saturate(.8) brightness(.85); }

/* ---------- 19 格蜂窝盘（打印版样式：颜色 = 属性，边上印骰子点） ---------- */
#board .hex .hx { stroke: none; filter: none; stroke-dasharray: none; }
#board .rim { fill: none; filter: drop-shadow(0 .1px .04px rgba(20, 5, 25, .5)); stroke: #8E73B4; stroke-width: .5; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
#board .hex.c-blue .hx { fill: #284B94; }
#board .hex.c-yellow .hx { fill: #B88020; }
#board .hex.c-red .hx { fill: #CE405A; }
#board .hex.c-white .hx { fill: #A8B8CB; }
#board .hex.t-market .hx { fill: #ADC6B0; }

#board .hex .g { font: 400 .5px var(--display); text-anchor: middle; fill: rgba(255, 255, 255, .95); pointer-events: none; }
#board .hex .n { font: 700 .16px var(--sans); text-anchor: middle; fill: rgba(255, 255, 255, .9); pointer-events: none; letter-spacing: .02em; }
#board .hex.c-white .g, #board .hex.c-yellow .g { fill: rgba(30, 5, 0, .75); }
#board .hex.c-white .n, #board .hex.c-yellow .n { fill: rgba(30, 5, 0, .65); }
:root[data-theme="dark"] #board .hex.c-white .g, :root[data-theme="dark"] #board .hex.c-white .n { fill: rgba(255, 255, 255, .85); }
#board .pips { pointer-events: none; }
#board .pip circle { fill: #1E0500; }
#board .hex .mid-logo { color: rgba(240, 81, 41, .35); pointer-events: none; }
#board .hex.reach .hx { stroke: var(--brand-ink); stroke-width: .1; filter: brightness(1.08) drop-shadow(0 0 .08px rgba(240, 81, 41, .9)); animation: reach 1.1s ease-in-out infinite; }
:root[data-theme="dark"] #board .hex.reach .hx { stroke: #FF8A5C; }
@keyframes reach { 50% { stroke-width: .16; } }
#board .mv line { stroke: var(--brand-ink); stroke-width: .07; stroke-linecap: round; opacity: .75; }
#board .mv circle { fill: var(--brand); stroke: #fff; stroke-width: .04; }
#board .mv text { font: 700 .22px var(--mono); text-anchor: middle; fill: #fff; }
:root[data-theme="dark"] #board .mv line { stroke: #FF8A5C; }

/* ---------- 手机 / 竖屏平板：手游式排布 ----------
   顶部 HUD（年龄 · 轮次 · 谁的回合 + 菜单）→ 对手头像条 → 盘面占满中间 → 我的状态条 → 拇指区大按钮。
   报表做成底部抽屉（点状态条或对手头像拉出），战报同样从底部弹出，页面本身不滚动。 */
.menu-btn, .me-hud, .sh-close, .pc-wan { display: none; }
.drawer-scrim { position: fixed; inset: 0; z-index: 44; background: rgba(10, 4, 0, .45); animation: fadeIn .15s; }
@media (max-width: 900px), (orientation: landscape) and (max-height: 560px) {
  .game { height: 100dvh; min-height: 0; overflow: hidden; }
  .topbar { position: relative; padding: 6px 10px; gap: 6px; }
  .brand b { display: none; }
  .status { gap: 4px; }
  .status .chip:nth-child(n+4):not([data-countdown]) { display: none; }
  .menu-btn { display: inline-grid; flex: none; }
  .tools { display: none; position: absolute; right: 8px; top: calc(100% + 4px); z-index: 50; flex-direction: column; gap: 4px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
  .topbar.menu-open .tools { display: flex; }
  .tools .icon-btn { width: 44px; height: 44px; }

  .table { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 6px 8px; }
  /* 对手：一排小头像卡（头像 + 现金 + 细进度条），当前行动者高亮 */
  .players { flex: none; flex-direction: row; gap: 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .players .pcard.mine { display: none; }
  .players .pcard { flex: 1 1 0; min-width: 64px; max-width: 160px; padding: 4px 6px; gap: 3px; border-left-width: 1px; border-radius: 12px; }
  .players .pc-top { gap: 5px; }
  .players .av { width: 24px; height: 24px; font-size: 13px; }
  .players .pc-name small, .players .pc-tags, .players .pc-bar em, .players .pc-cash small { display: none; }
  .players .pc-name { display: none; }
  .players .pc-top { gap: 2px; }
  .players .pc-cash { margin-left: auto; }
  @media (max-width: 420px) {
    .players .pcard { min-width: 0; padding: 4px 3px 5px; }
    .players .pc-top { flex-direction: column; }
    .players .pc-cash { margin: 0; align-items: center; }
  }
  .players .pc-cash b { display: none; }
  .players .pc-cash b.pc-wan { display: block; font-size: 12px; white-space: nowrap; }
  .players .pc-bar { height: 4px; border-radius: 3px; }
  .players .pcard.cur { outline: 2px solid #FFC83D; outline-offset: -1px; }
  .players .pcard.sel { background: var(--surface); }

  .board-wrap { flex: 1; min-height: 0; aspect-ratio: auto; }
  #board { max-height: none; }
  .board-hint { display: none; }

  /* 我的状态条 */
  .me-hud { flex: none; display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); box-shadow: var(--shadow); font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; }
  .me-hud .av { width: 32px; height: 32px; }
  .mh-money { display: flex; flex-direction: column; flex: none; }
  .mh-money small, .mh-goal small, .mh-more small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
  .mh-money b { font: 700 15px/1.15 var(--mono); color: var(--numeral); }
  :root[data-theme="dark"] .mh-money b { color: var(--text); }
  .mh-money b.pos { color: var(--good); } .mh-money b.neg { color: var(--bad); }
  .mh-goal { flex: 1; min-width: 0; display: grid; gap: 3px; }
  .mh-goal small { overflow: hidden; text-overflow: ellipsis; }
  .mh-goal small i { font-style: normal; }
  .mh-goal .g-track { height: 6px; }
  .mh-goal.ready .g-track i { background: var(--good); }
  .mh-stats { display: flex; gap: 6px; align-items: center; font-size: 10.5px; color: var(--text-2); white-space: nowrap; }
  .mh-stats .pips i { width: 4px; height: 8px; }
  .mh-more { flex: none; display: flex; flex-direction: column; align-items: center; color: var(--accent-ink); }
  .mh-more .ico { width: 18px; height: 18px; }

  /* 报表 = 底部抽屉 */
  .sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; margin: 0 auto; width: min(560px, 100%); max-height: 82dvh; overflow: auto; overscroll-behavior: contain;
    border-radius: 20px 20px 0 0; padding: 18px 14px calc(14px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .22s ease-out; visibility: hidden; }
  .sheet::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line-2); }
  body.sheet-open .sheet { transform: none; visibility: visible; }
  .sh-close { display: inline-grid; width: 36px; height: 36px; }
  .sh-grid { grid-template-columns: minmax(0, 1fr); }

  /* 战报 = 底部弹层 */
  .side.open { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-width: 560px; margin: 0 auto; height: 60dvh; z-index: 46; border-radius: 18px; }

  /* 提示浮在盘面上方（对手条下面），不挡操作 */
  .toasts { top: 104px; bottom: auto; left: 12px; right: 12px; max-width: 520px; margin: 0 auto; pointer-events: none; justify-items: center; }
  .ab-nums { display: none; }
  .toasts .toast:nth-last-child(n+3) { display: none; }
  body:has(.modal-back) .toast:not(.error) { display: none; }
  body:has(.modal-back) .toasts { top: 8px; }

  /* 行动栏：拇指区，按钮两列铺满 */
  .actionbar { position: static; padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); gap: 5px; }
  .ab-hint { font-size: 12.5px; line-height: 1.35; }
  .ab-row { flex-direction: column; gap: 6px; }
  .ab-main, .ab-free { width: 100%; }
  .ab-main .abtn { flex: 1 1 calc(50% - 6px); min-width: 0; min-height: 52px; border-radius: 14px; }
  .ab-main .abtn.primary { box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 60%, #000); }
  .ab-free .abtn { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 2px 8px; }
  .ab-free .abtn small { display: none; }
}
/* 手机横屏：盘面在左，右边一栏从上到下放对手、我的状态条、行动按钮 */
@media (orientation: landscape) and (max-height: 560px) {
  .game { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 46%); grid-template-rows: auto auto auto minmax(0, 1fr); }
  .topbar { grid-column: 1 / -1; padding: 4px 10px; }
  .table { display: contents; }
  .board-wrap { grid-column: 1; grid-row: 2 / 5; margin: 0 0 8px 8px; }
  .players { grid-column: 2; grid-row: 2; margin: 6px 8px 0; }
  .me-hud { grid-column: 2; grid-row: 3; width: auto; margin: 6px 8px 0; }
  .actionbar { grid-column: 2; grid-row: 4; align-self: end; border-top: 0; background: transparent; overflow: auto; }
  .ab-main .abtn { flex: 1 1 calc(33% - 6px); min-height: 42px; padding: 2px 8px; }
  .ab-main .abtn small { display: none; }
  .ab-main .abtn b { font-size: 13px; }
  .toasts { top: 8px; left: 8px; right: auto; width: 54%; }
}
@media (max-width: 480px) {
  .rank { font-size: 12px; }
  .rank th, .rank td { padding: 5px 3px; white-space: nowrap; }
  .rank th:nth-child(3), .rank td:nth-child(3) { display: none; }
  .rank td small { white-space: normal; }
}
/* 矮屏手机（如 360×640）：按钮只留标题（不能选的仍显示原因），把高度留给盘面 */
@media (max-width: 900px) and (orientation: portrait) and (max-height: 720px) {
  .ab-main .abtn { min-height: 40px; padding: 2px 10px; }
  .ab-main .abtn small { display: none; }
  .ab-main .abtn:disabled small { display: block; }
  .ab-free .abtn { min-height: 36px; }
  .ab-hint { font-size: 12px; }
  .me-hud { padding: 4px 8px; }
}
/* 急卖弹窗 */
.qs-list { display: grid; gap: 8px; margin: 10px 0; }
.qs-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.qs-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.qs-row small { font-size: 12px; color: var(--text-2); }
.qs-row .btn { flex: none; }
@media (max-width: 480px) { .qs-row { flex-direction: column; align-items: stretch; } }
.sh-note { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
