/* Poker Texas Hold'em No-Limit (js/poker.js) — felt table, chip stacks, pure-CSS cards.
   Theme-aware like the other game pages: tokens on :root, redefined under body.dark-theme. */
:root {
    --pk-accent: #0b7a53;
    --pk-accent-2: #0f9d68;
    --pk-accent-soft: #e1f4ea;
    --pk-page-bg: #f1f5f3;
    --pk-card-bg: #ffffff;
    --pk-card-border: #d6e2dc;
    --pk-muted: #56665e;
    --pk-shadow: 0 10px 30px rgba(10, 50, 30, .12);
    --pk-felt: #128357;
    --pk-felt-2: #0a4f35;
    --pk-felt-line: rgba(255, 255, 255, .14);
    --pk-wood: #6d3f1b;
    --pk-wood-2: #3f230c;
    --pk-on-felt: #f0fff7;
    --pk-plate: rgba(9, 22, 16, .82);
    --pk-plate-border: rgba(255, 255, 255, .16);
    --pk-face: #ffffff;
    --pk-face-2: #f2efe6;
    --pk-face-border: #cbc3b1;
    --pk-black: #161a22;
    --pk-red: #c81e2b;
    --pk-back: #1e3a8a;
    --pk-back-2: #2f5bd3;
    --pk-gold: #f2b705;
    --pk-gold-ink: #2a1d00;
    --pk-ok: #138a4f;
    --pk-ko: #c62828;
    --pk-fold: #6b7280;
    --pk-call: #1769c2;
    --pk-raise: #d97706;
    --pk-cw: 54px;    /* your hole cards */
    --pk-bw: 40px;    /* a board card */
    --pk-ow: 25px;    /* an opponent's card */
    --pk-th: 452px;   /* table height */
}

body.dark-theme {
    --pk-accent: #34d399;
    --pk-accent-2: #10b981;
    --pk-accent-soft: #0f2a1f;
    --pk-page-bg: #0c1310;
    --pk-card-bg: #16211b;
    --pk-card-border: #2a3b33;
    --pk-muted: #9db3a8;
    --pk-shadow: 0 10px 30px rgba(0, 0, 0, .45);
    --pk-felt: #0d6544;
    --pk-felt-2: #052a1c;
    --pk-wood: #4a2a10;
    --pk-wood-2: #261405;
    --pk-face: #f3f0e7;
    --pk-face-2: #e2ddcf;
    --pk-face-border: #9f9784;
    --pk-ok: #4ade80;
    --pk-ko: #f87171;
    --pk-call: #3b8ee6;
    --pk-raise: #f59e0b;
    --pk-fold: #8b93a1;
}

/* clip, not hidden: the site-wide `body { overflow-x: hidden }` makes <body> a scroll
   container that never scrolls, which silently kills any position: sticky inside. */
.pk-body, body.pk-body#page-top {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--pk-page-bg);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: clip;
}
.pk-main { padding-top: 92px; padding-bottom: 40px; }
.pk-game .container, .pk-hero .container { max-width: 800px; }

/* ---- hero ---- */
.pk-hero { text-align: center; padding: 4px 0 8px; }
.pk-hero h1 { font-weight: 800; font-size: clamp(1.55rem, 5vw, 2.2rem); margin-bottom: 4px; }
.pk-hero-icon { color: var(--pk-gold); }
.pk-lead { margin: 0 auto; max-width: 580px; color: var(--pk-muted); font-size: .98rem; line-height: 1.45; }
body.pk-playing .pk-lead { display: none; }
body.pk-playing .pk-hero { padding: 0 0 6px; }
body.pk-playing .pk-hero h1 { font-size: 1.3rem; margin: 0; }

