:root {
  --bg: #0b111e;
  --bg2: #101829;
  --card: #16203a;
  --card2: #1c2847;
  --line: #26345a;
  --text: #e9eef8;
  --muted: #8693b0;
  --gold: #f2c14e;
  --gold-d: #c8962a;
  --blue: #3e6dff;
  --win: #2fd27a;
  --lose: #ff5468;
  --red: #e0344a;
  --radius: 14px;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 15px/1.4 system-ui, "Segoe UI", Roboto, sans-serif; }
body { background: radial-gradient(1200px 600px at 70% -200px, #1a2a5244, transparent), var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px clamp(12px, 3vw, 28px); background: #0b111ee6; backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { font-weight: 800; font-size: 20px; letter-spacing: -.5px; text-decoration: none; }
.logo span { color: var(--gold); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.balance, .bonus, .rank {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
}
.balance b { font-variant-numeric: tabular-nums; font-size: 16px; min-width: 60px; text-align: right; transition: color .3s; }
.balance b.up { color: var(--win); }
.balance b.down { color: var(--lose); }
.chip-ico { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle, var(--gold) 34%, transparent 36%), conic-gradient(var(--gold) 0 10%, var(--gold-d) 0 25%, var(--gold) 0 35%, var(--gold-d) 0 50%, var(--gold) 0 60%, var(--gold-d) 0 75%, var(--gold) 0 85%, var(--gold-d) 0); box-shadow: inset 0 0 0 2px #0003; flex: none; }
.bonus { font-weight: 600; font-size: 14px; }
.bonus.ready { background: var(--gold); color: #241a00; border-color: var(--gold); }
.bonus:disabled { cursor: default; color: var(--muted); }
.rank { flex-direction: column; align-items: stretch; justify-content: center; gap: 4px; min-width: 120px; font-size: 12px; font-weight: 600; }
.rank-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.rank-bar i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .4s; }
@media (max-width: 640px) {
  .rank { display: none; }
  .bonus .lg { display: none; }
  .top-right { gap: 6px; }
}
@media (max-width: 380px) {
  .top { gap: 6px; padding: 10px; }
  .logo { font-size: 15px; }
  .balance, .bonus { height: 36px; padding: 0 8px; gap: 6px; }
  .balance b { min-width: 0; font-size: 15px; }
  .top-right { gap: 4px; }
  .top-right > .balance:first-child { padding: 0 8px !important; }
  .tile .art { font-size: 52px; }
  .tile h3 { font-size: 16px; }
  .logo { font-size: 17px; }
  .balance, .bonus { padding: 0 10px; }
}

main { padding: clamp(12px, 3vw, 28px); max-width: 1280px; margin: 0 auto; }

/* ---------- lobby ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 22px; flex-wrap: wrap; }
.hero h1 { margin: 0; font-size: clamp(24px, 4vw, 36px); letter-spacing: -1px; }
.hero p { margin: 4px 0 0; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, calc(50% - 7px)), 1fr)); gap: 14px; }
.tile {
  position: relative; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; text-decoration: none;
  background: var(--tile, var(--card2)); border: 1px solid #ffffff14; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px; transition: transform .15s, box-shadow .15s;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 14px 40px #0008; }
.tile .art { position: absolute; inset: 0 0 34% 0; display: grid; place-items: center; font-size: 72px; filter: drop-shadow(0 8px 16px #0006); }
.tile .art svg { width: 62%; height: auto; }
.tile h3 { margin: 0; font-size: 19px; position: relative; }
.tile small { color: #ffffffa8; position: relative; }
.tile .tag { position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; background: #0006; padding: 4px 8px; border-radius: 999px; }

.section-title { margin: 34px 0 12px; font-size: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { display: block; font-size: 20px; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ---------- game layout ---------- */
.game-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.back { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: 18px; }
.game-head h2 { margin: 0; font-size: 22px; }
.game { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 860px) {
  .game { grid-template-columns: minmax(0, 1fr); }
  .game .stage { order: -1; }
}
.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.stage { position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; min-height: 460px; overflow: hidden; }
@media (max-width: 860px) { .stage { min-height: 340px; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; }
.input {
  display: flex; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; height: 44px;
}
.input:focus-within { border-color: var(--blue); }
.input input, .input select { flex: 1; min-width: 0; width: 0; height: 100%; background: none; border: 0; outline: 0; padding: 0 12px; font-variant-numeric: tabular-nums; }
.input select option { background: var(--card); }
.input button { height: 100%; padding: 0 12px; background: none; border: 0; border-left: 1px solid var(--line); color: var(--muted); font-weight: 700; font-size: 13px; }
.input button:hover { color: var(--text); background: var(--card2); }
.input .chip-ico { margin-left: 12px; }

.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; height: 36px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--card2); color: var(--text); box-shadow: 0 1px 0 #ffffff10 inset; }

.btn { height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); font-weight: 700; padding: 0 16px; }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { height: 52px; background: linear-gradient(var(--gold), var(--gold-d)); color: #221800; border: 0; font-size: 16px; box-shadow: 0 6px 20px #f2c14e33; }
.btn-green { background: linear-gradient(#3be08a, #1fae62); color: #04210f; border: 0; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.readout { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.readout b { color: var(--text); font-variant-numeric: tabular-nums; }

/* result badge in stage */
.result-pop {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.8); opacity: 0; pointer-events: none;
  background: #0b111ef0; border: 2px solid var(--win); color: var(--win); border-radius: 16px; padding: 14px 22px; text-align: center;
  font-weight: 800; font-size: 26px; transition: .2s; z-index: 5; font-variant-numeric: tabular-nums;
}
.result-pop small { display: block; font-size: 14px; color: var(--muted); font-weight: 600; }
.result-pop.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.result-pop.lose { border-color: var(--lose); color: var(--lose); }

/* history */
.history { margin-top: 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.history h4 { margin: 0; padding: 12px 16px; font-size: 14px; color: var(--muted); border-bottom: 1px solid var(--line); }
.history table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.history td { padding: 9px 16px; border-bottom: 1px solid #ffffff08; }
.history td:last-child { text-align: right; }
.history .w { color: var(--win); }
.history .l { color: var(--muted); }
.history .empty { color: var(--muted); padding: 16px; text-align: left !important; }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; }
.toast { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; box-shadow: 0 10px 30px #0008; animation: toastIn .25s ease-out; max-width: 320px; }
.toast.gold { border-color: var(--gold); }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }

/* modal */
.modal { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal .box { background: var(--bg2); border: 1px solid var(--line); border-radius: 20px; padding: 22px; width: min(420px, 100%); }
.modal h3 { margin: 0 0 6px; }
.modal p { color: var(--muted); margin: 0 0 16px; }

/* footer */
body { display: flex; flex-direction: column; min-height: 100dvh; }
main { width: 100%; flex: 1; }
.foot { margin-top: 40px; border-top: 1px solid var(--line); background: linear-gradient(#0b111e00, #101829); }
.foot-in { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 20px clamp(12px, 3vw, 28px) calc(20px + env(safe-area-inset-bottom)); }
.foot .logo { font-size: 16px; }
.foot p { margin: 0; flex: 1; color: var(--muted); font-size: 13px; }
.foot-mail { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: 13px; font-weight: 600; transition: border-color .15s, color .15s; }
.foot-mail span { color: var(--muted); font-weight: 500; }
.foot-mail:hover { border-color: var(--gold); color: var(--gold); }
@media (max-width: 640px) {
  .foot-in { flex-direction: column; text-align: center; gap: 10px; }
  .foot-mail span { display: none; }
}

/* account */
.account { height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--gold); background: none; color: var(--gold); font-weight: 700; font-size: 14px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account.signed { border-color: var(--line); background: var(--card); color: var(--text); }
.account:hover { filter: brightness(1.15); }
.auth { display: flex; flex-direction: column; gap: 10px; }
.auth .btn { width: 100%; }
.btn-ghost { background: none; color: var(--muted); }
.btn-link { background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; padding: 4px; }
@media (max-width: 640px) {
  .account { height: 40px; padding: 0 10px; max-width: 84px; font-size: 13px; }
  .logo { font-size: 15px; }
  .top { gap: 6px; padding: 10px; }
  .top-right { gap: 4px; }
  .balance, .bonus { padding: 0 8px; gap: 6px; }
  .balance b { min-width: 0; }
}
@media (max-width: 380px) { .account { height: 36px; padding: 0 8px; max-width: 72px; } }
.mute { padding: 0 12px !important; font-size: 17px; }
.mute .t { display: none; }
.mute-foot { display: none; }
@media (max-width: 640px) { .mute { display: none !important; } .mute-foot { display: inline-flex; } }

/* leaderboard */
.lobby-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .lobby-cols { grid-template-columns: minmax(0, 1fr); } }
.section-title { display: flex; align-items: baseline; justify-content: space-between; }
.section-title .more { font-size: 13px; color: var(--gold); text-decoration: none; font-weight: 600; }
.board { margin-top: 0; }
.board td.place { width: 44px; color: var(--muted); font-weight: 700; }
.board td small { display: block; color: var(--muted); font-size: 12px; }
.board tr.me td { background: #f2c14e14; }
.board tr.me td:first-child { color: var(--gold); }
.board tr.sep td { border-top: 1px dashed var(--line); }
.board-tabs { max-width: 520px; margin-bottom: 14px; }
.board-note { color: var(--muted); font-size: 13px; margin: -4px 0 12px; }

@media (max-width: 350px) { .top .balance .chip-ico { display: none; } }

/* sign-in steps */
.auth-steps h3 { margin: 0 0 6px; }
.auth-steps p { color: var(--muted); margin: 0 0 16px; }
.auth-steps p b { color: var(--text); font-weight: 600; word-break: break-all; }
.auth-steps .btn-link { padding: 0; }
.auth-steps .resend { align-self: center; margin-top: 2px; text-decoration: none; }
.auth-steps .resend:disabled { opacity: .7; cursor: default; }
.otp { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; cursor: text; }
.otp span { height: 54px; display: grid; place-items: center; font-size: 24px; font-weight: 800; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-variant-numeric: tabular-nums; }
.otp span.cur { border-color: var(--gold); box-shadow: 0 0 0 3px #f2c14e22; }
/* the real input sits on top, invisible: it gets taps, paste, autofill and keyboard suggestions (16px = no iOS zoom) */
.otp-in { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; border: 0; padding: 0; color: transparent; caret-color: transparent; background: transparent; }

/* tablets: the full header (rank, labels) only fits on wide screens */
@media (max-width: 960px) {
  .rank { display: none; }
  .bonus .lg { display: none; }
}

/* ---------- poker ---------- */
.pk-head { display: flex; align-items: center; }
.pk-head h2 { flex: 1; }
.pk-cheat-btn { height: 40px; }
.pk-rules { color: var(--muted); margin: -4px 0 18px; font-size: 14px; }
.pk-empty { color: var(--muted); padding: 24px; text-align: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; }
.pk-offline { margin-bottom: 12px; padding: 12px; }
.pk-group .section-title { margin-top: 18px; }
.pk-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.pk-tcard { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 18px; text-decoration: none;
  background: radial-gradient(120% 120% at 100% 0%, #1d7a5b22, transparent 60%), var(--card); border: 1px solid var(--line); transition: transform .15s, border-color .15s; }
.pk-tcard:hover { transform: translateY(-2px); border-color: #f2c14e66; }
.pk-tcard-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.pk-tcard-top b { font-size: 17px; }
.pk-dots { display: flex; gap: 4px; }
.pk-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.pk-dots i.on { background: var(--win); box-shadow: 0 0 6px #2fd27a88; }
.pk-tcard-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.pk-tcard-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.pk-tcard-go { margin-top: 6px; display: grid; place-items: center; }
.pk-gate { display: grid; place-items: center; padding: 40px 12px; height: 100%; }
.pk-gate-box { text-align: center; max-width: 360px; background: var(--bg2); border: 1px solid var(--line); border-radius: 20px; padding: 28px 22px; }
.pk-gate-ico { font-size: 40px; color: var(--gold); }
.pk-gate h3 { margin: 6px 0; }
.pk-gate p { color: var(--muted); margin: 0 0 16px; }

/* shimmering "connecting" text */
.pk-shimmer { font-weight: 800; background: linear-gradient(90deg, #8693b0 0%, #8693b0 35%, #fff3cf 50%, #8693b0 65%, #8693b0 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: pkShimmer 1.6s linear infinite; }
@keyframes pkShimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* connection banner */
.pk-netbanner { position: fixed; left: 50%; top: 72px; z-index: 30; transform: translate(-50%, -140%); opacity: 0; display: flex; align-items: center; gap: 10px;
  max-width: calc(100vw - 24px); padding: 10px 16px; border-radius: 12px; background: #2a2210f2; border: 1px solid #f2c14e88; color: #ffe3a1; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px #0009; transition: transform .35s cubic-bezier(.2,.8,.3,1), opacity .35s; }
.pk-netbanner.on { transform: translate(-50%, 0); opacity: 1; }
.pk-netdot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); flex: none; animation: pkBlink 1s ease-in-out infinite; }
@keyframes pkBlink { 50% { opacity: .25; } }

/* ---------- table ---------- */
.pk-wrap { display: flex; flex-direction: column; gap: 12px; }
.pk-top { display: flex; align-items: center; gap: 10px; }
.pk-title { flex: 1; min-width: 0; }
.pk-title h2 { margin: 0; font-size: 20px; }
.pk-title small { color: var(--muted); font-size: 13px; }
.pk-leave { height: 40px; }

.pk-felt { position: relative; height: clamp(440px, 64vh, 620px); border-radius: 24px; background: radial-gradient(90% 70% at 50% 45%, #18264a, var(--bg2) 70%); border: 1px solid var(--line); overflow: hidden; user-select: none; }
.pk-oval { position: absolute; inset: 17% 13% 19%; border-radius: 999px;
  background: radial-gradient(120% 100% at 50% 30%, #1f8463, #12553f 55%, #0b3529); box-shadow: inset 0 0 0 10px #5a3a1f, inset 0 0 0 13px #c9a14a55, inset 0 0 60px #0006, 0 24px 60px #000a; }
.pk-center { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: 70%; z-index: 3; pointer-events: none; }
.pk-street { font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: #ffffff70; min-height: 15px; }
.pk-board { display: flex; gap: 6px; perspective: 600px; }
.pk-pot { display: flex; align-items: center; gap: 6px; background: #0b111ecc; padding: 4px 12px 4px 6px; border-radius: 999px; font-variant-numeric: tabular-nums; opacity: 0; transform: scale(.8); transition: opacity .25s, transform .25s; }
.pk-pot.on { opacity: 1; transform: none; }
.pk-side { display: flex; gap: 6px; justify-content: center; font-size: 12px; color: #ffffffc0; flex-wrap: wrap; }
.pk-side span { background: #0b111e99; padding: 2px 8px; border-radius: 999px; }
.pk-msg { background: #0b111ee6; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; max-width: 100%; text-align: center; }
.pk-msg.win { border-color: #2fd27a88; color: #c9f7dc; animation: pkPop .35s ease-out; }
.pk-center.counting .pk-board, .pk-center.counting .pk-street { display: none; }
.pk-cheat-btn .sm { display: none; }
.pk-count { display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: auto; }
.pk-count[hidden] { display: none; }
.pk-count-ring { position: relative; width: 72px; height: 72px; display: grid; place-items: center; }
.pk-count-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.pk-count-ring circle { fill: #0b111ecc; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 175.93; }
.pk-count-ring b { position: relative; font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; }
.pk-count-ring b.tick { animation: pkTick .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes pkTick { from { transform: scale(1.5); opacity: .3; } }
.pk-count small { color: #ffffffb0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.pk-delay { height: 36px; padding: 0 14px; font-size: 13px; background: #0b111ecc; }
.pk-delayed { font-size: 13px; font-weight: 800; color: var(--gold); background: #0b111ecc; padding: 3px 10px; border-radius: 999px; }
.pk-delayed.pop { animation: pkPop .35s cubic-bezier(.2,1.6,.4,1); }
.pk-felt .pk-offline-box { position: absolute; inset: 0; z-index: 20; display: none; flex-direction: column; gap: 6px; align-items: center; justify-content: center; background: #0b111ed9; backdrop-filter: blur(2px); font-size: 20px; }
.pk-felt .pk-offline-box small { color: var(--muted); font-size: 13px; }
.pk-felt.offline .pk-offline-box { display: flex; }

/* cards */
.pk-card { width: 46px; height: 64px; border-radius: 7px; background: #fbfaf6; color: #151a27; position: relative; box-shadow: 0 3px 10px #0007; flex: none; }
.pk-card b { position: absolute; left: 5px; top: 3px; font-size: 16px; line-height: 1; font-weight: 800; }
.pk-card i { position: absolute; left: 5px; top: 20px; font-style: normal; font-size: 13px; line-height: 1; }
.pk-card em { position: absolute; right: 5px; bottom: 3px; font-style: normal; font-size: 24px; line-height: 1; }
.pk-card.red { color: #c22a3c; }
.pk-card.back { background: repeating-linear-gradient(45deg, #1d3270 0 5px, #243c85 5px 10px); box-shadow: 0 3px 10px #0007, inset 0 0 0 3px #fbfaf6, inset 0 0 0 4px #c9a14a; }
.pk-card.slot { background: #ffffff0c; box-shadow: inset 0 0 0 1px #ffffff22; }
.pk-card.sm { width: 34px; height: 48px; border-radius: 5px; }
.pk-card.sm b { font-size: 13px; left: 3px; top: 2px; } .pk-card.sm i { font-size: 10px; left: 4px; top: 16px; } .pk-card.sm em { font-size: 16px; right: 3px; bottom: 2px; }
.pk-card.xs { width: 26px; height: 36px; border-radius: 4px; box-shadow: 0 1px 4px #0006; }
.pk-card.xs b { font-size: 11px; left: 3px; top: 2px; } .pk-card.xs i { font-size: 9px; left: 3px; top: 14px; } .pk-card.xs em { display: none; }
.pk-card.lg { width: 66px; height: 92px; border-radius: 9px; }
.pk-card.lg b { font-size: 22px; } .pk-card.lg i { font-size: 17px; top: 27px; } .pk-card.lg em { font-size: 34px; }
.pk-card.fly { animation: pkFly .42s cubic-bezier(.2,.8,.3,1) both; }
@keyframes pkFly { from { transform: translate(var(--dx), var(--dy)) rotate(-25deg) scale(.6); opacity: 0; } 30% { opacity: 1; } }
.pk-card.flip { animation: pkFlip .45s cubic-bezier(.2,.8,.3,1) both; transform-origin: 50% 50%; }
@keyframes pkFlip { from { transform: translateY(-18px) rotateY(90deg); opacity: 0; } 60% { opacity: 1; } }
.pk-card.rise { animation: pkRise .45s cubic-bezier(.2,.8,.3,1) both; }
@keyframes pkRise { from { transform: translateY(-60px) rotate(-12deg) scale(.7); opacity: 0; } }

/* seats */
.pk-slot { position: absolute; transform: translate(-50%, -50%); z-index: 5; display: flex; flex-direction: column; align-items: center; transition: left .3s, top .3s; }
.pk-slot > .pk-seat, .pk-slot > .pk-sit, .pk-slot > .pk-free { display: none; }
.pk-slot.occupied > .pk-seat { display: flex; }
.pk-slot.can-sit > .pk-sit { display: flex; }
.pk-slot:not(.occupied):not(.can-sit) > .pk-free { display: block; }
.pk-seat { position: relative; flex-direction: column; align-items: center; width: 156px; }
.pk-cards { display: flex; gap: 3px; height: 48px; margin-bottom: -12px; z-index: 1; transition: opacity .4s, transform .4s; }
.pk-seat.folded .pk-cards { opacity: 0; transform: translateY(16px) scale(.85); }
.pk-plate { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 12px 5px 5px; border-radius: 999px; background: #0b111ef2; border: 1px solid var(--line); box-shadow: 0 6px 18px #0007; transition: border-color .2s, box-shadow .2s, opacity .3s; }
.pk-ava { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; background: linear-gradient(135deg, #3e6dff, #1a2a52); }
.pk-ava > span { position: relative; z-index: 1; }
.pk-ring { position: absolute; inset: -3px; width: 44px; height: 44px; transform: rotate(-90deg); pointer-events: none; }
.pk-ring circle { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 119.38; stroke-dashoffset: 119.38; }
.pk-ring circle.low { stroke: var(--lose); }
.pk-net { position: absolute; right: -4px; bottom: -3px; z-index: 2; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #0b111e; display: grid; place-items: center; font-style: normal; font-size: 9px; }
.pk-net.poor { background: #f2a33a; }
.pk-net.poor::after { content: '📶'; font-size: 8px; filter: grayscale(1) brightness(.2); }
.pk-net.off { background: #6b7591; }
.pk-net.off::after { content: '✕'; color: #fff; font-weight: 900; }
.pk-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.pk-who b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-who span { font-size: 14px; color: var(--gold); font-weight: 800; font-variant-numeric: tabular-nums; }
.pk-seat.acting .pk-plate { border-color: var(--gold); box-shadow: 0 0 0 3px #f2c14e33, 0 6px 18px #0007; }
.pk-seat.me .pk-plate { background: #16203af2; border-color: #3e6dff88; }
.pk-seat.folded .pk-plate, .pk-seat.out .pk-plate { opacity: .5; }
.pk-seat.won .pk-plate { border-color: var(--win); animation: pkGlow 1.2s ease-in-out infinite; }
@keyframes pkGlow { 0%, 100% { box-shadow: 0 0 0 3px #2fd27a44, 0 6px 18px #0007; } 50% { box-shadow: 0 0 0 6px #2fd27a33, 0 0 28px #2fd27a66; } }
.pk-tag { min-height: 22px; margin-top: 4px; display: flex; flex-direction: column; align-items: center; }
.pk-tag.pop > * { animation: pkPop .3s cubic-bezier(.2,1.6,.4,1); }
@keyframes pkPop { from { transform: scale(.6); opacity: 0; } }
.pk-last { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 2px 9px; border-radius: 999px; background: #0b111ecc; color: #ffffffd0; }
.pk-won { color: var(--win); font-size: 14px; background: #0b111ecc; padding: 2px 10px; border-radius: 999px; }
.pk-tag small { font-size: 11px; color: #ffffffc0; font-weight: 600; margin-top: 2px; }
.pk-badge { font-size: 10px; font-weight: 800; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: #8693b0; color: #0b111e; white-space: nowrap; }
.pk-badge.allin { background: var(--lose); color: #fff; }
.pk-badge.off { background: #3a4260; color: #c9d2ea; text-transform: none; }
.pk-badge.leave { background: #4a3a1c; color: #ffd98a; text-transform: none; }
.pk-seat.leaving .pk-plate { opacity: .6; border-style: dashed; }
.pk-leaving { color: var(--gold); font-weight: 600; }
.pk-sit { align-items: center; gap: 6px; height: 42px; padding: 0 18px; border-radius: 999px; border: 1px dashed #f2c14e99; background: #0b111ebb; color: var(--gold); font-weight: 700; transition: background .15s, transform .15s; }
.pk-sit span { font-size: 18px; line-height: 1; }
.pk-sit:hover { background: #f2c14e22; transform: scale(1.04); }
.pk-free { font-size: 12px; color: #ffffff40; }

/* bets, dealer button, flying chips */
.pk-chip { width: 16px; height: 16px; border-radius: 50%; flex: none; background: radial-gradient(circle, var(--gold) 35%, transparent 37%), conic-gradient(var(--gold) 0 12.5%, #fff 0 25%, var(--gold) 0 37.5%, #fff 0 50%, var(--gold) 0 62.5%, #fff 0 75%, var(--gold) 0 87.5%, #fff 0); box-shadow: 0 1px 3px #0008; }
.pk-bet { position: absolute; transform: translate(-50%, -50%); z-index: 4; display: none; align-items: center; gap: 5px; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; background: #0b111ecc; padding: 2px 9px 2px 3px; border-radius: 999px; }
.pk-bet.on { display: flex; }
.pk-bet.slide { animation: pkBetIn .35s cubic-bezier(.2,.8,.3,1); }
@keyframes pkBetIn { from { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.6); opacity: .2; } }
.pk-dbtn { position: absolute; z-index: 6; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: #fbfaf6; color: #151a27; font-size: 12px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 2px 6px #0008; transition: left .5s cubic-bezier(.2,.8,.3,1), top .5s cubic-bezier(.2,.8,.3,1); }
.pk-fx { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.pk-flychip { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: radial-gradient(circle, var(--gold) 35%, transparent 37%), conic-gradient(var(--gold) 0 25%, #fff 0 50%, var(--gold) 0 75%, #fff 0); box-shadow: 0 1px 4px #000a;
  animation: pkChip .6s cubic-bezier(.5,0,.3,1) both; }
@keyframes pkChip { 0% { transform: translate(0, 0) scale(1); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(.8); opacity: .2; } }

/* my panel */
.pk-me { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; transition: border-color .2s, box-shadow .2s; }
.pk-me.turn { border-color: #f2c14e88; animation: pkTurn 1.6s ease-in-out infinite; }
@keyframes pkTurn { 0%, 100% { box-shadow: 0 0 0 0 #f2c14e00; } 50% { box-shadow: 0 0 0 4px #f2c14e22; } }
.pk-holebox { display: flex; align-items: center; gap: 12px; }
.pk-hole { display: flex; gap: 6px; align-items: center; min-height: 92px; touch-action: none; -webkit-touch-callout: none; }
.pk-hole.hidden-cards { cursor: pointer; }
.pk-holeinfo { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pk-eye { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 13px; font-weight: 600; }
.pk-eye span { font-size: 16px; }
.pk-eye.on { border-color: #f2c14e66; color: var(--gold); }
.pk-myhand { font-size: 13px; font-weight: 800; color: #221800; background: var(--gold); padding: 3px 10px; border-radius: 999px; animation: pkPop .3s ease-out; }
.pk-peek-hint { font-size: 12px; color: var(--muted); }
.pk-wait { color: var(--muted); font-size: 14px; padding: 0 6px; }
.pk-actions { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pk-waitturn { color: var(--muted); font-size: 14px; text-align: right; }
.pk-turnhead { display: flex; align-items: center; gap: 10px; }
.pk-turnhead b { color: var(--gold); }
.pk-secs { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; min-width: 18px; }
.pk-turnbar { flex: 1; height: 5px; border-radius: 3px; background: var(--card); overflow: hidden; }
.pk-turnbar i { display: block; height: 100%; width: 100%; background: var(--gold); }
.pk-turnbar i.low { background: var(--lose); }
.pk-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.pk-btns .btn { height: 52px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; }
.pk-btns kbd { font: 700 10px var(--mono); opacity: .55; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; }
.pk-fold { background: #2a1620; border-color: #ff546855; color: #ffb3bd; }
.pk-raise { display: flex; flex-direction: column; gap: 8px; }
.pk-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pk-quick button { height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 13px; font-weight: 600; }
.pk-quick button:hover { border-color: #f2c14e66; }
.pk-slider { display: grid; grid-template-columns: 1fr 110px; gap: 10px; align-items: center; }
.pk-slider .input { height: 40px; }
.pk-slider input[type=range], .pk-sitbox input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 4px; outline: 0;
  background: linear-gradient(90deg, var(--gold) var(--p, 0%), var(--card) var(--p, 0%)); }
.pk-slider input[type=range]::-webkit-slider-thumb, .pk-sitbox input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--gold); box-shadow: 0 2px 6px #0008; cursor: pointer; }
.pk-slider input[type=range]::-moz-range-thumb, .pk-sitbox input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--gold); cursor: pointer; }

/* sit dialog */
.pk-sitbox .pk-buyin { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 10px; }
.pk-sitbox .pk-buyin b { font-size: 30px; color: var(--gold); }
.pk-sitbox .pk-buyin span { color: var(--muted); font-size: 13px; }
.pk-sitbox input[type=range] { --p: 50%; background: var(--card); margin: 4px 0; }
.pk-range-lbl { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.pk-buyq { grid-template-columns: repeat(3, 1fr); margin-bottom: 14px; }
.pk-warn { color: var(--lose) !important; }

/* cheat sheet */
.pk-cheat-wrap { place-items: stretch end; padding: 0; }
.pk-cheat { width: min(440px, 100vw); height: 100%; overflow: auto; background: var(--bg2); border-left: 1px solid var(--line); padding: 18px 18px 30px; animation: pkDrawer .3s cubic-bezier(.2,.8,.3,1); }
@keyframes pkDrawer { from { transform: translateX(100%); } }
.pk-cheat-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -18px; background: var(--bg2); padding: 6px 0 10px; z-index: 1; }
.pk-cheat-head h3 { margin: 0; }
.pk-x { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 22px; line-height: 1; }
.pk-cheat section { margin-top: 14px; }
.pk-cheat h4 { margin: 0 0 8px; font-size: 14px; color: var(--gold); }
.pk-note { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.pk-ranks { display: flex; flex-direction: column; gap: 6px; }
.pk-rank { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--card); border: 1px solid transparent; transition: border-color .2s, background .2s; }
.pk-rank.hl { border-color: var(--gold); background: #f2c14e14; }
.pk-rank-n { color: var(--muted); font-weight: 800; font-size: 12px; }
.pk-rank-t b { display: block; font-size: 14px; }
.pk-rank-t small { color: var(--muted); font-size: 12px; }
.pk-rank-c { display: flex; gap: 2px; }
.pk-steps { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.pk-steps b { color: var(--text); }
.pk-acts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.pk-acts dt { font-weight: 800; }
.pk-acts dd { margin: 0; color: var(--muted); }
.pk-cheat kbd { font: 700 11px var(--mono); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; color: var(--text); }

@media (max-width: 640px) {
  .pk-felt { height: 560px; border-radius: 18px; }
  .pk-oval { inset: 15% 18% 16%; }
  .pk-center { width: 64%; gap: 6px; }
  .pk-board { gap: 4px; }
  .pk-board .pk-card { width: 32px; height: 45px; } .pk-board .pk-card em { font-size: 15px; }
  .pk-side { display: none; }
  .pk-msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; padding: 5px 10px; }
  .pk-seat { width: 112px; }
  .pk-plate { gap: 6px; padding: 4px 8px 4px 4px; }
  .pk-ava { width: 30px; height: 30px; font-size: 13px; }
  .pk-ring { width: 36px; height: 36px; }
  .pk-who b { font-size: 12px; } .pk-who span { font-size: 12px; }
  .pk-card { width: 36px; height: 50px; } .pk-card b { font-size: 13px; } .pk-card i { font-size: 11px; top: 17px; } .pk-card em { font-size: 18px; }
  .pk-card.sm { width: 28px; height: 40px; } .pk-card.sm em { display: none; }
  .pk-card.lg { width: 58px; height: 80px; }
  .pk-cards { height: 40px; }
  .pk-me { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; }
  .pk-holebox { justify-content: center; }
  .pk-hole { min-height: 0; }
  .pk-btns { grid-template-columns: repeat(3, 1fr); }
  .pk-btns .btn { height: 56px; font-size: 14px; padding: 0 6px; }
  .pk-btns kbd { display: none; }
  .pk-quick button { height: 40px; }
  .pk-slider { grid-template-columns: 1fr 90px; }
  .pk-waitturn { text-align: center; }
  .pk-cheat-wrap { place-items: end stretch; }
  .pk-cheat { width: 100vw; height: 86vh; border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; animation-name: pkSheet; }
  @keyframes pkSheet { from { transform: translateY(100%); } }
  .pk-netbanner { top: 64px; font-size: 13px; }
  .pk-top .pk-cheat-btn { padding: 0; width: 40px; font-size: 18px; }
  .pk-top .pk-cheat-btn .lg { display: none; } .pk-top .pk-cheat-btn .sm { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .pk-count-ring b.tick, .pk-delayed.pop,
  .pk-card.fly, .pk-card.flip, .pk-card.rise, .pk-bet.slide, .pk-tag.pop > *, .pk-myhand, .pk-msg.win, .pk-cheat, .pk-me.turn, .pk-seat.won .pk-plate, .pk-netdot { animation: none !important; }
  .pk-shimmer { animation: none; color: var(--muted); background: none; }
  .pk-dbtn, .pk-slot, .pk-cards, .pk-pot, .pk-netbanner { transition: none; }
}
.foot .mute-foot span { display: inline !important; color: inherit; }

/* ---------- admin panel ---------- */
.adm-tabs { max-width: 560px; margin-bottom: 16px; }
.adm-loading, .adm-empty { color: var(--muted); padding: 24px 4px; }
.adm-muted { color: var(--muted); }
.adm-note { color: var(--muted); font-size: 12px; margin: 8px 2px 0; }
.adm-stats { margin-bottom: 4px; }
.adm-table table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-table table th:last-child { text-align: right; }
.adm-table td small { display: block; color: var(--muted); font-size: 12px; }
.adm-rtp { padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.adm-rtp.ok { color: var(--win); background: #2fd27a1a; }
.adm-rtp.warn { color: var(--gold); background: #f2c14e1f; }
.adm-rtp.bad { color: var(--lose); background: #ff54681f; }
.adm-filters { display: flex; gap: 8px; margin-bottom: 12px; }
.adm-search { flex: 1; }
.adm-sort { width: 170px; flex: none; }
.adm-users .adm-row { cursor: pointer; }
.adm-users .adm-row:hover td { background: #ffffff06; }
.adm-badge { display: inline-block; margin-left: 4px; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .3px; white-space: nowrap; }
.adm-badge.ban { background: #ff546826; color: var(--lose); }
.adm-badge.admin { background: #3e6dff2e; color: #9db5ff; }
.adm-badge.table { background: #2fd27a1f; color: var(--win); }
.adm-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.adm-pager .btn { height: 38px; }
.adm-show-sm { display: none !important; }
@media (max-width: 640px) {
  .adm-hide-sm { display: none; }
  .adm-show-sm { display: block !important; }
  .adm-sort { width: 130px; }
  .adm-table table th, .adm-table td { padding-left: 10px; padding-right: 10px; }
}

/* drawer */
.adm-drawer-wrap { position: fixed; inset: 0; background: #0008; z-index: 35; display: flex; justify-content: flex-end; animation: admFade .15s ease-out; }
.adm-drawer { width: min(520px, 100%); height: 100%; overflow-y: auto; background: var(--bg2); border-left: 1px solid var(--line); padding: 20px; animation: admSlide .2s ease-out; }
@keyframes admFade { from { opacity: 0; } }
@keyframes admSlide { from { transform: translateX(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .adm-drawer-wrap, .adm-drawer { animation: none; } }
.adm-drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.adm-drawer-head h3 { margin: 0; font-size: 22px; }
.adm-drawer-head p { margin: 2px 0 0; color: var(--muted); word-break: break-all; }
.adm-x { flex: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 20px; }
.adm-badges { margin: 10px 0 4px -4px; }
.adm-ban-reason { color: var(--lose); font-size: 13px; margin: 6px 0; }
.adm-mini { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin: 12px 0; }
.adm-mini .stat { padding: 10px 12px; }
.adm-mini .stat b { font-size: 16px; }
.adm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.adm-actions .btn { height: 42px; font-size: 14px; }
.adm-danger { background: #ff54681f; border-color: #ff546866; color: var(--lose); }
.adm-danger:disabled { opacity: .4; }
.adm-h4 { margin: 20px 0 8px; font-size: 14px; color: var(--muted); }

/* log */
.adm-log { display: flex; flex-direction: column; gap: 6px; }
.adm-log-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.adm-log-t { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.adm-log-who { margin-left: auto; color: var(--muted); font-size: 12px; }

/* modal */
.adm-modal .box { display: flex; flex-direction: column; gap: 10px; }
.adm-modal .box h3 { margin: 0; }
.adm-modal .box p { margin: 0; }
.adm-modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }

/* poker */
.adm-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.adm-pk { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.adm-pk-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.adm-pk-head span { color: var(--muted); font-size: 13px; text-align: right; }
.adm-pk-seats { display: flex; flex-direction: column; gap: 6px; }
.adm-pk-seat { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 10px; padding: 8px 10px; }
.adm-pk-who { flex: 1; min-width: 0; }
.adm-pk-who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-pk-who small { color: var(--muted); }
.adm-net { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--win); }
.adm-net.poor { background: var(--gold); }
.adm-net.off { background: var(--lose); }
.adm-kick { height: 34px; padding: 0 12px; font-size: 13px; }

/* admin: multi-account hints */
.adm-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.adm-badge.multi { background: #ff9f1a22; color: #ffb547; border: 1px solid #ffb54755; }
.adm-multi { margin: 12px 0; padding: 12px; border-radius: 12px; background: #ff9f1a12; border: 1px solid #ffb54744; display: flex; flex-direction: column; gap: 6px; }
.adm-multi b { color: #ffb547; } .adm-multi span { color: var(--muted); font-size: 13px; }
.adm-links { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-link { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-weight: 700; font-size: 13px; text-align: left; }
.adm-link small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; }
.adm-link.sm { padding: 3px 8px; font-size: 12px; }
.adm-link:hover { border-color: var(--gold); }
.adm-weak { color: var(--muted); font-size: 13px; margin: 8px 0; }

/* admin: sign-ins and weak similarity */
.adm-badge.similar { background: #8693b022; color: #b8c2db; border: 1px solid #8693b055; }
.adm-similar, .adm-logins { margin: 12px 0; padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.adm-similar b small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.adm-sim-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); }
.adm-sim-row em { margin-left: auto; font-style: normal; font-weight: 800; min-width: 22px; text-align: center; border-radius: 6px; background: #ffffff10; padding: 1px 6px; }
.adm-sim-row.hi em { background: #ffb54733; color: #ffb547; }
.adm-logins small { display: inline-block; width: 78px; color: var(--muted); }
.adm-logins details summary { cursor: pointer; color: var(--muted); }
.adm-logins details div { padding: 3px 0 0 78px; }

/* boot: skeletons in the header until we know who you are (no "Войти"/guest balance flash) */
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.booting #balance, .booting #bonus > *, .booting #rankName { color: transparent !important; }
.booting #balance, .booting #bonus, .booting #account:empty, .booting #rank {
  background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%) 0 0 / 200% 100%; animation: skel 1.2s linear infinite; }
.booting #balance { border-radius: 6px; min-width: 64px; }
.booting #account:empty { min-width: 84px; border-color: var(--line); }
.booting #account { pointer-events: none; }
.booting #account:not(:empty) { border-color: var(--line); background: var(--card); color: var(--text); }
@media (prefers-reduced-motion: reduce) { .booting * { animation: none !important; } }

/* ================= durak ================= */
.dk-wrap { display: flex; flex-direction: column; gap: 12px; }
.dk-head { flex-wrap: wrap; }
.dk-head .dk-rules-btn { margin-left: auto; }
.dk-title { display: flex; flex-direction: column; line-height: 1.15; }
.dk-sub { color: var(--muted); font-size: 13px; }
.dk-intro { color: var(--muted); margin: -4px 0 0; }
.dk-create { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.dk-create .btn-primary { height: 44px; padding: 0 22px; }
.dk-create .seg button { font-size: 13px; }
@media (max-width: 760px) { .dk-create { grid-template-columns: minmax(0, 1fr); } }
.dk-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.dk-room { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.dk-room .btn { text-align: center; text-decoration: none; display: grid; place-items: center; height: 40px; }
.dk-room.playing { opacity: .8; }
.dk-room-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dk-room-stake { color: var(--gold); font-size: 17px; }
.dk-room-stake.free { color: var(--win); }
.dk-room-status { font-size: 12px; color: var(--muted); }
.dk-room.playing .dk-room-status { color: var(--gold); }
.dk-room-mid { display: flex; align-items: center; gap: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dk-dots { display: flex; gap: 4px; }
.dk-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dk-dots i.on { background: var(--gold); }
.dk-room-host { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 28px 12px; background: var(--bg2); border: 1px dashed var(--line); border-radius: 16px; }

/* cards: 36-card deck */
.dk-card { width: 58px; height: 82px; border-radius: 8px; background: #fbfaf6; color: #151a27; position: relative; box-shadow: 0 3px 10px #0007; flex: none; user-select: none; }
.dk-card b { position: absolute; left: 5px; top: 3px; font-size: 17px; line-height: 1; font-weight: 800; }
.dk-card i { position: absolute; left: 6px; top: 22px; font-style: normal; font-size: 14px; line-height: 1; }
.dk-card em { position: absolute; right: 6px; bottom: 4px; font-style: normal; font-size: 28px; line-height: 1; }
.dk-card.red { color: #c22a3c; }
.dk-card.back { background: repeating-linear-gradient(45deg, #1d3270 0 5px, #243c85 5px 10px); box-shadow: 0 3px 10px #0007, inset 0 0 0 3px #fbfaf6, inset 0 0 0 4px #c9a14a; }
.dk-card.back > * { display: none; }
.dk-card.sm { width: 38px; height: 54px; border-radius: 6px; }
.dk-card.sm b { font-size: 13px; left: 3px; top: 2px; } .dk-card.sm i { font-size: 10px; left: 4px; top: 16px; } .dk-card.sm em { font-size: 17px; right: 3px; bottom: 2px; }
.dk-card.xs { width: 22px; height: 32px; border-radius: 4px; box-shadow: 0 2px 4px #0006, inset 0 0 0 2px #fbfaf6; }

/* table */
.dk-felt { position: relative; height: clamp(440px, 60vh, 600px); border-radius: 24px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; }
.dk-oval { position: absolute; inset: 14% 11% 16%; border-radius: 999px; background: radial-gradient(120% 100% at 50% 30%, #1d7a5b, #11503c 55%, #0b3529); box-shadow: inset 0 0 0 10px #5a3a1f, inset 0 0 0 13px #c9a14a55, 0 20px 50px #0008; }
.dk-center { position: absolute; inset: 22% 15% 25%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.dk-deck, .dk-discard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 70px; }
.dk-deck { min-height: 96px; justify-content: center; }
.dk-trump { position: absolute; left: -22px; top: 50%; margin-top: -48px; transform: rotate(-90deg); z-index: 0; }
.dk-deck .dk-stack { z-index: 1; }
.dk-deck { padding-left: 18px; }
.dk-stack { position: relative; width: 58px; height: 82px; }
.dk-stack .dk-card { position: absolute; left: 0; top: 0; }
.dk-stack .d2 { transform: translate(3px, -3px); }
.dk-stack.dis .r1 { transform: rotate(-8deg); } .dk-stack.dis .r2 { transform: rotate(11deg) translate(4px, -2px); }
.dk-deckinfo { font-size: 11px; color: #ffffffb0; font-weight: 700; text-align: center; white-space: nowrap; background: #0b111eaa; padding: 2px 7px; border-radius: 999px; }
.dk-deckinfo b { color: #fff; }
.dk-suit { font-size: 14px; color: #fff; } .dk-suit.red { color: #ff6b7d; }
.dk-table { display: grid; place-items: center; min-height: 100px; }
.dk-pairs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; max-width: 420px; }
.dk-pair { position: relative; width: 74px; height: 100px; border-radius: 10px; transition: box-shadow .15s, background .15s; }
.dk-pair .atk { position: absolute; left: 0; top: 0; }
.dk-pair .def { position: absolute; left: 14px; top: 16px; transform: rotate(8deg); }
.dk-pair.target { background: #f2c14e22; box-shadow: 0 0 0 2px var(--gold); cursor: pointer; animation: dkPulse 1s ease-in-out infinite; }
@keyframes dkPulse { 50% { box-shadow: 0 0 0 4px #f2c14e66; } }
.dk-tablehint, .dk-waiting { text-align: center; color: #ffffffcc; font-weight: 700; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.dk-waiting b { font-size: 17px; letter-spacing: .5px; }
.dk-waiting span, .dk-waiting small { color: #ffffffa0; font-weight: 600; font-size: 13px; }
.dk-count-ring { position: relative; width: 104px; height: 104px; display: grid; place-items: center; }
.dk-count-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.dk-count-ring circle { fill: none; stroke: #ffffff22; stroke-width: 3; }
.dk-count-ring circle.p { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 0; }
.dk-count-ring b { font-size: 34px; line-height: 1; }
.dk-count-ring span { position: absolute; bottom: -20px; font-size: 11px; color: #ffffffb0; white-space: nowrap; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

/* seats */
.dk-seat { position: absolute; transform: translate(-50%, -50%); z-index: 3; display: flex; flex-direction: column; align-items: center; width: 140px; }
.dk-seat.empty { width: auto; color: #ffffff55; font-size: 13px; }
.dk-seat.empty .btn { height: 34px; padding: 0 12px; font-size: 13px; }
.dk-seat.gone { opacity: .55; }
.dk-fan { position: relative; height: 34px; width: 100%; display: flex; justify-content: center; margin-bottom: -6px; }
.dk-fan .dk-card { position: absolute; top: 0; transform: translateX(calc(var(--k) * 9px)) rotate(calc(var(--k) * 6deg)); transform-origin: 50% 120%; }
.dk-count { position: absolute; right: 22px; top: -4px; z-index: 2; background: var(--gold); color: #221800; font-size: 11px; font-weight: 900; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.dk-plate { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px 6px 6px; border-radius: 999px; background: #0b111ef2; border: 1px solid var(--line); box-shadow: 0 6px 18px #0007; }
.dk-seat.acting .dk-plate { border-color: var(--gold); box-shadow: 0 0 0 3px #f2c14e33, 0 6px 18px #0007; }
.dk-seat.def .dk-plate { border-color: #3e6dff99; }
.dk-ava { position: relative; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; background: linear-gradient(135deg, #3e6dff, #1a2a52); }
.dk-net { position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #0b111e; background: #ffb547; font-size: 8px; display: grid; place-items: center; color: #fff; }
.dk-net.off { background: #6b7590; }
.dk-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.dk-who b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-who span { font-size: 11px; color: var(--gold); font-weight: 700; white-space: nowrap; }
.dk-badges { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; justify-content: center; }
.dk-badge { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: #0b111ecc; border: 1px solid var(--line); color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.dk-badge.ready { color: var(--win); border-color: #2fd27a55; }
.dk-badge.bot { color: #9fb4ff; border-color: #3e6dff55; }
.dk-badge.out { color: var(--lose); border-color: #ff546855; }
.dk-badge.done { color: var(--gold); border-color: #f2c14e55; }
.dk-timer { width: 80%; height: 4px; border-radius: 2px; background: #ffffff1a; overflow: hidden; margin-top: 4px; }
.dk-timer i, .dk-mybar i { display: block; height: 100%; width: 100%; background: var(--gold); }
.dk-timer i.low, .dk-mybar i.low { background: var(--lose); }

/* my hand and actions */
.dk-me { background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; transition: border-color .2s, box-shadow .2s; }
.dk-me.myturn { border-color: #f2c14e88; box-shadow: 0 0 0 3px #f2c14e1f; animation: dkTurn 1.6s ease-in-out infinite; }
/* one-off flash when the turn comes to you (MC.yourTurn); the steady pulse above takes over afterwards */
.pk-me.turn-flash, .dk-me.turn-flash { animation: turnFlash .9s ease-out; }
@keyframes turnFlash { 0% { box-shadow: 0 0 0 0 #f2c14ecc; transform: scale(1.02); } 100% { box-shadow: 0 0 0 16px #f2c14e00; transform: none; } }
@keyframes dkTurn { 50% { box-shadow: 0 0 0 6px #f2c14e14; } }
.dk-status { display: flex; align-items: center; gap: 12px; min-height: 22px; }
.dk-hint { font-weight: 700; font-size: 14px; }
.dk-mybar { flex: 1; height: 5px; border-radius: 3px; background: #ffffff12; overflow: hidden; visibility: hidden; }
.dk-mybar.on { visibility: visible; }
.dk-hand { display: flex; justify-content: center; align-items: flex-end; min-height: 96px; padding-top: 10px; }
.dk-hand .dk-card { cursor: pointer; transition: transform .15s, filter .15s, opacity .15s; }
.dk-hand .dk-card.ok:hover, .dk-hand .dk-card.sel { transform: translateY(-12px); }
.dk-hand .dk-card.ok { box-shadow: 0 3px 10px #0007, 0 0 0 2px #2fd27a99; }
.dk-hand .dk-card.sel { box-shadow: 0 3px 10px #0007, 0 0 0 3px var(--gold); z-index: 2; }
.dk-hand .dk-card.dim { filter: brightness(.6) saturate(.6); cursor: default; }
.dk-hand .dk-card.trumpc::after { content: ''; position: absolute; right: 5px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.dk-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.dk-actions:empty { display: none; }
.dk-actions .btn { min-width: 140px; height: 48px; font-size: 16px; }

/* result, offline cover */
.dk-overlay { position: absolute; inset: 0; z-index: 10; display: none; place-items: center; background: #0b111eb3; backdrop-filter: blur(2px); }
.dk-overlay.on { display: grid; }
.dk-result { background: var(--bg2); border: 1px solid var(--line); border-radius: 20px; padding: 22px; width: min(360px, 92%); text-align: center; animation: dkPop .3s cubic-bezier(.2,.8,.3,1.2); }
@keyframes dkPop { from { transform: scale(.85); opacity: 0; } }
.dk-result-title { font-size: 24px; font-weight: 800; }
.dk-result-sub { color: var(--muted); margin: 4px 0 14px; font-size: 14px; }
.dk-result-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; text-align: left; }
.dk-result-rows div { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: var(--card); font-variant-numeric: tabular-nums; }
.dk-result-rows div.durak { background: #ff546818; }
.dk-result-rows div.me span { font-weight: 800; }
.dk-result-rows .w { color: var(--win); } .dk-result-rows .l { color: var(--lose); }
.dk-result-btns { display: flex; gap: 8px; justify-content: center; }
.dk-result-btns .btn { flex: 1; height: 46px; text-decoration: none; display: grid; place-items: center; }
.dk-hand:empty { min-height: 0; padding: 0; }
.dk-offline-cover { position: absolute; inset: 0; z-index: 20; display: none; place-items: center; background: #0b111ecc; text-align: center; }
.dk-offline-cover div { display: flex; flex-direction: column; gap: 6px; }
.dk-offline-cover small { color: var(--muted); }
.dk-felt.offline .dk-offline-cover { display: grid; }
.dk-confirm .box p:empty { display: none; }
.dk-confirm-btns { display: flex; gap: 8px; }
.dk-confirm-btns .btn { flex: 1; }
.dk-danger { background: var(--lose); color: #fff; border: 0; }

/* rules drawer */
.dk-rules-wrap { justify-content: flex-end; align-items: stretch; padding: 0; }
.dk-rules { width: min(440px, 100%); height: 100%; overflow-y: auto; background: var(--bg2); border-left: 1px solid var(--line); padding: 18px; transform: translateX(100%); transition: transform .25s ease; }
.dk-rules-wrap.on .dk-rules { transform: none; }
.dk-rules-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.dk-rules-head h3 { margin: 0; }
.dk-rules section { margin-top: 14px; }
.dk-rules h4 { margin: 0 0 4px; color: var(--gold); font-size: 14px; }
.dk-rules p { margin: 0; color: #c9d1e4; font-size: 14px; line-height: 1.45; }
.dk-ex { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.dk-ex-cards { display: flex; gap: 4px; }

@media (max-width: 640px) {
  .dk-felt { height: 520px; border-radius: 18px; }
  .dk-oval { inset: 13% 6% 15%; }
  .dk-center { inset: 21% 8% 24%; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 6px; }
  .dk-deck { grid-column: 1; grid-row: 1; flex-direction: row; min-height: 0; gap: 6px; }
  .dk-discard { grid-column: 2; grid-row: 1; flex-direction: row; justify-content: flex-end; }
  .dk-table { grid-column: 1 / -1; grid-row: 2; min-height: 0; }
  .dk-deck .dk-stack, .dk-discard .dk-stack, .dk-trump { display: none; }
  .dk-card { width: 46px; height: 66px; border-radius: 6px; }
  .dk-card b { font-size: 14px; } .dk-card i { font-size: 11px; top: 18px; } .dk-card em { font-size: 21px; }
  .dk-pair { width: 58px; height: 82px; }
  .dk-pair .def { left: 10px; top: 13px; }
  .dk-pairs { gap: 6px 10px; max-width: 150px; } /* two pairs per row: stays clear of the side seats */
  .dk-tablehint { display: none; } /* the status line under the table says the same */
  .dk-waiting { max-width: 128px; } .dk-waiting b { font-size: 15px; } .dk-waiting span, .dk-waiting small { font-size: 12px; }
  .dk-seat { width: 100px; }
  .dk-plate { padding: 4px 8px 4px 4px; gap: 6px; }
  .dk-ava { width: 26px; height: 26px; font-size: 13px; }
  .dk-hand { min-height: 80px; }
  .dk-hand .dk-card { width: 52px; height: 74px; }
  .dk-actions .btn { flex: 1; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dk-pair.target, .dk-me.myturn, .dk-result, .pk-me.turn-flash, .dk-me.turn-flash { animation: none; }
  .dk-rules { transition: none; }
}

/* two-factor sign-in and security settings */
.tf-step { display: flex; flex-direction: column; gap: 10px; }
.tf-step > p { margin: 0 0 4px; }
.tf-step .tf-pk, .tf-step .tf-use-rec { width: 100%; }
.tf-box { width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow: auto; }
.tf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tf-head h3 { margin: 0; }
.tf-lead { color: var(--muted); margin: 8px 0 14px; }
.tf-on { color: var(--win); } .tf-off { color: var(--muted); }
.tf-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.tf-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tf-row small, .tf-keys small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.tf-row .btn { flex: none; height: 40px; }
.tf-keys { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tf-keys li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.tf-keys b { word-break: break-word; }
.tf-note { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.tf-qr { width: 200px; height: 200px; margin: 0 auto 8px; background: #fff; border-radius: 12px; padding: 8px; }
.tf-qr svg { width: 100%; height: 100%; display: block; }
.tf-uri { display: block; text-align: center; margin-bottom: 10px; }
.tf-secret { text-align: center; margin-bottom: 12px; }
.tf-secret small { display: block; color: var(--muted); font-size: 12px; }
.tf-secret code { font-family: var(--mono); font-size: 14px; letter-spacing: 1px; word-break: break-all; user-select: all; }
.tf-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; margin: 0 0 14px; padding-left: 24px; }
.tf-codes code { font-family: var(--mono); font-size: 15px; user-select: all; }
.tf-box .btn-row { margin-bottom: 10px; }
.tf-box .btn-primary.tf-ok { width: 100%; }
@media (max-width: 420px) { .tf-row { flex-direction: column; align-items: stretch; } .tf-codes { grid-template-columns: 1fr 1fr; padding-left: 20px; } }
