@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/ChakraPetch-700.woff2") format("woff2");
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/Sora-400.woff2") format("woff2");
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/Sora-600.woff2") format("woff2");
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/Sora-700.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/JetBrainsMono-400.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/JetBrainsMono-600.woff2") format("woff2");
}

:root {
  --bg: #090d13;
  --bg-glow-a: #0d2230;
  --bg-glow-b: #16220f;
  --surface: #111826;
  --surface-2: #161f30;
  --border: #232d3f;
  --border-soft: #1a2333;
  --text: #eaf0f7;
  --text-muted: #8996a8;
  --text-faint: #5c6779;
  --cyan: #55cdff;
  --lime: #b4e63c;
  --gradient: linear-gradient(120deg, var(--cyan), var(--lime));
  --online: #7be07f;
  --offline: #ef7a6d;
  --radius: 14px;
  --shadow: 0 20px 50px -25px rgba(0, 0, 0, 0.6);

  --survival-light: #8ce99a;
  --survival-dark: #237032;
  --survival-gradient: linear-gradient(120deg, var(--survival-light), var(--survival-dark));
  --skyblock-light: #7ec8ff;
  --skyblock-dark: #164e8a;
  --skyblock-gradient: linear-gradient(120deg, var(--skyblock-light), var(--skyblock-dark));
  --minigames-light: #d3b8ff;
  --minigames-dark: #5a2fa8;
  --minigames-gradient: linear-gradient(120deg, var(--minigames-light), var(--minigames-dark));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Sora", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(650px 400px at 12% -10%, color-mix(in srgb, var(--bg-glow-a) 70%, transparent), transparent 70%),
    radial-gradient(600px 380px at 100% 10%, color-mix(in srgb, var(--bg-glow-b) 55%, transparent), transparent 70%);
  pointer-events: none;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

h1, h2, h3 { font-family: "Chakra Petch", "Sora", sans-serif; font-weight: 700; text-wrap: balance; letter-spacing: 0.01em; margin: 0; }

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

.num, .tabular { font-family: "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border-soft);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--gradient);
  color: #0a0e14;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  font-size: 14px;
}

.brand-word {
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.15s ease, background 0.15s ease;
}

.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a.active { color: var(--text); background: var(--surface-2); }

.site-nav a.nav-cta {
  margin-left: 8px;
  color: #0a0e14;
  background: var(--gradient);
}
.site-nav a.nav-cta:hover { filter: brightness(1.08); }

/* Page / footer */
.page { padding: 48px 24px 64px; flex: 1; }

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 20px 0;
  color: var(--text-faint);
  font-size: 13.5px;
}
.footer-inner { display: flex; justify-content: space-between; }
.footer-links a { color: var(--text-faint); }
.footer-links a:hover { color: var(--text-muted); }

/* Hero */
.hero { margin-bottom: 40px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2rem, 4vw, 2.9rem); margin-bottom: 10px; }
.hero .lede { color: var(--text-muted); font-size: 17px; max-width: 60ch; margin-bottom: 22px; }

