/* Theme tokens */
:root {
  --theme-red: #b91c1c;
  --theme-red-soft: #ef4444;
  --theme-gold: #f59e0b;
  --theme-gold-soft: #fbbf24;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
}

body {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 12% -5%, rgba(245,158,11,0.18), transparent 60%),
    radial-gradient(1000px 620px at 88% 0%, rgba(185,28,28,0.22), transparent 64%),
    #0c0c0f;
  color: #fff;
  font-family: 'Inter', sans-serif;
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background:
    radial-gradient(42% 34% at 18% 78%, rgba(185,28,28,0.24), transparent 72%),
    radial-gradient(38% 36% at 82% 24%, rgba(245,158,11,0.18), transparent 74%),
    radial-gradient(30% 26% at 52% 52%, rgba(239,68,68,0.12), transparent 76%);
  filter: blur(28px);
  opacity: 0.9;
  animation: background-aurora 18s ease-in-out infinite alternate;
}

body::after {
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.26;
  transform-origin: center;
  animation: background-grid-drift 26s linear infinite;
}

.bg-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-stars .star {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff 0%, rgba(255,245,214,0.95) 55%, rgba(255,255,255,0) 100%);
  opacity: 0.18;
  filter: drop-shadow(0 0 6px rgba(251,191,36,0.35));
  will-change: transform, opacity;
  animation:
    star-drift var(--drift-dur) ease-in-out infinite alternate,
    star-twinkle var(--dur) ease-in-out infinite;
  animation-delay: var(--drift-delay), var(--delay);
}

.hero,
.servers-section,
footer {
  position: relative;
  z-index: 1;
}

a { color: inherit; text-decoration: none; }

.hero {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(1rem, 2.8vh, 2rem) 1.5rem clamp(0.6rem, 1.5vh, 1rem);
  gap: 0.45rem;
}

.hero-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.hero-community-logo {
  display: block;
  max-height: clamp(200px, 36svh, 380px);
  max-width: min(90vw, 720px);
  width: auto;
  object-fit: contain;
  filter: saturate(1.15) contrast(1.08) drop-shadow(0 10px 24px rgba(245,158,11,0.32));
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--theme-gold-soft);
}

.hero h1 {
  font-size: clamp(1.35rem, 3.6vw, 2.2rem);
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
}

.hero p {
  font-size: clamp(0.82rem, 1.7vw, 0.96rem);
  color: rgba(255,255,255,0.45);
  max-width: 520px;
  line-height: 1.45;
  margin-top: 0.15rem;
}

.community-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.community-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(245,158,11,0.35);
  background: rgba(185,28,28,0.28);
  color: #fde68a;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.community-link-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(251,191,36,0.7);
  background: rgba(185,28,28,0.42);
}

.community-site-link {
  background: linear-gradient(135deg, rgba(245,158,11,0.3), rgba(185,28,28,0.35));
}

.servers-section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(0.5rem, 1.2vh, 0.9rem) 1.25rem clamp(0.4rem, 1vh, 0.7rem);
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.servers-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  text-align: center;
  margin-bottom: 0.65rem;
}

.servers-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
  align-content: start;
  gap: 0.7rem;
  overflow: auto;
  padding: 0.35rem;
}

.server-card {
  --server-accent: #6b7280;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #141418;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  overflow: visible;
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
  align-self: start;
}

.server-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    0 0 0 1px var(--server-accent),
    0 0 20px var(--server-accent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--server-accent) 45%, transparent),
    0 0 20px color-mix(in srgb, var(--server-accent) 32%, transparent);
  opacity: 0.55;
  animation: card-glow-pulse 2.8s ease-in-out infinite var(--glow-delay, 0ms);
}

.server-card:hover {
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-3px);
}

.server-card:hover::before {
  opacity: 0.9;
}

@keyframes card-glow-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px var(--server-accent),
      0 0 16px var(--server-accent);
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--server-accent) 38%, transparent),
      0 0 16px color-mix(in srgb, var(--server-accent) 26%, transparent);
  }
  50% {
    box-shadow:
      0 0 0 1px var(--server-accent),
      0 0 28px var(--server-accent);
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--server-accent) 68%, transparent),
      0 0 28px color-mix(in srgb, var(--server-accent) 52%, transparent);
  }
}

.server-card-body {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.95rem 1rem 0.75rem;
}

.server-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #1e1e24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.server-info { flex: 1; min-width: 0; }

.server-platform {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  margin-bottom: 0.35rem;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.5);
}

.server-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-desc {
  font-size: 0.76rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.4;
  margin-top: 0.25rem;
}

.server-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.62rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: auto;
}

.server-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
}

.status-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-dot.online { color: #22c55e; }
.status-dot.offline { color: #ef4444; }
.status-dot.coming_soon { color: #f59e0b; }

.server-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.34rem 0.64rem;
  border-radius: 7px;
  background: rgba(185,28,28,0.2);
  color: rgba(255,255,255,0.75);
  transition: background 0.2s, color 0.2s;
  border: none;
  cursor: pointer;
  min-width: 64px;
}

.server-btn.server-btn-discord {
  background: rgba(245,158,11,0.2);
  color: #fcd34d;
}

.server-btn.server-btn-connect {
  background: rgba(185,28,28,0.28);
  color: #fecaca;
}

.server-btn:hover {
  background: rgba(245,158,11,0.3);
  color: #fff7d6;
}

.server-btn.disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

footer {
  text-align: center;
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 0.68rem;
  color: rgba(255,255,255,0.2);
}

@media (max-height: 860px) {
  .hero-community-logo { max-height: clamp(168px, 28svh, 300px); }
}

@media (max-height: 760px) {
  .hero {
    padding-top: 0.75rem;
    padding-bottom: 0.45rem;
    gap: 0.35rem;
  }
  .hero-community-logo { max-height: clamp(144px, 24svh, 260px); }
}

@media (max-height: 680px) {
  .hero-community-logo { max-height: clamp(120px, 20svh, 216px); }
}

@media (max-width: 600px) {
  .hero {
    padding: 0.85rem 0.95rem 0.55rem;
    gap: 0.35rem;
  }
  .hero-community-logo {
    max-height: clamp(140px, 24svh, 240px);
    max-width: min(92vw, 480px);
  }
  .hero h1 { font-size: 1.2rem; }
  .hero p { font-size: 0.78rem; }
  .community-link-btn {
    padding: 0.32rem 0.55rem;
    font-size: 0.62rem;
  }
  .servers-section { padding: 0.4rem 0.7rem 0.45rem; }
  .servers-grid {
    grid-template-columns: 1fr;
    padding: 0.25rem;
  }
}

@keyframes background-aurora {
  0% {
    transform: translate3d(-2%, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(2%, -1%, 0) scale(1.06);
  }
}

@keyframes background-grid-drift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(20px, 14px, 0);
  }
}

@keyframes star-twinkle {
  0%, 100% {
    opacity: 0.1;
  }
  45% {
    opacity: 0.7;
  }
  70% {
    opacity: 0.22;
  }
}

@keyframes star-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(0.85);
  }
  100% {
    transform: translate3d(var(--dx), var(--dy), 0) scale(1.15);
  }
}
