/* 口袋牌局 · 样式
   顺序：变量 → 页头页脚 → 首页 → 游戏页外壳 → 牌与牌桌 → 通用小部件 → 弹层 → 响应式 */

:root {
  --ink: #221c16;
  --ink-soft: #5c5247;
  --paper: #f5f0e6;
  --paper-2: #ebe4d4;
  --card-bg: #fffdf8;
  --pine: #14382c;
  --pine-2: #1d5340;
  --gold: #e4c56a;
  --accent: #a9761f;
  --heart: #d7263d;
  --felt: #1b7a44;
  --felt-2: #146338;
  --line: rgba(34, 28, 22, 0.12);
  --card-w: 72px;
  --card-h: 104px;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(34, 28, 22, 0.06), 0 10px 28px rgba(34, 28, 22, 0.08);
  color-scheme: light;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Segoe UI", sans-serif;
}

html.dark {
  --ink: #f4efe6;
  --ink-soft: #b9b0a2;
  --paper: #15130f;
  --paper-2: #211c16;
  --card-bg: #221d17;
  --line: rgba(244, 239, 230, 0.12);
  --accent: #e4c56a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1000px 320px at 8% -8%, rgba(228, 197, 106, 0.22), transparent 55%),
    radial-gradient(800px 300px at 100% 0%, rgba(29, 83, 64, 0.12), transparent 60%),
    var(--paper);
  color: var(--ink);
  line-height: 1.5;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- 页头 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 60px;
  padding: 8px max(18px, calc((100% - 1240px) / 2));
  background: linear-gradient(180deg, var(--pine-2), var(--pine));
  color: #f6f1e6;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 148px; }
.mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(145deg, #fff8e4, #e9d59a); color: var(--pine);
  font-family: Palatino, "Songti SC", serif; font-weight: 700; font-size: 18px;
}
.brand b { display: block; font-size: 16px; letter-spacing: 0.04em; }
.brand small { display: block; opacity: 0.7; letter-spacing: 0.14em; font-size: 10px; }
.nav-main { display: flex; flex-wrap: wrap; gap: 4px 6px; flex: 1; }
.nav-main a {
  color: #f6f1e6; text-decoration: none; padding: 6px 10px; border-radius: 999px; font-size: 14px;
}
.nav-main a[aria-current="page"] { background: rgba(255, 255, 255, 0.16); }
.nav-main a:hover { background: rgba(255, 255, 255, 0.1); }
.top-actions { display: flex; gap: 8px; }
.ghost {
  color: #f6f1e6; text-decoration: none; background: transparent;
  border: 1px solid rgba(246, 241, 230, 0.32); border-radius: 999px; padding: 6px 14px; font-size: 14px;
}
.ghost:hover { background: rgba(255, 255, 255, 0.1); }

.wrap { width: min(1240px, calc(100% - 28px)); margin: 20px auto 40px; }

/* ---------- 广告位（尺寸预留，避免接入后页面跳动） ---------- */
.ad {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px auto;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
}
.ad .ad-tag {
  position: absolute; top: 4px; left: 8px; font-size: 10px; letter-spacing: 0.08em;
  color: var(--ink-soft); opacity: 0.7; z-index: 1;
}
.ad.is-empty {
  border: 1px dashed var(--line);
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(34, 28, 22, 0.025) 10px 20px);
  color: var(--ink-soft);
}
.ad .ad-hold { font-size: 13px; opacity: 0.55; }
.ad-top { min-height: 90px; max-width: 970px; }
.ad-inline { min-height: 120px; max-width: 970px; margin-top: 16px; }
.ad-foot { min-height: 90px; max-width: 970px; margin-bottom: 20px; }
.ad-side { min-height: 250px; }

