/* PlayNXC — Node edition. One stylesheet for members, guests and admin.
   Arcade identity (round #755): near-black grid ground, PlayNXC orange glow,
   electric cyan accent, Chakra Petch display, Space Grotesk body, JetBrains Mono numbers.
   Mobile-first: everything is designed at 360px and grows. Bootstrap 5.3 (dark) underneath. */

:root {
  --bg: #07080f;
  --bg-2: #0b0d18;
  --surface: #0f1122;
  --surface-2: #161a31;
  --surface-3: #1d2140;
  --line: #262a45;
  --line-2: #323758;
  --text: #f2f3fa;
  --muted: #9aa0bd;
  --dim: #6b7090;
  --primary: #ff8c42;
  --primary-2: #ff7a26;
  --primary-soft: rgba(255, 140, 66, 0.14);
  --on-primary: #160a04;
  --accent: #3de6ff;
  --accent-soft: rgba(61, 230, 255, 0.12);
  --ok: #3dd9a0;
  --ok-soft: rgba(61, 217, 160, 0.13);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.13);
  --bad: #ff5c6c;
  --bad-soft: rgba(255, 92, 108, 0.13);
  --info: #5ea8ff;
  --gem: #c084fc;
  --coin: #fbbf24;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --glow: 0 0 0 1px rgba(255, 140, 66, 0.55), 0 8px 26px rgba(255, 140, 66, 0.32);
  --f-display: 'Chakra Petch', 'Space Grotesk', system-ui, sans-serif;
  --f-body: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Old PHP-theme names, so styles ported from the PHP pages work unchanged. */
  --border: var(--line);
  --text-muted: var(--muted);
  --secondary: var(--ok);
  --secondary-dark: #22b884;
  --primary-light: var(--primary-soft);
  --primary-dark: var(--primary-2);
  --danger: var(--bad);
  --ax-display: var(--f-display);
  --ax-body: var(--f-body);
  --radius-sm: var(--r-sm);
  --radius-md: var(--r);
  --radius-lg: var(--r-lg);
  --radius-pill: 999px;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.45);
  --shadow-md: var(--shadow);
  --side-w: 236px;
  --top-h: 60px;
  --tab-h: 64px;

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-body-color-rgb: 242, 243, 250;
  --bs-emphasis-color: var(--text);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-color: var(--dim);
  --bs-border-color: var(--line);
  --bs-border-color-translucent: var(--line);
  --bs-secondary-bg: var(--surface-2);
  --bs-tertiary-bg: var(--surface-2);
  --bs-link-color: var(--primary);
  --bs-link-color-rgb: 255, 140, 66;
  --bs-link-hover-color: #ffb27a;
  --bs-link-hover-color-rgb: 255, 178, 122;
  --bs-heading-color: var(--text);
  --bs-font-sans-serif: var(--f-body);
  --bs-body-font-size: 0.95rem;
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────────── */
html, body { overflow-x: clip; }
body {
  font-family: var(--f-body);
  min-height: 100vh;
  background:
    radial-gradient(ellipse 900px 600px at 6% -12%, rgba(255, 140, 66, 0.10), transparent 60%),
    radial-gradient(ellipse 800px 560px at 102% -4%, rgba(61, 230, 255, 0.07), transparent 55%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--bg);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, h5, h6, .display { font-family: var(--f-display); font-weight: 700; letter-spacing: 0.01em; }
.mono, code, kbd { font-family: var(--f-mono); }
a { text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; }
::selection { background: var(--primary); color: var(--on-primary); }
.text-muted, .muted { color: var(--muted) !important; }
.text-dim { color: var(--dim) !important; }
.text-gem { color: var(--gem) !important; }
.text-coin { color: var(--coin) !important; }
.text-ok { color: var(--ok) !important; }
.text-bad { color: var(--bad) !important; }
.text-warn { color: var(--warn) !important; }
.text-accent { color: var(--accent) !important; }
.text-primary { color: var(--primary) !important; }
.small-caps { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); font-weight: 600; }
.nowrap { white-space: nowrap; }
.min-w-0 { min-width: 0; }
.ico { width: 1.1em; height: 1.1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.16em; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn { --bs-btn-font-weight: 600; border-radius: 12px; font-family: var(--f-body); letter-spacing: 0.01em; transition: transform .12s ease, box-shadow .2s ease, background .2s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  --bs-btn-color: var(--on-primary); --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary);
  --bs-btn-hover-color: var(--on-primary); --bs-btn-hover-bg: #ff9d5c; --bs-btn-hover-border-color: #ff9d5c;
  --bs-btn-active-color: var(--on-primary); --bs-btn-active-bg: var(--primary-2); --bs-btn-active-border-color: var(--primary-2);
  --bs-btn-disabled-color: var(--on-primary); --bs-btn-disabled-bg: #7a4a2c; --bs-btn-disabled-border-color: #7a4a2c;
  box-shadow: 0 6px 20px rgba(255, 140, 66, 0.25);
}
.btn-primary:hover { box-shadow: var(--glow); }
.btn-accent {
  --bs-btn-color: #04151a; --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: #04151a; --bs-btn-hover-bg: #7aefff; --bs-btn-hover-border-color: #7aefff;
  --bs-btn-active-bg: #23d4f0; --bs-btn-active-color: #04151a;
}
.btn-success {
  --bs-btn-color: #03140d; --bs-btn-bg: var(--ok); --bs-btn-border-color: var(--ok);
  --bs-btn-hover-color: #03140d; --bs-btn-hover-bg: #67e6b8; --bs-btn-hover-border-color: #67e6b8;
  --bs-btn-active-bg: #22b884; --bs-btn-active-color: #03140d;
}
.btn-ghost, .btn-outline-secondary {
  --bs-btn-color: var(--text); --bs-btn-bg: var(--surface-2); --bs-btn-border-color: var(--line-2);
  --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--surface-3); --bs-btn-hover-border-color: var(--line-2);
  --bs-btn-active-bg: var(--surface-3); --bs-btn-active-color: var(--text);
}
.btn-outline-primary {
  --bs-btn-color: var(--primary); --bs-btn-border-color: rgba(255, 140, 66, 0.5);
  --bs-btn-hover-color: var(--on-primary); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary);
  --bs-btn-active-bg: var(--primary-2); --bs-btn-active-color: var(--on-primary);
}
.btn-danger { --bs-btn-bg: var(--bad); --bs-btn-border-color: var(--bad); --bs-btn-hover-bg: #ff7a87; --bs-btn-hover-border-color: #ff7a87; }
.btn-lg { border-radius: 14px; padding: 0.8rem 1.4rem; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; }

/* ── Surfaces ─────────────────────────────────────────────────────────── */
.card, .panel {
  --bs-card-bg: var(--surface);
  --bs-card-border-color: var(--line);
  --bs-card-border-radius: var(--r);
  --bs-card-inner-border-radius: calc(var(--r) - 1px);
  --bs-card-cap-bg: transparent;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 40%), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}