.connect-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.connect-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.connect-chip .label { font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.connect-chip .value { font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: 14.5px; }

/* Status cards */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.status-card .row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.status-card h3 { font-size: 16px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.pill.online { color: var(--online); background: color-mix(in srgb, var(--online) 15%, transparent); }
.pill.online .dot { background: var(--online); box-shadow: 0 0 8px var(--online); }
.pill.offline { color: var(--offline); background: color-mix(in srgb, var(--offline) 15%, transparent); }
.pill.offline .dot { background: var(--offline); }

.status-card .count {
  font-family: "JetBrains Mono", monospace;
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
}
.status-card .count .max { font-size: 16px; color: var(--text-faint); font-weight: 400; }
.status-card .sub { color: var(--text-faint); font-size: 13px; margin-top: 6px; }

.bar-track {
  margin-top: 14px;
  height: 6px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}
.bar-fill { height: 100%; background: var(--gradient); border-radius: 4px; }

/* Section headings for leaderboard pages */
.section-head { margin-bottom: 28px; }
.section-head h1 { font-size: 2rem; margin-bottom: 8px; }
.section-head p { color: var(--text-muted); max-width: 60ch; }

/* Leaderboard table */
.board {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.board-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.board-row:last-child { border-bottom: none; }
.board-row.head {
  color: var(--text-faint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding-top: 12px;
  padding-bottom: 12px;
}

.rank {
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-faint);
}
.rank.top1 { color: #ffd76b; }
.rank.top2 { color: #cfd8e3; }
.rank.top3 { color: #d99a63; }

.player-name { font-weight: 600; font-size: 15px; }
.player-sub { color: var(--text-faint); font-size: 12.5px; margin-top: 2px; }

.value {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  font-size: 15.5px;
  text-align: right;
}
.value .unit { color: var(--text-faint); font-weight: 400; font-size: 13px; margin-left: 4px; }

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-faint);
}

.tab-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab-row a {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
}
.tab-row a.active { color: #0a0e14; background: var(--gradient); border-color: transparent; }

.tab-row-servers { margin-bottom: 14px; }
.tab-row-servers a { font-size: 15px; padding: 10px 20px; }

/* Per-gamemode colors for server-select buttons (top nav + in-page tabs) */
.site-nav a.server-survival, .tab-row a.server-survival { color: var(--survival-light); border-color: color-mix(in srgb, var(--survival-dark) 55%, transparent); }
.site-nav a.server-skyblock, .tab-row a.server-skyblock { color: var(--skyblock-light); border-color: color-mix(in srgb, var(--skyblock-dark) 55%, transparent); }
.site-nav a.server-minigames, .tab-row a.server-minigames { color: var(--minigames-light); border-color: color-mix(in srgb, var(--minigames-dark) 55%, transparent); }

.site-nav a.server-survival:hover, .tab-row a.server-survival:hover { background: color-mix(in srgb, var(--survival-dark) 22%, transparent); }
.site-nav a.server-skyblock:hover, .tab-row a.server-skyblock:hover { background: color-mix(in srgb, var(--skyblock-dark) 22%, transparent); }
.site-nav a.server-minigames:hover, .tab-row a.server-minigames:hover { background: color-mix(in srgb, var(--minigames-dark) 22%, transparent); }

.site-nav a.server-survival.active, .tab-row a.server-survival.active { background: var(--survival-gradient); color: #06210f; border-color: transparent; }
.site-nav a.server-skyblock.active, .tab-row a.server-skyblock.active { background: var(--skyblock-gradient); color: #051224; border-color: transparent; }
.site-nav a.server-minigames.active, .tab-row a.server-minigames.active { background: var(--minigames-gradient); color: #170a2c; border-color: transparent; }

.tab-row-metrics { padding-bottom: 16px; margin-bottom: 8px; border-bottom: 1px solid var(--border-soft); }
.tab-row-metrics a { font-size: 13px; padding: 7px 14px; }

.tab-row-sub a { font-size: 13px; padding: 6px 14px; background: transparent; }

/* Category landing pages */
.category-section { margin-bottom: 32px; }
.category-section h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.link-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.link-card:hover { border-color: var(--cyan); transform: translateY(-1px); }
.link-card .link-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.link-card .link-desc { color: var(--text-faint); font-size: 13px; }

/* Store */
.store-banner {
  background: color-mix(in srgb, var(--online) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--online) 40%, transparent);
  color: var(--online);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 28px;
  font-weight: 600;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--surface-2);
  display: block;
}

.product-body { padding: 16px 18px 4px; flex: 1; }
.product-name { font-size: 16px; margin-bottom: 8px; }
.product-desc {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.5;
  max-height: 8.5em;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  transition: max-height 0.25s ease;
}
.product-desc.expanded {
  max-height: 999px;
  mask-image: none;
}
.product-desc p { margin: 0 0 8px; }
.product-desc strong { color: var(--text); }

.desc-toggle {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
}
.product-card.expandable { cursor: pointer; }

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 18px;
}

.product-price {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  font-size: 16px;
  color: var(--lime);
}

.buy-button {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 20px;
  border-radius: 8px;
  border: none;
  background: var(--gradient);
  color: #0a0e14;
  cursor: pointer;
  transition: filter 0.15s ease, opacity 0.15s ease;
}
.buy-button:hover { filter: brightness(1.08); }
.buy-button:disabled { opacity: 0.6; cursor: default; }

/* Username prompt shown before handing off to the Tebex checkout popup. */
.checkout-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(4, 7, 11, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.checkout-overlay[hidden] { display: none; }

.checkout-dialog {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.checkout-dialog h3 { font-size: 18px; margin-bottom: 6px; }

.checkout-hint {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.checkout-input {
  width: 100%;
  font-family: "JetBrains Mono", monospace;
  font-size: 15px;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.checkout-input:focus {
  outline: none;
  border-color: var(--cyan);
}

.checkout-note {
  color: var(--text-faint);
  font-size: 12.5px;
  margin-top: 9px;
}
.checkout-note code {
  font-family: "JetBrains Mono", monospace;
  color: var(--text-muted);
}

.checkout-error {
  color: var(--offline);
  font-size: 13px;
  margin-top: 10px;
}
.checkout-error[hidden] { display: none; }

.checkout-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.checkout-cancel {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.checkout-cancel:hover { color: var(--text); border-color: var(--text-faint); }

/* Live map - needs real screen space, so it overrides .page's padding/max-width
   instead of sitting inside the normal centered content column. */
.page-map {
  padding: 0;
  max-width: none;
  width: 100%;
  display: flex;
}
.map-frame {
  flex: 1;
  width: 100%;
  min-height: 640px;
  border: 0;
  display: block;
}

@media (max-width: 640px) {
  .header-inner { height: auto; padding: 12px 0; flex-wrap: wrap; gap: 10px; }
  .site-nav { flex-wrap: wrap; }
  .footer-inner { flex-direction: column; gap: 6px; }
  .board-row { grid-template-columns: 40px 1fr auto; padding: 12px 16px; gap: 10px; }
}