/* ---- setup ---- */
.pk-setup { max-width: 560px; margin: 6px auto 0; padding: 14px; border-radius: 18px; background: var(--pk-card-bg); border: 1px solid var(--pk-card-border); box-shadow: var(--pk-shadow); }
.pk-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; margin-bottom: 10px; border-radius: 16px; background: var(--pk-page-bg); border: 1px solid var(--pk-card-border); }
.pk-mode { min-height: 52px; padding: 6px 8px; border: 0; border-radius: 12px; background: transparent; color: inherit; font-weight: 700; font-size: .9rem; line-height: 1.15; cursor: pointer; touch-action: manipulation; display: flex; align-items: center; justify-content: center; gap: 7px; text-align: center; }
.pk-mode small { display: block; font-weight: 600; opacity: .8; }
.pk-mode[aria-checked="true"] { background: var(--pk-accent); color: #fff; }
body.dark-theme .pk-mode[aria-checked="true"] { color: #04261a; }
.pk-format-note { margin: -4px 4px 12px; }
.pk-field { margin: 0 0 12px; }
.pk-label { display: block; font-weight: 800; margin: 0 0 6px; }
.pk-note { display: block; color: var(--pk-muted); margin-top: 5px; font-size: .84rem; line-height: 1.35; }
.pk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-chip { min-width: 46px; min-height: 46px; padding: 6px 12px; border-radius: 12px; border: 2px solid var(--pk-card-border); background: var(--pk-card-bg); color: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; touch-action: manipulation; flex: 1 1 0; }
.pk-chip[aria-checked="true"] { border-color: var(--pk-accent); background: var(--pk-accent-soft); color: var(--pk-accent); }
.pk-chip:focus-visible, .pk-mode:focus-visible, .pk-btn:focus-visible, .pk-act:focus-visible, .pk-icon-btn:focus-visible, .pk-preset:focus-visible, .pk-step:focus-visible, .pk-x:focus-visible, .pk-range:focus-visible { outline: 3px solid var(--pk-gold); outline-offset: 2px; }

.pk-switch { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0 12px; border-radius: 14px; border: 1px solid var(--pk-card-border); background: var(--pk-page-bg); cursor: pointer; line-height: 1.25; }
.pk-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pk-switch small { display: block; color: var(--pk-muted); font-size: .82rem; margin-top: 2px; }
.pk-switch-ui { flex: none; position: relative; width: 46px; height: 28px; border-radius: 14px; background: var(--pk-card-border); transition: background .2s; }
.pk-switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.pk-switch input:checked + .pk-switch-ui { background: var(--pk-accent); }
.pk-switch input:checked + .pk-switch-ui::after { transform: translateX(18px); }
.pk-switch input:focus-visible + .pk-switch-ui { outline: 3px solid var(--pk-gold); outline-offset: 2px; }
.pk-names { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.pk-name-in { min-width: 0; min-height: 44px; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--pk-card-border); background: var(--pk-card-bg); color: inherit; font-weight: 700; font-size: 1rem; }
.pk-name-in:focus { outline: none; border-color: var(--pk-accent); }
.pk-start, .pk-resume { width: 100%; margin-top: 4px; }
.pk-resume { margin-top: 8px; }

/* ---- buttons ---- */
.pk-btn { min-height: 48px; padding: 8px 14px; border: 1px solid var(--pk-card-border); border-radius: 14px; background: var(--pk-card-bg); color: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; touch-action: manipulation; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.pk-btn:hover:not(:disabled) { border-color: var(--pk-accent); }
.pk-btn:disabled { opacity: .45; cursor: not-allowed; }
.pk-btn-primary { background: var(--pk-accent); border-color: var(--pk-accent); color: #fff; }
body.dark-theme .pk-btn-primary { color: #04261a; }
.pk-wide { width: 100%; }
.pk-link { border: 0; background: none; padding: 4px 6px; color: var(--pk-muted); text-decoration: underline; font-size: .82rem; cursor: pointer; }

/* ---- status bar ---- */
.pk-play { max-width: 800px; margin: 0 auto; }
.pk-bar { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px 10px; padding: 4px 4px 4px 12px; margin: 0 0 8px; min-height: 48px; border-radius: 14px; background: var(--pk-card-bg); border: 1px solid var(--pk-card-border); font-size: .88rem; font-weight: 700; }
.pk-bar-hand { font-weight: 800; white-space: nowrap; }
.pk-bar-blinds { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.pk-bar-blinds b { font-weight: 800; white-space: nowrap; }
.pk-bar-blinds small { color: var(--pk-muted); font-weight: 600; font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-bar-tools { margin-left: auto; display: flex; gap: 4px; flex: none; }
.pk-icon-btn { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--pk-card-border); background: var(--pk-page-bg); color: inherit; display: grid; place-items: center; cursor: pointer; touch-action: manipulation; font-size: 1rem; padding: 0; }
.pk-icon-btn[aria-pressed="true"] .pk-on { color: var(--pk-gold); }
#pk-sound[aria-pressed="true"] .pk-on { color: inherit; }
.pk-on[hidden], .pk-off[hidden] { display: none; }

/* ---- the table ---- */
.pk-table { position: relative; height: var(--pk-th); margin: 0 auto; user-select: none; -webkit-user-select: none; }
.pk-felt { position: absolute; inset: 6% 4% 7%; border-radius: 46% / 32%; background: radial-gradient(ellipse at 50% 42%, var(--pk-felt) 0%, var(--pk-felt-2) 78%); border: 12px solid var(--pk-wood); box-shadow: inset 0 0 0 2px var(--pk-wood-2), inset 0 0 0 14px var(--pk-felt-line), inset 0 10px 40px rgba(0, 0, 0, .45), 0 0 0 2px var(--pk-wood-2), var(--pk-shadow); }
.pk-felt::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(35deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 5px); }
.pk-felt-logo { position: absolute; left: 50%; top: 66%; transform: translateX(-50%); color: rgba(255, 255, 255, .1); font-weight: 900; letter-spacing: .12em; font-size: 1.05rem; text-transform: uppercase; white-space: nowrap; }
.pk-center { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 7px; width: 74%; color: var(--pk-on-felt); z-index: 2; pointer-events: none; }
.pk-pot { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 3px 12px 3px 6px; border-radius: 999px; background: rgba(0, 0, 0, .35); font-weight: 800; font-size: .92rem; white-space: nowrap; transition: transform .2s; }
.pk-pot.is-empty { visibility: hidden; }
.pk-pot.is-bump { transform: scale(1.12); }
.pk-board { display: flex; gap: 4px; justify-content: center; min-height: calc(var(--pk-bw) * 1.4); }
.pk-slot { width: var(--pk-bw); height: calc(var(--pk-bw) * 1.4); border-radius: calc(var(--pk-bw) * .12); border: 2px dashed rgba(255, 255, 255, .16); }
.pk-banner { position: relative; max-width: 100%; padding: 6px 12px; border-radius: 12px; background: rgba(0, 0, 0, .55); color: #fff; font-weight: 700; font-size: .84rem; line-height: 1.3; text-align: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); animation: pk-rise .3s ease-out; }
.pk-banner b { color: var(--pk-gold); }
.pk-banner[hidden] { display: none; }
.pk-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

/* seats */
.pk-seat { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; width: 96px; pointer-events: auto; }
.pk-seat-cards { position: relative; display: flex; justify-content: center; height: calc(var(--pk-ow) * 1.4); margin-bottom: -8px; z-index: 1; }
.pk-seat-cards .pk-card { --w: var(--pk-ow); margin: 0 -3px; }
.pk-seat-cards .pk-card:first-child { transform: rotate(-6deg); }
.pk-seat-cards .pk-card:last-child { transform: rotate(6deg); }
.pk-seat.is-shown .pk-seat-cards { height: calc(var(--pk-ow) * 1.4 * 1.36); }
.pk-seat.is-shown .pk-seat-cards .pk-card { --w: calc(var(--pk-ow) * 1.36); margin: 0 -1px; }
.pk-plate { position: relative; z-index: 2; display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px 8px 4px 4px; border-radius: 14px; background: var(--pk-plate); border: 1px solid var(--pk-plate-border); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .35); transition: box-shadow .2s, opacity .2s; }
.pk-av { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: .9rem; color: #fff; background: var(--av, #475569); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25); }
.pk-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; text-align: left; }
.pk-name { font-weight: 800; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-name.is-long { font-size: .7rem; letter-spacing: -.01em; }
.pk-stack { font-weight: 800; font-size: .84rem; color: #ffe08a; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pk-tag { display: none; font-size: .7rem; font-weight: 600; opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-seat.is-turn .pk-plate { box-shadow: 0 0 0 3px var(--pk-gold), 0 0 18px rgba(242, 183, 5, .55); animation: pk-pulse 1.2s ease-in-out infinite; }
@keyframes pk-pulse { 50% { box-shadow: 0 0 0 3px var(--pk-gold), 0 0 4px rgba(242, 183, 5, .2); } }
.pk-seat.is-folded .pk-plate { opacity: .55; }
.pk-seat.is-folded .pk-seat-cards { opacity: 0; transition: opacity .3s; }
.pk-seat.is-out .pk-plate { opacity: .4; filter: grayscale(1); }
.pk-seat.is-out .pk-stack { color: #ddd; }
.pk-seat.is-win .pk-plate { box-shadow: 0 0 0 3px var(--pk-gold), 0 0 22px rgba(242, 183, 5, .7); }
.pk-seat.is-allin .pk-stack { color: #fca5a5; }
.pk-say { position: absolute; left: 50%; bottom: calc(100% + 3px); transform: translateX(-50%); z-index: 3; padding: 2px 9px; border-radius: 999px; background: #fff; color: #111; font-weight: 800; font-size: .74rem; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); animation: pk-say .25s ease-out; }
.pk-say.is-fold { background: #e5e7eb; color: #4b5563; }
.pk-say.is-raise { background: var(--pk-gold); color: var(--pk-gold-ink); }
.pk-say.is-allin { background: #dc2626; color: #fff; }
.pk-say.is-hand { background: #111827; color: #ffe08a; bottom: auto; top: calc(100% + 3px); box-shadow: 0 0 0 1px rgba(255, 224, 138, .5), 0 2px 8px rgba(0, 0, 0, .35); }
.pk-seat.is-top .pk-say { bottom: auto; top: calc(100% + 3px); }
.pk-seat.is-me > .pk-say, .pk-seat.is-me > .pk-say.is-hand { top: auto; bottom: calc(100% + 2px); }
@keyframes pk-say { from { transform: translateX(-50%) scale(.4); opacity: 0; } }

/* you */
.pk-seat.is-me { width: 140px; }
.pk-seat.is-me .pk-seat-cards { height: calc(var(--pk-cw) * 1.4); margin-bottom: -10px; }
.pk-seat.is-me .pk-seat-cards .pk-card { --w: var(--pk-cw); margin: 0 1px; }
.pk-seat.is-me .pk-plate { justify-content: center; }
.pk-seat.is-me .pk-name { font-size: .84rem; }

/* bets, dealer button, flying chips */
.pk-bet { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 2px; border-radius: 999px; background: rgba(0, 0, 0, .42); color: #fff; font-weight: 800; font-size: .76rem; white-space: nowrap; font-variant-numeric: tabular-nums; transition: left .38s cubic-bezier(.3, .7, .3, 1), top .38s cubic-bezier(.3, .7, .3, 1), opacity .38s; z-index: 1; }
.pk-bet.is-sweep { left: 50%; top: 36%; opacity: 0; }
.pk-chipico { position: relative; width: 18px; height: 18px; flex: none; border-radius: 50%; background: radial-gradient(circle, var(--chip, #dc2626) 0 42%, #fff 43% 50%, var(--chip, #dc2626) 51%); border: 2px dashed rgba(255, 255, 255, .85); box-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 -3px 0 -1px var(--chip2, #1d4ed8), 0 -3px 0 1px rgba(255, 255, 255, .5); }
.pk-pot .pk-chipico { --chip: #16a34a; --chip2: #111827; }
.pk-dealer { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); transform: translate(-50%, -50%); width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #111; font-weight: 900; font-size: .72rem; display: grid; place-items: center; box-shadow: 0 2px 5px rgba(0, 0, 0, .45), inset 0 0 0 2px #d1d5db; transition: left .5s ease, top .5s ease; z-index: 1; }
.pk-fly { position: absolute; z-index: 5; transition: left .55s cubic-bezier(.3, .7, .3, 1), top .55s cubic-bezier(.3, .7, .3, 1), opacity .55s; transform: translate(-50%, -50%); }

/* ---- cards (pure CSS) ---- */
.pk-card { --w: var(--pk-bw); position: relative; display: block; flex: none; width: var(--w); height: calc(var(--w) * 1.4); border-radius: calc(var(--w) * .12); background: linear-gradient(160deg, var(--pk-face) 0%, var(--pk-face-2) 100%); border: 1px solid var(--pk-face-border); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); color: var(--pk-black); font-family: Georgia, "Times New Roman", serif; overflow: hidden; }
.pk-card.is-red { color: var(--pk-red); }
.pk-c-tl { position: absolute; top: calc(var(--w) * .05); left: calc(var(--w) * .08); display: flex; flex-direction: column; align-items: center; line-height: .92; font-weight: 700; font-size: calc(var(--w) * .36); }
.pk-c-tl small { font-size: .8em; }
.pk-c-mid { position: absolute; right: calc(var(--w) * .06); bottom: calc(var(--w) * .02); font-size: calc(var(--w) * .62); line-height: 1; opacity: .92; }
.pk-card.is-ten .pk-c-tl { font-size: calc(var(--w) * .3); letter-spacing: -.06em; }
.pk-card.is-back { background: repeating-linear-gradient(45deg, var(--pk-back) 0 4px, var(--pk-back-2) 4px 8px), var(--pk-back); background-blend-mode: normal; border: calc(var(--w) * .07) solid #fff; }
.pk-card.is-back::after { content: ""; position: absolute; inset: 12%; border-radius: 3px; border: 1px solid rgba(255, 255, 255, .45); background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .12) 0 3px, transparent 3px 6px); }
.pk-card.is-deal { animation: pk-deal .34s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes pk-deal { from { translate: var(--dx, 0) var(--dy, -60px); scale: .5; opacity: 0; } }
.pk-card.is-flip { animation: pk-flip .36s ease-out both; }
@keyframes pk-flip { from { transform: perspective(300px) rotateY(90deg); filter: brightness(.6); } }
.pk-card.is-best { box-shadow: 0 0 0 2px var(--pk-gold), 0 0 12px rgba(242, 183, 5, .8); }
.pk-card.is-dim { filter: brightness(.55) saturate(.6); }

/* ---- below the table ---- */
.pk-helper { display: flex; align-items: center; gap: 10px; margin: 2px 0 8px; padding: 8px 12px; min-height: 58px; border-radius: 14px; background: var(--pk-card-bg); border: 1px solid var(--pk-card-border); font-size: .88rem; line-height: 1.3; }
.pk-helper[hidden] { display: none; }
.pk-helper-icon { flex: none; color: var(--pk-gold); font-size: 1.15rem; }
.pk-helper-main { flex: 1; min-width: 0; }
.pk-helper-name { font-weight: 800; }
.pk-helper-tip { color: var(--pk-muted); font-size: .82rem; }
.pk-helper-tip b { color: var(--text-color); }
.pk-meter { flex: none; width: 58px; text-align: center; font-weight: 900; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.pk-meter small { display: block; font-size: .64rem; font-weight: 700; color: var(--pk-muted); text-transform: uppercase; letter-spacing: .03em; }
.pk-meter-bar { display: block; height: 6px; margin-top: 3px; border-radius: 3px; background: var(--pk-card-border); overflow: hidden; }
.pk-meter-bar i { display: block; height: 100%; border-radius: 3px; background: var(--pk-accent-2); }
.pk-meter.is-low .pk-meter-bar i { background: var(--pk-ko); }
.pk-meter.is-mid .pk-meter-bar i { background: var(--pk-gold); }

.pk-controls { height: 158px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: flex-end; }
.pk-raise { margin-bottom: 8px; }
.pk-raise[hidden], .pk-acts[hidden], .pk-wait[hidden] { display: none; }
.pk-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: 6px; }
.pk-preset { min-height: 38px; padding: 2px 2px; border-radius: 10px; border: 1px solid var(--pk-card-border); background: var(--pk-card-bg); color: inherit; font-weight: 800; font-size: .78rem; line-height: 1.05; cursor: pointer; touch-action: manipulation; }
.pk-preset small { display: block; font-weight: 600; font-size: .68rem; color: var(--pk-muted); font-variant-numeric: tabular-nums; }
.pk-preset[aria-pressed="true"] { border-color: var(--pk-raise); background: color-mix(in srgb, var(--pk-raise) 14%, var(--pk-card-bg)); }
.pk-preset:disabled { opacity: .4; cursor: not-allowed; }
.pk-slider-row { display: flex; align-items: center; gap: 8px; }
.pk-step { flex: none; width: 44px; height: 40px; border-radius: 12px; border: 1px solid var(--pk-card-border); background: var(--pk-card-bg); color: inherit; cursor: pointer; touch-action: manipulation; }
.pk-range { flex: 1; min-width: 0; height: 40px; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; touch-action: pan-y; }
.pk-range::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--pk-raise) var(--fill, 0%), var(--pk-card-border) var(--fill, 0%)); }
.pk-range::-moz-range-track { height: 8px; border-radius: 4px; background: var(--pk-card-border); }
.pk-range::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--pk-raise); }
.pk-range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: #fff; border: 3px solid var(--pk-raise); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.pk-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--pk-raise); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.pk-acts { display: grid; grid-template-columns: 1fr 1.15fr 1.25fr; gap: 6px; }
.pk-act { min-height: 60px; padding: 4px 6px; border-radius: 14px; border: 0; color: #fff; font-weight: 900; font-size: 1rem; line-height: 1.1; cursor: pointer; touch-action: manipulation; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); font-variant-numeric: tabular-nums; }
.pk-act small { font-weight: 600; font-size: .7rem; opacity: .85; text-transform: lowercase; }
.pk-act:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.pk-act:disabled { opacity: .35; cursor: not-allowed; }
.pk-act-fold { background: var(--pk-fold); }
.pk-act-call { background: var(--pk-call); }
.pk-act-raise { background: var(--pk-raise); color: #1f1300; }
.pk-wait { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 60px; }
.pk-status { margin: 0; min-height: 1.5em; font-weight: 700; text-align: center; color: var(--pk-muted); line-height: 1.4; }
.pk-status.is-you { color: var(--pk-accent); }
.pk-next { min-width: 220px; }
.pk-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pk-record { text-align: center; color: var(--pk-muted); font-size: .88rem; margin: 12px 0 0; min-height: 1.3em; line-height: 1.5; }
.pk-record b { color: var(--text-color); }
.pk-reset-wrap { text-align: center; margin: 0; }
.pk-help { max-width: 800px; margin: 12px auto 0; padding: 12px 16px; border-radius: 14px; background: var(--pk-card-bg); border: 1px solid var(--pk-card-border); }
.pk-help summary { cursor: pointer; font-weight: 700; }
.pk-help ol { margin: 10px 0 0; padding-left: 20px; color: var(--pk-muted); line-height: 1.55; }
.pk-help li { margin-bottom: 4px; }
.pk-help strong, .pk-help b, .pk-help em { color: var(--text-color); }
.pk-help p { color: var(--pk-muted); margin: 10px 0 0; line-height: 1.55; font-size: .93rem; }
.pk-help kbd { font-size: .8em; }
.pk-disclaimer { max-width: 800px; margin: 12px auto 0; color: var(--pk-muted); font-size: .8rem; line-height: 1.45; text-align: center; }
.pk-powered { text-align: center; color: var(--pk-muted); font-size: .85rem; margin: 22px 0 0; }
.pk-powered a { color: var(--pk-accent); }

/* ---- dialogs ---- */
.pk-overlay { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .55); animation: pk-fade .2s ease-out; }
.pk-overlay[hidden] { display: none; }
@keyframes pk-fade { from { opacity: 0; } }
.pk-dialog { width: 100%; max-width: 420px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; padding: 20px 16px 16px; border-radius: 22px; background: var(--pk-card-bg); color: var(--text-color); text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); animation: pk-rise .25s ease-out; }
@keyframes pk-rise { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.pk-dialog h2 { font-weight: 800; font-size: 1.4rem; margin: 2px 0 4px; }
.pk-dialog-icon { font-size: 32px; color: var(--pk-accent); }
.pk-gold { color: var(--pk-gold); }
.pk-dialog-sub { color: var(--pk-muted); margin: 0 0 10px; }
.pk-dialog-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 14px; }
.pk-cover-card { max-width: 340px; }
.pk-final { text-align: left; margin: 6px auto 0; padding-left: 26px; max-width: 300px; font-weight: 700; line-height: 1.75; }
.pk-final .is-you { color: var(--pk-accent); }
.pk-final small { color: var(--pk-muted); font-weight: 600; }
.pk-sheet-card { max-width: 560px; text-align: left; padding: 14px 12px 12px; }
.pk-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pk-x { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--pk-card-border); background: var(--pk-card-bg); color: inherit; font-size: 1.1rem; cursor: pointer; }
.pk-sheet-body h3 { font-size: .95rem; font-weight: 800; margin: 12px 0 6px; }
.pk-standings { width: 100%; border-collapse: collapse; font-size: .9rem; }
.pk-standings th { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--pk-muted); font-weight: 700; padding: 4px; text-align: left; }
.pk-standings td { padding: 7px 4px; border-top: 1px solid var(--pk-card-border); font-weight: 700; }
.pk-standings td.num, .pk-standings th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pk-standings tr.is-you td { background: var(--pk-accent-soft); }
.pk-standings tr.is-out td { color: var(--pk-muted); }
.pk-loglist { list-style: none; margin: 0; padding: 0; font-size: .85rem; line-height: 1.45; }
.pk-loglist li { padding: 5px 2px; border-top: 1px solid var(--pk-card-border); }
.pk-loglist li b { font-weight: 800; }
.pk-loglist .pk-log-street { color: var(--pk-muted); font-weight: 800; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.pk-loglist .pk-mini { display: inline-block; padding: 0 4px; margin: 0 1px; border-radius: 4px; background: var(--pk-face); border: 1px solid var(--pk-face-border); color: var(--pk-black); font-family: Georgia, serif; font-weight: 700; font-size: .82rem; }
.pk-loglist .pk-mini.is-red { color: var(--pk-red); }

/* ---- bigger screens ---- */
@media (min-width: 700px) {
    :root { --pk-cw: 70px; --pk-bw: 58px; --pk-ow: 32px; --pk-th: 470px; }
    .pk-felt { inset: 9% 5% 9%; border-radius: 50%; }
    .pk-center { top: 46%; width: 60%; gap: 9px; }
    .pk-seat { width: 124px; }
    .pk-tag { display: block; }
    .pk-seat.is-me { width: 170px; }
    .pk-av { width: 36px; height: 36px; font-size: 1rem; }
    .pk-name { font-size: .88rem; }
    .pk-stack { font-size: .92rem; }
    .pk-bet { font-size: .86rem; }
    .pk-say { font-size: .84rem; padding: 3px 11px; }
    .pk-pot { font-size: 1.02rem; }
    .pk-banner { font-size: .92rem; }
    .pk-acts { max-width: 560px; margin: 0 auto; width: 100%; }
    .pk-raise { max-width: 560px; margin: 0 auto 8px; width: 100%; }
    .pk-bar { font-size: .96rem; }
}

/* wide screens: the table on the left, your helper and buttons on the right — all above the fold */
@media (min-width: 1100px) {
    body.pk-playing .pk-game .container, body.pk-playing .pk-hero .container { max-width: 1180px; }
    .pk-play { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto auto auto 1fr; column-gap: 20px; align-items: start; }
    .pk-bar { grid-column: 1 / -1; }
    .pk-table { --pk-th: 560px; grid-column: 1; grid-row: 2 / span 3; width: 100%; }
    .pk-helper { grid-column: 2; grid-row: 2; margin: 18px 0 10px; }
    .pk-controls { grid-column: 2; grid-row: 3; height: 186px; }
    .pk-actions { grid-column: 2; grid-row: 4; }
    .pk-raise, .pk-acts { max-width: none; }
    .pk-presets { grid-template-columns: repeat(5, 1fr); }
    .pk-act { min-height: 64px; }
}

@media (max-width: 380px) {
    :root { --pk-cw: 50px; --pk-bw: 37px; --pk-ow: 23px; --pk-th: 430px; }
    .pk-seat { width: 88px; }
    .pk-seat.is-me { width: 128px; }
    .pk-av { width: 24px; height: 24px; font-size: .74rem; }
    .pk-plate { gap: 4px; padding-right: 5px; }
    .pk-mode { font-size: .82rem; }
    .pk-bar { font-size: .82rem; gap: 4px 6px; }
    .pk-act { font-size: .92rem; }
}

/* short phones (e.g. 360x740, 375x667): everything from the bar to the buttons fits under the navbar */
@media (max-width: 699px) and (max-height: 780px) {
    :root { --pk-th: 404px; --pk-cw: 48px; --pk-bw: 36px; --pk-ow: 22px; }
    .pk-helper { min-height: 44px; padding: 5px 10px; margin-bottom: 6px; }
    .pk-helper-tip { display: none; }
    .pk-helper-main br { display: none; }
    .pk-meter { width: 52px; font-size: .95rem; }
    .pk-meter small { display: none; }
    .pk-controls { height: 136px; margin-bottom: 8px; }
    .pk-preset { min-height: 34px; }
    .pk-presets { margin-bottom: 4px; }
    .pk-step { height: 36px; }
    .pk-range { height: 36px; }
    .pk-raise { margin-bottom: 6px; }
    .pk-act { min-height: 52px; }
    .pk-bar { min-height: 44px; margin-bottom: 4px; }
    .pk-icon-btn { width: 38px; height: 38px; }
}
@media (max-width: 699px) and (max-height: 690px) {
    :root { --pk-th: 372px; }
    .pk-seat-cards { margin-bottom: -10px; }
}

@media (prefers-reduced-motion: reduce) {
    .pk-card, .pk-bet, .pk-dealer, .pk-fly, .pk-say, .pk-dialog, .pk-overlay, .pk-banner, .pk-seat.is-turn .pk-plate { transition: none !important; animation: none !important; }
}
