/* ==========================================================================
   Fang Tierlist — Core Design System & Global Styles
   Unique Dark Gaming Theme: Deep Obsidian Charcoal + Cyber Neon Cyan & Fang Accents
   ========================================================================== */

:root {
  /* Rich Dark Navy-Black Palette */
  --bg-base: #0a0e17;
  --bg-primary: #0f1422;
  --bg-surface: rgba(20, 27, 45, 0.75);
  --bg-surface-hover: rgba(30, 40, 66, 0.88);
  --bg-card: rgba(22, 29, 48, 0.72);
  --bg-card-hover: rgba(32, 43, 72, 0.88);
  --bg-input: rgba(12, 16, 28, 0.85);
  
  /* ═══════════════════════════════════════════════════
     PRIMARY GRADIENT: Purple → Blue → Cyan (site-wide)
     ═══════════════════════════════════════════════════ */
  --accent-purple: #8b5cf6;
  --accent-indigo: #6366f1;
  --accent-blue: #3b82f6;
  --accent-cyan: #22d3ee;

  /* Gradient values — use these everywhere for consistency */
  --grad-primary: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 50%, #22d3ee 100%);
  --grad-primary-hover: linear-gradient(135deg, #9d75f8 0%, #5193f8 50%, #38e8f7 100%);
  --grad-primary-subtle: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(59, 130, 246, 0.12) 50%, rgba(34, 211, 238, 0.1) 100%);
  --grad-primary-200: 200% auto; /* background-size for shimmer */

  /* ═══════════════════════════════════════════════════
     GOLD GRADIENT: Rank #1, HT1, Achievements
     ═══════════════════════════════════════════════════ */
  --accent-gold: #fbbf24;
  --accent-gold-dark: #f59e0b;
  --grad-gold: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  --gold-glow: rgba(251, 191, 36, 0.4);

  /* Legacy aliases (kept for backward compat) */
  --accent-gradient: var(--grad-primary);
  --accent-gradient-hover: var(--grad-primary-hover);
  --accent-gradient-subtle: var(--grad-primary-subtle);
  --gold-gradient: var(--grad-gold);

  /* Borders & Glassmorphism */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(139, 92, 246, 0.25);
  --border-focus: #8b5cf6;
  --border-glow: rgba(139, 92, 246, 0.45);

  /* Brand Glowing Shadows */
  --fang-glow: rgba(139, 92, 246, 0.35);
  --fang-blue: #3b82f6;
  --fang-purple: #8b5cf6;
  --glow-primary: 0 0 30px rgba(139, 92, 246, 0.4), 0 0 60px rgba(34, 211, 238, 0.15);
  --glow-gold: 0 0 24px rgba(251, 191, 36, 0.45);

  /* Tier Accent Colors */
  --tier-ht1: #fbbf24;
  --tier-ht1-glow: rgba(251, 191, 36, 0.35);
  --tier-lt1: #f59e0b;
  --tier-ht2: #a78bfa;
  --tier-ht2-glow: rgba(167, 139, 250, 0.3);
  --tier-lt2: #8b5cf6;
  --tier-ht3: #60a5fa;
  --tier-ht3-glow: rgba(96, 165, 250, 0.25);
  --tier-lt3: #3b82f6;
  --tier-ht4: #94a3b8;
  --tier-ht4-glow: rgba(148, 163, 184, 0.2);
  --tier-lt4: #64748b;
  --tier-ht5: #64748b;
  --tier-lt5: #475569;
  --tier-unr: #475569;

  /* Text Colors */
  --text-white: #ffffff;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #a78bfa;

  /* ═══════════════════════════════════════════════════
     TYPOGRAPHY — Space Grotesk (headings) + Inter (body)
     ═══════════════════════════════════════════════════ */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-gaming: 'Space Grotesk', 'Sora', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;

  /* Type Scale */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.5rem;    /* 40px */
  --text-5xl: 3rem;      /* 48px */
  --text-6xl: clamp(2.75rem, 6vw, 4rem); /* 44-64px fluid */

  /* Shadows & Glass */
  --glass-bg: rgba(20, 27, 45, 0.75);
  --glass-border: rgba(139, 92, 246, 0.2);
  --glass-blur: blur(14px);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 22px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.65);
  --shadow-gradient: 0 0 28px rgba(139, 92, 246, 0.3);

  /* Layout */
  --max-width: 1320px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Atmosphere: Rich Dark Navy-Black Radial Mesh with Violet-Blue Aura */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    radial-gradient(circle at 18% 12%, rgba(139, 92, 246, 0.09) 0%, transparent 45%),
    radial-gradient(circle at 82% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #0a0e17 0%, #0d121f 50%, #0a0e17 100%);
  pointer-events: none;
  z-index: 0;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* Links & Typography Helpers */
a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  transition: var(--transition);
}

input, select, textarea {
  font-family: inherit;
  outline: none;
}

