:root {
  --bg: #15191f; --panel: #1e242c; --text: #e8eaed; --muted: #9aa3ad; --accent: #f5d65c;
  --felt: #1c6640; --rail: #5c4028; --card: #fcfcfa; --err: #ff7b72;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 system-ui, Segoe UI, sans-serif; }
header { padding: 12px 16px; border-bottom: 1px solid #2a313a; }
h1 { margin: 0; font-size: 20px; }
h1 span { color: var(--muted); font-weight: normal; font-size: 14px; margin-left: 8px; }
h2 { margin-top: 0; }
h3 { margin: 0 0 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.panel { background: var(--panel); border-radius: 10px; padding: 20px; max-width: 460px; margin: 0 auto; }
.panel label { display: block; margin-bottom: 12px; color: var(--muted); }
.panel input, .panel select { display: block; width: 100%; margin-top: 4px; padding: 8px; border-radius: 6px;
  border: 1px solid #39424d; background: #11151a; color: var(--text); font-size: 15px; }
button { padding: 8px 14px; border-radius: 6px; border: 1px solid #39424d; background: #2a313a; color: var(--text);
  font-size: 15px; cursor: pointer; }
button:hover { background: #343c46; }
button.primary { background: var(--accent); color: #1a1a1a; border-color: var(--accent); font-weight: 600; }
.error { color: var(--err); min-height: 1.2em; }
.small { font-size: 13px; color: var(--muted); }
a { color: var(--accent); }
.wide { max-width: 1100px; }
table.stats-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 12px; }
.stats-table th, .stats-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #2f3742; vertical-align: top; }
.stats-table th { color: var(--muted); font-weight: 600; }
.stats-table td.num { text-align: right; white-space: nowrap; }
.pos { color: #7ee787; } .neg { color: var(--err); }
.players { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0; }
.players label { display: inline-flex; align-items: center; gap: 6px; color: var(--text); margin: 0; }
.players input { width: auto; display: inline; margin: 0; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
#botLabel { color: var(--muted); font-size: 13px; }
.match { font-weight: 600; margin-bottom: 8px; }

/* Table: fixed height so nothing jumps when buttons come and go */
.table { position: relative; height: 420px; border-radius: 210px; background: var(--felt); border: 14px solid var(--rail);
  display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 14px 0; }
.center { text-align: center; }
.note { color: #dfe6e0; font-size: 13px; min-height: 1.3em; margin-bottom: 6px; }
.board { display: flex; gap: 8px; justify-content: center; min-height: 82px; }
.pot { font-weight: 700; margin-top: 8px; }
.seat { display: flex; align-items: center; gap: 12px; }
.seat .cards { display: flex; gap: 6px; }
.seat .info { min-width: 190px; }
.seat .name { font-weight: 700; }
.seat .chips { color: #dfe6e0; font-size: 13px; }
.bubble { background: var(--accent); color: #1a1a1a; border-radius: 10px; padding: 4px 10px; font-weight: 600; font-size: 13px;
  min-width: 120px; text-align: center; }
.bubble.thinking { background: #46465a; color: #e6e6ff; }
.bubble.empty { visibility: hidden; }
.dealer { display: inline-block; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: #222; font-size: 11px;
  font-weight: 700; text-align: center; line-height: 20px; margin-left: 6px; }

.card { width: 54px; height: 76px; border-radius: 6px; background: var(--card); border: 1px solid #444;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; }
.card .r { font-size: 22px; line-height: 1; }
.card .s { font-size: 22px; line-height: 1.1; }
.card.c { color: #148232; } .card.d { color: #1e5ac8; } .card.h { color: #c81e28; } .card.s { color: #191919; }
.card.back { background: repeating-linear-gradient(90deg, #344a8c 0 6px, #3e559c 6px 8px); border: 2px solid #e6e6e6; }
.card.slot { background: transparent; border: 1px dashed #3c8c5f; }

.actions { display: flex; gap: 8px; min-height: 52px; margin: 10px 0; }
.actions button { flex: 1; min-height: 42px; }
.columns { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.log-box, .stats, .think { background: var(--panel); border-radius: 8px; padding: 10px; }
.log { height: 220px; overflow-y: auto; font-size: 13px; white-space: pre-wrap; }
.side { display: flex; flex-direction: column; gap: 12px; }
.stats { font-size: 13px; }
.think pre { margin: 0; font-size: 12px; white-space: pre-wrap; }

@media (max-width: 720px) {
  .table { height: 380px; border-radius: 40px; }
  .card { width: 42px; height: 60px; }
  .card .r, .card .s { font-size: 17px; }
  .seat .info { min-width: 120px; }
  .columns { grid-template-columns: 1fr; }
}
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); }
label.inline select { width: auto; display: inline; margin: 0; }
.small-btn { padding: 3px 10px; font-size: 13px; }
tr.total td { font-weight: 700; border-top: 2px solid #39424d; }
.stats-table input[type=checkbox] { width: auto; }
