/* ============================================================
   FANFORCE — Premium Dark Luxury UI
   Black × Gold × Silver Glassmorphism
   Single source of truth for all layouts
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ════════════════════════════════════════════════════════════
   DESIGN TOKENS
   ════════════════════════════════════════════════════════════ */
:root {
  /* Core Palette */
  --black-deep:     #050507;
  --black-rich:     #0c0c10;
  --black-card:     #111118;
  --black-glass:    #18181f;
  --black-border:   #252530;

  /* Gold Ramp */
  --gold-bright:    #F5C842;
  --gold-pure:      #D4AF37;
  --gold-mid:       #B8962E;
  --gold-dark:      #7A6020;
  --gold-glow:      rgba(212,175,55,0.25);
  --gold-glow-sm:   rgba(212,175,55,0.12);

  /* Silver Ramp */
  --silver-bright:  #F0F0F4;
  --silver-pure:    #C8C8D0;
  --silver-mid:     #9898A8;
  --silver-dim:     #505060;
  --silver-glow:    rgba(200,200,210,0.10);

  /* Glass layers */
  --glass-1:        rgba(255,255,255,0.03);
  --glass-2:        rgba(255,255,255,0.06);
  --glass-3:        rgba(255,255,255,0.09);
  --glass-border:   rgba(255,255,255,0.08);
  --glass-border-h: rgba(212,175,55,0.35);

  /* Rank Colors */
  --rank-member:    var(--silver-mid);
  --rank-silver:    var(--silver-pure);
  --rank-gold:      var(--gold-pure);
  --rank-platinum:  #A8D8EA;
  --rank-titan:     #FF6B6B;

  /* Typography */
  --font-display:   'Cinzel', serif;
  --font-body:      'DM Sans', sans-serif;

  /* Spacing */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   22px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-gold:    0 0 30px rgba(212,175,55,0.20), 0 0 60px rgba(212,175,55,0.06);
  --shadow-card:    0 8px 32px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.04) inset;
  --shadow-deep:    0 20px 60px rgba(0,0,0,0.8);

  /* Transitions */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ════════════════════════════════════════════════════════════
   RESET & BASE
   ════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--black-deep);
  color: var(--silver-pure);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Subtle noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

/* Ambient radial glow - top */
body::after {
  content: '';
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(212,175,55,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
input, button, select, textarea { font-family: var(--font-body); }

/* ════════════════════════════════════════════════════════════
   KEYFRAME ANIMATIONS
   ════════════════════════════════════════════════════════════ */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

@keyframes goldPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(212,175,55,0.15); }
  50%       { box-shadow: 0 0 40px rgba(212,175,55,0.35), 0 0 80px rgba(212,175,55,0.10); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes rankGlow {
  0%, 100% { text-shadow: 0 0 10px currentColor; }
  50%       { text-shadow: 0 0 25px currentColor, 0 0 50px currentColor; }
}

@keyframes treeNodeIn {
  from { opacity: 0; transform: scale(0.7) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes barFill {
  from { width: 0%; }
}

@keyframes badgePop {
  0%   { transform: scale(0) rotate(-15deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(3deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes floatUp {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-6px); }
}

@keyframes scanLine {
  0%   { top: 0%; }
  100% { top: 100%; }
}

@keyframes glowBorder {
  0%, 100% { border-color: rgba(212,175,55,0.2); }
  50%       { border-color: rgba(212,175,55,0.7); }
}

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

@keyframes orb {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
  33%       { transform: translate(30px, -20px) scale(1.1); opacity: 0.6; }
  66%       { transform: translate(-20px, 10px) scale(0.95); opacity: 0.35; }
}

/* ════════════════════════════════════════════════════════════
   GLASS CARD SYSTEM
   ════════════════════════════════════════════════════════════ */

.glass {
  background: var(--glass-1);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.glass-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.055) 0%, rgba(255,255,255,0.015) 100%);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,0.4), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.glass-card:hover {
  border-color: rgba(212,175,55,0.2);
  box-shadow: var(--shadow-card), var(--shadow-gold);
  transform: translateY(-2px);
}

.glass-card:hover::before { opacity: 1; }

.glass-card-gold {
  background: linear-gradient(135deg, rgba(212,175,55,0.12) 0%, rgba(212,175,55,0.03) 100%);
  border-color: rgba(212,175,55,0.3);
  box-shadow: var(--shadow-card), var(--shadow-gold);
}

/* ════════════════════════════════════════════════════════════
   APP LAYOUT — SIDEBAR
   ════════════════════════════════════════════════════════════ */

.app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ─── Sidebar ─── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0e0e14 0%, #080810 100%);
  border-right: 1px solid var(--black-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.35s var(--ease-out);
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--black-border);
}

.sidebar-logo .logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 3px;
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold-pure) 50%, var(--silver-pure) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.sidebar-logo .logo-sub {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--silver-dim);
  text-transform: uppercase;
  margin-top: 4px;
  display: block;
}

/* Sidebar User Chip */
.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--black-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-mid) 0%, var(--gold-pure) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--black-deep);
  flex-shrink: 0;
  position: relative;
}

