/* Spin Poker - client styles.
   Sections: tokens, base, controls, top bar, lobby, table, overlays, action bar, chat, dialogs, responsive. */

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #0b0d12;
  --bg-2: #151923;
  --panel: #151922;
  --panel-2: #1c212c;
  --panel-3: #252b38;
  --line: #2a3140;
  --text: #eef1f6;
  --muted: #8d96a9;
  --accent: #ff7a1a;
  --accent-2: #ffa94d;
  --gold: #ffd166;
  --green: #1fc88a;
  --green-2: #129a68;
  --red: #f0506a;
  --blue: #4d8dff;
  --felt-1: #12705a;
  --felt-2: #06392f;
  --back-1: #c0283d;
  --back-2: #7d1224;
  --radius: 14px;
  --topbar-h: 58px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

/* -------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(120% 80% at 50% 0%, var(--bg-2), var(--bg) 70%) fixed var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
h4 { margin: 20px 0 10px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .5; }
input { font: inherit; color: inherit; }
small { font-size: .8em; color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
* { scrollbar-width: thin; scrollbar-color: var(--panel-3) transparent; }

.pos { color: var(--green); }
.neg { color: var(--red); }
.icon { display: inline-flex; font-size: 1.25em; line-height: 0; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0; }
.lobby-note { text-align: center; margin-top: 22px; }
.noscript { color: #fff; text-align: center; padding: 40px; }
.notice { background: rgba(240, 80, 106, .12); border: 1px solid rgba(240, 80, 106, .4); color: #ffc2cc; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.empty { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 34px 16px; color: var(--muted); text-align: center; }

.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .2); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font: 700 11px/18px var(--font); font-style: normal; text-align: center; }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 11px; font-weight: 700; letter-spacing: .01em; transition: transform .08s, filter .15s, background .15s; white-space: nowrap; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn-primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #1a0d02; box-shadow: 0 6px 18px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--panel-3); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }

.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); flex: none; transition: color .15s, background .15s; }
.icon-btn:hover:not(:disabled) { color: var(--text); background: var(--panel-3); }
.icon-btn .badge { position: absolute; top: -6px; right: -6px; }

.segmented { display: inline-flex; padding: 4px; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--panel-3); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.seg-sm button { height: 28px; padding: 0 10px; font-size: 12.5px; }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; --fill: 50%; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--accent) var(--fill), var(--panel-3) var(--fill)); }
.range::-moz-range-track { height: 8px; border-radius: 8px; background: var(--panel-3); }
.range::-moz-range-progress { height: 8px; border-radius: 8px; background: var(--accent); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -8px; border-radius: 50%; background: #fff; border: 5px solid var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 5px solid var(--accent); }

.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle at 30% 25%, var(--a1), var(--a2)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .14); flex: none; font-size: 19px; line-height: 1; overflow: hidden; }
.avatar-glyph { transform: translateY(1px); }

.place-badge { display: inline-grid; place-items: center; min-width: 40px; height: 26px; padding: 0 8px; border-radius: 8px; font-weight: 800; font-size: 12.5px; background: var(--panel-3); color: var(--muted); flex: none; }
.place-badge.place-1 { background: linear-gradient(180deg, #ffe08a, #e6a700); color: #2b1d00; }
.place-badge.place-2 { background: linear-gradient(180deg, #e5e9f0, #9aa4b5); color: #1a2030; }

.mult-chip { display: inline-block; padding: 1px 8px; border-radius: 7px; background: rgba(77, 141, 255, .16); color: #9cc0ff; font-weight: 700; font-size: .9em; }
.mult-chip.hot { background: rgba(255, 209, 102, .16); color: var(--gold); }

/* -------------------------------------------------------------------- boot */
.boot { position: fixed; inset: 0; display: grid; place-content: center; gap: 22px; justify-items: center; }
.boot-logo { display: flex; align-items: center; gap: 12px; font-size: 30px; font-weight: 800; letter-spacing: .14em; }
.boot-logo b { color: var(--accent); font-weight: 800; }
.boot-logo i, .brand-mark { width: 30px; height: 30px; border-radius: 50%; border: 6px dashed var(--accent); background: radial-gradient(circle, var(--gold) 42%, transparent 46%); animation: spin 6s linear infinite; flex: none; }
.boot-bar { width: 220px; height: 4px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.boot-bar i { display: block; width: 40%; height: 100%; background: var(--accent); border-radius: 4px; animation: boot 1.1s ease-in-out infinite alternate; }
@keyframes boot { from { transform: translateX(-60%); } to { transform: translateX(210%); } }

/* ----------------------------------------------------------------- top bar */
#app { display: flex; flex-direction: column; height: 100dvh; }
.topbar { display: flex; align-items: center; gap: 14px; height: var(--topbar-h); padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); background: rgba(13, 16, 22, .86); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); flex: none; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .12em; font-size: 16px; flex: none; }
.brand b { color: var(--accent); font-weight: 800; }
.brand-mark { width: 24px; height: 24px; border-width: 5px; animation-duration: 14s; }

.table-tabs { display: flex; gap: 8px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.table-tabs::-webkit-scrollbar { display: none; }
.table-tab { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); flex: none; text-align: left; color: var(--muted); }
.table-tab > span:last-child { display: grid; line-height: 1.15; }
.table-tab b { font-size: 13px; color: var(--text); }
.table-tab small { font-size: 11px; }
.table-tab.active { border-color: var(--accent); background: rgba(255, 122, 26, .12); color: var(--accent-2); }
.table-tab.needs { animation: needs 1s ease-in-out infinite; border-color: var(--green); color: var(--green); }
.table-tab.done { opacity: .7; }
.table-tab.waiting { cursor: default; }
@keyframes needs { 50% { box-shadow: 0 0 0 3px rgba(31, 200, 138, .35); } }

.top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.online { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-right: 4px; }
.online i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(31, 200, 138, .2); }
.online b { color: var(--text); }
.wallet { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 4px 0 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.wallet b { font-size: 15px; }
.wallet em { font-style: normal; font-size: 12px; color: var(--muted); }
.wallet-plus { display: grid; place-items: center; width: 30px; height: 30px; margin-left: 6px; border-radius: 8px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #1a0d02; font-weight: 800; font-size: 18px; }
.profile-btn { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 3px; border-radius: 20px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 600; font-size: 14px; max-width: 170px; }
.profile-btn .avatar { width: 30px; height: 30px; font-size: 16px; }
.profile-btn > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-view="table"] .lobby-only { display: none; }

.offline { position: fixed; top: calc(var(--topbar-h) + 8px); left: 50%; transform: translateX(-50%); z-index: 60; padding: 8px 16px; border-radius: 10px; background: #5a1522; border: 1px solid var(--red); font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }

/* ------------------------------------------------------------------- lobby */
.lobby { flex: 1; overflow-y: auto; padding: 22px max(18px, env(safe-area-inset-right)) 40px max(18px, env(safe-area-inset-left)); }
.lobby > * { max-width: 1320px; margin-left: auto; margin-right: auto; }

.lobby-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px 28px; border-radius: 20px; border: 1px solid var(--line); overflow: hidden; background: radial-gradient(60% 140% at 100% 0%, rgba(255, 122, 26, .28), transparent 60%), radial-gradient(50% 120% at 0% 100%, rgba(31, 200, 138, .16), transparent 60%), var(--panel); }
.hero-text h1 { font-size: clamp(22px, 3vw, 34px); line-height: 1.12; font-weight: 800; letter-spacing: -.01em; }
.hero-text h1 em { font-style: normal; color: var(--gold); white-space: nowrap; }
.hero-text p { margin-top: 8px; color: var(--muted); max-width: 520px; }
.hero-mults { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 360px; flex: none; }
.hero-mults span { padding: 6px 12px; border-radius: 10px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); font-weight: 800; color: #c9d2e3; }
.hero-mults span.hot { color: var(--gold); border-color: rgba(255, 209, 102, .4); background: rgba(255, 209, 102, .1); }

.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; margin-top: 22px; align-items: start; }
.lobby-main { min-width: 0; }
.lobby-tabs { margin-bottom: 18px; }

.play-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.stepper { display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 6px 0 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.stepper-label { font-size: 13px; color: var(--muted); margin-right: 6px; }
.stepper b { min-width: 24px; text-align: center; font-size: 16px; }
.stepper button { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--panel-3); }
.stepper button:hover:not(:disabled) { background: var(--line); }

.game-block { margin-top: 20px; }
.game-block h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 18px; margin-bottom: 12px; }
.game-block h3 small { font-weight: 500; font-size: 13px; }
.buyin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }

.buyin-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius); background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); overflow: hidden; transition: transform .15s, border-color .15s; }
.buyin-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.buyin-card.game-omaha::before { background: linear-gradient(90deg, #7c5cff, #4d8dff); }
.buyin-card:hover { transform: translateY(-2px); border-color: #3a4356; }
.buyin-card.is-waiting { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 14px 30px -18px var(--accent); }
.bc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bc-game { display: grid; font-weight: 700; font-size: 13px; line-height: 1.2; }
.seat-dots { display: flex; gap: 4px; }
.seat-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--panel-3); border: 1px solid var(--line); }
.seat-dots i.on { background: var(--green); border-color: var(--green); box-shadow: 0 0 6px var(--green); }
.bc-buyin { display: flex; align-items: baseline; gap: 6px; }
.bc-buyin small { width: 100%; position: absolute; }
.bc-buyin { position: relative; padding-top: 16px; }
.bc-buyin b { font-size: 34px; line-height: 1; font-weight: 800; letter-spacing: -.02em; }
.bc-buyin em { font-style: normal; color: var(--muted); font-weight: 600; }
.bc-buyin small { top: 0; left: 0; }
.bc-prize { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 9px 11px; border-radius: 10px; background: rgba(255, 209, 102, .08); border: 1px dashed rgba(255, 209, 102, .28); }
.bc-prize b { color: var(--gold); font-size: 15px; white-space: nowrap; }
.bc-waiting { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.bc-wait-text { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--accent-2); }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); display: grid; gap: 4px; }
.stat b { font-size: 18px; }
.stat.pos b { color: var(--green); }
.stat.neg b { color: var(--red); }

