/* pk.css —— 德州扑克页（明暗两档；牌桌绒布在明暗两档都是深绿，绒布上的字用固定浅色）
 * 关键约束：绒布/牌面/筹码是"实物颜色"，不随主题翻转；面板、正文才走 --pk-* 令牌。
 */

:root {
  --pk-text: #1A1A1A;
  --pk-muted: #64748B;
  --pk-panel: #FFFFFF;
  --pk-panel-2: #F5F7FA;
  --pk-border: #D8E2EF;
  --pk-border-2: #EDF2F9;
  --pk-page: #E9EFEA;
  --pk-accent: #0F4C81;
  --pk-accent-2: #0B3F6E;
  --pk-gold: #E7C873;
  --pk-gold-2: #B88A2E;
  --pk-danger: #EF4444;
  --pk-success: #22C55E;
  --pk-shadow: 0 4px 6px rgba(15, 23, 42, .05), 0 12px 26px rgba(15, 23, 42, .08);

  /* 牌桌：深绿绒布 + 木质围栏（两档都不翻） */
  --pk-felt-1: #1F7A52;
  --pk-felt-2: #0C4A33;
  --pk-felt-3: #05281B;
  --pk-rail-1: #5B3A22;
  --pk-rail-2: #2B190C;
  --pk-felt-text: #F1F5F9;
  --pk-felt-muted: #A9C7B8;

  /* 牌面：米白纸 + 固定墨色；暗色主题下也不能把牌面翻黑 */
  --pk-card-bg: #FDFBF6;
  --pk-card-ink: #1E293B;
  --pk-card-red: #C0392B;
  --pk-back-1: #12345A;
  --pk-back-2: #0A2038;

  --pk-cw: 40px;
  --pk-ch: 56px;
  --pk-seatw: 118px;
  --pk-radius: 16px;
}

:root[data-theme="dark"] {
  --pk-text: #F1F5F9;
  --pk-muted: #94A3B8;
  --pk-panel: #1E293B;
  --pk-panel-2: #0F172A;
  --pk-border: #334155;
  --pk-border-2: #1E293B;
  --pk-page: #08111C;
  --pk-accent: #60A5FA;
  --pk-accent-2: #3B82F6;
  --pk-shadow: 0 2px 10px rgba(0, 0, 0, .45);

  --pk-felt-1: #17654A;
  --pk-felt-2: #093D2B;
  --pk-felt-3: #041F15;
  --pk-rail-1: #3B2515;
  --pk-rail-2: #170D06;
}

* { box-sizing: border-box; }

/* 类规则里的 display 会盖过 hidden 属性，这里统一兜住 */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

.pk-body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(231, 200, 115, .10), transparent 60%),
    radial-gradient(900px 500px at 50% 110%, rgba(15, 76, 129, .10), transparent 65%),
    var(--pk-page);
  color: var(--pk-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.pk-modal-open { overflow: hidden; }

.pk-app { min-height: 100vh; display: flex; flex-direction: column; }

/* ── 顶栏 ── */
.pk-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px clamp(12px, 3vw, 26px);
  background: color-mix(in srgb, var(--pk-panel) 88%, transparent);
  border-bottom: 1px solid var(--pk-border);
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
}
.pk-ic-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--pk-border);
  background: var(--pk-panel); color: var(--pk-text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
  flex: 0 0 auto;
}
.pk-ic-btn:hover { border-color: var(--pk-gold-2); color: var(--pk-gold-2); }
.pk-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .3px; min-width: 0; }
.pk-logo-ic {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #2b2b2b, #0b0b0b);
  color: #f8fafc; font-size: 17px; box-shadow: inset 0 0 0 2px rgba(231, 200, 115, .55);
}
.pk-logo > span:nth-child(2) { white-space: nowrap; }
.pk-tag {
  font-size: 11px; font-weight: 600; color: var(--pk-gold-2);
  border: 1px solid color-mix(in srgb, var(--pk-gold-2) 45%, transparent);
  border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.pk-spacer { flex: 1 1 auto; }
.pk-user {
  font-size: 13px; color: var(--pk-muted); max-width: 130px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── 主区 ── */
.pk-main { flex: 1 1 auto; padding: clamp(12px, 2.4vw, 24px) clamp(10px, 2.6vw, 28px) 30px; }

/* ── 入座设置 ── */
.pk-setup { display: flex; justify-content: center; padding: clamp(8px, 2vw, 28px) 0 10px; }
.pk-setup-card {
  width: min(760px, 100%);
  background: var(--pk-panel);
  border: 1px solid var(--pk-border);
  border-radius: 22px;
  box-shadow: var(--pk-shadow);
  padding: clamp(18px, 3vw, 32px);
}
.pk-setup-hero { text-align: center; margin-bottom: 20px; }
.pk-hero-suits { font-size: 30px; letter-spacing: 14px; color: var(--pk-card-red); text-shadow: 0 1px 0 rgba(0,0,0,.08); }
.pk-hero-suits::first-letter { color: var(--pk-text); }
.pk-setup-hero h1 { margin: 6px 0 8px; font-size: clamp(22px, 4vw, 30px); letter-spacing: .5px; }
.pk-setup-hero p { margin: 0 auto; max-width: 560px; color: var(--pk-muted); line-height: 1.75; font-size: 14px; }
.pk-field { margin: 18px 0; }
.pk-field > label { display: block; font-size: 13px; font-weight: 700; color: var(--pk-muted); margin-bottom: 8px; }
.pk-hint { font-size: 12px; color: var(--pk-muted); line-height: 1.65; margin-top: 8px; }

.pk-seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--pk-panel-2); border: 1px solid var(--pk-border); border-radius: 12px; flex-wrap: wrap; }
.pk-seg button {
  border: 0; background: transparent; color: var(--pk-muted); font: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
}
.pk-seg button[aria-pressed="true"] {
  background: var(--pk-panel); color: var(--pk-text); box-shadow: 0 1px 4px rgba(15, 23, 42, .16);
  outline: 1px solid color-mix(in srgb, var(--pk-gold-2) 55%, transparent);
}
.pk-seg button:hover { color: var(--pk-text); }

