:root {
  --bg: #0b0f1a;
  --bg-2: #0f1524;
  --card: #141b2d;
  --card-2: #182136;
  --line: #26304a;
  --line-2: #33406a;
  --text: #e6eaf2;
  --muted: #8a94ad;
  --faint: #5d6884;
  --blue: #3b82f6;
  --blue-2: #4d8df9;
  --cyan: #22d3ee;
  --gold: #f5b82e;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(3, 7, 18, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1000px 520px at 10% -10%, rgba(59, 130, 246, 0.16), transparent 62%),
    radial-gradient(800px 460px at 100% 110%, rgba(34, 211, 238, 0.09), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: #74a7fc; text-decoration: none; }
a:hover { color: var(--cyan); }
h1, h2, h3 { margin: 0 0 0.4em; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 0.8em; }
::selection { background: rgba(34, 211, 238, 0.3); color: #fff; }
* { scrollbar-color: #2b3754 transparent; scrollbar-width: thin; }

.boot, .center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--cyan); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.noscript { padding: 24px; text-align: center; }

/* ---------- layout */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 18px 14px; border-right: 1px solid var(--line); background: rgba(11, 15, 26, 0.75); backdrop-filter: blur(8px); display: flex; flex-direction: column; gap: 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; padding: 4px 8px 16px; color: var(--text); }
.brand .mark { width: 30px; height: 30px; }
.brand b { color: var(--cyan); font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 550; transition: background 0.15s, color 0.15s; }
.nav a:hover { background: rgba(59, 130, 246, 0.08); color: var(--text); }
.nav a.active { color: #fff; background: linear-gradient(90deg, rgba(59, 130, 246, 0.26), rgba(34, 211, 238, 0.06)); box-shadow: inset 3px 0 0 var(--cyan); }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav .sep { height: 1px; background: var(--line); margin: 10px 4px; }
.side .grow { flex: 1; }
.main { min-width: 0; padding: 22px 28px 90px; max-width: 1180px; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.topbar .title h1 { margin: 0; }
.topbar .title p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.coins { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: rgba(245, 184, 46, 0.12); color: var(--gold); font-weight: 650; border: 1px solid rgba(245, 184, 46, 0.25); white-space: nowrap; }
.coins svg { width: 16px; height: 16px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--line); object-fit: cover; }
.mobile-brand { display: none; }

.tabbar { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 14px 14px 96px; }
  .mobile-brand { display: flex; }
  .topbar .title { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(11, 15, 26, 0.96); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(10px); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 6px 2px; border-radius: 10px; }
  .tabbar a.active { color: var(--cyan); }
  .tabbar svg { width: 21px; height: 21px; }
  .page-title { display: block !important; }
}
.page-title { display: none; margin-bottom: 14px; }

/* ---------- cards and grids */
.card { background: rgba(20, 27, 45, 0.86); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 14px; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.gold { color: var(--gold); }
.mt { margin-top: 14px; }
.hide { display: none !important; }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 2px; }
.meter { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 10px; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: 99px; }

/* ---------- buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; transition: filter 0.15s, transform 0.08s, background 0.15s, box-shadow 0.15s; white-space: nowrap; text-decoration: none; }
.btn:hover { background: #1f2a44; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { border: 0; color: #fff; background: linear-gradient(135deg, #3b82f6, #2563eb); box-shadow: 0 6px 18px rgba(59, 130, 246, 0.28); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.cyan { border: 0; color: #04232b; background: linear-gradient(135deg, #22d3ee, #14b8d4); }
.btn.gold { border: 0; color: #2a1d02; background: linear-gradient(135deg, #f5b82e, #e09b12); }
.btn.danger { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.35); color: #fca5a5; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 14px 22px; font-size: 16px; }
.btn.block { width: 100%; }
.btn svg { width: 17px; height: 17px; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 550; }
input, select, textarea { font: inherit; color: var(--text); background: rgba(11, 15, 26, 0.75); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
input:hover, select:hover, textarea:hover { border-color: var(--line-2); }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue); }
input[type="range"] { padding: 0; accent-color: var(--cyan); }
.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; }

/* ---------- badges and pills */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 7px; background: rgba(138, 148, 173, 0.14); color: var(--muted); white-space: nowrap; }
.badge.green { background: rgba(34, 197, 94, 0.14); color: #4ade80; }
.badge.red { background: rgba(239, 68, 68, 0.14); color: #f87171; }
.badge.amber { background: rgba(245, 158, 11, 0.14); color: #fbbf24; }
.badge.blue { background: rgba(59, 130, 246, 0.16); color: #93c5fd; }
.badge.cyan { background: rgba(34, 211, 238, 0.14); color: #67e8f9; }
.badge.gold { background: rgba(245, 184, 46, 0.14); color: var(--gold); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- servers */
.server { background: rgba(20, 27, 45, 0.9); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: border-color 0.15s; }
.server:hover { border-color: var(--line-2); }
.server.bad { border-color: rgba(239, 68, 68, 0.4); }
.server .name { font-weight: 650; font-size: 16px; }
.server .meta { color: var(--muted); font-size: 13px; }
.server .specs { display: flex; gap: 14px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.server .specs b { color: var(--text); font-weight: 600; }
.server .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.server .actions .btn { flex: 1; }
.notice { border-radius: 10px; padding: 10px 12px; font-size: 13px; background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.2); color: #c3d5fb; }
.notice.red { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.3); color: #fecaca; }
.notice.amber { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.3); color: #fde68a; }
.empty { text-align: center; padding: 34px 18px; }
.empty .icon { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 14px; display: grid; place-items: center; background: rgba(59, 130, 246, 0.12); color: var(--cyan); }
.empty .icon svg { width: 26px; height: 26px; }

/* ---------- choice tiles (create flow) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.tile { text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(11, 15, 26, 0.55); color: var(--text); cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 6px; transition: border-color 0.15s, background 0.15s; }
.tile:hover { border-color: var(--line-2); }
.tile.selected { border-color: var(--cyan); background: rgba(34, 211, 238, 0.07); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1); }
.tile:disabled { opacity: 0.5; cursor: not-allowed; }
.tile .t { font-weight: 650; }
.tile .d { color: var(--muted); font-size: 13px; }
.step-title { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; font-weight: 650; }
.step-title .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: rgba(59, 130, 246, 0.18); color: #a4c6fe; }
.slider { display: grid; grid-template-columns: 90px minmax(0, 1fr) 110px; align-items: center; gap: 12px; }
.slider output { text-align: right; font-weight: 650; }

/* ---------- earn */
.earn-hero { display: grid; place-items: center; text-align: center; gap: 12px; padding: 30px 18px; }
.ring { --p: 0; width: 180px; height: 180px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--cyan) calc(var(--p) * 1%), var(--line) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--bg-2); }
.ring > div { position: relative; text-align: center; }
.ring .big { font-size: 34px; font-weight: 750; }
.ad-slot { min-height: 100px; display: grid; place-items: center; border: 1px dashed var(--line-2); border-radius: 12px; color: var(--faint); font-size: 12px; overflow: hidden; }
.ad-slot.tall { min-height: 260px; }
.ad-label { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.ts-box { min-height: 70px; display: grid; place-items: center; }

/* ---------- login + gate */
.hero { max-width: 460px; width: 100%; text-align: center; }
.hero .logo { width: 64px; height: 64px; margin: 0 auto 16px; }
.hero h1 { font-size: 30px; }
.hero h1 b { background: linear-gradient(90deg, var(--blue-2), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.btn.discord { background: #5865f2; border: 0; color: #fff; }
.btn.discord:hover { filter: brightness(1.08); background: #5865f2; }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; text-align: left; }
.feature { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(20, 27, 45, 0.6); font-size: 13px; color: var(--muted); }
.feature b { display: block; color: var(--text); font-size: 14px; margin-bottom: 2px; }
.countdown { font-size: 52px; font-weight: 800; background: linear-gradient(90deg, var(--blue-2), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- blocking overlay (ad blocker) */
.blocker { position: fixed; inset: 0; z-index: 100; background: rgba(7, 10, 18, 0.94); backdrop-filter: blur(10px); display: grid; place-items: center; padding: 20px; }
.blocker .card { max-width: 480px; text-align: center; border-color: rgba(239, 68, 68, 0.4); }
.blocker ol { text-align: left; color: var(--muted); font-size: 14px; padding-left: 20px; }

/* ---------- modal + toasts */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(7, 10, 18, 0.7); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 440px; background: #111827; border: 1px solid var(--line-2); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
#toasts { position: fixed; z-index: 120; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 11px 14px; border-radius: 10px; background: #141b2d; border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px; animation: rise 0.2s ease-out; }
.toast.ok { border-color: rgba(34, 197, 94, 0.45); }
.toast.err { border-color: rgba(239, 68, 68, 0.5); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 860px) { #toasts { bottom: 84px; right: 12px; left: 12px; max-width: none; } }

/* ---------- tables (admin) */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px; border-bottom: 1px solid var(--line); background: rgba(59, 130, 246, 0.05); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: rgba(59, 130, 246, 0.04); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 8px 13px; border-radius: 9px; color: var(--muted); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.tabs a.active { color: #fff; border-color: var(--cyan); background: rgba(34, 211, 238, 0.08); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.empty h2 { justify-content: center; }
.grid.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) {
  .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; }
  .stat .value { font-size: 19px; }
}

.grid > .card + .card { margin-top: 0; }