.panel { padding: 1.1rem; }
@media (min-width: 768px) { .panel { padding: 1.35rem; } }
.panel-tight { padding: 0.85rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.panel-title { font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.panel-title .bi { color: var(--primary); }
.panel-sub { color: var(--muted); font-size: 0.85rem; margin: 0.15rem 0 0; }
.panel-glow { border-color: rgba(255, 140, 66, 0.4); box-shadow: 0 0 0 1px rgba(255, 140, 66, 0.12), 0 14px 40px rgba(255, 140, 66, 0.08); }
.panel-accent { border-color: rgba(61, 230, 255, 0.35); }
.inset { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.75rem 0.9rem; }
hr, .divider { border-color: var(--line); opacity: 1; }

/* ── Page header ──────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-head h1 { font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.9rem); margin: 0; display: flex; align-items: center; gap: 0.55rem; }
.page-head h1 .bi { color: var(--primary); font-size: 0.9em; }
.page-head p { color: var(--muted); margin: 0.25rem 0 0; max-width: 60ch; }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── Stat tiles ───────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.85rem; } }
.stats.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 575.98px) { .stats.stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0.85rem 0.95rem; min-width: 0; position: relative; overflow: hidden; }
.stat-label { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; display: flex; align-items: center; gap: 0.35rem; }
.stat-value { font-family: var(--f-mono); font-weight: 700; font-size: clamp(1.05rem, 0.95rem + 0.8vw, 1.45rem); margin-top: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: 0.78rem; color: var(--dim); margin-top: 0.1rem; }
.stat::after { content: ''; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 140, 66, 0.10), transparent 70%); pointer-events: none; }
.stat.is-gem::after { background: radial-gradient(circle, rgba(192, 132, 252, 0.14), transparent 70%); }
.stat.is-ok::after { background: radial-gradient(circle, rgba(61, 217, 160, 0.13), transparent 70%); }
.stat.is-accent::after { background: radial-gradient(circle, rgba(61, 230, 255, 0.12), transparent 70%); }

/* ── Chips / badges / pills ──────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.22rem 0.6rem; border-radius: 999px; font-size: 0.76rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); white-space: nowrap; }
.chip-primary { background: var(--primary-soft); border-color: rgba(255, 140, 66, 0.35); color: #ffb27a; }
.chip-ok { background: var(--ok-soft); border-color: rgba(61, 217, 160, 0.35); color: var(--ok); }
.chip-warn { background: var(--warn-soft); border-color: rgba(251, 191, 36, 0.35); color: var(--warn); }
.chip-bad { background: var(--bad-soft); border-color: rgba(255, 92, 108, 0.35); color: #ff8a96; }
.chip-accent { background: var(--accent-soft); border-color: rgba(61, 230, 255, 0.35); color: var(--accent); }
.chip-gem { background: rgba(192, 132, 252, 0.12); border-color: rgba(192, 132, 252, 0.35); color: var(--gem); }
.badge { font-weight: 600; letter-spacing: 0.02em; }
.gem-amt { font-family: var(--f-mono); font-weight: 700; color: var(--gem); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--ok); box-shadow: 0 0 0 3px rgba(61, 217, 160, 0.2); }

/* ── Tabs (pill strip that scrolls sideways on phones) ───────────────── */
.tabs { display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: none; padding: 0.25rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 1rem; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.85rem; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 0.88rem; border: 0; background: transparent; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--text); background: var(--surface-2); }
.tabs .active, .tabs [aria-current="page"], .tabs [aria-selected="true"] { color: var(--on-primary); background: var(--primary); }
.tabs .count { font-family: var(--f-mono); font-size: 0.72rem; background: rgba(0, 0, 0, 0.25); border-radius: 6px; padding: 0 0.35rem; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-sm); }
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--line); --bs-table-striped-bg: rgba(255, 255, 255, 0.02); --bs-table-hover-bg: rgba(255, 255, 255, 0.035); margin: 0; font-size: 0.9rem; }
.table > :not(caption) > * > * { padding: 0.65rem 0.75rem; vertical-align: middle; }
.table thead th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; border-bottom-color: var(--line-2); white-space: nowrap; }
.table td.num, .table th.num { text-align: right; font-family: var(--f-mono); white-space: nowrap; }
/* Phones: a table marked .table-stack turns each row into a card. */
@media (max-width: 575.98px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 0.6rem; padding: 0.35rem 0.2rem; background: var(--bg-2); }
  .table-stack td { border: 0 !important; display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0.65rem !important; text-align: right; }
  .table-stack td::before { content: attr(data-label); color: var(--muted); font-size: 0.78rem; text-align: left; font-family: var(--f-body); text-transform: none; }
  .table-stack td.num { font-family: var(--f-mono); }
}

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-control, .form-select {
  background-color: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); border-radius: 12px; padding: 0.6rem 0.8rem;
}
.form-control:focus, .form-select:focus { background-color: var(--bg-2); color: var(--text); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.18); }
.form-control::placeholder { color: var(--dim); }
.form-control:disabled, .form-control[readonly] { background-color: var(--surface-2); color: var(--muted); }
.form-label { font-weight: 600; font-size: 0.86rem; color: var(--text); margin-bottom: 0.35rem; }
.form-text { color: var(--dim); }
.form-check-input { background-color: var(--bg-2); border-color: var(--line-2); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-switch .form-check-input:focus { box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.18); }
.input-group-text { background: var(--surface-2); border-color: var(--line-2); color: var(--muted); border-radius: 12px; }
.copy-field { display: flex; gap: 0.4rem; }
.copy-field input { font-family: var(--f-mono); font-size: 0.85rem; }

