/* =========================================================
   Theme
   ========================================================= */
:root {
  --bg: #0f1115;
  --bg-alt: #151820;
  --surface: #1b1f29;
  --surface-hover: #222734;
  --border: #2a3040;
  --text: #e8eaf0;
  --text-muted: #9aa3b5;
  --accent: #5fbf3a;        /* grass green */
  --accent-hover: #6fd348;
  --accent-dark: #3f8a24;
  --danger: #e5484d;
  --warning: #f5b83d;

  --nav-height: 68px;
  --radius: 10px;
  --max-width: 1120px;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* =========================================================
   Base
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(95, 191, 58, 0.12);
  color: var(--accent-hover);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.95em;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-narrow {
  max-width: 780px;
}

.accent {
  color: var(--accent);
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0b1a05;
  box-shadow: 0 4px 0 var(--accent-dark);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--accent-dark);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-lg {
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
}

.btn:focus-visible,
.nav-link:focus-visible,
.nav-brand:focus-visible,
.nav-toggle:focus-visible,
.faq-question:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* =========================================================
   Navbar
   ========================================================= */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-height);
  z-index: 100;
  transition: background-color 0.25s, border-color 0.25s, backdrop-filter 0.25s;
  border-bottom: 1px solid transparent;
}

.navbar.scrolled,
.navbar.menu-open {
  background: rgba(15, 17, 21, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}

.nav-container {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* left | center | right */
  align-items: center;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  justify-self: start;
}

.nav-logo {
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
}

.nav-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  display: block;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s, background-color 0.2s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-link.active {
  color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-self: end;
}

/* Hamburger (mobile only) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 2rem) 1.25rem 4rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(95, 191, 58, 0.18), transparent 60%),
    linear-gradient(180deg, #121722 0%, var(--bg) 100%);
}

/* Subtle pixel grid */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title {
  font-size: clamp(2.25rem, 7vw, 4.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
  margin: 0 0 2.25rem;
  max-width: 560px;
}

/* Server status pill */
.server-status {
  margin-top: 2.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warning);
  flex-shrink: 0;
}

.server-status[data-state="loading"] .status-dot {
  animation: pulse 1.2s ease-in-out infinite;
}

.server-status[data-state="online"] {
  border-color: rgba(95, 191, 58, 0.45);
}
.server-status[data-state="online"] .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(95, 191, 58, 0.6);
  animation: ping 2s ease-out infinite;
}

.server-status[data-state="offline"],
.server-status[data-state="error"] {
  border-color: rgba(229, 72, 77, 0.45);
}
.server-status[data-state="offline"] .status-dot,
.server-status[data-state="error"] .status-dot {
  background: var(--danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(95, 191, 58, 0.6); }
  80%  { box-shadow: 0 0 0 8px rgba(95, 191, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(95, 191, 58, 0); }
}

/* =========================================================
   Sections (shared)
   ========================================================= */
.section {
  padding: 6rem 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 auto;
  max-width: 560px;
}

/* =========================================================
   Connect Method
   ========================================================= */
.connect-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 780px;
  margin: 0 auto;
}

.connect-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}

.connect-card:hover {
  border-color: rgba(95, 191, 58, 0.45);
  transform: translateY(-3px);
}

.connect-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.connect-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: var(--accent);
  color: #0b1a05;
  font-weight: 800;
  font-size: 1rem;
  border-radius: 6px;
  box-shadow: 0 3px 0 var(--accent-dark);
}

.connect-title {
  margin: 0;
  font-size: 1.15rem;
}

.connect-badge {
  margin-left: auto;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(95, 191, 58, 0.12);
  border: 1px solid rgba(95, 191, 58, 0.35);
  border-radius: 999px;
  white-space: nowrap;
}

.connect-desc {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.connect-steps {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.connect-steps li + li {
  margin-top: 0.35rem;
}

.connect-steps strong {
  color: var(--text);
}

.connect-card a,
.text-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Address box sits at the bottom of every card */
.connect-address {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.connect-address code {
  flex: 1;
  min-width: 0;
  background: none;
  padding: 0;
  font-size: 0.85rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.copy-btn {
  flex-shrink: 0;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.copy-btn:hover {
  border-color: var(--accent);
}

.copy-btn.copied {
  color: #0b1a05;
  background: var(--accent);
  border-color: var(--accent);
}

.copy-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================================
   FAQ accordion
   ========================================================= */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item.open {
  border-color: rgba(95, 191, 58, 0.45);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: transparent;
  border: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 1.02rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}

.faq-question:hover {
  background: var(--surface-hover);
}

/* Plus / minus icon */
.faq-icon {
  position: relative;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  margin-top: -1px;
  background: var(--accent);
  transition: transform 0.25s;
}

.faq-icon::after {
  transform: rotate(90deg);
}

.faq-item.open .faq-icon::after {
  transform: rotate(0deg);
}

/* Smooth height animation using grid rows */
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.faq-item.open .faq-answer {
  grid-template-rows: 1fr;
}

.faq-answer-inner {
  overflow: hidden;
  color: var(--text-muted);
  padding: 0 1.25rem;
}

.faq-answer-inner > :first-child { margin-top: 0; }
.faq-answer-inner > :last-child  { margin-bottom: 1.15rem; }

.faq-answer-inner ul {
  padding-left: 1.25rem;
}

.faq-answer-inner strong {
  color: var(--text);
}

/* =========================================================
   Players list
   ========================================================= */
.players-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
}

.players-count {
  font-weight: 700;
  font-size: 1.1rem;
}

.players-updated {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.players-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.75rem;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
  animation: fade-in 0.3s ease both;
}

.player-card:hover {
  border-color: rgba(95, 191, 58, 0.45);
  transform: translateY(-2px);
}

.player-avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  image-rendering: pixelated;
  background: var(--surface-hover);
  flex-shrink: 0;
}

.player-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-card.more {
  justify-content: center;
  color: var(--text-muted);
  font-weight: 600;
  border-style: dashed;
}

.players-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem;
  margin: 0;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* =========================================================
   Footer
   ========================================================= */
.footer {
  margin-top: 5rem;
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer p {
  margin: 0;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 768px) {
  .nav-container {
    grid-template-columns: 1fr auto;
  }

  .nav-toggle {
    display: flex;
  }

  /* Links become a dropdown panel under the navbar */
  .nav-links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
    background: rgba(15, 17, 21, 0.97);
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }

  .navbar.menu-open .nav-links {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    padding: 0.85rem 0.5rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child .nav-link {
    border-bottom: none;
  }

  .nav-link:hover {
    background: transparent;
  }

  .section {
    padding: 4.5rem 0;
  }

  .section-header {
    margin-bottom: 2.25rem;
  }
}

@media (max-width: 480px) {
  .nav-title {
    font-size: 1rem;
  }

  .nav-logo {
    width: 30px;
    height: 30px;
  }

  .nav-actions {
    gap: 0.5rem;
  }

  .btn-sm {
    padding: 0.45rem 0.8rem;
    font-size: 0.82rem;
  }

  .server-status {
    font-size: 0.88rem;
  }

  .players-meta {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .player-card {
    gap: 0.6rem;
    padding: 0.6rem 0.7rem;
  }

  .player-avatar {
    width: 32px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