.sidebar-avatar::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-pure), transparent);
  z-index: -1;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--silver-bright);
  line-height: 1.2;
}

.sidebar-user-rank {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-pure);
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 9px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--silver-dim);
  padding: 8px 12px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--silver-mid);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  position: relative;
  border: 1px solid transparent;
  margin-bottom: 2px;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--glass-1);
  color: var(--silver-pure);
  border-color: var(--black-border);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(212,175,55,0.15) 0%, rgba(212,175,55,0.04) 100%);
  border-color: rgba(212,175,55,0.25);
  color: var(--gold-pure);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 2px;
  border-radius: 2px;
  background: var(--gold-pure);
  box-shadow: 0 0 8px var(--gold-pure);
}

.nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--glass-1);
  border: 1px solid var(--black-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.nav-item.active .nav-icon {
  background: rgba(212,175,55,0.15);
  border-color: rgba(212,175,55,0.3);
}

.nav-badge {
  margin-left: auto;
  background: var(--gold-pure);
  color: var(--black-deep);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--black-border);
}

.sidebar-footer-pts {
  font-size: 11px;
  color: var(--silver-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-footer-val {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--gold-bright), var(--gold-pure));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 2px;
}

/* ─── Main Content ─── */
.main-content {
  margin-left: 260px;
  flex: 1;
  min-width: 0;
  padding: 28px 32px;
  position: relative;
  z-index: 1;
}

/* ─── Topbar ─── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-heading {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--silver-bright) 0%, var(--silver-pure) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-heading span {
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold-pure) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-sub {
  font-size: 13px;
  color: var(--silver-dim);
  margin-top: 3px;
  letter-spacing: 0.3px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ════════════════════════════════════════════════════════════
   STAT CARDS
   ════════════════════════════════════════════════════════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
  animation: fadeSlideUp 0.5s var(--ease-out) both;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }

.stat-card-orb {
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.15;
  filter: blur(20px);
  animation: orb 6s ease-in-out infinite;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--glass-2);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}

.stat-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--silver-dim);
  font-weight: 600;
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--silver-bright);
  line-height: 1;
  animation: countUp 0.5s var(--ease-out) both;
}

.stat-delta {
  font-size: 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.stat-delta.up   { color: #4ade80; }
.stat-delta.down { color: #f87171; }
.stat-delta.gold { color: var(--gold-pure); }

/* ════════════════════════════════════════════════════════════
   SECTION HEADERS
   ════════════════════════════════════════════════════════════ */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--silver-pure);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 3px;
  height: 14px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-pure));
  border-radius: 2px;
  box-shadow: 0 0 8px var(--gold-glow);
}

.section-action {
  font-size: 12px;
  color: var(--gold-pure);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(212,175,55,0.2);
  transition: all 0.2s;
}

.section-action:hover {
  background: rgba(212,175,55,0.08);
  border-color: rgba(212,175,55,0.4);
}

/* ════════════════════════════════════════════════════════════
   GOLD SHIMMER TEXT
   ════════════════════════════════════════════════════════════ */

.gold-text {
  background: linear-gradient(90deg, var(--gold-pure) 0%, var(--gold-bright) 40%, var(--gold-pure) 60%, var(--silver-pure) 100%);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
}

.silver-text {
  background: linear-gradient(90deg, var(--silver-mid) 0%, var(--silver-bright) 40%, var(--silver-mid) 100%);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}

