/* ============================================================
   Anomalie — Frosted Glass Design System
   Deep Ocean / Soft Glass / Frosted Neumorphism
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* --- Color Palette & Custom Properties --- */
:root {
  /* Deep ocean base palette */
  --ocean-950: #040711;
  --ocean-900: #060912;
  --ocean-850: #0a0f1f;
  --ocean-800: #0e1530;
  --ocean-750: #111a3a;
  --ocean-700: #151f44;
  --ocean-600: #1e2d5e;
  --ocean-500: #2a3f7a;
  --ocean-400: #4a5ea0;
  --ocean-300: #7b8ec4;
  --ocean-200: #a8b5da;
  --ocean-100: #c8d1e8;
  --ocean-50:  #e4e8f4;

  /* Accent: Indigo → Violet gradient */
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-tertiary: #a78bfa;
  --accent-light: #c4b5fd;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --accent-glow-strong: rgba(99, 102, 241, 0.5);

  /* Semantic: glass surfaces */
  --glass-bg: rgba(10, 15, 32, 0.55);
  --glass-bg-strong: rgba(10, 15, 32, 0.75);
  --glass-bg-hover: rgba(20, 28, 58, 0.6);
  --glass-bg-input: rgba(6, 10, 22, 0.7);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-border-hover: rgba(255, 255, 255, 0.12);
  --glass-border-strong: rgba(255, 255, 255, 0.15);
  --glass-blur: blur(20px);

  /* Text */
  --text-primary: #d0d7ea;
  --text-secondary: #8b96b9;
  --text-muted: #5a6688;
  --text-heading: #eef1f8;
  --white: #ffffff;

  /* Status colors */
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.08);
  --success-border: rgba(52, 211, 153, 0.2);
  --success-glow: rgba(52, 211, 153, 0.25);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.08);
  --warning-border: rgba(251, 191, 36, 0.2);
  --error: #f87171;
  --error-bg: rgba(248, 113, 113, 0.08);
  --error-border: rgba(248, 113, 113, 0.2);
  --error-glow: rgba(248, 113, 113, 0.25);
  --info-bg: rgba(99, 102, 241, 0.08);
  --info-border: rgba(99, 102, 241, 0.2);
  --info-color: #a5b4fc;

  /* Radii — rounder for glass style */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px var(--accent-glow);
  --shadow-glow-strong: 0 0 40px var(--accent-glow-strong);

  /* Neumorphic shadows */
  --neu-raised: 6px 6px 14px rgba(0, 0, 0, 0.5), -3px -3px 10px rgba(255, 255, 255, 0.02);
  --neu-pressed: inset 3px 3px 8px rgba(0, 0, 0, 0.5), inset -2px -2px 6px rgba(255, 255, 255, 0.02);

  --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}


/* ============================================================
   1. Base Reset & Typography
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--ocean-950);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ── Background blobs ─────────────────────────────────────── */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

body::before {
  width: 600px;
  height: 600px;
  top: -10%;
  right: -8%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(139, 92, 246, 0.08) 50%, transparent 70%);
  animation: blobFloat 20s ease-in-out infinite;
}

body::after {
  width: 500px;
  height: 500px;
  bottom: -5%;
  left: -5%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, rgba(99, 102, 241, 0.06) 50%, transparent 70%);
  animation: blobFloat 25s ease-in-out infinite reverse;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.05); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
  75% { transform: translate(20px, 10px) scale(1.02); }
}

/* Everything sits above the blobs */
body > * {
  position: relative;
  z-index: 1;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
  margin-bottom: 0.75rem;
}

a {
  color: var(--accent-tertiary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-light);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

code, .mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}


/* ============================================================
   2. Navbar — Frosted glass
   ============================================================ */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 64px;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent-tertiary), var(--text-heading));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
}

.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.nav-link:hover {
  color: var(--text-heading);
  background: var(--glass-bg-hover);
}

.nav-link.active {
  color: var(--accent-tertiary);
  background: rgba(99, 102, 241, 0.1);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.nav-user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--glass-border-strong);
  object-fit: cover;
}

.avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  object-fit: cover;
  vertical-align: middle;
  margin-right: 0.5rem;
  display: inline-block;
  flex-shrink: 0;
}

td:has(.avatar-sm) {
  white-space: nowrap;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  cursor: pointer;
  transition: all var(--transition);
}

.nav-btn:hover {
  border-color: var(--glass-border-strong);
  color: var(--text-heading);
  background: var(--glass-bg-hover);
  box-shadow: var(--shadow-sm);
}


/* ============================================================
   3. Cards — Frosted glass panels
   ============================================================ */
.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-heading);
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.015);
}

.card-body {
  padding: 1.5rem;
}


/* ============================================================
   4. Tabs
   ============================================================ */
.tabs {
  display: flex;
  gap: 0.125rem;
  border-bottom: 1px solid var(--glass-border);
  padding: 0 1.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.75rem 1rem;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-tertiary);
  border-bottom-color: var(--accent-primary);
}

.tab-content {
  position: relative;
}

.tab-pane {
  display: none;
  animation: tabFadeIn 300ms ease;
}

.tab-pane.active {
  display: block;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   5. Tables — Glass rows
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  scrollbar-width: thin;
  scrollbar-color: var(--ocean-700) transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: rgba(255, 255, 255, 0.03);
}

th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

tbody tr {
  transition: all var(--transition);
}

tbody tr:hover:not(.rank-1):not(.rank-2):not(.rank-3):not(.rank-empty) {
  background: rgba(99, 102, 241, 0.04);
}

