:root {
  --bg: #07111f;
  --bg-soft: rgba(15, 23, 42, 0.9);
  --panel: rgba(15, 23, 42, 0.8);
  --panel-alt: rgba(15, 23, 42, 0.6);
  --line: rgba(148, 163, 184, 0.18);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.15);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.12);
  --yellow: #fbbf24;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --shadow-soft: 0 20px 45px rgba(2, 6, 23, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.24), transparent 30%),
    radial-gradient(circle at bottom right, rgba(34, 211, 238, 0.18), transparent 25%),
    linear-gradient(180deg, #0b1220 0%, var(--bg) 45%, #020817 100%);
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  opacity: 0.45;
  pointer-events: none;
}

body::before {
  top: -120px;
  left: -60px;
  background: rgba(139, 92, 246, 0.35);
  animation: floatGlow 14s ease-in-out infinite alternate;
}

body::after {
  right: -80px;
  bottom: -80px;
  background: rgba(34, 211, 238, 0.25);
  animation: floatGlow 16s ease-in-out infinite alternate-reverse;
}

img {
  max-width: 100%;
  display: block;
}

.app-shell,
.auth-shell {
  position: relative;
  z-index: 1;
}

.app-shell {
  max-width: 1270px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
  animation: fadeInUp 0.5s ease both;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.8rem);
  letter-spacing: -0.04em;
}

.login-btn,
.logout-btn,
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  text-decoration: none;
  color: white;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.login-btn,
.primary-btn {
  background: linear-gradient(135deg, #5865f2, #8b5cf6);
  box-shadow: 0 12px 26px rgba(88, 101, 242, 0.35);
}

.login-btn:hover,
.logout-btn:hover,
.primary-btn:hover,
.discord-login-btn:hover {
  transform: translateY(-2px);
}

.logout-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.user-pill img,
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.4);
}

.avatar.fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  color: white;
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  position: relative;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.72);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, border-color 0.25s ease;
  animation: fadeInUp 0.6s ease both;
}

.stat-card:hover,
.member-card:hover {
  transform: translateY(-4px);
  border-color: rgba(168, 85, 247, 0.5);
}

.stat-card.accent {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.12), rgba(15, 23, 42, 0.78));
  border-color: rgba(52, 211, 153, 0.35);
}

.stat-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card strong {
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 800;
}

.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.member-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.72));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  animation: fadeInUp 0.7s ease both;
}

.member-card.online {
  border-color: rgba(52, 211, 153, 0.5);
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.08), rgba(15, 23, 42, 0.82));
}

.member-card.offline {
  border-color: rgba(148, 163, 184, 0.2);
}

.member-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--green), var(--accent-2));
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.45);
}

.member-card.offline::before {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.8), rgba(148, 163, 184, 0.4));
  box-shadow: none;
}

.member-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.member-head h2 {
  margin: 0;
  font-size: 1.08rem;
}

.member-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--text);
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.9);
  animation: pulse 2s infinite;
}

.member-card.offline .status-dot {
  background: var(--muted);
  box-shadow: none;
  animation: none;
}

.time-box {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.time-box small {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.time-box strong {
  font-size: 1.4rem;
}

.welcome {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.welcome-box {
  max-width: 620px;
  text-align: center;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 36px 28px;
  box-shadow: var(--shadow-soft);
  animation: fadeInUp 0.6s ease both;
}

.welcome-box h2 {
  margin-top: 0;
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.welcome-box p {
  color: var(--muted);
  margin-bottom: 24px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(420px, 100%);
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px 24px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(12px);
  animation: fadeInUp 0.7s ease both;
}

.auth-card h1 {
  margin-bottom: 8px;
}

.auth-card p {
  color: var(--muted);
  margin-bottom: 20px;
}

.auth-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-card input {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-card input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.8);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.auth-card button,
.discord-login-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #5865f2, #8b5cf6);
  color: white;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(88, 101, 242, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-card button:hover,
.discord-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(88, 101, 242, 0.42);
}

.auth-error {
  background: rgba(239, 68, 68, 0.09);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 18px;
}

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

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes floatGlow {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(32px, -20px, 0) scale(1.08);
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-pill {
    width: 100%;
    justify-content: space-between;
  }

  .stats {
    grid-template-columns: 1fr;
  }
}