.pk-rules { margin-top: 22px; border-top: 1px dashed var(--pk-border); padding-top: 16px; }
.pk-rules h3 { margin: 0 0 8px; font-size: 14px; color: var(--pk-muted); }
.pk-rules ul { margin: 0; padding-left: 18px; color: var(--pk-muted); font-size: 13px; line-height: 1.85; }
.pk-rules li + li { margin-top: 3px; }

/* ── 按钮 ── */
.pk-btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.pk-btn {
  appearance: none; border: 1px solid var(--pk-border); background: var(--pk-panel); color: var(--pk-text);
  font: inherit; font-size: 14px; font-weight: 650; border-radius: 12px; padding: 10px 16px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: transform .12s, box-shadow .12s, background .15s, border-color .15s, color .15s;
  min-height: 42px;
}
.pk-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(15, 23, 42, .12); }
.pk-btn:active:not(:disabled) { transform: translateY(0); }
.pk-btn:disabled { opacity: .42; cursor: not-allowed; }
.pk-btn-primary {
  background: linear-gradient(180deg, #F0D68F, var(--pk-gold-2));
  border-color: #8f6a1f; color: #241a06; font-weight: 800;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.pk-btn-lg { padding: 13px 30px; font-size: 16px; border-radius: 14px; }
.pk-btn-ghost { background: transparent; color: var(--pk-muted); }
.pk-btn-fold { border-color: color-mix(in srgb, var(--pk-danger) 55%, var(--pk-border)); color: var(--pk-danger); }
.pk-btn-call { border-color: color-mix(in srgb, var(--pk-accent) 55%, var(--pk-border)); color: var(--pk-accent); }
.pk-btn-raise { border-color: var(--pk-gold-2); color: #7a5a12; background: color-mix(in srgb, var(--pk-gold) 22%, var(--pk-panel)); }
:root[data-theme="dark"] .pk-btn-raise { color: var(--pk-gold); }

/* ── 牌桌布局 ── */
.pk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(12px, 2vw, 22px); align-items: start; max-width: 1320px; margin: 0 auto; }
.pk-table-col { min-width: 0; }

.pk-table {
  position: relative;
  width: 100%;
  aspect-ratio: 1.62 / 1;
  max-height: 660px;
  margin: 0 auto;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .30));
}
.pk-rail {
  position: absolute; inset: 0;
  border-radius: 46% / 42%;
  background:
    linear-gradient(155deg, rgba(255,255,255,.20), transparent 32%),
    repeating-linear-gradient(100deg, rgba(255,255,255,.045) 0 3px, transparent 3px 9px),
    linear-gradient(160deg, var(--pk-rail-1), var(--pk-rail-2));
  padding: 2.6%;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.18), inset 0 -10px 26px rgba(0,0,0,.55);
}
.pk-rail::after {
  content: ""; position: absolute; inset: 1.1%; pointer-events: none;
  border-radius: 45.5% / 41.5%;
  border: 1px dashed rgba(231, 200, 115, .16);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, .05);
}
.pk-felt {
  position: absolute; inset: 2.6%;
  border-radius: 47% / 43%;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255,255,255,.13), transparent 52%),
    repeating-linear-gradient(28deg, rgba(255,255,255,.022) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-28deg, rgba(0,0,0,.03) 0 2px, transparent 2px 5px),
    radial-gradient(ellipse at 50% 42%, var(--pk-felt-1), var(--pk-felt-2) 64%, var(--pk-felt-3));
  box-shadow:
    inset 0 0 70px rgba(0,0,0,.55),
    inset 0 0 0 2px rgba(231,200,115,.32),
    inset 0 0 0 7px rgba(0,0,0,.14),
    inset 0 18px 40px rgba(255,255,255,.05);
  overflow: hidden;
}
/* 绒布细颗粒（不抢戏，只在不缩放时可见） */
.pk-felt::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: radial-gradient(rgba(255,255,255,.10) .6px, transparent .8px);
  background-size: 4px 4px;
  mix-blend-mode: overlay;
}
/* 中央金色细环 */
.pk-felt::after {
  content: ""; position: absolute; left: 50%; top: 47%; width: 46%; height: 46%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed rgba(231, 200, 115, .20);
  pointer-events: none;
}