/* ════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease-out);
  letter-spacing: 0.3px;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold-pure) 100%);
  color: var(--black-deep);
  border-color: var(--gold-bright);
  box-shadow: 0 4px 20px rgba(212,175,55,0.3);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold-mid) 100%);
  box-shadow: 0 6px 28px rgba(212,175,55,0.45);
  transform: translateY(-1px);
}

.btn-glass {
  background: var(--glass-2);
  border-color: var(--glass-border);
  color: var(--silver-pure);
  backdrop-filter: blur(10px);
}

.btn-glass:hover {
  background: var(--glass-3);
  border-color: rgba(212,175,55,0.25);
  color: var(--gold-pure);
}

.btn-outline-gold {
  background: transparent;
  border-color: rgba(212,175,55,0.4);
  color: var(--gold-pure);
}

.btn-outline-gold:hover {
  background: rgba(212,175,55,0.08);
  border-color: var(--gold-pure);
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; letter-spacing: 0.5px; }
.btn-icon { padding: 8px; }

/* ════════════════════════════════════════════════════════════
   RANK BADGES
   ════════════════════════════════════════════════════════════ */

.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: var(--font-display);
}

.rank-member  { background: rgba(152,152,168,0.12); color: var(--silver-mid);   border: 1px solid rgba(152,152,168,0.25); }
.rank-silver  { background: rgba(200,200,208,0.12); color: var(--silver-pure);  border: 1px solid rgba(200,200,208,0.3);  box-shadow: 0 0 12px rgba(200,200,208,0.1); }
.rank-gold    { background: rgba(212,175,55,0.12);  color: var(--gold-pure);    border: 1px solid rgba(212,175,55,0.3);   box-shadow: 0 0 12px var(--gold-glow-sm); animation: rankGlow 3s ease-in-out infinite; }
.rank-platinum { background: rgba(168,216,234,0.12); color: #A8D8EA;            border: 1px solid rgba(168,216,234,0.3);  box-shadow: 0 0 12px rgba(168,216,234,0.15); }
.rank-titan   { background: rgba(255,107,107,0.12); color: #FF8A8A;             border: 1px solid rgba(255,107,107,0.3);  box-shadow: 0 0 12px rgba(255,107,107,0.15); animation: rankGlow 2s ease-in-out infinite; }

/* ════════════════════════════════════════════════════════════
   PROGRESS BARS
   ════════════════════════════════════════════════════════════ */

.progress-wrap { margin-bottom: 12px; }

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.progress-label {
  font-size: 12px;
  color: var(--silver-mid);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.progress-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--silver-pure);
  font-family: var(--font-display);
}

.progress-track {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  position: relative;
  animation: barFill 1.2s var(--ease-out) both;
}

.progress-fill-gold {
  background: linear-gradient(90deg, var(--gold-mid), var(--gold-bright));
  box-shadow: 0 0 10px rgba(212,175,55,0.5);
}

.progress-fill-silver {
  background: linear-gradient(90deg, var(--silver-dim), var(--silver-pure));
  box-shadow: 0 0 8px rgba(200,200,208,0.3);
}

.progress-fill-complete {
  background: linear-gradient(90deg, #22c55e, #4ade80);
  box-shadow: 0 0 8px rgba(74,222,128,0.3);
}

/* Shimmer effect on progress */
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s ease-in-out infinite;
}

/* ════════════════════════════════════════════════════════════
   REFERRAL CODE BLOCK
   ════════════════════════════════════════════════════════════ */

.ref-code-block {
  background: linear-gradient(135deg, rgba(212,175,55,0.08) 0%, rgba(212,175,55,0.02) 100%);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  animation: glowBorder 3s ease-in-out infinite;
}

.ref-code-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--gold-pure);
}

.ref-code-meta {
  font-size: 11px;
  color: var(--silver-dim);
  margin-top: 2px;
  letter-spacing: 0.5px;
}

/* ════════════════════════════════════════════════════════════
   BINARY NETWORK TREE
   ════════════════════════════════════════════════════════════ */

.tree-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.tree-container {
  overflow-x: auto;
  padding: 24px 16px;
  min-height: 360px;
  position: relative;
}

