/* ============================================================
   德州扑克 H5 · 样式表
   全部图形由 CSS 绘制（牌面、筹码、牌桌），不依赖任何图片素材，
   既保证合规（无第三方美术资产），也让首屏加载几乎为零成本。
   移动端优先，桌面端自动居中收窄。
   ============================================================ */

:root {
  --felt-dark: #0a2e23;
  --felt: #0f4635;
  --felt-light: #146b4f;
  --gold: #d9b45b;
  --gold-dim: #8a7238;
  --ink: #0b1512;
  --text: #e9f2ee;
  --text-dim: #90a89e;
  --danger: #c8453b;
  --danger-dark: #8e2f28;
  --call: #2f7fb5;
  --raise: #c98a2b;
  --ok: #3f9d6c;
  --card-face: #fbfaf6;
  --card-back: linear-gradient(135deg, #7b1e2b 0%, #4a1119 100%);
  --radius: 12px;
  --shadow: 0 4px 14px rgba(0, 0, 0, .35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* ── 专业主题变量（texasholdem 模式，阶段1 UI 升级的地基）── */
  --color-gold: #d9b45b;
  --color-gold-bright: #f0dca6;
  --color-gold-control: #b38a3a;   /* 加注按钮填充底 */
  --color-gold-control-hover: #c99b45;
  --color-on-gold: #1a1408;
  --color-success: #3f9d6c;
  --color-success-bright: #5ec894;
  --color-danger: #c8453b;
  --color-danger-bright: #e07a6f;
  --table-seat: rgba(3, 18, 14, .88);
  --table-seat-strong: rgba(9, 34, 26, .95);
  --table-seat-border: rgba(255, 255, 255, .13);
  --table-turn-ring: rgba(217, 180, 91, .35);
  --table-text: #e9f2ee;
  --table-text-muted: #90a89e;
  --color-surface: rgba(10, 22, 18, .92);
  --color-surface-raised: rgba(16, 30, 25, .95);
  --color-control: rgba(255, 255, 255, .05);
  --color-border: rgba(255, 255, 255, .10);
  --color-border-strong: rgba(255, 255, 255, .18);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --shadow-overlay: 0 24px 60px rgba(0, 0, 0, .55);
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --ease-standard: cubic-bezier(.2, .8, .2, 1);
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: radial-gradient(ellipse at 50% 0%, #14483a 0%, #071b15 70%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  user-select: none;
  -webkit-user-select: none;
}

/* 屏幕切换 */
.screen { display: none; height: 100dvh; flex-direction: column; }
.screen.active { display: flex; }
.hidden { display: none !important; }

/* ─────────────── 通用按钮 ─────────────── */
.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  padding: 12px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .08s, filter .15s, opacity .15s;
}
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-block { width: 100%; display: block; }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-primary { background: linear-gradient(180deg, #e0bd68, #b8933f); color: #2b2107; border-color: #e6c87f; }
.btn-fold  { background: linear-gradient(180deg, #b4433a, var(--danger-dark)); border-color: #d1584e; }
.btn-check { background: linear-gradient(180deg, #4a9a72, #2f6d4f); border-color: #5cb188; }
.btn-call  { background: linear-gradient(180deg, #3a8dc4, #235f87); border-color: #4fa2d8; }
.btn-raise { background: linear-gradient(180deg, #d59a35, #9c6c1c); border-color: #e3ad4c; }

.icon-btn {
  appearance: none; border: 1px solid transparent; background: rgba(255, 255, 255, .1);
  color: var(--text); width: 38px; height: 38px; border-radius: var(--radius-md);
  font-size: 16px; cursor: pointer; flex-shrink: 0;
  /* GameHeader 模式：hover 金边 + 44px 触摸目标（窄屏）*/
  transition: border-color var(--duration-fast) var(--ease-standard),
              background-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
.icon-btn:hover, .icon-btn:focus-visible {
  border-color: var(--color-gold); color: var(--color-gold);
  background: rgba(217, 180, 91, .12);
}
@media (max-width: 480px) {
  .icon-btn { width: 44px; height: 44px; }
}

/* ─────────────── 大厅 ─────────────── */
#lobby { align-items: center; justify-content: center; padding: 24px 18px; overflow-y: auto; }

.lobby-card {
  width: 100%; max-width: 380px;
  background: linear-gradient(180deg, rgba(12, 40, 30, .88), rgba(4, 22, 16, .92));
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xl);
  padding: 28px 22px;
  box-shadow: var(--shadow-overlay), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(6px);
}

.logo { text-align: center; font-size: 30px; margin: 0 0 6px; letter-spacing: 3px; }
.suit.red { color: #e0574c; }
.suit.black { color: #e9f2ee; }

.lobby-title {
  text-align: center; margin: 0; font-size: 26px; letter-spacing: 4px;
  color: var(--gold); font-weight: 700;
}
.lobby-sub { text-align: center; color: var(--text-dim); font-size: 13px; margin: 4px 0 22px; }

.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.field input,
.advanced-grid input {
  width: 100%; padding: 12px 14px; font-size: 16px; font-family: inherit;
  background: rgba(0, 0, 0, .35); color: var(--text);
  border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--radius);
  outline: none;
}
.field input:focus { border-color: var(--gold); }
#input-code { letter-spacing: 6px; text-transform: uppercase; font-weight: 700; text-align: center; }

.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-dim); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .12); }

.advanced { margin-top: 18px; font-size: 13px; color: var(--text-dim); }
.advanced summary { cursor: pointer; padding: 6px 0; }
.advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.advanced-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.advanced-grid input { padding: 8px 10px; font-size: 14px; }

.lobby-status { text-align: center; font-size: 13px; color: var(--danger); min-height: 20px; margin: 12px 0 0; }

/* ─────────────── 顶栏 ─────────────── */
.topbar {
  display: flex; align-items: center; gap: 8px;
  padding: calc(6px + var(--safe-top)) 10px 6px;
  background: rgba(0, 0, 0, .3);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  flex-shrink: 0;
}
.room-info { display: flex; align-items: center; gap: 6px; }
/* 品牌（GameHeader）*/
.brand { color: var(--text); font-size: 14px; font-weight: 750; letter-spacing: .04em; white-space: nowrap; }
.brand span { color: var(--text-dim); font-weight: 450; }
@media (max-width: 520px) { .brand { display: none; } }
.room-code-label { font-size: 11px; color: var(--text-dim); }
.room-code {
  appearance: none; border: 1px dashed rgba(217, 180, 91, .5); background: transparent;
  color: var(--gold); font-size: 16px; font-weight: 700; letter-spacing: 2px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  padding: 1px 6px; border-radius: 8px; cursor: pointer;
}
.phase-info { margin-left: auto; text-align: right; font-size: 11px; color: var(--text-dim); }
#phase-label { display: block; color: var(--text); font-size: 12px; font-weight: 600; }
/* 窄屏顶栏精简：隐藏"房间码"文字标签、补码入口收起为图标（💰） */
@media (max-width: 480px) {
  .room-code-label { display: none; }
  .phase-info { font-size: 10px; }
  #phase-label { font-size: 11px; }
  #hand-no { display: none; }
}

/* ─────────────── 牌桌 ─────────────── */
.felt-wrap { flex: 1; min-height: 0; padding: 10px; display: flex; }
.felt {
  position: relative; flex: 0 0 auto; margin: auto;
  width: 100%;
  /* 尺寸由 JS fitFelt() 按 felt-wrap 实际可用空间 contain 计算（精确适配
     任意顶栏/计分板/底部条组合，不再依赖写死的 dvh 预算——预算过时会导致
     felt 溢出、座位与公共牌错位重叠）。以下为 JS 未就绪时的兜底： */
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 3 / 4;
  /* texasholdem 桌台语言：felt 渐变 + 内圈 rail 桌沿 + 亮边 + 灯带（与座位同视觉体系）*/
  --game-felt-center: #1a6b4e;
  --game-felt-edge: #0a2e23;
  --game-rail: rgba(31, 22, 12, .92); /* 深木桌沿 */
  background:
    /* ★ 真实台呢毡面（CC0 TextureCan fabrics_0075）+ 压暗层 + 渐变兜底 */
    linear-gradient(rgba(0, 0, 0, .22), rgba(0, 0, 0, .22)),
    url('assets/felt.jpg'),
    radial-gradient(circle at 50% 42%, var(--game-felt-center), var(--game-felt-edge) 82%);
  background-size: cover, cover, cover;
  border: 6px solid #4a3319; /* 深木色外沿 */
  /* 桌布椭圆调圆（46%/34% → 50%/45%）：座位 y 半径加大后自己会到 92%，
     旧椭圆垂直边界只有 84%，座位会露出桌布。 */
  border-radius: 50% / 45%;
  box-shadow:
    inset 0 0 0 7px var(--game-rail),         /* ★ 内圈桌沿（rail）*/
    inset 0 0 0 8px rgba(255, 255, 255, .04), /* rail 亮边 */
    inset 0 0 60px rgba(0, 0, 0, .45),
    0 0 0 2px rgba(217, 180, 91, .30),        /* ★ 金色灯带 */
    0 0 20px rgba(217, 180, 91, .10),         /* 灯带光晕 */
    0 10px 30px rgba(0, 0, 0, .5);            /* 深投影 */
}
/* 牌桌内圈装饰线（金色细环 + 微光） */
.felt::after {
  content: ""; position: absolute; inset: 9%;
  border: 1px solid rgba(217, 180, 91, .30);
  border-radius: 50% / 45%;
  box-shadow: inset 0 0 14px rgba(217, 180, 91, .06);
  pointer-events: none;
}
/* 桌布中央品牌标记（feltMark，低调） */
.felt-mark {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 2px;
  color: rgba(241, 237, 225, .10); pointer-events: none;
  font-family: var(--font-mono); letter-spacing: .22em;
  font: 750 15px/1 var(--font-mono);
}

.felt-inner {
  /* 竖屏：公共牌区中心略偏上（44%），给底部自己座位和侧翼座位让出空间。
     50% 时 community 底 ≈ 272px 会与 6 人桌侧翼座位盒顶（≈266px）重叠，
     5 人桌侧翼（y=63%）更是贴着 —— 上移到 44% 后 community 底 ≈ 247px，
     所有桌型侧翼/自己座位都有 ≥14px 安全间隙。
     min-height：等待阶段 pot/hint 隐藏时容器不塌缩（否则 community 上移 37px，
     横屏顶部中央座位会盖住第 2-3-4 张公共牌——用户实测踩坑）。 */
  position: absolute; top: 44%; left: 50%; transform: translate(-50%, -50%);
  min-height: calc(60px + 74px * var(--s, 1));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 86%; z-index: 2;
}

.pot-display {
  font-size: 16px; color: var(--gold); font-weight: 800;
  background: rgba(0, 0, 0, .55); padding: 5px 16px; border-radius: 8px;
  border: 1px solid rgba(217, 180, 91, .22); white-space: nowrap;
  min-height: 28px; display: flex; align-items: center;
  letter-spacing: .03em;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.pot-display:empty { display: none; }
/* 底池变化脉冲（CommunityBoard 模式）*/
.pot-pulse { animation: potPulse 420ms var(--ease-standard); }
@keyframes potPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
/* 阶段徽章（CommunityBoard 模式：胶囊 + 字母间距）*/
.phase-badge {
  padding: 3px 10px; border: 1px solid rgba(244, 239, 226, .28);
  border-radius: 999px; color: var(--color-gold-bright);
  font-size: 10px; font-weight: 700; letter-spacing: .14em;
  background: rgba(3, 18, 14, .6);
}

.community { display: flex; gap: 6px; justify-content: center; min-height: calc(74px * var(--s, 1)); align-items: center;
  margin-top: auto; /* 吸到 felt-inner 底部：pot/hint 隐藏时位置不变（配合 felt-inner min-height） */ }
/* 公共牌独立档位（42px，介于手牌 48 与 AI 手牌 38 之间）：
   层级清晰 + 全桌花色字号按档统一，杜绝大小参差。
   全部 × 统一比例尺 --s，随牌桌连续缩放，永不与座位重叠。 */
.community .card { width: calc(42px * var(--s, 1)); height: calc(60px * var(--s, 1)); border-radius: 5px; }
.community .card-corner.tl { top: 3px; left: 4px; }
.community .card-corner.br { bottom: 3px; right: 4px; }
.community .card-corner .rank { font-size: clamp(10px, calc(12px * var(--s, 1)), 12px); }
.community .card-corner .suit { font-size: clamp(9px, calc(10px * var(--s, 1)), 10px); }
.community .card-center .suit-big { font-size: clamp(18px, calc(26px * var(--s, 1)), 26px); }
/* community 档 SVG 像素尺寸 */
.community .card-corner .suit svg { width: calc(10px * var(--s, 1)); height: calc(10px * var(--s, 1)); }
.community .card-center .suit-big svg { width: calc(26px * var(--s, 1)); height: calc(26px * var(--s, 1)); }
.community .card-center .face { font-size: clamp(15px, calc(22px * var(--s, 1)), 22px); }
.community .card-center .suit-small { font-size: clamp(9px, calc(10px * var(--s, 1)), 10px); }

.board-msg {
  font-size: 12px; color: var(--text-dim); text-align: center; min-height: 16px;
  max-width: 100%; padding: 0 8px;
}

/* ─────────────── 扑克牌（CSS 绘制，按方案 7 维度） ─────────────── */
.card {
  width: calc(48px * var(--s, 1)); height: calc(68px * var(--s, 1)); border-radius: 6px;
  position: relative;
  background: #FFFFFF; color: #0A0A0A;
  font-family: Georgia, "Times New Roman", "Source Han Sans", "Songti SC", serif;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .35), 0 6px 12px rgba(0, 0, 0, .18);
  flex-shrink: 0;
  animation: dealIn .22s ease-out both;
}
/* 双对角角标：左上 + 右下镜像 180°（rank 大数字在上、suit 小花色在下） */
.card-corner {
  position: absolute;
  display: flex; flex-direction: column; align-items: center;
  line-height: 1;
  pointer-events: none;
}
.card-corner.tl { top: 4px; left: 5px; }
.card-corner.br { bottom: 4px; right: 5px; transform: rotate(180deg); }
.card-corner .rank {
  font-size: clamp(11px, calc(15px * var(--s, 1)), 15px); font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  font-family: Georgia, "Times New Roman", serif;
}
.card-corner .suit {
  font-size: clamp(10px, calc(12px * var(--s, 1)), 12px); line-height: 1;
  color: inherit; /* 继承 .card 的 color（黑/红）→ SVG fill */
  display: inline-block;
}
.card.sprite-face { background: transparent; }
.card-sprite {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.card-sprite svg { width: 100%; height: 100%; display: block; }
/* 花色用内联 SVG 矢量：4 个花色在同一 viewBox 内路径等大（边界统一 ~76%）。
   尺寸用【明确像素 × 比例尺】而非 em —— em 在部分 WebView（微信内置浏览器）
   作用于 SVG 时不可靠，会导致个别牌的花色按默认尺寸渲染、巨大盖住数字。 */
.suit-glyph {
  fill: currentColor;
  display: block;
  width: calc(12px * var(--s, 1)); height: calc(12px * var(--s, 1));   /* 角标花色基准 */
}
.card-center .suit-big svg { width: calc(32px * var(--s, 1)); height: calc(32px * var(--s, 1)); }   /* 中央大花色 */
.card-center .suit-small svg { width: calc(12px * var(--s, 1)); height: calc(12px * var(--s, 1)); } /* 人物牌小花色 */
/* 中央牌面：数字牌大花色 / 人物牌大字母+小花色 */
.card-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; line-height: 1;
  pointer-events: none; color: inherit;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
}
.card-center .suit-big {
  font-size: clamp(22px, calc(32px * var(--s, 1)), 32px); font-weight: 900;
  opacity: .9;
}
.card-center .face {
  font-size: clamp(18px, calc(26px * var(--s, 1)), 26px); font-weight: 900;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.card-center .suit-small {
  font-size: clamp(10px, calc(12px * var(--s, 1)), 12px); font-weight: 900; opacity: .6;
}
.card.red { color: #D62020; }
.card.back {
  background: var(--card-back);
  border: 1px solid rgba(255, 255, 255, .18);
  position: relative;
}
/* 牌背花纹：大几何菱形网格（内联 SVG），替代细碎网格防小屏糊成噪点 */
.card.back::after {
  content: ""; position: absolute; inset: 4px; border-radius: 4px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path d='M12 0L24 12L12 24L0 12Z' fill='none' stroke='rgba(255,255,255,.16)' stroke-width='2'/><path d='M12 4L20 12L12 20L4 12Z' fill='none' stroke='rgba(255,255,255,.07)' stroke-width='1.5'/></svg>");
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10);
}
.card.sm { width: calc(38px * var(--s, 1)); height: calc(54px * var(--s, 1)); border-radius: 4px; }
.card.sm .card-corner.tl { top: 3px; left: 4px; }
.card.sm .card-corner.br { bottom: 3px; right: 4px; }
.card.sm .card-corner .rank { font-size: clamp(10px, calc(11px * var(--s, 1)), 11px); }
.card.sm .card-corner .suit { font-size: clamp(9px, calc(9px * var(--s, 1)), 9px); }
.card.sm .card-center .suit-big { font-size: clamp(15px, calc(22px * var(--s, 1)), 22px); }
.card.sm .card-center .face { font-size: clamp(13px, calc(18px * var(--s, 1)), 18px); }
.card.sm .card-center .suit-small { font-size: clamp(9px, calc(10px * var(--s, 1)), 10px); }
/* sm 档 SVG 像素尺寸（明确值 × 比例尺，不依赖 em） */
.card.sm .card-corner .suit svg, .card.sm .suit-small svg { width: calc(9px * var(--s, 1)); height: calc(9px * var(--s, 1)); }
.card.sm .card-center .suit-big svg { width: calc(22px * var(--s, 1)); height: calc(22px * var(--s, 1)); }
.card.dim { filter: saturate(.5) brightness(.85); }
.card.highlight { box-shadow: 0 0 0 2px var(--gold), 0 2px 8px rgba(0,0,0,.5); }

@keyframes dealIn {
  0%   { opacity: 0; transform: translateY(-28px) rotate(-9deg) scale(.78); }
  55%  { opacity: 1; transform: translateY(4px) rotate(3deg) scale(1.03); }
  75%  { transform: translateY(-2px) rotate(-1deg) scale(.99); }
  100% { opacity: 1; transform: none; }
}

/* ─────────────── 座位 ─────────────── */
.seats { position: absolute; inset: 0; z-index: 3; }

.seat {
  position: absolute; transform: translate(-50%, -50%);
  width: calc(84px * var(--s, 1)); text-align: center;
}
/* 自己座位：底部对齐到 y=78% 兜底（renderSeats 不再设 inline top，让 adjustSelfSeat 动态覆盖）。
   78% 是 PC 大屏安全值（h=747 时 self 盒顶 491 vs community 底 388 间隙 103px）。
   横屏媒体查询下恢复中心对齐（贴桌底设计，不宜底对齐）。 */
.seat.self { top: 78%; }
.seat.self { padding-bottom: 4px; } /* 再留点呼吸空间 */
.seat-box {
  position: relative;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(14, 42, 33, .96), rgba(4, 20, 15, .96));
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px; padding: 5px 5px 4px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: border-color .2s, box-shadow .2s;
}
.seat.acting .seat-box {
  border-color: var(--gold);
  /* PlayerSeat 模式：金色呼吸光圈（2s 循环）*/
  animation: turnPulse 2s var(--ease-standard) infinite;
}
@keyframes turnPulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--table-turn-ring), 0 6px 16px rgba(0, 0, 0, .3); }
  50% { box-shadow: 0 0 0 5px var(--table-turn-ring), 0 0 18px rgba(217, 180, 91, .35), 0 6px 16px rgba(0, 0, 0, .3); }
}
.seat.folded .seat-box { opacity: .42; }
/* mucked：弃牌手牌变灰下移（HeroPanel 模式）*/
.seat.folded .seat-cards { opacity: .35; transform: translateY(4px) scale(.95); filter: grayscale(.6); }
.seat-cards { transition: opacity var(--duration-slow) var(--ease-standard), transform var(--duration-slow) var(--ease-standard); }
.seat.self .seat-box { border-color: rgba(94, 200, 148, .6); }
/* PlayerSeat 模式：identity 两行（头像左跨行 | 名字上 | 筹码下，永不对名称挤压）*/
.identity {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 1px 5px;
  padding: 1px 0;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(180deg, rgba(9, 34, 26, .95), rgba(4, 20, 15, .95));
  border: 2px solid var(--color-gold); color: var(--color-gold-bright);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  box-shadow: 0 0 0 1px rgba(217, 180, 91, .2), 0 2px 6px rgba(0, 0, 0, .4);
  grid-row: 1 / 3; /* 跨两行 */
}
.avatar.bot { border-color: var(--color-border-strong); color: var(--text-dim); }
.name-block {
  grid-column: 2; min-width: 0; display: grid; gap: 0px;
  /* 名字独占一行，不会被筹码挤压 */
}
.name-block strong {
  overflow: hidden; color: var(--table-text); font-size: 12px; font-weight: 700;
  text-overflow: ellipsis; white-space: nowrap; line-height: 1.2;
}
.name-block small { color: var(--table-text-muted); font-size: 8px; white-space: nowrap; }
.stack {
  grid-column: 2;
  display: flex; align-items: center; gap: 3px;
  color: var(--color-gold); font: 800 10px/1 var(--font-mono);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.seat.empty .seat-box { border-style: dashed; opacity: .4; }

.seat-name {
  font-size: clamp(10px, calc(11px * var(--s, 1)), 11px); font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
/* 筹码数字：模块下半部分最醒目位置（order 最靠后 + 大号金色） */
.seat-chips {
  margin-top: 2px; order: 3;
  font-size: clamp(12px, calc(15px * var(--s, 1)), 15px); color: var(--gold); font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
/* ── 真实筹码（react-pokerchip 技法：渐变圆 + 白色条纹环 + 内环）── */
.chip {
  display: inline-block; flex-shrink: 0;
  width: calc(18px * var(--s, 1)); height: calc(18px * var(--s, 1));
  border-radius: 50%; position: relative;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.9) 0%, rgba(255,255,255,.3) 20%, transparent 42%), var(--chip-color, #3a7bd5);
  border: 2px dashed rgba(255, 255, 255, .85); /* 白色虚线边缘 = edge spots 条纹 */
  box-shadow: inset 0 0 0 2px var(--chip-edge, #24569e), inset 0 -3px 5px rgba(0, 0, 0, .45), 0 2px 5px rgba(0, 0, 0, .5);
}
.chip::before {
  content: ''; position: absolute; inset: 3px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .6);
}
.chip::after {
  content: ''; position: absolute; inset: 6px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, rgba(255,255,255,.35), transparent 45%), var(--chip-color, #3a7bd5);
  box-shadow: inset 0 -2px 3px rgba(0,0,0,.4);
}
/* 5 色面值（100 蓝 / 500 绿 / 1000 黑 / 5000 紫 / 10000 红） */
.chip[data-v="100"]   { --chip-color: #3a7bd5; --chip-edge: #24569e; }
.chip[data-v="500"]   { --chip-color: #2e9e5b; --chip-edge: #1e7040; }
.chip[data-v="1000"]  { --chip-color: #3a3a3a; --chip-edge: #141414; }
.chip[data-v="5000"]  { --chip-color: #8e44ad; --chip-edge: #5e2c73; }
.chip[data-v="10000"] { --chip-color: #c0392b; --chip-edge: #8a2a20; }
/* 底池小筹码（更小一档）*/
.chip-sm { width: 14px; height: 14px; border-width: 1.5px; }
.chip-sm::before { inset: 2.5px; }
.chip-sm::after { inset: 5px; }
.pot-display { gap: 4px; }
/* 手牌容器：加深底色 + 细描边，强化与桌布的边界 */
.seat-cards {
  display: flex; gap: 3px; justify-content: center; align-items: center;
  min-height: calc(58px * var(--s, 1)); padding: 3px 5px; margin: 3px 0 2px;
  background: rgba(0, 0, 0, .34);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .3);
}

.seat-tags { display: flex; gap: 3px; justify-content: center; margin-top: 2px; flex-wrap: wrap; }
.tag {
  font-size: 9px; padding: 1px 5px; border-radius: 8px; font-weight: 700;
  background: rgba(255, 255, 255, .14);
}
.tag.dealer { background: #f2f0e6; color: #1a1a1a; }
/* dealer 金色圆徽（PlayerSeat 模式：座位顶部徽章）*/
.seat-tags .tag.dealer {
  min-width: 20px; height: 20px; display: inline-grid; place-items: center;
  padding: 0 4px; border: 1px solid var(--color-gold); border-radius: 50%;
  background: var(--table-seat-strong); color: var(--color-gold);
  font: 750 9px/1 var(--font-mono);
}
.tag.sb { background: #7b4fb5; }   /* 小盲：紫色 */
.tag.bb { background: #2f7fb5; }   /* 大盲：蓝色 */
.tag.allin { background: var(--danger); }
.tag.bot { background: #5b4b8a; }
/* 纯 "AI" 标记：缩小挪到座位右上角，降低视觉权重 */
.tag-ai {
  position: absolute; top: -3px; right: -3px; z-index: 1;
  font-size: 8px; padding: 0 4px; line-height: 1.6;
  border-radius: 6px; background: #5b4b8a; color: #E7DCF5;
}
.tag.bot-rock { background: #4a5568; }
.tag.bot-maniac { background: #c53030; }
.tag.bot-tag { background: #2b6cb0; }
.tag.bot-passive { background: #6b7280; }
.tag.bot-lag { background: #c05621; }
.tag.offline { background: #555; color: #bbb; }

/* 玩家面前的下注筹码 */
.seat-bet {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 700; color: #fff;
  background: rgba(0, 0, 0, .6); border: 1px solid var(--gold-dim);
  padding: 1px 7px; border-radius: 10px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.seat-bet::before { content: "●"; color: var(--gold); margin-right: 3px; font-size: 8px; }

/* 最近动作气泡 */
.seat-action {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 700;
  background: rgba(0, 0, 0, .78); border: 1px solid rgba(255,255,255,.25);
  padding: 2px 8px; border-radius: 10px; white-space: nowrap;
  line-height: 1.4;
  animation: popIn .2s ease-out both;
}
@keyframes popIn { from { opacity: 0; transform: translate(-50%, 4px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ─────────────── 底部操作区 ─────────────── */
.host-bar, .rebuy-bar {
  display: flex; gap: 8px; padding: 10px 12px calc(10px + var(--safe-bottom));
  background: rgba(0, 0, 0, .34); justify-content: center; flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.rebuy-bar { align-items: center; font-size: 13px; color: var(--text-dim); }
.rebuy-row {
  display: flex; align-items: center; gap: 8px;
  max-width: 560px; width: 100%; margin: 0 auto;
}
.rebuy-hint { font-size: 11px; color: var(--text-dim); flex: 1; text-align: left; }
/* 补码弹窗内（ModalDialog 模式）*/
.rebuy-amount {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong); background: var(--color-control);
  color: var(--color-gold); font-size: 16px; font-weight: 700; text-align: center;
  font-variant-numeric: tabular-nums; margin-bottom: 12px;
}
.rebuy-amount:focus { outline: 2px solid var(--color-gold); outline-offset: 1px; }
.rebuy-actions { display: grid; gap: 8px; }
/* 窄屏补码条：隐藏说明文字（空间让给输入框），输入框收窄 */
@media (max-width: 480px) {
  .rebuy-hint { display: none; }
  .rebuy-amount { width: 88px; padding: 5px 6px; font-size: 14px; }
  .rebuy-bar { padding: 8px 10px calc(8px + var(--safe-bottom)); }
}
.rebuy-amount {
  width: 110px; padding: 6px 8px; border-radius: 8px;
  border: 1px solid rgba(217, 180, 91, .4); background: rgba(0, 0, 0, .5);
  color: var(--gold); font-size: 15px; font-weight: 700; text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ─────────────── 计分板（顶部常驻，紧凑单行） ─────────────── */
.scoreboard {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 10px;
  background: rgba(0, 0, 0, .32);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scoreboard::-webkit-scrollbar { display: none; }
.scoreboard-title { font-size: 10px; color: var(--text-dim); white-space: nowrap; }
.scoreboard-list { display: flex; gap: 5px; }
.sb-row {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; white-space: nowrap;
  background: rgba(255, 255, 255, .06); border-radius: 5px; padding: 1px 6px;
}
.sb-name { color: var(--text); font-weight: 600; max-width: 56px; overflow: hidden; text-overflow: ellipsis; }
.sb-invest { color: var(--text-dim); }
.sb-chips { color: var(--gold); font-variant-numeric: tabular-nums; }
.sb-delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.sb-row.pos .sb-delta { color: var(--win, #5ec894); }
.sb-row.neg .sb-delta { color: var(--danger); }

/* ─────────────── 计分弹窗（卡片式排行榜 APP 风格）─────────────── */
.score-card { max-width: 400px; width: 92vw; }
.score-sub { font-size: 11px; color: var(--text-dim); margin: 4px 0 12px; text-align: center; }
.score-popup-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

/* ★ 冠军摘要卡：金色浮雕质感 */
.sp-champion-card {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px; margin-bottom: 4px;
  background: linear-gradient(135deg, rgba(217,180,91,.18), rgba(217,180,91,.06));
  border: 1px solid rgba(217,180,91,.55);
  border-radius: 14px;
  box-shadow: 0 0 16px rgba(217,180,91,.12);
}
.sp-champ-left { display: flex; flex-direction: column; align-items: center; gap: 0; }
.sp-champ-icon { font-size: 28px; line-height: 1; }
.sp-champ-label { font-size: 9px; color: var(--color-gold); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.sp-champ-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-champ-mid strong { font-size: 15px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-champ-stat { font-size: 10px; color: var(--color-gold); opacity: .75; }
.sp-champ-right em { font: 800 20px/1 var(--font-mono); color: var(--color-gold); font-style: normal; white-space: nowrap; }

/* ★ 每行卡片：头像 + 名字/明细 + 盈亏 + 状态标签 */
.sp-card {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  min-height: 52px;
}
.sp-card.top {
  background: linear-gradient(135deg, rgba(217,180,91,.10), var(--color-surface));
  border-color: rgba(217,180,91,.45);
  box-shadow: 0 0 10px rgba(217,180,91,.08);
}
.sp-card-rank { font-size: 16px; flex-shrink: 0; width: 24px; text-align: center; }
.sp-card-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--table-seat-strong); border: 2px solid var(--color-gold);
  color: var(--color-gold-bright); display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
}
.sp-card-avatar.bot { border-color: var(--color-border-strong); color: var(--text-dim); }
.sp-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-card-info strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-card-info small { font-size: 10px; color: var(--text-dim); white-space: nowrap; }
.sp-card-delta { font: 700 14px/1 var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }
.sp-card.up .sp-card-delta { color: var(--color-success-bright); }
.sp-card.down .sp-card-delta { color: var(--danger); }
.sp-card.flat .sp-card-delta { color: var(--text-dim); }
.sp-card-tag {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; flex-shrink: 0; white-space: nowrap;
}
.sp-card.up .sp-card-tag { color: var(--color-success-bright); background: rgba(94,200,148,.12); }
.sp-card.down .sp-card-tag { color: var(--danger); background: rgba(226,75,74,.12); }
.sp-card.flat .sp-card-tag { color: var(--text-dim); background: rgba(255,255,255,.06); }
/* 冠军行强化 */
.sp-card.top .sp-card-delta { color: var(--color-gold); }
.sp-card.top .sp-card-tag { color: var(--color-gold); background: rgba(217,180,91,.15); }
.sp-card.top .sp-card-info strong { color: var(--color-gold); }

@media (max-width: 400px) {
  .sp-card { gap: 6px; padding: 8px 10px; }
  .sp-card-info small { display: none; }
  .sp-card-delta { font-size: 12px; }
}

/* ─────────────── 行动区（ActionDock 完整结构） ─────────────── */
.action-bar {
  padding: 10px 12px calc(10px + var(--safe-bottom));
  background: rgba(0, 0, 0, .4);
  border-top: 1px solid rgba(217, 180, 91, .2);
  flex-shrink: 0;
  position: relative;
}
.dock { min-width: 0; display: grid; gap: 8px; }
/* 行动提示（金色 + mono 小字）*/
.prompt { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.prompt span { color: var(--color-gold); font-size: 12px; font-weight: 750; }
.prompt small { color: var(--text-dim); font: 500 10px/1 var(--font-mono); }
/* 语义色按钮（弃红/过蓝/跟绿/加金）*/
.coreActions { display: grid; grid-template-columns: repeat(4, minmax(62px, 1fr)); gap: 8px; }
.actionButton {
  min-height: 46px; display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 8px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
  color: var(--text); font: 700 13px/1 var(--font-sans);
  transition: transform var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              background-color var(--duration-fast) var(--ease-standard),
              filter var(--duration-fast) var(--ease-standard);
}
.actionButton:hover:not(:disabled) { border-color: var(--color-gold-bright); filter: brightness(1.08); }
.actionButton:active:not(:disabled) { transform: translateY(1px) scale(.97); }
.actionButton:disabled { opacity: .38; }
.actionButton.fold  { background: linear-gradient(180deg, #b4433a, #8e2f28); border-color: #d1584e; }
.actionButton.check { background: linear-gradient(180deg, #2f6d4f, #21513a); border-color: #5cb188; }
.actionButton.call  { background: linear-gradient(180deg, #3a8dc4, #235f87); border-color: #4fa2d8; }
.actionButton.raise { background: linear-gradient(180deg, #d59a35, #9c6c1c); border-color: #e3ad4c; }
/* 加注面板（三列网格：滑块 + 快捷 + 确认）*/
.raisePanel {
  display: grid; grid-template-columns: minmax(180px, .9fr) minmax(160px, 1fr) auto;
  align-items: end; gap: 12px; padding: 12px;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-lg);
  background: var(--color-control);
}
.slider { min-width: 0; display: grid; gap: 4px; }
.slider > span { display: flex; justify-content: space-between; color: var(--text-dim); font-size: 10px; }
.slider strong { color: var(--color-gold); font: 700 14px/1 var(--font-mono); }
.slider small { display: flex; justify-content: space-between; color: var(--text-dim); font: 500 9px/1 var(--font-mono); }
.raise-slider {
  width: 100%; height: 32px;
  -webkit-appearance: none; appearance: none;
  background: transparent; margin: 0;
  touch-action: manipulation;
}
.raise-slider::-webkit-slider-runnable-track {
  height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-dim) 100%);
}
.raise-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; border-radius: 50%; margin-top: -10px;
  background: linear-gradient(180deg, #f5e6bd, #d9b45b);
  border: 2px solid #8a7238; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); cursor: pointer;
}
.raise-slider::-moz-range-track { height: 6px; border-radius: 3px; background: var(--gold-dim); }
.raise-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: #f0dca6;
  border: 2px solid #8a7238; cursor: pointer;
}
/* 快捷加注（44px + 金色面值小字）*/
.quickRaises { display: grid; grid-template-columns: repeat(4, minmax(52px, 1fr)); gap: 6px; }
.quickRaises .chip-btn {
  min-height: 44px; display: grid; place-items: center; gap: 2px; padding: 5px;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface); color: var(--text-dim);
  font: 650 11px/1 var(--font-sans); cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard);
}
.quickRaises .chip-btn:hover { border-color: var(--color-gold); color: var(--text); }
.quickRaises .chip-btn:active { transform: translateY(1px) scale(.97); }
/* 确认加注（金色描边）*/
.confirmRaise {
  min-height: 44px; padding: 10px 16px;
  border: 1px solid var(--color-gold); border-radius: var(--radius-md);
  background: transparent; color: var(--color-gold);
  font: 700 12px/1 var(--font-sans); cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-standard),
              background-color var(--duration-fast) var(--ease-standard);
}
.confirmRaise:hover { background: var(--color-gold-control); color: var(--color-on-gold); }
.confirmRaise:active { transform: translateY(1px) scale(.98); }
/* 移动端：加注面板限高滚动，按钮 2×2 */
@media (max-width: 620px) {
  .coreActions { grid-template-columns: repeat(2, 1fr); }
  .raisePanel { grid-template-columns: 1fr; max-height: min(48dvh, 380px); overflow-y: auto; }
  .quickRaises { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 380px) {
  .prompt small { display: none; }
  .quickRaises { grid-template-columns: repeat(2, 1fr); }
}
/* 加注时牌桌缩小，让位给浮起的加注面板，避免挡手牌 */
#table-screen.raise-open .felt {
  transform: scale(0.88);
  transform-origin: center center;
  transition: transform 0.2s ease-out;
}
.felt { transition: transform 0.2s ease-out; }

.turn-timer { height: 3px; background: rgba(255, 255, 255, .1); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.turn-timer-fill { height: 100%; width: 100%; background: var(--gold); transition: width .25s linear; }
.turn-timer-fill.warn { background: var(--danger); }

.waiting-hint {
  padding: 12px 16px calc(12px + var(--safe-bottom));
  text-align: center; font-size: 13px; color: var(--text-dim);
  background: rgba(0, 0, 0, .55); flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, .05);
}

/* ─────────────── 结算浮层 ─────────────── */
/* ─────────────── 牌型提示（底池下方，深色衬底白字） ─────────────── */
.hand-hint {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 2px auto 0; padding: 3px 14px;
  background: rgba(0, 0, 0, .55);
  border-radius: 14px;
  font-size: 13px; font-weight: 600; color: #fff; text-align: center;
  min-height: 26px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: opacity .25s;
}
.hand-hint.hidden { display: none; }
.hand-hint .hand-desc { font-weight: 700; }
.hand-hint .hand-kicker { font-size: 11px; color: rgba(255,255,255,.65); margin-left: 4px; }

/* ─────────────── 结算弹窗 ─────────────── */
.result-overlay {
  position: fixed; inset: 0; z-index: 50;
  /* ModalDialog 模式：深绿黑遮罩 + 弹入动画 */
  background: rgba(7, 11, 9, .68);
  display: grid; place-items: center; padding: 20px;
  animation: overlayFade .18s ease-out both;
}
@keyframes overlayFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialogEnter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.result-card {
  position: relative;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xl);
  padding: 20px 22px; max-width: 340px; width: 100%;
  box-shadow: var(--shadow-overlay);
  max-height: calc(100dvh - max(32px, var(--safe-top) + var(--safe-bottom)));
  overflow-y: auto;
  animation: dialogEnter var(--duration-slow) var(--ease-standard) both;
}
/* 移动端：底部抽屉（ModalDialog 模式，符合手机交互习惯） */
@media (max-width: 620px) {
  .result-overlay { place-items: end center; padding: max(8px, var(--safe-top)) 0 0; }
  .result-card {
    max-width: 100%; width: 100%;
    border-right: 0; border-bottom: 0; border-left: 0;
    border-radius: 14px 14px 0 0;
    max-height: calc(100dvh - max(8px, var(--safe-top)));
    padding-bottom: calc(20px + var(--safe-bottom));
  }
}
.result-card h3 { margin: 0 0 12px; text-align: center; color: var(--gold); font-size: 18px; }
.result-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 13px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.07);
}
/* HandResult 模式：赢家金卡（金色左边框 + 背景 tint）*/
.result-row.winner {
  background: rgba(217, 180, 91, .08);
  border: 1px solid rgba(217, 180, 91, .35);
  border-left: 3px solid var(--color-gold);
  border-radius: var(--radius-md);
  margin: 2px -4px; padding: 8px 12px;
  border-bottom-color: rgba(217, 180, 91, .35);
}
.result-row:last-child { border-bottom: none; }
.result-name { min-width: 0; }
.result-hand { font-size: 11px; color: var(--muted); margin-top: 1px; }
.result-hand.win { color: var(--gold); }
.result-reveal { display: flex; gap: 3px; margin-top: 3px; }
.result-win {
  color: var(--gold); font-weight: 700; font-size: 14px;
  white-space: nowrap; margin-left: auto; padding-left: 10px;
}
.result-close {
  display: block; margin: 12px auto 0;
  background: none; border: 1px solid var(--gold-dim); color: var(--gold-dim);
  border-radius: 8px; padding: 6px 24px; font-size: 12px; cursor: pointer;
  transition: .15s;
}
.result-close:hover { border-color: var(--gold); color: var(--gold); }
.result-cards { display: flex; gap: 3px; margin-top: 3px; }
/* 公共牌（顶部居中展示） */
.result-community {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 0 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.result-community .community-label {
  font-size: 11px; color: var(--text-dim);
  letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: 6px;
}
.result-community .community-cards { gap: 5px; margin-top: 0; }

/* 玩家行：身份 + 动作历史 + 手牌 + 盈亏（HandResult 模式：卡片化）*/
.result-row.player {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin-bottom: 6px;
  flex-wrap: wrap;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.result-row.player.winner { border-color: rgba(217, 180, 91, .48); }
.result-row.player.folded { opacity: .55; }
.result-row.player .result-name { flex: 0 0 auto; min-width: 74px; }
.rp-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-row.player.folded .rp-name { opacity: .5; }
/* 隐私提示（HandResult 模式）*/
.result-privacy {
  display: flex; gap: 8px; align-items: center; margin-top: 10px;
  padding: 8px 12px; border: 1px solid var(--color-border);
  border-radius: var(--radius-md); background: var(--color-surface);
  color: var(--text-dim); font-size: 11px;
}

/* 动作历史标签流 */
.rp-actions {
  display: flex; gap: 3px; flex-wrap: wrap;
  flex: 1 1 auto; min-width: 0;
}
.rp-action {
  font-size: 10px; padding: 1px 6px; border-radius: 7px;
  font-weight: 700; white-space: nowrap;
  background: rgba(255, 255, 255, .10);
}
.rp-action.fold { background: rgba(200, 69, 59, .35); }
.rp-action.check { background: rgba(62, 157, 108, .30); }
.rp-action.call { background: rgba(47, 127, 181, .30); }
.rp-action.raise, .rp-action.bet { background: rgba(201, 138, 43, .30); }
.rp-action.allin { background: rgba(188, 63, 54, .45); }

/* 右侧：手牌 + 盈亏 + 剩余 */
.rp-right {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto; flex-shrink: 0;
}
.rp-profit {
  font-size: 15px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rp-profit.pos { color: var(--ok); }
.rp-profit.neg { color: var(--danger); }
.rp-chips {
  font-size: 11px; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ─────────────── 提示 ─────────────── */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(10px);
  background: rgba(0, 0, 0, .88); color: #fff; font-size: 13px;
  padding: 9px 18px; border-radius: 20px; z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: 84vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.conn-banner {
  position: fixed; top: var(--safe-top); left: 0; right: 0; z-index: 90;
  background: var(--danger); color: #fff; text-align: center;
  font-size: 12px; padding: 6px;
}

/* ─────────────── 小屏适配 ───────────────
   矮屏/窄屏额外调优：尺寸仍 × 统一比例尺 --s（连续缩放），
   不覆盖出固定值，避免打断全动态布局。 */
@media (max-height: 700px) {
  .card { width: calc(42px * var(--s, 1)); height: calc(60px * var(--s, 1)); }
  .card-corner.tl { top: 3px; left: 4px; }
  .card-corner.br { bottom: 3px; right: 4px; }
  .card-corner .rank { font-size: clamp(10px, calc(12px * var(--s, 1)), 12px); }
  .card-corner .suit { font-size: clamp(9px, calc(10px * var(--s, 1)), 10px); }
  .card-center .suit-big { font-size: clamp(16px, calc(24px * var(--s, 1)), 24px); }
  .card-center .face { font-size: clamp(14px, calc(20px * var(--s, 1)), 20px); }
  .card-center .suit-small { font-size: clamp(9px, calc(11px * var(--s, 1)), 11px); }
  .card-corner .suit svg, .suit-small svg { width: calc(10px * var(--s, 1)); height: calc(10px * var(--s, 1)); }
  .card-center .suit-big svg { width: calc(24px * var(--s, 1)); height: calc(24px * var(--s, 1)); }
  .seat { width: calc(74px * var(--s, 1)); }
}
@media (max-width: 340px) {
  .seat { width: calc(66px * var(--s, 1)); }
  .action-row .btn { font-size: 13px; padding: 12px 4px; }
}
/* 桌面端：限制宽度，避免牌桌被拉得过大（felt 上限 860，容器 900 容纳） */
@media (min-width: 720px) {
  #table-screen { max-width: 900px; margin: 0 auto; box-shadow: 0 0 60px rgba(0,0,0,.5); }
}

/* ─────────────── 横屏适配 ───────────────
   手机横屏高度受限：牌桌转宽扁、公共牌横向撑满不压缩、座位不重叠 */
@media (orientation: landscape) and (max-height: 560px) {
  .felt-wrap { padding: 6px; }
  .felt {
    aspect-ratio: 16 / 9;
    max-height: 100%;
    max-width: 100%;
  }
  /* 横屏矮桌：公共牌区置于上下座位之间的平衡点（社区中心≈50%h，
     顶部/底部/侧翼座位全部有安全间隙——25%/35% 都会压住某一侧座位）。
     min-height 固定：等待阶段 pot/hint 隐藏时不塌缩，community 位置与开局一致 */
  .felt-inner { top: 30%; min-height: calc(56px + 56px * var(--s, 1)); }
  .community { gap: 8px; min-height: calc(56px * var(--s, 1)); }
  .community .card { width: calc(38px * var(--s, 1)); height: calc(54px * var(--s, 1)); }
  .community .card-corner .rank { font-size: clamp(10px, calc(11px * var(--s, 1)), 11px); }
  .community .card-corner .suit { font-size: clamp(9px, calc(9px * var(--s, 1)), 9px); }
  .community .card-center .suit-big { font-size: clamp(15px, calc(22px * var(--s, 1)), 22px); }
  .community .card-center .face { font-size: clamp(13px, calc(18px * var(--s, 1)), 18px); }
  .community .card-corner .suit svg { width: calc(9px * var(--s, 1)); height: calc(9px * var(--s, 1)); }
  .community .card-center .suit-big svg { width: calc(22px * var(--s, 1)); height: calc(22px * var(--s, 1)); }
  .seat { width: calc(66px * var(--s, 1)); }
  /* 横屏自己座位恢复中心对齐：横屏自己 y=84% 本就贴桌底，
     底部对齐向上生长会撞公共牌区（84%h - 盒高 < 公共牌区底）。 */
  .seat.self { transform: translate(-50%, -50%); padding-bottom: 0; }
  .topbar { padding-top: calc(2px + var(--safe-top)); padding-bottom: 2px; }
  .pot-display { font-size: 14px; padding: 3px 12px; min-height: 24px; }
  .waiting-hint { padding: 8px 14px calc(8px + var(--safe-bottom)); }
}

/* ═══════════════ 聊天面板（ChatPanel 模式）═══════════════ */
.chat-panel {
  background: linear-gradient(180deg, rgba(12, 36, 28, .96), rgba(4, 20, 15, .96));
  border: 1px solid rgba(217, 180, 91, .25);
  border-radius: 16px;
  width: min(360px, 92vw); max-height: 60vh;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .6);
}
.chat-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.chat-head h3 { margin: 0; font-size: 15px; color: var(--color-gold); }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 4px;
  min-height: 120px; max-height: 320px;
  font-size: 12px; line-height: 1.5;
}
.chat-msg { padding: 4px 8px; border-radius: 8px; background: rgba(255,255,255,.05); word-break: break-word; }
.chat-msg .msg-sender { color: var(--color-gold); font-weight: 700; margin-right: 4px; }
.chat-msg.log { color: var(--text-dim); font-size: 10px; background: none; text-align: center; padding: 2px 0; }
.chat-input-row {
  display: flex; gap: 6px; padding: 8px 14px 12px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.chat-input {
  flex: 1; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px; padding: 8px 10px; color: var(--text);
  font-family: inherit; font-size: 13px; outline: none;
}
.chat-input:focus { border-color: var(--color-gold); }
@media (max-width: 500px) {
  .chat-panel { width: 94vw; max-height: 55vh; border-radius: 16px 16px 0 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   v20 UI 补完 · 三块整体重做
   （1）GameHeader 顶栏  （2）HeroPanel 本地底牌  （3）HandResult 三区块
   ───────────────────────────────────────────────────────────────────
   全部复用既有令牌：--color-gold / --table-seat / --radius-* / --space-* /
   --duration-* / --ease-standard / --font-mono，以及 rail 金边 + 灯带光晕
   的同一套阴影语言。不引入第二套配色、圆角或阴影。

   ★ 选择器为什么普遍带一层限定（.topbar.gh / .result-card.hr-card）：
     theme.css 在本文件之后加载，且对 .topbar / .result-card 有同名覆盖。
     多加一个类把特异度抬到 (0,2,0)，才能稳定压过覆盖层，而不用 !important。
   ═══════════════════════════════════════════════════════════════════ */

/* ─────────────── ① GameHeader（顶栏完整版） ─────────────── */
.topbar.gh {
  display: flex; align-items: center; gap: 10px;
  padding: calc(6px + var(--safe-top)) 10px 6px;
  /* 深绿半透明 + 细金边 + 磨砂：和 rail/灯带同一体系 */
  background: linear-gradient(180deg, rgba(9, 34, 26, .94), rgba(4, 20, 15, .80));
  border-bottom: 1px solid rgba(217, 180, 91, .28);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 6px 18px rgba(0, 0, 0, .38);
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  flex-shrink: 0; overflow: hidden;
}
.topbar.gh .gh-left { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.topbar.gh .gh-logo {
  width: 22px; height: 22px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%; font-size: 12px; line-height: 1;
  color: var(--color-gold-bright);
  background: var(--table-seat-strong);
  border: 1px solid rgba(217, 180, 91, .45);
  box-shadow: 0 0 8px rgba(217, 180, 91, .18);
}
.topbar.gh .brand { display: block; font-size: 13.5px; }
.topbar.gh .brand span { white-space: nowrap; }

/* 中段：模式标签 + 阶段。min-width:0 让它先被压缩，而不是把右侧工具挤出屏幕 */
.topbar.gh .gh-center {
  display: flex; align-items: center; gap: 8px;
  flex: 1 1 auto; min-width: 0; justify-content: center;
}
.gh-mode {
  flex-shrink: 0; padding: 2px 10px;
  border: 1px solid rgba(217, 180, 91, .38); border-radius: 999px;
  background: rgba(217, 180, 91, .10); color: var(--color-gold-bright);
  font-size: 10.5px; font-weight: 700; letter-spacing: .10em; white-space: nowrap;
}
.gh-mode.is-solo { border-color: rgba(255, 255, 255, .20); background: var(--color-control); color: var(--table-text-muted); }
.gh-mode.is-watch { border-color: rgba(47, 127, 181, .5); background: rgba(47, 127, 181, .14); color: #9ccdea; }
.topbar.gh .phase-info { margin-left: 0; text-align: left; min-width: 0; overflow: hidden; }
.topbar.gh #phase-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar.gh #hand-no { white-space: nowrap; }

/* 右段 */
.topbar.gh .gh-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.topbar.gh .gh-tools { display: flex; align-items: center; gap: 4px; }
.topbar.gh .room-info { gap: 5px; }

/* 连接状态徽章：在线绿 / 重连中黄（呼吸）/ 离线灰红 */
.gh-conn {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  padding: 3px 9px 3px 7px;
  border: 1px solid var(--color-border); border-radius: 999px;
  background: var(--color-control);
  font: 700 10px/1 var(--font-mono); letter-spacing: .04em;
  color: var(--table-text-muted);
  transition: border-color var(--duration-normal) var(--ease-standard),
              color var(--duration-normal) var(--ease-standard);
}
.gh-conn .gh-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: currentColor; box-shadow: 0 0 6px currentColor;
}
.gh-conn b { font-weight: 700; }
.gh-conn.is-online { color: var(--color-success-bright); border-color: rgba(94, 200, 148, .38); background: rgba(94, 200, 148, .10); }
.gh-conn.is-connecting { color: var(--color-warn, #e8c255); border-color: rgba(232, 194, 85, .40); background: rgba(232, 194, 85, .10); }
.gh-conn.is-connecting .gh-dot { animation: connBlink 1.4s var(--ease-standard) infinite; }
.gh-conn.is-offline { color: var(--color-danger-bright); border-color: rgba(224, 122, 111, .38); background: rgba(224, 122, 111, .10); }
.gh-conn.is-idle { color: var(--table-text-muted); }
@keyframes connBlink { 0%, 100% { opacity: 1; } 50% { opacity: .28; } }

/* 离座按钮：图标 + 文字，危险色描边（与 ActionDock fold 同一红系） */
.topbar.gh .gh-leave {
  width: auto; min-width: 38px; padding: 0 10px; gap: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border-color: rgba(200, 69, 59, .45); background: rgba(200, 69, 59, .12);
  color: var(--color-danger-bright); font: 700 12px/1 inherit;
}
.topbar.gh .gh-leave:hover, .topbar.gh .gh-leave:focus-visible {
  border-color: var(--color-danger); color: #fff; background: rgba(200, 69, 59, .28);
}
.gh-leave-icon { font-size: 13px; line-height: 1; }

/* 窄屏（<640）：单行压缩 —— 隐藏品牌文字、连接状态只留点 */
@media (max-width: 640px) {
  .topbar.gh { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .topbar.gh .brand { display: none; }
  .topbar.gh .gh-conn { padding: 4px; gap: 0; }
  .topbar.gh .gh-conn b { display: none; }
  .topbar.gh .gh-tools { gap: 3px; }
  .topbar.gh .icon-btn { width: 36px; height: 36px; font-size: 15px; }
  .topbar.gh .gh-leave { min-width: 36px; padding: 0 8px; }
  .gh-leave-text { display: none; }
  .topbar.gh .gh-center { gap: 6px; }
}
@media (max-width: 430px) {
  .topbar.gh .gh-mode { display: none; }
  .topbar.gh .room-code-label { display: none; }
  .topbar.gh .icon-btn { width: 34px; height: 34px; font-size: 14px; }
  .topbar.gh .room-code { font-size: 14px; letter-spacing: 1px; padding: 1px 5px; }
}

/* ─────────────── ② HeroPanel（本地玩家底牌大图） ─────────────── */
.hero-panel {
  flex-shrink: 0;
  padding: 6px 12px 8px;
  background: linear-gradient(180deg, rgba(4, 20, 15, .55), rgba(4, 20, 15, .88));
  border-top: 1px solid rgba(255, 255, 255, .06);
}
/* action-bar 存在时两条紧邻：去掉重复的分隔线，视觉合成一个底部区 */
.hero-panel + .action-bar { border-top-color: rgba(217, 180, 91, .14); }

.hero-inner {
  max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(84px, auto) 1fr minmax(72px, auto);
  align-items: center; gap: 10px;
  padding: 7px 12px;
  background: linear-gradient(180deg, rgba(14, 42, 33, .96), rgba(4, 20, 15, .96));
  border: 1px solid var(--table-seat-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .07);
  transition: border-color var(--duration-normal) var(--ease-standard);
}
/* 轮到自己：金边呼吸（复用 PlayerSeat 的 turnPulse 光圈语言） */
.hero-panel.is-turn .hero-inner {
  border-color: var(--color-gold);
  animation: turnPulse 2s var(--ease-standard) infinite;
}
.hero-panel.is-folded .hero-inner { opacity: .5; }

.hero-id { display: flex; align-items: center; gap: 7px; min-width: 0; }
.hero-avatar { width: 32px; height: 32px; font-size: 13px; grid-row: auto; }
.hero-meta { min-width: 0; display: grid; gap: 1px; }
.hero-meta strong {
  font-size: 12.5px; font-weight: 700; color: var(--table-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 复用 .stack（座位筹码）视觉；.stack 自带 grid-column:2（为座位两行网格设计），
   在 hero 的单列网格里必须掰回第 1 列，否则会掉进隐式第二列。 */
.hero-stack { grid-column: 1; font-size: 11px; }

/* 底牌大图：PlayerSeat 同一套牌面，只是放大 + 居中 */
.hero-cards {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, .34);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .3);
}
.hero-cards .card {
  width: 58px; height: 82px; border-radius: 7px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .45), 0 8px 18px rgba(0, 0, 0, .22);
}
.hero-cards .card.sm { width: 58px; height: 82px; }
.hero-cards .card-corner.tl { top: 5px; left: 6px; }
.hero-cards .card-corner.br { bottom: 5px; right: 6px; }
.hero-cards .card-corner .rank { font-size: 17px; }
.hero-cards .card-corner .suit svg { width: 13px; height: 13px; }
.hero-cards .card-center .suit-big svg { width: 36px; height: 36px; }
.hero-panel.is-folded .hero-cards .card { filter: grayscale(.65) brightness(.85); }
/* 未发牌时的空槽（虚线占位，保持面板高度恒定 → 牌桌不会每手抖一次） */
.hero-slot {
  width: 58px; height: 82px; border-radius: 7px;
  border: 1px dashed rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .03);
}

.hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.hero-turn {
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--color-gold); color: var(--color-on-gold);
  background: linear-gradient(180deg, #e0bd68, #b8933f);
  font-size: 10.5px; font-weight: 800; white-space: nowrap;
  box-shadow: 0 0 10px rgba(217, 180, 91, .35);
}
.hero-bet {
  font: 800 11px/1 var(--font-mono); color: var(--color-gold);
  padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .5); border: 1px solid var(--gold-dim); white-space: nowrap;
}
.hero-tags { margin-top: 0; justify-content: flex-end; }
.hero-tags:empty { display: none; }

/* HeroPanel 生效时隐藏自己座位里的小底牌，避免同屏两副 */
#table-screen.hero-on .seat.self .seat-cards { display: none; }

/* 矮屏 / 横屏：收缩牌面与内边距，配合 dvh 限高，绝不挤压 ActionDock */
@media (max-height: 760px) {
  .hero-cards .card, .hero-cards .card.sm, .hero-slot { width: 48px; height: 68px; }
  .hero-cards .card-corner .rank { font-size: 14px; }
  .hero-cards .card-center .suit-big svg { width: 30px; height: 30px; }
  .hero-panel { padding: 4px 10px 6px; }
  .hero-inner { padding: 5px 10px; gap: 8px; }
}
@media (max-width: 430px) {
  .hero-inner { grid-template-columns: auto 1fr auto; gap: 7px; padding: 5px 8px; }
  .hero-meta strong { max-width: 62px; }
  .hero-cards { gap: 6px; padding: 3px 6px; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .hero-panel { padding: 3px 10px 4px; }
  .hero-inner { padding: 4px 10px; max-height: 22dvh; }
  .hero-cards .card, .hero-cards .card.sm, .hero-slot { width: 40px; height: 57px; border-radius: 5px; }
  .hero-cards .card-corner .rank { font-size: 12px; }
  .hero-cards .card-center .suit-big svg { width: 24px; height: 24px; }
  .hero-avatar { width: 26px; height: 26px; font-size: 11px; }
  .hero-turn { font-size: 9.5px; padding: 2px 7px; }
}

/* ─────────────── ③ HandResult（结算三区块） ─────────────── */
/* 抽屉容器加宽：桌面端三区块并排；窄屏仍是 100% 底部抽屉 */
.result-card.hr-card { max-width: 720px; padding: 18px 20px; }

.hr-grid {
  display: grid; gap: 12px;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: start;
}
.hr-block {
  min-width: 0; display: flex; flex-direction: column; gap: 8px;
  padding: 12px; border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
.hr-block-title {
  margin: 0; font-size: 10px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--table-text-muted);
  display: flex; align-items: center; gap: 6px;
}
.hr-block-title::before {
  content: ""; width: 3px; height: 11px; border-radius: 2px;
  background: var(--color-gold); opacity: .75;
}

/* 区块 A：公共牌 */
.hr-board-cards {
  display: flex; flex-wrap: wrap; gap: 5px; justify-content: center;
  padding: 8px 4px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: var(--radius-md);
}
.hr-board-cards .card, .hr-board-cards .card.sm {
  width: 40px; height: 57px; border-radius: 5px;
}
.hr-board-cards .card-corner .rank { font-size: 12px; }
.hr-board-cards .card-center .suit-big svg { width: 24px; height: 24px; }
.hr-pot {
  align-self: center; padding: 3px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, .5); border: 1px solid rgba(217, 180, 91, .24);
  color: var(--color-gold); font: 800 12px/1.4 var(--font-mono); white-space: nowrap;
}
.hr-empty { color: var(--table-text-muted); font-size: 11px; text-align: center; padding: 6px 0; }

/* 区块 B：赢家（沿用 sp-champion-card 金卡视觉） */
.hr-champ { margin-bottom: 0; gap: 9px; padding: 11px 12px; }
.hr-champ + .hr-champ { margin-top: 6px; }
.hr-champ .sp-card-avatar { width: 34px; height: 34px; font-size: 14px; }
.hr-champ .sp-champ-right em { font-size: 17px; }
.hr-champ-note { font-size: 10.5px; color: var(--table-text-muted); text-align: center; }

/* 区块 C：手牌对比 */
.hr-hands { display: flex; flex-direction: column; gap: 6px; }
.hr-hand {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: var(--radius-md);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  transition: border-color var(--duration-normal) var(--ease-standard);
}
/* 赢家：金边 + 微光（与冠军卡同一金色语言） */
.hr-hand.win {
  background: linear-gradient(135deg, rgba(217, 180, 91, .16), rgba(217, 180, 91, .05));
  border-color: rgba(217, 180, 91, .55);
  box-shadow: 0 0 14px rgba(217, 180, 91, .14);
}
/* 其他人灰显 */
.hr-hand.lose { opacity: .62; }
.hr-hand.lose .hr-hand-cards .card { filter: saturate(.45) brightness(.86); }
.hr-hand.out { opacity: .45; }
.hr-hand-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--table-seat-strong); border: 2px solid var(--color-border-strong);
  color: var(--table-text-muted); font-size: 11px; font-weight: 700;
}
.hr-hand.win .hr-hand-avatar { border-color: var(--color-gold); color: var(--color-gold-bright); }
.hr-hand-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hr-hand-info strong {
  font-size: 12px; font-weight: 600; color: var(--table-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hr-hand.win .hr-hand-info strong { color: var(--color-gold); }
.hr-hand-info small { font-size: 10px; color: var(--table-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-hand-cards { display: flex; gap: 3px; flex-shrink: 0; }
.hr-hand-cards .card, .hr-hand-cards .card.sm {
  width: 30px; height: 43px; border-radius: 4px;
}
.hr-hand-cards .card-corner.tl { top: 2px; left: 3px; }
.hr-hand-cards .card-corner.br { bottom: 2px; right: 3px; }
.hr-hand-cards .card-corner .rank { font-size: 10px; }
.hr-hand-cards .card-corner .suit svg { width: 8px; height: 8px; }
.hr-hand-cards .card-center .suit-big svg { width: 18px; height: 18px; }
.hr-hand-profit {
  flex-shrink: 0; font: 800 12px/1 var(--font-mono);
  font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--table-text-muted);
}
.hr-hand-profit.pos { color: var(--color-success-bright); }
.hr-hand-profit.neg { color: var(--color-danger-bright); }
.hr-grid .result-privacy { margin-top: 2px; }

/* 结算底部：关闭按钮跨整行 */
.hr-foot { margin-top: 12px; }

/* 窄屏 / 中屏：三区块改上下堆叠（移动端底部抽屉里纵向滚动） */
@media (max-width: 860px) {
  .hr-grid { grid-template-columns: 1fr; gap: 10px; }
  .result-card.hr-card { max-width: 520px; }
}
@media (max-width: 620px) {
  .result-card.hr-card { max-width: 100%; padding: 16px 14px calc(16px + var(--safe-bottom)); }
  .hr-block { padding: 10px; }
  .hr-board-cards .card, .hr-board-cards .card.sm { width: 36px; height: 51px; }
  .hr-board-cards .card-center .suit-big svg { width: 21px; height: 21px; }
}
