:root {
  --bg: #0d1110;
  --bg-2: #131917;
  --panel: #1a1a19;
  --panel-2: #222321;
  --line: #2e302d;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --muted: #8b8a82;
  --gold: #e0b252;
  --gold-2: #b8892e;
  --green: #2fbf71;
  --red: #e66767;
  --blue: #3987e5;
  --felt-1: #1f6b45;
  --felt-2: #0f4129;
  --rail: #3a2417;
  --radius: 10px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; }
body { min-height: 100vh; background: radial-gradient(1200px 600px at 50% -200px, #1b2a23 0%, var(--bg) 60%) fixed; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
.num, td.n, .mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0 0 12px; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; color: var(--text-2); }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 18px; padding: 10px 22px; background: rgba(13,17,16,.85);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--text); letter-spacing: .02em; }
.brand .chip { width: 26px; height: 26px; border-radius: 50%; background: repeating-conic-gradient(var(--gold) 0 30deg, #7a1d1d 30deg 60deg);
  box-shadow: inset 0 0 0 5px #7a1d1d, inset 0 0 0 7px var(--gold); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--text-2); padding: 7px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--panel-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--panel-2); color: var(--gold); }
.spacer { flex: 1; }
.bankroll { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; font-weight: 600; }
.bankroll .coin { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe7a3, var(--gold-2)); }

/* ---------- buttons & inputs ---------- */
.btn { appearance: none; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: 8px 14px;
  border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, transform .05s; }
.btn:hover { background: #2b2c2a; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.gold { background: linear-gradient(180deg, #f0c766, var(--gold-2)); color: #1a1205; border-color: #c99a3c; }
.btn.gold:hover { filter: brightness(1.07); }
.btn.green { background: #1d7a4b; border-color: #26915a; }
.btn.red { background: #8f2f2f; border-color: #a53b3b; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.ghost { background: transparent; }
input, select { background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; }
input:focus, select:focus { outline: 2px solid var(--gold-2); outline-offset: 0; }
label { color: var(--text-2); font-size: 13px; }

/* ---------- layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 24px 22px 60px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; gap: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .k { color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.tile .v { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { background: none; border: none; color: var(--text-2); padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--gold); border-bottom-color: var(--gold); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- tables ---------- */
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
table.list th.sortable { cursor: pointer; }
table.list th.sortable:hover { color: var(--text); }
table.list th.sorted { color: var(--gold); }
table.list td { padding: 10px; border-bottom: 1px solid #242523; vertical-align: middle; }
table.list tr:hover td { background: #1f201e; }
table.list td.n, table.list th.n { text-align: right; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--panel-2);
  color: var(--text-2); border: 1px solid var(--line); vertical-align: middle; }
.badge.bot { color: #9fc2ef; border-color: #2c4a72; background: #172333; }
.badge.human { color: #e7cf95; border-color: #6b5528; background: #2a2213; }
.badge.live { color: #8fe0b2; border-color: #22603f; background: #10291c; }
.badge.done { color: var(--muted); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 6px; box-shadow: 0 0 8px var(--green); }

/* ---------- modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; width: min(420px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal h2 { margin-bottom: 14px; }
.modal .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal .err { color: var(--red); min-height: 18px; font-size: 13px; }
.modal pre { white-space: pre-wrap; background: var(--bg-2); padding: 12px; border-radius: 8px; max-height: 60vh; overflow: auto; font-size: 12.5px; line-height: 1.5; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--gold); padding: 10px 14px; border-radius: 8px;
  max-width: 340px; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: slidein .2s ease-out; }
.toast.error { border-left-color: var(--red); }
.toast.good { border-left-color: var(--green); }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } }

/* ---------- cards ---------- */
.card { --w: 46px; width: var(--w); height: calc(var(--w) * 1.4); border-radius: calc(var(--w) * .12); background: linear-gradient(180deg, #fff, #ecebe6);
  color: #161616; display: inline-block; font-weight: 800; box-shadow: 0 2px 6px rgba(0,0,0,.45); position: relative; line-height: 1; flex-shrink: 0;
  transition: transform .2s, opacity .2s; overflow: hidden; }
.card .r { position: absolute; left: 9%; top: 6%; font-size: calc(var(--w) * .40); letter-spacing: -0.04em; }
.card .s { position: absolute; left: 10%; top: 36%; font-size: calc(var(--w) * .30); }
.card .b { position: absolute; right: 7%; bottom: 3%; font-size: calc(var(--w) * .58); opacity: .92; }
.card.red { color: #c42727; }
.card.back { background: repeating-linear-gradient(45deg, #7a1d1d 0 4px, #8f2626 4px 8px); border: 3px solid #f3efe6; }
.card.dim { opacity: .35; }
.card.hl { transform: translateY(-6px); box-shadow: 0 0 0 2px var(--gold), 0 6px 14px rgba(0,0,0,.5); }
.card.deal { animation: deal .25s ease-out; }
@keyframes deal { from { transform: translateY(-14px) scale(.9); opacity: 0; } }

/* ---------- forms in pages ---------- */
.searchbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: var(--bg-2); border: none; color: var(--text-2); padding: 7px 12px; font: inherit; font-weight: 600; cursor: pointer; }
.seg button.active { background: var(--panel-2); color: var(--gold); }
.empty { color: var(--muted); padding: 24px; text-align: center; }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .wrap { padding: 16px 12px 40px; }
  .hide-sm { display: none; }
}