.pk-tablemark {
  position: absolute; left: 50%; bottom: 4.5%; transform: translateX(-50%);
  font-size: 9px; letter-spacing: 4px; color: rgba(241, 245, 249, .22);
  font-weight: 700; white-space: nowrap; pointer-events: none;
}

/* ── 中央：底池 / 公共牌 ── */
.pk-center {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  width: 72%; pointer-events: none;
}
.pk-pot {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0, 0, 0, .40);
  border: 1px solid rgba(231, 200, 115, .34);
  border-radius: 999px; padding: 5px 15px 5px 9px;
  color: var(--pk-felt-text);
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.pk-pot-label { font-size: 11px; letter-spacing: 2px; color: var(--pk-felt-muted); }
.pk-pot b { font-size: 19px; color: var(--pk-gold); font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.pk-pot-chips { display: inline-flex; align-items: flex-end; }
.pk-pot-chips i {
  display: block; width: 13px; height: 13px; border-radius: 50%; margin-left: -3px;
  background: repeating-conic-gradient(#e5e7eb 0 22deg, #94a3b8 22deg 44deg);
  border: 2px solid #f8fafc; box-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.pk-pot-chips i:nth-child(2) { background: repeating-conic-gradient(#fca5a5 0 22deg, #b91c1c 22deg 44deg); }
.pk-pot-chips i:nth-child(3) { background: repeating-conic-gradient(#86efac 0 22deg, #15803d 22deg 44deg); }

.pk-board { display: flex; gap: clamp(3px, .8vw, 7px); justify-content: center; }
.pk-slot {
  width: var(--pk-cw); height: var(--pk-ch); border-radius: 6px;
  border: 1.5px dashed rgba(241, 245, 249, .28);
  background: rgba(0, 0, 0, .12);
}
.pk-street { font-size: 11px; letter-spacing: 3px; color: var(--pk-felt-muted); text-transform: uppercase; }

/* ── 扑克牌 ── */
.pk-card {
  position: relative; width: var(--pk-cw); height: var(--pk-ch);
  border-radius: 6px; background: var(--pk-card-bg); color: var(--pk-card-ink);
  box-shadow: 0 3px 8px rgba(0,0,0,.38), 0 0 0 1px rgba(0,0,0,.10);
  display: flex; align-items: center; justify-content: center;
  user-select: none; flex: 0 0 auto;
  overflow: hidden;
}
.pk-card.red { color: var(--pk-card-red); }
.pk-card .pk-corner {
  position: absolute; top: 2px; left: 3px; line-height: .95;
  font-weight: 900; font-size: calc(var(--pk-cw) * .34);
  display: flex; flex-direction: column; align-items: center;
}
.pk-card .pk-corner span:last-child { font-size: calc(var(--pk-cw) * .27); }
.pk-card .pk-corner.br { top: auto; left: auto; right: 3px; bottom: 2px; transform: rotate(180deg); }
.pk-card .pk-pip { font-size: calc(var(--pk-cw) * .52); line-height: 1; opacity: .92; }
.pk-card .pk-pips { position: absolute; inset: 13% 17%; pointer-events: none; }
.pk-card .pk-pips i {
  position: absolute; font-style: normal; line-height: 1;
  font-size: calc(var(--pk-cw) * .185);
  transform: translate(-50%, -50%);
}
.pk-card .pk-pips i.rot { transform: translate(-50%, -50%) rotate(180deg); }
.pk-card .pk-court { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.pk-card .pk-court b { font-size: calc(var(--pk-cw) * .42); font-weight: 900; letter-spacing: -.5px; }
.pk-card .pk-court i { font-style: normal; font-size: calc(var(--pk-cw) * .25); margin-top: 1px; }
.pk-card.back {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.075) 0 3px, transparent 3px 7px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.06) 0 3px, transparent 3px 7px),
    radial-gradient(circle at 35% 28%, #1c4b7a, var(--pk-back-1) 45%, var(--pk-back-2));
  box-shadow: 0 3px 8px rgba(0,0,0,.42), inset 0 0 0 2px rgba(231, 200, 115, .55), inset 0 0 0 4px rgba(0,0,0,.25);
  color: transparent;
}
.pk-card.back::after {
  content: "♠"; position: absolute; color: rgba(231, 200, 115, .55); font-size: calc(var(--pk-cw) * .38);
}
.pk-card.is-deal { animation: pk-deal .3s cubic-bezier(.2, .8, .3, 1.1) both; }
.pk-card.is-flip { animation: pk-flip .32s ease-out both; }
.pk-card.is-win { box-shadow: 0 0 0 2px var(--pk-gold), 0 0 16px rgba(231, 200, 115, .85), 0 4px 10px rgba(0,0,0,.4); }
.pk-slot.is-win { border-color: var(--pk-gold); box-shadow: 0 0 12px rgba(231, 200, 115, .45); }

@keyframes pk-deal {
  from { opacity: 0; transform: translateY(-18px) scale(.86) rotate(-5deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
@keyframes pk-flip {
  from { transform: rotateY(90deg) scale(.96); opacity: .4; }
  to { transform: rotateY(0) scale(1); opacity: 1; }
}

/* ── 座位 ── */
.pk-seats { position: absolute; inset: 0; pointer-events: none; }
.pk-seat {
  position: absolute; width: var(--pk-seatw);
  display: flex; flex-direction: column; align-items: center;
  color: var(--pk-felt-text);
  transition: opacity .2s, filter .2s;
  z-index: 3;
}
/* 上下两家用 bottom/top 贴边，避免整块座位被绒布 overflow 裁掉 */
.pk-pos-0 { left: 50%; bottom: 2%; transform: translateX(-50%); }
.pk-pos-1 { left: 86%; top: 68%; transform: translate(-50%, -50%); }
.pk-pos-2 { left: 86%; top: 24%; transform: translate(-50%, -50%); }
.pk-pos-3 { left: 50%; top: 4%;  transform: translateX(-50%); }
.pk-pos-4 { left: 14%; top: 24%; transform: translate(-50%, -50%); }
.pk-pos-5 { left: 14%; top: 68%; transform: translate(-50%, -50%); }

.pk-player {
  display: flex; align-items: center; gap: 7px;
  background: linear-gradient(180deg, rgba(15,23,42,.72), rgba(2,6,23,.72));
  border: 1px solid rgba(231, 200, 115, .26);
  border-radius: 999px; padding: 4px 11px 4px 4px;
  min-width: 104px;
  box-shadow: 0 4px 12px rgba(0,0,0,.28);
  position: relative;
}
.pk-avatar-wrap { position: relative; flex: 0 0 auto; display: inline-flex; }
.pk-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
  background: radial-gradient(circle at 32% 26%, #64748b, #1e293b 70%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.16);
}
.pk-pos-tag {
  position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  font-size: 8px; font-weight: 900; line-height: 1.5; letter-spacing: .2px;
  padding: 0 3px; border-radius: 4px; white-space: nowrap;
  background: #0b1220; color: var(--pk-gold);
  border: 1px solid rgba(231, 200, 115, .55);
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.pk-seat.is-you .pk-avatar { background: radial-gradient(circle at 32% 26%, #f0d68f, #b88a2e 70%); color: #241a06; }
.pk-pos-1 .pk-avatar { background: radial-gradient(circle at 32% 26%, #60a5fa, #1d4ed8 70%); }
.pk-pos-2 .pk-avatar { background: radial-gradient(circle at 32% 26%, #f472b6, #9d174d 70%); }
.pk-pos-3 .pk-avatar { background: radial-gradient(circle at 32% 26%, #a78bfa, #5b21b6 70%); }
.pk-pos-4 .pk-avatar { background: radial-gradient(circle at 32% 26%, #34d399, #047857 70%); }
.pk-pos-5 .pk-avatar { background: radial-gradient(circle at 32% 26%, #fbbf24, #b45309 70%); }

.pk-meta { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.pk-name { font-size: 12px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 86px; }
.pk-stack { font-size: 12px; color: var(--pk-gold); font-variant-numeric: tabular-nums; font-weight: 700; }

.pk-seat.is-actor .pk-player {
  border-color: var(--pk-gold);
  box-shadow: 0 0 0 2px rgba(231, 200, 115, .8), 0 0 22px rgba(231, 200, 115, .55);
  animation: pk-pulse 1.7s ease-in-out infinite;
}
@keyframes pk-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(231,200,115,.75), 0 0 16px rgba(231,200,115,.42); }
  50% { box-shadow: 0 0 0 3px rgba(231,200,115,.95), 0 0 28px rgba(231,200,115,.72); }
}
.pk-seat.is-folded { opacity: .52; }
.pk-seat.is-out { opacity: .30; filter: grayscale(1); }
.pk-seat.is-winner .pk-player { border-color: var(--pk-gold); box-shadow: 0 0 0 2px var(--pk-gold), 0 0 26px rgba(231,200,115,.7); }
.pk-seat.is-you .pk-player { min-width: 116px; }

.pk-hole { display: flex; gap: 4px; margin-bottom: 4px; min-height: var(--pk-ch); align-items: flex-end; }
.pk-hole .pk-card { --pk-cw: 34px; --pk-ch: 48px; }
.pk-seat.is-you .pk-hole .pk-card { --pk-cw: 48px; --pk-ch: 68px; }
/* 对家：DOM 是 hole→player→act，column-reverse 后从上到下变成 act→player→hole */
.pk-pos-3 { flex-direction: column-reverse; }
.pk-pos-3 .pk-hole { margin: 4px 0 0; }

.pk-seat-bet {
  position: absolute; display: inline-flex; align-items: center; gap: 5px;
  background: rgba(2, 6, 23, .55); border: 1px solid rgba(231,200,115,.22);
  border-radius: 999px; padding: 2px 8px 2px 4px;
  font-size: 11px; font-weight: 800; color: var(--pk-gold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap; pointer-events: none;
}
.pk-chipstack { display: inline-flex; align-items: flex-end; }
.pk-seat-bet .pk-chip {
  width: 12px; height: 12px; border-radius: 50%;
  background: repeating-conic-gradient(#fde68a 0 24deg, #b45309 24deg 48deg);
  border: 1.5px solid #fff7ed; box-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.pk-chipstack .pk-chip:nth-child(2) {
  margin-left: -8px; transform: translateY(-2px);
  background: repeating-conic-gradient(#bfdbfe 0 24deg, #1d4ed8 24deg 48deg);
}
.pk-chipstack .pk-chip:nth-child(3) {
  margin-left: -8px; transform: translateY(-4px);
  background: repeating-conic-gradient(#e5e7eb 0 24deg, #475569 24deg 48deg);
}
.pk-seat-bet[hidden] { display: none; }
.pk-pos-0 .pk-seat-bet { top: -26px; left: 50%; transform: translateX(-50%); }
.pk-pos-1 .pk-seat-bet { left: -36px; top: 50%; transform: translateY(-50%); }
.pk-pos-2 .pk-seat-bet { left: -36px; top: 50%; transform: translateY(-50%); }
.pk-pos-3 .pk-seat-bet { bottom: -26px; left: 50%; transform: translateX(-50%); }
.pk-pos-4 .pk-seat-bet { right: -36px; top: 50%; transform: translateY(-50%); }
.pk-pos-5 .pk-seat-bet { right: -36px; top: 50%; transform: translateY(-50%); }

.pk-badges { position: absolute; top: -6px; right: -2px; display: flex; gap: 3px; align-items: center; }
.pk-dealer, .pk-blind, .pk-allin-tag, .pk-out-tag {
  font-size: 9px; font-weight: 900; line-height: 1;
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.45);
}
.pk-dealer {
  background: radial-gradient(circle at 35% 30%, #fff7d6, #e7c873 55%, #a77c22);
  color: #3a2a06; border: 1px solid #fff3c4;
  box-shadow: 0 1px 3px rgba(0,0,0,.45), inset 0 0 0 1.5px rgba(255,255,255,.55);
}
.pk-blind { width: auto; padding: 0 5px; border-radius: 999px; background: #f8fafc; color: #0f172a; }
.pk-allin-tag { width: auto; padding: 0 5px; border-radius: 999px; background: var(--pk-danger); color: #fff; }
.pk-out-tag { width: auto; padding: 0 5px; border-radius: 999px; background: #475569; color: #f1f5f9; }

.pk-act {
  margin-top: 4px; font-size: 10px; font-weight: 700; letter-spacing: .3px;
  color: #0b1220; background: rgba(241, 245, 249, .92);
  border-radius: 999px; padding: 2px 8px; white-space: nowrap;
  min-height: 16px; opacity: 0; transition: opacity .15s;
}
.pk-act:not(:empty) { opacity: 1; }
.pk-act.k-fold { background: rgba(254, 226, 226, .94); color: #991b1b; }
.pk-act.k-raise { background: rgba(253, 230, 138, .96); color: #713f12; }
.pk-act.k-call { background: rgba(219, 234, 254, .96); color: #1e40af; }

.pk-tags { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.pk-handtag {
  font-size: 9.5px; font-weight: 750; line-height: 1.5;
  padding: 1px 6px; border-radius: 999px; white-space: nowrap;
  background: rgba(2, 6, 23, .78); color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, .45);
}
.pk-handtag.is-win { color: var(--pk-gold); border-color: var(--pk-gold); box-shadow: 0 0 8px rgba(231, 200, 115, .45); }
.pk-won {
  font-size: 10px; font-weight: 850; line-height: 1.5;
  padding: 1px 5px; border-radius: 999px; white-space: nowrap;
  background: rgba(22, 101, 52, .85); color: #bbf7d0;
  border: 1px solid rgba(134, 239, 172, .45);
}

/* ── 开局门：入座后先停在这里，点“开始游戏”才发牌 ── */
.pk-startgate {
  max-width: 980px; margin: 12px auto 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pk-gold) 20%, var(--pk-panel)), var(--pk-panel));
  border: 1px dashed color-mix(in srgb, var(--pk-gold-2) 55%, var(--pk-border));
  border-radius: 14px; padding: 13px 15px;
  box-shadow: var(--pk-shadow);
  animation: pk-rise .28s ease-out both;
}
.pk-startgate-box { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.pk-startgate-kicker {
  font-size: 10.5px; font-weight: 800; letter-spacing: .8px; color: var(--pk-gold-2);
  border: 1px solid color-mix(in srgb, var(--pk-gold-2) 45%, transparent);
  border-radius: 999px; padding: 2px 8px;
}
.pk-startgate-box b { font-size: 15px; }
.pk-startgate-sub { font-size: 12.5px; color: var(--pk-muted); line-height: 1.5; }
.pk-startgate-box .pk-btn { margin-left: auto; min-height: 40px; }

/* ── 结果横幅 ── */
.pk-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 10px auto 0; max-width: 980px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pk-gold) 20%, var(--pk-panel)), var(--pk-panel));
  border: 1px solid color-mix(in srgb, var(--pk-gold-2) 50%, var(--pk-border));
  border-radius: 14px; padding: 10px 14px;
  box-shadow: var(--pk-shadow);
  animation: pk-rise .28s ease-out both;
}
@keyframes pk-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.pk-banner-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pk-banner-text b { font-size: 15px; }
.pk-banner-text span { font-size: 12.5px; color: var(--pk-muted); line-height: 1.5; }

/* ── 动作条 ── */
.pk-actionbar {
  max-width: 980px; margin: 12px auto 0;
  background: var(--pk-panel);
  border: 1px solid var(--pk-border);
  border-radius: var(--pk-radius);
  box-shadow: var(--pk-shadow);
  padding: 12px 14px;
  display: grid; gap: 10px;
}
.pk-ab-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pk-turn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pk-muted); flex: 0 0 auto; }
.pk-actionbar.is-live .pk-turn-dot { background: var(--pk-success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pk-success) 22%, transparent); animation: pk-blink 1.4s infinite; }
@keyframes pk-blink { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.pk-ab-head b { font-size: 14px; }
.pk-ab-stack { margin-left: auto; font-size: 12px; color: var(--pk-muted); font-variant-numeric: tabular-nums; }
.pk-ab-btns { display: grid; grid-template-columns: 1fr 1.35fr 1.35fr; gap: 8px; }
.pk-ab-btns .pk-btn { width: 100%; }
.pk-ab-slider { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.pk-ab-slider input[type="range"] { width: 100%; accent-color: var(--pk-gold-2); cursor: pointer; height: 22px; }
.pk-quick { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.pk-quick button {
  border: 1px solid var(--pk-border); background: var(--pk-panel-2); color: var(--pk-muted);
  font: inherit; font-size: 11.5px; font-weight: 650; border-radius: 8px; padding: 5px 10px; cursor: pointer;
}
.pk-quick button:hover { color: var(--pk-text); border-color: var(--pk-gold-2); }
.pk-ab-slider output {
  min-width: 92px; text-align: right; font-weight: 850; font-size: 15px;
  color: var(--pk-gold-2); font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] .pk-ab-slider output { color: var(--pk-gold); }
.pk-keys { display: flex; flex-wrap: wrap; gap: 5px 12px; font-size: 11px; color: var(--pk-muted); }
.pk-keys kbd {
  font: inherit; font-size: 10px; font-weight: 800; line-height: 1;
  padding: 2px 4px; margin-right: 2px; border-radius: 4px;
  border: 1px solid var(--pk-border); border-bottom-width: 2px;
  background: var(--pk-panel-2); color: var(--pk-text);
}

/* ── 侧栏 ── */
.pk-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* 注意：侧栏面板是 .pk-cardbox，扑克牌是 .pk-card，两者不能共用类名 */
.pk-cardbox {
  background: var(--pk-panel); border: 1px solid var(--pk-border); border-radius: var(--pk-radius);
  box-shadow: var(--pk-shadow); padding: 13px 14px;
}
.pk-cardbox h3 { margin: 0 0 9px; font-size: 13px; color: var(--pk-muted); letter-spacing: .5px; font-weight: 750; }
/* 实时积分榜：每手结束后结算一次，行内数字用等宽数字 */
.pk-lbcard h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pk-lb-hand { font-size: 11px; font-weight: 600; letter-spacing: 0; color: var(--pk-muted); white-space: nowrap; }
.pk-lb { display: grid; gap: 1px; font-variant-numeric: tabular-nums; }
.pk-lb-row {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) 44px 44px 50px;
  gap: 6px; align-items: center; padding: 4px 6px; border-radius: 7px; font-size: 12px;
}
.pk-lb-row.pk-lb-head { font-size: 10.5px; color: var(--pk-muted); padding-top: 0; padding-bottom: 2px; }
.pk-lb-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-lb-row .rk { color: var(--pk-muted); font-size: 11px; text-align: center; }
.pk-lb-row .dl, .pk-lb-row .nt, .pk-lb-row .st { text-align: right; }
.pk-lb-row .dl.is-up, .pk-lb-row .nt.is-up { color: var(--pk-success); font-weight: 750; }
.pk-lb-row .dl.is-down, .pk-lb-row .nt.is-down { color: var(--pk-danger); font-weight: 750; }
.pk-lb-row.is-you { background: color-mix(in srgb, var(--pk-gold) 15%, transparent); font-weight: 750; }
.pk-lb-row.is-out { opacity: .55; }
.pk-lb-foot { margin-top: 7px; font-size: 11px; color: var(--pk-muted); }
.pk-info-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 5px 0; border-bottom: 1px dashed var(--pk-border-2); }
.pk-info-row:last-child { border-bottom: 0; }
.pk-info-row span { color: var(--pk-muted); }
.pk-info-row b { font-variant-numeric: tabular-nums; }
.pk-handname { font-size: 20px; font-weight: 850; letter-spacing: .5px; min-height: 26px; }
.pk-equity { margin-top: 5px; font-size: 12px; color: var(--pk-muted); line-height: 1.6; }
.pk-equity b { color: var(--pk-accent); font-size: 14px; }
.pk-draws {
  margin-top: 8px; font-size: 12px; line-height: 1.55; color: var(--pk-text);
  background: var(--pk-panel-2); border-left: 3px solid var(--pk-gold-2);
  border-radius: 8px; padding: 6px 9px; min-height: 30px;
}
.pk-stats { margin-top: 7px; font-size: 11.5px; color: var(--pk-muted); font-variant-numeric: tabular-nums; }
.pk-logcard { display: flex; flex-direction: column; min-height: 0; }
.pk-log {
  height: 230px; overflow-y: auto; font-size: 12px; line-height: 1.62;
  border-radius: 10px; background: var(--pk-panel-2); padding: 8px 10px;
  color: var(--pk-muted);
  scrollbar-width: thin;
}
.pk-log-line { padding: 1.5px 0; word-break: break-word; }
.pk-log-line.k-hand { color: var(--pk-text); font-weight: 750; margin-top: 4px; }
.pk-log-line.k-street { color: var(--pk-accent); font-weight: 700; }
.pk-log-line.k-result { color: var(--pk-gold-2); font-weight: 750; }
:root[data-theme="dark"] .pk-log-line.k-result { color: var(--pk-gold); }
.pk-log-line.k-bust { color: var(--pk-danger); font-weight: 700; }
.pk-log-line.k-level { color: var(--pk-success); font-weight: 750; }
.pk-log-line.k-champion { color: var(--pk-gold-2); font-weight: 850; }
.pk-side-btns { margin-top: 0; }
.pk-side-btns .pk-btn { flex: 1 1 0; padding: 8px 10px; font-size: 12.5px; min-height: 38px; }

/* ── 结果弹窗 ── */
.pk-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 18px; }
.pk-modal[hidden] { display: none; }
.pk-modal-mask { position: absolute; inset: 0; background: rgba(2, 6, 23, .62); backdrop-filter: blur(4px); }
.pk-modal-box {
  position: relative; width: min(520px, 100%);
  background: var(--pk-panel); border: 1px solid var(--pk-border); border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45); padding: 24px; text-align: center;
  max-height: 88vh; overflow-y: auto;
  animation: pk-rise .3s ease-out both;
}
.pk-trophy { font-size: 54px; line-height: 1; filter: drop-shadow(0 8px 16px rgba(184, 138, 46, .35)); }
.pk-modal-box h2 { margin: 10px 0 6px; font-size: 24px; }
.pk-result-sub { margin: 0 0 14px; color: var(--pk-muted); font-size: 13.5px; line-height: 1.7; }
.pk-standings { border: 1px solid var(--pk-border-2); border-radius: 14px; overflow: hidden; text-align: left; }
.pk-standing { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 9px 12px; font-size: 13px; border-bottom: 1px solid var(--pk-border-2); }
.pk-standing:last-child { border-bottom: 0; }
.pk-standing.is-you { background: color-mix(in srgb, var(--pk-gold) 16%, transparent); font-weight: 750; }
.pk-standing .rk { font-weight: 850; color: var(--pk-muted); font-variant-numeric: tabular-nums; }
.pk-standing .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-standing .pz { color: var(--pk-gold-2); font-weight: 800; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .pk-standing .pz { color: var(--pk-gold); }
.pk-modal-box .pk-btnrow { justify-content: center; }

/* ── 响应式 ── */
@media (max-width: 1120px) {
  .pk-layout { grid-template-columns: minmax(0, 1fr); }
  .pk-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .pk-side .pk-logcard { grid-column: 1 / -1; }
  .pk-side .pk-log { height: 180px; }
  .pk-table { max-height: 560px; }
}
@media (max-width: 760px) {
  :root { --pk-cw: 36px; --pk-ch: 50px; --pk-seatw: 106px; }
  .pk-logo .pk-tag { display: none; }
  .pk-table { aspect-ratio: 1.32 / 1; max-height: none; }
  .pk-seats { font-size: 11px; }
  .pk-player { min-width: 94px; padding: 3px 9px 3px 3px; gap: 5px; }
  .pk-avatar { width: 26px; height: 26px; font-size: 11px; }
  .pk-name { max-width: 68px; font-size: 11px; }
  .pk-stack { font-size: 11px; }
  .pk-hole .pk-card { --pk-cw: 29px; --pk-ch: 41px; }
  .pk-seat.is-you .pk-hole .pk-card { --pk-cw: 40px; --pk-ch: 56px; }
  .pk-pos-1, .pk-pos-2 { left: 84%; }
  .pk-pos-4, .pk-pos-5 { left: 16%; }
  .pk-center { width: 76%; gap: 6px; }
  .pk-pot b { font-size: 17px; }
  .pk-street { font-size: 10px; letter-spacing: 2px; }
  .pk-seat-bet { font-size: 10px; }
  .pk-pos-1 .pk-seat-bet, .pk-pos-2 .pk-seat-bet { left: -26px; }
  .pk-pos-4 .pk-seat-bet, .pk-pos-5 .pk-seat-bet { right: -26px; }
  .pk-side { grid-template-columns: minmax(0, 1fr); }
  .pk-side .pk-logcard { grid-column: auto; }
  .pk-ab-btns { grid-template-columns: 1fr 1.2fr 1.2fr; }
  .pk-actionbar { padding: 10px 12px; }
  .pk-pos-tag { font-size: 7px; bottom: -6px; }
  .pk-handtag { font-size: 8.5px; padding: 0 5px; }
  .pk-won { font-size: 9px; }
}
@media (max-width: 430px) {
  :root { --pk-cw: 33px; --pk-ch: 46px; --pk-seatw: 96px; }
  .pk-topbar { padding: 8px 10px; gap: 8px; }
  .pk-user { display: none; }
  .pk-logo { font-size: 14px; }
  .pk-logo-ic { width: 26px; height: 26px; font-size: 14px; }
  .pk-table { aspect-ratio: 1.06 / 1; }
  .pk-pos-0 { bottom: 1.5%; }
  .pk-pos-1 { left: 82%; top: 69%; }
  .pk-pos-2 { left: 82%; top: 24%; }
  .pk-pos-3 { top: 3%; }
  .pk-pos-4 { left: 18%; top: 24%; }
  .pk-pos-5 { left: 18%; top: 69%; }
  .pk-player { min-width: 84px; padding: 3px 8px 3px 3px; }
  .pk-name { max-width: 58px; font-size: 10.5px; }
  .pk-stack { font-size: 10.5px; }
  .pk-avatar { width: 24px; height: 24px; font-size: 10px; }
  .pk-hole .pk-card { --pk-cw: 25px; --pk-ch: 35px; }
  .pk-seat.is-you .pk-hole .pk-card { --pk-cw: 36px; --pk-ch: 50px; }
  .pk-center { top: 45%; width: 82%; }
  .pk-pot { padding: 4px 12px 4px 8px; gap: 6px; }
  .pk-pot b { font-size: 16px; }
  .pk-tablemark { display: none; }
  .pk-seat.is-you .pk-player { min-width: 96px; }
  .pk-ab-btns { grid-template-columns: 1fr 1fr; }
  .pk-ab-btns .pk-btn-raise { grid-column: 1 / -1; }
  .pk-banner { flex-direction: column; align-items: stretch; gap: 8px; }
  .pk-banner .pk-btn { width: 100%; }
  .pk-setup-card { border-radius: 18px; }
  .pk-hero-suits { font-size: 24px; letter-spacing: 10px; }
  .pk-seg { width: 100%; }
  .pk-seg button { flex: 1 1 0; padding: 8px 8px; }
  .pk-log { height: 160px; }
  .pk-keys { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pk-card.is-deal, .pk-card.is-flip, .pk-banner, .pk-modal-box { animation: none; }
  .pk-seat.is-actor .pk-player { animation: none; }
  .pk-actionbar.is-live .pk-turn-dot { animation: none; }
}
