:root {
  color-scheme: dark;
  --background: #080710;
  --surface: #11101c;
  --surface-raised: #181629;
  --surface-soft: #0d0c17;
  --border: #2c2941;
  --border-strong: #413c5f;
  --text: #f8f7ff;
  --muted: #aaa6bd;
  --subtle: #78748e;
  --accent: #8bf4eb;
  --accent-strong: #51ded3;
  --accent-soft: rgba(139, 244, 235, 0.12);
  --danger: #ff7b78;
  --danger-soft: rgba(255, 123, 120, 0.12);
  --warning: #f4c96b;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  --shell: 1120px;
  --theme-glow: rgba(132, 92, 246, 0.18);
  --theme-secondary: #a47cff;
  --card-cut: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 72% -8%, var(--theme-glow), transparent 34rem),
    radial-gradient(circle at 8% 36%, rgba(59, 213, 203, 0.08), transparent 28rem),
    var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 280ms ease, color 280ms ease;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--background);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(65, 60, 95, 0.72);
  background: rgba(8, 7, 16, 0.82);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 25px;
  height: 25px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  rotate: 45deg;
}
.brand-mark span {
  border-radius: 2px;
  background: linear-gradient(135deg, #a47cff, var(--accent));
}
.brand-mark span:nth-child(2),
.brand-mark span:nth-child(3) { opacity: 0.52; }

.navigation {
  display: flex;
  align-items: center;
  gap: 28px;
}
.navigation a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 160ms ease;
}
.navigation a:hover,
.navigation a:focus-visible { color: var(--text); }
.navigation .nav-cta {
  padding: 8px 13px;
  border: 1px solid rgba(139, 244, 235, 0.2);
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 92px 0 80px;
}
.hero::after {
  position: absolute;
  right: -8rem;
  top: 2rem;
  width: 26rem;
  height: 26rem;
  border: 1px solid rgba(164, 124, 255, 0.06);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.hero-grid { position: relative; z-index: 1; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(340px, 0.78fr);
  gap: clamp(48px, 8vw, 104px);
  align-items: center;
}
.hero-copy h1 {
  max-width: 720px;
  margin: 20px 0 18px;
  font-size: clamp(2.7rem, 6vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
  font-weight: 780;
}
.hero-copy > p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
}
.hero-copy .hero-kicker {
  margin: 0 0 -7px;
  color: #a78bfa;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}
.hero-actions {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.button--primary {
  background: #7559d9;
  box-shadow: 0 8px 22px rgba(91, 66, 184, 0.18);
  color: white;
  text-decoration: none;
}
.text-link {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}
.text-link span { margin-left: 4px; color: var(--accent); }
.text-link:hover { color: var(--text); }

.eyebrow,
.state-line {
  display: flex;
  align-items: center;
  gap: 9px;
}
.eyebrow {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.status-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 999px;
  background: var(--subtle);
  box-shadow: 0 0 0 4px rgba(110, 122, 116, 0.1);
}
.status-dot--online {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 22px rgba(114, 230, 168, 0.28);
}
.status-dot--offline {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.server-address {
  width: min(100%, 610px);
  margin-top: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 14px 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(16, 22, 20, 0.7);
}
.server-address > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.server-address strong {
  overflow: hidden;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(0.9rem, 2.4vw, 1.03rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field-label {
  color: var(--subtle);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}
.copy-feedback {
  min-height: 24px;
  margin-top: 8px !important;
  color: var(--accent) !important;
  font-size: 0.84rem !important;
}

.button,
.icon-button {
  border: 0;
  cursor: pointer;
}
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border-radius: 11px;
  font-size: 0.88rem;
  font-weight: 750;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}
.button svg,
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.button--secondary {
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  color: var(--text);
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible,
.icon-button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.live-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--card-cut);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card-heading,
.section-heading,
.history-header,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.card-heading h2 {
  margin: 3px 0 0;
  font-size: 1.08rem;
  letter-spacing: -0.025em;
}
.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  transition: color 150ms ease, border-color 150ms ease, rotate 300ms ease;
}
.icon-button:hover { color: var(--text); border-color: var(--border-strong); }
.icon-button.is-loading { rotate: 180deg; }

.server-state {
  margin: 26px 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.server-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(164, 124, 255, 0.3), rgba(139, 244, 235, 0.08)),
    var(--surface-soft);
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 850;
}
.server-icon img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.state-line { margin-bottom: 5px; }
.server-state p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.status-metrics > div { padding: 0 13px; }
.status-metrics > div:first-child { padding-left: 0; }
.status-metrics > div + div { border-left: 1px solid var(--border); }
.status-metrics dt {
  margin-bottom: 3px;
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 700;
}
.status-metrics dd {
  margin: 0;
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metric-muted { color: var(--subtle); font-weight: 500; }
.last-updated {
  min-height: 25px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--subtle);
  font-size: 0.75rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border: 1px solid rgba(114, 230, 168, 0.22);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}
.section { padding: 76px 0; border-top: 1px solid rgba(44, 41, 65, 0.72); }
.section--muted { background: rgba(13, 12, 23, 0.64); }
.section-heading { margin-bottom: 30px; }
.section-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.045em;
}
.section-value { color: var(--muted); font-size: 0.88rem; font-weight: 650; }

.player-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.player-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}
.player-avatar {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
  image-rendering: pixelated;
}
.player-avatar img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.player-card strong {
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.empty-state {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 28px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
}
.empty-state strong { color: var(--text); }
.empty-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 5px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--accent);
  font-weight: 800;
}
.privacy-note,
.data-note {
  margin: 16px 0 0;
  color: var(--subtle);
  font-size: 0.78rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.stat-card {
  min-height: 152px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.stat-label, .stat-context { color: var(--muted); font-size: 0.78rem; }
.stat-card strong {
  margin: 10px 0;
  font-size: 2.15rem;
  line-height: 1;
  letter-spacing: -0.05em;
}

.history-card {
  margin-top: 14px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.history-header h3 { margin: 0 0 3px; font-size: 1rem; }
.history-header p, .history-header > span {
  margin: 0;
  color: var(--subtle);
  font-size: 0.76rem;
}
.chart {
  height: 190px;
  margin-top: 28px;
  display: flex;
  align-items: end;
  gap: clamp(3px, 0.75vw, 8px);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(to bottom, transparent 24.5%, rgba(52, 65, 59, 0.28) 25%, transparent 25.5%),
    linear-gradient(to bottom, transparent 49.5%, rgba(52, 65, 59, 0.28) 50%, transparent 50.5%),
    linear-gradient(to bottom, transparent 74.5%, rgba(52, 65, 59, 0.28) 75%, transparent 75.5%);
}
.chart-bar {
  min-width: 4px;
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(to top, var(--accent-strong), var(--accent));
  opacity: 0.76;
  transition: height 240ms ease, opacity 160ms ease;
}
.chart-bar:hover { opacity: 1; }
.chart-bar--offline { height: 3px !important; background: var(--danger); opacity: 0.72; }
.chart-empty {
  width: 100%;
  align-self: center;
  color: var(--subtle);
  font-size: 0.82rem;
  text-align: center;
}

.site-footer {
  padding: 34px 0 42px;
  border-top: 1px solid var(--border);
}
.join-section { overflow: hidden; }
.join-card {
  position: relative;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 52px;
  padding: clamp(30px, 5vw, 56px);
  border: 1px solid rgba(164, 124, 255, 0.32);
  border-radius: var(--card-cut);
  background:
    radial-gradient(circle at 90% 10%, rgba(139, 244, 235, 0.1), transparent 20rem),
    linear-gradient(135deg, rgba(98, 67, 173, 0.18), rgba(17, 16, 28, 0.96));
}
.join-copy h2 {
  margin: 7px 0 12px;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.05em;
}
.join-copy p { margin: 0; color: var(--muted); }
.modpack-note {
  margin-top: 22px;
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--accent-soft);
}
.modpack-note strong { font-size: 0.84rem; }
.modpack-note span { color: var(--muted); font-size: 0.78rem; }
.discord-button {
  width: fit-content;
  min-height: 38px;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(139, 244, 235, 0.2);
  border-radius: 9px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 750;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.discord-button svg { width: 18px; height: 18px; fill: #8b7cf6; }
.discord-button:hover { transform: translateY(-1px); border-color: var(--border-strong); background: #201d35; }
.join-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.join-steps li {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 7, 16, 0.38);
}
.join-steps li > span {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}
.join-steps div { min-width: 0; display: grid; }
.join-steps strong { font-size: 0.86rem; }
.join-steps small, .join-steps code { overflow: hidden; color: var(--muted); font-size: 0.75rem; text-overflow: ellipsis; }
.join-copy-button { grid-column: 2; justify-self: start; margin-top: -34px; }
.footer-inner > div { display: grid; gap: 3px; }
.footer-inner span,
.footer-inner p { color: var(--subtle); font-size: 0.76rem; }
.footer-inner p { margin: 0; text-align: right; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(360px, calc(100% - 36px));
  transform: translateY(24px);
  padding: 12px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: #1b192c;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.38);
  color: var(--text);
  font-size: 0.84rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.is-visible { transform: translateY(0); opacity: 1; }

@media (max-width: 900px) {
  .hero { padding-top: 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 50px; }
  .live-card { width: 100%; }
  .player-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .join-card { grid-template-columns: 1fr; gap: 30px; }
  .join-copy-button { grid-column: auto; margin-top: -14px; }
}

@media (max-width: 620px) {
  .shell { width: min(calc(100% - 28px), var(--shell)); }
  .navigation { display: none; }
  .header-inner { min-height: 62px; }
  .hero { padding: 54px 0 58px; }
  .hero-copy h1 { font-size: clamp(2.55rem, 14vw, 4rem); }
  .server-address { align-items: stretch; flex-direction: column; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .text-link { text-align: center; }
  .button { width: 100%; }
  .live-card { padding: 20px; border-radius: 19px; }
  .status-metrics { grid-template-columns: 1fr 1fr; row-gap: 16px; }
  .status-metrics > div { padding: 0 10px; }
  .status-metrics > div:nth-child(3) {
    grid-column: 1 / -1;
    padding: 15px 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }
  .section { padding: 58px 0; }
  .section-heading, .history-header, .footer-inner { align-items: flex-start; flex-direction: column; gap: 8px; }
  .player-list, .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 132px; }
  .history-card { padding: 18px; }
  .chart { height: 155px; }
  .footer-inner p { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