.tree-level {
  display: flex;
  justify-content: center;
  gap: 20px;
  position: relative;
  margin-bottom: 0;
}

.tree-connector-wrap {
  display: flex;
  justify-content: center;
  position: relative;
  height: 40px;
}

.tree-connector-wrap .v-line {
  width: 1px;
  height: 20px;
  background: linear-gradient(180deg, var(--gold-pure), transparent);
  margin: 0 auto;
}

.tree-connector-wrap .h-line {
  position: absolute;
  top: 20px;
  height: 1px;
  background: rgba(212,175,55,0.3);
  left: calc(25% + 10px);
  right: calc(25% + 10px);
}

.tree-connector-wrap .v-line-l,
.tree-connector-wrap .v-line-r {
  position: absolute;
  top: 20px;
  width: 1px;
  height: 20px;
  background: rgba(212,175,55,0.3);
}

.tree-connector-wrap .v-line-l { left: 25%; }
.tree-connector-wrap .v-line-r { right: 25%; }

.tree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: treeNodeIn 0.4s var(--ease-spring) both;
}

.tree-node-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.055) 0%, rgba(255,255,255,0.015) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-align: center;
  min-width: 100px;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  position: relative;
  backdrop-filter: blur(10px);
}

.tree-node-card:hover {
  border-color: rgba(212,175,55,0.4);
  box-shadow: var(--shadow-gold);
  transform: translateY(-3px) scale(1.03);
}

.tree-node-card.root {
  background: linear-gradient(135deg, rgba(212,175,55,0.18) 0%, rgba(212,175,55,0.06) 100%);
  border-color: rgba(212,175,55,0.45);
  box-shadow: var(--shadow-gold);
  animation: goldPulse 3s ease-in-out infinite, treeNodeIn 0.4s var(--ease-spring) both;
}

.tree-node-card.empty {
  border-style: dashed;
  border-color: var(--black-border);
  opacity: 0.5;
}

.tree-node-card.empty:hover {
  border-color: rgba(212,175,55,0.4);
  opacity: 0.9;
}

.tree-node-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold-mid), var(--gold-bright));
  color: var(--black-deep);
}

.tree-node-card.root .tree-node-avatar {
  animation: floatUp 3s ease-in-out infinite;
}

.tree-node-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--silver-pure);
  white-space: nowrap;
}

.tree-node-rank {
  font-size: 9px;
  color: var(--silver-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}

.tree-leg-label {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-top: 6px;
  font-weight: 700;
}

/* ════════════════════════════════════════════════════════════
   LEADERBOARD
   ════════════════════════════════════════════════════════════ */

.lb-filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--glass-1);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-md);
  width: fit-content;
}

.lb-tab {
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--silver-dim);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  letter-spacing: 0.5px;
}

.lb-tab.active {
  background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(212,175,55,0.05));
  border-color: rgba(212,175,55,0.3);
  color: var(--gold-pure);
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  transition: all 0.2s var(--ease-out);
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 4px;
}

.lb-row:hover {
  background: var(--glass-1);
  border-color: var(--glass-border);
}

.lb-row.top-3 {
  background: linear-gradient(135deg, rgba(212,175,55,0.07) 0%, rgba(212,175,55,0.02) 100%);
  border-color: rgba(212,175,55,0.12);
}

.lb-pos {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  width: 32px;
  text-align: center;
  color: var(--silver-dim);
}

.lb-pos.pos-1 { color: var(--gold-bright); text-shadow: 0 0 15px rgba(245,200,66,0.6); }
.lb-pos.pos-2 { color: var(--silver-pure); text-shadow: 0 0 10px rgba(200,200,208,0.4); }
.lb-pos.pos-3 { color: #CD7F32; text-shadow: 0 0 10px rgba(205,127,50,0.4); }

.lb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
}

.lb-info { flex: 1; min-width: 0; }

.lb-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--silver-pure);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-meta {
  font-size: 11px;
  color: var(--silver-dim);
  margin-top: 1px;
}

.lb-pts-wrap { text-align: right; }

.lb-pts {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-pure);
}

