/* Spin 2 Win admin console - dark navy + gold. No build step. */
:root {
  --bg: #060a14;
  --bg-2: #0a1020;
  --panel: #0e1629;
  --panel-2: #121c33;
  --panel-3: #18243f;
  --line: rgba(148, 170, 220, 0.12);
  --line-2: rgba(148, 170, 220, 0.2);
  --text: #e8edf7;
  --text-2: #aab6cf;
  --muted: #7d8aa6;
  --gold: #e3b54f;
  --gold-2: #f6d98a;
  --gold-3: #b9862a;
  --gold-soft: rgba(227, 181, 79, 0.12);
  --green: #2fd18b;
  --green-soft: rgba(47, 209, 139, 0.13);
  --red: #ff5d6c;
  --red-soft: rgba(255, 93, 108, 0.13);
  --amber: #ffb547;
  --amber-soft: rgba(255, 181, 71, 0.14);
  --blue: #5aa2ff;
  --blue-soft: rgba(90, 162, 255, 0.13);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.75), 0 2px 0 rgba(255, 255, 255, 0.02) inset;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Cinzel', Georgia, serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --side-w: 256px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(227, 181, 79, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(90, 120, 255, 0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
code, .mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.gold { color: var(--gold-2); }
::selection { background: rgba(227, 181, 79, 0.35); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ------------------------------------------------------------------ boot */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); border-top-color: var(--gold); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
.spinner.lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ brand */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%; flex: none; position: relative;
  background: conic-gradient(from 0deg, #e3b54f 0 36deg, #1b2a4d 36deg 72deg, #e3b54f 72deg 108deg, #1b2a4d 108deg 144deg, #e3b54f 144deg 180deg, #1b2a4d 180deg 216deg, #e3b54f 216deg 252deg, #1b2a4d 252deg 288deg, #e3b54f 288deg 324deg, #1b2a4d 324deg 360deg);
  box-shadow: 0 0 0 2px var(--gold-3), 0 6px 22px -6px rgba(227, 181, 79, .6);
}
.brand-mark::after { content: ''; position: absolute; inset: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3c9, var(--gold) 60%, var(--gold-3)); box-shadow: 0 0 0 2px #0a1020; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-family: var(--display); font-size: 18px; letter-spacing: .06em; color: var(--gold-2); background: linear-gradient(180deg, #fff1c2, #e3b54f 60%, #b9862a); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand-text small { color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; margin-top: 3px; }
.brand-lg .brand-mark { width: 48px; height: 48px; }
.brand-lg .brand-mark::after { inset: 14px; }
.brand-lg .brand-text b { font-size: 22px; }

