:root {
  --bg: #0a0e13;
  --bg-2: #0f151c;
  --panel: #131a23;
  --panel-2: #1a2330;
  --panel-3: #222d3c;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #e9eef4;
  --muted: #8a97a8;
  --dim: #5d6a7b;
  --green: #22c55e;
  --green-2: #16a34a;
  --red: #ef4444;
  --blue: #3b82f6;
  --gold: #f6c453;
  --felt-1: #1f7a5e;
  --felt-2: #125540;
  --felt-3: #0b3a2c;
  --s-spade: #1b2230;
  --s-heart: #d92b2b;
  --s-diamond: #2563eb;
  --s-club: #138a43;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
body.two-color { --s-diamond: #d92b2b; --s-club: #1b2230; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; }
body { overflow: hidden; overscroll-behavior: none; }
#app { height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
input, select, textarea { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; font-weight: 600; background: var(--panel-3); border: 1px solid var(--line-2); transition: transform .08s, background .15s, opacity .15s, border-color .15s; white-space: nowrap; user-select: none; }
.btn:hover { background: #2a3749; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.primary { background: linear-gradient(180deg, #2bd168, #19a64f); border-color: transparent; color: #04140a; }
.btn.primary:hover { background: linear-gradient(180deg, #34dc72, #1db457); }
.btn.danger { background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .35); color: #ff9b9b; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.icon-btn { height: 36px; min-width: 36px; padding: 0 10px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-weight: 600; font-size: 13px; position: relative; transition: background .15s, color .15s; }
.icon-btn:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; flex: none; }
.badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
kbd { font-family: var(--mono); font-size: 10px; opacity: .55; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; line-height: 14px; }

/* ---------- lobby ---------- */
.lobby { height: 100%; overflow-y: auto; background:
  radial-gradient(1200px 600px at 15% -10%, rgba(34, 197, 94, .14), transparent 60%),
  radial-gradient(900px 500px at 100% 0%, rgba(59, 130, 246, .10), transparent 60%), var(--bg); }
.lobby-inner { max-width: 1120px; margin: 0 auto; padding: 48px 20px 64px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(145deg, #2bd168, #0f7a3c); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(34, 197, 94, .3); }
.brand-mark svg { width: 22px; height: 22px; }
.hero { margin: 56px 0 36px; }
.hero h1 { font-size: clamp(34px, 6vw, 58px); line-height: 1.02; letter-spacing: -.035em; margin: 0 0 14px; font-weight: 800; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, #4ade80, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 17px; max-width: 560px; margin: 0; line-height: 1.5; }
.cards-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
@media (max-width: 920px) { .cards-grid { grid-template-columns: 1fr; } }
.lcard { background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01)); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.lcard h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.lcard h2 .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .06); }
.lcard p.sub { margin: -6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text); cursor: pointer; user-select: none; }
.toggle input { display: none; }
.toggle .sw { width: 38px; height: 22px; border-radius: 11px; background: var(--panel-3); position: relative; transition: background .2s; flex: none; border: 1px solid var(--line-2); }
.toggle .sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #cfd8e3; transition: transform .2s; }
.toggle input:checked + .sw { background: var(--green-2); }
.toggle input:checked + .sw::after { transform: translateX(16px); background: #fff; }
.seg { display: flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; height: 32px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--panel-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row output { min-width: 28px; text-align: right; font-weight: 700; }
.recent { margin-top: 36px; }
.recent h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
.recent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.recent-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.recent-item:hover { border-color: var(--line-2); transform: translateY(-1px); }
.recent-item b { display: block; font-size: 14px; }
.recent-item span { font-size: 12px; color: var(--muted); }
.features { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; color: var(--muted); font-size: 13px; }
.features span { display: inline-flex; align-items: center; gap: 7px; }
.features i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; }

/* ---------- game layout ---------- */
.game { height: 100%; display: grid; grid-template-rows: 56px 1fr auto; grid-template-columns: 1fr 330px; grid-template-areas: "top top" "stage side" "dock side"; }
@media (max-width: 1100px) { .game { grid-template-columns: 1fr; grid-template-areas: "top" "stage" "dock"; } }
.topbar { grid-area: top; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); background: rgba(10, 14, 19, .85); z-index: 20; min-width: 0; }
.topbar .brand-mark { width: 30px; height: 30px; border-radius: 9px; flex: none; }
.topbar .brand-mark svg { width: 17px; height: 17px; }
.t-title { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.t-title b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-title span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.topbar .spacer { flex: 1; }
.conn { font-size: 12px; color: var(--gold); display: none; align-items: center; gap: 6px; }
.conn.on { display: inline-flex; }
.conn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.only-narrow { display: none !important; }
@media (max-width: 1100px) { .only-narrow { display: inline-flex !important; } }
@media (max-width: 640px) { .hide-sm { display: none !important; } .topbar { padding: 0 6px 0 10px; gap: 2px; } }

.stage { grid-area: stage; position: relative; min-height: 0; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, #13202a 0%, var(--bg) 70%); }
.table-wrap { position: relative; width: 100%; height: 100%; display: grid; place-items: center; padding: 64px 110px 74px; }
.table { position: relative; aspect-ratio: 2.05 / 1; width: min(100%, calc((100vh - 56px - 96px - 138px) * 2.05)); max-width: 1100px; }
.felt { position: absolute; inset: 0; border-radius: 999px; background: radial-gradient(ellipse at 50% 40%, var(--felt-1) 0%, var(--felt-2) 55%, var(--felt-3) 100%);
  box-shadow: 0 0 0 10px #10171e, 0 0 0 12px #263241, 0 30px 80px rgba(0, 0, 0, .65), inset 0 0 60px rgba(0, 0, 0, .45); }
.felt::before { content: ""; position: absolute; inset: 7%; border-radius: 999px; border: 2px solid rgba(255, 255, 255, .06); }
.felt::after { content: "POKER NIGHT"; position: absolute; left: 50%; top: 73%; transform: translate(-50%, -50%); font-weight: 900; letter-spacing: .4em; font-size: clamp(10px, 1.4vw, 16px); color: rgba(255, 255, 255, .06); white-space: nowrap; }

body.portrait .table-wrap { padding: 46px 8px 64px; }
body.portrait .table { aspect-ratio: 1 / 1.62; width: min(calc(100vw - 96px), calc((100% - 0px) / 1.62)); height: auto; max-height: calc(100% - 20px); }
body.portrait .felt::after { top: 64%; letter-spacing: .25em; }

/* center: pot / board / banner */
.center { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 2; pointer-events: none; }
.pot { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px 0 6px; border-radius: 14px; background: rgba(0, 0, 0, .35); font-weight: 700; font-size: 14px; transition: opacity .2s; }
.pot .lbl { font-size: 10px; letter-spacing: .1em; color: rgba(255, 255, 255, .55); font-weight: 800; }
.pot.empty { opacity: 0; }
.pot-total { font-size: 11px; color: rgba(255, 255, 255, .55); font-weight: 600; height: 14px; margin-top: -6px; }
.board { display: flex; gap: 6px; --cw: var(--bcw, 56px); }
.slot { width: var(--cw); height: calc(var(--cw) * 1.4); border-radius: calc(var(--cw) * .1); border: 1.5px dashed rgba(255, 255, 255, .09); }
.banner { min-height: 30px; display: flex; align-items: center; justify-content: center; }
.banner > div { padding: 6px 14px; border-radius: 999px; background: rgba(0, 0, 0, .5); border: 1px solid rgba(246, 196, 83, .45); color: var(--gold); font-weight: 700; font-size: 13px; white-space: nowrap; animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); }
.center-cta { pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.center-cta .msg { font-size: 14px; color: rgba(255, 255, 255, .8); font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.center-cta .row { gap: 8px; }
body.portrait .board { gap: 4px; }

/* cards */
.card { width: var(--cw); height: calc(var(--cw) * 1.4); border-radius: calc(var(--cw) * .1); background: linear-gradient(180deg, #fff, #f1f3f6); position: relative; box-shadow: 0 2px 6px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(0, 0, 0, .08); flex: none; overflow: hidden; color: var(--sc); transition: opacity .3s, filter .3s, transform .3s; }
.card .r { position: absolute; left: 9%; top: 3%; font-weight: 800; font-size: calc(var(--cw) * .52); line-height: 1; letter-spacing: -.05em; }
.card .s1 { position: absolute; left: 10%; top: 42%; font-size: calc(var(--cw) * .3); line-height: 1; }
.card .s2 { position: absolute; right: 6%; bottom: 2%; font-size: calc(var(--cw) * .58); line-height: 1; }
.card.s { --sc: var(--s-spade); } .card.h { --sc: var(--s-heart); } .card.d { --sc: var(--s-diamond); } .card.c { --sc: var(--s-club); }
body.fourc .card.d, body.fourc .card.c { background: var(--sc); color: #fff; }
body.fourc .card.s { background: #2b3445; color: #fff; }
body.fourc .card.h { background: var(--s-heart); color: #fff; }
.card.back { background: #8f1d2c; box-shadow: 0 2px 6px rgba(0, 0, 0, .5), inset 0 0 0 2px rgba(255, 255, 255, .85); }
.card.back::before { content: ""; position: absolute; inset: 4px; border-radius: calc(var(--cw) * .06); background:
  repeating-linear-gradient(45deg, rgba(255, 255, 255, .13) 0 2px, transparent 2px 7px),
  repeating-linear-gradient(-45deg, rgba(255, 255, 255, .13) 0 2px, transparent 2px 7px), #b02437; }
.card.dim { filter: brightness(.45) saturate(.6); }
.card.win { transform: translateY(-5px); box-shadow: 0 0 0 2px var(--gold), 0 6px 16px rgba(246, 196, 83, .35); }
.card.deal { animation: deal .32s cubic-bezier(.2, .9, .3, 1.1) both; }
.card.flip { animation: flip .42s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes deal { from { opacity: 0; transform: translate(var(--fx, 0), var(--fy, -40px)) scale(.6) rotate(-12deg); } }
@keyframes flip { from { opacity: 0; transform: perspective(500px) rotateY(95deg) scale(.9); } }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }

/* seats */
.seat { position: absolute; transform: translate(-50%, -50%); width: var(--sw); z-index: 3; --sw: 158px; --cw: 40px; display: flex; flex-direction: column; align-items: center; }
.seat .hole { display: flex; justify-content: center; height: calc(var(--cw) * 1.4 * .72); margin-bottom: -2px; position: relative; z-index: 0; }
.seat .hole .card { margin: 0 -3px; transform: rotate(var(--rot, 0deg)); transform-origin: 50% 120%; }
.seat .hole.n4 .card { margin: 0 calc(var(--cw) * -.3); }
.seat .hole.n5 .card { margin: 0 calc(var(--cw) * -.4); }
.seat .hole .card.win { transform: translateY(-7px) rotate(var(--rot, 0deg)); }
.seat.me { --cw: 58px; --sw: 186px; }
.seat.me .hole { height: calc(var(--cw) * 1.4 * .82); }
.pod { position: relative; z-index: 1; width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 10px 7px 7px; border-radius: 14px; background: linear-gradient(180deg, #1b2532, #121a24); border: 1px solid var(--line-2); box-shadow: 0 8px 22px rgba(0, 0, 0, .5); transition: opacity .25s, border-color .2s, box-shadow .2s, transform .2s; }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; background: var(--av, #475569); position: relative; }
.avatar .bot-ic { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; background: #0b1118; display: grid; place-items: center; font-size: 9px; border: 1px solid var(--line-2); }
.avatar .dot { position: absolute; right: -1px; top: -1px; width: 10px; height: 10px; border-radius: 50%; background: #64748b; border: 2px solid #121a24; }
.avatar .dot.on { background: var(--green); }
.pod .info { min-width: 0; flex: 1; line-height: 1.2; }
.pod .nm { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #cfd8e3; }
.pod .st { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tag { position: absolute; top: -11px; right: 8px; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; display: flex; align-items: center; background: #334155; color: #e2e8f0; opacity: 0; transform: translateY(4px) scale(.9); transition: opacity .18s, transform .18s; pointer-events: none; z-index: 2; }
.tag.on { opacity: 1; transform: none; }
.tag.call, .tag.check { background: #1e3a5f; color: #93c5fd; }
.tag.raise, .tag.bet { background: #14532d; color: #86efac; }
.tag.allin { background: #7c2d12; color: #fdba74; }
.tag.fold { background: #3f3f46; color: #a1a1aa; }
.tag.think { background: #312e81; color: #c7d2fe; }
.tag.out { background: #3f3f46; color: #d4d4d8; }
.timer { position: absolute; left: 10px; right: 10px; bottom: 3px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .08); overflow: hidden; opacity: 0; }
.timer i { position: absolute; inset: 0; background: var(--green); transform-origin: left; border-radius: 2px; }
.timer.on { opacity: 1; }
.timer.warn i { background: var(--red); }
.seat.turn .pod { border-color: rgba(34, 197, 94, .9); box-shadow: 0 0 0 3px rgba(34, 197, 94, .22), 0 10px 30px rgba(0, 0, 0, .5); transform: translateY(-2px); }
.seat.folded .pod { opacity: .45; }
.seat.folded .hole { opacity: 0; }
.seat.me.folded .hole { opacity: .4; }
.seat.away .pod { opacity: .55; }
.seat.winner .pod { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246, 196, 83, .25), 0 0 34px rgba(246, 196, 83, .3); }
.seat.leaving .nm::after { content: " · leaving"; color: var(--muted); font-weight: 500; }
.empty-seat { position: absolute; transform: translate(-50%, -50%); z-index: 3; width: 112px; height: 50px; border-radius: 14px; border: 1.5px dashed rgba(255, 255, 255, .16); display: grid; place-items: center; color: rgba(255, 255, 255, .5); font-weight: 700; font-size: 12px; transition: all .15s; background: rgba(0, 0, 0, .15); }
.empty-seat.can:hover { border-color: var(--green); color: var(--green); background: rgba(34, 197, 94, .08); }
.empty-seat.pending { border-style: solid; color: var(--gold); border-color: rgba(246, 196, 83, .4); font-size: 11px; text-align: center; padding: 0 6px; }
.empty-seat.dead { opacity: .3; pointer-events: none; }
.float-win { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); color: var(--gold); font-weight: 900; font-size: 18px; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); animation: floatup 2.4s ease-out forwards; pointer-events: none; z-index: 5; white-space: nowrap; }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -34px); } }
.win-hand { position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 700; color: var(--gold); background: rgba(0, 0, 0, .65); padding: 2px 8px; border-radius: 8px; z-index: 4; }
.my-hand { position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 700; color: #cfe9da; background: rgba(0, 0, 0, .55); padding: 2px 9px; border-radius: 8px; z-index: 4; }

/* bets, dealer button, chips */
.bet { position: absolute; transform: translate(-50%, -50%); z-index: 2; display: flex; align-items: center; gap: 5px; padding: 2px 9px 2px 3px; border-radius: 12px; background: rgba(0, 0, 0, .38); font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; transition: opacity .2s; white-space: nowrap; }
.bet.empty { opacity: 0; pointer-events: none; }
.chip { width: 18px; height: 18px; border-radius: 50%; flex: none; background: radial-gradient(circle at 50% 50%, var(--cc, #ef4444) 0 45%, #fff 46% 52%, var(--cc, #ef4444) 53%); box-shadow: 0 1px 2px rgba(0, 0, 0, .6), inset 0 0 0 2px rgba(255, 255, 255, .5); }
.chip.c1 { --cc: #e2e8f0; } .chip.c2 { --cc: #ef4444; } .chip.c3 { --cc: #3b82f6; } .chip.c4 { --cc: #22c55e; } .chip.c5 { --cc: #111827; } .chip.c6 { --cc: #a855f7; } .chip.c7 { --cc: #f59e0b; }
.flychip { position: absolute; z-index: 30; pointer-events: none; }
.dealer-btn { position: absolute; width: 24px; height: 24px; border-radius: 50%; transform: translate(-50%, -50%); background: linear-gradient(180deg, #fff, #d5dbe3); color: #111; font-weight: 900; font-size: 12px; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .55); z-index: 2; transition: left .5s cubic-bezier(.4, 0, .2, 1), top .5s cubic-bezier(.4, 0, .2, 1), opacity .3s; }

body.portrait .seat { --sw: 100px; --cw: 30px; }
body.portrait .seat.me { --sw: 150px; --cw: 50px; }
body.portrait .pod { padding: 5px 7px 5px 5px; gap: 6px; border-radius: 11px; }
body.portrait .avatar { width: 26px; height: 26px; font-size: 12px; }
body.portrait .seat:not(.me) .avatar { display: none; }
body.portrait .pod .nm { font-size: 11px; }
body.portrait .pod .st { font-size: 13px; }
body.portrait .empty-seat { width: 74px; height: 40px; font-size: 11px; }
body.portrait .bet { font-size: 12px; }
body.portrait .tag { right: 4px; font-size: 9px; height: 18px; padding: 0 6px; }

/* ---------- dock (my controls) ---------- */
.dock { grid-area: dock; position: relative; z-index: 15; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(10, 14, 19, .92); min-height: 76px; }
.dock-left { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.dock-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.act-row { display: flex; gap: 8px; }
.act { height: 52px; min-width: 116px; padding: 0 18px; border-radius: 12px; font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s, filter .15s, opacity .15s; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.act:active { transform: scale(.96); }
.act:hover { filter: brightness(1.1); }
.act.fold { background: #2a1517; color: #fca5a5; border: 1px solid rgba(239, 68, 68, .4); }
.act.fold.confirm { background: var(--red); color: #fff; }
.act.call { background: linear-gradient(180deg, #2b6de0, #1f55b8); color: #fff; }
.act.raise { background: linear-gradient(180deg, #2bd168, #19a64f); color: #04140a; }
.act .sub { font-weight: 700; opacity: .85; }
.pre-row { display: flex; gap: 6px; }
.pre { height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--muted); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; }
.pre::before { content: ""; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid currentColor; opacity: .7; }
.pre.on { color: #04140a; background: var(--green); border-color: var(--green); }
.pre.on::before { background: #04140a; border-color: #04140a; opacity: 1; box-shadow: inset 0 0 0 2px var(--green); }
.raise-panel { width: min(470px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); animation: pop .18s ease-out; }
.presets { display: flex; gap: 6px; }
.presets button { flex: 1; height: 34px; border-radius: 8px; background: var(--panel-3); font-weight: 700; font-size: 12px; color: #cbd5e1; transition: background .12s; }
.presets button:hover { background: #2c3a4d; }
.presets button:disabled { opacity: .35; }
.slider-row { display: flex; align-items: center; gap: 10px; }
.slider-row input[type=number] { width: 120px; height: 40px; font-weight: 800; font-size: 16px; text-align: right; }
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--green) var(--p, 0%), var(--panel-3) var(--p, 0%)); border: 0; padding: 0; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); cursor: grab; }
input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 0; }
input[type=range]:focus { box-shadow: none; }
.dock-msg { color: var(--muted); font-size: 13px; font-weight: 600; padding: 0 4px; align-self: center; }
.mystack { display: flex; flex-direction: column; padding-right: 8px; margin-right: 2px; border-right: 1px solid var(--line); line-height: 1.2; }
.mystack span { font-size: 11px; color: var(--muted); font-weight: 600; }
.mystack b { font-size: 17px; }
@media (max-width: 640px) {
  .dock { flex-direction: column; align-items: stretch; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 8px; min-height: 0; }
  .dock-right { align-items: stretch; }
  .act-row, .pre-row { width: 100%; }
  .act { flex: 1; min-width: 0; height: 50px; padding: 0 8px; font-size: 14px; }
  .act kbd, .pre kbd { display: none; }
  .pre { flex: 1; justify-content: center; padding: 0 6px; font-size: 12px; }
  .dock-left { justify-content: space-between; }
  .raise-panel { width: 100%; }
  .slider-row input[type=number] { width: 96px; }
}

/* ---------- side panel ---------- */
.side { grid-area: side; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--bg-2); z-index: 25; }
@media (max-width: 1100px) {
  .side { grid-area: auto; position: fixed; right: 0; top: 0; bottom: 0; width: min(380px, 92vw); transform: translateX(105%); transition: transform .25s cubic-bezier(.4, 0, .2, 1); box-shadow: -20px 0 60px rgba(0, 0, 0, .5); }
  .side.open { transform: none; }
}
.tabs { display: flex; gap: 4px; padding: 10px 10px 0; border-bottom: 1px solid var(--line); }
.tabs button { height: 36px; padding: 0 14px; font-weight: 700; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; position: relative; }
.tabs button.on { color: var(--text); border-color: var(--green); }
.tabs .close { margin-left: auto; }
.feed { flex: 1; overflow-y: auto; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; overscroll-behavior: contain; }
.feed .ln { padding: 2px 0; color: #b6c2d1; word-wrap: break-word; }
.feed .ln.hd { color: var(--text); font-weight: 700; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.feed .ln.win { color: var(--gold); }
.feed .ln time { color: var(--dim); font-size: 11px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.feed .cc { display: inline-flex; align-items: center; gap: 1px; padding: 0 4px; border-radius: 4px; font-weight: 800; background: #fff; color: var(--sc); font-size: 11.5px; line-height: 16px; margin: 0 1px; }
.feed .cc.s { --sc: var(--s-spade); } .feed .cc.h { --sc: var(--s-heart); } .feed .cc.d { --sc: var(--s-diamond); } .feed .cc.c { --sc: var(--s-club); }
.chat .msg { padding: 4px 0; }
.chat .msg b { color: var(--text); margin-right: 6px; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; height: 40px; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 24; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.on { opacity: 1; pointer-events: auto; }

/* ---------- modals ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(3, 6, 10, .66); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: rise .22s cubic-bezier(.2, .9, .3, 1); }
.modal.wide { width: min(760px, 100%); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px 6px; }
.modal-h h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.modal-h .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.modal-b { padding: 12px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 0 20px 20px; }
.htabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.htabs button { height: 38px; padding: 0 12px; font-weight: 700; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; position: relative; }
.htabs button.on { color: var(--text); border-color: var(--green); }
.htabs .badge { position: static; display: inline-grid; margin-left: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid3 { grid-template-columns: 1fr 1fr; } }
.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.li .grow { flex: 1; min-width: 0; }
.li .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .grow span { font-size: 12px; color: var(--muted); }
.li input { width: 100px; height: 34px; padding: 6px 10px; }
.empty-note { color: var(--muted); text-align: center; padding: 18px; font-size: 13px; }
.bot-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bot-pick button { text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 3px; transition: border-color .15s, background .15s; }
.bot-pick button.on { border-color: var(--green); background: rgba(34, 197, 94, .08); }
.bot-pick b { font-size: 13px; }
.bot-pick span { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.lvl { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; background: var(--panel-3); color: var(--muted); margin-left: 6px; }

/* ledger */
.ledger-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.ledger-table th { text-align: right; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 8px 8px; border-bottom: 1px solid var(--line); }
.ledger-table td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.ledger-table th:first-child, .ledger-table td:first-child { text-align: left; }
.ledger-table td.money { font-weight: 800; font-size: 14px; }
.ledger-table tr.bot td { color: var(--muted); }
.ledger-table .who { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.ledger-table .who .avatar { width: 24px; height: 24px; font-size: 11px; }
@media (max-width: 560px) { .ledger-table .opt { display: none; } }
.settle { display: flex; flex-direction: column; gap: 8px; }
.pay { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: linear-gradient(90deg, rgba(239, 68, 68, .07), rgba(34, 197, 94, .07)); border: 1px solid var(--line); }
.pay .p { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.pay .p span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay .avatar { width: 28px; height: 28px; font-size: 12px; }
.pay .arrow { color: var(--muted); font-size: 12px; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.pay .arrow svg { width: 26px; height: 14px; }
.pay .amt { font-weight: 900; font-size: 17px; color: var(--gold); }
.section-t { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; margin: 4px 0 -4px; display: flex; justify-content: space-between; align-items: center; }
.note { font-size: 12px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; line-height: 1.45; }
.all-square { text-align: center; padding: 18px; color: var(--muted); }

/* toasts */
#toasts { position: fixed; top: 66px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 12px; background: #1f2937; border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-weight: 600; font-size: 13px; animation: rise .2s; pointer-events: auto; max-width: 90vw; }
.toast.err { background: #3b1518; border-color: rgba(239, 68, 68, .5); color: #fecaca; }
.toast.ok { border-color: rgba(34, 197, 94, .5); }
.toast.req { cursor: pointer; border-color: rgba(246, 196, 83, .5); }

.notfound { height: 100%; display: grid; place-items: center; text-align: center; }
.notfound h2 { margin: 0 0 8px; }
.seat.me .hole.n4 .card { margin: 0 calc(var(--cw) * -.22); }
.seat.me .hole.n5 .card { margin: 0 calc(var(--cw) * -.3); }

/* host's on-table approval panel */
.reqpanel { position: absolute; top: 12px; left: 12px; z-index: 12; width: min(340px, calc(100% - 24px)); background: rgba(19, 26, 35, .96); border: 1px solid rgba(246, 196, 83, .45); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 14px 40px rgba(0, 0, 0, .55); animation: rise .25s; }
.rp-h { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); padding: 0 2px; }
.rp { display: flex; align-items: center; gap: 10px; }
.rp .avatar { width: 30px; height: 30px; font-size: 13px; }
.rp .grow { flex: 1; min-width: 0; line-height: 1.25; }
.rp .grow b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp .grow span { font-size: 11.5px; color: var(--muted); }
.rp-b { width: 36px; height: 36px; border-radius: 10px; font-weight: 900; font-size: 15px; flex: none; transition: transform .08s, filter .15s; }
.rp-b:active { transform: scale(.94); }
.rp-b.yes { background: var(--green); color: #04140a; }
.rp-b.no { background: rgba(239, 68, 68, .16); color: #fca5a5; border: 1px solid rgba(239, 68, 68, .4); }
.center { max-width: 86%; }
.center-cta .row { flex-wrap: wrap; justify-content: center; }
.center-cta .row > * { flex: none; }
body.portrait .center-cta .btn { height: 36px; padding: 0 12px; font-size: 13px; }
body.portrait .center-cta .msg { font-size: 13px; }
body.portrait .reqpanel { top: 8px; left: 8px; width: calc(100% - 16px); }

/* accounts & payments */
.lobby-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acct-row { display: flex; align-items: center; gap: 6px; }
.acct-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 4px; border-radius: 18px; background: var(--panel-2); border: 1px solid var(--line-2); font-weight: 700; font-size: 13px; transition: background .15s; }
.acct-btn:hover { background: var(--panel-3); }
.acct-btn .avatar { width: 28px; height: 28px; font-size: 12px; }
.acct-btn > span:only-child { padding-left: 8px; }
.dues-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 -18px; padding: 10px 12px 10px 16px; border-radius: 12px; background: rgba(246, 196, 83, .1); border: 1px solid rgba(246, 196, 83, .45); color: #fde7b0; font-size: 13px; }
.dues-strip.floating { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); margin: 0; z-index: 11; width: min(520px, calc(100% - 24px)); background: rgba(40, 33, 14, .95); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.reqpanel:not(.hidden) ~ .dues-strip, .dues-strip.floating:has(~ .reqpanel:not(.hidden)) { top: auto; bottom: 10px; }
.debt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); flex-wrap: wrap; }
.debt.owe { border-left: 3px solid var(--red); }
.debt.owed { border-left: 3px solid var(--green); }
.debt.ghost { opacity: .75; }
.debt .grow { flex: 1; min-width: 180px; line-height: 1.35; font-size: 14px; }
.debt .grow span { font-size: 12px; color: var(--muted); }
.dbtns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dstat { font-size: 12px; color: var(--muted); font-weight: 600; }
.dstat.warn { color: var(--gold); }
.remind { padding: 12px; border-radius: 12px; background: rgba(246, 196, 83, .08); border: 1px solid rgba(246, 196, 83, .35); font-size: 13px; color: #fde7b0; display: flex; flex-direction: column; gap: 10px; }
.remind .debt { color: var(--text); }
#rb, #pb { display: flex; flex-direction: column; gap: 12px; }

.wk { display: flex; flex-direction: column; gap: 6px; }
.wk-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-weight: 600; }
.wk-row .avatar { width: 26px; height: 26px; font-size: 12px; }
.wk-row .grow { flex: 1; }
.wk-row b { font-size: 15px; }

/* phones: forms and host rows fit the screen */
.field input, .field select { width: 100%; min-width: 0; }
.grid2 > *, .grid3 > *, .row > * { min-width: 0; }
@media (max-width: 560px) {
  .modal-h { padding: 16px 14px 4px; }
  .modal-b { padding: 12px 14px 16px; }
  .modal-f { padding: 0 14px 16px; }
  .htabs { padding: 0 14px !important; margin: -12px -14px 0 !important; }
  .htabs button { padding: 0 9px; }
  .li { flex-wrap: wrap; row-gap: 8px; }
  .li .grow { flex: 1 1 calc(100% - 48px); }
  .li input { flex: 1 1 90px; width: auto; }
  .li .btn { flex: none; }
  .rp-b { width: 40px; height: 40px; }
  .wk-row b { font-size: 14px; }
  .debt .dbtns { width: 100%; justify-content: flex-end; }
}
@media (max-width: 640px) {
  .topbar > .brand-mark, #b-prefs { display: none !important; }
  .topbar .t-title b { font-size: 13px; }
  .acct-btn { padding: 0 4px; }
}
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-list .btn { justify-content: flex-start; height: 46px; }

/* the bottom bar keeps one height whether or not it's your turn, so the table never jumps;
   the raise slider floats above it instead of pushing everything up */
.dock-right { position: relative; min-height: 52px; justify-content: flex-end; }
.raise-panel { position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 30; }
.pre, .act { height: 52px; }
@media (max-width: 640px) {
  .dock-right { min-height: 50px; }
  .pre, .act { height: 50px; }
  .raise-panel { left: 0; right: 0; width: auto; }
}

.t-title span.clickable { cursor: pointer; text-decoration: underline dotted rgba(255, 255, 255, .35); text-underline-offset: 3px; }
.t-title span.clickable::after { content: " ▾"; font-size: 10px; }