.history-list { display: grid; gap: 8px; }
.history-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-align: left; transition: background .15s; }
.history-row:hover { background: var(--panel-2); }
.hr-main { display: grid; flex: 1; min-width: 0; }
.hr-main b, .hr-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-mult { font-weight: 800; color: #9cc0ff; }
.hr-prize { min-width: 70px; text-align: right; font-weight: 800; color: var(--muted); }
.hr-prize.pos { color: var(--green); }
.history-row .icon { color: var(--muted); }

.lead { color: #c5ccd9; margin-bottom: 14px; }
.table-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; background: var(--panel); font-size: 14px; }
.data-table th, .data-table td { padding: 11px 14px; text-align: right; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--panel-2); }
.data-table tr + tr td { border-top: 1px solid var(--line); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.step { display: flex; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.step > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #1a0d02; font-weight: 800; flex: none; }
.step p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.facts { list-style: none; margin: 0; padding: 0; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.facts li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 14px; }
.facts li + li { border-top: 1px solid var(--line); }
.facts span { color: var(--muted); }
.facts b { text-align: right; }
.blind-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.blind-strip span { display: grid; justify-items: center; padding: 6px 10px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.blind-strip span.now { border-color: var(--accent); background: rgba(255, 122, 26, .14); }
.blind-strip span.past { opacity: .45; }

.wins-panel { position: sticky; top: 0; padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.wins-panel h3 { font-size: 16px; margin-bottom: 10px; }
.month-top { display: grid; gap: 2px; padding: 14px; margin-bottom: 16px; border-radius: 12px; background: linear-gradient(135deg, rgba(255, 209, 102, .2), rgba(255, 122, 26, .1)); border: 1px solid rgba(255, 209, 102, .35); }
.month-top small { display: flex; align-items: center; gap: 6px; color: var(--gold); font-weight: 600; }
.month-top b { font-size: 26px; font-weight: 800; }
.month-top span { font-size: 13px; color: #cfd6e4; }
.wins-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; max-height: 520px; overflow-y: auto; }
.wins-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; background: var(--panel-2); border: 1px solid transparent; }
.wins-list li.top-1 { border-color: rgba(255, 209, 102, .5); background: linear-gradient(90deg, rgba(255, 209, 102, .14), var(--panel-2)); }
.wins-list li.top-2 { border-color: rgba(200, 208, 222, .3); }
.wins-list li.top-3 { border-color: rgba(205, 127, 50, .4); }
.win-who, .win-what { display: grid; line-height: 1.25; min-width: 0; }
.win-who { flex: 1; }
.win-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-what { text-align: right; flex: none; }
.win-what b { color: var(--gold); }

/* hand history */
.hands { display: grid; gap: 8px; }
.hand { border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.hand summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
.hand summary::-webkit-details-marker { display: none; }
.hand-winner { flex: 1; text-align: right; font-size: 13px; color: var(--muted); }
.hand-delta { min-width: 52px; text-align: right; font-weight: 800; }
.hand-body { padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.hand-players { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 12px 0; }
.hand-players > div { display: flex; align-items: center; gap: 8px; }
.hand-lines { margin: 0; padding-left: 26px; color: #c5ccd9; font-size: 13.5px; line-height: 1.7; }
.mini-cards { display: inline-flex; gap: 3px; --cw: 24px; }

/* ------------------------------------------------------------------- cards */
.card { position: relative; width: var(--cw); height: calc(var(--cw) * 1.4); border-radius: calc(var(--cw) * .11); background: linear-gradient(180deg, #ffffff, #e9edf3); color: #171a21; box-shadow: 0 calc(var(--cw) * .04) calc(var(--cw) * .12) rgba(0, 0, 0, .45); flex: none; font-weight: 800; user-select: none; transition: transform .25s, filter .25s, box-shadow .25s; overflow: hidden; }
.card-rank { position: absolute; top: calc(var(--cw) * .04); left: calc(var(--cw) * .1); font-size: calc(var(--cw) * .46); line-height: 1; letter-spacing: -.06em; }
.card-suit { position: absolute; top: calc(var(--cw) * .5); left: calc(var(--cw) * .1); font-size: calc(var(--cw) * .3); line-height: 1; }
.card-pip { position: absolute; right: calc(var(--cw) * .07); bottom: calc(var(--cw) * .02); font-size: calc(var(--cw) * .66); line-height: 1; }
.card.suit-h, .card.suit-d { color: #d42a41; }
.deck-4 .card.suit-d { color: #1c6fe3; }
.deck-4 .card.suit-c { color: #17964a; }
.face-solid .card:not(.card-back) { color: #fff; background: linear-gradient(180deg, #3b4252, #1f2430); }
.face-solid .card.suit-h, .face-solid .card.suit-d { background: linear-gradient(180deg, #e2445a, #b01f35); }
.face-solid.deck-4 .card.suit-d { background: linear-gradient(180deg, #3d86f0, #1b55b8); }
.face-solid.deck-4 .card.suit-c { background: linear-gradient(180deg, #2bb463, #147a3c); }
.card-back { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .1) 0 calc(var(--cw) * .06), transparent calc(var(--cw) * .06) calc(var(--cw) * .14)), linear-gradient(135deg, var(--back-1), var(--back-2)); box-shadow: inset 0 0 0 calc(var(--cw) * .07) rgba(255, 255, 255, .85), inset 0 0 0 calc(var(--cw) * .11) var(--back-2), 0 calc(var(--cw) * .04) calc(var(--cw) * .12) rgba(0, 0, 0, .45); }
.card-in { animation: card-in .32s cubic-bezier(.2, .8, .3, 1.2) backwards; }
@keyframes card-in { from { opacity: 0; transform: translateY(calc(var(--cw) * -.6)) scale(.7) rotate(-8deg); } }
.card.hl { transform: translateY(calc(var(--cw) * -.14)); box-shadow: 0 0 0 calc(var(--cw) * .05) var(--gold), 0 0 calc(var(--cw) * .4) rgba(255, 209, 102, .7); }
.card.dim { filter: brightness(.42) saturate(.6); }
.no-anim .card-in, .no-anim .seat-win, .no-anim .seat-emote.pop { animation: none; }

/* ------------------------------------------------------------------- table */
.table-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.table-hud { display: flex; align-items: center; gap: 10px; padding: 10px max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); flex: none; }
.hud-info { display: flex; align-items: stretch; gap: 8px; flex: 1; min-width: 0; justify-content: center; overflow-x: auto; scrollbar-width: none; }
.hud-info::-webkit-scrollbar { display: none; }
.hud-prize, .hud-item { display: grid; align-content: center; padding: 5px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); line-height: 1.2; white-space: nowrap; flex: none; }
.hud-prize { border-color: rgba(255, 209, 102, .4); background: rgba(255, 209, 102, .08); }
.hud-prize b { color: var(--gold); }
.hud-prize em { font-style: normal; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: rgba(255, 209, 102, .18); font-size: .85em; }
.hud-buttons { display: flex; gap: 8px; flex: none; }
.hud-back { min-width: 38px; height: 38px; flex: none; }

.table-area { flex: 1; min-height: 0; display: grid; place-items: center; padding: 6px 8px; overflow: hidden; }
.stage { position: relative; --u: 10px; font-size: calc(var(--u) * 1.5); }

.rail { position: absolute; left: 5%; right: 5%; top: 13%; bottom: 15%; padding: calc(var(--u) * 1.5); border-radius: 999px; background: linear-gradient(180deg, #343b4a, #171b24); box-shadow: 0 calc(var(--u) * 2.5) calc(var(--u) * 5) rgba(0, 0, 0, .6), inset 0 calc(var(--u) * .2) 0 rgba(255, 255, 255, .14), inset 0 calc(var(--u) * -.3) calc(var(--u) * .6) rgba(0, 0, 0, .6); }
.felt { position: relative; width: 100%; height: 100%; border-radius: inherit; background: radial-gradient(ellipse at 50% 38%, var(--felt-1), var(--felt-2) 92%); box-shadow: inset 0 0 calc(var(--u) * 7) rgba(0, 0, 0, .55), inset 0 0 0 calc(var(--u) * .25) rgba(0, 0, 0, .35); }
.felt::after { content: ""; position: absolute; inset: calc(var(--u) * 2.2); border-radius: inherit; border: calc(var(--u) * .16) solid rgba(255, 255, 255, .1); }

.pot { position: absolute; left: 50%; top: 24.500%; transform: translate(-50%, -50%); display: flex; align-items: baseline; gap: calc(var(--u) * .8); padding: calc(var(--u) * .45) calc(var(--u) * 1.6); border-radius: 999px; background: rgba(0, 0, 0, .42); border: 1px solid rgba(255, 255, 255, .1); white-space: nowrap; z-index: 3; }
.pot small { font-size: calc(var(--u) * 1.25); text-transform: uppercase; letter-spacing: .1em; color: rgba(255, 255, 255, .65); }
.pot b { font-size: calc(var(--u) * 1.9); color: var(--gold); }
.board { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); display: flex; gap: calc(var(--u) * .7); --cw: calc(var(--u) * 6.6); z-index: 3; }

.seat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; z-index: 4; }
.seat.pos-0 { left: 50%; top: 86%; }
.seat.pos-1 { left: 15%; top: 30%; }
.seat.pos-2 { left: 85%; top: 30%; }
.seat-cards { display: flex; justify-content: center; gap: calc(var(--u) * .4); --cw: calc(var(--u) * 4.3); height: calc(var(--cw) * 1.4); margin-bottom: calc(var(--u) * -1.2); transition: opacity .2s; }
.seat.pos-0 .seat-cards { --cw: calc(var(--u) * 6.4); }
.seat:not(.pos-0) .seat-cards:has(.card:not(.card-back)) { --cw: calc(var(--u) * 5.2); }
.seat:not(.pos-0) .seat-cards.many .card + .card { margin-left: calc(var(--cw) * -.45); }
.seat:not(.pos-0) .seat-cards.many .card:not(.card-back) + .card { margin-left: calc(var(--cw) * -.2); }
.seat-pod { position: relative; z-index: 2; display: flex; align-items: center; gap: calc(var(--u) * .9); min-width: calc(var(--u) * 15); padding: calc(var(--u) * .45) calc(var(--u) * 1.7) calc(var(--u) * .45) calc(var(--u) * .45); border-radius: 999px; background: linear-gradient(180deg, #232936, #12151c); border: calc(var(--u) * .16) solid #3a4254; box-shadow: 0 calc(var(--u) * .6) calc(var(--u) * 1.6) rgba(0, 0, 0, .55); transition: border-color .2s, box-shadow .2s, opacity .2s; }
.seat-avatar .avatar { width: calc(var(--u) * 5.600); height: calc(var(--u) * 5.600); font-size: calc(var(--u) * 3); }
.seat-plate { display: grid; min-width: 0; padding-bottom: calc(var(--u) * .4); line-height: 1.2; }
.seat-name { display: flex; align-items: center; gap: calc(var(--u) * .5); font-size: calc(var(--u) * 1.3); color: #aab3c5; max-width: calc(var(--u) * 13); white-space: nowrap; }
.seat-name > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.seat-name > em { flex: none; }
.bot-tag { font-style: normal; font-size: .72em; font-weight: 700; padding: 0 .45em; border-radius: .4em; background: rgba(255, 255, 255, .1); color: #c5ccd9; letter-spacing: .05em; }
.seat-stack { font-size: calc(var(--u) * 1.75); font-weight: 800; white-space: nowrap; }
.seat-timer { position: absolute; left: calc(var(--u) * 7); right: calc(var(--u) * 1.8); bottom: calc(var(--u) * .5); height: calc(var(--u) * .4); border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; opacity: 0; }
.seat-timer i { display: block; height: 100%; border-radius: 99px; background: var(--green); transform-origin: left; transform: scaleX(0); }
.seat-timer i.low { background: var(--red); }
.seat.bank .seat-timer i { background: var(--gold); }
.seat.acting .seat-timer { opacity: 1; }
.seat.acting .seat-pod { border-color: var(--accent); box-shadow: 0 0 0 calc(var(--u) * .3) rgba(255, 122, 26, .3), 0 0 calc(var(--u) * 2.4) rgba(255, 122, 26, .5); }
.seat.winner .seat-pod { border-color: var(--gold); box-shadow: 0 0 0 calc(var(--u) * .3) rgba(255, 209, 102, .35), 0 0 calc(var(--u) * 3) rgba(255, 209, 102, .6); }
.seat.folded .seat-pod { opacity: .55; }
.seat.folded .seat-cards { opacity: .4; }
.seat.out .seat-pod { opacity: .4; filter: grayscale(1); }
.seat.away .avatar, .seat.offline .avatar { filter: grayscale(1) brightness(.7); }

.seat-badge { position: absolute; top: 100%; margin-top: calc(var(--u) * .5); padding: calc(var(--u) * .2) calc(var(--u) * 1); border-radius: 99px; font-size: calc(var(--u) * 1.2); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; background: #2a3140; color: #d7dde9; z-index: 5; }
.seat.pos-0 .seat-badge { top: auto; bottom: calc(var(--u) * 2); left: 100%; margin: 0 0 0 calc(var(--u) * .8); }
.seat-badge.a-fold { background: #3a2029; color: #ff9aaa; }
.seat-badge.a-check { background: #1d3a34; color: #7ff0c4; }
.seat-badge.a-call { background: #14493a; color: #8ff7cf; }
.seat-badge.a-bet, .seat-badge.a-raise { background: #5a3210; color: #ffc48a; }
.seat-badge.a-allin { background: linear-gradient(90deg, #d42a41, #ff7a1a); color: #fff; }
.seat-badge.desc { background: rgba(0, 0, 0, .7); color: var(--gold); text-transform: none; letter-spacing: 0; border: 1px solid rgba(255, 209, 102, .4); }

.seat-win { position: absolute; top: calc(var(--u) * -3.6); font-size: calc(var(--u) * 2.2); font-weight: 800; color: var(--gold); text-shadow: 0 2px 8px rgba(0, 0, 0, .8); white-space: nowrap; animation: win-rise .6s cubic-bezier(.2, .8, .3, 1.3) backwards; z-index: 6; }
@keyframes win-rise { from { opacity: 0; transform: translateY(calc(var(--u) * 2)) scale(.6); } }
.seat-emote { position: absolute; top: calc(var(--u) * -1); right: calc(var(--u) * -3.500); display: grid; place-items: center; min-width: calc(var(--u) * 5.600); height: calc(var(--u) * 5.600); padding: 0 calc(var(--u) * .8); border-radius: calc(var(--u) * 1.8); background: #fff; color: #171a21; font-size: calc(var(--u) * 3); font-weight: 800; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); z-index: 8; }
.seat-emote.pop { animation: emote 2.6s ease both; }
@keyframes emote { 0% { transform: scale(0); } 8% { transform: scale(1.15); } 14%, 85% { transform: scale(1); opacity: 1; } 100% { transform: scale(.8); opacity: 0; } }

.bet { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: calc(var(--u) * .6); padding: calc(var(--u) * .3) calc(var(--u) * 1.1) calc(var(--u) * .3) calc(var(--u) * .4); border-radius: 99px; background: rgba(0, 0, 0, .5); font-size: calc(var(--u) * 1.6); font-weight: 800; white-space: nowrap; z-index: 3; animation: bet-in .2s ease-out; }
@keyframes bet-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.6); } }
.bet-0 { left: 50%; top: 61%; }
.bet-1 { left: 27%; top: 51%; }
.bet-2 { left: 73%; top: 51%; }
.chip-icon { width: calc(var(--u) * 2); height: calc(var(--u) * 2); border-radius: 50%; background: radial-gradient(circle, #fff 30%, var(--accent) 34%); border: calc(var(--u) * .28) dashed #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .6); }

.dealer-btn { position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center; width: calc(var(--u) * 2.800); height: calc(var(--u) * 2.800); border-radius: 50%; background: linear-gradient(180deg, #fff, #cfd6e4); color: #171a21; font-size: calc(var(--u) * 1.5); font-weight: 800; box-shadow: 0 calc(var(--u) * .3) calc(var(--u) * .8) rgba(0, 0, 0, .6); z-index: 5; transition: left .4s ease, top .4s ease; }
.dealer-0 { left: 40%; top: 77%; }
.dealer-1 { left: 26%; top: 33%; }
.dealer-2 { left: 74%; top: 33%; }

/* portrait arrangement (phones) */
.stage.portrait .rail { left: 3%; right: 3%; top: 9%; bottom: 11%; border-radius: calc(var(--u) * 16); }
.stage.portrait .pot { top: 35%; }
.stage.portrait .board { top: 47.500%; --cw: calc(var(--u) * 8.6); }
.stage.portrait .seat.pos-0 { top: 85%; }
.stage.portrait .seat.pos-1 { left: 22%; top: 17%; }
.stage.portrait .seat.pos-2 { left: 78%; top: 17%; }
.stage.portrait .seat.pos-0 .seat-cards { --cw: calc(var(--u) * 9); }
.stage.portrait .seat.pos-0 .seat-cards.many { --cw: calc(var(--u) * 7.600); }
.stage.portrait .seat.pos-0 .seat-badge { bottom: calc(var(--u) * 8); left: 50%; transform: translateX(calc(var(--u) * 9)); margin: 0; }
.stage.portrait .bet-0 { top: 66%; }
.stage.portrait .bet-1 { left: 26%; top: 33%; }
.stage.portrait .bet-2 { left: 74%; top: 33%; }
.stage.portrait .dealer-0 { left: 27%; top: 79%; }
.stage.portrait .dealer-1 { left: 40%; top: 19%; }
.stage.portrait .dealer-2 { left: 60%; top: 19%; }

/* ---------------------------------------------------------------- overlays */
.overlay { position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 20; display: grid; place-items: center; padding: 12px; overflow-y: auto; background: rgba(6, 8, 12, .8); backdrop-filter: blur(4px); font-size: clamp(12px, calc(var(--u) * 1.6), 19px); animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } }
.spin-card, .finish-card { display: grid; justify-items: center; gap: 1em; width: min(100%, 30em); padding: 1.6em; border-radius: 1.2em; background: linear-gradient(180deg, #1e2430, #12151c); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); text-align: center; }
.spin-title { font-size: .9em; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 700; }
.spin-players { display: flex; justify-content: center; gap: 1.4em; }
.spin-players div { display: grid; justify-items: center; gap: .3em; font-size: .85em; font-weight: 600; max-width: 7em; }
.spin-players span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.spin-players .avatar { width: 3.2em; height: 3.2em; font-size: 1.5em; }
.reel { position: relative; --reel-h: 1.7em; font-size: 2.6em; font-weight: 800; width: min(100%, 6em); border-radius: .3em; background: #07090d; border: 2px solid var(--accent); box-shadow: inset 0 0 1em rgba(0, 0, 0, .9), 0 0 1.2em rgba(255, 122, 26, .35); }
.reel-window { height: var(--reel-h); overflow: hidden; -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }
.reel-strip { display: grid; will-change: transform; }
.reel-strip span { height: var(--reel-h); line-height: var(--reel-h); color: #dbe2ef; }
.reel-strip span.hot { color: var(--gold); }
.reel-mark { position: absolute; top: 50%; left: -.28em; right: -.28em; height: 0; }
.reel-mark::before, .reel-mark::after { content: ""; position: absolute; top: -.18em; border: .18em solid transparent; }
.reel-mark::before { left: 0; border-left-color: var(--accent); }
.reel-mark::after { right: 0; border-right-color: var(--accent); }
.spin-result { display: grid; gap: .3em; justify-items: center; opacity: 0; transform: translateY(.6em); transition: opacity .35s, transform .35s; }
.spin-result > b { font-size: 2em; color: var(--gold); line-height: 1.1; }
.spin-payouts { display: flex; gap: 1.6em; margin-top: .3em; font-weight: 700; }
.spin-payouts span { display: grid; }
.spin-overlay.landed .spin-result { opacity: 1; transform: none; }
.spin-overlay.landed .reel { animation: land .5s ease; }
.spin-overlay.landed .reel-window { -webkit-mask-image: none; mask-image: none; }
.spin-overlay.big .reel { border-color: var(--gold); box-shadow: 0 0 2em rgba(255, 209, 102, .8); animation: land .5s ease, glow 1s ease-in-out infinite alternate; }
@keyframes land { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes glow { to { box-shadow: 0 0 3.5em rgba(255, 209, 102, 1); } }

.finish-place { display: grid; place-items: center; width: 4.6em; height: 4.6em; border-radius: 50%; background: var(--panel-3); font-size: 1.5em; font-weight: 800; line-height: 1; align-content: center; }
.finish-place small { font-size: .42em; text-transform: uppercase; letter-spacing: .12em; }
.place-1 .finish-place { background: radial-gradient(circle at 30% 25%, #fff0b8, #e6a700); color: #2b1d00; box-shadow: 0 0 2em rgba(255, 209, 102, .6); }
.place-1 .finish-place small { color: #5c4300; }
.place-2 .finish-place { background: radial-gradient(circle at 30% 25%, #f4f6fa, #9aa4b5); color: #1a2030; }
.place-2 .finish-place small { color: #3c475c; }
.finish-card h2 { font-size: 1.5em; }
.finish-prize { font-size: 1.25em; font-weight: 800; color: var(--muted); }
.finish-prize.pos { color: var(--green); font-size: 1.7em; }
.finish-list { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: .4em; }
.finish-list li { display: flex; align-items: center; gap: .7em; padding: .5em .7em; border-radius: .7em; background: rgba(255, 255, 255, .04); text-align: left; }
.finish-list li.me { background: rgba(255, 122, 26, .14); box-shadow: inset 0 0 0 1px rgba(255, 122, 26, .5); }
.finish-list b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finish-list .avatar { width: 2em; height: 2em; font-size: 1.1em; }
.finish-actions { display: flex; flex-wrap: wrap; gap: .7em; width: 100%; }
.finish-actions .btn { flex: 1; padding: 0 12px; }
.finish-note { color: var(--muted); font-size: .9em; }

/* -------------------------------------------------------------- action bar */
.action-bar { position: relative; flex: none; height: 156px; display: flex; flex-direction: column; justify-content: flex-end; padding: 8px max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.action-inner { display: grid; gap: 8px; width: min(100%, 760px); margin: 0 auto; }
.action-inner.sent { opacity: .6; pointer-events: none; }
.hand-strength { align-self: center; margin-bottom: 6px; padding: 2px 12px; border-radius: 99px; background: rgba(0, 0, 0, .55); border: 1px solid rgba(255, 209, 102, .35); color: var(--gold); font-size: 13px; font-weight: 700; white-space: nowrap; pointer-events: none; z-index: 6; }
.act-row { display: flex; gap: 8px; }
.act { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 56px; border-radius: 13px; font-weight: 800; font-size: 16px; line-height: 1.15; letter-spacing: .02em; transition: transform .08s, filter .15s; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 8px 18px -10px rgba(0, 0, 0, .8); }
.act b { font-size: 14px; font-weight: 700; opacity: .9; }
.act:active { transform: translateY(1px) scale(.99); }
.act:hover { filter: brightness(1.1); }
.act-fold { background: linear-gradient(180deg, #4a2530, #33161f); color: #ffb3bf; border: 1px solid #6b2f3d; }
.act-check, .act-call { background: linear-gradient(180deg, var(--green), var(--green-2)); color: #03241a; }
.act-raise { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #1a0d02; }

.size-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
.presets { display: flex; gap: 6px; }
.preset { height: 36px; min-width: 52px; padding: 0 10px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.preset:hover { background: var(--panel-3); border-color: var(--accent); }
.slider-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.slider-row .icon-btn { width: 36px; height: 36px; }
.bet-input { width: 84px; height: 36px; padding: 0 8px; border-radius: 9px; background: #0c0f14; border: 1px solid var(--line); font-weight: 700; text-align: center; flex: none; -moz-appearance: textfield; appearance: textfield; }
.bet-input::-webkit-outer-spin-button, .bet-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bet-input:focus { outline: none; border-color: var(--accent); }

.pre-row { display: flex; gap: 8px; justify-content: center; }
.pre { flex: 1; max-width: 220px; display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: #c5ccd9; }
.pre i { width: 16px; height: 16px; border-radius: 5px; border: 2px solid #56607a; flex: none; }
.pre.on { border-color: var(--green); color: var(--text); background: rgba(31, 200, 138, .12); }
.pre.on i { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 2px #0f2a22; }
.away-row { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--muted); font-size: 14px; }
.away-row .act { flex: none; width: 180px; height: 48px; }
.idle-row { text-align: center; color: var(--muted); font-size: 14px; min-height: 46px; display: grid; place-items: center; }

/* -------------------------------------------------------------------- chat */
.chat-panel { position: fixed; left: 0; top: var(--topbar-h); bottom: 0; width: 330px; z-index: 40; display: flex; flex-direction: column; background: rgba(15, 18, 25, .97); border-right: 1px solid var(--line); box-shadow: 20px 0 50px rgba(0, 0, 0, .5); animation: slide-in .2s ease; }
@keyframes slide-in { from { transform: translateX(-30px); opacity: 0; } }
.chat-panel header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); }
.chat-list { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.chat-line { display: flex; gap: 8px; align-items: flex-start; }
.chat-line .avatar { width: 28px; height: 28px; font-size: 15px; }
.chat-line > div { min-width: 0; padding: 6px 10px; border-radius: 4px 12px 12px 12px; background: var(--panel-2); }
.chat-line.mine > div { background: rgba(255, 122, 26, .16); }
.chat-line b { font-size: 12.5px; margin-right: 6px; }
.chat-line time { font-size: 11px; color: var(--muted); }
.chat-line p { font-size: 14px; overflow-wrap: anywhere; }
.chat-line.dealer { justify-content: space-between; gap: 10px; padding: 3px 8px; border-left: 2px solid var(--panel-3); color: var(--muted); font-size: 12.5px; }
.chat-emotes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); }
.chat-emotes button { height: 38px; border-radius: 9px; background: var(--panel-2); font-size: 19px; font-weight: 800; }
.chat-emotes button:hover { background: var(--panel-3); }
.chat-form { display: flex; gap: 8px; padding: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border-radius: 10px; background: #0c0f14; border: 1px solid var(--line); }
.chat-form input:focus { outline: none; border-color: var(--accent); }
.chat-send { color: var(--accent-2); }

/* ----------------------------------------------------------------- dialogs */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(4, 6, 9, .72); backdrop-filter: blur(3px); animation: fade .15s ease; }
.modal { display: flex; flex-direction: column; width: min(100%, 460px); max-height: min(calc(100dvh - 32px), 760px); border-radius: 18px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 40px 100px rgba(0, 0, 0, .7); animation: pop .2s cubic-bezier(.2, .8, .3, 1.1); }
@keyframes pop { from { transform: translateY(12px) scale(.97); opacity: 0; } }
.modal-wide { width: min(100%, 760px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 18px 20px; overflow-y: auto; min-height: 0; }
.modal-body > h4:first-child { margin-top: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }

.settings-tabs { margin-bottom: 16px; }
.settings-content { min-height: 340px; }
.settings-panel { display: grid; gap: 4px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); cursor: pointer; }
.switch-row > .range { max-width: 260px; }
.switch-text { display: grid; min-width: 0; }
.switch-text b { font-weight: 600; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--panel-3); transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.toggle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.field-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.field-input { display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px; border-radius: 10px; background: #0c0f14; border: 1px solid var(--line); color: var(--text); }
.field-input:focus-within { border-color: var(--accent); }
.field-input input { flex: 1; min-width: 0; width: 100%; height: 100%; background: none; border: 0; outline: none; font-weight: 700; }
.field-input em { font-style: normal; color: var(--muted); font-size: 12px; white-space: nowrap; }
.field-input.fixed { font-weight: 700; color: var(--muted); background: var(--panel-2); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { display: grid; justify-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.swatch::before { content: ""; width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--c1), var(--c2)); border: 3px solid var(--panel-3); transition: border-color .15s, transform .15s; }
.swatch.active { color: var(--text); }
.swatch.active::before { border-color: var(--accent); transform: scale(1.06); box-shadow: 0 0 0 3px rgba(255, 122, 26, .25); }

.wallet-balance { display: flex; align-items: baseline; gap: 8px; }
.wallet-balance small { width: 100%; }
.wallet-balance { flex-wrap: wrap; }
.wallet-balance b { font-size: 34px; font-weight: 800; line-height: 1.1; }
.wallet-balance em { font-style: normal; color: var(--muted); font-weight: 600; }
.ledger { list-style: none; margin: 0; padding: 0; display: grid; }
.ledger li { display: grid; grid-template-columns: minmax(0, 1fr) auto 80px; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.ledger li > span:first-child { display: grid; }
.ledger li > span:nth-child(2) { font-weight: 700; }
.ledger li > small { text-align: right; }
.avatar-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.avatar-grid button { display: grid; place-items: center; aspect-ratio: 1; border-radius: 14px; background: var(--panel-2); border: 2px solid transparent; }
.avatar-grid button.active { border-color: var(--accent); background: rgba(255, 122, 26, .12); }
.avatar-grid .avatar { width: 70%; height: 70%; font-size: 26px; }

.toasts { position: fixed; top: calc(var(--topbar-h) + 12px); right: 14px; z-index: 200; display: grid; gap: 8px; justify-items: end; pointer-events: none; max-width: calc(100vw - 28px); }
.toast { padding: 10px 16px; border-radius: 11px; background: var(--panel-3); border: 1px solid var(--line); border-left: 4px solid var(--blue); box-shadow: 0 14px 34px rgba(0, 0, 0, .5); font-size: 14px; font-weight: 600; animation: toast-in .2s ease; transition: opacity .3s, transform .3s; }
.toast-error { border-left-color: var(--red); }
.toast-warn { border-left-color: var(--gold); }
.toast-ok { border-left-color: var(--green); }
.toast-out { opacity: 0; transform: translateX(20px); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } }

/* --------------------------------------------------- casino look (buttons) */
/* Raised, pressable buttons: a darker "edge" under each button sinks when it is pressed. */
.btn { border-radius: 13px; }
.btn-primary { background: linear-gradient(180deg, #ffd27a 0%, #ff9a2e 48%, #f0700d 100%); color: #2a1400; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); box-shadow: 0 4px 0 #9a4300, 0 14px 24px -12px rgba(255, 122, 26, .8), inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(120, 50, 0, .25); }
.btn-primary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 #9a4300, inset 0 2px 6px rgba(120, 50, 0, .45); }
.btn-ghost { background: linear-gradient(180deg, #2c3342, #1a1f29); border-color: #394256; box-shadow: 0 3px 0 #0a0c11, inset 0 1px 0 rgba(255, 255, 255, .08); }
.btn-ghost:hover:not(:disabled) { background: linear-gradient(180deg, #353d4f, #202632); }
.btn-ghost:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 #0a0c11, inset 0 2px 5px rgba(0, 0, 0, .5); }
.btn-sm { box-shadow: 0 2px 0 #0a0c11, inset 0 1px 0 rgba(255, 255, 255, .08); }
.icon-btn { background: linear-gradient(180deg, #2a3140, #1a1f29); border-color: #394256; box-shadow: 0 2px 0 #0a0c11, inset 0 1px 0 rgba(255, 255, 255, .08); }
.icon-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .5); }
.wallet-plus { box-shadow: 0 2px 0 #9a4300, inset 0 1px 0 rgba(255, 255, 255, .5); }
.buyin-card { box-shadow: 0 10px 24px -16px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .05); }

/* logo woven into the felt */
.felt-logo { position: absolute; left: 50%; top: 50%; width: calc(var(--u) * 36); max-width: 62%; transform: translate(-50%, -50%); opacity: .13; filter: saturate(.85); pointer-events: none; user-select: none; }
.stage.portrait .felt-logo { top: 52%; width: calc(var(--u) * 34); max-width: 70%; }

/* chips: a small stack seen from above, coloured by the size of the bet */
.bet { --chip: #3f7fe8; --chip-d: #1d4aa3; gap: calc(var(--u) * .8); padding: calc(var(--u) * .35) calc(var(--u) * 1.2) calc(var(--u) * .55) calc(var(--u) * .5); background: rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .1); }
.bet.chips-2 { --chip: #e0445c; --chip-d: #8f1c30; }
.bet.chips-3 { --chip: #22b477; --chip-d: #0e6b44; }
.bet.chips-4 { --chip: #2a2f3b; --chip-d: #090b10; }
.chip-icon, .pot::before { width: calc(var(--u) * 2.2); height: calc(var(--u) * 2.2); border-radius: 50%; background: radial-gradient(circle, #fff 0 26%, var(--chip) 29% 100%); border: calc(var(--u) * .3) dashed rgba(255, 255, 255, .92); box-shadow: 0 calc(var(--u) * .28) 0 var(--chip-d), 0 calc(var(--u) * .56) 0 var(--chip), 0 calc(var(--u) * .84) 0 var(--chip-d), 0 calc(var(--u) * 1.1) calc(var(--u) * .6) rgba(0, 0, 0, .7); flex: none; }
.bet.chips-4 .chip-icon { border-color: var(--gold); }
.pot { --chip: #f0a51e; --chip-d: #8a5a00; align-items: center; padding: calc(var(--u) * .4) calc(var(--u) * 1.7) calc(var(--u) * .6) calc(var(--u) * .6); background: linear-gradient(180deg, rgba(0, 0, 0, .6), rgba(0, 0, 0, .4)); border-color: rgba(255, 209, 102, .35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.pot::before { content: ""; margin-right: calc(var(--u) * .3); }
.dealer-btn { background: radial-gradient(circle at 35% 30%, #fff, #d9dfeb 60%, #aab3c6); border: calc(var(--u) * .22) solid var(--gold); box-shadow: 0 calc(var(--u) * .35) 0 #7a5a12, 0 calc(var(--u) * .7) calc(var(--u) * 1) rgba(0, 0, 0, .65); }

/* action console */
.action-bar { height: 188px; }
.action-inner:has(.act-row, .pre-row, .away-row) { padding: 12px; border-radius: 22px; background: linear-gradient(180deg, rgba(34, 40, 53, .92), rgba(13, 16, 22, .96)); border: 1px solid #343c4e; box-shadow: 0 -10px 40px -20px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .07); }
.act-row { gap: 10px; }
.act { flex-direction: row; gap: 12px; height: 60px; padding: 0 14px; border-radius: 16px; text-transform: uppercase; letter-spacing: .09em; font-size: 15px; transition: transform .07s, box-shadow .07s, filter .15s; }
.act-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(0, 0, 0, .2); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35), 0 1px 0 rgba(255, 255, 255, .25); font-size: 14px; flex: none; }
.act-icon .icon svg { stroke-width: 2.8; }
.act-text { display: grid; justify-items: start; line-height: 1.1; text-align: left; }
.act-text b { font-size: 19px; letter-spacing: 0; opacity: 1; font-weight: 800; }
.act-fold { background: linear-gradient(180deg, #f0677c 0%, #cf3350 50%, #a81d38 100%); color: #fff; border: 0; text-shadow: 0 1px 2px rgba(80, 0, 15, .6); box-shadow: 0 5px 0 #660f21, 0 16px 24px -14px rgba(207, 51, 80, .9), inset 0 1px 0 rgba(255, 255, 255, .45); }
.act-check, .act-call { background: linear-gradient(180deg, #5df0b8 0%, #1fc88a 50%, #0f9a67 100%); color: #03271b; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); box-shadow: 0 5px 0 #06573a, 0 16px 24px -14px rgba(31, 200, 138, .9), inset 0 1px 0 rgba(255, 255, 255, .6); }
.act-raise { background: linear-gradient(180deg, #ffe08a 0%, #ffb629 50%, #ea8f00 100%); color: #2b1900; text-shadow: 0 1px 0 rgba(255, 255, 255, .4); box-shadow: 0 5px 0 #875200, 0 16px 24px -14px rgba(255, 182, 41, .9), inset 0 1px 0 rgba(255, 255, 255, .65); }
.act:active { transform: translateY(5px); box-shadow: 0 0 0 transparent, inset 0 3px 8px rgba(0, 0, 0, .35); }
.action-inner.sent .act { transform: translateY(5px); box-shadow: inset 0 3px 8px rgba(0, 0, 0, .35); }

.size-row { gap: 12px; padding: 0 2px 2px; }
.presets { gap: 8px; }
.preset { height: 38px; min-width: 58px; padding: 0 12px; border-radius: 99px; background: radial-gradient(circle at 50% 30%, #333b4d, #1a1f29); border: 2px dashed rgba(255, 255, 255, .28); font-weight: 800; font-size: 13px; color: #e6ebf5; box-shadow: 0 3px 0 #0a0c11; transition: transform .07s, box-shadow .07s, border-color .15s, color .15s; }
.preset:hover { background: radial-gradient(circle at 50% 30%, #3b4458, #1f2531); border-color: var(--gold); color: var(--gold); }
.preset:active { transform: translateY(3px); box-shadow: 0 0 0 #0a0c11; }
.slider-row .icon-btn { border-radius: 50%; }
.range::-webkit-slider-runnable-track { height: 10px; border-radius: 10px; background: linear-gradient(90deg, var(--gold) 0, var(--accent) var(--fill), #0a0c11 var(--fill)); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .07); }
.range::-moz-range-track { height: 10px; border-radius: 10px; background: #0a0c11; }
.range::-moz-range-progress { height: 10px; border-radius: 10px; background: linear-gradient(90deg, var(--gold), var(--accent)); }
.range::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -9px; background: radial-gradient(circle, #fff 0 30%, var(--accent) 33% 100%); border: 3px dashed #fff; box-shadow: 0 3px 0 #9a4300, 0 6px 10px rgba(0, 0, 0, .6); }
.range::-moz-range-thumb { width: 22px; height: 22px; background: radial-gradient(circle, #fff 0 30%, var(--accent) 33% 100%); border: 3px dashed #fff; }
.bet-input { width: 92px; height: 38px; border-radius: 11px; background: #07090d; border: 1px solid #394256; color: var(--gold); font-size: 16px; font-weight: 800; box-shadow: inset 0 2px 5px rgba(0, 0, 0, .7); }

.pre-row { gap: 10px; }
.pre { height: 50px; border-radius: 14px; background: linear-gradient(180deg, #2c3342, #1a1f29); border: 1px solid #394256; box-shadow: 0 4px 0 #0a0c11, inset 0 1px 0 rgba(255, 255, 255, .08); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; transition: transform .07s, box-shadow .07s; }
.pre i { width: 18px; height: 18px; border-radius: 50%; border: 2px dashed #6b7691; }
.pre.on { transform: translateY(3px); background: linear-gradient(180deg, #17503d, #0f3327); border-color: var(--green); box-shadow: 0 1px 0 #06251b, inset 0 2px 6px rgba(0, 0, 0, .4); }
.pre.on i { background: radial-gradient(circle, #fff 0 28%, var(--green) 32% 100%); border: 2px dashed #fff; box-shadow: none; }
.away-row .act { width: 200px; height: 52px; }
.hand-strength { padding: 3px 14px; background: linear-gradient(180deg, rgba(0, 0, 0, .7), rgba(0, 0, 0, .5)); border-color: rgba(255, 209, 102, .5); letter-spacing: .02em; }

/* ------------------------------------------------- table cloth and rail */
/* The table is built from layers, all drawn in CSS so every felt colour gets the same treatment:
   rail  = padded leather (grain + stitching), then a thin metal inlay,
   felt  = base colour, a woven speed-cloth pattern, fibre noise, lamp light and a soft vignette. */
:root {
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 -.15'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.1 -.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --leather: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='.35' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .5 -.12'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.rail { padding: calc(var(--u) * 2.3); background: var(--leather), linear-gradient(180deg, #454d5e 0%, #2a303c 18%, #191d26 60%, #0e1117 100%); background-blend-mode: soft-light, normal; box-shadow: 0 calc(var(--u) * 3) calc(var(--u) * 6) rgba(0, 0, 0, .7), 0 calc(var(--u) * .6) calc(var(--u) * 1.2) rgba(0, 0, 0, .6), inset 0 calc(var(--u) * .35) calc(var(--u) * .5) rgba(255, 255, 255, .2), inset 0 calc(var(--u) * -.9) calc(var(--u) * 1.4) rgba(0, 0, 0, .75), inset 0 0 0 1px rgba(0, 0, 0, .6); }
/* stitching along the middle of the padding */
.rail::before { content: ""; position: absolute; inset: calc(var(--u) * .95); border-radius: inherit; border: calc(var(--u) * .12) dashed rgba(255, 255, 255, .2); pointer-events: none; }

.felt { background: radial-gradient(ellipse 85% 75% at 50% 42%, var(--felt-1) 0%, color-mix(in srgb, var(--felt-1) 55%, var(--felt-2)) 55%, var(--felt-2) 100%); box-shadow: 0 0 0 calc(var(--u) * .16) #07090c, 0 0 0 calc(var(--u) * .42) #b99a55, 0 0 0 calc(var(--u) * .58) #5d4a1e, 0 0 0 calc(var(--u) * .72) #07090c, inset 0 calc(var(--u) * 1.2) calc(var(--u) * 2.4) rgba(0, 0, 0, .65), inset 0 0 calc(var(--u) * 9) rgba(0, 0, 0, .6); overflow: hidden; }
/* weave + fibres */
.felt::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background-image: var(--grain), var(--grain-dark), repeating-linear-gradient(45deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 3px), repeating-linear-gradient(-45deg, rgba(0, 0, 0, .1) 0 1px, transparent 1px 3px); background-size: 240px 240px, 240px 240px, auto, auto; mix-blend-mode: soft-light; opacity: .95; }
/* betting line, lamp light from above and vignette */
.felt::after { inset: 0; border: 0; background: radial-gradient(ellipse 58% 46% at 50% 30%, rgba(255, 255, 255, .15), transparent 72%), radial-gradient(ellipse 100% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, .38) 100%); pointer-events: none; }
.felt-line { position: absolute; inset: calc(var(--u) * 2.4); border-radius: inherit; border: calc(var(--u) * .16) solid rgba(255, 255, 255, .13); box-shadow: 0 0 calc(var(--u) * .4) rgba(0, 0, 0, .35), inset 0 0 calc(var(--u) * .4) rgba(0, 0, 0, .25); pointer-events: none; }
.felt-logo { opacity: .2; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .35)); z-index: 1; }
.stage.portrait .rail { padding: calc(var(--u) * 1.9); }

/* ------------------------------------------------ royal theme (purple + gold) */
/* The look of the whole client: deep violet night, gold accents, glowing table rail.
   It overrides the neutral tokens and components defined above. */
:root {
  --panel: #150f2e;
  --panel-2: #1d1540;
  --panel-3: #2b2058;
  --line: #382b6b;
  --text: #f4f1ff;
  --muted: #a69fc9;
  --accent: #ff9d0a;
  --accent-2: #ffc53d;
  --gold: #ffd24a;
  --glow: rgba(124, 77, 255, .45);
}
body { background: radial-gradient(90% 70% at 12% 0%, rgba(111, 66, 255, .35), transparent 60%), radial-gradient(70% 60% at 100% 100%, rgba(255, 140, 20, .16), transparent 60%), radial-gradient(120% 90% at 50% 0%, var(--bg-2), var(--bg) 72%) fixed var(--bg); }
::-webkit-scrollbar-thumb { background-color: #3a2d6e; }

/* portraits */
.avatar { background: #0d0a1c; box-shadow: 0 2px 8px rgba(0, 0, 0, .6); overflow: hidden; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* top bar */
.topbar { height: var(--topbar-h); background: linear-gradient(180deg, rgba(20, 13, 48, .95), rgba(10, 7, 26, .9)); border-bottom: 1px solid #2f2360; box-shadow: 0 10px 30px -18px #000; }
.brand img { display: block; height: 46px; width: auto; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .6)); }
.online { height: 38px; padding: 0 14px; border-radius: 99px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; font-weight: 700; }
.online b { color: var(--green); }
.wallet { height: 40px; padding: 0 4px 0 8px; border-radius: 99px; background: rgba(0, 0, 0, .4); border: 1px solid var(--line); gap: 8px; }
.wallet::before { content: ""; width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle, #ffe9a6 0 28%, #f0a51e 31% 62%, #b97300 65% 100%); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35), 0 2px 6px rgba(0, 0, 0, .5); flex: none; }
.wallet b { font-size: 16px; }
.wallet-plus { border-radius: 50%; width: 30px; height: 30px; margin-left: 2px; }
.profile-btn { height: 42px; padding: 0 14px 0 3px; border-radius: 99px; background: rgba(0, 0, 0, .4); border: 1px solid var(--line); }
.profile-btn .avatar { width: 36px; height: 36px; }
.icon-btn { background: linear-gradient(180deg, #2a2056, #171033); border-color: #3d2f78; box-shadow: 0 2px 0 #07051a, inset 0 1px 0 rgba(255, 255, 255, .1); color: #c9c2ea; border-radius: 12px; }
.icon-btn:hover:not(:disabled) { background: linear-gradient(180deg, #35296c, #1d1540); color: #fff; }
.btn-ghost { background: linear-gradient(180deg, #2c2159, #191138); border-color: #3d2f78; box-shadow: 0 3px 0 #07051a, inset 0 1px 0 rgba(255, 255, 255, .1); }
.btn-ghost:hover:not(:disabled) { background: linear-gradient(180deg, #382b70, #201746); }
.btn-ghost:active:not(:disabled), .btn-sm:active:not(:disabled) { box-shadow: 0 0 0 #07051a, inset 0 2px 5px rgba(0, 0, 0, .5); }
.btn-sm { box-shadow: 0 2px 0 #07051a, inset 0 1px 0 rgba(255, 255, 255, .1); }
.btn-primary { background: linear-gradient(180deg, #ffe07a 0%, #ffb21f 48%, #f08a00 100%); box-shadow: 0 4px 0 #8f4c00, 0 14px 26px -12px rgba(255, 160, 20, .85), inset 0 1px 0 rgba(255, 255, 255, .65), inset 0 -2px 0 rgba(120, 60, 0, .25); }
.btn-primary:active:not(:disabled) { box-shadow: 0 0 0 #8f4c00, inset 0 2px 6px rgba(120, 60, 0, .45); }
.btn-lg { height: 56px; padding: 0 32px; border-radius: 99px; font-size: 18px; gap: 10px; }
.segmented { background: rgba(0, 0, 0, .35); border-color: var(--line); }
.segmented button.active { background: linear-gradient(180deg, #ffd35a, #f59a00); color: #2a1500; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.table-tab { background: rgba(0, 0, 0, .35); border-color: var(--line); border-radius: 99px; padding: 0 16px 0 12px; }
.table-tab.active { border-color: var(--gold); background: rgba(255, 180, 30, .12); color: var(--gold); box-shadow: 0 0 14px -4px rgba(255, 180, 30, .7); }

/* lobby: side menu | content | quick games + winners */
.lobby { padding-top: 18px; }
.lobby > * { max-width: 1560px; }
.lobby-shell { display: grid; grid-template-columns: 228px minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.lobby-center { min-width: 0; display: grid; gap: 18px; }
.lobby-right { display: grid; gap: 18px; position: sticky; top: 0; min-width: 0; }
.lobby-side { display: grid; gap: 16px; position: sticky; top: 0; }
.lobby-tabs { display: none; }
.lobby-note { margin: 0; text-align: center; }

.side-nav { display: grid; gap: 4px; padding: 10px; border-radius: 18px; background: linear-gradient(180deg, rgba(29, 21, 64, .9), rgba(15, 10, 34, .9)); border: 1px solid var(--line); }
.side-nav button { display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 14px; border-radius: 13px; color: #cfc8ee; font-weight: 600; text-align: left; transition: background .15s, color .15s; }
.side-nav button .icon { font-size: 20px; color: #8f85bd; }
.side-nav button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav button.active { background: linear-gradient(180deg, #ffd35a, #f59a00); color: #2a1500; font-weight: 800; box-shadow: 0 3px 0 #8f4c00, 0 10px 22px -10px rgba(255, 160, 20, .9), inset 0 1px 0 rgba(255, 255, 255, .6); }
.side-nav button.active .icon { color: #2a1500; }
.side-promo { display: grid; justify-items: center; gap: 6px; padding: 16px 14px; border-radius: 18px; text-align: center; background: radial-gradient(120% 80% at 50% 0%, rgba(255, 150, 20, .28), transparent 65%), linear-gradient(180deg, #221748, #120c2a); border: 1px solid rgba(255, 190, 60, .35); }
.side-promo img { width: 82%; height: auto; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .6)); }
.side-promo b { font-size: 16px; }
.side-promo .btn { margin-top: 6px; }

.lobby-hero { min-height: 250px; padding: 30px 34px; border-radius: 24px; border: 1px solid #45358a; background: radial-gradient(60% 120% at 78% 50%, rgba(255, 160, 30, .34), transparent 62%), radial-gradient(70% 130% at 0% 0%, rgba(124, 77, 255, .55), transparent 60%), repeating-conic-gradient(from 0deg at 78% 50%, rgba(255, 255, 255, .035) 0 6deg, transparent 6deg 14deg), linear-gradient(120deg, #1b1242, #0d0920); box-shadow: 0 24px 50px -30px #000, inset 0 1px 0 rgba(255, 255, 255, .08); }
.hero-text { position: relative; z-index: 1; display: grid; gap: 14px; justify-items: start; }
.hero-text h1 { font-size: clamp(30px, 4.2vw, 58px); font-style: italic; font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; line-height: 1; color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.hero-text h1 em { background: linear-gradient(180deg, #fff3b0, #ffb21f 55%, #f07a00); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; padding-right: .12em; }
.hero-text p { margin: 0; color: #d6cff5; max-width: 460px; font-size: 16px; }
.hero-logo { height: clamp(170px, 20vw, 270px); width: auto; flex: none; margin: -20px 0; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .65)) drop-shadow(0 0 40px rgba(255, 160, 30, .35)); animation: hero-float 5s ease-in-out infinite; }
@keyframes hero-float { 50% { transform: translateY(-8px); } }

.quick-panel, .wins-panel { position: static; padding: 18px; border-radius: 20px; background: linear-gradient(180deg, rgba(29, 21, 64, .92), rgba(15, 10, 34, .92)); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.quick-panel h3, .wins-panel h3 { display: flex; align-items: center; gap: 8px; font-size: 17px; margin-bottom: 14px; }
.quick-panel h3 .icon { color: var(--gold); }
.quick-panel h3 small { margin-left: auto; font-weight: 600; }
.wins-panel h3::before { content: ""; width: 20px; height: 20px; background: var(--gold); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 3h10v2h4v3a5 5 0 0 1-4.600 5A5 5 0 0 1 13 16.900V19h3v2H8v-2h3v-2.100A5 5 0 0 1 7.600 13 5 5 0 0 1 3 8V5h4zm0 4H5v1a3 3 0 0 0 2 2.800zm10 0v3.800A3 3 0 0 0 19 8V7z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 3h10v2h4v3a5 5 0 0 1-4.600 5A5 5 0 0 1 13 16.900V19h3v2H8v-2h3v-2.100A5 5 0 0 1 7.600 13 5 5 0 0 1 3 8V5h4zm0 4H5v1a3 3 0 0 0 2 2.800zm10 0v3.800A3 3 0 0 0 19 8V7z'/%3E%3C/svg%3E") center / contain no-repeat; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick { display: flex; align-items: baseline; justify-content: center; gap: 5px; height: 46px; border-radius: 99px; background: linear-gradient(180deg, #2c2159, #191138); border: 1px solid #45358a; box-shadow: 0 3px 0 #07051a, inset 0 1px 0 rgba(255, 255, 255, .1); transition: transform .07s, box-shadow .07s, border-color .15s; }
.quick b { font-size: 17px; }
.quick em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 700; }
.quick:hover { border-color: var(--gold); }
.quick:active { transform: translateY(3px); box-shadow: 0 0 0 #07051a; }
.quick.on { align-items: center; background: linear-gradient(180deg, #ffd35a, #f59a00); border-color: #ffe9a6; color: #2a1500; box-shadow: 0 3px 0 #8f4c00, 0 0 18px -4px rgba(255, 170, 30, .9); }
.quick.on em { color: #5c3500; }
.quick.on .spinner { border-color: rgba(60, 30, 0, .25); border-top-color: #2a1500; }
.lobby-main.is-leaders .wins-list { max-height: none; }
.month-top { background: linear-gradient(135deg, rgba(255, 190, 50, .22), rgba(124, 77, 255, .18)); }
.wins-list li { background: rgba(0, 0, 0, .28); }
.wins-list .avatar { width: 40px; height: 40px; }

.buyin-card { background: linear-gradient(180deg, #221849, #140e2e); border-color: #3d2f78; border-radius: 18px; box-shadow: 0 14px 30px -20px #000, inset 0 1px 0 rgba(255, 255, 255, .07); }
.buyin-card::before { height: 4px; background: linear-gradient(90deg, #ff8a00, #ffd24a); }
.buyin-card.game-omaha::before { background: linear-gradient(90deg, #7c4dff, #c084fc); }
.buyin-card:hover { border-color: #6a55c9; box-shadow: 0 18px 36px -18px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .07); }
.buyin-card.is-waiting { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 26px -6px rgba(255, 180, 30, .8); }
.bc-prize { background: rgba(255, 190, 50, .09); border-color: rgba(255, 200, 80, .35); }
.stat, .history-row, .step, .facts, .data-table, .blind-strip span, .stepper { background: rgba(21, 15, 46, .9); }
.data-table th { background: #1d1540; }
.modal { background: linear-gradient(180deg, #1d1540, #120c2a); border-color: #45358a; }
.field-input, .chat-form input, .bet-input { background: #090617; }
.chat-panel { background: rgba(14, 9, 34, .98); }
.toast { background: #241a4d; }
.avatar-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; }
.avatar-grid button { background: rgba(0, 0, 0, .3); border-radius: 50%; padding: 4px; }
.avatar-grid button.active { border-color: var(--gold); background: rgba(255, 180, 30, .15); box-shadow: 0 0 16px -2px rgba(255, 180, 30, .8); }
.avatar-grid .avatar { width: 100%; height: 100%; }
.boot-logo { width: min(70vw, 360px); height: auto; filter: drop-shadow(0 16px 30px rgba(0, 0, 0, .6)); animation: hero-float 3s ease-in-out infinite; }
.boot-bar { background: #2b2058; }

/* table: night room, glowing gold rail */
.table-view { background: radial-gradient(60% 55% at 50% 48%, rgba(124, 77, 255, .22), transparent 70%); }
.hud-prize, .hud-item { background: rgba(14, 9, 34, .8); border-color: var(--line); }
.hud-prize { border-color: rgba(255, 200, 80, .5); background: rgba(255, 180, 30, .1); }
.rail { background: var(--leather), linear-gradient(180deg, #3a2f66 0%, #231a47 20%, #130d2b 62%, #080514 100%); box-shadow: 0 0 0 calc(var(--u) * .22) #ffb21f, 0 0 calc(var(--u) * 1.2) rgba(255, 170, 30, .9), 0 0 calc(var(--u) * 5) rgba(255, 150, 20, .45), 0 calc(var(--u) * 3) calc(var(--u) * 6) rgba(0, 0, 0, .75), inset 0 calc(var(--u) * .35) calc(var(--u) * .5) rgba(255, 255, 255, .22), inset 0 calc(var(--u) * -.9) calc(var(--u) * 1.4) rgba(0, 0, 0, .8); }
.felt-logo { width: calc(var(--u) * 26); max-width: 46%; top: 53%; opacity: .2; filter: saturate(.55) brightness(1.15) drop-shadow(0 2px 2px rgba(0, 0, 0, .4)); }
.stage.portrait .felt-logo { width: calc(var(--u) * 30); max-width: 62%; top: 55%; }
.seat-pod { background: linear-gradient(180deg, #2a2056, #110b28); border-color: #5140a0; padding: calc(var(--u) * .3) calc(var(--u) * 1.9) calc(var(--u) * .3) calc(var(--u) * .3); min-width: calc(var(--u) * 16.500); }
.seat-avatar { margin: calc(var(--u) * -1) 0 calc(var(--u) * -1) calc(var(--u) * -.8); }
.seat-avatar .avatar { width: calc(var(--u) * 7.400); height: calc(var(--u) * 7.400); box-shadow: 0 calc(var(--u) * .4) calc(var(--u) * 1) rgba(0, 0, 0, .7); }
.seat-name { color: #cfc8ee; font-size: calc(var(--u) * 1.400); }
.seat-stack { display: flex; align-items: center; gap: calc(var(--u) * .6); font-size: calc(var(--u) * 1.800); }
.seat-stack::before { content: ""; width: calc(var(--u) * 1.600); height: calc(var(--u) * 1.600); border-radius: 50%; background: radial-gradient(circle, #fff 0 26%, #3f7fe8 30% 100%); border: calc(var(--u) * .22) dashed #fff; flex: none; }
.seat.out .seat-stack::before { display: none; }
.seat-timer { left: calc(var(--u) * 8); }
.seat.acting .seat-pod { border-color: var(--gold); box-shadow: 0 0 0 calc(var(--u) * .3) rgba(255, 190, 40, .3), 0 0 calc(var(--u) * 2.6) rgba(255, 180, 30, .7); }
.seat.acting .seat-avatar .avatar { box-shadow: 0 0 0 calc(var(--u) * .3) var(--gold), 0 0 calc(var(--u) * 2) rgba(255, 180, 30, .9); }
.seat-badge { background: #2b2058; }
.spin-card, .finish-card { background: linear-gradient(180deg, #241a4d, #110b28); border-color: #5140a0; box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 60px -20px var(--glow); }
.spin-players .avatar { width: 3.6em; height: 3.6em; }
.finish-list .avatar { width: 2.2em; height: 2.2em; }
.reel { border-color: var(--gold); box-shadow: inset 0 0 1em rgba(0, 0, 0, .9), 0 0 1.2em rgba(255, 180, 30, .5); }
.reel-mark::before { border-left-color: var(--gold); }
.reel-mark::after { border-right-color: var(--gold); }

/* action console in the royal palette */
.action-inner:has(.act-row, .pre-row, .away-row) { background: linear-gradient(180deg, rgba(42, 32, 86, .95), rgba(14, 9, 34, .97)); border-color: #5140a0; box-shadow: 0 -10px 40px -20px #000, 0 0 40px -18px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .1); }
.preset { background: radial-gradient(circle at 50% 30%, #35296c, #191138); box-shadow: 0 3px 0 #07051a; border-style: solid; border-width: 1px; border-color: #5140a0; }
.preset:hover { background: radial-gradient(circle at 50% 30%, #40327f, #1f1646); }
.preset:active { box-shadow: 0 0 0 #07051a; }
.pre { background: linear-gradient(180deg, #2c2159, #191138); border-color: #45358a; box-shadow: 0 4px 0 #07051a, inset 0 1px 0 rgba(255, 255, 255, .1); }
.bet-input { border-color: #45358a; }
.range::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--gold) 0, var(--accent) var(--fill), #090617 var(--fill)); }

/* wide screens: the console moves to the right of the table, with tall square buttons */
@media (min-width: 1100px) and (min-height: 600px) {
  .table-view { display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-rows: auto minmax(0, 1fr); }
  .table-hud { grid-column: 1 / -1; }
  .table-area { grid-column: 1; grid-row: 2; }
  .action-bar { grid-column: 2; grid-row: 2; height: auto; align-self: end; justify-content: flex-end; padding: 0 20px 26px 4px; }
  .action-inner { width: 100%; gap: 12px; }
  .action-inner:has(.act-row, .pre-row, .away-row) { padding: 16px; border-radius: 26px; }
  .hand-strength { margin-bottom: 10px; font-size: 14px; }
  .size-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .preset { min-width: 0; height: 44px; border-radius: 14px; font-size: 15px; }
  .slider-row { padding: 6px; border-radius: 16px; background: rgba(0, 0, 0, .35); border: 1px solid #45358a; }
  .slider-row .icon-btn { width: 42px; height: 42px; border-radius: 12px; }
  .bet-input { width: 78px; height: 42px; border: 0; background: none; box-shadow: none; font-size: 20px; }
  .act-row { gap: 10px; }
  .act { flex-direction: column; height: 122px; padding: 12px 6px; gap: 10px; border-radius: 20px; font-size: 14px; }
  .act-icon { width: 40px; height: 40px; font-size: 16px; }
  .act-text { justify-items: center; text-align: center; gap: 2px; }
  .act-text b { font-size: 22px; }
  .pre-row { flex-direction: column; }
  .pre { flex: none; max-width: none; height: 54px; justify-content: flex-start; padding: 0 18px; }
  .away-row { flex-direction: column; text-align: center; }
  .away-row .act { width: 100%; height: 64px; flex-direction: row; }
  .idle-row { min-height: 0; padding-bottom: 8px; }
}

/* -------------------------------------------------------------- responsive */
@media (max-width: 1040px) {
  .lobby-shell { grid-template-columns: minmax(0, 1fr); }
  .lobby-side { display: none; }
  .lobby-tabs { display: inline-flex; }
  .lobby-right { position: static; }
  .hero-logo { height: clamp(120px, 26vw, 200px); }
  .wins-panel { position: static; }
  .wins-list { max-height: none; }
  .hero-mults { display: none; }
}

@media (max-width: 760px) {
  :root { --topbar-h: 52px; }
  .topbar { gap: 8px; }
  .online > span, .profile-btn > span:last-child, .wide-only { display: none; }
  .online { padding: 0 10px; }
  .profile-btn { padding: 0 3px; }
  .online { margin: 0; }
  .wallet { padding-left: 10px; }
  .wallet em { display: none; }
  .table-tab { padding: 0 9px; }
  .table-tab .icon { display: none; }
  .lobby { padding: 14px 12px 30px; }
  .lobby-hero { padding: 20px 18px; border-radius: 18px; min-height: 0; gap: 8px; }
  .hero-text p { font-size: 14px; }
  .hero-logo { height: 112px; margin: 0 -8px 0 0; }
  .btn-lg { height: 48px; padding: 0 22px; font-size: 16px; }
  .brand img { height: 38px; }
  .wallet::before { display: none; }
  .quick-grid { gap: 8px; }
  .buyin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .buyin-card { padding: 13px; gap: 10px; }
  .bc-buyin b { font-size: 28px; }
  .bc-prize { flex-direction: column; gap: 0; align-items: flex-start; }
  .bc-waiting { flex-direction: column; align-items: stretch; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .history-row .icon, .hr-mult { display: none; }
  .hud-hand, .hud-back > span:not(.icon) { display: none; }
  .table-hud { gap: 6px; padding-top: 8px; }
  .hud-prize, .hud-item { padding: 4px 9px; font-size: 13px; }
  .table-area { padding: 4px; }
  .action-bar { height: 212px; }
  .size-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .presets { display: grid; grid-template-columns: repeat(4, 1fr); }
  .preset { min-width: 0; height: 32px; }
  .slider-row .icon-btn { display: none; }
  .act { height: 56px; font-size: 13px; gap: 8px; padding: 0 8px; }
  .act-icon { width: 28px; height: 28px; font-size: 12px; }
  .act-text b { font-size: 16px; }
  .action-inner:has(.act-row, .pre-row, .away-row) { padding: 10px; border-radius: 18px; }
  .pre { font-size: 11.5px; letter-spacing: .03em; }
  .chat-panel { width: 100%; top: auto; height: min(70dvh, 520px); border-right: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: 0 -20px 50px rgba(0, 0, 0, .6); animation-name: slide-up; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal, .modal-wide { width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toggle-grid { grid-template-columns: minmax(0, 1fr); }
  .toasts { left: 14px; justify-items: stretch; }
}
@keyframes slide-up { from { transform: translateY(30px); opacity: 0; } }

@media (max-width: 380px) {
  .online { display: none; }
  .wallet-plus { width: 26px; height: 26px; }
}

/* short landscape screens (phones turned sideways) */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --topbar-h: 44px; }
  .online > span, .profile-btn > span:last-child { display: none; }
  .brand img { height: 34px; }
  .table-hud { position: absolute; top: calc(var(--topbar-h) + 4px); left: 0; right: 0; z-index: 10; padding-top: 0; pointer-events: none; }
  .table-hud > * { pointer-events: auto; }
  .hud-hand, .hud-back > span:not(.icon) { display: none; }
  .hud-prize, .hud-item { padding: 2px 8px; font-size: 12px; }
  .table-view { position: relative; flex-direction: row; }
  .table-area { padding: 2px; }
  .action-bar { width: 250px; height: auto; justify-content: center; padding: 6px; }
  .size-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .presets { display: grid; grid-template-columns: repeat(4, 1fr); }
  .preset { min-width: 0; height: 30px; padding: 0 4px; }
  .slider-row .icon-btn { display: none; }
  .act-row, .pre-row { flex-direction: column; }
  .act { flex: none; height: 42px; gap: 8px; }
  .act-icon { width: 26px; height: 26px; }
  .act-text { display: flex; align-items: baseline; gap: 6px; }
  .pre { max-width: none; flex: none; height: 40px; }
  .away-row { flex-direction: column; text-align: center; }

}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
