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

:root {
  --bg:        #08080f;
  --surface:   #10101e;
  --surface2:  #181828;
  --border:    #2a2a45;
  --purple:    #9443ef;
  --purple2:   #c75bf9;
  --cyan:      #00c9e4;
  --text:      #dde0f0;
  --muted:     #6b6e8a;
  --steam:     #1a9fff;
  --discord:   #5865f2;
  --success:   #3ddc84;
  --error:     #ff5b5b;
  --radius:    12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── Stars ─────────────────────────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 10%, rgba(255,255,255,.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 80%, rgba(255,255,255,.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 35%, rgba(255,255,255,.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 20% 90%, rgba(255,255,255,.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 50%, rgba(255,255,255,.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 70%, rgba(255,255,255,.5) 0%, transparent 100%),
    radial-gradient(2px 2px at 75% 15%, rgba(148,67,239,.8) 0%, transparent 100%),
    radial-gradient(2px 2px at 25% 75%, rgba(0,201,228,.6) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Layout ────────────────────────────────────────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* ─── Branding ──────────────────────────────────────────────────────────────── */
.logo-lunar {
  background: linear-gradient(135deg, #9443ef, #c75bf9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-rust { color: #ffffff; }

/* ─── Nav ───────────────────────────────────────────────────────────────────── */
nav {
  border-bottom: 1px solid var(--border);
  background: rgba(8,8,15,.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.nav-logo-img { width: 36px; height: 36px; object-fit: contain; }

nav ul { list-style: none; display: flex; gap: 1.5rem; align-items: center; }

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  transition: color .2s;
}
nav a:hover  { color: var(--text); }
nav a.active { color: var(--purple); }

nav a.nav-discord {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: #fff;
  background: var(--discord);
  padding: .35rem .85rem;
  border-radius: 6px;
  font-weight: 600;
  transition: opacity .2s;
}
nav a.nav-discord:hover { opacity: .85; color: #fff; }

/* ─── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
  min-height: calc(90vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1rem;
}

.hero .container { width: 100%; }

.hero-logo {
  display: block;
  width: 110px;
  height: 110px;
  object-fit: contain;
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 0 28px rgba(148,67,239,.7));
}

.hero-badge {
  display: inline-block;
  background: rgba(148,67,239,.15);
  border: 1px solid rgba(148,67,239,.35);
  color: var(--purple2);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .3rem .9rem;
  border-radius: 99px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.hero h1 .h1-lunar {
  background: linear-gradient(135deg, #9443ef, #c75bf9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h1 .h1-rust { color: #ffffff; }

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); opacity: .9; }

.btn-primary {
  background: linear-gradient(135deg, #9443ef, #c75bf9);
  color: #fff;
  box-shadow: 0 4px 24px rgba(148,67,239,.4);
}
.btn-primary:hover { box-shadow: 0 6px 30px rgba(148,67,239,.6); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--purple); color: var(--purple2); }

.btn-steam {
  background: var(--steam);
  color: #fff;
  box-shadow: 0 4px 20px rgba(26,159,255,.3);
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: .9rem 1.75rem;
}
.btn-steam:hover { box-shadow: 0 6px 28px rgba(26,159,255,.5); }

.btn-discord {
  background: var(--discord);
  color: #fff;
  box-shadow: 0 4px 20px rgba(88,101,242,.3);
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: .9rem 1.75rem;
}
.btn-discord:hover { box-shadow: 0 6px 28px rgba(88,101,242,.5); }

.btn-discord-hero {
  background: var(--discord);
  color: #fff;
  box-shadow: 0 4px 20px rgba(88,101,242,.3);
}
.btn-discord-hero:hover { box-shadow: 0 6px 28px rgba(88,101,242,.5); }

.btn-play {
  background: linear-gradient(135deg, #9443ef, #c75bf9);
  color: #fff;
  box-shadow: 0 4px 20px rgba(148,67,239,.35);
  white-space: nowrap;
}
.btn-play:hover { box-shadow: 0 6px 28px rgba(148,67,239,.55); }

.btn-danger {
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
  font-size: .85rem;
  padding: .5rem 1.2rem;
}
.btn-danger:hover { background: rgba(255,91,91,.1); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ─── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 3rem 0;
}

.card-icon { font-size: 1.75rem; margin-bottom: .75rem; }
.card h3   { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.card p    { font-size: .875rem; color: var(--muted); }

/* ─── Server Cards (homepage) ───────────────────────────────────────────────── */
.servers { padding: 3rem 0; border-top: 1px solid var(--border); }
.servers h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.25rem; text-align: center; }

.server-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.server-info h3 { font-size: 1.05rem; font-weight: 700; }
.server-info p  { font-size: .85rem; color: var(--muted); margin-top: .2rem; }

.server-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.server-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  font-weight: 600;
  padding: .25rem .7rem;
  border-radius: 99px;
}

.server-badge.online {
  background: rgba(61,220,132,.1);
  border: 1px solid rgba(61,220,132,.3);
  color: var(--success);
}
.server-badge.offline {
  background: rgba(255,91,91,.1);
  border: 1px solid rgba(255,91,91,.3);
  color: var(--error);
}

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ─── Servers Page ──────────────────────────────────────────────────────────── */
.servers-page { padding: 4rem 0; min-height: calc(100vh - 64px); }
.servers-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: .5rem;
}
.servers-page > .container > p { color: var(--muted); margin-bottom: 2.5rem; }

.server-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.server-detail-header {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.server-detail-title h2 {
  font-size: 1.25rem;
  font-weight: 800;
}
.server-detail-title p {
  font-size: .85rem;
  color: var(--muted);
  margin-top: .2rem;
}

.server-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0;
}

.stat-block {
  padding: 1.25rem 1.75rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat-block:last-child { border-right: none; }

.stat-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: .35rem;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.stat-value.online-text  { color: var(--success); }
.stat-value.offline-text { color: var(--error); }

.server-detail-footer {
  padding: 1.25rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.server-address {
  font-family: monospace;
  font-size: .875rem;
  color: var(--muted);
  background: var(--surface2);
  padding: .4rem .75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ─── Link Page ─────────────────────────────────────────────────────────────── */
.link-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.link-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 480px;
}

.link-card h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: .5rem; }
.link-card > p { color: var(--muted); font-size: .9rem; margin-bottom: 2rem; }

.steps { display: flex; align-items: center; margin-bottom: 2rem; }
.step  { display: flex; flex-direction: column; align-items: center; gap: .3rem; flex: 1; }

.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  border: 2px solid var(--border);
  color: var(--muted);
  background: var(--surface2);
  transition: all .3s;
}
.step.active .step-circle { border-color: var(--purple); color: var(--purple); background: rgba(148,67,239,.1); }
.step.done   .step-circle { border-color: var(--success); color: var(--success); background: rgba(61,220,132,.1); }
.step span { font-size: .72rem; color: var(--muted); }
.step.active span { color: var(--purple); }
.step.done   span { color: var(--success); }

.step-line { flex: 1; height: 2px; background: var(--border); margin-bottom: 1.2rem; transition: background .3s; }
.step-line.done { background: var(--success); }

.account-display {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .85rem 1rem;
  margin-bottom: 1.25rem;
}
.account-display img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--border); }
.account-display .acc-info { flex: 1; }
.account-display .acc-name { font-weight: 700; font-size: .95rem; }
.account-display .acc-sub  { font-size: .78rem; color: var(--muted); }
.account-display .acc-check { color: var(--success); font-size: 1.1rem; }

.alert { border-radius: 8px; padding: .75rem 1rem; font-size: .875rem; margin-bottom: 1.25rem; border: 1px solid transparent; }
.alert-success { background: rgba(61,220,132,.1); border-color: rgba(61,220,132,.3); color: var(--success); }
.alert-error   { background: rgba(255,91,91,.1);  border-color: rgba(255,91,91,.3);  color: var(--error); }

.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.unlink-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .82rem;
  color: var(--muted);
}

.booster-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: rgba(255,115,250,.1);
  border: 1px solid rgba(255,115,250,.3);
  color: #ff73fa;
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 99px;
  margin-top: .4rem;
}

/* ─── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1rem;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
}

.modal h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: .75rem; color: var(--error); }
.modal p  { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; line-height: 1.6; }

.modal-actions {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
}

/* ─── Footer ────────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  position: relative;
  z-index: 1;
}

.staff-login-link {
  display: inline-block;
  margin-top: .6rem;
  color: var(--muted);
  font-size: .75rem;
  text-decoration: none;
  opacity: .5;
  transition: opacity .15s;
}
.staff-login-link:hover { opacity: 1; }

/* ─── Spinner ────────────────────────────────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
