:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --ink: #15181d;
  --ink-2: #545b66;
  --ink-3: #8a919c;
  --line: #e2e5ea;
  --accent: #0f7a52;
  --accent-2: #0b6343;
  --accent-soft: #e5f4ed;
  --raise: #c97a00;
  --danger: #c2372f;
  --felt-1: #2f8f66;
  --felt-2: #1d6b4a;
  --rim: #d8dce2;
  --gold: #e6b43c;
  --red-suit: #d12c2c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .06);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { min-height: 100dvh; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 11px 16px; font-weight: 600; font-size: 15px; transition: transform .06s, background .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 7px 11px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.iconbtn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; position: relative; }
.iconbtn:hover { background: rgba(0, 0, 0, .05); }
.dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* ---------- home ---------- */
.home { max-width: 640px; margin: 0 auto; padding: 20px 16px 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -.02em; margin: 6px 0 4px; }
.brand .mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 20px; }
.tag { color: var(--ink-2); margin: 0 0 22px; }
.card-panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card-panel h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.01em; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; background: #fff; font-size: 16px; }
.input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.code-input { text-transform: uppercase; letter-spacing: .18em; font-weight: 700; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 600; }
.seg button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }
.big-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.big-choice button { text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 13px; padding: 14px; }
.big-choice button b { display: block; font-size: 15px; margin-bottom: 3px; }
.big-choice button span { font-size: 13px; color: var(--ink-2); }
.big-choice button.on { border-color: var(--accent); background: var(--accent-soft); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.toggle:first-of-type { border-top: 0; }
.toggle small { display: block; color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.switch { appearance: none; width: 44px; height: 26px; border-radius: 13px; background: #cfd4db; position: relative; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { left: 21px; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.list-item:first-child { border-top: 0; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: #eef0f3; color: var(--ink-2); }
.pill.green { background: var(--accent-soft); color: var(--accent-2); }
.pill.amber { background: #fdf1dc; color: #8a5300; }
.pill.red { background: #fbe6e4; color: var(--danger); }
.empty { color: var(--ink-3); font-size: 14px; padding: 6px 0; }
.foot { text-align: center; color: var(--ink-3); font-size: 13px; margin-top: 26px; }

/* ---------- table screen ---------- */
.game { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top)); background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar .title { flex: 1; min-width: 0; }
.topbar .title b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title span { font-size: 12px; color: var(--ink-2); }
.fair-chip { display: inline-flex; align-items: center; gap: 5px; border: 0; background: var(--accent-soft); color: var(--accent-2); font-weight: 700; font-size: 12.5px; padding: 7px 10px; border-radius: 99px; }
.fair-chip.warn { background: #fbe6e4; color: var(--danger); }
.fair-chip .icon { width: 16px; height: 16px; }
.banner { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 13px; padding: 7px 10px; background: #fff8e8; border-bottom: 1px solid #f1e3bd; color: #6b4a00; }
.banner b { color: #3d2a00; }
.notice { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); background: rgba(21, 24, 29, .86); color: #fff; padding: 7px 13px; border-radius: 99px; font-size: 13px; font-weight: 600; white-space: nowrap; z-index: 5; pointer-events: none; }

.stage { flex: 1; position: relative; display: grid; place-items: center; padding: 34px 26px 30px; min-height: 0; }
.felt { position: relative; width: min(100%, calc((100dvh - 250px) * 0.56)); aspect-ratio: 0.56; border-radius: 999px; background: radial-gradient(ellipse at 50% 45%, var(--felt-1), var(--felt-2) 75%); box-shadow: 0 0 0 10px var(--rim), 0 0 0 11px #c5cad2, inset 0 0 40px rgba(0,0,0,.25), 0 18px 40px rgba(16,24,40,.18); }
@media (min-aspect-ratio: 1/1) {
  .felt { width: min(100%, calc((100dvh - 230px) * 1.9)); aspect-ratio: 1.9; }
}
.center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: 90%; }
.board { display: flex; gap: 5px; justify-content: center; }
.pot { color: #fff; font-weight: 700; font-size: 14px; background: rgba(0,0,0,.22); padding: 4px 12px; border-radius: 99px; }
.result { color: #fff; font-size: 13.5px; font-weight: 600; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.4); max-width: 100%; }
.waiting { color: rgba(255,255,255,.9); font-size: 14px; text-align: center; max-width: 80%; }
.watermark { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); color: rgba(255,255,255,.14); font-weight: 800; letter-spacing: .08em; font-size: 13px; white-space: nowrap; }

/* cards */
.c { width: 38px; height: 54px; border-radius: 6px; background: #fff; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.25); color: #15181d; position: relative; }
.c.fresh { animation: deal .25s ease-out; }
.c .r { font-size: 19px; letter-spacing: -.04em; }
.c .s { font-size: 17px; margin-top: 1px; }
.c.red { color: var(--red-suit); }
.c.back { background: repeating-linear-gradient(45deg, #2b5ea8 0 4px, #24508f 4px 8px); border: 2px solid #fff; }
.c.slot { background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.18); }
.c.win { box-shadow: 0 0 0 2px var(--gold), 0 2px 8px rgba(0,0,0,.3); }
.c.dim { opacity: .5; }
@keyframes deal { from { transform: translateY(-8px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 700px) { .c { width: 46px; height: 66px; } .c .r { font-size: 23px; } .c .s { font-size: 20px; } }

/* seats */
.seat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; width: 92px; z-index: 2; }
.seat .cards { display: flex; gap: 2px; height: 40px; margin-bottom: -10px; z-index: 1; }
.seat .cards .c { width: 28px; height: 40px; border-radius: 4px; }
.seat .cards .c .r { font-size: 15px; }
.seat .cards .c .s { font-size: 13px; }
.seat.me .cards { height: 58px; margin-bottom: -12px; }
.seat.me .cards .c { width: 40px; height: 58px; border-radius: 6px; }
.seat.me .cards .c .r { font-size: 20px; }
.seat.me .cards .c .s { font-size: 17px; }
.plate { position: relative; background: var(--panel); border-radius: 12px; padding: 5px 8px 6px; min-width: 84px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.22); border: 2px solid transparent; z-index: 2; }
.plate .nm { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 84px; }
.plate .st { font-size: 13.5px; font-weight: 800; letter-spacing: -.01em; }
.plate .tagline { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.seat.turn .plate { border-color: var(--gold); }
.seat.folded .plate { opacity: .55; }
.seat.folded .cards { opacity: .35; }
.seat.off .plate { opacity: .6; }
.seat.winner .plate { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(230,180,60,.45), 0 2px 8px rgba(0,0,0,.22); }
.timer { position: absolute; left: 6px; right: 6px; bottom: 2px; height: 3px; border-radius: 2px; background: #eceef1; overflow: hidden; }
.timer i { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.timer.low i { background: var(--danger); }
.empty-seat { position: absolute; transform: translate(-50%, -50%); border: 1.5px dashed rgba(255,255,255,.55); color: #fff; background: rgba(255,255,255,.08); border-radius: 12px; padding: 9px 12px; font-size: 13px; font-weight: 600; z-index: 2; }
.empty-seat.out { border-color: #c5cad2; color: var(--ink-3); background: #fff; }
.seat-dot { position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%; border: 1.5px dashed rgba(255,255,255,.35); z-index: 1; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .seat { width: 120px; }
  .plate { min-width: 110px; padding: 7px 10px 8px; }
  .plate .nm { font-size: 14px; max-width: 110px; }
  .plate .st { font-size: 17px; }
  .seat .cards { height: 54px; }
  .seat .cards .c { width: 38px; height: 54px; }
  .seat .cards .c .r { font-size: 19px; } .seat .cards .c .s { font-size: 16px; }
  .seat.me .cards { height: 70px; }
  .seat.me .cards .c { width: 50px; height: 70px; }
  .seat.me .cards .c .r { font-size: 25px; } .seat.me .cards .c .s { font-size: 21px; }
  .bet { font-size: 15px; } .pot { font-size: 16px; }
}
.dealer { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #15181d; font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.35); transform: translate(-50%, -50%); z-index: 3; }
.bet { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 4px; color: #fff; font-size: 12.5px; font-weight: 700; z-index: 3; white-space: nowrap; }
.chip { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); box-shadow: inset 0 0 0 2.5px #fff6, 0 1px 2px rgba(0,0,0,.4); border: 1.5px dashed #fff8; }
.handname { font-size: 11px; font-weight: 700; color: #fff; background: rgba(0,0,0,.45); border-radius: 6px; padding: 2px 6px; margin-top: 3px; white-space: nowrap; }
.won { font-size: 12px; font-weight: 800; color: #1c1300; background: var(--gold); border-radius: 6px; padding: 2px 6px; margin-top: 3px; }

/* action bar */
.actions { background: var(--panel); border-top: 1px solid var(--line); padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); min-height: 74px; }
.actions .main { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.actions .main .btn { padding: 14px 6px; font-size: 16px; border-radius: 13px; }
.btn.fold { color: var(--danger); }
.btn.call { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.raise { background: var(--raise); border-color: var(--raise); color: #fff; }
.raisebox { margin-bottom: 10px; }
.raisebox .presets { display: flex; gap: 6px; margin-bottom: 8px; }
.raisebox .presets button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 0; font-size: 13px; font-weight: 600; }
.raisebox .presets button.on { border-color: var(--raise); color: var(--raise); }
.raisebox .slide { display: flex; align-items: center; gap: 10px; }
.raisebox input[type=range] { flex: 1; accent-color: var(--raise); height: 28px; }
.raisebox .amt { width: 92px; text-align: center; font-weight: 800; font-size: 16px; border: 1px solid var(--line); border-radius: 9px; padding: 7px 4px; }
.idle { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; min-height: 54px; color: var(--ink-2); font-size: 14px; }
.pre { display: flex; gap: 8px; justify-content: center; }
.pre label { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 11px; padding: 10px 14px; font-weight: 600; font-size: 14px; }
.pre input { accent-color: var(--accent); width: 18px; height: 18px; }

/* sheets */
.sheet-wrap { position: fixed; inset: 0; background: rgba(15, 18, 24, .35); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--panel); width: 100%; max-width: 560px; max-height: 88dvh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 18px max(18px, env(safe-area-inset-bottom)); animation: up .2s ease-out; }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 18px; } }
.sheet h3 { margin: 0; font-size: 18px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
.check { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.check:first-child { border-top: 0; }
.check .ok { color: var(--accent); font-weight: 800; }
.check .no { color: var(--danger); font-weight: 800; }
.chatlog { display: flex; flex-direction: column; gap: 8px; max-height: 50dvh; overflow: auto; margin-bottom: 10px; }
.chatlog .m b { font-size: 13px; margin-right: 6px; }
.chatlog .m { font-size: 14.5px; }
.standings .list-item b { width: 34px; display: inline-block; }
.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); background: #15181d; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 60; animation: up .2s; max-width: 90vw; text-align: center; }
.conn { position: fixed; top: 0; left: 0; right: 0; background: var(--danger); color: #fff; text-align: center; font-size: 13px; font-weight: 600; padding: 4px; z-index: 70; }
.chatpop { position: absolute; transform: translate(-50%, -100%); background: #fff; color: #15181d; font-size: 12.5px; padding: 5px 9px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.25); max-width: 150px; z-index: 6; animation: up .2s; pointer-events: none; }

/* verify page */
.verify { max-width: 760px; margin: 0 auto; padding: 20px 16px 60px; }
.verify table { width: 100%; border-collapse: collapse; font-size: 14px; }
.verify td, .verify th { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.deckgrid { display: flex; flex-wrap: wrap; gap: 4px; }
.deckgrid .c { width: 30px; height: 42px; animation: none; }
.deckgrid .c .r { font-size: 15px; } .deckgrid .c .s { font-size: 13px; }
.deckgrid .c.used { box-shadow: 0 0 0 2px var(--accent); }
.deckgrid .c small { position: absolute; top: -7px; right: -5px; font-size: 9px; background: #15181d; color: #fff; border-radius: 4px; padding: 1px 3px; }
.prose p, .prose li { line-height: 1.6; }
.prose h2 { margin-top: 28px; }

/* big tournament page */
.big-choice button:nth-child(3) { grid-column: 1 / -1; }
.tourney .thead { gap: 10px; margin-bottom: 14px; }
.tourney .thead .brand { font-size: 22px; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tstat { background: #f6f7f9; border-radius: 12px; padding: 10px 12px; min-height: 76px; }
.tstat > span { display: block; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.tstat > b { display: block; font-size: 20px; letter-spacing: -.01em; margin: 2px 0; }
.ladder { display: flex; flex-wrap: wrap; gap: 6px; }
.standings .list-item.mine { background: var(--accent-soft); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; }
.standings .list-item b { width: 40px; }
@media (max-width: 420px) { .tstat > b { font-size: 17px; } .tstats { gap: 6px; } }
a.btn { text-decoration: none; }
.bottag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: #eef0f3; color: var(--ink-2); padding: 1px 5px; border-radius: 5px; vertical-align: 1px; }

/* webcams */
.camlayer { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.camtile { position: fixed; border-radius: 50%; overflow: hidden; background: #1d2a24; border: 2.5px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); transition: left .25s, top .25s; }
.camtile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camtile.me video { transform: scaleX(-1); }
.camtile .micoff { position: absolute; right: 2px; bottom: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }
.iconbtn#cam.on { color: var(--accent-2); background: var(--accent-soft); }

/* following the hand */
.ticker { color: rgba(255,255,255,.88); font-size: 12.5px; font-weight: 600; text-align: center; margin-top: 6px; min-height: 17px; max-width: 92%; }
.c.fresh { animation: deal .35s ease-out both; }
.fxlayer { position: fixed; inset: 0; pointer-events: none; z-index: 7; }
.actpop { position: fixed; transform: translate(-50%, -100%); padding: 5px 11px; border-radius: 99px; font-size: 13px; font-weight: 800; color: #fff; white-space: nowrap; box-shadow: 0 3px 10px rgba(0,0,0,.3); opacity: 0; animation: actpop 1.9s ease-out both; }
.actpop.fold { background: #5b6470; }
.actpop.call { background: var(--accent); }
.actpop.raise { background: #c97a00; }
@keyframes actpop { 0% { opacity: 0; transform: translate(-50%, -60%) scale(.7); } 12% { opacity: 1; transform: translate(-50%, -100%) scale(1.08); } 20% { transform: translate(-50%, -100%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -130%); } }
.muck { position: fixed; width: 22px; height: 31px; border-radius: 4px; background: repeating-linear-gradient(45deg, #1f4fa8 0 4px, #2a5fc0 4px 8px); border: 1.5px solid #fff; opacity: 0; animation: muck .8s ease-in both; }
@keyframes muck { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(160deg) scale(.6); } }
.myhand { margin-top: 4px; background: rgba(21,24,29,.82); color: #fff; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.camtile.spot { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,177,58,.45), 0 6px 18px rgba(0,0,0,.35); animation: camspot .3s ease-out; }
.camtile.talk { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(26,140,90,.45), 0 6px 18px rgba(0,0,0,.35); }
@keyframes camspot { from { transform: scale(.6); opacity: .3; } }
.talkbtn { position: fixed; right: 12px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 8; display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 99px; border: 0; background: #fff; color: var(--ink); font-weight: 700; font-size: 13px; box-shadow: 0 3px 12px rgba(0,0,0,.25); user-select: none; -webkit-user-select: none; touch-action: none; }
.talkbtn.on { background: var(--accent); color: #fff; transform: scale(1.06); }
.talkbtn[hidden] { display: none; }
