@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/vazirmatn.woff2') format('woff2-variations'), url('/fonts/vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0b1020;
  --bg2: #10172b;
  --panel: #151d33;
  --panel2: #1c2642;
  --line: #27324f;
  --text: #eef1f8;
  --muted: #8f9bb9;
  --gold: #f4c24f;
  --gold2: #d99a1e;
  --green: #2fd17a;
  --red: #ff5a5f;
  --blue: #4d8dff;
  --felt1: #17905a;
  --felt2: #0b5534;
  --felt3: #073a23;
  --rail1: #3b2617;
  --rail2: #1d120a;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
  background: radial-gradient(120% 80% at 50% -10%, #1a2446 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold); text-decoration: none; }
.hidden { display: none !important; }
.grow { flex: 1; }
.row { display: flex; align-items: center; }
.gap { gap: 8px; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.boot { display: grid; place-items: center; height: 100vh; font-size: 56px; color: var(--gold); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- buttons & inputs ---------- */
.btn {
  border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 700; font-size: 15px;
  background: var(--panel2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .08s, filter .15s; text-align: center;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn.primary { background: linear-gradient(180deg, #ffd56b, var(--gold2)); color: #2b1b00; }
.btn.danger { background: linear-gradient(180deg, #ff6b6f, #d63b40); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { display: flex; width: 100%; margin-top: 10px; }
.ib { border: 0; background: rgba(255,255,255,.06); width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; font-size: 18px; color: var(--text); flex: none; }
.link { border: 0; background: none; color: var(--gold); padding: 0 4px; font-weight: 700; }
input, select, textarea {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold2); }
input[type=checkbox] { width: auto; accent-color: var(--gold); }
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; padding: 0; border: 0; height: 36px; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--gold2), var(--gold)); }
input[type=range]::-moz-range-track { height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--gold2), var(--gold)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: #fff; margin-top: -11px; box-shadow: 0 2px 8px rgba(0,0,0,.5); border: 3px solid var(--gold2); }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 3px solid var(--gold2); }

/* ---------- toast & sheet ---------- */
.toasts { position: fixed; top: calc(10px + var(--safe-t)); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 100; pointer-events: none; padding: 0 12px; }
.toast { background: rgba(20,28,50,.96); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; max-width: 460px; box-shadow: 0 10px 30px rgba(0,0,0,.4); transform: translateY(-20px); opacity: 0; transition: .25s; font-size: 14px; }
.toast.in { transform: none; opacity: 1; }
.toast.error { border-color: #6b2a2d; background: rgba(60,16,20,.96); }
.toast.win { border-color: #6b5a1d; background: rgba(54,42,10,.96); color: #ffe39a; }
.sheet-back { position: fixed; inset: 0; background: rgba(3,6,14,.6); z-index: 50; display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; backdrop-filter: blur(2px); }
.sheet-back.in { opacity: 1; }
.sheet { width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; background: var(--panel); border-radius: 22px 22px 0 0; padding: 6px 16px calc(18px + var(--safe-b)); transform: translateY(40px); transition: transform .22s; border: 1px solid var(--line); border-bottom: 0; }
.sheet.wide { max-width: 760px; }
.sheet-back.in .sheet { transform: none; }
.sheet-grip { width: 42px; height: 5px; border-radius: 4px; background: var(--line); margin: 6px auto 4px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 10px; }
.sheet-head b { font-size: 17px; }
.sheet-text { color: #cfd6e8; margin: 4px 0 12px; }
.sheet-note { color: var(--muted); font-size: 13px; margin: 8px 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 14px; }
.kv span { color: var(--muted); }
.kv b { text-align: left; }
.kv.gold b, .kv.gold span { color: var(--gold); }
.buyin-val { text-align: center; margin: 14px 0 0; }
.big-num { font-size: 34px; color: var(--gold); }
.commit { margin-top: 10px; }
.commit small { color: var(--muted); display: block; margin-bottom: 6px; }
.commit code { display: block; direction: ltr; text-align: left; font-size: 11px; word-break: break-all; background: var(--bg2); padding: 8px; border-radius: 8px; color: #b8c4e0; }
.toggles { margin-top: 14px; flex-wrap: wrap; }
.tg { display: inline-flex; gap: 6px; align-items: center; background: var(--bg2); padding: 8px 12px; border-radius: 10px; font-size: 14px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 18px calc(24px + var(--safe-b)); }
.auth-logo { text-align: center; margin-bottom: 18px; }
.auth-logo h1 { margin: 6px 0 0; font-size: 34px; font-weight: 900; letter-spacing: -.5px; }
.auth-logo p { margin: 0; color: var(--muted); }
.logo-cards { display: flex; justify-content: center; gap: 0; height: 92px; }
.lc { display: grid; place-items: center; width: 62px; height: 86px; border-radius: 10px; background: #fff; font-size: 26px; font-weight: 800; box-shadow: 0 10px 24px rgba(0,0,0,.45); direction: ltr; font-family: Georgia, serif; }
.lc.s { color: #111; transform: rotate(-9deg) translateX(8px); }
.lc.h { color: #d81b28; transform: rotate(8deg) translateX(-8px) translateY(4px); }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 20px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.auth-card h2 { margin: 0 0 12px; font-size: 18px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.form-err { color: var(--red); font-size: 14px; min-height: 0; }
.auth-switch { margin-top: 14px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- pages ---------- */
.page { max-width: 640px; margin: 0 auto; padding: 0 14px calc(28px + var(--safe-b)); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--safe-t)) 0 10px; background: linear-gradient(var(--bg) 70%, transparent); }
.brand { font-weight: 900; font-size: 20px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.brand-suit { color: var(--gold); font-size: 24px; }
.wallet { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; color: var(--text); }
.wallet b { color: var(--gold); }
.chip { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, #fff 0 22%, transparent 23%), repeating-conic-gradient(#e8a317 0 30deg, #fff3c4 30deg 45deg); border: 2px solid #b07a0c; flex: none; }
.notice { background: rgba(244,194,79,.1); border: 1px solid rgba(244,194,79,.3); color: #ffe39a; padding: 10px 14px; border-radius: 12px; margin: 6px 0 10px; font-size: 14px; white-space: pre-line; }
.admin-link { display: block; text-align: left; font-size: 13px; margin: 0 0 8px; }
.seat-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: linear-gradient(90deg, rgba(47,209,122,.15), rgba(47,209,122,.05)); border: 1px solid rgba(47,209,122,.35); padding: 10px 12px; border-radius: 14px; margin-bottom: 10px; font-size: 14px; }
.tabs { display: flex; gap: 6px; background: var(--panel); border: 1px solid var(--line); padding: 4px; border-radius: 14px; margin-bottom: 12px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: 10px; font-weight: 700; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; }
.tabs button small { background: rgba(255,255,255,.08); border-radius: 8px; padding: 0 7px; font-size: 12px; }
.tabs button.on { background: var(--panel2); color: var(--text); box-shadow: inset 0 -2px 0 var(--gold); }
.list { display: flex; flex-direction: column; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.tcard { width: 100%; text-align: right; background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; transition: transform .08s; }
.tcard:active { transform: scale(.985); }
.tcard.mine { border-color: rgba(244,194,79,.5); }
.tc-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tc-name { font-size: 16px; }
.badge { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,.08); }
.badge.g-holdem { background: rgba(77,141,255,.18); color: #9cc0ff; }
.badge.g-omaha5 { background: rgba(190,110,255,.18); color: #d6a9ff; }
.badge.lim { direction: ltr; }
.live { margin-inline-start: auto; font-size: 11px; color: var(--green); display: flex; align-items: center; gap: 4px; }
.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(47,209,122,.2); }
.tc-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tc-body div { background: rgba(0,0,0,.18); border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; }
.tc-body small { color: var(--muted); font-size: 11px; }
.tc-body b { font-size: 15px; }
.tc-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tc-foot .muted { flex: 1; font-size: 12px; }
.dots { display: flex; gap: 4px; flex: 1; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.1); }
.dots i.p { background: var(--green); }
.dots i.b { background: #7d8db3; }
.bots { font-size: 12px; color: var(--muted); }
.progress { height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold2), var(--gold)); }
.page h3 { font-size: 15px; color: var(--muted); margin: 20px 0 8px; }
.acc-card { background: linear-gradient(160deg, #1f2a4d, var(--panel)); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.acc-name { display: flex; align-items: center; gap: 12px; }
.acc-name small { display: block; color: var(--muted); }
.acc-chips { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,.2); padding: 10px 12px; border-radius: 12px; }
.acc-chips b { display: flex; align-items: center; gap: 6px; font-size: 20px; color: var(--gold); }
.ledger { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.lrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.05); }
.lrow:last-child { border-bottom: 0; }
.lrow small { display: block; color: var(--muted); font-size: 12px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.pw-form { display: flex; flex-direction: column; gap: 8px; }

.ava { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(160deg, #3a4a78, #1d2746); display: grid; place-items: center; font-weight: 800; font-size: 18px; position: relative; border: 2px solid rgba(255,255,255,.18); }
.ava.big { width: 54px; height: 54px; font-size: 22px; }

/* ================= TABLE ================= */
body.in-table { overflow: hidden; background: #070b16; }
.tv {
  position: fixed; inset: 0; display: flex; flex-direction: column; max-width: 620px; margin: 0 auto;
  background: radial-gradient(130% 70% at 50% 40%, #13203f 0%, #070b16 70%);
  padding-top: var(--safe-t); user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.tv-top { display: flex; align-items: center; gap: 8px; padding: 6px 10px; height: 52px; flex: none; }
.tv-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.tv-title b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-title small { color: var(--muted); font-size: 12px; }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.conn-dot.bad { background: var(--red); animation: pulse .8s infinite; }
.tv-hud { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; padding: 0 10px 4px; flex: none; }
.hud-pill { font-size: 12px; background: rgba(255,255,255,.07); border-radius: 999px; padding: 2px 10px; }
.hud-pill.admin { background: rgba(244,194,79,.15); color: var(--gold); }
.hud-warn { font-size: 12px; background: rgba(255,90,95,.14); color: #ffb0b2; border-radius: 999px; padding: 2px 10px; }

.tv-stage { position: relative; flex: 1; min-height: 0; direction: ltr; --bw: 46px; --sw: 64px; }
.felt {
  position: absolute; border-radius: 200px;
  background:
    radial-gradient(70% 60% at 50% 45%, var(--felt1) 0%, var(--felt2) 62%, var(--felt3) 100%);
  box-shadow:
    0 0 0 9px var(--rail1), 0 0 0 11px #120b05, 0 0 0 13px #4b3220,
    0 18px 40px rgba(0,0,0,.6), inset 0 0 40px rgba(0,0,0,.45);
}
.felt-line { position: absolute; inset: 14px; border-radius: inherit; border: 1.5px solid rgba(255,255,255,.07); }
.felt-brand { position: absolute; left: 0; right: 0; top: 56%; text-align: center; color: rgba(255,255,255,.07); font-size: 22px; letter-spacing: 10px; }
.center { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; z-index: 2; }
.pot { background: rgba(0,0,0,.35); border-radius: 999px; padding: 2px 14px; font-size: 13px; direction: rtl; white-space: nowrap; }
.pot b { color: var(--gold); font-size: 15px; }
.board { display: flex; gap: 4px; min-height: calc(var(--bw) * 1.4); }
.board .card { --cw: var(--bw); }
.center-msg { direction: rtl; text-align: center; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.center-msg .res { background: rgba(0,0,0,.45); border-radius: 10px; padding: 2px 10px; }
.center-msg .res b { color: var(--gold); }
.center-msg .wait { color: rgba(255,255,255,.65); background: rgba(0,0,0,.25); padding: 4px 12px; border-radius: 999px; }

/* cards */
.card {
  --cw: 40px;
  width: var(--cw); height: calc(var(--cw) * 1.4); border-radius: calc(var(--cw) * .13);
  background: linear-gradient(180deg, #ffffff, #eef0f4); position: relative; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: 'Vazirmatn', 'Segoe UI', Roboto, Arial, sans-serif; font-weight: 800; line-height: .95; direction: ltr;
  box-shadow: 0 2px 6px rgba(0,0,0,.45), inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .2s, filter .2s;
}
.card .r { font-size: calc(var(--cw) * .5); letter-spacing: -1px; }
.card .s { font-size: calc(var(--cw) * .46); margin-top: calc(var(--cw) * .02); }
.card.s-s { color: #13151a; }
.card.s-h { color: #dc1f2e; }
.card.s-d { color: #1d63e0; }
.card.s-c { color: #11873e; }
.card.back {
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.25) 0 18%, transparent 19%),
    repeating-linear-gradient(45deg, #9b1f33 0 3px, #b52a40 3px 6px);
  border: 2px solid #f6f6f6;
}
.card.slot { background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.12); }
.card.hl { transform: translateY(-5px); box-shadow: 0 0 0 2px var(--gold), 0 6px 16px rgba(244,194,79,.4); }
.card.dim { filter: brightness(.5) saturate(.6); }
.card.deal { animation: deal .35s ease-out both; }
@keyframes deal { from { transform: translateY(-14px) rotateY(80deg) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }

/* seats */
.seats { position: absolute; inset: 0; }
.seat { position: absolute; transform: translate(-50%, -50%); width: var(--sw); display: flex; flex-direction: column; align-items: center; z-index: 3; direction: rtl; transition: opacity .2s; }
.seat .ava { width: calc(var(--sw) * .74); height: calc(var(--sw) * .74); font-size: calc(var(--sw) * .3); z-index: 2; }
.seat .ava.botava { background: linear-gradient(160deg, #5b4a8a, #2c2447); }
.seat .ava.ghost { background: rgba(255,255,255,.04); border-style: dashed; }
.seat .ring { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); pointer-events: none; display: none; }
.seat .ring circle { fill: none; stroke: #3ddc84; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 176; stroke-dashoffset: 0; }
.seat.turn .ring { display: block; }
.seat.turn .ava { box-shadow: 0 0 0 3px rgba(61,220,132,.25), 0 0 22px rgba(61,220,132,.35); }
.seat .plate { margin-top: -8px; background: rgba(6,10,20,.88); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 8px 6px 3px; width: calc(var(--sw) + 14px); text-align: center; line-height: 1.2; z-index: 1; }
.seat .nm { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #dfe5f3; }
.seat .nm em { display: block; font-style: normal; font-size: 9px; color: #9aa7c8; }
.seat .nm em.strong { color: #ffb86b; }
.seat .st { font-size: 13px; font-weight: 800; color: var(--gold); }
.seat.me .plate { border-color: rgba(244,194,79,.55); }
.seat.folded { opacity: .45; }
.seat.away .ava { filter: grayscale(1) brightness(.7); }
.seat.winner .plate { border-color: var(--gold); box-shadow: 0 0 18px rgba(244,194,79,.45); }
.seat.talk .ava { box-shadow: 0 0 0 3px #3ddc84, 0 0 18px rgba(61,220,132,.7); }
.seat .spk { position: absolute; top: -4px; right: -4px; width: 16px; height: 16px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 3px rgba(61,220,132,.3); animation: pulse .7s infinite; }
.seat .tag { position: absolute; top: 100%; margin-top: 3px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.65); border-radius: 999px; padding: 1px 9px; white-space: nowrap; color: #dfe5f3; z-index: 4; }
.seat[data-top="1"] .tag { top: auto; bottom: 100%; margin: 0 0 3px; }
.seat .tag.win { background: linear-gradient(180deg, #ffd56b, var(--gold2)); color: #2b1b00; font-size: 13px; animation: pop .4s; }
.seat .tag.hand { background: rgba(244,194,79,.2); color: #ffe39a; }
.seat .tag.a-fold { color: #9aa3b8; }
.seat .tag.a-raise, .seat .tag.a-bet { background: rgba(255,140,60,.85); color: #fff; }
.seat .tag.a-allin { background: rgba(255,60,80,.9); color: #fff; }
.seat .tag.a-call, .seat .tag.a-check { background: rgba(77,141,255,.75); color: #fff; }
.seat .handname { position: absolute; bottom: 100%; margin-bottom: 4px; font-size: 11px; color: #ffe39a; background: rgba(0,0,0,.7); padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.seat .mini { display: flex; position: absolute; top: 2%; left: 70%; z-index: 0; }
.seat[data-side="r"] .mini { left: auto; right: 70%; }
.seat .mini .card { --cw: calc(var(--sw) * .36); margin-inline: calc(var(--sw) * -.07); }
.seat .mini.n5 .card { --cw: calc(var(--sw) * .3); margin-inline: calc(var(--sw) * -.09); }
.seat .mini.open { top: -6%; z-index: 5; }
.seat .mini.open .card { --cw: calc(var(--sw) * .42); margin-inline: calc(var(--sw) * -.04); }
.seat .mini.open.n5 .card { --cw: calc(var(--sw) * .36); margin-inline: calc(var(--sw) * -.1); }
.seat .mini:not(.open) .card:nth-child(odd) { transform: rotate(-6deg); }
.seat .mini:not(.open) .card:nth-child(even) { transform: rotate(6deg); }
.seat.empty .ava { opacity: .5; }
.sit-btn { width: calc(var(--sw) * .86); height: calc(var(--sw) * .86); border-radius: 50%; border: 2px dashed rgba(244,194,79,.55); background: rgba(244,194,79,.08); color: var(--gold); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; font-size: 11px; font-weight: 700; }
.sit-btn b { font-size: 20px; }
.sit-btn:active { background: rgba(244,194,79,.25); }
.bet { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 4px; background: rgba(0,0,0,.5); border-radius: 999px; padding: 1px 8px 1px 3px; font-size: 12px; font-weight: 800; z-index: 2; white-space: nowrap; transition: left .25s, top .25s; }
.bet .chip { width: 14px; height: 14px; border-width: 1.5px; }
.dealer { position: absolute; transform: translate(-50%, -50%); width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #111; font-size: 12px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.5); z-index: 2; transition: left .4s, top .4s; font-family: Arial, sans-serif; }

/* hero bar */
.tv-hero { flex: none; display: flex; align-items: center; gap: 12px; padding: 6px 14px 2px; min-height: 96px; }
.hero-cards { display: flex; direction: ltr; padding-top: 6px; }
.hero-cards .card { --cw: 62px; margin-inline-end: -8px; }
.hero-cards .card:nth-child(1) { transform: rotate(-5deg); }
.hero-cards .card:nth-child(2) { transform: rotate(3deg) translateY(2px); }
.hero-cards.n5 .card { --cw: min(54px, 13.5vw); margin-inline-end: -16px; }
.hero-cards.n5 .card:nth-child(1) { transform: rotate(-8deg) translateY(4px); }
.hero-cards.n5 .card:nth-child(2) { transform: rotate(-4deg) translateY(1px); }
.hero-cards.n5 .card:nth-child(3) { transform: none; }
.hero-cards.n5 .card:nth-child(4) { transform: rotate(4deg) translateY(1px); }
.hero-cards.n5 .card:nth-child(5) { transform: rotate(8deg) translateY(4px); }
.hero-cards .card.hl { transform: translateY(-8px) !important; }
.hero-cards.folded .card { filter: brightness(.4) saturate(.4); }
.hero-info { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.made { background: rgba(244,194,79,.16); color: #ffe39a; border: 1px solid rgba(244,194,79,.35); border-radius: 999px; padding: 1px 12px; font-weight: 700; font-size: 14px; }
.hero-status { color: var(--muted); font-size: 13px; }
.hero-stack small { color: var(--muted); font-size: 12px; margin-inline-end: 6px; }
.hero-stack b { color: var(--gold); font-size: 17px; }

/* my turn timer */
.my-timer { height: 4px; margin: 0 14px; border-radius: 4px; background: transparent; overflow: hidden; flex: none; }
.my-timer.on { background: rgba(255,255,255,.08); }
.my-timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold2), var(--green)); transform-origin: right; transform: scaleX(0); }
.my-timer.on i { transform: scaleX(1); }

/* actions */
.tv-actions { flex: none; position: relative; padding: 8px 10px calc(10px + var(--safe-b)); min-height: 72px; display: flex; flex-direction: column; justify-content: flex-end; }
.act-row { display: flex; gap: 8px; align-items: stretch; }
.act { flex: 1; border: 0; border-radius: 14px; padding: 14px 6px; font-weight: 800; font-size: 16px; color: #fff; min-height: 54px; box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: transform .06s; }
.act:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.act.fold { background: linear-gradient(180deg, #4a5470, #353d55); }
.act.call { background: linear-gradient(180deg, #3b82f6, #2459c9); }
.act.raise { background: linear-gradient(180deg, #ffb347, #e07a10); }
.act.raise.on { outline: 2px solid #fff3; }
.act.confirm { width: 100%; flex: none; margin-top: 8px; }
.act.big { flex: 1; }
.act.primary { background: linear-gradient(180deg, #ffd56b, var(--gold2)); color: #2b1b00; }
.act.small { flex: none; padding: 10px 12px; min-height: 44px; font-size: 13px; background: var(--panel2); }
.tv-actions.sent .act { opacity: .6; pointer-events: none; }
.wait-txt { flex: 1; align-self: center; text-align: center; color: var(--muted); font-size: 13px; }
.pre-row .pre { flex: 1; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 12px 4px; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 50px; }
.pre i { width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--muted); flex: none; }
.pre.on { border-color: var(--gold2); background: rgba(244,194,79,.1); }
.pre.on i { background: var(--gold); border-color: var(--gold); }
.spect { justify-content: center; }
.spect-msg { text-align: center; color: var(--muted); font-size: 14px; padding: 10px; }
.raise-panel { position: absolute; bottom: 100%; left: 8px; right: 8px; background: rgba(16,22,40,.97); border: 1px solid var(--line); border-radius: 18px; padding: 10px 10px 12px; box-shadow: 0 -10px 30px rgba(0,0,0,.5); animation: rise .15s ease-out; z-index: 6; }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
.presets { display: flex; gap: 6px; }
.presets button { flex: 1; border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 9px 2px; font-size: 12px; font-weight: 700; }
.presets button:active { background: #2b3760; }
.slider-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.slider-row input { flex: 1; }
.pm { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); font-size: 22px; font-weight: 700; flex: none; }
.raise-val { text-align: center; }
.rv { font-size: 22px; color: var(--gold); }

/* push to talk */
.ptt {
  position: relative; z-index: 1; flex: none; margin-inline-start: auto;
  width: 58px; height: 58px; border-radius: 50%; border: 0; color: #fff;
  background: radial-gradient(circle at 35% 30%, #4a5a8a, #232c4a); box-shadow: 0 6px 18px rgba(0,0,0,.5), inset 0 0 0 2px rgba(255,255,255,.15);
  display: grid; place-items: center; touch-action: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
}
.ptt.on { background: radial-gradient(circle at 35% 30%, #ff6b6f, #c9262c); transform: scale(1.12); box-shadow: 0 0 0 8px rgba(255,90,95,.25), 0 0 0 16px rgba(255,90,95,.12); }
.ptt.on::after { content: 'در حال صحبت…'; position: absolute; bottom: calc(100% + 10px); left: 0; white-space: nowrap; background: rgba(0,0,0,.85); padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.tv-top .ptt { width: 40px; height: 40px; margin: 0; }
.tv-top .ptt svg { width: 20px; height: 20px; }
.tv-top .ptt.on::after { bottom: auto; top: calc(100% + 8px); }

@media (max-height: 640px) {
  .tv-hero { min-height: 80px; }
  .hero-cards .card { --cw: 52px; }
  .hero-cards.n5 .card { --cw: 46px; }
  .tv-top { height: 46px; }
  .act { min-height: 48px; padding: 10px 6px; }
  .tv-hero .ptt { width: 52px; height: 52px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .tv::before { content: 'برای تجربه بهتر گوشی را عمودی نگه دارید'; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); z-index: 30; }
}

/* ================= ADMIN ================= */
.admin-body { background: var(--bg); }
.adm { max-width: 1100px; margin: 0 auto; padding: 0 12px calc(30px + var(--safe-b)); }
.adm-top { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: calc(10px + var(--safe-t)) 0 0; }
.adm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.adm-head h1 { font-size: 18px; margin: 0; flex: 1; }
.adm-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tabs button { flex: none; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 14px; font-weight: 700; color: var(--muted); }
.adm-tabs button.on { background: var(--panel2); color: var(--text); border-color: var(--gold2); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.stat small { color: var(--muted); display: block; font-size: 12px; }
.stat b { font-size: 20px; }
.stat.g b { color: var(--gold); }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.box h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.box h3 .grow { flex: 1; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,.06); text-align: right; vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: rgba(255,255,255,.03); }
.scroll-x { overflow-x: auto; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fgrid label, .flabel { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.fgrid label.full { grid-column: 1 / -1; }
.pill { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.08); margin-inline-end: 4px; }
.pill.on { background: rgba(47,209,122,.18); color: #7ff0b0; }
.pill.red { background: rgba(255,90,95,.18); color: #ffb0b2; }
.pill.gold { background: rgba(244,194,79,.18); color: #ffe39a; }
.seatlist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.seatchip { display: flex; align-items: center; gap: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 4px 6px 4px 10px; font-size: 12px; }
.seatchip button { border: 0; background: rgba(255,90,95,.15); color: #ffb0b2; border-radius: 7px; padding: 2px 8px; font-size: 11px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hand-view .street { margin: 8px 0; }
.hand-view .street b { color: var(--gold); font-size: 13px; }
.hand-view .acts { font-size: 13px; color: #cfd6e8; }
.cardrow { display: inline-flex; gap: 3px; vertical-align: middle; direction: ltr; }
.cardrow .card { --cw: 26px; }
.mono { font-family: ui-monospace, monospace; direction: ltr; text-align: left; font-size: 11px; word-break: break-all; color: #b8c4e0; }
@media (max-width: 640px) {
  .tbl.resp thead { display: none; }
  .tbl.resp tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .tbl.resp td { display: flex; justify-content: space-between; border: 0; padding: 3px 4px; }
  .tbl.resp td::before { content: attr(data-l); color: var(--muted); font-size: 12px; }
}
