/* অবসর — the Oboshor app's light-green system, modernised. Light by default, dark optional. */
@font-face { font-family: "Kalpurush"; src: url("kalpurush.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #eef6f1; --fg: #1b3226; --card: #ffffff; --card-2: #f6faf8;
  --primary: #1f935d; --primary-2: #2fb374; --primary-3: #12704a; --on-primary: #fff;
  --secondary: #c8f9dc; --muted: #e2e9e5; --muted-fg: #577566;
  --accent: #f9b81f; --danger: #dc2828; --success: #1b985d; --border: #d3e6db;
  --lead-bg: #d8f5e4; --last-bg: #fde3e3; --zebra: #f3f8f5;
  --shadow: 0 1px 2px rgba(18, 112, 74, .06), 0 8px 24px rgba(18, 112, 74, .08);
  --shadow-lg: 0 20px 50px rgba(10, 40, 25, .25);
  --r: 16px; --r-sm: 12px;
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  --font: "Kalpurush", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
  --ch: 120px; --tch: 90px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1611; --fg: #e6f4ec; --card: #14221a; --card-2: #182920;
  --primary: #33bc7b; --primary-2: #3fcf8a; --primary-3: #1a8a58; --on-primary: #06120c;
  --secondary: #1d3327; --muted: #1b2a21; --muted-fg: #9bb6a7;
  --accent: #f9c948; --danger: #f05a5a; --success: #33bc7b; --border: #27412f;
  --lead-bg: #18432d; --last-bg: #4a1f22; --zebra: #172820;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.45; }
body { min-height: 100dvh; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button { font-family: inherit; }
input, select { font-family: inherit; font-size: 16px; color: var(--fg); background: var(--card-2); border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted-fg); } .small { font-size: 13px; } .center { text-align: center; }
small { display: block; font-size: 12.5px; color: var(--muted-fg); font-weight: 400; }

/* ------------------------------------------------ splash */
#splash { position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(160deg, var(--primary-2), var(--primary-3)); color: #fff; transition: opacity .35s; }
#splash h1 { font-size: 40px; } #splash p { margin: 0; opacity: .85; }
#splash.out { opacity: 0; pointer-events: none; }
.logo-tile { width: 54px; height: 54px; flex: none; border-radius: 16px; display: grid; place-items: center; font-size: 32px; color: #fff;
  background: linear-gradient(145deg, var(--primary-2), var(--primary-3)); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 40%, transparent); }
.logo-tile.big { width: 88px; height: 88px; font-size: 54px; border-radius: 26px; }
#splash .logo-tile { background: rgba(255, 255, 255, .18); box-shadow: none; }

/* ------------------------------------------------ views */
.view { display: none; }
.view.active { display: block; animation: viewIn .22s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
.page { max-width: 560px; margin: 0 auto; padding: calc(14px + var(--st)) calc(16px + var(--sr)) calc(100px + var(--sb)) calc(16px + var(--sl)); }
.page.wide { max-width: 1120px; }

.page-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.page-head > div { flex: 1; min-width: 0; }
.page-head h1 { font-size: 24px; }
.page-head p { margin: 2px 0 0; font-size: 14px; }
.back { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0; background: var(--card); color: var(--fg); font-size: 26px; line-height: 1; box-shadow: var(--shadow); cursor: pointer; }
.pill { background: var(--secondary); color: var(--primary-3); font-weight: 700; font-size: 13px; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
:root[data-theme="dark"] .pill { color: var(--primary-2); }

.card-box { background: var(--card); border-radius: var(--r); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card-box h3 { font-size: 17px; margin-bottom: 8px; }
.hl-box { background: linear-gradient(135deg, var(--secondary), var(--card)); }
.sec-title { font-size: 16px; margin: 4px 0 10px; }

/* ------------------------------------------------ buttons */
.btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 0; border-radius: var(--r-sm); padding: 11px 16px;
  font-size: 15px; font-weight: 700; color: var(--fg); background: var(--muted); cursor: pointer; transition: transform .12s, filter .15s, background .15s; text-align: center; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, var(--primary-2), var(--primary)); color: var(--on-primary); box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 32%, transparent); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.warn { background: var(--accent); color: #2b2000; }
.btn.ghost { background: transparent; border: 1.5px solid var(--border); }
.btn.danger-ghost { background: transparent; border: 1.5px solid color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.btn.big { width: 100%; padding: 15px 18px; font-size: 17px; border-radius: 14px; }
.btn.small { padding: 7px 12px; font-size: 13.5px; border-radius: 10px; }
.btn.full { width: 100%; margin-top: 10px; }
.btn small { color: inherit; opacity: .8; font-size: 11.5px; }
.btn:disabled { opacity: .45; box-shadow: none; cursor: default; }
.field { display: block; margin: 12px 0; }
.field > span { display: block; font-size: 14px; color: var(--muted-fg); margin-bottom: 6px; font-weight: 600; }
.field input { width: 100%; }
.inline-form { display: flex; gap: 8px; } .inline-form input { flex: 1; min-width: 0; }
.code-input { text-transform: uppercase; letter-spacing: 4px; font-weight: 700; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; } .row-actions .btn { flex: 1; min-width: 100px; }
.sticky-cta { position: sticky; bottom: calc(12px + var(--sb)); margin-top: 18px; }

/* switch */
.switch { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; flex: none; border-radius: 999px; background: var(--muted); border: 0; padding: 0; position: relative; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch:checked { background: var(--primary); } .switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: .5; }

/* ------------------------------------------------ welcome & home */
.welcome { min-height: 80dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 8px; }
.welcome h1 { font-size: 32px; margin-top: 10px; } .welcome .field { width: 100%; text-align: left; } .welcome .btn { margin-top: 4px; }
.home-head { display: flex; gap: 14px; align-items: center; margin: 6px 0 4px; }
.home-head h1 { font-size: 30px; color: var(--primary); }
.home-head p { margin: 0; font-size: 14.5px; color: var(--muted-fg); }
.tagline { font-size: 20px; font-weight: 700; margin: 14px 0 16px; }
.resume-card, .mini-card { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; cursor: pointer;
  background: linear-gradient(135deg, var(--primary-2), var(--primary-3)); color: #fff; box-shadow: var(--shadow); transition: transform .12s; }
.resume-card small { color: rgba(255, 255, 255, .85); }
.resume-card.online { background: linear-gradient(135deg, #2d6bd6, #1b3f8f); }
.resume-card > span:nth-child(2), .mini-card > span:nth-child(2) { flex: 1; min-width: 0; }
.resume-card:active, .mini-card:active, .mode-card:active { transform: scale(.98); }
.rc-icon, .mc-icon { font-size: 26px; } .chev { font-size: 24px; opacity: .6; }
.mini-card { background: var(--card); color: var(--fg); }
.mini-card small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.mode-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; border: 0; border-radius: 20px; padding: 18px 16px; min-height: 170px; cursor: pointer;
  background: var(--card); color: var(--fg); box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .12s; }
.mode-card b { font-size: 18px; } .mode-card small { font-size: 13px; }
.mode-card::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 110px; height: 110px; border-radius: 50%; opacity: .14; }
.mode-card.online::after { background: #2d6bd6; } .mode-card.khata::after { background: var(--accent); }
.mode-ico { font-size: 34px; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--secondary); }
.mode-card.online .mode-ico { background: color-mix(in srgb, #2d6bd6 18%, var(--card)); }
.mode-card.khata .mode-ico { background: color-mix(in srgb, var(--accent) 25%, var(--card)); }
.credit { text-align: center; font-size: 13px; color: var(--muted-fg); margin-top: 22px; }
.credit a { color: var(--muted-fg); }

/* ------------------------------------------------ bottom nav */
.bottom-nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--sb)); z-index: 50; display: flex; gap: 4px; padding: 6px;
  background: color-mix(in srgb, var(--card) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: 22px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.bottom-nav button { border: 0; background: transparent; color: var(--muted-fg); font-size: 12.5px; font-weight: 700; padding: 6px 18px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: background .15s, color .15s; }
.bottom-nav button span { font-size: 21px; line-height: 1.2; }
.bottom-nav button.on { background: var(--secondary); color: var(--primary-3); }
:root[data-theme="dark"] .bottom-nav button.on { color: var(--primary-2); }

/* ------------------------------------------------ results */
.group-label { font-weight: 700; color: var(--muted-fg); font-size: 14px; margin: 16px 4px 8px; }
.res-item { background: var(--card); border-radius: var(--r); margin-bottom: 10px; box-shadow: var(--shadow); overflow: hidden; }
.res-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px; border: 0; background: transparent; color: var(--fg); text-align: left; cursor: pointer; }
.res-crown { font-size: 22px; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--lead-bg); flex: none; }
.res-main { flex: 1; min-width: 0; } .res-names { display: block; font-size: 12.5px; color: var(--muted-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-item .chev { transition: transform .2s; } .res-item.open .chev { transform: rotate(90deg); }
.res-body { padding: 0 12px 6px; animation: viewIn .2s; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted-fg); } .empty-state .big { font-size: 54px; } .empty-state b { color: var(--fg); font-size: 18px; display: block; margin: 6px 0; }

/* ------------------------------------------------ point sheet & result card */
.sheet-wrap { overflow-x: auto; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--card); }
table.sheet { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.sheet th, .sheet td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 8px 6px; text-align: center; }
.sheet th:last-child, .sheet td:last-child { border-right: 0; }
.sheet thead th { background: var(--secondary); color: var(--primary-3); font-size: 14px; position: sticky; top: 0; }
:root[data-theme="dark"] .sheet thead th { color: var(--primary-2); }
.sheet tbody tr:nth-child(even) td { background: var(--zebra); }
.sheet td small { font-size: 11px; }
.sheet td.lbl { color: var(--muted-fg); font-size: 13px; white-space: nowrap; }
.sheet td.neg { color: var(--danger); font-weight: 700; }
.sheet td.pos { color: var(--success); font-weight: 700; }
.sheet td.empty { color: var(--muted-fg); padding: 22px; }
.sheet tr.preview td { color: var(--muted-fg); font-style: italic; background: transparent !important; }
.sheet tfoot td { font-weight: 800; font-size: 17px; background: color-mix(in srgb, var(--accent) 14%, var(--card)); border-bottom: 0; }
.sheet td.lead { background: var(--lead-bg) !important; color: var(--success); }
.sheet td.last { background: var(--last-bg) !important; color: var(--danger); }
.sheet.compact { font-size: 14px; } .sheet.compact td, .sheet.compact th { padding: 6px 4px; }
.rcard { background: #fff; color: #1b3226; border-radius: 20px; overflow: hidden; border: 1px solid #d3e6db; box-shadow: var(--shadow); margin: 6px 0 4px; }
.rcard-head { display: flex; gap: 12px; align-items: center; padding: 16px; color: #fff; background: linear-gradient(90deg, #2fb374, #12704a); }
.rcard-logo { width: 46px; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 28px; flex: none; }
.rcard-title { font-weight: 800; font-size: 17px; } .rcard-sub { font-size: 12.5px; opacity: .9; }
.rcard .sheet { --border: #d3e6db; --secondary: #c8f9dc; --primary-3: #12704a; --zebra: #f3f8f5; --lead-bg: #d8f5e4; --last-bg: #fde3e3; --card: #fff; --danger: #dc2828; --success: #1b985d; --muted-fg: #577566; --accent: #f9b81f; color: #1b3226; }
.rcard-badges { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 14px 0; }
.badge { font-weight: 700; font-size: 14px; padding: 6px 12px; border-radius: 999px; }
.badge.win { background: #d8f5e4; color: #11603a; } .badge.lose { background: #fde3e3; color: #dc2828; }
.rcard-foot { text-align: center; font-size: 11.5px; color: #577566; padding: 10px; }

/* ------------------------------------------------ setup */
.seating { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; touch-action: none; }
.seat-row { display: flex; align-items: center; gap: 10px; background: var(--card-2); border: 1.5px solid var(--border); border-radius: 14px; padding: 10px 12px; transition: transform .18s, box-shadow .18s; }
.seat-row.dragging { transition: none; box-shadow: var(--shadow-lg); z-index: 2; position: relative; background: var(--card); border-color: var(--primary); }
.handle { font-size: 20px; color: var(--muted-fg); cursor: grab; padding: 4px 6px; touch-action: none; }
.seat-no { font-size: 13px; color: var(--muted-fg); width: 44px; }
.seat-name { flex: 1; font-weight: 700; } .seat-name.empty { color: var(--muted-fg); font-weight: 400; font-style: italic; }
.x-btn { border: 0; background: var(--muted); color: var(--fg); width: 30px; height: 30px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; }
.chip-btn { border: 1.5px solid var(--border); background: var(--card-2); color: var(--fg); font-weight: 700; padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 14.5px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.chip-btn.used { opacity: .45; } .chip-btn:active { transform: scale(.95); }
.target-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.target-grid.sm { grid-template-columns: repeat(auto-fit, minmax(46px, 1fr)); flex: 1; max-width: 320px; }
.target-chip { border: 1.5px solid var(--border); background: var(--card-2); color: var(--fg); border-radius: 14px; padding: 12px 4px; font-weight: 800; font-size: 16px; cursor: pointer; transition: all .15s; }
.target-grid.sm .target-chip { padding: 7px 2px; font-size: 14px; border-radius: 10px; }
.target-chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 35%, transparent); }
.seat-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-weight: 600; }

/* ------------------------------------------------ scorer */
.game-head h1 { font-size: 22px; }
.tabs { display: flex; gap: 4px; background: var(--muted); padding: 4px; border-radius: 14px; margin-bottom: 14px; }
.tabs button { flex: 1; border: 0; background: transparent; color: var(--muted-fg); padding: 9px 4px; border-radius: 11px; font-weight: 700; font-size: 14.5px; cursor: pointer; transition: background .15s, color .15s; }
.tabs button.on { background: var(--card); color: var(--fg); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.score-body.split { display: grid; gap: 14px; }
@media (min-width: 760px) { .score-body.split { grid-template-columns: minmax(320px, 420px) 1fr; align-items: start; } .col-board { position: sticky; top: 12px; } }
@media (orientation: landscape) and (max-height: 520px) { .score-body.split { grid-template-columns: minmax(300px, 380px) 1fr; } }
.panel { background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.panel-head h3 { font-size: 16.5px; }
.collapse { border: 0; background: var(--muted); color: var(--fg); width: 32px; height: 32px; border-radius: 10px; font-size: 18px; cursor: pointer; }
.entry-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.entry-row .pn { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--card-2); border: 1.5px solid var(--border); border-radius: 14px; padding: 3px; }
.stepper button { width: 40px; height: 38px; border: 0; border-radius: 11px; background: var(--muted); color: var(--fg); font-size: 20px; font-weight: 700; cursor: pointer; }
.stepper button:active:not(:disabled) { background: var(--secondary); }
.stepper button:disabled { opacity: .35; }
.stepper .val { min-width: 34px; text-align: center; font-weight: 800; font-size: 19px; }
.sum-line { text-align: center; font-weight: 800; font-size: 17px; margin: 12px 0 2px; padding: 8px; border-radius: 12px; background: var(--muted); }
.sum-line.ok { background: var(--lead-bg); color: var(--success); } .sum-line.bad { background: var(--last-bg); color: var(--danger); }
.panel > .muted.small { text-align: center; margin: 6px 0 12px; }
.warn-box { background: color-mix(in srgb, var(--accent) 18%, var(--card)); border: 1.5px solid color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 14px; padding: 12px; margin: 10px 0; font-weight: 700; text-align: center; display: flex; flex-direction: column; gap: 8px; }
.seg { display: flex; background: var(--muted); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted-fg); padding: 8px 12px; border-radius: 9px; font-weight: 700; font-size: 14.5px; cursor: pointer; transition: all .15s; }
.seg button.on { background: var(--card); color: var(--fg); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.seg button.on.win { background: var(--success); color: #fff; } .seg button.on.lose { background: var(--danger); color: #fff; }
.seg.sm button { padding: 6px 9px; font-size: 13px; }
.two-btn { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.hist-card { background: var(--card); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.hist-head { font-weight: 800; margin-bottom: 6px; color: var(--primary); }
.hist-row { display: grid; grid-template-columns: 1fr auto 52px; gap: 8px; padding: 5px 0; border-top: 1px solid var(--border); font-size: 14.5px; }
.hist-row b { text-align: right; } .neg { color: var(--danger); } .pos { color: var(--success); }
.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; border-radius: var(--r); padding: 13px 14px; background: var(--card); color: var(--fg); box-shadow: var(--shadow); cursor: pointer; transition: transform .12s; }
.opt:active { transform: scale(.985); }
.opt > span:nth-child(2) { flex: 1; min-width: 0; }
.oi { font-size: 22px; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--muted); flex: none; }
.opt.hl .oi { background: color-mix(in srgb, #2d6bd6 20%, var(--card)); }
.opt.hl { outline: 2px solid color-mix(in srgb, #2d6bd6 40%, transparent); }
.opt.danger b { color: var(--danger); } .opt.danger .oi { background: var(--last-bg); }

/* summary */
.summary { text-align: center; position: relative; }
.go-title { font-size: 34px; margin: 12px 0 2px; }
.winner-line { font-size: 22px; font-weight: 800; color: var(--primary); }
.summary .rcard { text-align: left; margin-top: 16px; }
.confetti { position: absolute; inset: -20px 0 auto; height: 200px; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; left: calc(var(--i) * 5.5%); width: 8px; height: 14px; border-radius: 2px;
  background: hsl(calc(var(--i) * 47), 80%, 55%); animation: fall 2.4s ease-in calc(var(--i) * -0.13s) 2 both; }
@keyframes fall { to { transform: translateY(240px) rotate(540deg); opacity: 0; } }

/* ------------------------------------------------ online: join & lobby */
.room-code { font-size: 30px; font-weight: 800; letter-spacing: 6px; color: var(--primary); font-family: ui-monospace, Menlo, Consolas, monospace; }
.lseats { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
.lseat { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--card-2); border: 1.5px solid var(--border); }
.lseat.me { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--card)); }
.lseat-main { flex: 1; min-width: 0; } .lseat-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lseat-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ava-sm { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; }
.ava-xs { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; margin-right: 6px; vertical-align: middle; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa; display: inline-block; margin-right: 5px; vertical-align: middle; }
.dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-weight: 600; }
.set-row:last-of-type { border-bottom: 0; }
.resume-box { background: var(--card-2); border-radius: 14px; padding: 12px; margin-top: 6px; display: flex; flex-direction: column; gap: 8px; }
.resume-row { display: grid; grid-template-columns: 54px 1fr 84px; gap: 8px; align-items: center; font-size: 14px; }
.resume-row.two { grid-template-columns: 1fr 140px; }
.resume-row input, .resume-row select { padding: 8px 10px; min-width: 0; width: 100%; }
.rules { padding-left: 20px; margin: 6px 0 0; font-size: 14.5px; } .rules li { margin: 6px 0; }
.loading { min-height: 60dvh; display: grid; place-items: center; text-align: center; color: var(--muted-fg); }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--muted); border-top-color: var(--primary); animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------ modal & toasts */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: calc(12px + var(--st)) calc(12px + var(--sr)) calc(12px + var(--sb)) calc(12px + var(--sl));
  background: rgba(6, 20, 13, 0); transition: background .18s; }
.modal.in { background: rgba(6, 20, 13, .55); }
.modal-card { width: min(460px, 100%); max-height: 100%; overflow: auto; background: var(--card); color: var(--fg); border-radius: 22px; padding: 18px; box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(.97); opacity: 0; transition: transform .2s cubic-bezier(.2, .8, .3, 1), opacity .18s; }
.modal.in .modal-card { transform: none; opacity: 1; }
.modal-card.wide { width: min(680px, 100%); }
.modal-card h2 { font-size: 19px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-card p { margin: 0 0 6px; }
.x { border: 0; background: var(--muted); color: var(--fg); width: 34px; height: 34px; border-radius: 50%; font-size: 19px; cursor: pointer; flex: none; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.modal-actions.col { flex-direction: column; } .modal-actions.col .btn { width: 100%; }
.winner-box { text-align: center; } .winner-box .crown { font-size: 46px; animation: bob 1.4s ease-in-out infinite; } .winner-box .wn { font-size: 24px; font-weight: 800; color: var(--primary); }
@keyframes bob { 50% { transform: translateY(-6px); } }
.round-table td.nm { text-align: left; font-weight: 700; white-space: nowrap; }
.toasts { position: fixed; left: 50%; top: calc(12px + var(--st)); transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { background: #12261b; color: #fff; padding: 10px 16px; border-radius: 14px; font-size: 14.5px; font-weight: 700; box-shadow: var(--shadow-lg); text-align: center;
  transform: translateY(-10px); opacity: 0; transition: transform .22s, opacity .22s; }
.toast.in { transform: none; opacity: 1; }
.toast.warn { background: #b26b00; } .toast.wrong { background: #c1121f; font-size: 16px; } .toast.err { background: #8f1d1d; }

/* ================================================ the card table (always dark, landscape) */
#v-table { position: fixed; inset: 0; overflow: hidden; background: #071610; color: #fff; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
#stage { position: absolute; inset: 0; }
.stage-bg { position: absolute; inset: 0; background:
  radial-gradient(ellipse 80% 60% at 50% 45%, #13402b 0%, #0a2419 55%, #06120c 100%); }
.stage-bg::after { content: ""; position: absolute; inset: 0; opacity: .06;
  background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 22px 22px; }
.table-rim { position: absolute; left: calc(12vw + var(--sl)); right: calc(12vw + var(--sr)); top: 14vh; bottom: 24vh; border-radius: 999px; padding: 1.3vh;
  background: linear-gradient(180deg, #1c3a2b, #0b1f15); box-shadow: 0 2vh 5vh rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(249, 184, 31, .35); }
.felt { position: relative; width: 100%; height: 100%; border-radius: 999px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 42%, #2fb374 0%, #1f935d 38%, #12704a 78%, #0e5c3c 100%); box-shadow: inset 0 0 4vh rgba(0, 0, 0, .45); }
.felt::after { content: ""; position: absolute; inset: 5% 4%; border-radius: 999px; border: 1.5px dashed rgba(255, 255, 255, .14); }
.felt-logo { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26vh; color: rgba(0, 0, 0, .09); }

.hud-btn { position: absolute; z-index: 30; width: 44px; height: 44px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .08); color: #fff; font-size: 20px; cursor: pointer; transition: transform .12s; }
.hud-btn:active { transform: scale(.92); }
.hud-btn.tl { top: calc(10px + var(--st)); left: calc(10px + var(--sl)); font-size: 28px; line-height: 1; }
.hud-btn.tl2 { top: calc(62px + var(--st)); left: calc(10px + var(--sl)); }
.hud-btn.tr { top: calc(10px + var(--st)); right: calc(10px + var(--sr)); }
.hud-btn.tr2 { top: calc(62px + var(--st)); right: calc(10px + var(--sr)); }
.info-bar { position: absolute; z-index: 20; top: calc(14px + var(--st)); left: calc(64px + var(--sl)); display: flex; flex-wrap: wrap; gap: 5px; max-width: 26vw; }
.net-dot { position: absolute; z-index: 20; top: calc(16px + var(--st)); right: calc(62px + var(--sr)); width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); }
.net-dot.off { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .3); animation: blink 1s infinite; }
.chip { background: rgba(0, 0, 0, .42); border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; white-space: nowrap; color: #fff; }
.chip.gold { color: #f9c948; } .chip.red { background: rgba(220, 40, 40, .85); }
.chip.turn { background: #f9b81f; color: #1b1300; border-color: transparent; animation: blink 1.1s infinite; }
@keyframes blink { 50% { opacity: .6; } }

/* seats */
.tseat { position: absolute; z-index: 12; display: flex; flex-direction: column; align-items: center; width: 130px; transform: translateX(-50%); pointer-events: none; }
.tseat.pos-top { left: 50%; top: calc(1.2vh + var(--st)); }
.tseat.pos-left { left: calc(7vw + var(--sl) + 18px); top: 30vh; }
.tseat.pos-right { left: calc(93vw - var(--sr) - 18px); top: 30vh; }
.tseat.pos-bottom { left: 50%; bottom: 2vh; }
.tseat .tname { order: -1; margin: 0 0 3px; }
.ava { position: relative; width: clamp(46px, 13vh, 70px); height: clamp(46px, 13vh, 70px); border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: clamp(20px, 5.5vh, 30px); color: #fff; border: 2.5px solid rgba(255, 255, 255, .9); box-shadow: 0 4px 12px rgba(0, 0, 0, .45); }
.ava::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 2.5px solid #f9b81f; opacity: 0; transform: scale(.9); transition: opacity .2s, transform .2s; }
.tseat.turn .ava::after { opacity: 1; transform: scale(1); animation: halo 1.2s ease-in-out infinite; }
@keyframes halo { 50% { transform: scale(1.08); opacity: .55; } }
.tseat.offline .ava { opacity: .45; }
.ring { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); opacity: 0; transition: opacity .2s; }
.ring.on { opacity: 1; }
.ring circle { fill: none; stroke: #f9b81f; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 295.3; stroke-dashoffset: 0; }
.b-dealer, .b-bot { position: absolute; display: none; }
.b-dealer { right: -6px; bottom: 0; width: 20px; height: 20px; border-radius: 50%; background: #1f935d; color: #fff; font-size: 11px; place-items: center; border: 2px solid #fff; }
.tseat.dealer .b-dealer { display: grid; }
.b-bot { left: -8px; top: -6px; font-size: 16px; } .tseat.bot .b-bot { display: block; }
.tname { font-size: 12.5px; font-weight: 700; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 3px #000; margin-top: 2px; }
.tpill { margin-top: -10px; position: relative; z-index: 2; background: #0c1712; border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 999px; padding: 1px 12px; font-weight: 800; font-size: 14px; }
.tpill.made { border-color: #22c55e; color: #86efac; } .tpill.over { border-color: #ef4444; color: #fca5a5; }
.ttotal { font-size: 11px; opacity: .75; margin-top: 1px; }

/* cards */
.card { position: absolute; left: 0; top: 0; height: var(--h); width: calc(var(--h) * .7); border-radius: calc(var(--h) * .075); background: linear-gradient(180deg, #ffffff, #f4f4f0);
  color: #15171a; box-shadow: 0 2px 6px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(0, 0, 0, .06); contain: layout paint; backface-visibility: hidden; }
.card.red { color: #d42430; }
.card .rk { position: absolute; left: 8%; top: 3%; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 800; font-size: calc(var(--h) * .21); line-height: 1; letter-spacing: -1px; }
.card .st { position: absolute; left: 9%; top: 24%; font-size: calc(var(--h) * .16); line-height: 1; }
.card .big { position: absolute; right: 8%; bottom: 4%; font-size: calc(var(--h) * .44); line-height: 1; }
.card.face .big { font-family: Georgia, serif; font-weight: 700; font-size: calc(var(--h) * .38); }
.card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(8, 20, 14, .48); opacity: 0; transition: opacity .15s; pointer-events: none; }
#handLayer { position: absolute; inset: 0; z-index: 15; pointer-events: none; }
.hcard { --h: var(--ch); pointer-events: auto; cursor: pointer; will-change: transform; transition: transform .24s cubic-bezier(.2, .8, .25, 1); }
#handLayer.myturn .hcard.dim::after { opacity: 1; }
#trickLayer { position: absolute; inset: 0; z-index: 14; pointer-events: none; }
.tcard { --h: var(--tch); will-change: transform; transition: transform .32s cubic-bezier(.2, .8, .25, 1), box-shadow .2s; }
.tcard.win { box-shadow: 0 0 0 3px #f9b81f, 0 0 26px rgba(249, 184, 31, .8); z-index: 3; }

.my-info { position: absolute; z-index: 13; left: 50%; transform: translateX(-50%); bottom: calc(var(--ch) * .86 + 6px); display: flex; gap: 5px; white-space: nowrap; }
.timer-big { position: absolute; z-index: 13; left: 50%; transform: translateX(-50%); top: 62vh; font-size: 7vh; font-weight: 800; color: #f9c948; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); pointer-events: none; font-variant-numeric: tabular-nums; }
.timer-big.low { color: #ff6b6b; }
.center-msg { position: absolute; z-index: 13; left: 50%; top: 42vh; transform: translate(-50%, -50%); font-weight: 700; font-size: 15px; text-shadow: 0 1px 4px #000; pointer-events: none; text-align: center; }
.side-btn { position: absolute; z-index: 25; left: calc(10px + var(--sl)); top: 50vh; border: 0; border-radius: 14px; padding: 10px 10px; color: #fff; font-weight: 800; font-size: 13px; line-height: 1.25; cursor: pointer;
  background: linear-gradient(180deg, #ef4444, #b91c1c); box-shadow: 0 6px 16px rgba(185, 28, 28, .45); animation: nudge 1.6s ease-in-out infinite; }
.side-btn small { color: #fff; opacity: .85; font-size: 11px; }
@keyframes nudge { 50% { transform: translateX(3px); } }

.call-panel { position: absolute; z-index: 40; left: 50%; top: 43vh; transform: translate(-50%, -50%); text-align: center; padding: 12px 14px 14px; border-radius: 20px;
  background: rgba(8, 26, 18, .94); border: 1.5px solid rgba(249, 184, 31, .7); box-shadow: 0 16px 40px rgba(0, 0, 0, .55); animation: popIn .2s cubic-bezier(.2, .8, .3, 1.2); }
@keyframes popIn { from { transform: translate(-50%, -50%) scale(.85); opacity: 0; } }
.call-title { font-weight: 800; color: #f9c948; font-size: 17px; }
.call-sub { font-size: 13px; opacity: .85; margin-top: 2px; }
.call-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-top: 10px; }
.call-grid button { width: 48px; height: 42px; border: 0; border-radius: 12px; background: #fff; color: #12261b; font-weight: 800; font-size: 19px; cursor: pointer; font-family: inherit; transition: transform .1s; }
.call-grid button:active { transform: scale(.9); }
.call-grid button.suggest { background: #f9b81f; }

.bubble { position: fixed; z-index: 60; background: #fff; color: #111; padding: 7px 12px; border-radius: 14px; font-size: 14px; font-weight: 700; max-width: 200px;
  transform: translate(-50%, -100%); box-shadow: 0 6px 18px rgba(0, 0, 0, .4); animation: bubbleIn .2s cubic-bezier(.2, .8, .3, 1.3); pointer-events: none; }
@keyframes bubbleIn { from { transform: translate(-50%, -80%) scale(.6); opacity: 0; } }

body.in-table #bottomNav { display: none !important; }
.rotate { display: none; position: fixed; inset: 0; z-index: 450; background: #0a2419; color: #fff; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; font-size: 18px; font-weight: 700; }
.rotate .phone { font-size: 64px; animation: rot 1.8s ease-in-out infinite; }
@keyframes rot { 40%, 60% { transform: rotate(-90deg); } }
@media (orientation: portrait) { body.in-table .rotate { display: flex; } }
@media (max-height: 380px) {
  .hud-btn { width: 38px; height: 38px; border-radius: 12px; font-size: 17px; }
  .hud-btn.tl2, .hud-btn.tr2 { top: calc(54px + var(--st)); }
  .call-grid button { width: 42px; height: 36px; font-size: 17px; }
  .info-bar { left: calc(56px + var(--sl)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (max-height: 480px) {
  .modal-card { padding: 12px 14px; border-radius: 18px; }
  .modal-card h2 { font-size: 16px; margin-bottom: 4px; }
  .modal-card .sheet td, .modal-card .sheet th { padding: 4px 6px; font-size: 13.5px; }
  .modal-card .sheet tfoot td { font-size: 14.5px; }
  .modal-actions { margin-top: 8px; } .modal-actions .btn { padding: 8px 12px; font-size: 14px; }
  .winner-box .crown { font-size: 30px; } .winner-box .wn { font-size: 19px; } .winner-box p { margin: 0; }
}

/* profile */
.profile-card { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: 20px; padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.profile-card > div:not(.ava-lg) { flex: 1; min-width: 0; }
.ava-lg { width: 62px; height: 62px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 28px; font-weight: 800; color: #fff;
  background: linear-gradient(145deg, var(--primary-2), var(--primary-3)); box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 35%, transparent); }
.pname { display: block; font-size: 20px; }
