/* ===== NAVIGATION ===== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--fg);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--fg); }

.btn-accent-sm {
  padding: 8px 20px;
  background: var(--accent);
  color: #0a0a0f;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn-accent-sm:hover { opacity: 0.85; }

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  transition: border-color 0.2s, color 0.2s;
}

.btn-ghost:hover { border-color: var(--fg-muted); color: var(--fg); }

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 60px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
}

.auth-header { margin-bottom: 32px; }

.auth-title {
  font-family: 'Syne', sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 12px;
}

.auth-sub {
  font-size: 0.95rem;
  color: var(--fg-muted);
}

.auth-form { display: flex; flex-direction: column; gap: 20px; margin-bottom: 24px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.form-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  padding: 12px 16px;
  transition: border-color 0.2s;
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: rgba(0, 255, 136, 0.4);
}

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

.form-hint {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.alert-error {
  background: rgba(255, 80, 80, 0.1);
  border: 1px solid rgba(255, 80, 80, 0.3);
  border-radius: 10px;
  color: #ff8080;
  font-size: 0.9rem;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.alert-success {
  background: rgba(0, 255, 136, 0.08);
  border: 1px solid rgba(0, 255, 136, 0.25);
  border-radius: 10px;
  color: var(--accent);
  font-size: 0.9rem;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-secondary {
  padding: 12px 24px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
}

.btn-secondary:hover { background: rgba(0, 255, 136, 0.08); }

.btn-ghost-block {
  display: block;
  padding: 12px 24px;
  text-align: center;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 12px;
  transition: border-color 0.2s, color 0.2s;
}

.btn-ghost-block:hover { border-color: var(--fg-muted); color: var(--fg); }

.referral-badge {
  background: rgba(0, 255, 136, 0.06);
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

/* XP preview on register page */
.xp-preview {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.xp-preview-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 12px;
}

.xp-preview-items { display: flex; flex-direction: column; gap: 8px; }

.xp-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.xp-label { color: var(--fg-muted); }
.xp-value { font-weight: 700; }

.auth-footer-link {
  text-align: center;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.auth-footer-link a { color: var(--accent); text-decoration: none; }
.auth-footer-link a:hover { text-decoration: underline; }

/* ===== HERO CTA BUTTONS ===== */
.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 48px;
  flex-wrap: wrap;
}

.btn-hero-primary {
  padding: 16px 36px;
  background: var(--accent);
  color: #0a0a0f;
  border-radius: 100px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
  display: inline-block;
}

.btn-hero-primary:hover { opacity: 0.88; transform: translateY(-2px); }

.btn-hero-ghost {
  padding: 16px 36px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--fg);
  border-radius: 100px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s;
  display: inline-block;
}

.btn-hero-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ===== PROFILE PAGE ===== */
.profile-page {
  min-height: 100vh;
  padding: 90px 24px 60px;
}

.profile-container {
  max-width: 880px;
  margin: 0 auto;
}

.xp-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 20px;
}

.xp-banner-left { display: flex; align-items: center; gap: 20px; }

.profile-avatar {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.profile-username {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.profile-joined { font-size: 0.85rem; color: var(--fg-muted); margin-top: 4px; }

.xp-score { text-align: right; }

.xp-number {
  font-family: 'Syne', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

.xp-label-text {
  font-size: 0.8rem;
  letter-spacing: 3px;
  color: var(--fg-muted);
  font-weight: 600;
  margin-top: 4px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
}

.card-section-label {
  font-size: 0.7rem;
  letter-spacing: 3px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
}

.card-body-text { font-size: 0.95rem; color: var(--fg-muted); line-height: 1.6; margin-bottom: 16px; }

.invite-box { display: flex; gap: 8px; margin-bottom: 8px; }

.invite-input { flex: 1; font-size: 0.85rem; }

.btn-copy {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s;
}

.btn-copy:hover { border-color: var(--accent); color: var(--accent); }

/* XP history */
.xp-history { display: flex; flex-direction: column; }

.xp-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  flex-wrap: wrap;
  gap: 8px;
}

.xp-history-item:last-child { border-bottom: none; }

.xp-event-type { color: var(--fg); }

.xp-event-right { display: flex; align-items: center; gap: 12px; }

.xp-event-amount { font-weight: 700; font-size: 0.95rem; }

.xp-event-date { font-size: 0.8rem; color: var(--fg-muted); }

/* ===== LEADERBOARD ===== */
.lb-page {
  min-height: 100vh;
  padding: 90px 24px 80px;
}

.lb-container { max-width: 800px; margin: 0 auto; }

.lb-header { text-align: center; margin-bottom: 60px; }

.lb-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  margin: 16px 0 12px;
}

.lb-sub { font-size: 1rem; color: var(--fg-muted); }

/* Podium */
.lb-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.podium-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  min-width: 160px;
  transition: border-color 0.3s;
}

.podium-card:hover { border-color: rgba(0, 255, 136, 0.2); }

.podium-1 {
  border-color: rgba(0, 255, 136, 0.25);
  transform: translateY(-12px);
  min-width: 190px;
}

.podium-crown { font-size: 1.8rem; margin-bottom: 4px; }

.podium-rank {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--fg-muted);
  margin-bottom: 12px;
}

.podium-avatar {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin: 0 auto 12px;
}

.podium-avatar-gold {
  background: linear-gradient(135deg, #c49a1a, #f0d060);
  box-shadow: 0 0 20px rgba(240, 208, 96, 0.3);
}

.podium-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
}

.podium-name:hover { color: var(--accent); }

.podium-xp { font-size: 0.9rem; font-weight: 700; }

/* Table */
.lb-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}

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

.lb-th {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.lb-th-right { text-align: right; }

.lb-row { border-bottom: 1px solid var(--border); transition: background 0.15s; }
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: rgba(255,255,255,0.02); }
.lb-row-you { background: rgba(0, 255, 136, 0.04) !important; }

.lb-td { padding: 14px 20px; font-size: 0.9rem; }
.lb-td-right { text-align: right; }

.lb-rank { width: 60px; }

.rank-medal { font-size: 1.1rem; }
.rank-num { font-size: 0.85rem; color: var(--fg-muted); font-weight: 600; }

.lb-username {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 500;
}

.lb-username:hover { color: var(--accent); }

.lb-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent));
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.you-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
}

.lb-xp { font-weight: 700; font-size: 1rem; }
.lb-xp-label { font-size: 0.75rem; color: var(--fg-muted); }

.lb-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--fg-muted);
  font-size: 1rem;
}

.lb-empty a { color: var(--accent); text-decoration: none; }

.lb-cta { text-align: center; margin-top: 32px; }

/* ===== MOBILE ===== */
@media (max-width: 640px) {
  .auth-card { padding: 32px 24px; }
  .auth-title { font-size: 2rem; }
  .profile-grid { grid-template-columns: 1fr; }
  .xp-banner { flex-direction: column; align-items: flex-start; }
  .xp-score { text-align: left; }
  .lb-podium { gap: 8px; }
  .podium-card { min-width: 100px; padding: 16px 12px; }
  .podium-1 { min-width: 120px; }
  .nav-links { gap: 12px; }
  .nav-link { display: none; }
}
