:root {
  --bg: #0b0d12;
  --bg-elev: #11141b;
  --bg-elev-2: #161a23;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e7e9ee;
  --text-muted: #9aa1ad;
  --text-dim: #6b7280;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-dim: #1e3a8a;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 10px;
  --radius-lg: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ── Layout ─────────────────────────────────── */
.nav {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 13, 18, 0.85);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 50;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.brand-logo { display: block; }
.nav-links { display: flex; gap: 4px; margin-left: 20px; flex: 1; }
.nav-link { padding: 6px 12px; border-radius: 6px; font-size: 14px; color: var(--text-muted); }
.nav-link:hover { background: var(--bg-elev); color: var(--text); }
.nav-link.active { color: var(--text); background: var(--bg-elev); }
.nav-actions { display: flex; gap: 10px; align-items: center; }

.container { max-width: 1200px; margin: 0 auto; padding: 32px 20px 80px; }

/* ── Buttons ─────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; border: 1px solid transparent; transition: all 0.15s; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary { background: var(--bg-elev); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-elev-2); border-color: var(--border-strong); }
.btn-danger { background: rgba(239, 68, 68, 0.1); color: var(--red); border-color: rgba(239, 68, 68, 0.3); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.15); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--bg-elev); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Hero ─────────────────────────────────── */
.hero { text-align: center; padding: 56px 20px 32px; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  background: rgba(59, 130, 246, 0.1); color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 999px; font-size: 12px; font-weight: 500; letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.hero h1 { font-size: 44px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 12px; line-height: 1.1; }
.hero p { font-size: 17px; color: var(--text-muted); max-width: 560px; margin: 0 auto 24px; }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.stats { display: flex; gap: 12px; justify-content: center; margin: 28px 0; flex-wrap: wrap; }
.stat { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 24px; min-width: 120px; text-align: center; }
.stat-num { font-size: 22px; font-weight: 600; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Filters ─────────────────────────────────── */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 32px 0 20px; align-items: center; }
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; flex: 1; min-width: 220px; max-width: 360px;
}
.search-wrap:focus-within { border-color: var(--accent); }
.search-wrap input { background: transparent; border: none; outline: none; color: var(--text); flex: 1; font-size: 14px; }
.chip { background: var(--bg-elev); border: 1px solid var(--border); color: var(--text-muted); padding: 6px 14px; border-radius: 999px; font-size: 13px; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Server grid / cards ─────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; display: flex; flex-direction: column; transition: border-color 0.15s;
}
.card:hover { border-color: var(--border-strong); }
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.card-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elev-2); font-size: 18px; flex-shrink: 0; overflow: hidden;
}
.card-icon img { width: 100%; height: 100%; object-fit: cover; }
.card-title { font-size: 16px; font-weight: 500; margin: 0; }
.card-owner { font-size: 12px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.card-owner img { width: 16px; height: 16px; border-radius: 50%; }
.card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin: 8px 0 12px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tag { font-size: 11px; background: var(--bg-elev-2); color: var(--text-muted); padding: 3px 8px; border-radius: 6px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: auto; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.live-dot.off { background: var(--text-dim); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 999px; }
.badge-mod { background: rgba(245, 158, 11, 0.15); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-ban { background: rgba(239, 68, 68, 0.15); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-new { background: rgba(34, 197, 94, 0.15); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.3); }
.badge-removed { background: rgba(107, 114, 128, 0.15); color: var(--text-dim); border: 1px solid rgba(107, 114, 128, 0.3); }

/* ── Forms ─────────────────────────────────── */
.form { max-width: 640px; margin: 0 auto; }
.form-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.form-row .hint { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.form-row .hint a { color: var(--accent); }
input[type="text"], input[type="url"], input[type="password"], textarea, select {
  width: 100%; padding: 10px 12px; background: var(--bg-elev-2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 14px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 100px; font-family: inherit; }
.optional-block {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius); padding: 14px; margin-bottom: 18px;
}
.optional-block h4 { margin: 0 0 6px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.optional-block p { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; line-height: 1.5; }
.optional-block .lock {
  font-size: 11px; color: var(--text-dim); display: flex; align-items: center; gap: 4px; margin-top: 8px;
}

/* ── Admin ─────────────────────────────────── */
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.admin-tab { padding: 10px 16px; font-size: 14px; color: var(--text-muted); background: none; border: none; border-bottom: 2px solid transparent; }
.admin-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.admin-tab:hover { color: var(--text); }

.admin-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px;
}
.admin-row img { width: 36px; height: 36px; border-radius: 50%; }
.admin-row-main { flex: 1; min-width: 0; }
.admin-row-title { font-size: 14px; font-weight: 500; }
.admin-row-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.admin-row-actions { display: flex; gap: 6px; }

/* ── Modal ─────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; max-width: 480px; width: 100%; }
.modal h3 { margin: 0 0 8px; font-size: 18px; font-weight: 500; }
.modal p { color: var(--text-muted); margin: 0 0 16px; font-size: 14px; line-height: 1.55; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ── Misc ─────────────────────────────────── */
.empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty .icon { font-size: 32px; margin-bottom: 12px; opacity: 0.5; }
.alert { padding: 12px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }
.alert-success { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3); color: #86efac; }
.alert-info { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.3); color: #93c5fd; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--text-dim); border-top-color: var(--text); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.discord-btn { background: #5865f2 !important; border-color: #5865f2 !important; color: #fff !important; }
.discord-btn:hover { background: #4752c4 !important; border-color: #4752c4 !important; }

/* Icon upload */
.icon-upload { display: flex; gap: 14px; align-items: flex-start; }
.icon-preview {
  width: 72px; height: 72px; border-radius: 14px;
  background: var(--bg-elev-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; overflow: hidden; flex-shrink: 0;
}
.icon-preview img { width: 100%; height: 100%; object-fit: cover; }

/* VC toggle */
.toggle {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 12px; background: var(--bg-elev-2); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.toggle:hover { border-color: var(--border-strong); }
.toggle input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.toggle-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.toggle-text strong { font-weight: 500; }
.toggle-text .hint { font-size: 12px; color: var(--text-dim); margin: 0; }

/* Invite code row on cards */
.invite-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-elev-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; margin-bottom: 12px;
}
.invite-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.invite-code {
  font-family: ui-monospace, monospace; font-size: 13px; color: var(--text);
  background: transparent; flex: 1; letter-spacing: 0.05em;
}

.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px; font-size: 13px; }
.user-chip img { width: 24px; height: 24px; border-radius: 50%; }

@media (max-width: 640px) {
  .hero h1 { font-size: 32px; }
  .nav-links { display: none; }
  .grid { grid-template-columns: 1fr; }
}

/* ── Site footer ─────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  margin-top: 80px;
  padding: 32px 20px 40px;
}
.site-footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center;
}
.site-footer-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 14px; color: var(--text);
}
.site-footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.site-footer-links a { font-size: 13px; color: var(--text-muted); }
.site-footer-links a:hover { color: var(--text); }
.site-footer-fine { font-size: 11px; color: var(--text-dim); max-width: 560px; line-height: 1.5; }

/* ── Terms / legal pages ─────────────────────────── */
.legal {
  max-width: 760px; margin: 0 auto;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px 44px;
  line-height: 1.7; color: var(--text);
}
.legal h1 { font-size: 30px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.02em; }
.legal .updated { color: var(--text-dim); font-size: 13px; margin-bottom: 32px; }
.legal h2 { font-size: 18px; font-weight: 600; margin: 32px 0 10px; color: var(--text); }
.legal h3 { font-size: 15px; font-weight: 500; margin: 20px 0 6px; color: var(--text); }
.legal p, .legal li { font-size: 14px; color: var(--text); }
.legal ul { padding-left: 22px; margin: 8px 0 14px; }
.legal li { margin-bottom: 4px; }
.legal strong { color: var(--text); }
.legal a { color: var(--accent); text-decoration: underline; }
.legal a:hover { color: #93c5fd; }
.legal .callout {
  background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius); padding: 14px 16px; margin: 16px 0;
  font-size: 13px; color: var(--text-muted);
}