/* ==========================================================================
   Header & Navigation (Glassmorphism + Modern Gradient Highlights)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(10, 14, 23, 0.88);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  z-index: 90;
  padding: 0.95rem 0;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  min-width: fit-content;
  text-decoration: none;
}

.brand-img {
  height: 42px;
  width: auto;
  max-width: 250px;
  object-fit: contain;
  filter: drop-shadow(0 2px 12px rgba(139, 92, 246, 0.35));
  transition: var(--transition);
  flex-shrink: 0;
}

.brand-logo:hover .brand-img {
  transform: translateY(-1px) scale(1.02);
  filter: drop-shadow(0 0 18px rgba(139, 92, 246, 0.6));
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.nav-link:hover {
  color: var(--text-white);
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-1px);
}

.nav-link.active {
  color: #ffffff;
  background: var(--accent-gradient);
  border: 1px solid rgba(139, 92, 246, 0.5);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

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

.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  color: #ffffff;
  background: rgba(22, 29, 48, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 8px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  backdrop-filter: var(--glass-blur);
}

.admin-btn:hover {
  background: rgba(32, 42, 70, 0.95);
  border-color: #8b5cf6;
  color: #a78bfa;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
  transform: translateY(-2px) scale(1.02);
}

.admin-icon {
  width: 16px;
  height: 16px;
}

.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  color: #ffffff;
  background: linear-gradient(135deg, #5865F2 0%, #4752c4 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.4);
  white-space: nowrap;
}

.discord-btn:hover {
  background: linear-gradient(135deg, #6774ff 0%, #5865F2 100%);
  border-color: #ffffff;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.6);
}

.discord-icon {
  width: 18px;
  height: 18px;
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.mobile-toggle:hover,
.mobile-toggle:active {
  background: rgba(139, 92, 246, 0.12);
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile Drawer */
.mobile-drawer {
  display: none;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-medium);
  padding: 1rem 1.5rem;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-drawer.open {
  display: flex;
}

.mobile-nav-link {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
}

.mobile-nav-link.active, .mobile-nav-link:hover {
  color: #ffffff;
  background: var(--accent-gradient);
}

/* ==========================================================================
   Main Content Layout (Seamless transition below navbar)
   ========================================================================== */
.main-content {
  flex: 1;
  padding: 2.25rem 0 4rem;
  position: relative;
  z-index: 1;
}

.page-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 1.25rem;
  color: var(--text-secondary);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(0, 240, 255, 0.15);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  background: #090d16;
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  position: relative;
  z-index: 10;
}

.footer-container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  padding-bottom: 3rem;
}

.footer-logo {
  height: 38px;
  margin-bottom: 1rem;
}

.footer-desc {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.footer-server-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
}

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

.footer-server-copy code {
  color: var(--accent-cyan);
  font-family: monospace;
  font-weight: 700;
}

.copy-ip-btn {
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.25);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.copy-ip-btn:hover {
  background: var(--accent-cyan);
  color: #080b11;
}

.footer-heading {
  color: var(--text-white);
  font-family: var(--font-gaming);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a:hover {
  color: var(--accent-cyan);
  padding-left: 4px;
}

.footer-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.footer-discord-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #5865F2;
  color: #ffffff;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.3);
}

.footer-discord-cta:hover {
  background: #4752c4;
  transform: translateY(-2px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.5rem 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-bottom-links a:hover {
  color: var(--text-white);
}

.sep {
  color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-white);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-width: 380px;
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

.toast.info {
  border-left: 4px solid var(--accent-cyan);
}

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

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* ==========================================================================
   Responsive Breakpoints — Mobile-First Comprehensive
   ========================================================================== */

/* ── Tablet ≤ 1024px ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

/* ── Mobile ≤ 768px ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Viewport safety */
  html, body { overflow-x: hidden; }

  /* --- Navbar --- */
  .desktop-nav { display: none; }

  .mobile-toggle {
    display: flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  /* Discord button: hide text, keep icon */
  .discord-btn span { display: none; }
  .discord-btn {
    padding: 0.55rem 0.75rem;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  /* Admin button: hide text on mobile */
  .admin-btn span#admin-btn-text { display: none; }
  .admin-btn {
    padding: 0.55rem 0.75rem;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  /* Mobile drawer full-width */
  .mobile-drawer {
    padding: 1rem;
    gap: 0.4rem;
  }

  .mobile-nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    padding: 0.8rem 1rem;
  }

  /* --- Typography scale down --- */
  .hero-title {
    font-size: clamp(1.9rem, 9vw, 2.8rem);
    letter-spacing: -0.5px;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    letter-spacing: 0.2px;
    padding: 0 0.5rem;
  }

  /* --- Footer --- */
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  /* --- Toast — smaller on mobile --- */
  .toast-container {
    bottom: 1rem;
    right: 0.75rem;
    left: 0.75rem;
  }

  .toast {
    max-width: 100%;
  }

  /* --- Main content padding --- */
  .main-content {
    padding: 1.5rem 0 3rem;
  }
}

/* ── Small Mobile ≤ 480px ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .container { padding: 0 1rem; }

  .hero-title {
    font-size: clamp(1.6rem, 8vw, 2.2rem);
  }

  .hero-subtitle {
    font-size: 0.88rem;
  }

  .page-hero {
    padding: 1rem 0 0.75rem;
    margin-bottom: 2rem;
  }
}

