/* Poker Night, round 2. Black room, green felt, big readable controls. */
:root {
  --bg: #0a0b0d;
  --bg-2: #121418;
  --bg-3: #1b1e24;
  --line: #2a2e36;
  --line-2: #3a3f49;
  --ink: #f5f6f8;
  --ink-2: #b8bdc6;
  --ink-3: #868c97;
  --felt: #12804f;
  --felt-2: #0b5c39;
  --felt-rim: #06120c;
  --gold: #f6c544;
  --gold-2: #ffd96b;
  --go: #22c55e;
  --go-2: #16a34a;
  --stop: #ef4444;
  --stop-2: #dc2626;
  --sky: #3b82f6;
  --card: #ffffff;
  --card-red: #d81f2a;
  --card-black: #111318;
  --win: #34d399;
  --radius-s: 8px;
  --radius-m: 14px;
  --font: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.45; font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
a { color: var(--gold); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--ink-3); }
.spacer { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  border: 0; border-radius: 12px; padding: .7rem 1.15rem; font-weight: 700; letter-spacing: .01em;
  background: var(--bg-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
}
.btn:hover { background: #242830; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .4; cursor: default; }
.btn.primary { background: var(--gold); color: #1a1405; box-shadow: none; }
.btn.primary:hover { background: var(--gold-2); }
.btn.go { background: var(--go); color: #04140a; box-shadow: none; }
.btn.go:hover { background: #3bd672; }
.btn.red { background: transparent; color: #ff6b6b; box-shadow: inset 0 0 0 2px var(--stop); }
.btn.red:hover { background: rgba(239, 68, 68, .12); }
.btn.ghost { background: transparent; }
.btn.small { padding: .4rem .8rem; font-size: .875rem; min-height: 36px; border-radius: 10px; }
.btn.icon { width: 44px; padding: 0; font-size: 1.15rem; position: relative; }
.btn.icon.mute { opacity: .75; }
.btn.icon.mute::after { content: ''; position: absolute; left: 50%; top: 18%; width: 2.5px; height: 64%; background: var(--stop); border-radius: 2px; transform: rotate(45deg); }
.btn.on { background: #11331f; box-shadow: inset 0 0 0 2px var(--go); color: #b7f7cf; }
.btn.off-red { background: #3a1416; box-shadow: inset 0 0 0 2px var(--stop); color: #ffc4c4; }
.btn .key { font-size: .7rem; font-weight: 800; opacity: .6; border: 1px solid currentColor; border-radius: 4px; padding: 0 .3em; line-height: 1.3; }

input[type=text], input[type=email], input[type=number], input[type=password], select {
  background: var(--bg); border: 1.5px solid var(--line-2); border-radius: var(--radius-s);
  padding: .65rem .75rem; width: 100%; min-height: 44px;
}
input:focus, select:focus { border-color: var(--gold); outline: none; }
label { display: block; font-size: .85rem; color: var(--ink-2); margin: .7rem 0 .3rem; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

/* ---------- home ---------- */
.home { min-height: 100%; display: grid; place-items: center; padding: 32px 18px; background: var(--bg); }
.home-inner { width: 100%; max-width: 440px; }
.home h1 { font-size: clamp(2.6rem, 10vw, 3.6rem); line-height: 1; margin: 18px 0 14px; font-weight: 900; letter-spacing: -.02em; }
.home h1 span { color: var(--go); display: block; }
.home .lede { color: var(--ink-2); font-size: 1.08rem; margin: 0 0 22px; }
.home form { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px; }
.home form .btn { width: 100%; margin-top: 14px; min-height: 52px; font-size: 1.05rem; }
.home .note { color: var(--ink-3); font-size: .9rem; margin-top: 16px; }
.suits { display: flex; gap: 10px; font-size: 1.6rem; }
.suits span:nth-child(2n) { color: var(--card-red); }

/* ---------- room layout ---------- */
.room { position: relative; height: 100dvh; display: grid; grid-template-columns: 1fr 360px; grid-template-rows: 56px 1fr auto; grid-template-areas: "top top" "stage panel" "actions panel"; }
.topbar { grid-area: top; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); background: #0d0f12; min-width: 0; }
.brand { font-weight: 900; letter-spacing: -.01em; font-size: 1.1rem; white-space: nowrap; }
.brand b { color: var(--go); }
.conn { width: 10px; height: 10px; border-radius: 50%; background: var(--go); flex: none; }
.conn.off { background: var(--stop); animation: blink 1s infinite; }
.code { color: var(--ink-3); font-size: .85rem; white-space: nowrap; }
.blindinfo { margin-left: 8px; font-weight: 800; font-size: 1rem; white-space: nowrap; }
.blindinfo small { color: var(--ink-3); font-weight: 600; margin-left: 6px; font-size: .8rem; }
.topbar .long { display: inline; }
.topbar .short { display: none; }

.stage { grid-area: stage; position: relative; min-height: 0; overflow: hidden; display: grid; place-items: center; padding: 18px; container-type: size; }
.table-wrap { position: relative; width: min(100cqw - 36px, (100cqh - 36px) * 1.9); aspect-ratio: 1.9 / 1; }
.felt {
  position: absolute; inset: 8% 7%; border-radius: 999px;
  background: radial-gradient(ellipse at 50% 40%, #18a064 0%, var(--felt) 45%, var(--felt-2) 100%);
  box-shadow: 0 0 0 14px #15171b, 0 0 0 16px #23262c, 0 30px 80px rgba(0, 0, 0, .7), inset 0 0 60px rgba(0, 0, 0, .35);
  transition: box-shadow .3s ease;
}
.stage.myturn .felt { box-shadow: 0 0 0 14px #15171b, 0 0 0 16px var(--gold), 0 0 60px 10px rgba(246, 197, 68, .35), 0 30px 80px rgba(0, 0, 0, .7), inset 0 0 60px rgba(0, 0, 0, .35); }
.stage.hurry .felt { animation: hurry 1s ease-in-out infinite; }
@keyframes hurry {
  0%, 100% { box-shadow: 0 0 0 14px #15171b, 0 0 0 16px var(--stop), 0 0 40px 6px rgba(239, 68, 68, .35), 0 30px 80px rgba(0, 0, 0, .7), inset 0 0 60px rgba(0, 0, 0, .35); }
  50% { box-shadow: 0 0 0 14px #15171b, 0 0 0 18px var(--stop), 0 0 110px 30px rgba(239, 68, 68, .65), 0 30px 80px rgba(0, 0, 0, .7), inset 0 0 90px rgba(239, 68, 68, .25); }
}
.wordmark { position: absolute; left: 50%; top: 68%; transform: translate(-50%, -50%); font-weight: 900; letter-spacing: .3em; color: rgba(255, 255, 255, .09); font-size: clamp(.8rem, 1.6vw, 1.2rem); white-space: nowrap; pointer-events: none; }
.practice-mark { position: absolute; left: 50%; top: 70%; transform: translate(-50%, -50%); font-weight: 900; letter-spacing: .18em; color: rgba(255, 255, 255, .16); font-size: clamp(1.6rem, 5vw, 3.4rem); pointer-events: none; white-space: nowrap; }

/* center: pot, board, messages */
.center { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px; width: 66%; }
.pot { background: rgba(0, 0, 0, .45); border-radius: 999px; padding: .35rem 1.1rem; font-weight: 800; font-size: clamp(1rem, 2vw, 1.35rem); white-space: nowrap; }
.pot small { font-weight: 600; color: var(--ink-2); font-size: .75em; margin-left: .5em; }
.board { display: flex; gap: clamp(4px, .8vw, 10px); min-height: calc(var(--cw) * 1.4); --cw: clamp(40px, 6.2vw, 78px); }
.status-line { font-weight: 700; color: #e7fff1; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); text-align: center; font-size: clamp(.9rem, 1.6vw, 1.1rem); }
.status-line small { display: block; color: rgba(231, 255, 241, .75); font-weight: 600; font-size: .85em; }

/* cards */
.card { --cw: inherit; width: var(--cw); height: calc(var(--cw) * 1.4); border-radius: calc(var(--cw) * .1); background: var(--card); color: var(--card-black); position: relative; display: inline-block; box-shadow: 0 3px 10px rgba(0, 0, 0, .35); flex: none; font-weight: 800; }
.card .r { position: absolute; left: 9%; top: 2%; font-size: calc(var(--cw) * .56); line-height: 1; letter-spacing: -.04em; }
.card .s { position: absolute; right: 8%; bottom: 4%; font-size: calc(var(--cw) * .58); line-height: 1; }
.card.red { color: var(--card-red); }
.card.back { background: repeating-linear-gradient(45deg, #1d4ed8 0 6px, #1e40af 6px 12px); box-shadow: inset 0 0 0 3px #fff, 0 3px 10px rgba(0, 0, 0, .35); }
.card.empty { background: rgba(0, 0, 0, .18); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .12); }
.card.dim { filter: brightness(.55); }
.card.deal { animation: deal .35s ease-out both; }
.card.lift { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--gold), 0 8px 18px rgba(0, 0, 0, .45); }
@keyframes deal { from { opacity: 0; transform: translateY(-14px) scale(.9) rotate(-6deg); } to { opacity: 1; transform: none; } }
.mini { display: inline-flex; gap: 3px; vertical-align: middle; }
.mini .card { --cw: 26px; }
.mini .card .r { font-size: 15px; }
.mini .card .s { font-size: 13px; }

/* seats */
.seat { position: absolute; transform: translate(-50%, -50%); width: clamp(118px, 13vw, 168px); z-index: 2; }
.seat .hole { display: flex; justify-content: center; gap: 3px; height: calc(var(--cw) * 1.05); margin-bottom: -18px; position: relative; z-index: 1; --cw: clamp(38px, 4.4vw, 58px); }
.seat .hole .card:nth-child(1) { transform: rotate(-5deg); }
.seat .hole .card:nth-child(2) { transform: rotate(5deg) translateX(-6px); }
.seat.me .hole { --cw: clamp(48px, 5.6vw, 74px); height: calc(var(--cw) * 1.1); margin-bottom: -16px; }
.seat.folded .hole { opacity: .25; }
.plate { position: relative; z-index: 2; background: #f7f7f8; color: #121418; border-radius: 12px; padding: 6px 10px 6px 6px; display: flex; align-items: center; gap: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); min-height: 54px; }
.seat.out .plate, .seat.away .plate { background: #3a3d44; color: #d9dbe0; }
.seat.turn .plate { box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(246, 197, 68, .6); }
.seat.hurry .plate { box-shadow: 0 0 0 3px var(--stop), 0 0 30px rgba(239, 68, 68, .75); }
.seat.winner .plate { box-shadow: 0 0 0 3px var(--win), 0 0 34px rgba(52, 211, 153, .8); animation: pop .5s ease; }
@keyframes pop { 50% { transform: scale(1.08); } }
.avatar { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; flex: none; overflow: visible; }
.avatar video { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ring { position: absolute; inset: -5px; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--p, 1) * 360deg), transparent 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px)); }
.seat.hurry .ring { background: conic-gradient(var(--stop) calc(var(--p, 1) * 360deg), transparent 0); }
.who { min-width: 0; flex: 1; line-height: 1.15; }
.nm { font-weight: 800; font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; line-height: 1.1; }
.stk { font-weight: 800; font-size: 1.1rem; display: block; }
.tag { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; white-space: nowrap; display: block; }
.seat.out .tag, .seat.away .tag { color: #c4c8cf; }
.wins { position: absolute; top: -9px; right: -7px; background: var(--go-2); color: #fff; font-weight: 900; font-size: .72rem; border-radius: 999px; padding: 1px 7px 1px 5px; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); white-space: nowrap; }
.media-ico { position: absolute; bottom: -6px; left: -6px; font-size: .7rem; background: #111; border-radius: 999px; padding: 1px 4px; }
.clock { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #1a1405; font-weight: 900; font-size: .85rem; border-radius: 999px; padding: 1px 9px; z-index: 3; }
.seat.hurry .clock { background: var(--stop); color: #fff; }
/* the seat clock sits on the plate's top right corner, never over the cards */
.plate .clock { top: -11px; right: -8px; left: auto; transform: none; box-shadow: 0 2px 6px rgba(0, 0, 0, .45); }
.hosttools { margin-top: 26px; }
@media (max-width: 767px) { .practice-mark { display: none; } }
.handlabel { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); background: var(--stop-2); color: #fff; font-weight: 800; font-size: .78rem; border-radius: 6px; padding: 1px 8px; white-space: nowrap; z-index: 3; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); max-width: 112%; overflow: hidden; text-overflow: ellipsis; }
.seat.winner .handlabel { background: #4f46e5; }
.act { position: absolute; left: 50%; top: -30px; transform: translateX(-50%); background: #fff; color: #111; border-radius: 999px; padding: 2px 12px; font-weight: 800; font-size: .85rem; z-index: 4; box-shadow: 0 3px 10px rgba(0, 0, 0, .4); white-space: nowrap; }
.react { position: absolute; left: 50%; top: -48px; transform: translateX(-50%); font-size: 36px; z-index: 5; animation: floatup 3.5s ease-out forwards; pointer-events: none; }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -40px); } }
.bet { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 5px; background: rgba(0, 0, 0, .55); border-radius: 999px; padding: 2px 10px 2px 3px; font-weight: 800; font-size: .95rem; z-index: 1; }
.chip { width: 18px; height: 18px; border-radius: 50%; background: #e5e7eb; border: 3px dashed #9ca3af; display: inline-block; }
.chip.b { background: #3b82f6; border-color: #bfdbfe; }
.chip.g { background: var(--gold); border-color: #fff3c4; }
.chip.flying { position: absolute; z-index: 6; transition: left .8s cubic-bezier(.3, .7, .3, 1), top .8s cubic-bezier(.3, .7, .3, 1), opacity .3s ease .7s; transform: translate(-50%, -50%); }
.dealer { position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%; background: #fff; color: #1d4ed8; display: grid; place-items: center; font-weight: 900; font-size: .8rem; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); z-index: 1; }
.open-seat { position: absolute; transform: translate(-50%, -50%); width: clamp(96px, 10vw, 130px); height: 50px; border-radius: 12px; border: 1.5px dashed rgba(255, 255, 255, .28); background: rgba(0, 0, 0, .35); color: var(--ink); font-weight: 800; letter-spacing: .12em; font-size: .85rem; text-transform: uppercase; }
.open-seat:hover { border-color: var(--gold); color: var(--gold); }
.open-seat.quiet { border-style: dotted; color: rgba(255, 255, 255, .25); cursor: default; letter-spacing: .1em; display: grid; place-items: center; }

/* the big turn banner and countdown */
.turnbig { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); z-index: 7; font-weight: 900; font-size: clamp(1.4rem, 3.2vw, 2.4rem); color: var(--gold); text-shadow: 0 2px 12px rgba(0, 0, 0, .7); letter-spacing: .04em; white-space: nowrap; pointer-events: none; display: none; }
.stage.myturn .turnbig { display: block; animation: pulse 1.6s ease-in-out infinite; }
.countdown { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 8; font-weight: 900; font-size: clamp(5rem, 14vw, 10rem); color: #fff; text-shadow: 0 0 30px rgba(239, 68, 68, .9), 0 4px 12px rgba(0, 0, 0, .6); pointer-events: none; display: none; line-height: 1; }
.stage.hurry .countdown { display: block; }
.stage.hurry .turnbig { color: #ff8a8a; }
@keyframes pulse { 50% { opacity: .65; } }

/* win moment */
.winline { text-align: center; pointer-events: none; animation: winin2 .5s cubic-bezier(.2, 1.4, .4, 1) both; max-width: 100%; }
.winline b { display: block; font-size: clamp(1rem, 2.2vw, 1.6rem); font-weight: 900; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }
.winline span { display: inline-block; margin-top: 4px; background: #4f46e5; color: #fff; font-weight: 800; border-radius: 8px; padding: 2px 10px; font-size: clamp(.8rem, 1.5vw, 1rem); }
.phoneinfo { display: none; font-weight: 800; font-size: .8rem; color: rgba(255, 255, 255, .75); }
.pracpill { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; background: #7c3aed; color: #fff; font-weight: 900; letter-spacing: .16em; padding: 6px 8px 6px 14px; border-radius: 999px; font-size: .9rem; box-shadow: 0 6px 20px rgba(124, 58, 237, .5); }
.pracpill span { letter-spacing: 0; font-weight: 700; font-size: .8rem; opacity: .85; }
.pracpill button { background: rgba(255, 255, 255, .2); border: 0; color: #fff; font-weight: 800; letter-spacing: .02em; border-radius: 999px; padding: 6px 12px; font-size: .82rem; min-height: 36px; }
.pracpill button.go { background: var(--gold); color: #1a1405; }
.bigwin { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; pointer-events: none; background: radial-gradient(circle, rgba(246, 197, 68, .28), transparent 60%); animation: fadeout 4.2s ease forwards; }
.bigwin div { text-align: center; animation: winin .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.bigwin b { display: block; font-size: clamp(2.4rem, 8vw, 5.5rem); font-weight: 900; color: var(--gold); text-shadow: 0 0 40px rgba(246, 197, 68, .8), 0 6px 20px rgba(0, 0, 0, .8); line-height: 1; }
.bigwin span { display: block; font-size: clamp(1.1rem, 3vw, 1.8rem); font-weight: 800; color: #fff; margin-top: 10px; text-shadow: 0 3px 12px rgba(0, 0, 0, .9); }
.bigwin i { position: absolute; width: 10px; height: 16px; top: -20px; animation: confetti 2.8s linear forwards; }
@keyframes confetti { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes winin { from { opacity: 0; transform: translate(-50%, -50%) scale(.6); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.bigwin div { animation-name: winin2; }
@keyframes winin2 { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeout { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* waiting panel on the felt */
.lobby { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); z-index: 6; background: rgba(8, 10, 12, .9); border: 1px solid var(--line-2); border-radius: 16px; padding: 18px 20px; width: min(430px, 64%); text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.lobby h3 { margin: 0 0 4px; font-size: 1.25rem; font-weight: 900; }
.lobby p { margin: 4px 0 12px; color: var(--ink-2); font-size: .95rem; }
.lobby ol { text-align: left; margin: 6px 0 14px; padding-left: 1.3em; color: var(--ink-2); font-size: .92rem; }
.lobby ol li.done { color: var(--win); }
.lobby .btn { width: 100%; min-height: 54px; font-size: 1.08rem; margin-top: 6px; }
.lobby.mini { width: auto; padding: 10px 14px; top: 24%; }
.lobby.mini .btn { min-height: 44px; font-size: .95rem; }

/* practice ribbon */
.ribbon { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 9; background: #7c3aed; color: #fff; font-weight: 900; letter-spacing: .18em; padding: 6px 16px; border-radius: 999px; font-size: .95rem; box-shadow: 0 6px 20px rgba(124, 58, 237, .5); display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.ribbon button { background: rgba(255, 255, 255, .2); border: 0; color: #fff; font-weight: 800; letter-spacing: .02em; border-radius: 999px; padding: 2px 10px; font-size: .8rem; }

/* video strip */
.vstrip { position: absolute; top: 66px; left: 10px; z-index: 9; display: flex; flex-direction: column; gap: 6px; }
.vstrip:empty { display: none; }
.seat.hasvid { width: clamp(150px, 15vw, 190px); }
.seat.hasvid .plate { padding-left: 4px; }
.seat.hasvid .avatar { width: 86px; height: 64px; border-radius: 10px; font-size: 0; }
.seat.hasvid .avatar video { border-radius: 10px; }
.seat.hasvid .ring { border-radius: 14px; }
.vtile { width: 160px; aspect-ratio: 4 / 3; background: #000; border-radius: 10px; overflow: hidden; position: relative; box-shadow: 0 6px 18px rgba(0, 0, 0, .6); border: 1.5px solid var(--line-2); }
.vtile video { width: 100%; height: 100%; object-fit: cover; }
.vtile span { position: absolute; left: 6px; bottom: 4px; font-size: .75rem; font-weight: 800; background: rgba(0, 0, 0, .6); padding: 0 6px; border-radius: 4px; }
.vtile.mine video { transform: scaleX(-1); }
.tapsound { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 12; }

/* ---------- action bar ---------- */
.actions { grid-area: actions; padding: 10px 14px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: #0d0f12; min-height: 92px; display: flex; flex-direction: column; gap: 8px; }
.actrow { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; justify-content: flex-end; }
.actrow .btn.big { min-height: 64px; min-width: 120px; font-size: 1.15rem; border-radius: 14px; flex: 1 1 0; max-width: 220px; }
.actrow .btn.big.fold { box-shadow: inset 0 0 0 2.5px var(--stop); color: #ff7b7b; background: rgba(239, 68, 68, .06); }
.actrow .btn.big.check, .actrow .btn.big.call { box-shadow: inset 0 0 0 2.5px var(--go); color: #6ff0a0; background: rgba(34, 197, 94, .07); }
.actrow .btn.big.raise { background: var(--go); color: #04140a; box-shadow: none; }
.actrow .btn.big.more { max-width: 110px; min-width: 90px; color: var(--gold); box-shadow: inset 0 0 0 2px var(--gold); background: transparent; }
.yourturn { display: flex; align-items: center; gap: 10px; font-weight: 900; color: var(--gold); font-size: 1.25rem; letter-spacing: .04em; }
.yourturn .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); animation: pulse 1s infinite; }
.yourturn .secs { margin-left: auto; font-size: 1.5rem; }
.yourturn.hurry { color: #ff6b6b; }
.yourturn.hurry .dot { background: var(--stop); }
.raisebox { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.raisebox .presets { display: flex; gap: 6px; flex-wrap: wrap; }
.raisebox .presets .btn { min-height: 40px; padding: .3rem .7rem; font-size: .85rem; }
.raisebox input[type=range] { flex: 1 1 160px; accent-color: var(--gold); min-height: 40px; }
.raisebox .amt { width: 110px; font-weight: 800; font-size: 1.1rem; text-align: center; }
.hint { color: var(--ink-2); font-weight: 600; }
.pre { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pre label { margin: 0; display: inline-flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1.5px solid var(--line-2); border-radius: 12px; padding: .55rem .85rem; font-size: .95rem; color: var(--ink); cursor: pointer; min-height: 48px; }
.pre label:has(input:checked) { border-color: var(--gold); background: #2a2210; }
.pre input { width: 20px; height: 20px; accent-color: var(--gold); }
.menu { position: relative; }
.menu .pop { position: absolute; bottom: calc(100% + 6px); right: 0; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; display: none; flex-direction: column; gap: 4px; min-width: 210px; z-index: 30; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.menu.open .pop { display: flex; }
.menu .pop .btn { justify-content: flex-start; box-shadow: none; }
.reactbar { display: flex; gap: 4px; }
.reactbar button { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; font-size: 1.2rem; width: 40px; height: 40px; }

/* ---------- side panel ---------- */
.panel { grid-area: panel; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #0d0f12; }
.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; flex: none; }
.tab { background: none; border: 0; padding: 14px 10px; font-weight: 800; color: var(--ink-3); border-bottom: 2.5px solid transparent; white-space: nowrap; position: relative; font-size: .92rem; flex: 1; }
.tab[aria-selected=true] { color: var(--ink); border-bottom-color: var(--gold); }
.tab .dot { position: absolute; top: 9px; right: 4px; width: 8px; height: 8px; background: var(--stop); border-radius: 50%; }
.tabbody { flex: 1; overflow-y: auto; padding: 12px; min-height: 0; }
.chatform { display: flex; gap: 8px; padding: 10px 12px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); flex: none; }
.chatform input { flex: 1; }
.h { font-weight: 900; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin: 14px 0 8px; }
.h:first-child { margin-top: 0; }

/* chat */
.chatlog { display: flex; flex-direction: column; gap: 6px; }
.msg { font-size: .95rem; word-wrap: break-word; }
.msg time { color: var(--ink-3); font-size: .72rem; margin-right: 6px; font-weight: 600; }
.msg b { font-weight: 800; }
.msg.sys { color: var(--ink-3); font-size: .85rem; }
.hcard { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 4px 0; }
.hcard.practice { border-color: #5b21b6; }
.hcard header { display: flex; justify-content: space-between; align-items: baseline; font-size: .78rem; color: var(--ink-3); font-weight: 700; margin-bottom: 6px; }
.hcard header .tagp { color: #c4b5fd; letter-spacing: .1em; }
.hcard .bd { display: flex; gap: 4px; margin-bottom: 8px; }
.hcard .bd .card { --cw: 34px; }
.hcard .bd .card .r { font-size: 19px; }
.hcard .bd .card .s { font-size: 17px; }
.hcard .res { font-weight: 800; font-size: .98rem; margin-bottom: 8px; }
.hcard .res .amt { color: var(--win); }
.hcard .res em { font-style: normal; background: #4f46e5; color: #fff; border-radius: 6px; padding: 0 6px; font-size: .82rem; margin-left: 4px; }
.carousel { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; scrollbar-width: thin; }
.pcard { scroll-snap-align: start; flex: none; background: var(--bg-3); border-radius: 10px; padding: 7px 9px; min-width: 118px; }
.pcard.w { box-shadow: inset 0 0 0 1.5px var(--win); }
.pcard .n { font-weight: 800; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.pcard .hn { font-size: .78rem; color: var(--ink-2); margin-top: 4px; white-space: nowrap; }
.pcard .net { font-size: .8rem; font-weight: 800; }
.pos { color: var(--win); }
.neg { color: #ff8a8a; }

/* players, night, scoreboard */
.plist { display: flex; flex-direction: column; gap: 6px; }
.prow { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border-radius: 10px; padding: 8px 10px; }
.prow .avatar { width: 34px; height: 34px; font-size: 19px; }
.prow .grow { flex: 1; min-width: 0; }
.prow .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { font-size: .72rem; font-weight: 800; border-radius: 999px; padding: 1px 8px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.pill.playing, .pill.ready { background: #11331f; color: #86efac; }
.pill.watching { background: #1e293b; color: #93c5fd; }
.pill.brb, .pill.sittingout { background: #3b2f0c; color: #fde68a; }
.pill.away, .pill.out, .pill.gone { background: #2a2d33; color: #c4c8cf; }
.pill.nextgame, .pill.leaving { background: #312e81; color: #c7d2fe; }
.ledger table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ledger th { text-align: left; color: var(--ink-3); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; padding: 4px 4px 6px; }
.ledger td { padding: 7px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.ledger .n { text-align: right; white-space: nowrap; }
.pay { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.warn { background: #3a1416; color: #ffc4c4; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }
.night { background: var(--bg-2); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.night summary { cursor: pointer; font-weight: 800; display: flex; justify-content: space-between; gap: 8px; list-style: none; }
.night summary::-webkit-details-marker { display: none; }
.card-box { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; }

/* modal and toasts */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 16px; padding: 20px; width: 100%; max-width: 440px; max-height: 92dvh; overflow-y: auto; }
.modal h2 { margin: 0 0 4px; font-size: 1.4rem; font-weight: 900; }
.modal .btn.primary { width: 100%; margin-top: 16px; min-height: 52px; font-size: 1.05rem; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg); padding: 4px; border-radius: 12px; margin: 12px 0 4px; }
.modes button { border: 0; background: none; padding: .6rem; border-radius: 9px; font-weight: 800; color: var(--ink-3); }
.modes button[aria-pressed=true] { background: var(--bg-3); color: var(--ink); }
.avatars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.avatars button { aspect-ratio: 1; border-radius: 50%; border: 0; font-size: 20px; display: grid; place-items: center; padding: 0; }
.avatars button[aria-pressed=true] { box-shadow: 0 0 0 3px var(--gold); }
.toast { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); background: #f5f6f8; color: #111; padding: .7rem 1.1rem; border-radius: 12px; font-weight: 700; z-index: 70; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); max-width: 90vw; text-align: center; }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- phones and narrow screens ---------- */
@media (max-width: 860px) {
  .room { grid-template-columns: 1fr; grid-template-rows: 52px auto 1fr auto; grid-template-areas: "top" "video" "stage" "actions"; }
  #blindinfo, #hostbar, #copy, #snd { display: none !important; }
  .phoneinfo { display: block; }
  .actions .btn { min-height: 56px; }
  .actions .raisebox .presets .btn { min-height: 56px; padding: .3rem .6rem; }
  .actions .reactbar button, .menu .pop .btn { min-height: 56px; }
  .countdown { top: 66%; font-size: 4.6rem; }
  .stage.myturn .turnbig { display: none; }
  .winline b { font-size: .95rem; }
  .winline span { font-size: .78rem; }
  .center { width: 56%; }
  .topbar { padding: 0 8px; gap: 6px; }
  .topbar .long { display: none; }
  .topbar .short { display: inline; }
  .code { display: none; }
  .blindinfo { font-size: .9rem; margin-left: 2px; }
  .blindinfo small { display: none; }
  .stage { padding: 6px 4px; }
  .table-wrap { width: min(100cqw - 8px, (100cqh - 12px) * .66); aspect-ratio: .66 / 1; }
  .topbar { overflow: hidden; }
  .topbar .btn.small.icon { width: 38px; min-height: 38px; }
  .topbar .btn.small { padding: .3rem .55rem; }
  .pre { flex-wrap: nowrap; gap: 6px; }
  .pre label { padding: .4rem .55rem; font-size: .85rem; gap: 6px; min-height: 48px; }
  .pre input { width: 18px; height: 18px; }
  .felt { inset: 9% 13% 8%; border-radius: 46% / 30%; }
  .seat { width: 98px; }
  .seat.me { width: 140px; }
  .plate { padding: 4px 7px 4px 4px; gap: 6px; min-height: 44px; border-radius: 10px; }
  .avatar { width: 34px; height: 34px; font-size: 20px; }
  .nm { font-size: .8rem; }
  .stk { font-size: .92rem; }
  .seat .hole { --cw: 30px; margin-bottom: -12px; }
  .seat.me .hole { --cw: 58px; margin-bottom: -12px; }
  .center { width: 60%; top: 45%; }
  .board { --cw: clamp(32px, 9.4vw, 46px); }
  .open-seat { width: 74px; height: 42px; font-size: .75rem; }
  .lobby { width: 50%; padding: 10px; top: 43%; border-radius: 12px; }
  .lobby h3 { font-size: .95rem; }
  .lobby p { font-size: .78rem; margin: 2px 0 6px; }
  .lobby ol { display: none; }
  .lobby .btn { min-height: 44px; font-size: .88rem; padding: .4rem .5rem; }
  .lobby.mini { width: auto; top: 22%; }
  .showhint { display: none; }
  .actions { padding: 8px 10px calc(10px + var(--safe-b)); min-height: 0; }
  .actrow { gap: 8px; }
  .actrow .btn.big { min-width: 0; min-height: 58px; font-size: 1.05rem; max-width: none; }
  .actrow .btn.big.more { flex: 0 0 72px; }
  .btn .key { display: none; }
  .raisebox .amt { width: 90px; }
  .panel { position: fixed; inset: auto 0 0 0; height: 72dvh; border-left: 0; border-top: 1px solid var(--line-2); border-radius: 18px 18px 0 0; z-index: 40; transform: translateY(102%); transition: transform .25s ease; box-shadow: 0 -20px 60px rgba(0, 0, 0, .6); }
  .panel.open { transform: none; }
  .panel .grab { display: block; }
  .vstrip { grid-area: video; position: static; flex-direction: row; overflow-x: auto; padding: 6px 8px 0; gap: 6px; }
  .vtile { width: 92px; flex: none; }
  .turnbig { top: 27%; }
  .toast { bottom: 150px; }
  .modes button { padding: .55rem .3rem; font-size: .9rem; }
}
.grab { display: none; width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 8px auto 0; flex: none; border: 0; padding: 0; }
@media (max-width: 390px) {
  .seat { width: 90px; }
  .nm { font-size: .76rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.lobby.wait { top: 74%; }
@media (max-width: 860px) { .lobby.wait { top: 70%; width: 56%; } }
@media (max-width: 860px) {
  .table-wrap { width: 100%; height: 100%; aspect-ratio: auto; }
  .felt { inset: 6% 12% 4%; border-radius: 48% / 34%; }
  .vtile { width: 72px; }
  .center { width: 52%; top: 45%; gap: 6px; }
}
@media (max-width: 860px) {
  .center { top: 47%; }
  .handlabel { max-width: 100%; font-size: .7rem; padding: 1px 5px; }
}

/* round 2 QA: every control at least 44px, one height per control family, the big action buttons are their own tier */
.btn, .btn.small { min-height: 44px; }
.btn.small { padding: .45rem .85rem; }
.btn.icon { width: 44px; }
.modes button { min-height: 44px; }
.avatars button { min-height: 44px; }
.open-seat { height: 46px; }
.grab { width: 100%; height: 28px; margin: 0; background: transparent; position: relative; }
.grab::before { content: ''; position: absolute; left: 50%; top: 11px; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: var(--line-2); }
select { -webkit-appearance: none; appearance: none; padding-right: 2.2rem; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
@media (max-width: 860px) {
  .topbar .btn.small.icon, #openpanel { width: 44px; min-height: 44px; }
  .avatars { grid-template-columns: repeat(6, 1fr); }
  .actions .btn { min-height: 56px; }
}
.btn { padding-top: .55rem; padding-bottom: .55rem; }
.lobby .btn, .modal .btn.primary, .home form .btn { min-height: 52px; }
.grab { height: 44px; }
.grab::before { top: 14px; }
.modes button { min-height: 48px; }
.avatars button { min-height: 48px; aspect-ratio: auto; }

/* host prompt: a friend asks for their seat back from a new phone */
#claims { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(520px, calc(100vw - 32px)); }
#claims .claim { background: #f5f6f8; color: #111; border-radius: 14px; padding: 14px 16px; box-shadow: 0 12px 34px rgba(0, 0, 0, .55); display: grid; gap: 10px; font-size: 1rem; line-height: 1.35; }
#claims .row { display: flex; gap: 8px; }
#claims .btn { min-height: 48px; flex: 1; }
#claims .btn:not(.primary) { background: #e4e6ea; color: #111; }
