:root {
  --bg: #0B1220;
  --surface: #121C30;
  --surface-alt: #1A2742;
  --border: #24365A;
  --text: #F3F6FB;
  --muted: #9AA8C7;
  --accent: #FFC53D;
  --accent-text: #1B1500;
  --plus: #34D399;
  --minus: #FB7185;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
.view { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.view[hidden] { display: none; }
#view-home { justify-content: center; }

.hero { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.langsw { display: inline-flex; background: var(--surface, #111C33); border: 1px solid var(--border, #22345C); border-radius: 999px; padding: 2px; }
.langsw button { border: 0; background: transparent; color: var(--muted, #9AA8C7); font: inherit; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.langsw button.on { background: var(--accent, #FFC53D); color: var(--accent-text, #1B1500); }
.hero h1 .tagline { display: block; font-size: .72em; font-weight: 700; color: var(--accent, #FFC53D); margin-top: 2px; }
.brand { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 3px; }
h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 800; }
h2 { margin: 0; font-size: 19px; font-weight: 700; }
.muted { color: var(--muted); line-height: 1.45; }
.small { font-size: 13px; }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.label { color: var(--muted); font-size: 14px; display: block; margin-bottom: 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.gap-s { gap: 8px; }
.grow { flex: 1; }

.input {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  padding: 13px 14px;
  outline: none;
}
.input:focus { border-color: var(--accent); }
.code-input {
  text-transform: uppercase;
  letter-spacing: 6px;
  font-weight: 800;
  font-size: 22px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: var(--radius);
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-alt);
  cursor: pointer;
  transition: transform .06s ease, opacity .12s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.secondary { border: 1px solid var(--border); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.small { padding: 9px 14px; font-size: 14px; border-radius: 12px; }
.linkbtn { background: none; border: 0; color: var(--accent); font-weight: 700; font-size: 14px; cursor: pointer; }

.msg { color: var(--minus); text-align: center; margin: 0; font-size: 14px; }

/* ---- table ---- */
.gamehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.roomlabel { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 1.5px; margin-bottom: 6px; }
.roomlabel span { color: var(--text); }
.right { text-align: right; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-alt); color: var(--muted); }
.pill.ok { background: #113B2E; color: var(--plus); }
.pill.warn { background: #3B2F10; color: var(--accent); }
.pill.bad { background: #3B1520; color: var(--minus); }
.pill.seen { background: #15304F; color: #7CB8FF; }
.spacer { height: 120px; }

/* seating */
.seats { list-style: none; margin: 0; padding: 0; }
.seats li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 15px; }
.seats li:first-child { border-top: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--plus); }
.pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seats .pname { white-space: normal; line-height: 1.25; }
.pname.me { color: var(--accent); }
.ptag { color: var(--muted); font-size: 11px; margin-left: 6px; letter-spacing: .5px; }
.bal { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 56px; text-align: right; }
.bal.pos { color: var(--plus); } .bal.neg { color: var(--minus); } .bal.zero { color: var(--muted); }
.iconbtn { width: 30px; height: 30px; flex: none; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); font-weight: 800; font-size: 13px; cursor: pointer; }
.iconbtn:disabled { opacity: .3; }
.iconbtn.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.iconbtn.danger { color: var(--minus); }
.hostbox { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.boot-input { width: 110px; text-align: right; font-weight: 800; font-size: 18px; }
.linkbtn.center { align-self: center; }

/* my cards */
.mycards { display: flex; flex-direction: column; gap: 10px; }
.cards { display: flex; gap: 10px; justify-content: center; min-height: 104px; }
.pcard { width: 70px; height: 100px; border-radius: 10px; display: flex; flex-direction: column; justify-content: space-between; padding: 6px 7px; font-weight: 900; font-size: 20px; background: #fff; color: #111; box-shadow: 0 6px 16px rgba(0,0,0,.35); transition: transform .25s ease; }
.pcard.red { color: #D6336C; }
.pcard .suit { font-size: 26px; text-align: center; }
.pcard .bot { align-self: flex-end; transform: rotate(180deg); }
.pcard.down { background: linear-gradient(135deg, #3B5BDB, #1E3A8A); border: 2px solid #93A4FF55; color: transparent; }
.pcard.down::after { content: ''; position: relative; display: block; width: 100%; height: 100%; background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,.08) 6px 12px); border-radius: 6px; margin: -6px -7px; padding: 6px 7px; }
.hint.center { text-align: center; }

/* result */
.result { text-align: center; gap: 8px; display: flex; flex-direction: column; }
.result[hidden], #table[hidden], .card[hidden] { display: none; }
.result h2 { color: var(--accent); }
.result .reveal { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.result .reveal .who { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.result .reveal .who b { color: var(--text); }
.result .cards { min-height: 0; }
.result .pcard { width: 46px; height: 66px; font-size: 14px; padding: 4px 5px; border-radius: 7px; }
.result .pcard .suit { font-size: 18px; }

/* log */
.log { color: var(--muted); font-size: 12.5px; line-height: 1.5; padding: 0 4px; }
.log div:first-child { color: var(--text); }

/* settlement */
.transfers { list-style: none; margin: 0 0 8px; padding: 0; }
.transfers li { display: flex; align-items: center; gap: 8px; padding: 12px; margin-top: 8px; background: var(--surface-alt); border-radius: 12px; font-size: 15px; }
.transfers li b { color: var(--accent); margin-left: auto; font-variant-numeric: tabular-nums; }
.transfers .arrow { color: var(--muted); }

/* sticky actions */
.actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.actions > .row { max-width: 520px; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.actions[hidden] { display: none; }
.turn-banner { max-width: 520px; margin: 0 auto 8px; text-align: center; font-weight: 800; color: var(--accent); font-size: 14px; letter-spacing: .5px; }
.turn-banner.wait { color: var(--muted); font-weight: 600; }
.btn.danger { background: #3B1520; color: var(--minus); border: 1px solid #5B2232; }
.btn.show { background: #15304F; color: #7CB8FF; border: 1px solid #27497A; }
.btn[hidden] { display: none; }
.btn .sub { display: block; font-size: 11px; font-weight: 600; opacity: .8; }

/* sheets */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet[hidden] { display: none; }
.sheet-body { width: 100%; max-width: 520px; background: var(--surface); border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg); padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; max-height: 92dvh; overflow: auto; }
.rules p { margin: 0; color: var(--text); line-height: 1.5; font-size: 14.5px; }
.rules p.indent { padding-left: 12px; border-left: 2px solid var(--border); color: var(--muted); }
.qr { align-self: center; background: #fff; padding: 12px; border-radius: var(--radius); line-height: 0; }
.qr svg { width: 220px; height: 220px; display: block; }
.invite-code { text-align: center; color: var(--accent); font-size: 44px; font-weight: 900; letter-spacing: 10px; font-variant-numeric: tabular-nums; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); background: #3B1520; color: var(--minus); border: 1px solid #5B2232; padding: 10px 14px; border-radius: 12px; font-size: 14px; z-index: 20; max-width: 90vw; text-align: center; }
.toast[hidden] { display: none; }


/* QR landing: hide hosting, show one join button */
.joining #btn-host, .joining #view-home .hero p, .joining #view-home .hint { display: none; }
.joining #view-home .row { flex-direction: column; align-items: stretch; }
.joining #code { display: none; }
.joining #home-msg { color: var(--accent); }

/* bots & settlement recording */
.ptag.bot { color: #7CB8FF; }
.transfers li { flex-wrap: wrap; }
.transfers li.paid { opacity: .55; }
.transfers li.paid b { color: var(--plus); }
.transfers .mark { margin-left: auto; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.transfers .state { margin-left: auto; font-size: 13px; color: var(--muted); }
.transfers .state.ok { color: var(--plus); font-weight: 700; }
.allpaid { text-align: center; color: var(--plus); font-weight: 800; margin: 6px 0 0; }

/* ---- round table ---- */
.table-circle { position: relative; width: 100%; max-width: 380px; aspect-ratio: 1; margin: 30px auto 62px; }
.table-circle.oval { aspect-ratio: auto; height: 200px; max-width: 440px; margin: 2px auto 14px; }
.felt {
  position: absolute; inset: 17%; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #27604A 0%, #1B4737 55%, #123526 100%);
  border: 7px solid #4A3416; box-shadow: inset 0 0 30px rgba(0,0,0,.45), 0 10px 30px rgba(0,0,0,.4);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
}
.felt .lbl { color: #BFE3CF; font-size: 10px; font-weight: 800; letter-spacing: 2px; }
.felt .pot { color: var(--accent); font-size: 46px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.felt .stake { color: #F3F6FB; font-size: 15px; font-weight: 700; margin-top: 4px; }
.felt .code { color: #F3F6FB; font-size: 26px; font-weight: 900; letter-spacing: 5px; }
.felt .sub { color: #BFE3CF; font-size: 12px; }
.seat { position: absolute; width: 92px; transform: translate(-50%, -50%); text-align: center; z-index: 2; }
.seat .avatar {
  width: 46px; height: 46px; border-radius: 50%; margin: 0 auto; position: relative;
  background: var(--surface-alt); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; color: var(--text);
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.seat.me .avatar { border-color: var(--accent); color: var(--accent); }
.table-circle.live .seat:not(.turn):not(.answering) .avatar, .table-circle.live .seat:not(.turn):not(.answering) .nm { opacity: .7; }
.table-circle.live .seat.folded .avatar, .table-circle.live .seat.folded .nm { opacity: .35; }
.seat.turn, .seat.answering { z-index: 4; }
.seat.turn .avatar, .seat.answering .avatar {
  width: 60px; height: 60px; font-size: 20px; margin-top: -7px;
  border: 3px solid var(--accent); background: #2A2208; color: #FFE39A;
  box-shadow: 0 0 0 5px rgba(255,197,61,.35), 0 0 28px 6px rgba(255,197,61,.45), 0 4px 12px rgba(0,0,0,.4);
  animation: halo 1.1s ease-in-out infinite;
}
.seat.answering .avatar { border-color: #7CB8FF; background: #0F2440; color: #CFE6FF; box-shadow: 0 0 0 5px rgba(124,184,255,.35), 0 0 28px 6px rgba(124,184,255,.45); animation: haloBlue 1.1s ease-in-out infinite; }
.seat.turn .nm, .seat.answering .nm { color: var(--accent); font-size: 13px; }
.seat.answering .nm { color: #7CB8FF; }
.seat .turntag { display: none; }
.seat.turn .turntag, .seat.answering .turntag {
  display: inline-block; margin-top: 2px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); font-size: 10px; font-weight: 900; letter-spacing: 1.2px;
}
.seat.answering .turntag { background: #7CB8FF; color: #06101F; }
@keyframes halo {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255,197,61,.30), 0 0 22px 4px rgba(255,197,61,.35), 0 4px 12px rgba(0,0,0,.4); }
  50%      { box-shadow: 0 0 0 9px rgba(255,197,61,.12), 0 0 40px 12px rgba(255,197,61,.55), 0 4px 12px rgba(0,0,0,.4); }
}
@keyframes haloBlue {
  0%, 100% { box-shadow: 0 0 0 4px rgba(124,184,255,.30), 0 0 22px 4px rgba(124,184,255,.35); }
  50%      { box-shadow: 0 0 0 9px rgba(124,184,255,.12), 0 0 40px 12px rgba(124,184,255,.55); }
}
.felt .turnline { margin-top: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.35); color: #FFE39A; font-size: 12px; font-weight: 800; letter-spacing: .3px; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.felt .turnline.me { background: var(--accent); color: var(--accent-text); animation: breathe 1.1s ease-in-out infinite; }
.felt .turnline.blue { color: #CFE6FF; }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.seat.folded .avatar { opacity: .4; }
.seat.offline .avatar { border-style: dashed; opacity: .7; }
.seat.winner .avatar { border-color: var(--plus); box-shadow: 0 0 0 4px rgba(52,211,153,.35); }
.seat .nm { font-size: 12px; font-weight: 700; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .sub { font-size: 11px; color: var(--muted); white-space: nowrap; }
.seat .sub.ok { color: var(--plus); } .seat .sub.bad { color: var(--minus); } .seat .sub.seen { color: #7CB8FF; }
.seat .badge { position: absolute; top: -6px; right: -6px; background: var(--accent); color: var(--accent-text); font-size: 10px; font-weight: 900; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.seat .badge.win { right: auto; left: -6px; background: var(--plus); color: #06101F; }
.seat .mini { display: flex; gap: 2px; justify-content: center; margin-top: 3px; min-height: 18px; }
.seat .minicard { width: 12px; height: 17px; border-radius: 2px; background: linear-gradient(135deg, #3B5BDB, #1E3A8A); border: 1px solid #93A4FF55; }
.seat .minicard.up { background: #fff; color: #111; font-size: 9px; font-weight: 800; display: flex; align-items: center; justify-content: center; width: 16px; height: 21px; }
.seat .minicard.up.red { color: #D6336C; }
.seat .bal { display: block; font-size: 11px; min-width: 0; text-align: center; }

/* ---- 0.6 compact live table: oval felt, moves grid, no vertical scrolling ---- */
.table-circle.oval .felt { inset: 22px 42px; border-width: 6px; }
.table-circle.oval .felt .pot { font-size: 30px; }
.table-circle.oval .felt .lbl { font-size: 9px; }
.table-circle.oval .felt .stake { font-size: 10px; margin-top: 2px; }
.table-circle.oval .felt .code { font-size: 22px; letter-spacing: 3px; }
.table-circle.oval .felt .turnline { margin-top: 4px; padding: 3px 8px; font-size: 11px; }
.table-circle.oval .seat { width: 78px; }
.table-circle.oval .seat .avatar { width: 36px; height: 36px; font-size: 13px; }
.table-circle.oval .seat.turn .avatar, .table-circle.oval .seat.answering .avatar { width: 44px; height: 44px; font-size: 16px; }
.table-circle.oval .seat .nm { font-size: 10px; margin-top: 2px; }
.table-circle.oval .seat.turn .nm, .table-circle.oval .seat.answering .nm { font-size: 11px; }
.table-circle.oval .seat .sub { font-size: 9px; }
.table-circle.oval .seat .turntag { font-size: 8px; padding: 1px 6px; margin-top: 2px; }
.table-circle.oval .seat .mini { margin-top: 2px; min-height: 0; }
.table-circle.oval .seat .badge { width: 16px; height: 16px; font-size: 9px; }

.moves { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.moves-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.moves-scroll::-webkit-scrollbar { display: none; }
.moves table { border-collapse: collapse; font-size: 10px; min-width: 100%; }
.moves th { background: var(--surface-alt); color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .8px; height: 18px; padding: 0 6px; text-align: left; white-space: nowrap; }
.moves td { height: 24px; padding: 0 6px; white-space: nowrap; border-top: 1px solid rgba(36,54,90,.5); vertical-align: middle; }
.moves td.pn, .moves th.pn { position: sticky; left: 0; background: var(--surface); font-weight: 700; max-width: 92px; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
.moves th.pn { background: var(--surface-alt); }
.moves tr.me td.pn { color: var(--accent); }
.moves tr.folded td.pn { color: var(--muted); }
.moves tr.cur td { background: rgba(255,197,61,.1); }
.moves tr.cur td.pn { background: #1d2538; }
.moves .dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-right: 4px; background: transparent; vertical-align: middle; }
.moves tr.cur .dot { background: var(--accent); }
.moves .eye { font-style: normal; font-size: 8px; color: #7CB8FF; }
.moves .x { font-style: normal; font-size: 8px; color: var(--minus); font-weight: 800; }
.moves td.empty { color: var(--border); text-align: center; }
.moves .mv { display: block; color: var(--muted); font-weight: 600; line-height: 1.15; }
.moves .mv b { color: var(--muted); font-weight: 800; }
.moves td.last .mv { color: var(--text); font-weight: 800; }
.moves td.last .mv b { color: var(--text); }
.moves .mv.bad { color: var(--minus); } .moves .mv.gold { color: var(--accent); } .moves .mv.blue { color: #7CB8FF; } .moves .mv.dim { color: var(--muted); }

.mycards { flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; }
.mycards .cards { gap: 6px; min-height: 0; }
.mycards .pcard { width: 46px; height: 66px; font-size: 14px; padding: 4px 5px; border-radius: 7px; }
.mycards .pcard .suit { font-size: 18px; }
.mycards .mytext { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mycards .mytext .row { gap: 8px; align-items: center; }
.mycards h2 { font-size: 15px; margin: 0; }
.mycards .hint { font-size: 12px; margin: 0; text-align: left; }

.result { text-align: left; gap: 6px; padding: 10px 12px; }
.result h2 { font-size: 15px; margin: 0; }
.result .row { gap: 6px; align-items: baseline; }
.result .reveal { flex-direction: column; gap: 4px; justify-content: flex-start; }
.result .rv { display: flex; align-items: center; gap: 8px; }
.result .rv .mini { display: flex; gap: 3px; }
.result .rv .who { font-size: 12px; color: var(--muted); margin: 0; }
.result .rv.win .who, .result .rv.win .who b { color: var(--plus); }
.result .minicard { width: 18px; height: 22px; border-radius: 2px; background: #fff; color: #111; font-size: 9px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.result .minicard.red { color: #D6336C; }

#table { display: flex; flex-direction: column; gap: 8px; }
#table[hidden] { display: none; }
#table .log { font-size: 11.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-bottom: 130px; }
#view-game.live { gap: 8px; }
.gamehead .pill { white-space: nowrap; }

/* local (phone-served) mode: guests only join */
body.local #btn-host, body.local .or, body.local #code, body.local label[for="code"] { display: none !important; }

.btn.step { flex: 0 0 38px; padding-left: 0; padding-right: 0; font-weight: 800; }

.via { font-size: 10px; margin-right: 3px; }
.via.off { color: var(--minus); }
.ptag.via-cloud { color: #7CB8FF; } .ptag.via-lan { color: var(--plus); } .ptag.via-host { color: var(--accent); } .ptag.via-off { color: var(--minus); }
.seats .legend, li.legend { font-size: 11px; list-style: none; padding-top: 6px; }

/* Blind / seen / packed: one glance across the table */
.stline { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 3px; }
.st { display: inline-block; padding: 2px 6px; border-radius: 6px; font-size: 10px; font-weight: 900; letter-spacing: .6px; line-height: 1.3; white-space: nowrap; }
.st.blind { background: #3B2A6B; color: #E4D9FF; border: 1.5px dashed #A78BFA; }
.st.seen { background: #0E7490; color: #ECFEFF; border: 1.5px solid #67E8F9; }
.st.packed { background: #3A1A22; color: #FF8FA3; border: 1.5px solid #7F2A3A; }
.seat .amt { font-size: 17px; font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.seat.folded .amt { color: var(--muted); }
.stm { font-style: normal; display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 4px; font-size: 10px; font-weight: 900; text-align: center; }
.stm.blind { background: #3B2A6B; color: #E4D9FF; } .stm.seen { background: #0E7490; color: #ECFEFF; } .stm.packed { background: #3A1A22; color: #FF8FA3; }
.moves td b { font-size: 14px; }
/* Table talk */
.btn.talk.live { background: #DC2626; color: #fff; border-color: #DC2626; animation: breathe 1.4s ease-in-out infinite; }
.talk-lang { min-width: 34px; }
.bubble { position: absolute; bottom: calc(100% - 4px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 150px;
  background: #F8FAFC; color: #0B1220; font-size: 12px; font-weight: 700; line-height: 1.3; padding: 6px 9px; border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.45); z-index: 10; text-align: left; }
.bubble.fresh { animation: pop .25s ease-out; }
.bubble::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: #F8FAFC; }
.bubble.below { bottom: auto; top: calc(100% - 4px); }
.bubble.below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #F8FAFC; }
@keyframes pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }

.gamehead .btn.small { padding: 8px 10px; }
.bubble.l { left: 0; transform: none; } .bubble.l::after { left: 22px; }
.bubble.r { left: auto; right: 0; transform: none; } .bubble.r::after { left: auto; right: 16px; }
.bubble.l.fresh, .bubble.r.fresh { animation: none; }
.seat .tot { font-size: 10px; color: var(--muted); font-weight: 600; }

/* Variations */
#vary { display: flex; flex-direction: column; gap: 10px; }
.vary-btn { width: 100%; }
.vary-note { background: #1E2A4A; border: 1px solid #2E4374; color: #DCE6FF; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.vary-note.on { background: #2A2208; border-color: var(--accent); color: #FFE39A; }
.vary-poll { border: 2px solid var(--accent); }
.vary-h { color: var(--muted); font-size: 13px; font-weight: 700; }
.vary-name { font-size: 20px; font-weight: 900; color: var(--accent); margin: 2px 0 4px; }
.vary-count { font-weight: 800; margin: 6px 0 10px; }
.vary-poll .btn.on { outline: 3px solid #fff; }
.vary-opt { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.vary-opt:last-of-type { border-bottom: 0; }
.felt .modebadge { background: #7C3AED; color: #fff; font-size: 11px; font-weight: 900; letter-spacing: .4px; padding: 3px 10px; border-radius: 999px; margin-bottom: 4px; max-width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modebar { background: #4C1D95; border: 1px solid #7C3AED; color: #fff; border-radius: 12px; padding: 7px 12px; font-size: 13px; text-align: center; margin-bottom: 6px; }
.modebar span { display: block; font-size: 11px; color: #DDD6FE; margin-top: 2px; }
.segs { display: flex; gap: 6px; margin: 4px 0 8px; }
.segs .seg { flex: 1; padding: 9px 6px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); font-weight: 800; font-size: 13px; }
.segs .seg.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.site-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 18px 8px 26px; line-height: 1.8; }
.site-foot a { color: var(--muted); margin: 0 6px; }

/* ===== Casino look ===== */
:root { --card-back: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22100%22%20height%3D%22140%22%20viewBox%3D%220%200%20100%20140%22%3E%3Cdefs%3E%3Cpattern%20id%3D%22d%22%20width%3D%2210%22%20height%3D%2210%22%20patternUnits%3D%22userSpaceOnUse%22%20patternTransform%3D%22rotate%2845%29%22%3E%3Crect%20width%3D%2210%22%20height%3D%2210%22%20fill%3D%22%230E1E44%22/%3E%3Cpath%20d%3D%22M0%205h10M5%200v10%22%20stroke%3D%22%231F3B7A%22%20stroke-width%3D%221.2%22/%3E%3C/pattern%3E%3ClinearGradient%20id%3D%22g%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%221%22%20y2%3D%221%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%23F7D774%22/%3E%3Cstop%20offset%3D%22.5%22%20stop-color%3D%22%23C9962B%22/%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F7D774%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect%20x%3D%221%22%20y%3D%221%22%20width%3D%2298%22%20height%3D%22138%22%20rx%3D%229%22%20fill%3D%22%230B1733%22%20stroke%3D%22url%28%23g%29%22%20stroke-width%3D%222%22/%3E%3Crect%20x%3D%227%22%20y%3D%227%22%20width%3D%2286%22%20height%3D%22126%22%20rx%3D%226%22%20fill%3D%22url%28%23d%29%22%20stroke%3D%22url%28%23g%29%22%20stroke-width%3D%221.2%22/%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2270%22%20r%3D%2222%22%20fill%3D%22%230B1733%22%20stroke%3D%22url%28%23g%29%22%20stroke-width%3D%222%22/%3E%3Ctext%20x%3D%2250%22%20y%3D%2278%22%20text-anchor%3D%22middle%22%20font-family%3D%22Georgia%2Cserif%22%20font-size%3D%2222%22%20font-weight%3D%22700%22%20fill%3D%22url%28%23g%29%22%3ENA%3C/text%3E%3Ctext%20x%3D%2250%22%20y%3D%22112%22%20text-anchor%3D%22middle%22%20font-family%3D%22Helvetica%2CArial%2Csans-serif%22%20font-size%3D%228.5%22%20font-weight%3D%22700%22%20letter-spacing%3D%222%22%20fill%3D%22%23F7D774%22%3ENEOABHRO%3C/text%3E%3Ctext%20x%3D%2250%22%20y%3D%2234%22%20text-anchor%3D%22middle%22%20font-family%3D%22Helvetica%2CArial%2Csans-serif%22%20font-size%3D%226%22%20font-weight%3D%22700%22%20letter-spacing%3D%221.5%22%20fill%3D%22%23C9962B%22%3EKHEL-MITRA%3C/text%3E%3C/svg%3E"); }
.pcard.down, .minicard:not(.up) { background: var(--card-back) center/cover no-repeat !important; border: 0 !important; box-shadow: 0 3px 8px rgba(0,0,0,.45); }
.pcard.down * , .minicard:not(.up) * { display: none; }
.mini-fly { width: 34px !important; height: 48px !important; border-radius: 5px; }
/* table light: a warm spotlight on the felt */
.felt { overflow: visible; }
.felt::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(ellipse 55% 60% at 50% 42%, rgba(255,244,200,.30), rgba(255,244,200,.08) 45%, rgba(0,0,0,0) 62%), radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 55%, rgba(0,0,0,.45) 100%); }
.felt > * { position: relative; z-index: 2; }
.felt .heap { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.felt .heap .hc { position: absolute; transform: translate(-50%,-50%); filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.felt .pot { text-shadow: 0 2px 10px rgba(0,0,0,.85), 0 0 2px #000; }
.turnptr { position: absolute !important; left: 50%; top: 50%; width: 46%; height: 0; z-index: 1 !important; pointer-events: none; transition: transform .45s cubic-bezier(.3,.7,.3,1); transform-origin: 0 0; }
.turnptr::after { content: ''; position: absolute; right: 18%; top: -9px; border-left: 18px solid rgba(255,214,102,.95); border-top: 9px solid transparent; border-bottom: 9px solid transparent; filter: drop-shadow(0 0 6px rgba(255,200,60,.9)); animation: ptrpulse 1s ease-in-out infinite; }
.turnptr::before { content: ''; position: absolute; left: 22%; right: 26%; top: -1.5px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(255,214,102,0), rgba(255,214,102,.7)); }
@keyframes ptrpulse { 0%,100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
.flyer { position: fixed; z-index: 9999; pointer-events: none; will-change: transform; filter: drop-shadow(0 6px 8px rgba(0,0,0,.5)); }
.flyer svg, .flyer .pcard { width: 100%; height: 100%; display: block; }
/* chip tray */
.tray-wrap { background: linear-gradient(180deg, #1A1206, #0E0A04); border: 1px solid #5A4416; border-radius: 16px; padding: 8px 10px 10px; margin-bottom: 8px; box-shadow: inset 0 2px 10px rgba(0,0,0,.6); }
.tray-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.tray-info { flex: 1; font-size: 13px; color: #F3E3B5; }
.tray { display: flex; justify-content: space-between; gap: 4px; touch-action: none; }
.tchip { background: none; border: 0; padding: 0; cursor: grab; transition: transform .12s; -webkit-tap-highlight-color: transparent; }
.tchip:active { transform: translateY(-6px) scale(1.06); }
.tchip.dim { opacity: .35; filter: grayscale(.6); }
.tray.shake { animation: shake .35s; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
#btn-chipnext:not(:disabled) { box-shadow: 0 0 0 3px rgba(255,197,61,.35), 0 0 18px rgba(255,197,61,.5); }
.table-circle.oval { height: 250px; }
#table .table-circle.oval .felt { justify-content: flex-start; padding-top: 14px; }
.unlock { text-align: center; padding: 18px 10px; background: var(--surface-alt); border-radius: 14px; }
.unlock .big { font-size: 34px; }
.unlock .btn { margin-top: 10px; width: 100%; }
