/* =========================================================================
   AsteriaSMP — base design system
   CSS custom properties are populated at runtime from assets/js/config.js
   (see applyTheme() in main.js) so config.js is the single source of truth.
   ========================================================================= */

:root {
  --bg-void: #050311;
  --bg-deep: #0a0620;
  --bg-panel: #120b28;
  --bg-panel-light: #1a1038;
  --border: #2e2358;

  --primary: #9b5cf6;
  --primary-light: #c9a4ff;
  --primary-dark: #6d28d9;
  --accent: #22d3ee;
  --accent-pink: #f472b6;

  --text-primary: #f3edff;
  --text-muted: #b3a3d9;
  --text-faint: #7c6ba3;

  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --gold: #ffd166;

  --font-heading: 'Space Grotesk', 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-glow: 0 0 40px rgba(155, 92, 246, 0.25);
  --header-h: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-heading {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; color: var(--text-muted); }
a { color: var(--primary-light); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.gradient-text {
  background: linear-gradient(120deg, var(--primary-light), var(--accent) 60%, var(--accent-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section {
  position: relative;
  padding: 88px 0;
}
.section-tight { padding: 56px 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

/* ---------------------------------------------------------------------
   Starfield / nebula background — pure CSS, no images required.
   --------------------------------------------------------------------- */
.starfield {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 70% 50% at 20% 0%, rgba(155, 92, 246, 0.22), transparent 60%),
    radial-gradient(ellipse 60% 45% at 85% 15%, rgba(34, 211, 238, 0.14), transparent 60%),
    radial-gradient(ellipse 55% 55% at 50% 100%, rgba(244, 114, 182, 0.10), transparent 65%),
    var(--bg-void);
}
.starfield::before,
.starfield::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: repeat;
  opacity: 0.8;
}
.starfield::before {
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 120px 90px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 220px 40px, #fff, transparent),
    radial-gradient(1px 1px at 300px 150px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 60px 180px, #fff, transparent),
    radial-gradient(1px 1px at 380px 60px, #fff, transparent);
  background-size: 420px 220px;
  animation: driftStars 140s linear infinite;
}
.starfield::after {
  background-image:
    radial-gradient(1px 1px at 40px 120px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 160px 10px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 260px 170px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 340px 90px, rgba(255,255,255,0.6), transparent);
  background-size: 500px 300px;
  animation: driftStars 220s linear infinite reverse;
  opacity: 0.5;
}
@keyframes driftStars {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-420px, -220px, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .starfield::before, .starfield::after { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------------
   Panels / cards
   --------------------------------------------------------------------- */
.panel {
  background: linear-gradient(180deg, var(--bg-panel-light), var(--bg-panel));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  background-color: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover, .card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(155, 92, 246, 0.55);
  box-shadow: var(--shadow-glow);
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  color: #0d0620;
  background: linear-gradient(120deg, var(--primary-light), var(--primary) 60%, var(--accent-pink));
  box-shadow: 0 8px 24px rgba(155, 92, 246, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(155, 92, 246, 0.5); }

.btn-outline {
  color: var(--text-primary);
  background: rgba(255,255,255,0.02);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); }

.btn-sm { padding: 9px 18px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ---------------------------------------------------------------------
   Header / Nav
   --------------------------------------------------------------------- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(5, 3, 17, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(155, 92, 246, 0.15);
}
.nav-wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 19px;
  color: var(--text-primary);
}
.nav-brand img { height: 34px; width: 34px; border-radius: 8px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-links a.active { color: var(--text-primary); background: rgba(155, 92, 246, 0.18); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-primary);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.icon-btn:hover { transform: translateY(-2px) scale(1.05); border-color: var(--accent); background: rgba(34,211,238,0.12); }
.icon-btn svg { width: 19px; height: 19px; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  align-items: center; justify-content: center;
  cursor: pointer;
}

@media (max-width: 940px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: rgba(10, 6, 32, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 10px;
    gap: 2px;
    transform: translateY(-130%);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; }
  .nav-links a { padding: 14px 18px; }
}

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
#site-footer {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(155,92,246,0.05));
  padding: 56px 0 28px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); font-weight: 700; font-size: 18px; margin-bottom: 10px; }
.footer-brand img { height: 30px; width: 30px; border-radius: 8px; }
.footer-col h4 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 14px; }
.footer-col a, .footer-col span { display: block; color: var(--text-muted); font-size: 14.5px; margin-bottom: 10px; transition: color 0.2s ease; }
.footer-col a:hover { color: var(--primary-light); }
.footer-socials { display: flex; gap: 10px; margin-top: 14px; }
.footer-bottom {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--text-faint);
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}

/* ---------------------------------------------------------------------
   Reveal-on-scroll utility (used across pages via main.js IntersectionObserver)
   --------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------------------------------------------------------------------
   Misc utilities
   --------------------------------------------------------------------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.text-center { text-align: center; }
.text-faint { color: var(--text-faint); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }

.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.15);
  color: var(--gold);
  border: 1px solid rgba(255, 209, 102, 0.35);
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-panel) 25%, var(--bg-panel-light) 50%, var(--bg-panel) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
  animation: floatOrb 10s ease-in-out infinite;
}
@keyframes floatOrb {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-24px) scale(1.06); }
}

.divider { height: 1px; background: var(--border); border: none; margin: 40px 0; }

/* ---------------------------------------------------------------------
   Modal (shared: store item info, home gallery lightbox, etc.)
   --------------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(5,3,17,0.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
  position: relative;
  width: 100%; max-width: 460px;
  background: linear-gradient(180deg, var(--bg-panel-light), var(--bg-panel));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.25s ease;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 20px; line-height: 1; cursor: pointer;
}

/* ---------------------------------------------------------------------
   Tabs (category tabs / leaderboard tabs / any pill-style tab group)
   --------------------------------------------------------------------- */
.category-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.category-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.category-tab:hover { transform: translateY(-2px); border-color: var(--primary-light); color: var(--text-primary); }
.category-tab.active {
  color: #0d0620;
  background: linear-gradient(120deg, var(--primary-light), var(--accent));
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(155,92,246,0.35);
}