.lb-pts-label {
  font-size: 9px;
  color: var(--silver-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ════════════════════════════════════════════════════════════
   MISSION CARDS
   ════════════════════════════════════════════════════════════ */

.mission-card {
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  animation: fadeSlideUp 0.4s var(--ease-out) both;
}

.mission-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  border: 1px solid var(--glass-border);
  transition: all 0.2s;
}

.mission-card:hover .mission-icon {
  transform: scale(1.1) rotate(5deg);
  border-color: rgba(212,175,55,0.3);
}

.mission-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--silver-pure);
  margin-bottom: 3px;
}

.mission-desc {
  font-size: 11px;
  color: var(--silver-dim);
  line-height: 1.5;
  margin-bottom: 8px;
}

.mission-pts {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-pure);
  letter-spacing: 0.5px;
}

.mission-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.status-pending  { background: rgba(212,175,55,0.12); color: var(--gold-pure); border: 1px solid rgba(212,175,55,0.2); }
.status-done     { background: rgba(74,222,128,0.10); color: #4ade80;          border: 1px solid rgba(74,222,128,0.2); }
.status-new      { background: rgba(168,216,234,0.10); color: #A8D8EA;         border: 1px solid rgba(168,216,234,0.2); }
.status-progress { background: rgba(251,146,60,0.10); color: #fb923c;          border: 1px solid rgba(251,146,60,0.2); }

/* ════════════════════════════════════════════════════════════
   CAMPAIGN CARDS
   ════════════════════════════════════════════════════════════ */

.campaign-card {
  padding: 18px;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  animation: fadeSlideUp 0.4s var(--ease-out) both;
  position: relative;
  overflow: hidden;
}

.campaign-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-pure), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.campaign-card:hover::after { opacity: 1; }

.campaign-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 10px;
}

.campaign-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--silver-bright);
  letter-spacing: 0.2px;
}

.campaign-desc {
  font-size: 12px;
  color: var(--silver-mid);
  line-height: 1.6;
  margin-bottom: 12px;
}

.campaign-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.campaign-stat {
  font-size: 11px;
  color: var(--silver-dim);
  display: flex;
  align-items: center;
  gap: 5px;
}

.campaign-stat-val { color: var(--silver-pure); font-weight: 600; }

/* ════════════════════════════════════════════════════════════
   BADGE DISPLAY
   ════════════════════════════════════════════════════════════ */

.badges-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.badge-item {
  text-align: center;
  padding: 14px 8px;
  border-radius: var(--radius-md);
  background: var(--glass-1);
  border: 1px solid var(--black-border);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.badge-item:hover {
  border-color: rgba(212,175,55,0.3);
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
}

.badge-item.unlocked {
  animation: badgePop 0.5s var(--ease-spring) both;
}

.badge-item.locked {
  opacity: 0.3;
  filter: grayscale(1);
}

.badge-icon {
  font-size: 26px;
  display: block;
  margin: 0 auto 8px;
  animation: floatUp 4s ease-in-out infinite;
}

.badge-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--silver-dim);
}

.badge-item.unlocked .badge-name { color: var(--gold-pure); }

/* ════════════════════════════════════════════════════════════
   FORMS & INPUTS
   ════════════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--silver-mid);
  margin-bottom: 7px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-md);
  color: var(--silver-pure);
  font-family: var(--font-body);
  font-size: 13px;
  transition: all 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: rgba(212,175,55,0.5);
  background: rgba(212,175,55,0.04);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.1);
}

.form-input::placeholder { color: var(--silver-dim); }

.form-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'%3E%3Cpath fill='%23808090' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ════════════════════════════════════════════════════════════
   TABLE STYLES
   ════════════════════════════════════════════════════════════ */

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--silver-dim);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--black-border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--silver-pure);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  transition: all 0.15s;
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: rgba(255,255,255,0.025);
}