tr.rank-1:hover {
  background: linear-gradient(90deg, rgba(255, 195, 30, 0.2) 0%, rgba(255, 215, 0, 0.1) 50%, rgba(255, 195, 30, 0.2) 100%) !important;
}
tr.rank-2:hover {
  background: linear-gradient(90deg, rgba(190, 205, 235, 0.18) 0%, rgba(210, 220, 245, 0.09) 50%, rgba(190, 205, 235, 0.18) 100%) !important;
}
tr.rank-3:hover {
  background: linear-gradient(90deg, rgba(205, 140, 60, 0.15) 0%, rgba(205, 140, 60, 0.07) 50%, rgba(205, 140, 60, 0.15) 100%) !important;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* --- Top 3 ranks — styles on tr, not td --- */
@keyframes rankPulse1 {
  0%, 100% { box-shadow: inset 0 0 40px rgba(255, 200, 50, 0.06), 0 1px 0 rgba(255, 200, 50, 0.15); }
  50% { box-shadow: inset 0 0 40px rgba(255, 200, 50, 0.14), 0 1px 0 rgba(255, 200, 50, 0.25); }
}

@keyframes rankPulse2 {
  0%, 100% { box-shadow: inset 0 0 35px rgba(190, 205, 235, 0.05), 0 1px 0 rgba(190, 205, 235, 0.12); }
  50% { box-shadow: inset 0 0 35px rgba(190, 205, 235, 0.12), 0 1px 0 rgba(190, 205, 235, 0.2); }
}

@keyframes rankPulse3 {
  0%, 100% { box-shadow: inset 0 0 30px rgba(205, 140, 60, 0.04), 0 1px 0 rgba(205, 140, 60, 0.1); }
  50% { box-shadow: inset 0 0 30px rgba(205, 140, 60, 0.1), 0 1px 0 rgba(205, 140, 60, 0.18); }
}

/* Rank 1 — Gold */
tr.rank-1 {
  background: linear-gradient(90deg, rgba(255, 195, 30, 0.12) 0%, rgba(255, 215, 0, 0.06) 50%, rgba(255, 195, 30, 0.12) 100%);
  border-left: 3px solid rgba(255, 200, 50, 0.6);
  animation: rankPulse1 4s ease-in-out infinite;
}
tr.rank-1 td { font-weight: 600; border-bottom-color: rgba(255, 200, 50, 0.1) !important; background: none !important; }
tr.rank-1 td:first-child { color: #ffd700; font-weight: 700; }

/* Rank 2 — Silver */
tr.rank-2 {
  background: linear-gradient(90deg, rgba(190, 205, 235, 0.1) 0%, rgba(210, 220, 245, 0.05) 50%, rgba(190, 205, 235, 0.1) 100%);
  border-left: 3px solid rgba(200, 215, 240, 0.5);
  animation: rankPulse2 4.5s ease-in-out infinite;
}
tr.rank-2 td { font-weight: 600; border-bottom-color: rgba(200, 215, 240, 0.08) !important; background: none !important; }
tr.rank-2 td:first-child { color: #c8d4ed; font-weight: 700; }

/* Rank 3 — Bronze */
tr.rank-3 {
  background: linear-gradient(90deg, rgba(205, 140, 60, 0.08) 0%, rgba(205, 140, 60, 0.04) 50%, rgba(205, 140, 60, 0.08) 100%);
  border-left: 3px solid rgba(205, 140, 60, 0.45);
  animation: rankPulse3 5s ease-in-out infinite;
}
tr.rank-3 td { font-weight: 600; border-bottom-color: rgba(205, 140, 60, 0.06) !important; background: none !important; }
tr.rank-3 td:first-child { color: #cd7f32; font-weight: 700; }

/* --- Empty placeholder rows --- */
.rank-empty td {
  color: var(--text-muted);
  opacity: 0.3;
  font-style: italic;
  user-select: none;
}

.rank-empty td:first-child {
  border-left: 3px solid transparent;
}


/* ============================================================
   6. Battle Pass — Glass tier cards
   ============================================================ */
.battle-pass {
  padding: 1.5rem;
}

/* --- Battle Pass Track --- */

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes bp-pulse {
  0%, 100% { box-shadow: 0 0 8px var(--accent-glow), 0 0 20px transparent; }
  50% { box-shadow: 0 0 12px var(--accent-glow-strong), 0 0 28px var(--accent-glow); }
}

.bp-track-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 1rem;
  margin: 0 -0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.bp-track-wrapper::-webkit-scrollbar {
  height: 6px;
}
.bp-track-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
.bp-track-wrapper::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 999px;
}

.bp-track {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0.5rem;
  min-width: min-content;
}

/* Each tier node + connector */
.bp-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex-shrink: 0;
  width: 140px;
}

/* Connector line between nodes */
.bp-connector {
  flex-shrink: 0;
  width: 48px;
  display: flex;
  align-items: center;
  position: relative;
  align-self: center;
  margin-top: -24px;
}

.bp-connector-line {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.bp-connector-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Node circle */
.bp-node-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--glass-bg-strong);
  border: 2px solid var(--glass-border);
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.bp-node-circle img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* Node info below circle */
.bp-node-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.625rem;
  text-align: center;
  min-height: 56px;
}

.bp-node-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.2;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-node-pts {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.bp-node-action {
  margin-top: 0.25rem;
}

/* State: locked */
.bp-node.locked .bp-node-circle {
  opacity: 0.3;
  border-color: rgba(255, 255, 255, 0.05);
}
.bp-node.locked .bp-node-title,
.bp-node.locked .bp-node-pts {
  opacity: 0.35;
}

/* State: unlocked (claimable) */
.bp-node.unlocked .bp-node-circle {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  animation: bp-pulse 2.5s ease-in-out infinite;
}

/* State: claimed (pending delivery) */
.bp-node.claimed .bp-node-circle {
  border-color: var(--warning);
  background: rgba(251, 191, 36, 0.1);
}

/* State: delivered (done) */
.bp-node.delivered .bp-node-circle {
  border-color: var(--success);
  background: rgba(52, 211, 153, 0.1);
}
.bp-node.delivered .bp-node-circle::after {
  content: '\2713';
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--success);
  color: var(--ocean-950);
  font-size: 0.625rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Current tier indicator */
.bp-node.current .bp-node-circle {
  border-width: 3px;
  border-color: var(--accent-tertiary);
  box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(99, 102, 241, 0.1);
}


/* ============================================================
   7. Referral Section
   ============================================================ */
.referral-link-box {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--glass-bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: var(--neu-pressed);
  transition: border-color var(--transition);
}

.referral-link-box:focus-within {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: var(--neu-pressed), 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.referral-link-box input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.8125rem;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  min-width: 0;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.75rem 1.25rem;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.copy-btn:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 16px var(--accent-glow);
}

.copy-btn.copied {
  background: linear-gradient(135deg, var(--success), #10b981);
}

.referral-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-md);
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
  background: linear-gradient(135deg, var(--text-heading), var(--accent-tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card .stat-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}


/* ============================================================
   8. Account Section
   ============================================================ */
.account-info {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.account-info .info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--glass-border);
}

.account-info .info-row:last-child {
  border-bottom: none;
}

.account-info .info-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.account-info .info-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-heading);
}

