/* ====== 德州扑克 · Telegram Mini App · 仅移动端 ====== */
:root {
  --bg: #0b0b0d;
  --bg2: #141418;
  --card: #1b1c21;
  --line: rgba(255, 255, 255, .07);
  --text: #f3efe6;
  --sub: #9a968c;
  --gold: #e8c26e;
  --gold2: #b98a3a;
  --gold-grad: linear-gradient(135deg, #fbe7b0 0%, #e8c26e 40%, #b98a3a 100%);
  --green: #1fbf7a;
  --red: #ef4f5f;
  --felt1: #0f7a59;
  --felt2: #07422f;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --vh: 1vh;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); overflow: hidden; overscroll-behavior: none; }
body {
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.hidden { display: none !important; }

#app { position: fixed; inset: 0; max-width: 520px; margin: 0 auto; overflow: hidden; background: var(--bg); }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-bottom: calc(84px + var(--safe-b)); }
.scroll::-webkit-scrollbar { display: none; }

/* ---------- 启动页 ---------- */
#boot { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(120% 70% at 50% 30%, #2a2214 0%, var(--bg) 70%); transition: opacity .4s; }
#boot.out { opacity: 0; pointer-events: none; }
.logo { width: 84px; height: 84px; }
.boot-title { font-size: 22px; font-weight: 800; letter-spacing: 6px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.boot-msg { color: var(--sub); font-size: 13px; min-height: 18px; text-align: center; padding: 0 30px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(232, 194, 110, .2); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 顶栏 ---------- */
.topbar { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 16px 10px; }
.me-chip { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.me-chip .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.balance { display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 5px; border-radius: 99px; background: rgba(232, 194, 110, .1); border: 1px solid rgba(232, 194, 110, .25); font-weight: 800; color: var(--gold); }
.coin { width: 18px; height: 18px; flex: none; }

/* ---------- 头像 ---------- */
.ava { position: relative; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; font-weight: 800; color: #fff; background: #333; }
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava.s32 { width: 32px; height: 32px; font-size: 14px; }
.ava.s72 { width: 72px; height: 72px; font-size: 28px; }

/* ---------- 大厅横幅 ---------- */
.hero-banner { position: relative; margin: 4px 16px 14px; border-radius: 20px; padding: 18px 18px 16px; overflow: hidden;
  background: radial-gradient(90% 120% at 100% 0%, rgba(232, 194, 110, .35), transparent 60%), linear-gradient(160deg, #2b2416, #15130f 70%);
  border: 1px solid rgba(232, 194, 110, .22); }
.hero-banner::after { content: ""; position: absolute; right: -18px; bottom: -30px; width: 150px; height: 150px; opacity: .14;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23e8c26e' d='M50 5C35 30 10 40 10 62c0 13 10 22 22 22 7 0 12-3 15-8-1 8-4 14-10 18h26c-6-4-9-10-10-18 3 5 8 8 15 8 12 0 22-9 22-22C90 40 65 30 50 5z'/%3E%3C/svg%3E") no-repeat center/contain; }
.hero-banner h2 { font-size: 13px; color: var(--sub); font-weight: 500; }
.hero-banner .big { font-size: 30px; font-weight: 900; margin: 2px 0 12px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .5px; }
.hero-actions { display: flex; gap: 10px; position: relative; z-index: 1; }

.btn { height: 42px; padding: 0 18px; border-radius: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform .12s, filter .12s, opacity .2s; }
.btn:active { transform: scale(.96); filter: brightness(.92); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-gold { background: var(--gold-grad); color: #2a1d06; box-shadow: 0 6px 18px -6px rgba(232, 194, 110, .6), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-ghost { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.btn-block { width: 100%; height: 50px; font-size: 16px; border-radius: 16px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; padding: 4px; margin: 0 16px 12px; background: var(--bg2); border-radius: 14px; border: 1px solid var(--line); overflow-x: auto; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; height: 34px; padding: 0 12px; border-radius: 10px; color: var(--sub); font-weight: 600; font-size: 13px; transition: all .2s; }
.tab.on { background: var(--gold-grad); color: #2a1d06; box-shadow: 0 2px 10px -4px rgba(232, 194, 110, .7); }

.section-title { display: flex; align-items: center; gap: 10px; margin: 16px 16px 10px; color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: 2px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(232, 194, 110, .3), transparent); }

/* ---------- 牌桌卡片 ---------- */
.tlist { display: flex; flex-direction: column; gap: 10px; padding: 0 16px; }
.tcard { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, #1f2026, #18191d); border: 1px solid var(--line); transition: transform .12s; }
.tcard:active { transform: scale(.985); }
.tcard::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent, var(--gold)); }
.ring { position: relative; width: 54px; height: 54px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.tinfo { flex: 1; min-width: 0; }
.tinfo .row1 { display: flex; align-items: center; gap: 6px; color: var(--sub); font-size: 12px; }
.tag { padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; color: #1a1306; background: var(--accent, var(--gold)); }
.tinfo .blinds { font-size: 20px; font-weight: 800; margin: 3px 0 1px; letter-spacing: .3px; }
.tinfo .row3 { color: var(--sub); font-size: 12px; }
.tbuy { text-align: right; flex: none; }
.tbuy small { display: block; color: var(--sub); font-size: 11px; }
.tbuy b { display: inline-flex; align-items: center; gap: 4px; font-size: 17px; color: var(--gold); }
.live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(31, 191, 122, .18); margin-right: 4px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(31, 191, 122, 0); } }

.empty { text-align: center; color: var(--sub); padding: 30px 0; font-size: 13px; }

/* ---------- 底部导航 ---------- */
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; padding: 8px 10px calc(8px + var(--safe-b));
  background: rgba(14, 14, 17, .86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border-radius: 14px; color: var(--sub); font-size: 11px; font-weight: 600; transition: color .2s; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar button.on { color: var(--gold); background: rgba(232, 194, 110, .08); }

/* ---------- 我的 ---------- */
.profile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: calc(28px + var(--safe-t)) 16px 6px; }
.profile .ava { box-shadow: 0 0 0 3px #0b0b0d, 0 0 0 5px var(--gold2); }
.profile .pname { font-size: 20px; font-weight: 800; }
.profile .pid { color: var(--sub); font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 16px; }
.stat { padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.stat small { color: var(--sub); font-size: 12px; }
.stat b { display: block; font-size: 22px; font-weight: 800; margin-top: 2px; }
.list { margin: 0 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 0 16px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.li:last-child { border-bottom: 0; }
.li .r { color: var(--sub); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.switch { width: 46px; height: 28px; border-radius: 99px; background: #3a3a40; position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 4px rgba(0, 0, 0, .3); }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(18px); }

/* ---------- 房间页 ---------- */
.panel { margin: 0 16px 14px; padding: 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.panel h3 { font-size: 16px; margin-bottom: 4px; }
.panel p { color: var(--sub); font-size: 12px; margin-bottom: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; color: var(--sub); font-size: 12px; margin-bottom: 6px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { flex: 1 0 auto; min-width: 56px; height: 38px; padding: 0 10px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.seg button.on { border-color: var(--gold); color: var(--gold); background: rgba(232, 194, 110, .1); }
.code-boxes { display: flex; gap: 8px; justify-content: center; margin: 4px 0 14px; }
.code-boxes span { width: 44px; height: 54px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); display: grid; place-items: center; font-size: 24px; font-weight: 800; }
.code-boxes span.cur { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 194, 110, .15); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { height: 48px; border-radius: 12px; background: rgba(255, 255, 255, .06); font-size: 20px; font-weight: 700; }
.keypad button:active { background: rgba(255, 255, 255, .14); }

/* ---------- Toast ---------- */
#toasts { position: fixed; left: 0; right: 0; top: calc(60px + var(--safe-t)); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { max-width: 80%; padding: 10px 16px; border-radius: 12px; background: rgba(20, 20, 24, .92); border: 1px solid rgba(232, 194, 110, .25); backdrop-filter: blur(10px); font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: toastIn .25s ease-out; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.96); } }

/* ---------- Sheet / Modal ---------- */
.mask { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .25s; }
.mask.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-width: 520px; margin: 0 auto; max-height: 86vh; overflow-y: auto;
  padding: 10px 18px calc(18px + var(--safe-b)); border-radius: 24px 24px 0 0; background: #17181c; border-top: 1px solid rgba(232, 194, 110, .2);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .9, .3, 1); }
.sheet.show { transform: none; }
.sheet .grip { width: 38px; height: 4px; border-radius: 4px; background: #3a3a40; margin: 0 auto 12px; }
.sheet h3 { font-size: 18px; text-align: center; margin-bottom: 4px; }
.sheet .desc { text-align: center; color: var(--sub); font-size: 12px; margin-bottom: 16px; }
.buyin-amt { text-align: center; font-size: 36px; font-weight: 900; color: var(--gold); margin: 6px 0 2px; }
.buyin-sub { text-align: center; color: var(--sub); font-size: 12px; margin-bottom: 16px; }
.range-row { display: flex; justify-content: space-between; color: var(--sub); font-size: 12px; margin-top: 6px; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--gold) var(--p, 50%), #33343a var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: #fff; border: 3px solid var(--gold); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 6px; background: #33343a; }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--gold); }
input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--gold); }

/* ====================== 牌桌 ====================== */
#tableView { background: #06120d; }
.tv-top { position: absolute; top: 0; left: 0; right: 0; z-index: 12; display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 12px 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .08); backdrop-filter: blur(6px); }
.icon-btn svg { width: 20px; height: 20px; }
.tv-title { flex: 1; text-align: center; font-size: 12px; color: rgba(255, 255, 255, .6); line-height: 1.25; }
.tv-title b { display: block; color: #fff; font-size: 14px; }

.felt-wrap { position: absolute; left: 0; right: 0; top: 0; bottom: 0; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 40%, #0d3326 0%, #061710 55%, #030806 100%); }
.felt { position: absolute; left: 8%; right: 8%; top: calc(70px + var(--safe-t)); bottom: 196px; border-radius: 999px;
  background:
    radial-gradient(60% 45% at 50% 42%, rgba(255, 255, 255, .10), transparent 70%),
    repeating-radial-gradient(circle at 50% 50%, rgba(0, 0, 0, .025) 0 2px, transparent 2px 4px),
    radial-gradient(100% 100% at 50% 45%, var(--felt1) 0%, var(--felt2) 100%);
  box-shadow: 0 0 0 7px #2a1d12, 0 0 0 9px #6b4a2a, 0 0 0 11px #2a1d12, 0 0 0 12px rgba(232, 194, 110, .35), 0 30px 60px rgba(0, 0, 0, .7), inset 0 0 50px rgba(0, 0, 0, .55); }
.felt::after { content: ""; position: absolute; inset: 14px; border-radius: inherit; border: 1.5px solid rgba(255, 255, 255, .07); }
.felt-logo { position: absolute; left: 50%; top: 72%; transform: translate(-50%, -50%); font-size: 13px; letter-spacing: 6px; font-weight: 800; color: rgba(255, 255, 255, .07); white-space: nowrap; }

.board { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); display: flex; gap: 5px; z-index: 3; }
.board .pcard { width: 12vw; max-width: 52px; }
.pot { position: absolute; left: 50%; top: 31%; transform: translate(-50%, -50%); z-index: 3; display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; border-radius: 99px; background: rgba(0, 0, 0, .35); font-weight: 800; font-size: 14px; white-space: nowrap; transition: opacity .2s; }
.pot .chipstack { width: 20px; height: 20px; }
.pot-sub { position: absolute; left: 50%; top: 56%; transform: translateX(-50%); z-index: 3; color: rgba(255, 255, 255, .45); font-size: 11px; white-space: nowrap; text-align: center; }
.hand-name { position: absolute; transform: translateX(-50%); z-index: 3; padding: 3px 12px; border-radius: 99px; background: rgba(0, 0, 0, .4); color: var(--gold); font-weight: 700; font-size: 12px; white-space: nowrap; }

/* 扑克牌 */
.pcard { position: relative; aspect-ratio: 5 / 7; border-radius: 9%/6.5%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .45); overflow: hidden; flex: none; }
.pcard svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pcard.back { background:
    repeating-linear-gradient(45deg, rgba(232, 194, 110, .18) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-45deg, rgba(232, 194, 110, .18) 0 2px, transparent 2px 7px),
    linear-gradient(160deg, #8a1d2c, #4d0d18); border: 2px solid #fff; }
.pcard.back::after { content: ""; position: absolute; inset: 14%; border-radius: 6px; border: 1px solid rgba(232, 194, 110, .55); }
.pcard.dim { filter: brightness(.45) saturate(.6); }
.pcard.hl { box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(232, 194, 110, .8); transform: translateY(-5px); }
.pcard { transition: transform .25s, filter .25s, box-shadow .25s; }
.pcard.flip { animation: flipIn .45s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes flipIn { 0% { transform: perspective(400px) rotateY(90deg) scale(.9); } 100% { transform: none; } }
.pcard.deal { animation: dealIn .4s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes dealIn { 0% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)) scale(.4) rotate(-30deg); } 100% { opacity: 1; } }

/* 座位 */
.seat { position: absolute; z-index: 5; width: 74px; margin-left: -37px; margin-top: -46px; display: flex; flex-direction: column; align-items: center; transition: opacity .3s; }
.seat .sname { max-width: 80px; font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, .85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; margin-bottom: 3px; }
.seat .savatar { position: relative; width: 52px; height: 52px; }
.seat .savatar .ava { width: 52px; height: 52px; font-size: 20px; box-shadow: 0 0 0 2px rgba(0, 0, 0, .5), 0 4px 10px rgba(0, 0, 0, .5); }
.seat .timer { position: absolute; inset: -5px; width: 62px; height: 62px; transform: rotate(-90deg); pointer-events: none; }
.seat .timer circle { fill: none; stroke-width: 4; stroke-linecap: round; }
.seat .sstack { margin-top: -6px; position: relative; z-index: 2; min-width: 58px; padding: 2px 8px; border-radius: 99px; text-align: center; font-size: 12px; font-weight: 800; background: rgba(5, 15, 11, .88); border: 1px solid rgba(255, 255, 255, .1); color: #fff; }
.seat.folded .savatar, .seat.folded .sname { opacity: .45; }
.seat.sitout .savatar { opacity: .4; }
.seat.acting .savatar .ava { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(232, 194, 110, .6); }
.seat.winner .savatar .ava { box-shadow: 0 0 0 3px var(--gold), 0 0 26px 4px rgba(232, 194, 110, .8); animation: winGlow 1s ease-in-out infinite alternate; }
@keyframes winGlow { to { box-shadow: 0 0 0 3px #fff3cf, 0 0 34px 8px rgba(232, 194, 110, .9); } }
.badge { font-size: 10.5px !important; position: absolute; left: 50%; top: 0; transform: translate(-50%, -35%); z-index: 3; padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 800; white-space: nowrap; background: rgba(255, 255, 255, .92); color: #222; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); animation: pop .25s; }
.badge.fold { background: rgba(60, 60, 66, .92); color: #ccc; }
.badge.raise, .badge.allin { background: linear-gradient(135deg, #ffb347, #ef4f5f); color: #fff; }
.badge.call, .badge.check { background: linear-gradient(135deg, #46d39a, #129a66); color: #fff; }
.badge.win { background: var(--gold-grad); color: #2a1d06; }
@keyframes pop { from { transform: translate(-50%, -35%) scale(.4); opacity: 0; } }
.seat .mini { position: absolute; top: 18px; display: flex; z-index: 1; }
.seat .mini .pcard { width: 20px; margin-left: -9px; }
.seat .mini .pcard:nth-child(2) { transform: rotate(9deg) translateY(1px); }
.seat .mini .pcard:nth-child(1) { transform: rotate(-4deg); }
.seat.left .mini { right: -4px; }
.seat.right .mini { left: 0; }
.seat .shown { position: absolute; top: 14px; display: flex; gap: 2px; z-index: 4; }
.seat .shown .pcard { width: 30px; }
.seat .hand-tag { position: absolute; top: 60px; z-index: 5; padding: 1px 6px; border-radius: 6px; font-size: 10px; font-weight: 800; background: rgba(0, 0, 0, .75); color: var(--gold); white-space: nowrap; }
.seat.empty .savatar { display: grid; place-items: center; border-radius: 50%; border: 1.5px dashed rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .2); color: rgba(255, 255, 255, .55); font-size: 24px; font-weight: 300; }
.seat.empty .sname { color: rgba(255, 255, 255, .45); margin-top: 4px; order: 2; }
.seat.me { width: 92px; margin-left: -46px; }

.bet { position: absolute; z-index: 4; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 3px; padding: 1px 7px 1px 2px; border-radius: 99px; background: rgba(0, 0, 0, .4); font-size: 12px; font-weight: 800; white-space: nowrap; transition: left .45s cubic-bezier(.3, .8, .3, 1), top .45s cubic-bezier(.3, .8, .3, 1), opacity .45s; }
.bet .chipstack { width: 18px; height: 18px; }
.dealer { position: absolute; z-index: 4; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #d8d8d8); color: #111; font-size: 11px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 2px 4px rgba(0, 0, 0, .5); transition: left .5s, top .5s; }

.fly { position: absolute; z-index: 30; pointer-events: none; transition: left .6s cubic-bezier(.4, 0, .2, 1), top .6s cubic-bezier(.4, 0, .2, 1), opacity .3s .5s; }
.fly .chipstack { width: 20px; height: 20px; }
.float-win { position: absolute; z-index: 31; transform: translate(-50%, -50%); font-size: 18px; font-weight: 900; color: var(--gold); text-shadow: 0 2px 6px #000; pointer-events: none; animation: floatUp 1.8s ease-out forwards; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 0) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -160%); } }

/* 我的底牌 */
.my-cards { position: absolute; z-index: 8; display: flex; gap: 0; align-items: flex-end; }
.my-cards .pcard { width: 17vw; max-width: 70px; box-shadow: 0 8px 20px rgba(0, 0, 0, .6); }
.my-cards .pcard + .pcard { margin-left: -4vw; }
.my-cards .pcard:nth-child(1) { transform: rotate(-6deg) translateY(4px); }
.my-cards .pcard:nth-child(2) { transform: rotate(6deg) translateY(4px); }
.my-cards .pcard.hl:nth-child(1) { transform: rotate(-6deg) translateY(-4px); }
.my-cards .pcard.hl:nth-child(2) { transform: rotate(6deg) translateY(-4px); }
.my-cards.folded .pcard { filter: brightness(.45); }

/* 操作区 */
.actions { position: absolute; left: 0; right: 0; bottom: 0; z-index: 15; padding: 10px 12px calc(12px + var(--safe-b));
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .75) 30%, rgba(0, 0, 0, .9)); }
.act-row { display: flex; gap: 8px; }
.abtn { flex: 1; height: 54px; border-radius: 16px; font-weight: 800; font-size: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; transition: transform .1s, filter .1s; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 16px -6px rgba(0, 0, 0, .8); }
.abtn small { font-size: 12px; font-weight: 700; opacity: .9; }
.abtn:active { transform: scale(.95); filter: brightness(.9); }
.abtn.fold { background: linear-gradient(180deg, #4a4b52, #2c2d32); color: #ddd; }
.abtn.call { background: linear-gradient(180deg, #2fd38c, #0f8f5b); color: #fff; }
.abtn.raise { background: linear-gradient(180deg, #ffbd59, #e2862c); color: #2a1404; }
.abtn.allin { background: linear-gradient(180deg, #ff6b7a, #c7283b); color: #fff; }
.pre-row { display: flex; gap: 8px; }
.pre { flex: 1; height: 44px; border-radius: 14px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 6px; color: rgba(255, 255, 255, .8); }
.pre i { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid rgba(255, 255, 255, .4); display: inline-grid; place-items: center; font-style: normal; font-size: 11px; }
.pre.on { border-color: var(--gold); color: var(--gold); background: rgba(232, 194, 110, .1); }
.pre.on i { background: var(--gold); border-color: var(--gold); color: #2a1d06; }
.pre.on i::after { content: "✓"; }

.raise-panel { margin-bottom: 10px; padding: 12px; border-radius: 18px; background: rgba(23, 24, 28, .96); border: 1px solid rgba(232, 194, 110, .25); }
.raise-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.raise-presets button { height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .06); font-size: 12px; font-weight: 700; }
.raise-presets button:active { background: rgba(232, 194, 110, .2); }
.raise-val { display: flex; align-items: center; gap: 8px; }
.raise-val .amt { min-width: 84px; text-align: center; font-size: 20px; font-weight: 900; color: var(--gold); }
.step { width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, .08); font-size: 20px; font-weight: 700; flex: none; }

.sit-cta { display: flex; gap: 8px; }

/* 聊天/表情 */
.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 14px; }
.emoji-grid button { height: 48px; border-radius: 12px; background: rgba(255, 255, 255, .05); font-size: 26px; }
.emoji-grid button:active { transform: scale(.9); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick button { padding: 8px 12px; border-radius: 99px; background: rgba(255, 255, 255, .06); font-size: 13px; }
.bubble { position: absolute; z-index: 25; transform: translate(-50%, -100%); max-width: 140px; padding: 6px 10px; border-radius: 12px 12px 12px 4px; background: #fff; color: #111; font-size: 12px; font-weight: 600; pointer-events: none; animation: bubble 3.2s forwards; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); }
.bubble.emoji { background: none; box-shadow: none; font-size: 40px; padding: 0; }
@keyframes bubble { 0% { opacity: 0; transform: translate(-50%, -80%) scale(.6); } 8% { opacity: 1; transform: translate(-50%, -100%) scale(1.05); } 12% { transform: translate(-50%, -100%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -120%); } }

/* 上一手 */
.lh-board { display: flex; gap: 4px; justify-content: center; margin: 8px 0 14px; }
.lh-board .pcard { width: 40px; }
.lh-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lh-row:last-child { border-bottom: 0; }
.lh-row .n { flex: 1; min-width: 0; }
.lh-row .n b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lh-row .n small { color: var(--sub); font-size: 12px; }
.lh-row .cs { display: flex; gap: 3px; }
.lh-row .cs .pcard { width: 30px; }
.lh-row .v { width: 64px; text-align: right; font-weight: 800; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 10px; color: var(--sub); word-break: break-all; }

/* 规则 */
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-row .idx { width: 22px; color: var(--gold); font-weight: 800; }
.rank-row .t { width: 72px; font-weight: 700; }
.rank-row .cs { display: flex; gap: 2px; }
.rank-row .cs .pcard { width: 26px; }

/* 断线条 */
.netbar { position: fixed; top: calc(8px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 95; padding: 6px 14px; border-radius: 99px; background: rgba(239, 79, 95, .92); font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.netbar .spinner { width: 12px; height: 12px; border-width: 2px; border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }
