/* Nabla Poker — design tokens, app shell and shared components */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "STIX Two Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/stix-two-text-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "STIX Two Text"; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url("/fonts/stix-two-text-latin-wght-italic.woff2") format("woff2"); }
/* The nabla-dollar sign: no Inter subset has it and many phones have no font with one. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/nabla.woff2") format("woff2");
  unicode-range: U+2207; }
@font-face { font-family: "STIX Two Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/nabla.woff2") format("woff2");
  unicode-range: U+2207; }
@font-face { font-family: "STIX Two Text"; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url("/fonts/nabla.woff2") format("woff2");
  unicode-range: U+2207; }
:root {
  --bg: #06071a;
  --bg-2: #0a0c24;
  --surface: #10132c;
  --surface-2: #171b3a;
  --surface-3: #242a54;
  --line: rgba(150, 165, 255, .11);
  --line-2: rgba(150, 165, 255, .2);
  --text: #eef0ff;
  --muted: #9ca4cf;
  --faint: #6a72a3;
  --accent: #4dd6ff;
  --accent-2: #2a9fe6;
  --accent-ink: #04122b;
  --pos: #45e6a8;
  /* The brand gradient is a colour map, read from low to high like a field plot. */
  --field: linear-gradient(90deg, #7b7dff, #4dd6ff 45%, #5df2c1 78%, #f3e86b);
  --serif: "STIX Two Text", "STIX Two Math", Cambria, "Times New Roman", serif;
  --gold: #f6c453;
  --gold-2: #e09b1f;
  --red: #ff5d6c;
  --blue: #7c8cff;
  --violet: #a78bfa;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 60px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 650; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.pos { color: var(--pos); }
.neg { color: var(--red); }
[hidden] { display: none !important; }
svg.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
::selection { background: rgba(77, 214, 255, .3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ shell */
#app { min-height: 100%; display: flex; flex-direction: column; }
.backdrop {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 10% -12%, rgba(123, 125, 255, .2), transparent 62%),
    radial-gradient(820px 520px at 100% 0%, rgba(77, 214, 255, .11), transparent 60%),
    radial-gradient(700px 600px at 50% 120%, rgba(93, 242, 193, .07), transparent 60%),
    radial-gradient(rgba(150, 165, 255, .16) 1px, transparent 1.5px) 0 0 / 30px 30px,
    var(--bg);
}
.topbar {
  position: sticky; top: 0; z-index: 30; height: calc(var(--nav-h) + var(--safe-t)); padding: var(--safe-t) 20px 0;
  display: flex; align-items: center; gap: 22px;
  background: rgba(6, 7, 26, .72); backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--field); opacity: .45; }
.brand { display: flex; align-items: center; gap: 10px; font: 650 21px/1 var(--serif); letter-spacing: -.01em; }
.brand i { font-weight: 600; background: var(--field); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .08em; margin-right: -.08em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #7b7dff, #4dd6ff 55%, #5df2c1); color: var(--accent-ink);
  box-shadow: 0 6px 20px rgba(92, 160, 255, .45), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.brand-mark svg { width: 20px; height: 20px; margin-top: 1px; }
.nav { display: flex; gap: 4px; margin-right: auto; }
.nav a {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; color: var(--muted);
  font-weight: 600; font-size: 14px; transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav a.active { color: var(--text); background: rgba(255, 255, 255, .09); }
.bankroll {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 7px; border-radius: 999px;
  background: rgba(246, 196, 83, .1); border: 1px solid rgba(246, 196, 83, .25); color: var(--gold);
  font-weight: 700; font-size: 14px;
}
.chip-ico {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 8h10l-5 9z' fill='%23a06a10'/%3E%3C/svg%3E") center / 100% no-repeat,
    radial-gradient(circle at 50% 50%, #fff3c9 0 46%, transparent 48%),
    repeating-conic-gradient(#fff3c9 0 12deg, var(--gold-2) 12deg 45deg);
  box-shadow: inset 0 0 0 2px var(--gold-2), 0 2px 5px rgba(0, 0, 0, .4);
}
.avatar {
  --hue: 160;
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #fff; text-transform: uppercase;
  background: linear-gradient(140deg, hsl(var(--hue) 70% 52%), hsl(calc(var(--hue) + 40) 65% 36%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.avatar svg { width: 55%; height: 55%; }
.user-btn { display: flex; align-items: center; gap: 8px; border-radius: 999px; padding: 3px; }
.user-btn:hover { background: rgba(255, 255, 255, .06); }

.tabbar { display: none; }
main.page { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; }
main.page.wide { max-width: 1400px; }

@media (max-width: 760px) {
  .topbar { padding: var(--safe-t) 14px 0; gap: 10px; --nav-h: 54px; }
  .topbar .nav { display: none; }
  .topbar .brand { margin-right: auto; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column;
    grid-auto-columns: 1fr; padding: 6px 8px calc(6px + var(--safe-b));
    background: rgba(8, 9, 30, .86); backdrop-filter: blur(18px) saturate(1.4); border-top: 1px solid var(--line);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 11px; font-weight: 600;
    color: var(--faint); border-radius: 12px; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--accent); }
  main.page { padding: 18px 14px calc(96px + var(--safe-b)); }
}

/* ------------------------------------------------------------------ buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
  border-radius: 12px; font-weight: 700; font-size: 14px; letter-spacing: .01em; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  transition: transform .08s, filter .15s, background .15s, box-shadow .15s; user-select: none;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary {
  background: linear-gradient(100deg, #8a8cff, #4dd6ff 55%, #5df2c1); color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 8px 26px rgba(92, 160, 255, .32), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn.primary:hover { filter: brightness(1.07); }
.btn.gold { background: linear-gradient(180deg, #ffd978, #e9a62b); color: #2b1c00; border-color: transparent;
  box-shadow: 0 8px 22px rgba(246, 196, 83, .25), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.btn.danger { color: var(--red); border-color: rgba(255, 93, 108, .35); background: rgba(255, 93, 108, .08); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { height: 50px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.icon-only { width: 40px; padding: 0; }
.btn.sm.icon-only { width: 34px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.input, select.input {
  height: 44px; width: 100%; padding: 0 14px; border-radius: 12px; background: var(--bg-2);
  border: 1px solid var(--line-2); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(77, 214, 255, .15); }
select.input { appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a0b3' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 12px; border-radius: 9px; font-weight: 650; font-size: 13px; color: var(--muted);
  white-space: nowrap; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; cursor: pointer; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3);
  position: relative; transition: background .15s; flex: none; cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform .18s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked { background: var(--accent-2); }
.switch input:checked::after { transform: translateX(18px); }
input[type=range] { appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; --fill: 50%; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, #7b7dff, var(--accent) var(--fill), var(--surface-3) var(--fill)); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, #7b7dff, var(--accent) var(--fill), var(--surface-3) var(--fill)); }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .5), 0 0 0 4px rgba(77, 214, 255, .25); }
input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5), 0 0 0 4px rgba(77, 214, 255, .25); }

.card-panel { background: linear-gradient(180deg, rgba(150, 165, 255, .06), rgba(150, 165, 255, .015)), var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .07); color: var(--muted); white-space: nowrap; }
.pill.live { background: rgba(77, 214, 255, .12); color: var(--accent); }
.pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 0 currentColor; animation: pulse 1.6s infinite; }
.pill.gold { background: rgba(246, 196, 83, .12); color: var(--gold); }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 18px; margin-bottom: 6px; }
.empty .btn { margin-top: 18px; }
/* Loading is a nabla with curl. */
.spinner { width: 34px; height: 34px; margin: 60px auto; background: linear-gradient(135deg, #7b7dff, #4dd6ff 55%, #5df2c1);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5h18L12 21zM8.37 7.2h9.9L13.32 16z' fill='%23000' fill-rule='evenodd'/%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='M3 5h18L12 21zM8.37 7.2h9.9L13.32 16z' fill='%23000' fill-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat;
  transform-origin: 50% 43%; animation: spin 1.3s cubic-bezier(.6, .1, .3, .9) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ overlays */
.scrim { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(3, 4, 16, .62); backdrop-filter: blur(6px); animation: fade .16s ease-out; }
.modal { width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(150, 165, 255, .1), transparent 40%), var(--surface);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: pop .22s cubic-bezier(.2, 1.2, .4, 1); }
.modal.wide { width: min(560px, 100%); }
.modal h2 { font-size: 25px; letter-spacing: -.01em; line-height: 1.15; }
.modal .sub { color: var(--muted); margin-top: 4px; font-size: 14px; }
.modal form, .modal .stack { display: grid; gap: 14px; margin-top: 18px; }
.modal .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.modal .error { color: var(--red); font-size: 13px; font-weight: 600; min-height: 18px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@media (max-width: 560px) {
  .scrim { place-items: end center; padding: 0; }
  .modal, .modal.wide { width: 100%; border-radius: 24px 24px 0 0; padding: 22px 18px calc(22px + var(--safe-b));
    animation: sheet .26s cubic-bezier(.2, 1, .3, 1); max-height: 92dvh; }
  .modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--surface-3);
    margin: -8px auto 14px; }
}
@keyframes sheet { from { transform: translateY(100%); } }

.menu { position: fixed; z-index: 120; min-width: 210px; padding: 6px; border-radius: 14px; background: var(--surface-2);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: pop .14s ease-out; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  font-weight: 600; font-size: 14px; text-align: left; }
.menu button:hover, .menu a:hover { background: rgba(255, 255, 255, .07); }
.menu .sep { height: 1px; margin: 6px; background: var(--line); }
.menu .head { padding: 8px 12px 6px; font-size: 12px; color: var(--muted); }
.menu .danger { color: var(--red); }

#toasts { position: fixed; z-index: 200; top: calc(14px + var(--safe-t)); left: 50%; transform: translateX(-50%);
  display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast { padding: 10px 16px; border-radius: 12px; font-weight: 650; font-size: 14px; background: var(--surface-3);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: toast .25s cubic-bezier(.2, 1.3, .4, 1); }
.toast.error { background: #3a1820; border-color: rgba(255, 93, 108, .5); color: #ffc9ce; }
.toast.ok { background: #0f3327; border-color: rgba(69, 230, 168, .45); color: #b8ffe6; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: .25s; }
@keyframes toast { from { opacity: 0; transform: translateY(-12px) scale(.96); } }

/* ------------------------------------------------------------------ playing cards */
.pcard {
  --cw: 44px;
  position: relative; width: var(--cw); height: calc(var(--cw) * 1.4); flex: none; border-radius: calc(var(--cw) * .11);
  background: linear-gradient(160deg, #ffffff, #e9edf3); color: #161b26;
  box-shadow: 0 calc(var(--cw) * .04) calc(var(--cw) * .14) rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(0, 0, 0, .08);
  font-weight: 800; line-height: 1; user-select: none; overflow: hidden;
}
.pcard .rk { position: absolute; top: 7%; left: 9%; font-size: calc(var(--cw) * .46); letter-spacing: -.06em; }
.pcard .st { position: absolute; top: 44%; left: 9%; width: calc(var(--cw) * .28); height: calc(var(--cw) * .28); fill: currentColor; }
.pcard .bg { position: absolute; right: 5%; bottom: 5%; width: calc(var(--cw) * .58); height: calc(var(--cw) * .58);
  fill: currentColor; opacity: .92; }
.pcard.h, .pcard.d { color: #e0213f; }
.four-color .pcard.d { color: #1f6feb; }
.four-color .pcard.c { color: #12924a; }
.pcard.back {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5h18L12 21zM8.37 7.2h9.9L13.32 16z' fill='%23fff' fill-rule='evenodd'/%3E%3C/svg%3E") center 54% / 40% no-repeat,
    radial-gradient(circle at 50% 50%, #14174a 0 31%, rgba(255, 255, 255, .5) 32% 34%, transparent 35%),
    repeating-linear-gradient(60deg, rgba(255, 255, 255, .1) 0 1px, transparent 1px calc(var(--cw) * .13)),
    repeating-linear-gradient(-60deg, rgba(255, 255, 255, .1) 0 1px, transparent 1px calc(var(--cw) * .13)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .1) 0 1px, transparent 1px calc(var(--cw) * .13)),
    linear-gradient(155deg, #5a5ce0, #262a8c 45%, #12637f);
  box-shadow: 0 calc(var(--cw) * .04) calc(var(--cw) * .14) rgba(0, 0, 0, .45), inset 0 0 0 calc(var(--cw) * .05) rgba(255, 255, 255, .85),
    inset 0 0 0 calc(var(--cw) * .07) rgba(0, 0, 0, .2);
}
.pcard.slot { background: rgba(0, 0, 0, .16); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .09); }
.pcard.dim { filter: brightness(.55) saturate(.6); }
.pcard.hl { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(246, 196, 83, .7); transform: translateY(-8%); }
.mini-cards { display: inline-flex; gap: 3px; vertical-align: middle; }
.mini-cards .pcard { --cw: 26px; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.mini-cards .pcard .bg { display: none; }
.mini-cards .pcard .rk { font-size: 14px; top: 9%; left: 0; right: 0; text-align: center; }
.mini-cards .pcard .st { top: 50%; left: 50%; width: 12px; height: 12px; margin-left: -6px; }