.discord-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, #5865F2, #7289da);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.discord-link-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.3);
}

.discord-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.discord-status.connected {
  color: var(--success);
}

.discord-status.disconnected {
  color: var(--text-muted);
}

.discord-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.discord-status.connected::before {
  box-shadow: 0 0 6px var(--success-glow);
}


/* ============================================================
   9. Buttons — Soft glass + gradient glow
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-tertiary);
  outline-offset: 2px;
}

.btn-primary {
  color: var(--white);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow-strong);
}

.btn-primary:active {
  transform: translateY(0);
  filter: brightness(0.95);
  box-shadow: 0 1px 8px var(--accent-glow);
}

.btn-secondary {
  color: var(--text-secondary);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-strong);
  color: var(--text-heading);
  box-shadow: var(--shadow-sm);
}

.btn-danger {
  color: var(--white);
  background: linear-gradient(135deg, #dc2626, #ef4444);
  border: none;
  box-shadow: 0 2px 12px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--error-glow);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}


/* ============================================================
   10. Forms — Neumorphic inset inputs
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-heading);
}

.form-input,
.form-textarea,
select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--glass-bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  outline: none;
  box-shadow: var(--neu-pressed);
}

.form-input:focus,
.form-textarea:focus,
select:focus {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: var(--neu-pressed), 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%235a6688' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}


/* ============================================================
   11. Badges — Glass pills
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  border-radius: 999px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.badge-success {
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid var(--success-border);
}

.badge-warning {
  color: var(--warning);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
}

.badge-error {
  color: var(--error);
  background: var(--error-bg);
  border: 1px solid var(--error-border);
}


/* ============================================================
   12. Admin
   ============================================================ */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-stats .stat-card {
  border-left: 3px solid var(--accent-primary);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.tier-form {
  display: grid;
  gap: 1rem;
}

.tier-form .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.tier-table {
  margin-top: 1.5rem;
}

.tier-table .actions {
  display: flex;
  gap: 0.5rem;
}

/* --- Modal Overlay --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 17, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-card {
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}


/* ============================================================
   13. Alerts — Glass with colored tint
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid;
  margin-bottom: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.alert-success {
  color: var(--success);
  background: var(--success-bg);
  border-color: var(--success-border);
}

.alert-error {
  color: var(--error);
  background: var(--error-bg);
  border-color: var(--error-border);
}

.alert-info {
  color: var(--info-color);
  background: var(--info-bg);
  border-color: var(--info-border);
}


/* ============================================================
   14. Utility Classes
   ============================================================ */
/* Section headings inside tab panes — spacing */
.tab-pane > h2 {
  margin: 1.5rem 0 1rem;
}

.text-muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }


/* ============================================================
   16. Landing Page — Dramatic glass card
   ============================================================ */
.landing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.5rem;
  position: relative;
}

/* Extra blob for landing page */
.landing-container::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(99, 102, 241, 0.05) 50%, transparent 70%);
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: blobPulse 8s ease-in-out infinite;
}

@keyframes blobPulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.15); }
}

.landing-banner {
  max-width: 480px;
  width: 100%;
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  border-radius: var(--radius-md);
  color: var(--accent-light);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  animation: bannerSlideIn 400ms ease;
  position: relative;
  z-index: 1;
}

