:root {
  --bg: #0f1a15;
  --surface: #17251e;
  --surface-2: #1f3128;
  --line: #2c4237;
  --text: #f1efe7;
  --muted: #9db3a7;
  --accent: #e8c45a;
  --accent-ink: #1b1505;
  --felt: #13563b;
  --pos: #5fd394;
  --neg: #ff7a6b;
  --warn: #f2b24b;
  --radius: 14px;
  --tap: 52px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Rubik, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; }
h2 { font-size: 1.15rem; margin: 20px 0 10px; }
h3 { font-size: 1rem; margin: 22px 0 10px; color: var(--muted); font-weight: 600; }
h4 { margin: 18px 0 8px; color: var(--muted); }
p { margin: 0; }
main { max-width: 640px; margin: 0 auto; padding: 12px 16px calc(96px + env(safe-area-inset-bottom)); }

/* header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-title { flex: 1; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-sm { font-size: 1.5rem; color: var(--accent); width: 40px; text-align: center; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: 1.05rem; font-weight: 700; cursor: pointer;
}
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pos) 25%, transparent); }
body.offline .live-dot { background: var(--neg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--neg) 25%, transparent); }

/* cards and layout */
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.row-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.end { text-align: end; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.center { text-align: center; justify-content: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.empty { color: var(--muted); padding: 14px 4px; }
.hello { font-size: 1.4rem; font-weight: 700; margin: 8px 0 14px; }
details > summary { cursor: pointer; font-weight: 600; list-style: none; }
details > summary::before { content: '＋ '; color: var(--accent); }
details[open] > summary { margin-bottom: 12px; }
.label { font-size: .85rem; color: var(--muted); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .85rem; color: var(--muted); }
input, select {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.amount-input { font-size: 1.8rem; font-weight: 700; text-align: center; min-height: 64px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
form[data-game="cash"] .only-tour, form[data-game="tournament"] .only-cash { display: none; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 10px 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600;
}
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 40%, var(--line)); }
.btn.danger:not(.ghost) { background: var(--neg); color: #2a0703; }
.btn.big { min-height: var(--tap); font-size: 1.05rem; width: 100%; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn.on { outline: 2px solid var(--accent); }
.btn.wa { background: #1f8f4e; border-color: #1f8f4e; }
.fab {
  position: fixed; inset-inline-end: 16px; bottom: calc(18px + env(safe-area-inset-bottom));
  background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 14px 20px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}

/* segmented and tabs */
.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg > button, .seg > label { flex: 1; min-height: 42px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; display: grid; place-items: center; }
.seg > button.on, .seg > label:has(input:checked) { background: var(--surface-2); color: var(--text); }
.seg > label input { position: absolute; opacity: 0; pointer-events: none; }
.tabs { display: flex; gap: 6px; margin: 14px 0; border-bottom: 1px solid var(--line); }
.tab { flex: 1; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); padding: 10px 6px; font: inherit; font-weight: 600; cursor: pointer; }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; }

/* badges */
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge.live { background: color-mix(in srgb, var(--neg) 22%, transparent); color: var(--neg); }
.badge.scheduled { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.badge.closed { background: var(--surface-2); color: var(--muted); }
.rsvp-pill { font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.rsvp-pill.in { color: var(--pos); }
.rsvp-pill.out { color: var(--neg); }
.rsvp-pill.maybe { color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font-size: .8rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag { font-style: normal; font-size: .72rem; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); color: var(--muted); margin-inline-start: 4px; }

/* auth */
.auth { max-width: 420px; margin: 0 auto; padding: calc(40px + env(safe-area-inset-top)) 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.brand { text-align: center; }
.logo { width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 22px; background: var(--felt); display: grid; place-items: center; font-size: 2.6rem; color: var(--text); border: 3px dashed var(--accent); }
.brand h1 { font-size: 1.8rem; }

/* stats */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: .78rem; color: var(--muted); }
.stat b { font-size: 1.2rem; }
.stat.wide { grid-column: span 2; }
.stat.wide b { font-size: 1.8rem; }
.debt-card { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.debt-card div { display: flex; flex-direction: column; }
.debt-card b { font-size: 1.3rem; }
.chart { width: 100%; height: auto; margin-top: 8px; }
.chart .zero { stroke: var(--line); stroke-dasharray: 4 4; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.chart .pt.pos { fill: var(--pos); }
.chart .pt.neg { fill: var(--neg); }

/* group */
.invite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.invite code { font-size: 1.3rem; letter-spacing: .12em; padding: 6px 12px; background: var(--bg); border-radius: 10px; border: 1px dashed var(--accent); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-grid .wd { font-size: .75rem; color: var(--muted); padding-bottom: 4px; }
.day { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; font-size: .95rem;
  border: 0; background: none; color: inherit; font-family: inherit; cursor: pointer; padding: 0; }
.day:hover { background: var(--surface-2); }

.day.today { outline: 1px solid var(--accent); }
.day.has { background: var(--surface-2); font-weight: 700; }
.day a { position: absolute; inset: 0; display: grid; place-items: center; }
.day i { position: absolute; bottom: 4px; min-width: 6px; height: 6px; border-radius: 6px; background: var(--accent);
  font: 700 .55rem/10px system-ui, sans-serif; font-style: normal; color: var(--accent-ink); padding: 0; }
.day i:not(:empty) { height: 11px; min-width: 11px; padding: 0 2px; }
.cal-day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; scroll-margin-top: 80px; }
.day i.past { background: var(--muted); }
.day.sel, .day.has.sel { background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.day.sel i, .day.sel i.past { background: var(--accent-ink); color: var(--accent); }

/* session */
.session-head .big-title { font-size: 1.25rem; display: block; margin: 2px 0; }
.pot { display: flex; align-items: baseline; justify-content: space-between; background: var(--felt); border-color: color-mix(in srgb, var(--accent) 35%, var(--felt)); }
.pot b { font-size: 2rem; color: var(--accent); }
.ledger { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; }
.ledger-head, .ledger-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 12px 16px; }
.ledger-head.three, .ledger-row.three { grid-template-columns: 1fr auto auto; }
.ledger-head { font-size: .78rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.ledger-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: start; min-height: 64px; cursor: pointer; }
.ledger-row:last-child { border-bottom: 0; }
.ledger-row.mine { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.ledger-row.left { opacity: .6; }
.pname { font-weight: 600; font-size: 1.05rem; }
.pamount { text-align: end; display: flex; flex-direction: column; }
.pamount b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.pamount small { color: var(--muted); }
.ledger-row.flash { animation: flash 3s ease-out; }
@keyframes flash { 0%, 30% { background: color-mix(in srgb, var(--accent) 40%, transparent); } 100% { background: transparent; } }
.requests { border-color: var(--accent); }
.tools { margin-top: 18px; }
.end-btn { border-color: var(--accent); color: var(--accent); }
.close-panel { border-color: var(--accent); }
.close-row { display: grid; grid-template-columns: 1fr 140px; align-items: center; gap: 10px; }
.close-row b { text-align: center; }
.ok { color: var(--pos); font-weight: 700; }
.warn { color: var(--warn); font-weight: 700; }
.settle-preview { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.paid { opacity: .6; }
.quick { display: flex; gap: 8px; }
.quick .btn { flex: 1; min-height: 52px; font-size: 1.05rem; }

/* log */
.log { display: flex; flex-direction: column; }
.log-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.log-row .grow { flex: 1; display: flex; flex-direction: column; }
.log-row .amt { font-variant-numeric: tabular-nums; }
.log-row.reversed .grow, .log-row.reversed .amt { text-decoration: line-through; opacity: .55; }
.log-row.reversal .amt { color: var(--warn); }
.log-row.cash_out .amt { color: var(--pos); }

/* chat */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 58vh; overflow-y: auto; padding: 4px 0 10px; }
.msg { max-width: 80%; align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; }
.msg.mine { align-self: flex-end; background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.msg b { font-size: .8rem; color: var(--accent); }
.msg small { display: block; font-size: .7rem; color: var(--muted); text-align: end; }
.chat-form { display: flex; gap: 8px; position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); }

/* sheet + toast */
#sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.sheet {
  position: absolute; inset-inline: 0; bottom: 0; max-height: 88vh; overflow-y: auto;
  max-width: 640px; margin: 0 auto; background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px;
  animation: up .18s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 30; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--neg); color: #2a0703; }

@media (min-width: 700px) { main { padding-top: 20px; } }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.invite-banner { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); text-align: center; font-weight: 600; }
form:not([data-host="__other"]) .only-other { display: none; }
.cal-pick { display: flex; align-items: center; gap: 6px; }
.cal-pick select { min-height: 40px; width: auto; font-weight: 700; padding: 6px 10px; }

/* avatars */
.av { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; vertical-align: middle; background: var(--surface-2); }
.av-letter { display: inline-grid; place-items: center; color: #17110a; font-weight: 800; }
.with-av { display: inline-flex; align-items: center; gap: 10px; }
.me-btn { display: grid; place-items: center; border-radius: 50%; }
.me-btn .av { border: 2px solid var(--line); }
.pname .av { margin-inline-end: 6px; }
.photo-card { display: flex; align-items: center; gap: 16px; }
.photo-card label.btn { cursor: pointer; }
/* chat */
.msg-row { display: flex; align-items: flex-end; gap: 8px; }
.msg-row.mine { justify-content: flex-end; }
.msg-row .msg { max-width: 80%; }
.chat-form .meme-btn { min-width: 46px; padding: 0 10px; font-size: 1.3rem; }
.msg-meme { padding: 8px; }
.meme { position: relative; display: grid; justify-items: center; gap: 6px; padding: 10px 8px 8px; border-radius: 12px; background: #000; }
.meme .meme-av { border-radius: 14px; border: 3px solid #fff; }
.meme-text { color: #fff; font: 900 1.25rem/1.15 Impact, "Arial Black", system-ui, sans-serif; text-transform: uppercase; text-align: center;
  text-shadow: 2px 2px 0 #000, -2px 2px 0 #000, 2px -2px 0 #000, -2px -2px 0 #000; max-width: 240px; overflow-wrap: anywhere; }
.meme-by { font-size: .72rem; color: #bbb; }
.meme-pick { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.meme-friend { display: grid; justify-items: center; gap: 4px; background: none; border: 2px solid transparent; border-radius: 14px; padding: 6px; color: var(--text); font: inherit; font-size: .8rem; cursor: pointer; min-width: 72px; }
.meme-friend.on { border-color: var(--accent); background: var(--surface-2); }
.meme-preview { min-height: 170px; }
.msg-row.mine .msg { align-self: auto; background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }

.msg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.msg-head b { font-size: .8rem; color: var(--accent); }
.msg-del { background: none; border: 0; cursor: pointer; font-size: .85rem; opacity: .55; padding: 0 2px; }
.msg-del:hover { opacity: 1; }
.msg-deleted { opacity: .65; }
.msg .deleted { font-style: italic; color: var(--muted); }
.msg-av { align-self: flex-start; margin-top: 2px; }
.member-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.msg-row.mine { flex-direction: row-reverse; justify-content: flex-start; }

/* polls */
.poll { display: flex; flex-direction: column; gap: 10px; }
.poll.closed { opacity: .8; }
.poll-head { display: flex; gap: 10px; align-items: flex-start; }
.poll-q { font-size: 1.05rem; }
.poll-opt { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: start; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; color: var(--text); font: inherit; cursor: pointer; }
.poll-opt.on { border-color: var(--accent); }
.poll-opt:disabled { cursor: default; }
.poll-check { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; font-size: .8rem; font-weight: 900; color: var(--accent-ink); margin-top: 1px; }
.poll-check.sq { border-radius: 6px; }
.poll-opt.on .poll-check { background: var(--accent); border-color: var(--accent); }
.poll-body { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.poll-row { display: flex; justify-content: space-between; gap: 8px; }
.poll-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.poll-bar i { display: block; height: 100%; background: var(--pos); border-radius: 3px; transition: width .3s; }
.poll-opt.lead .poll-bar i { background: var(--accent); }
.poll-voters { display: flex; align-items: center; gap: 2px; }
.poll-voters .av { border: 2px solid var(--bg); margin-inline-start: -4px; }
.poll-voters small { margin-inline-start: 6px; }
.poll-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.poll-input { display: flex; gap: 8px; align-items: center; }

/* ---------- odds calculator ---------- */
.tool-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.odds-config { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; margin-bottom: 8px; }
.poker-table { isolation: isolate; position: relative; width: 100%; max-width: 520px; margin: 6px auto 14px; aspect-ratio: 3 / 4; }
.poker-table .felt {
  position: absolute; inset: 11% 13%; border-radius: 50% / 38%;
  background: radial-gradient(ellipse at center, #1c7a52 0%, var(--felt) 70%);
  border: 10px solid #5a3a22; box-shadow: inset 0 0 30px rgba(0,0,0,.45), 0 6px 18px rgba(0,0,0,.4);
}
.board { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; width: 70%; }
.street-label { display: block; font-size: .78rem; color: #d7efe1; opacity: .8; margin-bottom: 4px; letter-spacing: .04em; }
.board-cards { display: flex; justify-content: center; gap: 4px; }
.board-cards.hole { justify-content: flex-start; gap: 8px; margin: 6px 0 12px; }
.slot { padding: 0; border: 0; background: none; cursor: pointer; }
.board-cards { direction: ltr; }
.board-cards .slot:nth-child(4) { margin-left: 6px; }
.pc {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 38px; height: 54px; border-radius: 6px; background: #fbfaf5; color: #15130f;
  font-weight: 800; font-size: 1rem; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.pc i { font-style: normal; font-size: 1.05rem; }
.pc.red { color: #c8281c; }
.pc.empty { background: rgba(255,255,255,.08); border: 1.5px dashed rgba(255,255,255,.4); color: rgba(255,255,255,.6); box-shadow: none; }
.pc.mini { width: 19px; height: 26px; font-size: .68rem; border-radius: 3px; }
.pc.mini i { font-size: .62rem; }
.seat {
  position: absolute; transform: translate(-50%, -50%); width: 86px; padding: 4px 3px 5px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; color: var(--text);
  font: inherit; cursor: pointer; z-index: 1;
}
.seat.lead { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.seat.empty { width: 46px; height: 46px; border-radius: 50%; border-style: dashed; background: rgba(0,0,0,.25); color: var(--muted); font-size: 1.3rem; justify-content: center; }
.seat-name { font-size: .74rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-cards { display: flex; gap: 1px; }
.seat-pct { font-size: .85rem; color: var(--accent); }
.seat-hand { font-size: .62rem; color: var(--muted); white-space: nowrap; }
.poker-table[style*="--seats:9"] .seat:not(.empty), .poker-table[style*="--seats:10"] .seat:not(.empty) { width: 74px; }
.odds-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.odds-actions .btn { flex: 1 1 auto; }
.odds-row { width: 100%; text-align: start; font: inherit; color: inherit; cursor: pointer; }
.odds-row-top { display: flex; align-items: center; gap: 8px; }
.odds-row-top b:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.odds-cards { display: flex; gap: 2px; }
.odds-eq { min-width: 58px; text-align: end; color: var(--accent); }
.odds-bar { height: 6px; border-radius: 3px; background: var(--bg); margin: 8px 0 6px; overflow: hidden; }
.odds-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .25s; }
.card-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; margin: 8px 0 14px; }
.pick {
  aspect-ratio: 5 / 7; border: 0; border-radius: 4px; background: #fbfaf5; color: #15130f; font: inherit;
  font-weight: 800; font-size: .72rem; line-height: 1; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer;
}
.pick i { font-style: normal; font-size: .7rem; }
.pick.red { color: #c8281c; }
.pick:disabled { opacity: .18; cursor: default; }
.pick.on { outline: 3px solid var(--accent); outline-offset: 1px; }

/* ---------- reactions, emoji, hand photos ---------- */
.reacts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.react {
  display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: .95rem; cursor: pointer;
}
.react b { font-size: .78rem; color: var(--muted); }
.react.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, var(--surface-2)); }
.react.mine b { color: var(--accent); }
.react.ghost { background: transparent; opacity: .75; }
.react.more { color: var(--muted); font-weight: 700; }
.msg .reacts .react { min-height: 26px; padding: 1px 7px; font-size: .85rem; }
.msg-head > span { display: inline-flex; gap: 2px; }
.react-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 12px; }
.react-pick {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font: inherit; cursor: pointer;
}
.react-pick span { font-size: 1.7rem; line-height: 1.1; }
.react-pick small { font-size: .7rem; color: var(--muted); text-align: center; }
.react-pick.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, var(--surface-2)); }
.who { display: grid; gap: 6px; margin-bottom: 12px; }
.who-row { display: flex; gap: 10px; align-items: baseline; font-size: .9rem; }
.who-row span:first-child { font-size: 1.2rem; }
.emoji-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 6px 0 12px; }
.emoji-grid button { font-size: 1.6rem; background: none; border: 0; padding: 6px 0; border-radius: 10px; cursor: pointer; }
.emoji-grid button:active { background: var(--surface-2); }
.upload-hand { margin-bottom: 6px; }
.hand-card { padding: 12px; }
.hand-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hand-img { display: block; width: 100%; padding: 0; border: 0; background: #000; border-radius: 10px; overflow: hidden; cursor: zoom-in; }
.hand-img img { display: block; width: 100%; max-height: 70vh; object-fit: contain; }
.hand-caption { margin: 8px 0 2px; white-space: pre-wrap; }
.photo-full { margin: 4px 0 10px; border-radius: 10px; overflow: hidden; background: #000; }
.photo-full img { display: block; width: 100%; max-height: 62vh; object-fit: contain; }

/* ---------- account menu ---------- */
button.me-btn { background: none; border: 0; padding: 0; cursor: pointer; }
.user-menu {
  position: fixed; top: calc(62px + env(safe-area-inset-top)); inset-inline-end: 12px; z-index: 25; width: min(320px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px;
  box-shadow: 0 18px 40px rgba(0,0,0,.55); display: flex; flex-direction: column; animation: um-in .14s ease-out;
}
@keyframes um-in { from { opacity: 0; transform: translateY(-6px); } }
.um-head { display: flex; gap: 12px; align-items: center; padding: 10px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.um-who { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; gap: 1px; }
.um-who b { font-size: 1.05rem; }
.um-who span { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.user-menu > a, .user-menu > button {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px;
  color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; text-align: start; cursor: pointer;
}
.user-menu > a:hover, .user-menu > button:hover, .user-menu > a:focus-visible, .user-menu > button:focus-visible { background: var(--surface-2); outline: none; }
.user-menu > .danger { color: var(--neg); }
.um-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ---------- context help ---------- */
.help-panel { display: none; }
.help-btn { font-size: 1rem; }
.help-title { font-size: .8rem; font-weight: 700; color: var(--accent); letter-spacing: .03em; margin-bottom: 4px; }
.help-panel h4, .help-sheet h4 { margin: 4px 0 6px; color: var(--text); font-size: 1.05rem; }
.help-panel p, .help-sheet p { margin: 0 0 10px; }
.help-panel ul, .help-sheet ul { margin: 0 0 12px; padding-inline-start: 18px; display: grid; gap: 8px; line-height: 1.45; }
.help-last { border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-radius: 12px; padding: 10px 12px; }
.help-last p { margin: 4px 0 0; }
.help-sheet { margin-bottom: 12px; }
@media (min-width: 1280px) {
  .help-panel {
    display: block; position: fixed; top: calc(84px + env(safe-area-inset-top)); right: 24px; width: 290px;
    max-height: calc(100vh - 108px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px 18px; font-size: .92rem;
  }
  .help-btn { display: none; }
}

/* ---------- poll sharing ---------- */
.poll.focus { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.wa-ghost { color: #4fd18b; text-decoration: none; }
.wa-preview {
  background: #0b141a; border: 1px solid #22313a; border-radius: 12px; padding: 10px 12px; margin: 6px 0 12px;
  font-size: .9rem; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; color: #e9edef;
}
a.btn.wa { display: grid; place-items: center; text-decoration: none; color: #fff; margin-bottom: 10px; }

/* show / hide password */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-inline-end: 52px; }
.pw-wrap input[dir="ltr"] { padding-right: 52px; padding-left: 12px; }
.pw-eye {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 44px; height: 40px;
  border: 0; background: none; font-size: 1.15rem; cursor: pointer; border-radius: 8px; opacity: .8;
}
.pw-eye:hover, .pw-eye[aria-pressed="true"] { opacity: 1; background: var(--surface-2); }

/* ---------- places ---------- */
form[data-host="__other"] .not-other { display: none; }
.place-card { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.place-card.empty { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.place-text { display: flex; gap: 6px; align-items: baseline; }
.place-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.place-btns .btn { text-decoration: none; flex: 1 1 auto; justify-content: center; }
.nav-g { background: #1a73e8; border-color: #1a73e8; color: #fff; }
.nav-w { background: #33ccff; border-color: #33ccff; color: #05202b; }
.pin-state a { color: var(--accent); }

/* ---------- light theme (dark is the default above) ---------- */
:root[data-theme="light"] {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --surface-2: #ece6d9;
  --line: #d9d1c1;
  --text: #1d1a14;
  --muted: #676257;
  --accent: #a87a0c;
  --accent-ink: #ffffff;
  --felt: #13563b;
  --pos: #1b7f47;
  --neg: #c23b2a;
  --warn: #a76a12;
  color-scheme: light;
}
:root[data-theme="light"] .wa-ghost { color: #15803d; }
:root[data-theme="light"] .user-menu { box-shadow: 0 18px 40px rgba(60,45,20,.18); }
:root[data-theme="light"] .sheet-backdrop { background: rgba(30,25,15,.4); }
:root[data-theme="light"] .poker-table .felt { border-color: #7a5230; }
:root[data-theme="light"] .seat { box-shadow: 0 2px 6px rgba(0,0,0,.12); }
:root[data-theme="light"] .seat.empty { background: rgba(255,255,255,.75); }

/* language list */
.lang-select { width: auto; min-height: 40px; padding: 6px 12px; font-weight: 600; }
.lang-select.wide { width: 100%; min-height: 48px; }