/* ── Alerts / flash ───────────────────────────────────────────────────── */
.alert { border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); }
.alert-success { background: var(--ok-soft); border-color: rgba(61, 217, 160, 0.35); color: #b6f5dc; }
.alert-danger, .alert-error { background: var(--bad-soft); border-color: rgba(255, 92, 108, 0.35); color: #ffc2c8; }
.alert-warning { background: var(--warn-soft); border-color: rgba(251, 191, 36, 0.35); color: #fde3a1; }
.alert-info { background: var(--accent-soft); border-color: rgba(61, 230, 255, 0.3); color: #bff6ff; }

/* ── Empty state ──────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 2.4rem 1rem; color: var(--muted); }
.empty .bi, .empty .emoji { font-size: 2.6rem; display: block; margin-bottom: 0.6rem; color: var(--dim); }
.empty h3, .empty h5 { color: var(--text); font-size: 1.1rem; }

/* ── Progress ─────────────────────────────────────────────────────────── */
.progress { background: var(--bg-2); border-radius: 999px; height: 8px; border: 1px solid var(--line); }
.progress-bar { background: linear-gradient(90deg, var(--primary), #ffb27a); border-radius: 999px; }
.progress-bar.bg-accent { background: linear-gradient(90deg, #1cc8e6, var(--accent)); }
.progress-bar.bg-ok { background: linear-gradient(90deg, #22b884, var(--ok)); }

/* ── Dropdowns / modals / toasts ─────────────────────────────────────── */
.dropdown-menu { --bs-dropdown-bg: var(--surface-2); --bs-dropdown-border-color: var(--line-2); --bs-dropdown-link-color: var(--text); --bs-dropdown-link-hover-bg: var(--surface-3); --bs-dropdown-link-hover-color: var(--text); --bs-dropdown-link-active-bg: var(--primary); --bs-dropdown-divider-bg: var(--line-2); --bs-dropdown-header-color: var(--muted); border-radius: 14px; padding: 0.4rem; box-shadow: var(--shadow); }
.dropdown-item { border-radius: 9px; padding: 0.5rem 0.75rem; }
.modal-content { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); color: var(--text); }
.modal-header, .modal-footer { border-color: var(--line); }
.btn-close { filter: invert(1) grayscale(1) brightness(1.6); }
.modal-backdrop.show { opacity: 0.7; }
.toast-stack { position: fixed; z-index: 2000; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 0.5rem; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
@media (min-width: 992px) { .toast-stack { bottom: 24px; left: auto; right: 24px; transform: none; } }
.toast-x { pointer-events: auto; background: var(--surface-3); border: 1px solid var(--line-2); border-left: 4px solid var(--accent); color: var(--text); border-radius: 12px; padding: 0.7rem 0.9rem; box-shadow: var(--shadow); font-size: 0.9rem; animation: toastIn .25s ease; }
.toast-x.ok { border-left-color: var(--ok); }
.toast-x.bad { border-left-color: var(--bad); }
.toast-x.warn { border-left-color: var(--warn); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* ═════════════════════════════ APP SHELL ═════════════════════════════ */
.shell { min-height: 100vh; }
.shell-main { min-width: 0; padding-bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 1rem 16px 0; }
@media (min-width: 768px) { .wrap { padding: 1.4rem 24px 0; } }
@media (min-width: 992px) {
  .shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .shell-main { padding-bottom: 32px; }
  .wrap { padding: 1.6rem 32px 0; }
}

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 1030; height: var(--top-h); display: flex; align-items: center; gap: 0.6rem; padding: 0 16px; background: rgba(7, 8, 15, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
@media (min-width: 992px) { .topbar { padding: 0 32px; } }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; color: var(--text); letter-spacing: 0.02em; }
.brand:hover { color: var(--text); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), #ff5f6d); color: var(--on-primary); font-size: 1.1rem; box-shadow: 0 6px 18px rgba(255, 140, 66, 0.35); flex: 0 0 auto; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.brand b { color: var(--primary); }
.topbar-title { font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.bal-pill { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.38rem 0.75rem 0.38rem 0.45rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); font-family: var(--f-mono); font-weight: 700; font-size: 0.9rem; }
.bal-pill:hover, .bal-pill[aria-expanded="true"] { border-color: rgba(192, 132, 252, 0.6); color: var(--text); }
.bal-pill .gem-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(192, 132, 252, 0.16); color: var(--gem); font-size: 0.85rem; }
.bal-menu { min-width: 270px; }
.bal-row { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.65rem 0.1rem; gap: 1rem; }
.bal-row b { font-family: var(--f-mono); }
.bal-sub { font-size: 0.74rem; color: var(--dim); padding: 0 0.65rem 0.4rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line-2); flex: 0 0 auto; overflow: hidden; }
.avatar-btn { padding: 0; border: 0; background: none; border-radius: 50%; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); }
.icon-btn:hover { color: var(--primary); }

/* Sidebar (desktop) */
.side { display: none; }
@media (min-width: 992px) {
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: rgba(11, 13, 24, 0.86); border-right: 1px solid var(--line); padding: 14px 12px; overflow-y: auto; scrollbar-width: thin; }
}
.side .brand { padding: 4px 8px 16px; }
.side-group { margin-top: 0.4rem; }
.side-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); font-weight: 700; padding: 0.75rem 0.75rem 0.35rem; }
.side-link { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.75rem; border-radius: 11px; color: var(--muted); font-weight: 600; font-size: 0.92rem; position: relative; }
.side-link .bi { font-size: 1.08rem; width: 1.2rem; text-align: center; }
.side-link:hover { color: var(--text); background: var(--surface-2); }
.side-link.active { color: var(--text); background: linear-gradient(90deg, rgba(255, 140, 66, 0.2), rgba(255, 140, 66, 0.04)); box-shadow: inset 3px 0 0 var(--primary); }
.side-link.active .bi { color: var(--primary); }
.side-link .nb, .tab-link .nb { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 0.7rem; font-weight: 800; display: inline-grid; place-items: center; font-family: var(--f-mono); }
.side-link .flame { margin-left: auto; color: #ff6b3d; font-size: 0.8rem; }
.side-foot { margin-top: auto; padding-top: 1rem; }
.side-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-top: 0.5rem; }
.side-roles a { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.55rem 0.3rem; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 0.74rem; font-weight: 600; }
.side-roles a:hover { color: var(--text); border-color: var(--line-2); }
.side-roles .bi { font-size: 1rem; color: var(--accent); }

/* Bottom tab bar (phones/tablets) */
.tabbar { position: fixed; z-index: 1035; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(11, 13, 24, 0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
@media (min-width: 992px) { .tabbar { display: none; } }
.tab-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--dim); font-size: 0.68rem; font-weight: 600; position: relative; border: 0; background: none; }
.tab-link .bi { font-size: 1.25rem; line-height: 1; }
.tab-link.active { color: var(--primary); }
.tab-link.active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--primary); box-shadow: 0 0 12px var(--primary); }
.tab-link .nb { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; min-width: 17px; height: 17px; font-size: 0.62rem; }

/* "More" sheet (phones) */
.sheet { position: fixed; inset: 0; z-index: 1060; display: none; }
.sheet.open { display: block; }
.sheet-back { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); animation: fadeIn .2s ease; }
.sheet-body { position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow-y: auto; background: var(--surface); border-top: 1px solid var(--line-2); border-radius: 22px 22px 0 0; padding: 0.5rem 16px calc(18px + env(safe-area-inset-bottom)); animation: sheetUp .25s ease; }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0.35rem auto 0.8rem; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.55rem; }
@media (min-width: 480px) { .sheet-grid { grid-template-columns: repeat(5, 1fr); } }
.sheet-item { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.7rem 0.2rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: 0.72rem; font-weight: 600; text-align: center; position: relative; line-height: 1.15; }
.sheet-item .bi { font-size: 1.3rem; color: var(--primary); }
.sheet-item.active { border-color: rgba(255, 140, 66, 0.55); }
.sheet-item .nb { position: absolute; top: 4px; right: 6px; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0.4; } }
@keyframes fadeIn { from { opacity: 0; } }

