/* 德州撲克單機版：牌桌、牌面、操作面板。--u 由 JS 依牌桌區大小設定，所有尺寸都跟著它放大縮小 */
.th-game { --u: 16px; --pu: 16px; position: relative; margin: 10px 0; min-height: 440px; border-radius: 14px; overflow: hidden; background: #0a2218; color: #fff; -webkit-user-select: none; user-select: none; touch-action: manipulation; font-size: 16px; line-height: 1.3; box-shadow: 0 2px 14px rgba(0,0,0,.25); }
.th-game[data-full="1"] { position: fixed; inset: 0; z-index: 100000; margin: 0 !important; width: auto !important; height: auto !important; border-radius: 0; }
html.th-lock, html.th-lock body { overflow: hidden; }
.th-stage { display: flex; flex-direction: column; height: 100%; }
.th-area { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 50%, #123a2a 0, #0a2218 80%); }

/* 牌桌 */
.th-felt { position: absolute; left: calc(var(--u) * 1.4); right: calc(var(--u) * 1.4); top: calc(var(--u) * 1.8); bottom: calc(var(--u) * 2.4); border-radius: 50%; background: radial-gradient(ellipse at 50% 38%, #2c9d66 0, #1b7b4d 55%, #0e5a36 100%); border: calc(var(--u) * .5) solid #4a3020; box-shadow: inset 0 0 calc(var(--u) * 2.4) rgba(0,0,0,.5), 0 6px 22px rgba(0,0,0,.55); }
.th-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * .35); z-index: 2; pointer-events: none; }
.th-pot { display: inline-flex; align-items: center; gap: calc(var(--u) * .4); background: rgba(0,0,0,.5); border-radius: 999px; padding: calc(var(--u) * .12) calc(var(--u) * .8) calc(var(--u) * .12) calc(var(--u) * .4); font-size: max(13px, calc(var(--u) * .95)); }
.th-pot.pop { animation: thPop .5s ease-out; }
.th-pots { display: flex; flex-wrap: wrap; justify-content: center; gap: calc(var(--u) * .3); max-width: calc(var(--u) * 17); }
.th-pots:empty { display: none; }
.th-potpill { background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 0 calc(var(--u) * .55); font-size: max(11px, calc(var(--u) * .72)); }
.th-potpill.empty { opacity: .45; }
.th-board { display: flex; gap: calc(var(--u) * .35); }
.th-slot { width: calc(var(--u) * 2.9); aspect-ratio: 100 / 140; border-radius: calc(var(--u) * .3); border: 2px dashed rgba(255,255,255,.22); }
.th-slot .th-card { width: 100%; }

/* 撲克牌 */
.th-card { display: block; position: relative; aspect-ratio: 100 / 140; border-radius: calc(var(--u) * .3); box-shadow: 0 2px 5px rgba(0,0,0,.45); background: #fff; transition: opacity .3s, filter .3s, box-shadow .3s; }
.th-card svg { display: block; width: 100%; height: 100%; }
.th-card.hl { box-shadow: 0 0 0 3px #facc15, 0 0 16px 5px rgba(250,204,21,.85); z-index: 3; }
.th-card.dim { opacity: .42; filter: saturate(.55); }

/* 座位 */
.th-seats { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.th-seat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; width: var(--sw, calc(var(--u) * 6.8)); transition: opacity .3s; }
.th-seat.me { width: var(--swm, calc(var(--u) * 9)); }
.th-hole { display: flex; gap: calc(var(--u) * .25); position: relative; z-index: 1; margin-bottom: calc(var(--u) * -.5); transition: opacity .3s, filter .3s; min-height: 0; }
.th-hole .th-card { width: calc(var(--u) * 2.1); }
.th-seat.me .th-hole .th-card { width: calc(var(--u) * 3.4); }
.th-plate { position: relative; z-index: 2; width: 100%; background: rgba(12,20,34,.93); border: 2px solid #2f3e57; border-radius: calc(var(--u) * .7); padding: calc(var(--u) * .2) calc(var(--u) * .35); text-align: center; min-width: 0; }
.th-nm { font-size: max(11px, calc(var(--u) * .7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #cbd5e1; line-height: 1.25; }
.th-pts { font-size: max(12px, calc(var(--u) * .98)); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.th-badges { position: absolute; right: calc(var(--u) * -.35); top: calc(var(--u) * -.55); display: flex; gap: 2px; z-index: 3; }
.th-bd { font-style: normal; font-weight: 800; font-size: max(10px, calc(var(--u) * .6)); min-width: calc(var(--u) * 1.15); height: calc(var(--u) * 1.15); min-height: 14px; padding: 0 3px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid #fff; }
.th-bd-d { background: #fff; color: #111; }
.th-bd-sb { background: #2563eb; color: #fff; }
.th-bd-bb { background: #ea580c; color: #fff; }
.th-status { position: absolute; left: 50%; top: 0; transform: translate(-50%, -105%); z-index: 4; white-space: nowrap; background: #1e293b; color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; padding: 0 calc(var(--u) * .6); font-size: max(11px, calc(var(--u) * .72)); font-weight: 700; line-height: 1.5; }
.th-seat.me .th-status { left: 100%; top: 50%; transform: translate(calc(var(--u) * .35), -50%); }
.th-status[data-k=fold] { background: #475569; }
.th-status[data-k=raise], .th-status[data-k=bet] { background: #047857; }
.th-status[data-k=call], .th-status[data-k=check] { background: #1d4ed8; }
.th-status[data-k=allin] { background: #b45309; }
.th-status[data-k=show] { background: #7c3aed; }
.th-status[data-k=out] { background: #7f1d1d; }
.th-status[data-k=think] { background: #334155; }
.th-seat.turn .th-plate { border-color: #fbbf24; box-shadow: 0 0 0 2px #fbbf24, 0 0 16px 2px rgba(251,191,36,.8); animation: thPulse 1.3s ease-in-out infinite; }
.th-seat.folded .th-hole { opacity: .3; filter: grayscale(1); }
.th-seat.folded .th-plate { opacity: .65; }
.th-seat.out { opacity: .42; }
.th-seat.out .th-hole { display: none; }
.th-seat.win .th-plate { border-color: #facc15; box-shadow: 0 0 0 2px #facc15, 0 0 18px 3px rgba(250,204,21,.8); background: rgba(60,48,8,.95); }
.th-float { position: absolute; left: 50%; top: 0; transform: translateX(-50%); z-index: 9; pointer-events: none; font-weight: 800; font-size: max(14px, calc(var(--u) * 1.2)); color: #fde047; text-shadow: 0 1px 3px #000, 0 0 6px #000; white-space: nowrap; animation: thFloat 2.4s ease-out forwards; }
.th-float.refund { color: #bfdbfe; }

/* 下注籌碼 */
.th-bets { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.th-bet { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: calc(var(--u) * .3); background: rgba(0,0,0,.5); border-radius: 999px; padding: calc(var(--u) * .1) calc(var(--u) * .6) calc(var(--u) * .1) calc(var(--u) * .25); font-size: max(11px, calc(var(--u) * .82)); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.th-chip { display: inline-block; flex: none; width: calc(var(--u) * 1.05); height: calc(var(--u) * 1.05); min-width: 12px; min-height: 12px; border-radius: 50%; background: #d62d2d; border: calc(var(--u) * .14) dashed #fff; box-shadow: 0 1px 2px rgba(0,0,0,.6); }
.th-bet[data-tier="2"] .th-chip { box-shadow: 0 calc(var(--u) * -.16) 0 #2563eb, 0 1px 2px rgba(0,0,0,.6); }
.th-bet[data-tier="3"] .th-chip { box-shadow: 0 calc(var(--u) * -.16) 0 #2563eb, 0 calc(var(--u) * -.32) 0 #111827, 0 1px 2px rgba(0,0,0,.6); }
.th-fly { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
.th-chip.fly { position: absolute; }

/* 角落資訊與按鈕 */
.th-info { position: absolute; left: calc(var(--u) * .6); top: calc(var(--u) * .5); z-index: 6; font-size: max(11px, calc(var(--u) * .75)); line-height: 1.3; color: #d5e6dc; pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.th-info b { color: #fff; }
.th-info span { color: #fde68a; }
.th-corner { position: absolute; right: 6px; top: 6px; z-index: 14; display: flex; gap: 5px; }
.th-ibtn { width: 44px; height: 44px; border-radius: 50%; padding: 0; display: grid; place-items: center; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.4); color: #fff; cursor: pointer; }
.th-ibtn:hover { background: rgba(0,0,0,.75); }
.th-ibtn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.th-ibtn .th-snd-on { fill: currentColor; stroke: none; display: none; }
.th-game.th-snd .th-snd-on { display: inline; }
.th-game.th-snd .th-snd-off { display: none; }
.th-ibtn .th-snd-off { fill: currentColor; stroke: currentColor; }
.th-ibtn[aria-pressed=true] .th-fs-in { display: none; }
.th-ibtn:not([aria-pressed=true]) .th-fs-out { display: none; }
.th-toast { position: absolute; left: 50%; top: calc(50% - var(--u) * 5.2); transform: translateX(-50%); z-index: 8; background: rgba(0,0,0,.72); color: #fff; padding: calc(var(--u) * .15) calc(var(--u) * .9); border-radius: 999px; font-size: max(13px, calc(var(--u) * .9)); white-space: nowrap; opacity: 0; transition: opacity .25s; pointer-events: none; max-width: 94%; overflow: hidden; text-overflow: ellipsis; }
.th-toast.on { opacity: 1; }
.th-seat.me .th-hole { margin-bottom: calc(var(--u) * -.15); }

/* 開場 */
.th-intro { position: absolute; inset: 0; z-index: 12; background: rgba(4,20,13,.8); display: grid; place-items: center; padding: 10px; }
.th-intro-card { text-align: center; max-width: 440px; }
.th-intro-card h2 { margin: 0 0 6px; font-size: 1.5rem; color: #fff; }
.th-intro-sum { margin: 0 0 4px; font-size: 1rem; color: #e2efe8; }
.th-intro-note { margin: 0 0 6px; font-weight: 700; color: #fde68a; }
.th-stats { margin: 0 0 10px; font-size: .92rem; color: #b6cdc0; }
.th-intro-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.th-big { min-height: 52px; padding: 0 26px; font-size: 1.1rem; }
.th-game .btn { background: #fff; color: var(--brand-dark); }
.th-game .btn-primary { background: var(--brand); color: #fff; }
.th-game .btn-primary:hover { background: var(--brand-dark); }

/* 操作面板 */
.th-panel { flex: 0 0 auto; background: #0c1722; border-top: 2px solid #1d2f3f; padding: 8px 10px; max-height: 46%; overflow-y: auto; }
.th-portrait .th-panel { min-height: 124px; }
.th-land .th-panel { min-height: 66px; }
.th-wait { color: #9fb4c4; font-size: 1rem; padding: 12px 4px; text-align: center; }
.th-turn-info { font-size: max(13px, calc(var(--pu) * .8)); margin-bottom: 6px; color: #dbe7f0; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.th-turn-info b { color: #fde047; }
.th-pot-note { color: #9fb4c4; }
.th-odds { color: #bfdbfe; font-size: .9em; }
.th-main { display: flex; gap: 8px; }
.th-act { flex: 1 1 0; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border-radius: 12px; border: 2px solid transparent; padding: 2px 8px; font-weight: 700; font-size: max(15px, calc(var(--pu) * .95)); line-height: 1.2; cursor: pointer; color: #fff; background: #334155; min-width: 0; }
.th-act:focus-visible { outline: 3px solid #fde047; outline-offset: 2px; }
.th-act small { display: block; font-size: .72em; font-weight: 600; opacity: .9; margin-top: 1px; }
.th-fold { background: #7f1d1d; }
.th-check, .th-call { background: #1d4ed8; }
.th-raise { background: #047857; }
.th-allin { background: #b45309; }
.th-act:active { filter: brightness(1.2); }
.th-act[aria-disabled=true], .th-act.off { opacity: .45; cursor: default; }
.th-sheet { background: #13222f; border: 1px solid #27465a; border-radius: 12px; padding: 8px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }
.th-quick { display: flex; gap: 6px; }
.th-q { white-space: nowrap; min-height: 44px; background: #264a63; font-size: max(13px, calc(var(--pu) * .78)); padding: 2px 4px; }
.th-slide { display: flex; gap: 10px; align-items: center; }
.th-slide input[type=range] { flex: 1 1 auto; min-width: 0; height: 44px; accent-color: #34d399; background: transparent; }
.th-slide input[type=number] { flex: 0 0 auto; width: 7em; height: 44px; font-size: 16px; font-weight: 700; padding: 0 8px; border-radius: 10px; border: 2px solid #4b6a80; background: #fff; color: #111; text-align: right; }
.th-go-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.th-go { flex: 0 0 auto; min-width: 12em; background: #047857; padding: 4px 16px; }
.th-range-note { font-size: .82rem; color: #9fb4c4; flex: 1 1 8em; }
.th-land .th-panel-turn { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.th-land .th-panel-turn .th-turn-info { flex: 0 1 28%; margin: 0; flex-direction: column; gap: 0; }
.th-land .th-panel-turn .th-main { flex: 1 1 60%; }
.th-land .th-panel-turn .th-sheet { flex: 1 0 100%; order: -1; flex-direction: row; align-items: center; margin-bottom: 4px; padding: 6px; gap: 8px; flex-wrap: wrap; }
.th-land .th-quick { flex: 1 1 42%; }
.th-land .th-slide { flex: 1 1 22%; }
.th-land .th-go-row { flex: 1 1 24%; }
.th-land .th-range-note { display: none; }
.th-land .th-go { min-width: 9em; }

/* 結算 */
.th-result { color: #e8f1f7; }
.th-res-head { font-size: max(15px, calc(var(--pu) * .95)); font-weight: 700; margin-bottom: 4px; }
.th-res-head .up { color: #86efac; }
.th-res-head .down { color: #fca5a5; }
.th-res-list { display: flex; flex-direction: column; gap: 2px; font-size: max(13px, calc(var(--pu) * .78)); }
.th-res-pot b { color: #fde047; }
.th-res-pot small { color: #9fb4c4; }
.th-nextrow, .th-end { margin-top: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.th-end { flex-direction: column; align-items: stretch; }
.th-end b { font-size: max(15px, calc(var(--pu) * .95)); color: #fde047; }
.th-end small, .th-nextrow small { color: #9fb4c4; font-size: .85rem; }
.th-next { min-height: 48px; min-width: 9em; }
.th-land .th-panel-result { display: flex; align-items: center; gap: 14px; }
.th-land .th-panel-result .th-result { flex: 1 1 auto; min-width: 0; }
.th-land .th-panel-result .th-nextrow, .th-land .th-panel-result .th-end { margin: 0; flex: 0 0 auto; align-items: flex-end; max-width: 40%; }

/* 視窗 */
.th-modal { position: absolute; inset: 0; z-index: 30; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; padding: 10px; }
.th-modal-card { background: #fff; color: #111; border-radius: 14px; padding: 12px 16px 14px; max-width: 540px; width: 100%; max-height: 100%; overflow: auto; -webkit-user-select: text; user-select: text; }
.th-modal-card h2 { margin: 0 0 6px; font-size: 1.25rem; color: #111; }
.th-modal-card fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; padding: 6px 12px 8px; }
.th-modal-card legend { font-weight: 700; padding: 0 6px; }
.th-modal-card label { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; font-size: 1rem; }
.th-modal-card select { min-height: 44px; font: inherit; font-size: 16px; padding: 0 8px; border-radius: 8px; border: 1px solid #94a3b8; background: #fff; max-width: 60%; }
.th-modal-card input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--brand); }
.th-set-note { font-size: .88rem; color: #475569; margin: 4px 0; }
.th-modal-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.th-modal-card .btn { color: var(--brand-dark); background: #fff; }
.th-modal-card .btn-primary { background: var(--brand); color: #fff; }
.th-ranklist { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.th-ranklist li { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid #e2e8f0; padding: 3px 0; font-size: .95rem; }
.th-ranklist .th-card { width: 30px; }

/* 頁面上的牌型表 */
.th-hand-table td, .th-hand-table th { vertical-align: middle; }
.th-mini { display: inline-flex; gap: 3px; flex-wrap: nowrap; }
.th-mini .th-card { width: 34px; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.th-hand-table .th-ex { display: inline-flex; gap: 3px; }
@media (max-width: 520px) { .th-hand-table .th-mini .th-card { width: 28px; } .th-hand-table td, .th-hand-table th { padding: 6px 4px; font-size: .92rem; } }

@keyframes thPulse { 0%, 100% { box-shadow: 0 0 0 2px #fbbf24, 0 0 8px 1px rgba(251,191,36,.5); } 50% { box-shadow: 0 0 0 3px #fbbf24, 0 0 20px 4px rgba(251,191,36,.9); } }
@keyframes thPop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes thFloat { 0% { transform: translate(-50%, 0); opacity: 0; } 12% { opacity: 1; } 100% { transform: translate(-50%, calc(var(--u) * -3.2)); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .th-seat.turn .th-plate { animation: none; }
  .th-pot.pop { animation: none; }
  .th-float { animation: none; }
  .th-card, .th-seat, .th-hole, .th-toast { transition: none; }
}

.th-next { font-size: max(15px, calc(var(--pu) * .95)); }
.th-hint-inline { color: #cfe3f0; font-size: .95em; }
.th-hint-inline b { color: #fde047; }
.th-link-inline { display: inline; border: 0; border-bottom: 1px dotted #bfdbfe; background: none; color: #bfdbfe; font: inherit; padding: 0 2px; min-height: 0; cursor: pointer; margin-left: 6px; }
.th-portrait .th-wait { padding: 8px 4px 4px; }
/* 直向展開加注面板時壓縮高度，讓牌桌留得住 */
.th-portrait .th-sheet { padding: 6px; gap: 6px; }
.th-portrait .th-go-row { gap: 6px; }
.th-portrait .th-go { flex: 1 1 100%; min-height: 50px; }
.th-portrait .th-range-note { display: none; }
.th-portrait .th-slide input[type=number] { width: 5.5em; }
/* 手機橫向：自己的牌縮小一點、公共牌上移，避免兩者疊在一起 */
.th-short .th-seat.me .th-hole .th-card { width: calc(var(--u) * 2.8); }
.th-pots, .th-potpill { white-space: nowrap; }
.th-land .th-panel-result .th-end { max-width: 58%; }
.th-land .th-seat.me .th-hole .th-card { width: calc(var(--u) * 3.0); }
.th-short .th-seat.me .th-hole .th-card { width: calc(var(--u) * 2.8); }
/* 手機橫向的加注面板：快捷鈕、滑桿、送出鈕排在同一列，操作鈕才不會被擠出畫面 */
.th-land .th-quick { flex: 1 1 290px; }
.th-land .th-slide { flex: 1 1 190px; }
.th-land .th-go-row { flex: 0 1 165px; }
.th-land .th-go { min-width: 0; width: 100%; }
.th-land .th-slide input[type=number] { width: 5.6em; }
.th-short .th-sheet { padding: 4px 6px; gap: 6px; }
.th-short .th-q { min-height: 44px; }
/* 桌機橫向（寬螢幕）：加注面板空間夠，送出鈕不要擠成窄窄一條 */
.th-land:not(.th-short) .th-quick { flex: 1 1 420px; }
.th-land:not(.th-short) .th-slide { flex: 1 1 240px; }
.th-land:not(.th-short) .th-go-row { flex: 0 0 auto; }
.th-land:not(.th-short) .th-go { width: auto; min-width: 11em; }
.th-land:not(.th-short) .th-slide input[type=number] { width: 6.5em; font-size: max(16px, calc(var(--pu) * .7)); }

/* ===== 第二輪修正 ===== */
/* K1：設定視窗的勾選列用自己的 class（原本借用 th-check，撞到「過牌」動作鈕的藍底） */
.th-modal-card label.th-opt { display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 48px; margin: 4px 0; padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: #111; cursor: pointer; }
.th-modal-card label.th-opt:hover { background: #f1f5f9; }
.th-modal-card label.th-opt:has(input:checked) { border-color: var(--brand); background: #eff4ff; }
.th-modal-card label.th-opt input[type=checkbox] { flex: none; width: 26px; height: 26px; margin: 0; }
/* M1：頁內全螢幕高度＝可視高度（dvh、100vh 後備、安全區） */
.th-game { min-height: 0; height: 480px; }
.th-game[data-full="1"] { height: 100vh !important; height: 100dvh !important; width: 100% !important; min-height: 0; }
.th-game[data-full="1"] .th-stage { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
/* M2：底池與各邊池同一個盒子（上下排列、不再互相覆蓋）；橫向放在公共牌左側 */
.th-potbox { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * .3); }
.th-pot { white-space: nowrap; }
.th-pot small { font-size: max(10px, calc(var(--u) * .62)); opacity: .85; }
.th-slot { width: var(--slot, calc(var(--u) * 2.9)); }
.th-land .th-center { top: calc(50% - var(--u) * .6); }
.th-short .th-center { top: calc(50% - var(--u) * .9); }
.th-land .th-potbox { position: absolute; right: 100%; top: 50%; transform: translateY(-50%); margin-right: calc(var(--u) * .8); width: max-content; max-width: var(--potw); align-items: flex-end; }
.th-land .th-pot { flex-direction: column; align-items: center; gap: 0; border-radius: calc(var(--u) * .9); padding: calc(var(--u) * .25) calc(var(--u) * .7); }
.th-land .th-pot .th-chip { display: none; }
.th-land .th-pots { justify-content: flex-end; max-width: var(--potw); }
.th-land .th-toast { top: calc(50% - var(--u) * 4.4); }
/* 動作標籤：浮在名牌正上方（蓋在自己那兩張牌的下緣），攤牌的牌型名稱改放名牌那一行 */
.th-status { top: 2px; left: 50%; transform: translate(-50%, -100%); }
.th-seat.me .th-status { left: 100%; top: 50%; transform: translate(calc(var(--u) * .35), -50%); white-space: normal; max-width: var(--stw); text-align: center; line-height: 1.25; padding: calc(var(--u) * .1) calc(var(--u) * .6); }
.th-hn { font-style: normal; font-weight: 700; color: #e9d5ff; }
/* 橫向：局數與盲注放在右上角按鈕旁 */
.th-land .th-info { left: auto; right: calc(150px + var(--u) * .4); top: 6px; height: 44px; display: flex; flex-direction: column; justify-content: center; text-align: right; }
.th-land .th-info span { display: none; }
/* 面板：提示句與牌型提示放在左欄 */
.th-left { min-width: 0; }
.th-odds { font-size: max(11px, .85em); }
.th-land .th-panel-turn .th-left { flex: 0 1 31%; }
.th-land .th-panel-turn .th-turn-info { flex: none; flex-direction: row; gap: 0 .6em; margin: 0 0 2px; }
.th-land .th-panel-turn .th-main { flex: 1 1 55%; }
.th-hint-inline { margin-top: 2px; }
.th-sheeted .th-odds, .th-sheeted .th-hint-inline { display: none; }
.th-link-inline { padding: 11px 8px; margin: -11px 0 -11px 4px; }
.th-panel { padding-bottom: 14px; }
.th-portrait .th-pots { max-width: calc(var(--u) * 19); flex-wrap: nowrap; }
.th-pots .th-potpill { font-size: max(10px, calc(var(--u) * .66)); padding: 0 calc(var(--u) * .45); }
.th-center, .th-land .th-center, .th-short .th-center { top: var(--cy, 50%); gap: calc(var(--u) * .25); }
.th-info { font-size: clamp(11px, calc(var(--u) * .75), 14px); }
/* 第二輪微調：橫向的局數資訊不用 flex（會把每個字拆開直排）、面板左欄加寬並縮小提示字級 */
.th-land .th-info { display: block; height: auto; top: 13px; line-height: 1.3; }
.th-land .th-panel { padding-bottom: 12px; }
.th-land .th-panel-turn .th-left { flex: 0 1 38%; }
.th-land .th-panel-turn .th-main { flex: 1 1 50%; }
.th-short .th-odds { font-size: max(10.5px, .72em); line-height: 1.25; display: block; }
.th-short .th-hint-inline { font-size: max(12px, .8em); white-space: nowrap; }
.th-short .th-link-inline { margin-left: 2px; }
.th-seat.me .th-status { white-space: pre-line; }
/* 最後微調：提示字級跟著面板、「牌型表」連結用底線、玩家的狀態標籤寬度依內容 */
.th-hint-inline { font-size: max(13px, calc(var(--pu) * .8)); }
.th-link-inline { border-bottom: 0; text-decoration: underline dotted; text-underline-offset: 3px; }
.th-seat.me .th-status { width: max-content; }

/* ===== 第三輪 ===== */
/* 徽章（D／SB／BB）放在名牌內下方左右兩角，D 在左、SB 或 BB 在右：不蓋名稱、不蓋點數、不蓋底牌，也不會凸出名牌外被裁切 */
.th-badges { position: absolute; left: 0; right: 0; bottom: 0; top: auto; display: block; height: 0; pointer-events: none; z-index: 3; }
.th-badges .th-bd { position: absolute; bottom: calc(var(--u) * .28 + 2px); margin: 0; }
.th-badges .th-bd-d { left: 4px; }
.th-badges .th-bd-sb, .th-badges .th-bd-bb { right: 4px; }
.th-plate { padding-bottom: calc(var(--u) * .2); }
/* 狀態標籤：名牌正上方；玩家自己的放右側並讓開徽章 */
.th-status { top: 0; transform: translate(-50%, -100%); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.th-seat.me .th-status { left: 100%; top: 50%; transform: translate(calc(var(--u) * .35 + 4px), -50%); }
.th-seat.shown:not(.me) .th-status:not([data-k=out]) { display: none; }
.th-seat.allin .th-plate { border-color: #f59e0b; }
/* 提示（輪到你了等）放公共牌正下方 */
.th-toast, .th-land .th-toast { top: var(--toasty, 50%); }
/* 加注面板：數字與單位不換行 */
.th-go { white-space: nowrap; }
.th-go small { white-space: nowrap; }
.th-land .th-go-row { flex: 0 1 190px; }
.th-hole, .th-seat.me .th-hole { margin-bottom: 0; }
/* S3：手機橫向（視窗高 460 以下）加注面板壓成一列，操作區完整在可視範圍內 */
@media (max-height: 460px) and (orientation: landscape) {
  .th-land .th-panel { max-height: 58%; padding: 6px 10px 13px; }
  .th-land .th-panel-turn .th-sheet { padding: 4px 6px; gap: 6px; margin-bottom: 4px; flex-wrap: nowrap; }
  .th-land .th-quick { flex: 0 0 auto; gap: 4px; }
  .th-land .th-q { flex: 0 0 auto; min-width: 50px; padding: 0 3px; font-size: 12px; }
  .th-land .th-q small { font-size: 10.5px; }
  .th-land .th-slide { flex: 1 1 120px; min-width: 0; gap: 6px; }
  .th-land .th-slide input[type=range] { min-width: 50px; }
  .th-land .th-slide input[type=number] { width: 4.8em; padding: 0 4px; }
  .th-land .th-go-row { flex: 0 0 128px; }
  .th-land .th-go { width: 100%; min-width: 0; padding: 2px 4px; font-size: 13.5px; }
  .th-land .th-go small { font-size: 10.5px; }
}
.th-land .th-potbox { top: 0; transform: none; }
/* nm／pts 兩行的文字框不互碰（複驗員用緊貼文字的框量） */
.th-nm { line-height: 1.55; } .th-pts { line-height: 1.4; }
.th-plate { padding-top: calc(var(--u) * .12); padding-bottom: calc(var(--u) * .12); }