/* ------------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.login-glow { position: absolute; width: 720px; height: 720px; border-radius: 50%; background: radial-gradient(circle, rgba(227,181,79,.16), transparent 62%); top: 50%; left: 50%; transform: translate(-50%, -58%); pointer-events: none; }
.login-card {
  position: relative; width: 100%; max-width: 400px; padding: 32px 28px 24px;
  background: linear-gradient(180deg, rgba(20, 30, 54, .92), rgba(12, 18, 34, .96));
  border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--shadow), 0 0 0 1px rgba(227,181,79,.08);
  display: flex; flex-direction: column; gap: 14px; animation: rise .5s var(--ease);
}
.login-card::before { content: ''; position: absolute; left: 24px; right: 24px; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); border-radius: 2px; }
.login-title { font-size: 22px; margin-top: 10px; }
.login-foot { text-align: center; margin-top: 2px; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .02em; }
.field-help { font-size: 12px; color: var(--muted); }
.field-err { font-size: 12px; color: var(--red); font-weight: 500; }
input[type=text], input[type=password], input[type=number], input[type=search], textarea, select {
  width: 100%; min-width: 0; font: inherit; color: var(--text);
  background: #0a1122; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 10px 12px; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { resize: vertical; min-height: 72px; }
input::placeholder, textarea::placeholder { color: #56627d; }
input:hover, textarea:hover, select:hover { border-color: rgba(148, 170, 220, .32); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 181, 79, .16); background: #0c142a; }
.has-error input, .has-error textarea, input.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 93, 108, .12); }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-group { display: flex; align-items: stretch; gap: 0; position: relative; }
.input-group > input { flex: 1; }
.input-group > input:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .btn-icon, .input-group > .addon, .input-group > .btn {
  border: 1px solid var(--line-2); border-left: 0; background: #0d1528; border-radius: 0; height: auto; width: auto; padding: 0 12px;
}
.input-group > :last-child { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
.addon { display: inline-flex; align-items: center; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.form-error { color: var(--red); background: var(--red-soft); border: 1px solid rgba(255,93,108,.25); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 13.5px; color: var(--text); white-space: nowrap;
  padding: 9px 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel-2);
  cursor: pointer; transition: transform .12s var(--ease), background .15s, border-color .15s, box-shadow .15s, opacity .15s;
  text-decoration: none; user-select: none;
}
.btn:hover { background: var(--panel-3); border-color: rgba(148,170,220,.32); text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled, .btn.is-busy { opacity: .55; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }
.btn-gold { color: #1a1204; border-color: transparent; background: linear-gradient(180deg, #f8dc8f, #e3b54f 55%, #c9952f); box-shadow: 0 8px 22px -10px rgba(227, 181, 79, .8), inset 0 1px 0 rgba(255,255,255,.5); }
.btn-gold:hover { background: linear-gradient(180deg, #ffe7a6, #ecc15e 55%, #d4a038); border-color: transparent; }
.btn-green { color: #03170e; border-color: transparent; background: linear-gradient(180deg, #5ef0ae, #2fd18b); }
.btn-green:hover { background: linear-gradient(180deg, #74f6bb, #3adf97); border-color: transparent; }
.btn-danger { color: #fff; border-color: transparent; background: linear-gradient(180deg, #ff7683, #e8414f); }
.btn-danger:hover { background: linear-gradient(180deg, #ff8a95, #f04e5c); border-color: transparent; }
.btn-soft-danger { color: #ff9aa4; background: var(--red-soft); border-color: rgba(255,93,108,.28); }
.btn-soft-danger:hover { background: rgba(255,93,108,.2); border-color: rgba(255,93,108,.4); }
.btn-soft-green { color: #7ef0bd; background: var(--green-soft); border-color: rgba(47,209,139,.28); }
.btn-soft-green:hover { background: rgba(47,209,139,.2); }
.btn-soft-amber { color: #ffd08a; background: var(--amber-soft); border-color: rgba(255,181,71,.3); }
.btn-soft-amber:hover { background: rgba(255,181,71,.22); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,.04); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { padding: 12px 18px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: transparent; border: 1px solid transparent; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; }
.btn-icon:hover { background: rgba(255,255,255,.06); color: var(--text); }
.btn-icon svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--side-w); flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 22px; padding: 22px 16px 16px;
  background: linear-gradient(180deg, rgba(12, 19, 37, .96), rgba(8, 13, 26, .98));
  border-right: 1px solid var(--line); z-index: 40;
}
.sidebar > .brand { padding: 0 6px; }
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px;
  color: var(--text-2); font-weight: 500; transition: background .15s, color .15s; position: relative; text-decoration: none;
}
.nav a svg { opacity: .8; }
.nav a:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav a.active { color: var(--gold-2); background: linear-gradient(90deg, rgba(227,181,79,.16), rgba(227,181,79,.03)); }
.nav a.active::before { content: ''; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.nav a.active svg { opacity: 1; }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 6px 0; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me > span:last-child { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.me b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me small { color: var(--muted); font-size: 11px; }
.scrim { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 16px 28px; background: rgba(6, 10, 20, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; }
.live-dot { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.02); white-space: nowrap; }
.live-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(47,209,139,.6); animation: pulse 2s infinite; }
.view { padding: 24px 28px 48px; outline: none; animation: fade .25s var(--ease); max-width: 1480px; width: 100%; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ cards */
.card { background: linear-gradient(180deg, rgba(18, 28, 51, .82), rgba(12, 19, 36, .88)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { font-size: 15px; }
.card-head .sub { color: var(--muted); font-size: 12.5px; font-weight: 400; margin-left: 8px; }
.card-body { padding: 18px 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 18px 20px; position: relative; overflow: hidden; }
.stat::after { content: ''; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, var(--tint, rgba(227,181,79,.12)), transparent 70%); pointer-events: none; }
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.stat-label .ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--ico-bg, var(--gold-soft)); color: var(--ico, var(--gold-2)); }
.stat-label .ico svg { width: 16px; height: 16px; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-top: 12px; font-variant-numeric: tabular-nums; line-height: 1.1; overflow-wrap: anywhere; }
.stat-value small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat-foot { margin-top: 8px; font-size: 12.5px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.stat.t-green { --tint: rgba(47,209,139,.14); --ico-bg: var(--green-soft); --ico: var(--green); }
.stat.t-blue { --tint: rgba(90,162,255,.14); --ico-bg: var(--blue-soft); --ico: var(--blue); }
.stat.t-red { --tint: rgba(255,93,108,.12); --ico-bg: var(--red-soft); --ico: var(--red); }
.stat.t-amber { --tint: rgba(255,181,71,.13); --ico-bg: var(--amber-soft); --ico: var(--amber); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv dd.left { text-align: left; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: rgba(255,255,255,.015); }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255,255,255,.025); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td:first-child { box-shadow: inset 2px 0 0 var(--gold); }
th.right, td.right { text-align: right; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty svg { width: 38px; height: 38px; opacity: .35; }
.loading { padding: 40px; display: grid; place-items: center; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }

.player-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player-cell > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.player-cell b { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-cell small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13px; color: #1a1204; background: linear-gradient(135deg, #f6d98a, #c9952f); text-transform: uppercase; }
.avatar.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
.avatar.xl { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; box-shadow: 0 10px 30px -12px rgba(227,181,79,.7); }
.avatar.off { background: linear-gradient(135deg, #3a4663, #242f49); color: var(--text-2); }
.balance { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold-2); white-space: nowrap; }

/* ------------------------------------------------------------------ pills */
.pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.online { color: var(--green); background: var(--green-soft); border-color: rgba(47,209,139,.25); }
.pill.online::before { animation: pulse 1.8s infinite; }
.pill.offline { color: #93a0bb; background: rgba(147,160,187,.1); border-color: rgba(147,160,187,.18); }
.pill.idle { color: var(--blue); background: var(--blue-soft); border-color: rgba(90,162,255,.25); }
.pill.blocked { color: var(--red); background: var(--red-soft); border-color: rgba(255,93,108,.28); }
.pill.locked { color: var(--amber); background: var(--amber-soft); border-color: rgba(255,181,71,.28); }
.pill.gold { color: var(--gold-2); background: var(--gold-soft); border-color: rgba(227,181,79,.25); }
.pill.plain::before { display: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47,209,139,.55); } 70% { box-shadow: 0 0 0 7px rgba(47,209,139,0); } 100% { box-shadow: 0 0 0 0 rgba(47,209,139,0); } }

.platform { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); white-space: nowrap; }
.platform svg { width: 16px; height: 16px; }
.platform.windows svg { color: #4cc2ff; }
.platform.android svg { color: #3ddc84; }

.digit { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 800; font-size: 14px; color: #1a1204; background: radial-gradient(circle at 35% 30%, #fff2c6, var(--gold) 60%, var(--gold-3)); box-shadow: 0 4px 12px -4px rgba(227,181,79,.7); font-variant-numeric: tabular-nums; }
.digit.pending { background: rgba(255,255,255,.06); color: var(--muted); box-shadow: none; border: 1px dashed var(--line-2); }
.digit.sm { width: 24px; height: 24px; font-size: 12px; }
.status-tag { font-size: 11.5px; font-weight: 600; text-transform: capitalize; padding: 2px 9px; border-radius: 7px; background: rgba(255,255,255,.05); color: var(--text-2); white-space: nowrap; }
.status-tag.open { color: var(--green); background: var(--green-soft); }
.status-tag.closed { color: var(--amber); background: var(--amber-soft); }
.status-tag.settled { color: var(--text-2); }
.status-tag.pending { color: var(--blue); background: var(--blue-soft); }
.status-tag.cancelled { color: var(--red); background: var(--red-soft); }

.lines { display: flex; flex-wrap: wrap; gap: 5px; }
.line { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 8px 2px 3px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.line b { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--panel-3); }
.line.won { border-color: rgba(47,209,139,.4); background: var(--green-soft); }
.line.won b { background: var(--green); color: #03170e; }

/* ------------------------------------------------------------------ toolbar */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1 1 240px; min-width: 0; max-width: 420px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 38px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: #0a1122; border: 1px solid var(--line); gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: transparent; border: 0; padding: 6px 12px; border-radius: 9px; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--panel-3); color: var(--gold-2); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 4px 10px -6px rgba(0,0,0,.6); }
.tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { font: inherit; font-weight: 600; font-size: 13px; color: var(--muted); background: none; border: 0; padding: 14px 12px 12px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; transition: color .15s, border-color .15s; display: inline-flex; gap: 7px; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--gold-2); border-bottom-color: var(--gold); }
.tabs .count { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--text-2); }

/* ------------------------------------------------------------------ player page */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; margin-bottom: 14px; }
.back svg { width: 16px; height: 16px; }
.hero { padding: 22px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(600px 200px at 100% 0%, rgba(227,181,79,.1), transparent 70%); pointer-events: none; }
.hero-id { display: flex; gap: 16px; align-items: center; min-width: 0; }
.hero-id > div { min-width: 0; }
.hero-id h2 { font-size: 22px; overflow-wrap: anywhere; }
.hero-id .sub { color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.hero-id .pills { margin-top: 10px; }
.hero-bal { text-align: right; position: relative; }
.hero-bal .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.hero-bal .val { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; color: var(--gold-2); font-variant-numeric: tabular-nums; line-height: 1.15; }
.hero-bal .val small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); position: relative; }
.info-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); position: relative; }
.info-grid > div { padding: 14px 22px; border-right: 1px solid var(--line); min-width: 0; }
.info-grid > div:nth-child(4n) { border-right: 0; }
.info-grid > div:nth-child(n+5) { border-top: 1px solid var(--line); }
.info-grid dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.info-grid dd { margin: 4px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.note-box { padding: 12px 22px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 13px; position: relative; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-box b { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; margin-right: 8px; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 12px; font-size: 12.5px; color: var(--text-2); background: rgba(90,162,255,.07); border: 1px solid rgba(90,162,255,.18); }
.callout svg { width: 17px; height: 17px; color: var(--blue); margin-top: 1px; }
.callout.warn { background: rgba(255,181,71,.07); border-color: rgba(255,181,71,.2); }
.callout.warn svg { color: var(--amber); }
.callouts { display: flex; flex-direction: column; gap: 8px; padding: 0 22px 18px; position: relative; }

/* ------------------------------------------------------------------ settings */
.settings-group + .settings-group { margin-top: 20px; }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.set-field { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; min-width: 0; transition: background .2s; }
.set-grid .set-field:nth-child(odd) { border-right: 1px solid var(--line); }
.set-field.wide { grid-column: 1 / -1; border-right: 0 !important; }
.set-field.changed { background: rgba(227,181,79,.045); }
.set-field.has-error { background: rgba(255,93,108,.05); }
.set-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.set-head label { font-weight: 600; font-size: 13.5px; }
.set-head .def { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.set-head .def button { font: inherit; color: var(--gold-2); background: none; border: 0; padding: 0; cursor: pointer; }
.set-head .def button:hover { text-decoration: underline; }
.set-field .input-group { max-width: 280px; }
.savebar { position: sticky; bottom: 16px; z-index: 20; margin-top: 20px; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 20px; border-radius: 14px; background: rgba(18, 28, 51, .95); border: 1px solid rgba(227,181,79,.3); box-shadow: 0 20px 50px -10px rgba(0,0,0,.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); flex-wrap: wrap; animation: rise .25s var(--ease); }
.savebar .msg { flex: 1; min-width: 160px; font-size: 13px; color: var(--text-2); }

.toggle { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { width: 46px; height: 26px; border-radius: 999px; background: #2a3550; border: 1px solid var(--line-2); position: relative; transition: background .2s, border-color .2s; flex: none; }
.toggle .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #cfd7ea; transition: transform .22s var(--ease), background .2s; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.toggle input:checked + .track { background: linear-gradient(180deg, #45e39d, #22b675); border-color: transparent; }
.toggle input:checked + .track::after { transform: translateX(20px); background: #fff; }
.toggle input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }
.toggle .state { font-weight: 600; font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 5px 5px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--gold-2); background: linear-gradient(180deg, rgba(227,181,79,.18), rgba(227,181,79,.08)); border: 1px solid rgba(227,181,79,.35); animation: pop .2s var(--ease); }
.chip button { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.25); border: 0; color: var(--gold-2); cursor: pointer; padding: 0; }
.chip button:hover { background: rgba(255,93,108,.3); color: #fff; }
.chip button svg { width: 12px; height: 12px; }
.chip-add { display: inline-flex; gap: 6px; }
.chip-add input { width: 110px; padding: 6px 10px; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ modal */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(3, 6, 14, .66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .18s ease; overflow-y: auto; }
.overlay.closing { animation: fadeOut .16s ease forwards; }
.modal { width: 100%; max-width: 480px; background: linear-gradient(180deg, #131d35, #0d1528); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.9), 0 0 0 1px rgba(227,181,79,.06); animation: modalIn .24s var(--ease); display: flex; flex-direction: column; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
.modal.sm { max-width: 420px; }
.overlay.closing .modal { animation: modalOut .16s ease forwards; }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px 6px; }
.modal-head .m-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--gold-soft); color: var(--gold-2); }
.modal-head .m-ico.danger { background: var(--red-soft); color: var(--red); }
.modal-head .m-ico.green { background: var(--green-soft); color: var(--green); }
.modal-head .m-ico.amber { background: var(--amber-soft); color: var(--amber); }
.modal-head h3 { font-size: 17px; }
.modal-head p { color: var(--text-2); font-size: 13px; margin-top: 3px; }
.modal-head > div { flex: 1; min-width: 0; }
.modal-body { padding: 16px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; flex-wrap: wrap; }
.modal-foot .btn { min-width: 100px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { font: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 8px; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); color: var(--text-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.quick button:hover { color: var(--gold-2); border-color: rgba(227,181,79,.4); }
.preview { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
.preview b { font-size: 15px; font-variant-numeric: tabular-nums; }
.cred { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: #0a1122; border: 1px dashed rgba(227,181,79,.4); }
.cred dt { color: var(--muted); font-size: 12px; }
.cred dd { margin: 0; font-family: ui-monospace, Consolas, monospace; font-size: 17px; font-weight: 700; color: var(--gold-2); letter-spacing: .04em; overflow-wrap: anywhere; min-width: 0; }

/* ------------------------------------------------------------------ toasts */
.toasts { position: fixed; right: 20px; top: 84px; z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; max-width: calc(100vw - 32px); }
.toast { pointer-events: none; display: flex; align-items: flex-start; gap: 10px; min-width: 260px; max-width: 400px; padding: 12px 14px; border-radius: 13px; background: #16213b; border: 1px solid var(--line-2); box-shadow: 0 16px 40px -12px rgba(0,0,0,.8); font-size: 13px; animation: toastIn .28s var(--ease); }
.toast.out { animation: toastOut .22s ease forwards; }
.toast svg { width: 18px; height: 18px; margin-top: 1px; }
.toast.ok { border-color: rgba(47,209,139,.35); }
.toast.ok svg { color: var(--green); }
.toast.err { border-color: rgba(255,93,108,.4); }
.toast.err svg { color: var(--red); }
.toast span { flex: 1; overflow-wrap: anywhere; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-grid > div:nth-child(4n) { border-right: 1px solid var(--line); }
  .info-grid > div:nth-child(2n) { border-right: 0; }
  .info-grid > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-102%); transition: transform .28s var(--ease); box-shadow: 20px 0 60px rgba(0,0,0,.6); }
  .shell.menu-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(3,6,14,.6); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .shell.menu-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-grid; margin-left: -8px; }
  .topbar { padding: 12px 16px; }
  .view { padding: 16px 16px 40px; }
  .set-grid { grid-template-columns: minmax(0, 1fr); }
  .set-grid .set-field:nth-child(odd) { border-right: 0; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .topbar-title h1 { font-size: 17px; }
  .live-dot { padding: 5px 9px; font-size: 11.5px; }
  .stats { gap: 12px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 21px; }
  .stat-label { font-size: 11.5px; }
  .stat-label .ico { width: 24px; height: 24px; }
  .card-head { padding: 14px 16px; }
  .card-body { padding: 14px 16px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 18px 16px; gap: 14px; }
  .hero-bal { text-align: left; padding: 12px 14px; border-radius: 12px; background: rgba(227,181,79,.06); border: 1px solid rgba(227,181,79,.18); }
  .hero-bal .val { font-size: 28px; }
  .avatar.xl { width: 52px; height: 52px; font-size: 18px; border-radius: 15px; }
  .hero-id h2 { font-size: 19px; }
  .actions { padding: 12px 16px; }
  .actions .btn { flex: 1 1 calc(50% - 8px); }
  .info-grid > div { padding: 12px 16px; }
  .callouts { padding: 0 16px 16px; }
  .note-box { padding: 12px 16px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .set-field { padding: 16px; }
  .toolbar { padding: 12px; }
  .search { max-width: none; flex-basis: 100%; }
  .toolbar .btn-gold { flex: 1; }
  .toasts { left: 16px; right: 16px; top: 68px; align-items: stretch; }
  .toast { min-width: 0; max-width: none; }
  .modal-head { padding: 18px 18px 4px; }
  .modal-body { padding: 14px 18px; }
  .modal-foot { padding: 12px 18px 18px; }
  .modal-foot .btn { flex: 1; }
  .savebar { bottom: 10px; padding: 12px; }
  .savebar .btn { flex: 1; }

  /* Tables become stacked cards */
  table.rt thead { display: none; }
  table.rt, table.rt tbody, table.rt tr, table.rt td { display: block; width: 100%; }
  table.rt tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.rt tbody tr:last-child { border-bottom: 0; }
  table.rt td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; min-width: 0; }
  table.rt td::before { content: attr(data-label); color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; text-align: left; flex: none; }
  table.rt td.main-cell { padding-bottom: 8px; text-align: left; justify-content: flex-start; }
  table.rt td.main-cell::before { display: none; }
  table.rt td.hide-sm { display: none; }
  table.rt td > * { min-width: 0; }
  table.rt td .lines { justify-content: flex-end; }
  table.rt td.wrap { overflow-wrap: anywhere; }
  tr.clickable:hover td:first-child { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------------ misc */
.sr-copy { position: fixed; left: -9999px; top: 0; opacity: 0; }
a.stat-link { color: inherit; text-decoration: none; transition: transform .18s var(--ease), border-color .18s; }
a.stat-link:hover { transform: translateY(-2px); border-color: rgba(90,162,255,.35); text-decoration: none; }
.stat-value.small-value { font-size: 18px; margin-top: 16px; }
.mono-input { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace !important; letter-spacing: .04em; }
.confirm-msg { color: var(--text-2); font-size: 14px; line-height: 1.6; }
.confirm-msg b { color: var(--text); }
.account-card { max-width: 560px; }
.settings-summary .stats > div { min-width: 0; }
@media (max-width: 640px) {
  .input-group > .btn span { display: none; }
  .stat-value.small-value { font-size: 15px; }
}
@media (min-width: 901px) {
  /* Keep the sidebar column painted on long pages (and in full-page captures). */
  .shell { background: linear-gradient(90deg, #0a0f1f var(--side-w), transparent var(--side-w)); }
}
