:root {
  --bg:        #0d0b14;
  --bg2:       #13111e;
  --bg3:       #1a1726;
  --pink:      #ffb6c1;
  --pink-dark: #e8829a;
  --purple:    #a78bfa;
  --green:     #44ff88;
  --red:       #ff4444;
  --text:      #f0f0f0;
  --text-muted:#999;
  --border:    rgba(255,255,255,0.08);
  --radius:    12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Login ───────────────────────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 60%, rgba(167,139,250,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 30%, rgba(255,182,193,0.06) 0%, transparent 60%),
              var(--bg);
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.login-logo { font-size: 3rem; margin-bottom: 1rem; }
.login-card h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.login-card p { color: var(--text-muted); margin-bottom: 2rem; line-height: 1.6; }

.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #5865f2;
  color: white;
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.2s;
}
.btn-discord:hover { background: #4752c4; }
.login-footer { margin-top: 2rem; font-size: 12px; color: var(--text-muted); }

/* ── Navbar ──────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand { font-size: 18px; font-weight: 700; color: var(--pink); }
.nav-user { display: flex; align-items: center; gap: 12px; }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; }

.btn-logout {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  transition: all 0.2s;
}
.btn-logout:hover { color: var(--text); background: rgba(255,255,255,0.1); }

/* ── Dashboard layout ────────────────────────────────────────── */
.dashboard-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: calc(100vh - 60px);
}

.dash-sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-link {
  display: block;
  padding: 10px 1.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.dash-link:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.dash-link.active { color: var(--pink); border-left-color: var(--pink); background: rgba(255,182,193,0.06); }

.dash-main { padding: 2rem; }

/* ── Dashboard header ────────────────────────────────────────── */
.dash-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.dash-avatar { width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--pink); }
.dash-header h1 { font-size: 1.8rem; }
.dash-id { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.dash-title { color: var(--pink); font-size: 13px; margin-top: 2px; }
.prestige-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f9ca24, #f0932b);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  margin-bottom: 4px;
}

/* ── Stat grid ───────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.stat-label { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--pink); }

/* ── Dash sections ───────────────────────────────────────────── */
.dash-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.dash-section h2 { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 1rem; }
.dash-bio { color: var(--text); line-height: 1.65; }

/* ── Fight record ────────────────────────────────────────────── */
.fight-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.fight-stat { text-align: center; }
.fight-label { display: block; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.fight-val { font-size: 1.4rem; font-weight: 700; }
.fight-val.win { color: var(--green); }
.fight-val.loss { color: var(--red); }

/* ── Marriage ────────────────────────────────────────────────── */
.marriage-row { display: flex; align-items: center; gap: 1rem; }
.partner-avatar { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--pink); }
.partner-name { font-weight: 600; font-size: 16px; }
.partner-id { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.badge-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.badge-item img { width: 40px; height: 40px; object-fit: contain; }
.badge-item span { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

/* ── Guild levels ────────────────────────────────────────────── */
.guild-levels { display: flex; flex-direction: column; gap: 8px; }
.guild-level-row { display: flex; align-items: center; gap: 1rem; padding: 8px; background: rgba(255,255,255,0.02); border-radius: 8px; }
.guild-id { font-size: 12px; color: var(--text-muted); font-family: monospace; flex: 1; }
.guild-name { font-size: 14px; color: var(--text); flex: 1; font-weight: 500; }
.guild-level { font-size: 14px; }
.guild-exp { font-size: 12px; color: var(--text-muted); }
.lb-username { font-size: 14px; color: var(--text); }
.val-warn { color: #f59e0b; }
.empty-note { color: var(--text-muted); font-size: 14px; }
.section-divider { font-size: 14px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 2rem 0 1rem; }

/* ── Server list ─────────────────────────────────────────────── */
.server-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.server-card:hover { border-color: rgba(255,182,193,0.3); background: var(--bg3); }
.server-icon { width: 44px; height: 44px; border-radius: 50%; }
.server-icon-placeholder {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: var(--pink);
  flex-shrink: 0;
}
.server-info { flex: 1; }
.server-name { font-weight: 600; font-size: 15px; }
.server-role { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.server-arrow { color: var(--text-muted); font-size: 20px; }

/* ── Server detail ───────────────────────────────────────────── */
.server-detail-header { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 0.5rem; }
.back-link { color: var(--text-muted); text-decoration: none; font-size: 14px; margin-right: 0.5rem; }
.back-link:hover { color: var(--pink); }
.server-icon-lg { width: 56px; height: 56px; border-radius: 50%; }
.server-icon-placeholder-lg {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 22px; color: var(--pink);
}
.server-role-badge {
  display: inline-block;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  margin-top: 4px;
}

/* ── Settings grid ───────────────────────────────────────────── */
.settings-grid { display: flex; flex-direction: column; gap: 0; }
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 14px;
}
.setting-row:last-child { border-bottom: none; }
.setting-label { color: var(--text-muted); }
.setting-value { font-weight: 500; color: var(--text); }
.val-on { color: var(--green); }
.val-off { color: var(--red); }

/* ── Stream alert status ─────────────────────────────────────── */
.status-live { color: #f87171; font-weight: 600; }
.status-offline { color: var(--text-muted); }

/* ── Reaction role panels ────────────────────────────────────── */
.rr-panels { display: flex; flex-direction: column; gap: 8px; }
.rr-panel { background: rgba(255,255,255,0.02); border-radius: 8px; padding: 10px 14px; }
.rr-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.rr-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); }
.rr-type { text-transform: capitalize; }

/* ── Collection ──────────────────────────────────────────────── */
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.collection-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; transition: border-color 0.2s; }
.collection-card:hover { border-color: rgba(255,182,193,0.3); }
.collection-name { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.collection-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.collection-stats { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); }

/* ── Leaderboard ─────────────────────────────────────────────── */
.lb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 0.75rem; }
.lb-table th { text-align: left; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.lb-table td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.lb-table tr:last-child td { border-bottom: none; }
.lb-rank { font-size: 16px; width: 36px; }
.lb-userid { color: var(--text-muted); font-size: 12px; font-family: monospace; }
.lb-muted { color: var(--text-muted); }
.lb-you td { background: rgba(255,182,193,0.06); }
.lb-you .lb-userid { color: var(--pink); font-family: inherit; font-weight: 600; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .dash-sidebar { flex-direction: row; border-right: none; border-bottom: 1px solid var(--border); padding: 0.5rem; overflow-x: auto; }
  .dash-link { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .dash-link.active { border-left-color: transparent; border-bottom-color: var(--pink); }
  .lb-grid { grid-template-columns: 1fr; }
  .fight-grid { grid-template-columns: repeat(2, 1fr); }
}