.landing-banner.error {
  color: var(--error);
  background: var(--error-bg);
  border-color: var(--error-border);
}

@keyframes bannerSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.landing-card {
  max-width: 480px;
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), 0 0 60px rgba(99, 102, 241, 0.06);
  padding: 3rem 2.5rem;
  text-align: center;
  animation: cardFadeIn 600ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.landing-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.04em;
  margin-bottom: 0.25rem;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text-heading) 30%, var(--accent-tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-subtitle {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.landing-description {
  font-size: 0.9375rem;
  color: var(--text-primary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.landing-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.9375rem 1.5rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 4px 20px var(--accent-glow);
  position: relative;
  overflow: hidden;
}

.landing-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.landing-cta:hover::before {
  transform: translateX(100%);
}

.landing-cta:hover {
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow-strong);
  color: var(--white);
}

.landing-cta:active {
  transform: translateY(0);
  box-shadow: 0 2px 12px var(--accent-glow);
}

.landing-cta svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.landing-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.landing-note svg {
  display: inline-block;
  vertical-align: -2px;
  margin-right: 0.25rem;
  width: 14px;
  height: 14px;
}


/* ============================================================
   15. Responsive — Mobile-first breakpoints
   ============================================================ */
@media (max-width: 768px) {
  h1 { font-size: 1.625rem; }
  h2 { font-size: 1.25rem; }

  body::before {
    width: 350px;
    height: 350px;
  }

  body::after {
    width: 300px;
    height: 300px;
  }

  .navbar {
    padding: 0 1rem;
  }

  .nav-links {
    gap: 0;
  }

  .nav-link {
    padding: 0.5rem 0.625rem;
    font-size: 0.8125rem;
  }

  .container {
    padding: 0 1rem;
  }

  .tabs {
    padding: 0 1rem;
  }

  .tab-btn {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
  }

  .card-title {
    padding: 1rem 1.25rem;
  }

  .card-body {
    padding: 1.25rem;
  }

  .bp-node {
    width: 110px;
  }

  .bp-connector {
    width: 32px;
  }

  .referral-stats {
    grid-template-columns: 1fr 1fr;
  }

  .admin-stats {
    grid-template-columns: 1fr 1fr;
  }

  .tier-form .form-row {
    grid-template-columns: 1fr;
  }

  .landing-card {
    padding: 2.25rem 1.75rem;
    border-radius: var(--radius-lg);
  }

  .landing-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.375rem; }

  body::before,
  body::after {
    width: 250px;
    height: 250px;
    filter: blur(70px);
  }

  .navbar {
    height: 56px;
  }

  .nav-user-name {
    display: none;
  }

  .tabs {
    padding: 0 0.75rem;
    gap: 0;
  }

  .tab-btn {
    padding: 0.5rem 0.625rem;
    font-size: 0.75rem;
  }

  .referral-link-box {
    flex-direction: column;
  }

  .referral-link-box input {
    border-bottom: 1px solid var(--glass-border);
  }

  .copy-btn {
    justify-content: center;
    padding: 0.625rem;
  }

  .referral-stats {
    grid-template-columns: 1fr;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .bp-node {
    width: 100px;
  }

  .bp-connector {
    width: 24px;
  }

  .bp-node-circle {
    width: 46px;
    height: 46px;
    font-size: 1.25rem;
  }

  .bp-node-title {
    font-size: 0.6875rem;
    max-width: 90px;
  }

  .stat-card .stat-value {
    font-size: 1.5rem;
  }

  .landing-container {
    padding: 1.5rem 1rem;
  }

  .landing-card {
    padding: 2rem 1.25rem;
  }

  .landing-title {
    font-size: 1.75rem;
  }

  .landing-subtitle {
    font-size: 0.9375rem;
  }

  .account-info .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  #referralApplySection > div {
    flex-direction: column;
  }

  #referralApplySection .btn {
    width: 100%;
    justify-content: center;
  }
}