/* Footer */
.site-foot { margin-top: 2.5rem; border-top: 1px solid var(--line); padding: 1.4rem 0 0.4rem; color: var(--dim); font-size: 0.85rem; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--primary); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }

/* ═════════════════════════════ GUEST SHELL ═══════════════════════════ */
.g-nav { position: sticky; top: 0; z-index: 1030; background: rgba(7, 8, 15, 0.8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.g-nav-in { max-width: 1200px; margin: 0 auto; height: 64px; display: flex; align-items: center; gap: 1rem; padding: 0 16px; }
.g-links { display: none; gap: 0.25rem; margin-left: auto; }
.g-links a { color: var(--muted); padding: 0.45rem 0.8rem; border-radius: 10px; font-weight: 600; font-size: 0.92rem; }
.g-links a:hover, .g-links a.active { color: var(--text); background: var(--surface-2); }
@media (min-width: 768px) { .g-links { display: flex; } .g-nav .g-cta { margin-left: 0.5rem !important; } }
.g-cta { margin-left: auto; }
.g-wrap { max-width: 1200px; margin: 0 auto; padding: 1.4rem 16px 0; }
@media (min-width: 768px) { .g-wrap { padding: 2rem 24px 0; } }
.g-menu-btn { display: inline-grid; }
@media (min-width: 768px) { .g-menu-btn { display: none; } }

/* ═════════════════════════════ AD SLOTS ══════════════════════════════ */
.nxc-slot { display: flex; justify-content: center; align-items: center; margin: 1rem auto; max-width: 100%; color-scheme: normal; overflow: hidden; }
.nxc-slot-fit { position: relative; width: var(--slot-w, auto); max-width: 100%; min-height: var(--slot-h, 0); }
.nxc-slot-fit[data-w] { overflow: hidden; }
.nxc-slot-in { transform-origin: top left; width: var(--slot-w, auto); }
.nxc-slot-auto { width: 100%; }
.nxc-slot-auto .nxc-slot-in { width: 100%; }
.ad-side { position: sticky; top: calc(var(--top-h) + 16px); display: flex; flex-direction: column; gap: 1rem; }
.ad-side .nxc-slot { margin: 0 auto; }

/* Page layout with an ad sidebar: main column + 336px side (stacks on phones) */
.with-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
@media (min-width: 1200px) { .with-side { grid-template-columns: minmax(0, 1fr) 336px; } }

/* ═════════════════════════════ CONTENT (prose) ══════════════════════ */
.prose { line-height: 1.7; color: #d9dbea; font-size: 1rem; }
.prose h2 { font-size: 1.35rem; margin: 1.8rem 0 0.7rem; }
.prose h3 { font-size: 1.12rem; margin: 1.4rem 0 0.5rem; }
.prose p, .prose ul, .prose ol { margin-bottom: 1rem; }
.prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: 12px; height: auto; }
.prose blockquote { border-left: 3px solid var(--primary); padding-left: 1rem; color: var(--muted); }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.5rem 0.7rem; }

/* FAQ accordion */
.faq-item { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin-bottom: 0.6rem; overflow: hidden; }
.faq-item summary { list-style: none; cursor: pointer; padding: 0.95rem 1.1rem; font-weight: 600; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-family: var(--f-mono); color: var(--primary); font-size: 1.2rem; transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-a { padding: 0 1.1rem 1rem; color: #cfd2e3; line-height: 1.65; }

/* Utility grids */
.grid-2, .grid-3, .grid-4 { display: grid; gap: 0.9rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.list-rows > * + * { border-top: 1px solid var(--line); }
.list-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0; min-width: 0; }

/* Pager */
.pager { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; justify-content: center; margin-top: 1rem; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 0.6rem; display: inline-grid; place-items: center; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-family: var(--f-mono); font-size: 0.85rem; }
.pager a:hover { color: var(--text); border-color: var(--line-2); }
.pager .cur { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 700; }
.pager .off { opacity: 0.4; }

/* Tooltip ⓘ */
.tip { position: relative; display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--surface-3); color: var(--muted); font-size: 0.7rem; cursor: help; vertical-align: 1px; font-style: normal; }
.tip-box { position: absolute; z-index: 20; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 260px; background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text); padding: 0.5rem 0.65rem; border-radius: 10px; font-size: 0.78rem; line-height: 1.4; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .15s; text-transform: none; letter-spacing: 0; font-weight: 500; white-space: normal; }
.tip:hover .tip-box, .tip:focus .tip-box, .tip.on .tip-box { opacity: 1; }

/* Loading spinner + skeleton */
.spin { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: currentColor; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: skel 1.4s infinite; border-radius: 8px; }
@keyframes skel { to { background-position: -200% 0; } }

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

/* ── Shared pieces (contest pill, stat panels) ─────────────────────── */
.contest-pill { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.85rem; border-radius: 12px; background: linear-gradient(90deg, rgba(251, 191, 36, 0.14), rgba(251, 191, 36, 0.04)); border: 1px solid rgba(251, 191, 36, 0.35); color: var(--text); font-size: 0.86rem; }
.contest-pill .bi { color: var(--coin); }
.contest-pill:hover { color: var(--text); border-color: var(--coin); }
.panel .stats .stat-value { font-size: clamp(0.95rem, 0.78rem + 0.55vw, 1.25rem); text-overflow: clip; }
/* Leaderboards */
.lb-rank { width: 2.2rem; text-align: center; font-family: var(--f-mono); font-size: 0.82rem; color: var(--dim); flex: 0 0 auto; }
.lb-me { background: var(--primary-soft); border-radius: 10px; padding-left: 0.4rem !important; padding-right: 0.4rem !important; }
.contest-card .stats .stat-value { font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.2rem); }
/* Withdraw */
.wd-coins { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 0.45rem; }
.wd-coin { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0.55rem 0.3rem; border-radius: 12px; background: var(--bg-2); border: 1.5px solid var(--line); color: var(--text); font-size: 0.8rem; }
.wd-coin:hover { border-color: var(--line-2); }
.wd-coin.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.wd-coin.is-empty { opacity: 0.55; }
.wd-coin small { font-size: 0.58rem; font-weight: 800; letter-spacing: 0.04em; }
.wd-res { display: block; width: 36px; height: 4px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.wd-res i { display: block; height: 100%; background: var(--ok); }
.wd-method { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; padding: 0.7rem 0.8rem; border-radius: 12px; background: var(--bg-2); border: 1.5px solid var(--line); color: var(--text); text-align: left; }
.wd-method small { color: var(--dim); font-size: 0.74rem; }
.wd-method.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.wd-method.is-empty { opacity: 0.6; }
/* PTC */
.ptc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; }
@media (max-width: 420px) { .ptc-grid { grid-template-columns: minmax(0, 1fr); } }
.ptc-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0.9rem; display: flex; flex-direction: column; gap: 0.55rem; min-width: 0; }
.ptc-card.is-pending { border-color: rgba(251, 191, 36, 0.5); }
.ptc-card.is-done { border-color: rgba(61, 217, 160, 0.5); }
.ptc-card-head { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.ptc-card-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; flex: 0 0 auto; overflow: hidden; background: var(--surface-2); }
.ptc-card-icon img { width: 100%; height: 100%; object-fit: cover; }
.ptc-card-title { font-weight: 700; font-size: 0.9rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 0; }
.ptc-card-desc { font-size: 0.76rem; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex-grow: 1; }
.ptc-card-pills { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.ptc-card-pill { background: var(--surface-2); border-radius: 999px; padding: 3px 9px; font: 700 0.68rem var(--f-mono); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.ptc-state { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 0.42rem 0.6rem; border-radius: 999px; font-weight: 700; font-size: 0.74rem; line-height: 1.2; text-align: center; }
.ptc-state-pending { background: var(--warn-soft); color: var(--warn); }
.ptc-state-done { background: var(--ok-soft); color: var(--ok); }
.ptc-state-held, .ptc-state-wallet { background: rgba(94, 168, 255, 0.14); color: var(--info); }
.ptc-state-wallet a { color: inherit; }
.ptc-state-rejected { background: var(--bad-soft); color: #ff8a96; }
.ptc-state-reset { border: 0; background: none; color: inherit; opacity: 0.6; padding: 0 0 0 4px; font-size: 0.9rem; line-height: 1; cursor: pointer; }
.ptc-modal { position: fixed; inset: 0; z-index: 2147483646; background: rgba(7, 8, 15, 0.92); align-items: center; justify-content: center; padding: 1rem; }
.ptc-modal-box { position: relative; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 1.6rem; max-width: 400px; width: 100%; text-align: center; max-height: 92vh; overflow-y: auto; }
.ptc-tab-spinner { width: 0.8rem; height: 0.8rem; border-width: 2px; }

/* Round #1095 (owner): phone menu like sagebit — Home raised in the middle, the open page glows */
.tab-link.tab-center { justify-content: flex-end; padding-bottom: 6px; overflow: visible; }
.tab-center-btn { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--primary), var(--primary-2, #e67a30)); color: #14090a; box-shadow: 0 8px 22px rgba(255, 140, 66, 0.45), 0 0 0 4px var(--bg); transition: transform .15s ease, box-shadow .15s ease; }
.tab-center-btn .bi { font-size: 1.5rem; }
.tab-link.tab-center span:last-child { margin-top: 36px; }
.tab-link.tab-center.active::before { display: none; }
.tab-link.tab-center.active .tab-center-btn { box-shadow: 0 0 24px rgba(255, 140, 66, 0.7), 0 0 0 4px var(--bg); transform: translateX(-50%) scale(1.04); }
.tab-link.active:not(.tab-center) .bi { filter: drop-shadow(0 0 6px rgba(255, 140, 66, 0.8)); }

/* Round #1099: merged pages — one switch at the top (Wallet: Withdraw · Deposit, Account: Profile · Sessions) */
.page-switch { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 5px; margin: 0 0 1rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); max-width: 520px; }
.page-switch a { display: flex; align-items: center; justify-content: center; gap: 8px; padding: .6rem .8rem; border-radius: 12px; color: var(--muted); font-weight: 700; text-decoration: none; transition: background .15s, color .15s; }
.page-switch a:hover { color: var(--text); }
.page-switch a.on { background: var(--primary); color: #14090a; box-shadow: 0 6px 18px rgba(255, 140, 66, .3); }
