:root {
  --bg: #0d1117;
  --panel: #161d27;
  --felt: #1d5c3f;
  --felt-dark: #143d2b;
  --gold: #d4a94e;
  --text: #e8e4d8;
  --muted: #9aa3ad;
  --red: #e05252;
  --green: #4caf7d;
  --card-w: 54px;
  --card-h: 76px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 18px; background: #0a0e14; border-bottom: 1px solid #232c38;
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 18px; color: var(--gold); white-space: nowrap; }
.tabs { display: flex; gap: 6px; }
.tab {
  background: none; border: none; color: var(--muted); font-size: 15px;
  padding: 8px 16px; cursor: pointer; border-radius: 8px;
}
.tab.active { color: var(--text); background: #1d2632; }
.tab:hover { color: var(--text); }
.playmoney {
  margin-left: auto; font-size: 12px; color: var(--gold);
  border: 1px solid var(--gold); border-radius: 20px; padding: 4px 12px; white-space: nowrap;
}
main { flex: 1; max-width: 1060px; width: 100%; margin: 0 auto; padding: 18px; }
.tabpane { display: none; }
.tabpane.active { display: block; }
.hidden { display: none !important; }

/* ---------- setup ---------- */
.setup { text-align: center; padding: 30px 10px; }
.setup h1 { font-size: 44px; margin: 0 0 8px; color: var(--gold); }
.tagline { color: var(--muted); max-width: 560px; margin: 0 auto 28px; line-height: 1.5; }
.setup-grid { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.setup-card {
  background: var(--panel); border: 1px solid #232c38; border-radius: 14px;
  padding: 18px 20px; min-width: 230px;
}
.setup-card h3 { margin: 0 0 12px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.opt-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.opt-row button {
  background: #0f141c; color: var(--text); border: 1px solid #2b3542;
  padding: 9px 14px; border-radius: 9px; cursor: pointer; font-size: 14px;
}
.opt-row button.sel { border-color: var(--gold); color: var(--gold); background: #1a1608; }
.hint { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; min-height: 18px; }
.big-btn {
  background: linear-gradient(180deg, #e0b45c, #c08f2e); color: #201503;
  font-size: 19px; font-weight: 800; border: none; border-radius: 12px;
  padding: 15px 54px; cursor: pointer;
}
.big-btn:hover { filter: brightness(1.08); }
.career { margin-top: 22px; color: var(--muted); font-size: 14px; }

/* ---------- table ---------- */
.table-wrap { position: relative; }
.poker-table { position: relative; width: 100%; max-width: 860px; margin: 6px auto; aspect-ratio: 16/9.2; }
.felt {
  position: absolute; inset: 7%; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, var(--felt) 0%, var(--felt-dark) 78%);
  border: 10px solid #4a2f1d; box-shadow: 0 0 0 3px #2b1c10, inset 0 0 60px rgba(0,0,0,.5);
}
.board-area {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  text-align: center; width: 70%;
}
.pot-line { font-size: 15px; color: var(--gold); margin-bottom: 8px; font-weight: 700; }
.pot-label { font-size: 11px; letter-spacing: 2px; color: var(--muted); margin-right: 6px; }
.community { display: flex; gap: 7px; justify-content: center; min-height: var(--card-h); }
.street-label { margin-top: 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; min-height: 16px; }

/* seats */
.seat {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  width: 150px; z-index: 2;
}
.seat .who { display: flex; align-items: center; gap: 8px; background: rgba(6,10,14,.82);
  border: 1px solid #2b3542; border-radius: 10px; padding: 5px 10px; font-size: 13px;
  position: relative; }
.seat .avatar {
  width: 26px; height: 26px; border-radius: 50%; background: #2b3542; color: var(--gold);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: none;
}
.seat.human .avatar { background: var(--gold); color: #201503; }
.seat .sname { font-weight: 700; white-space: nowrap; }
.seat .sstack { color: var(--muted); font-variant-numeric: tabular-nums; }
.seat .scards { display: flex; gap: 4px; min-height: 46px; }
.seat .sbet {
  font-size: 12px; color: #ffd97a; background: rgba(6,10,14,.85); border: 1px solid #6b5320;
  border-radius: 12px; padding: 2px 9px; min-height: 20px; font-variant-numeric: tabular-nums;
}
.seat .sbet:empty { display: none; }
.seat.active .who { border-color: var(--gold); box-shadow: 0 0 12px rgba(212,169,78,.45); }
.seat.winner .who { border-color: var(--green); box-shadow: 0 0 14px rgba(76,175,125,.6); }
.seat.folded { opacity: .45; }
.seat.sitting-out { opacity: .35; }
.dealer-btn {
  position: absolute; width: 24px; height: 24px; border-radius: 50%;
  background: #f2f2f2; color: #111; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,.5); z-index: 3;
  right: -12px; top: 50%; transform: translateY(-50%); flex: none;
}
.allin-tag {
  font-size: 10px; font-weight: 800; color: #fff; background: var(--red);
  border-radius: 4px; padding: 2px 6px; letter-spacing: 1px; flex: none;
}
.showdown-hand { font-size: 12px; color: #bfe6cd; background: rgba(6,10,14,.85); border-radius: 8px; padding: 3px 8px; }

/* cards */
.card {
  width: var(--card-w); height: var(--card-h); border-radius: 8px; background: #f7f4ec;
  color: #141414; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; box-shadow: 0 3px 8px rgba(0,0,0,.45); position: relative; flex: none;
  font-size: 20px; line-height: 1.05;
}
.card .suit { font-size: 22px; }
.card.red { color: #c22f2f; }
.card.small { width: 40px; height: 57px; font-size: 15px; border-radius: 6px; }
.card.small .suit { font-size: 16px; }
.card.back {
  background: repeating-linear-gradient(45deg, #274b73, #274b73 6px, #1d3a5c 6px, #1d3a5c 12px);
  border: 3px solid #f7f4ec;
}
.seat.human .card { width: 62px; height: 88px; font-size: 23px; }
.seat.human .card .suit { font-size: 26px; }
.winning-card { outline: 3px solid var(--green); }

/* result banner */
.result-banner {
  max-width: 860px; margin: 4px auto 0; text-align: center;
  background: #10251b; border: 1px solid var(--green); color: #d9f2e3;
  border-radius: 12px; padding: 12px 18px; font-size: 16px;
}

/* under table */
.under-table { display: flex; gap: 14px; max-width: 860px; margin: 12px auto 0; align-items: stretch; }
.action-panel {
  flex: 1; background: var(--panel); border: 1px solid #232c38; border-radius: 14px; padding: 14px 16px;
}
.to-call { font-size: 14px; color: var(--gold); margin-bottom: 10px; min-height: 18px; font-weight: 600; }
.action-buttons { display: flex; gap: 10px; }
.act {
  flex: 1; padding: 13px 0; font-size: 16px; font-weight: 800; border: none; border-radius: 10px; cursor: pointer;
}
.act.fold { background: #3a2126; color: #ff9d9d; }
.act.fold:hover { background: #4c2a31; }
.act.check { background: #22303f; color: #bcd6ff; }
.act.check:hover { background: #2b3d51; }
.act.raise { background: linear-gradient(180deg, #e0b45c, #c08f2e); color: #201503; }
.act.raise:hover { filter: brightness(1.08); }
.act:disabled { opacity: .4; cursor: default; }
.raise-controls { margin-top: 12px; }
.raise-controls input[type=range] { width: 100%; accent-color: var(--gold); }
.raise-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.chip-btn {
  background: #0f141c; border: 1px solid #2b3542; color: var(--text);
  border-radius: 8px; padding: 7px 11px; cursor: pointer; font-size: 13px;
}
.chip-btn:hover { border-color: var(--gold); color: var(--gold); }
.raise-amount { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.raise-amount input { width: 90px; background: #0f141c; border: 1px solid #2b3542; color: var(--text);
  border-radius: 8px; padding: 8px; font-size: 14px; }
.raise-amount .act { flex: none; padding: 9px 16px; font-size: 14px; }
.wait-panel {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid #232c38; border-radius: 14px;
  color: var(--muted); font-size: 15px; min-height: 96px;
}
/* privacy gate (hot-seat) */
.privacy-gate {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(4, 8, 14, .96);
  display: flex; align-items: center; justify-content: center;
}
.gate-card { text-align: center; padding: 30px; }
.gate-title { color: var(--muted); font-size: 15px; text-transform: uppercase; letter-spacing: 2px; }
.gate-name { color: var(--gold); font-size: 34px; font-weight: 800; margin: 10px 0 22px; }
.gate-card .hint { margin-top: 16px; }
/* seat picker */
.setup-card.wide { flex: 1 1 100%; }
.seat-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.seat-row { display: flex; align-items: center; gap: 8px; }
.seat-num { width: 52px; color: var(--muted); font-size: 13px; flex: none; }
.seat-name {
  flex: 1; min-width: 0; background: #0f141c; border: 1px solid #2b3542; color: var(--text);
  border-radius: 8px; padding: 7px 10px; font-size: 14px;
}
.seat-name:disabled { opacity: .55; }
.type-btn {
  background: #0f141c; border: 1px solid #2b3542; color: var(--muted);
  border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; flex: none;
}
.type-btn.sel { border-color: var(--gold); color: var(--gold); font-weight: 700; }
.opt-row.small button { font-size: 13px; padding: 7px 12px; }
.big-btn:disabled { opacity: .4; cursor: default; }
.side-col { width: 250px; display: flex; flex-direction: column; gap: 10px; }
.log-box { background: var(--panel); border: 1px solid #232c38; border-radius: 14px; padding: 10px 12px; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.log-box h4 { margin: 0 0 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.hand-log { overflow-y: auto; max-height: 190px; font-size: 13px; line-height: 1.65; color: #c9cfd6; }
.hand-log .me { color: var(--gold); }
.hand-log .sys { color: var(--muted); font-style: italic; }
.game-buttons { display: flex; gap: 8px; }
.ghost {
  flex: 1; background: none; border: 1px solid #2b3542; color: var(--muted);
  border-radius: 9px; padding: 9px; cursor: pointer; font-size: 13px;
}
.ghost:hover { color: var(--text); border-color: var(--muted); }

/* docs */
.doc { max-width: 720px; margin: 0 auto; line-height: 1.65; }
.doc h2 { color: var(--gold); }
.doc h3 { margin-top: 26px; color: var(--text); }
.doc .sub { font-size: 13px; color: var(--muted); font-weight: 400; }
.rankings { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.rank-row {
  display: flex; gap: 12px; align-items: center; background: var(--panel);
  border: 1px solid #232c38; border-radius: 10px; padding: 8px 12px;
}
.rank-row .rn { width: 26px; height: 26px; border-radius: 50%; background: #0f141c;
  border: 1px solid var(--gold); color: var(--gold); display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 13px; flex: none; }
.rank-row .rcards { display: flex; gap: 3px; }
.rank-row .rname { font-weight: 700; }
.rank-row .rdesc { color: var(--muted); font-size: 13px; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; border-top: 1px solid #1a222c; margin-top: 20px; }

@media (max-width: 760px) {
  :root { --card-w: 40px; --card-h: 58px; }
  .poker-table { aspect-ratio: 16/12; }
  .community { gap: 5px; }
  .community .card { width: 32px; height: 45px; font-size: 14px; border-radius: 6px; }
  .community .card .suit { font-size: 15px; }
  .pot-line { font-size: 13px; margin-bottom: 4px; }
  .seat { width: 104px; }
  .seat .who { font-size: 11px; padding: 4px 7px; gap: 6px; }
  .seat .avatar { width: 22px; height: 22px; font-size: 11px; }
  .seat .scards { min-height: 34px; }
  .seat .card { width: 34px; height: 49px; font-size: 15px; }
  .seat .card .suit { font-size: 16px; }
  .card.small { width: 30px; height: 43px; font-size: 12px; }
  .card.small .suit { font-size: 13px; }
  .seat.human .card { width: 38px; height: 54px; font-size: 16px; }
  .seat.human .card .suit { font-size: 18px; }
  /* bet badge lives in the seat flow on mobile; keep its space when empty
     so cards never shift, and never overlap anything */
  .seat .sbet:empty { display: block; visibility: hidden; }
  /* dealer button sits on the avatar spot: inside the plate, zero extent */
  .seat .dealer-btn { left: 5px; right: auto; width: 22px; height: 22px; font-size: 10px; }
  .under-table { flex-direction: column; }
  .side-col { width: 100%; }
  .playmoney { display: none; }
}