/* ════════════════════════════════════════════════════════════
   LOGIN PAGE
   ════════════════════════════════════════════════════════════ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.login-bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orb 8s ease-in-out infinite;
}

.login-orb-1 {
  width: 400px; height: 400px;
  top: -100px; left: -100px;
  background: radial-gradient(circle, rgba(212,175,55,0.15), transparent 70%);
}

.login-orb-2 {
  width: 300px; height: 300px;
  bottom: -80px; right: -80px;
  background: radial-gradient(circle, rgba(200,200,208,0.08), transparent 70%);
  animation-delay: -3s;
}

.login-card {
    backdrop-filter: blur(20px);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 40px;
    width: 380px;
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo-text {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 6px;
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold-pure) 50%, var(--silver-pure) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.login-logo-sub {
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--silver-dim);
  text-transform: uppercase;
  margin-top: 6px;
  display: block;
}

.login-heading {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--silver-pure);
  margin-bottom: 6px;
  text-align: center;
}

.login-sub {
  font-size: 13px;
  color: var(--silver-dim);
  text-align: center;
  margin-bottom: 28px;
}

.login-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
  margin: 24px 0;
}

/* ════════════════════════════════════════════════════════════
   ADMIN PANEL EXTRAS
   ════════════════════════════════════════════════════════════ */

.admin-topbar {
  background: linear-gradient(90deg, rgba(212,175,55,0.08) 0%, transparent 100%);
  border-bottom: 1px solid rgba(212,175,55,0.15);
  padding: 10px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--black-deep);
  background: linear-gradient(90deg, var(--gold-bright), var(--gold-pure));
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74,222,128,0.6);
  display: inline-block;
  animation: goldPulse 1.5s ease-in-out infinite;
}

/* ════════════════════════════════════════════════════════════
   PROFILE PAGE
   ════════════════════════════════════════════════════════════ */

.profile-hero {
  position: relative;
  margin-bottom: 24px;
}

.profile-cover {
  height: 120px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(135deg, rgba(212,175,55,0.2) 0%, rgba(212,175,55,0.05) 40%, rgba(200,200,208,0.08) 100%);
  border: 1px solid rgba(212,175,55,0.15);
  border-bottom: none;
  position: relative;
  overflow: hidden;
}

.profile-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 20px,
    rgba(212,175,55,0.03) 20px,
    rgba(212,175,55,0.03) 21px
  );
}

.profile-avatar-wrap {
  position: absolute;
  bottom: -24px;
  left: 24px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--black-rich);
  background: linear-gradient(135deg, var(--gold-mid) 0%, var(--gold-bright) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--black-deep);
  box-shadow: 0 0 20px rgba(212,175,55,0.3);
}

.profile-body {
  background: var(--glass-1);
  border: 1px solid var(--glass-border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 36px 24px 20px;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--silver-bright);
  letter-spacing: 0.5px;
}

.profile-username {
  font-size: 13px;
  color: var(--silver-dim);
  margin-top: 2px;
}

/* ════════════════════════════════════════════════════════════
   NOTIFICATION POPUP (Badge unlock)
   ════════════════════════════════════════════════════════════ */

.badge-popup {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(212,175,55,0.2) 0%, rgba(212,175,55,0.05) 100%);
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  box-shadow: var(--shadow-gold), var(--shadow-deep);
  animation: fadeSlideUp 0.5s var(--ease-spring) both;
}

.badge-popup-icon { font-size: 28px; animation: floatUp 2s ease-in-out infinite; }

.badge-popup-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-pure);
  margin-bottom: 2px;
}

.badge-popup-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--silver-bright);
}

/* ════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ════════════════════════════════════════════════════════════ */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.flex   { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.p-16   { padding: 16px; }
.p-20   { padding: 20px; }
.w-full { width: 100%; }
.text-gold   { color: var(--gold-pure); }
.text-silver { color: var(--silver-pure); }
.text-muted  { color: var(--silver-dim); }
.text-sm  { font-size: 12px; }
.text-xs  { font-size: 11px; }
.font-display { font-family: var(--font-display); }
.font-bold { font-weight: 700; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.divider { height: 1px; background: var(--black-border); margin: 16px 0; }
.hidden { display: none !important; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Stagger animation helpers */
.anim-1 { animation-delay: 0.05s; }
.anim-2 { animation-delay: 0.10s; }
.anim-3 { animation-delay: 0.15s; }
.anim-4 { animation-delay: 0.20s; }
.anim-5 { animation-delay: 0.25s; }

/* ════════════════════════════════════════════════════════════
   SCROLLBAR
   ════════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--silver-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .main-content { padding: 20px; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .badges-grid { grid-template-columns: repeat(3, 1fr); }
  .login-card { width: 100%; margin: 16px; padding: 32px 24px; }
}