/* ---------- 首页 ---------- */
.hero {
  display: flex; justify-content: space-between; gap: 28px; align-items: center;
  padding: 30px 32px; margin-bottom: 8px; border-radius: 24px; color: #f6f1e6;
  background:
    radial-gradient(600px 240px at 90% 10%, rgba(228, 197, 106, 0.28), transparent 60%),
    linear-gradient(135deg, #1d5340, #0f2c22);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-copy { max-width: 640px; }
.eyebrow {
  display: inline-block; font-size: 12px; letter-spacing: 0.08em; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); color: #f2e4b6; margin-bottom: 10px;
}
.hero h1 {
  font-family: Palatino, "Songti SC", "Iowan Old Style", serif;
  font-size: 46px; line-height: 1.05; margin: 0 0 12px;
}
.hero p { margin: 0 0 18px; max-width: 520px; opacity: 0.92; font-size: 16px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-primary, .btn-soft {
  border-radius: 999px; padding: 10px 20px; font-size: 15px; text-decoration: none; border: 1px solid transparent; display: inline-block;
}
.btn-primary { background: linear-gradient(180deg, #f0d68a, #d7b04f); color: #2a2110; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-soft { background: rgba(255, 255, 255, 0.12); color: #f6f1e6; border-color: rgba(255, 255, 255, 0.25); }
.btn-soft:hover { background: rgba(255, 255, 255, 0.2); }
.hero-cards { position: relative; width: 260px; height: 190px; flex: 0 0 auto; }
.deco {
  position: absolute; width: 96px; height: 138px; border-radius: 10px; background: #fffdf8; color: #1b1b1b;
  font-family: Palatino, serif; font-weight: 700; font-size: 30px; padding: 8px 10px; line-height: 1;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}
.deco i { display: block; font-style: normal; font-size: 26px; }
.deco.red { color: #c81e1e; }
.deco.c1 { left: 0; top: 30px; transform: rotate(-14deg); }
.deco.c2 { left: 44px; top: 16px; transform: rotate(-4deg); }
.deco.c3 { left: 92px; top: 14px; transform: rotate(7deg); }
.deco.c4 { left: 138px; top: 30px; transform: rotate(17deg); }

.chips-row { display: flex; gap: 8px; margin: 14px 0 10px; flex-wrap: wrap; }
.filter {
  border: 1px solid var(--line); background: var(--card-bg); border-radius: 999px; padding: 6px 16px; font-size: 14px;
}
.filter.on { background: var(--pine); color: #f6f1e6; border-color: var(--pine); }
html.dark .filter.on { background: var(--gold); color: #221c16; border-color: var(--gold); }

.menu { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.menu.rich { grid-template-columns: repeat(2, 1fr); gap: 16px; }
.col {
  background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
}
.col h2 { margin: 0 0 10px; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.col h2 em { margin-left: auto; font-style: normal; font-size: 12px; opacity: 0.55; font-weight: 400; }
.tone-heart { color: var(--heart); }
.tone-spade { color: #222; }
html.dark .tone-spade { color: #f4efe6; }
.tone-diamond { color: #c9842a; }
.tone-club { color: #2f6b43; }
.col > a, .col .tiles > a {
  display: flex; justify-content: space-between; gap: 8px; text-decoration: none; padding: 7px 4px; border-top: 1px solid var(--line);
}
.col a span { opacity: 0.55; font-size: 12px; }
.col a:hover { background: rgba(228, 197, 106, 0.2); }

.menu.rich .tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.menu.rich .tile {
  display: grid; grid-template-columns: 42px 1fr; grid-template-rows: auto auto; gap: 0 10px; align-items: center;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; background: var(--paper);
  position: relative; transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.menu.rich .tile:hover { transform: translateY(-2px); border-color: #c9a24a; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1); background: var(--paper); }
.tile .ico {
  grid-row: 1 / 3; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(145deg, #2a8a52, #14603a); color: #fff;
}
.tile .tt { display: flex; flex-direction: column; min-width: 0; }
.tile .tt strong { font-size: 15px; }
.tile .tt small { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .pl { grid-column: 2; font-size: 11px; color: var(--accent); opacity: 1; margin-top: 2px; }
.tile:hover span { opacity: 1; }

/* ---------- 游戏页外壳 ---------- */
.game-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin: 4px 0 12px; flex-wrap: wrap; }
.game-head .title h1 { font-family: Palatino, "Songti SC", serif; font-size: 34px; margin: 0; line-height: 1.1; }
.game-head .en { opacity: 0.5; margin-left: 10px; font-size: 14px; font-family: inherit; font-weight: 400; }
.game-head .blurb { margin: 4px 0 0; color: var(--ink-soft); }
.game-head .actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pill {
  background: var(--card-bg); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 14px;
}
.pill:hover { border-color: #c9a24a; }
.pill.primary { background: var(--pine); border-color: var(--pine); color: #f6f1e6; }
html.dark .pill.primary { background: var(--gold); color: #221c16; border-color: var(--gold); }
.pill.ghosty { background: transparent; color: var(--ink-soft); }

.howto {
  background: linear-gradient(180deg, #fff7dc, #fbedc2); border: 1px solid #ecd58d; border-radius: 14px;
  padding: 12px 16px; margin-bottom: 12px; color: #3b2f0b;
}
html.dark .howto { background: #2c2510; border-color: #5b4a1a; color: #f0e2b0; }
.howto .goal { margin: 0; font-size: 16px; }
.howto .goal b {
  display: inline-block; background: #3b2f0b; color: #fdeeb3; border-radius: 6px; padding: 0 8px; margin-right: 8px; font-size: 13px;
}
html.dark .howto .goal b { background: #e4c56a; color: #221c16; }
.howto details { margin-top: 8px; }
.howto summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.howto ol { margin: 8px 0 4px; padding-left: 1.4em; }
.howto li { margin: 4px 0; }
.howto .tip { margin: 6px 0 0; font-size: 14px; }

.stage { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.stage-main { min-width: 0; }
.stage-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 12px; }
.stage-side .ad { margin: 0; }
.side-card { background: var(--card-bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.side-card h3 { margin: 0 0 6px; font-size: 15px; }
.side-card p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.mini-list { display: flex; flex-direction: column; }
.mini-list a { padding: 6px 2px; text-decoration: none; border-top: 1px solid var(--line); font-size: 14px; }
.mini-list a:first-child { border-top: 0; }
.mini-list a:hover { color: var(--accent); }

.hud { display: flex; gap: 10px; align-items: center; min-height: 32px; margin-bottom: 8px; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.hud-item { background: var(--card-bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px 10px; font-size: 14px; }
.scores { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border-radius: 999px; padding: 3px 12px; background: var(--card-bg); border: 1px solid var(--line); font-size: 14px;
}
.chip.on { border-color: var(--gold); background: rgba(228, 197, 106, 0.28); font-weight: 600; }

.hint {
  display: flex; gap: 10px; align-items: center; padding: 10px 14px; margin-bottom: 8px; min-height: 46px;
  background: var(--pine); color: #f6f1e6; border-radius: 12px; font-size: 15px;
}
.hint-ico { font-size: 18px; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }

.rail {
  background: linear-gradient(180deg, #7a4b2c, #3d2416 40%, #2a1810); border-radius: 22px; padding: 10px;
  box-shadow: 0 16px 40px rgba(40, 24, 12, 0.22);
}
.felt {
  position: relative; min-height: 480px; border-radius: 14px; padding: 16px;
  background:
    radial-gradient(900px 300px at 50% 0%, rgba(255, 255, 255, 0.16), transparent 50%),
    radial-gradient(700px 500px at 50% 120%, rgba(0, 0, 0, 0.28), transparent 60%),
    var(--felt);
  color: #f7f3ea; overflow: auto;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.4);
}
.note { min-height: 1.4em; margin: 10px 2px 0; color: var(--ink-soft); font-size: 14px; }
.note a { color: var(--accent); margin: 0 4px; }

/* ---------- 牌与牌桌 ---------- */
.table { display: flex; flex-direction: column; gap: 14px; min-width: 640px; }
.spread { display: flex; gap: 10px; align-items: flex-start; }
.grow { flex: 1; }
.pile, .column { position: relative; width: var(--card-w); min-height: var(--card-h); }
.stack .card + .card, .column .card + .card { margin-top: calc(var(--card-h) * -0.74); }
.freecell-board .column .card + .card { margin-top: calc(var(--card-h) * -0.6); }
.fan { display: flex; }
.fan .card + .card { margin-left: calc(var(--card-w) * -0.5); }
.hand-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.count {
  position: absolute; right: -6px; bottom: -6px; background: #f6f1e6; color: var(--pine);
  border-radius: 99px; min-width: 22px; text-align: center; font-size: 12px; font-weight: 700;
}

.card, .slot {
  width: var(--card-w); height: var(--card-h); border-radius: 9px; position: relative; padding: 0; flex: 0 0 auto; user-select: none;
}
.card {
  border: 1px solid #cfc7b8;
  background: linear-gradient(180deg, #fff, #f8f5ee);
  color: #1b1b1b;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 6px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s;
}
.card.red { color: #c81e1e; }
.card.small { transform: scale(0.9); transform-origin: top left; }
.card.back {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.22), transparent 42%),
    repeating-linear-gradient(45deg, #24634b 0 6px, #184636 6px 12px);
  border: 3px solid #f6f1e6;
  color: rgba(246, 241, 230, 0.85);
}
.back-mark { font-size: 26px; }
.card.is-selected { outline: 3px solid var(--gold); transform: translateY(-10px); }
.hand-row .card:not(:disabled):not(.is-selected):hover,
.fan-hand .card:not(:disabled):not(.is-selected):hover { transform: translateY(-8px); box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2), 0 14px 20px rgba(0, 0, 0, 0.3); }
/* 现在不能出的牌：变灰，光标提示不可点 */
.card:disabled { filter: brightness(0.7) saturate(0.4); cursor: not-allowed; }
.card.back:disabled { filter: none; cursor: default; }
/* 现在可以出的牌：底部亮条，一眼看出该点哪张 */
.hand-row .card:not(:disabled):not(.back)::after,
.fan-hand .card:not(:disabled):not(.back)::after {
  content: ""; position: absolute; left: 14%; right: 14%; bottom: -5px; height: 3px; border-radius: 3px; background: var(--gold);
}
.card:focus-visible, .slot:focus-visible, .choice:focus-visible { outline: 3px solid var(--gold); }
.corner { position: absolute; top: 4px; left: 5px; display: flex; flex-direction: column; align-items: center; line-height: 1; font-size: 15px; font-weight: 700; }
.corner i { font-size: 13px; }
.corner.br { top: auto; left: auto; right: 5px; bottom: 4px; transform: rotate(180deg); }
.corner i, .pip, .face i { font-style: normal; }
.pips { position: absolute; inset: 20px 12px; }
.pip { position: absolute; font-size: 17px; }
.pip.n { top: 0; left: 50%; transform: translateX(-50%); }
.pip.s { bottom: 0; left: 50%; transform: translateX(-50%) rotate(180deg); }
.pip.w { top: 50%; left: 0; transform: translateY(-50%); }
.pip.e { top: 50%; right: 0; transform: translateY(-50%); }
.pip.c { top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 26px; }
.pip.nw { top: 0; left: 0; }
.pip.ne { top: 0; right: 0; }
.pip.sw { bottom: 0; left: 0; transform: rotate(180deg); }
.pip.se { bottom: 0; right: 0; transform: rotate(180deg); }
.pip.cn { top: 18%; left: 50%; transform: translateX(-50%); }
.pip.cs { bottom: 18%; left: 50%; transform: translateX(-50%) rotate(180deg); }
.pip.cw { top: 32%; left: 0; }
.pip.ce { top: 32%; right: 0; }
.face {
  position: absolute; inset: 18px 9px; border: 2px solid currentColor; border-radius: 6px; display: grid; place-items: center;
  font-size: 28px; background: rgba(228, 197, 106, 0.16);
}
.face b { font-family: Palatino, "Songti SC", serif; }
.slot {
  border: 2px dashed rgba(255, 255, 255, 0.4); background: rgba(0, 0, 0, 0.14); color: rgba(255, 255, 255, 0.85); font-size: 13px;
}
.joker { color: #7a1f6a; }
.card .mid { display: none; }

.msg, .pending {
  margin: 12px auto; max-width: 480px; text-align: center; background: rgba(0, 0, 0, 0.28); border-radius: 12px; padding: 12px;
}
.board-btn, .btn, .choice { padding: 9px 16px; }
.board-btn {
  border-radius: 999px; border: 0; background: linear-gradient(180deg, #fbf4e0, #eadfc2); color: var(--pine); font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); margin: 2px;
}
.board-btn:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.board-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.feature, .btn, .choice {
  border: 1px solid var(--line); background: var(--card-bg); border-radius: 14px; text-decoration: none;
}
.btn:hover, .choice:hover { border-color: #c9a24a; }

/* 通用牌桌布局（ui.js 提供）：上下左右四个座位，中间是出牌区 */
.seat-table { display: grid; gap: 10px; min-width: 0; grid-template-columns: minmax(84px, 1fr) minmax(0, 2.4fr) minmax(84px, 1fr); grid-template-areas: ". top ." "left mid right" "bottom bottom bottom"; }
.seat-table.three { grid-template-areas: "left . right" "mid mid mid" "bottom bottom bottom"; grid-template-columns: 1fr 1fr 1fr; }
.seat-table.two { grid-template-areas: "top top top" "mid mid mid" "bottom bottom bottom"; grid-template-columns: 1fr; }
.seat { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 8px; border-radius: 12px; border: 2px solid transparent; }
.seat.pos-top { grid-area: top; }
.seat.pos-left { grid-area: left; }
.seat.pos-right { grid-area: right; }
.seat.pos-bottom { grid-area: bottom; }
.seat.turn { border-color: var(--gold); background: rgba(228, 197, 106, 0.14); }
.seat .who { font-size: 14px; font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
.seat .who small { font-weight: 400; opacity: 0.85; background: rgba(0, 0, 0, 0.25); padding: 0 8px; border-radius: 99px; }
.seat .who .tag { background: var(--gold); color: #2a2110; border-radius: 99px; padding: 0 8px; font-size: 12px; font-weight: 700; }
.mini-backs { display: flex; justify-content: center; align-items: center; height: 46px; max-width: 100%; overflow: hidden; }
.mini-backs .mb { width: 26px; height: 40px; border-radius: 4px; border: 2px solid #f6f1e6; background: repeating-linear-gradient(45deg, #24634b 0 4px, #184636 4px 8px); margin-left: -16px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }
.mini-backs .mb:first-child { margin-left: 0; }
.open-hand { display: flex; flex-wrap: wrap; justify-content: center; zoom: 0.55; max-width: 100%; gap: 4px; }
.open-hand .card { margin: 0; }
.bid-box { width: 100%; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.bid-hist { font-size: 13px; text-align: center; }
.bid-grid { display: grid; grid-template-columns: repeat(5, minmax(48px, 64px)); gap: 4px; }
.bid-btn { padding: 5px 0; border-radius: 8px; border: 0; background: #fbf4e0; color: #1b1b1b; font-weight: 700; font-size: 14px; }
.bid-btn.red { color: #c81e1e; }
.bid-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.bid-btn:not(:disabled):hover { background: var(--gold); }
.play-area { grid-area: mid; display: grid; place-items: center; min-height: calc(var(--card-h) * 1.5 + 30px); position: relative; padding: 8px; background: rgba(0, 0, 0, 0.14); border-radius: 16px; }
.play-area .center-note { position: absolute; top: 8px; left: 12px; font-size: 13px; opacity: 0.9; }
.trick-cards { display: grid; gap: 6px; grid-template-columns: repeat(3, auto); grid-template-rows: repeat(3, auto); align-items: center; justify-items: center; }
.trick-cards .tc { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; }
.trick-cards .tc .card { pointer-events: none; }
.trick-cards .tc.pos-top { grid-column: 2; grid-row: 1; }
.trick-cards .tc.pos-left { grid-column: 1; grid-row: 2; }
.trick-cards .tc.pos-right { grid-column: 3; grid-row: 2; }
.trick-cards .tc.pos-bottom { grid-column: 2; grid-row: 3; }
.trick-cards .tc.win .card { outline: 3px solid var(--gold); }
.empty-hint { font-size: 14px; opacity: 0.8; text-align: center; padding: 12px; }
.hand-zone { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hand-zone .fan-hand { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 0; max-width: 100%; padding-bottom: 6px; }
.hand-zone .fan-hand .card { margin-left: calc(var(--card-w) * -0.26); }
.hand-zone .fan-hand .card:first-child { margin-left: 0; }
.hand-zone .fan-hand .card:hover { z-index: 3; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.big-msg { text-align: center; font-size: 16px; background: rgba(0, 0, 0, 0.3); border-radius: 12px; padding: 10px 14px; }

.war-center { display: flex; gap: 40px; justify-content: center; }
.war-center .cp { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.gf-center { display: flex; flex-direction: column; gap: 8px; align-items: center; width: 100%; }
.gf-log { font-size: 13px; text-align: center; line-height: 1.6; opacity: 0.95; }
.spit-piles { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.spit-piles .sp { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.spit-piles small { opacity: 0.8; }
.center-piles { display: flex; gap: 22px; align-items: center; justify-content: center; flex-wrap: wrap; }
.center-piles .cp { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.center-piles .cp .card.back:not(:disabled) { cursor: pointer; box-shadow: 0 0 0 3px var(--gold), 0 6px 12px rgba(0,0,0,.3); }
.center-piles .need { background: var(--gold); color: #2a2110; font-weight: 700; border-radius: 10px; padding: 6px 12px; }

/* ---------- 棋盘（国际象棋 / 跳棋 / 黑白棋共用） ---------- */
.bd-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bd-grid {
  --sq: min(11vw, 58px);
  display: grid; grid-template-columns: repeat(8, var(--sq)); width: max-content;
  border: 8px solid #3b2414; border-radius: 8px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}
.bd-sq { width: var(--sq); height: var(--sq); border: 0; padding: 0; position: relative; display: grid; place-items: center; font-size: calc(var(--sq) * 0.7); line-height: 1; }
.bd-sq.l { background: #eadfc0; color: #1b1b1b; }
.bd-sq.d { background: #3f8a5a; color: #1b1b1b; }
.bd-sq.g { background: #1d7a44; }
.bd-sq.last::before { content: ""; position: absolute; inset: 0; background: rgba(228, 197, 106, 0.5); }
.bd-sq.pick::before { content: ""; position: absolute; inset: 0; background: rgba(255, 220, 90, 0.75); }
.bd-sq.chk::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(215, 38, 61, 0.85), transparent 75%); }
.bd-sq.go::after { content: ""; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: rgba(20, 56, 44, 0.55); }
.bd-sq.go.cap::after { width: 86%; height: 86%; background: transparent; border: 4px solid rgba(215, 38, 61, 0.75); }
.bd-sq > * { position: relative; z-index: 1; }
.pc-w { color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000, 0 1px 3px #000; }
.pc-b { color: #111; text-shadow: 0 0 1px #fff; }
.disc { width: 78%; height: 78%; border-radius: 50%; display: grid; place-items: center; font-size: calc(var(--sq) * 0.42); box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45), inset 0 -3px 0 rgba(0, 0, 0, 0.25); }
.disc.k1 { background: radial-gradient(circle at 35% 30%, #555, #111); color: #f6d365; }
.disc.k2 { background: radial-gradient(circle at 35% 30%, #fff, #cfc6b0); color: #b8862b; }
.rv-sq { background: #1d7a44; border: 1px solid rgba(0, 0, 0, 0.35); }
.rv-sq .disc { width: 84%; height: 84%; }
.rv-sq.go::after { background: rgba(255, 255, 255, 0.55); width: 22%; height: 22%; }
.rv-sq.last .disc { outline: 3px solid var(--gold); }
.bd-info { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: 14px; }
.bd-info .tag { background: rgba(0, 0, 0, 0.3); border-radius: 99px; padding: 2px 12px; }
.bd-info .tag.on { background: var(--gold); color: #2a2110; font-weight: 700; }

/* ---------- 通用小部件 ---------- */
.dice {
  width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center; background: #fffdf8; color: #1b1b1b;
  font-size: 30px; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.18);
}
.board-grid { display: grid; gap: 2px; }
.cell, .peg {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 4px; background: rgba(255, 255, 255, 0.12); color: #f6f1e6; border: 0;
}
.cell.lit { background: #f6f1e6; color: #1b1b1b; }
.help { opacity: 0.85; }

.site-foot { width: min(1240px, calc(100% - 28px)); margin: 0 auto 32px; }
.prose { display: grid; grid-template-columns: 1.2fr 1fr 0.8fr; gap: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.prose h2 { font-size: 16px; margin: 0 0 8px; }
.prose p, .prose li { margin: 0 0 8px; color: var(--ink-soft); font-size: 14px; }
.family { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; }
.family a, .text-link { color: var(--pine-2); }
html.dark .family a, html.dark .text-link { color: var(--gold); }
.fine { opacity: 0.7; font-size: 13px; }

.crumbs { margin: 0 0 12px; font-size: 14px; opacity: 0.7; }
.crumbs a { color: inherit; }
.guide h1 { font-family: Palatino, "Songti SC", serif; font-size: 40px; line-height: 1.15; margin: 0 0 12px; }
.guide .answer { font-size: 18px; max-width: 42em; }
.guide h2 { font-family: Palatino, "Songti SC", serif; font-size: 22px; margin: 28px 0 8px; }
.guide p, .guide li { max-width: 42em; line-height: 1.65; }
.guide ol, .guide ul { padding-left: 1.2em; }
.guide .play-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.guide .related { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 8px; }
.guide .related a { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; background: var(--card-bg); }
.guide .related a:hover { border-color: #c9a24a; }
.guide .feature { padding: 12px 16px; display: block; color: inherit; }
.guide .feature b, .guide .feature em { display: block; font-style: normal; }
.guide .feature em { color: #8a6a22; font-size: 13px; }

/* ---------- 弹层 ---------- */
.sheet {
  position: fixed; inset: 0; background: rgba(20, 16, 12, 0.5); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 30; padding: 18px;
}
.sheet[hidden] { display: none; }
.panel {
  width: min(560px, 100%); max-height: min(84vh, 760px); overflow: auto; background: var(--paper); color: var(--ink);
  border-radius: 18px; padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.panel.wide { width: min(980px, 100%); }
.panel h2 { margin: 0 0 8px; font-family: Palatino, "Songti SC", serif; }
.panel p { line-height: 1.6; }
.choices { display: grid; gap: 8px; margin: 12px 0; }
.choice:disabled { opacity: 0.4; cursor: not-allowed; }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #221c16; color: #f6f1e6;
  padding: 9px 16px; border-radius: 999px; z-index: 40; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.pause-cover {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(12, 40, 28, 0.85); border-radius: 14px; z-index: 5;
}
.win-pop { animation: pop 0.45s ease; text-align: center; }
.win-pop h2 { font-size: 30px; }
@keyframes pop { from { transform: scale(0.94); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .stage-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .stage-side > * { flex: 1 1 280px; }
  .hero-cards { display: none; }
}
@media (max-width: 980px) {
  .menu, .prose { grid-template-columns: 1fr 1fr; }
  .menu.rich { grid-template-columns: 1fr; }
  .nav-main { display: none; }
  .topbar { justify-content: space-between; }
}
@media (max-width: 680px) {
  :root { --card-w: 42px; --card-h: 60px; }
  .menu, .prose { grid-template-columns: 1fr; }
  .menu.rich .tiles { grid-template-columns: 1fr; }
  .hero { padding: 22px 18px; }
  .hero h1 { font-size: 34px; }
  .game-head .title h1 { font-size: 28px; }
  .game-head .actions { justify-content: flex-start; }
  .wrap { width: min(100% - 16px, 1240px); }
  .felt { padding: 8px; min-height: 360px; }
  .rail { padding: 6px; border-radius: 16px; }
  .table { min-width: 0; }
  .spread { gap: 4px; }
  .pips { display: none; }
  .card .mid { display: block; position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-38%); text-align: center; font-size: 22px; opacity: 0.9; }
  .face { display: none; }
  .mini-backs .mb { width: 18px; height: 28px; margin-left: -11px; }
  .mini-backs { height: 32px; }
  .corner { font-size: 11px; top: 2px; left: 3px; }
  .corner i { font-size: 10px; }
  .corner.br { right: 3px; bottom: 2px; top: auto; left: auto; }
  .face { inset: 14px 5px; font-size: 18px; }
  .seat-table { grid-template-columns: minmax(56px, 1fr) minmax(0, 3fr) minmax(56px, 1fr); }
  .hand-zone .fan-hand .card { margin-left: calc(var(--card-w) * -0.45); }
  .ad-top { min-height: 60px; }
}
@media (max-width: 400px) {
  :root { --card-w: 40px; --card-h: 57px; }
  .felt { padding: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .hint-ico, .win-pop { animation: none; }
  .card { transition: none; }
}
