/* ==========================================================================
   MCVote — "Neon Deep" theme
   Premium dark surfaces, dual neon accent, glass layering, restrained glow.
   Self-hosted only: no external fonts or assets (CSP: default-src 'self').
   Legacy class names are preserved so every Go template keeps rendering.
   ========================================================================== */

:root {
  /* Base canvas */
  --bg: #06070c;
  --bg-deep: #04050a;
  --surface: rgba(19, 22, 33, 0.72);
  --surface-solid: #131621;
  --surface-2: rgba(26, 30, 44, 0.78);
  --surface-3: #1b1f2d;
  --surface-hover: rgba(32, 37, 54, 0.85);

  /* Lines */
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --border-glow: rgba(52, 229, 127, 0.35);

  /* Type */
  --text: #f2f5fa;
  --text-2: #a3adc2;
  --text-3: #6b7488;

  /* Neon accents */
  --accent: #34e57f;
  --accent-strong: #16c95f;
  --accent-soft: rgba(52, 229, 127, 0.12);
  --accent-2: #2bd06d;   /* deeper green, same family (was cyan) */
  --accent-3: #7ff0a6;   /* light green highlight (was purple) */
  --on-accent: #04220f;

  /* Signals */
  --danger: #ff5c72;
  --danger-bg: rgba(255, 92, 114, 0.1);
  --gold: #f5c451;
  --gold-bg: rgba(245, 196, 81, 0.12);

  /* Composites */
  --grad-accent: linear-gradient(135deg, #4dea92 0%, var(--accent-strong) 100%);
  --grad-text: linear-gradient(180deg, #ffffff 0%, #cfe9d9 100%);
  --glow-accent: 0 0 0 1px rgba(52, 229, 127, 0.4), 0 8px 30px -6px rgba(52, 229, 127, 0.45);
  --glow-soft: 0 20px 60px -25px rgba(52, 229, 127, 0.32);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 40px -20px rgba(0, 0, 0, 0.9);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;

  --shell: 1140px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient light — fixed, never scrolls, never intercepts clicks. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(760px 460px at 12% -6%, rgba(52, 229, 127, 0.13), transparent 62%),
    radial-gradient(700px 420px at 88% 4%, rgba(52, 229, 127, 0.06), transparent 60%),
    radial-gradient(900px 700px at 50% 108%, rgba(255, 255, 255, 0.03), transparent 65%);
}

/* Fine grid, dissolving downward. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
}

::selection { background: var(--accent); color: var(--on-accent); }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
code, .mono { font-family: var(--mono); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

main {
  position: relative;
  width: min(var(--shell), calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 96px;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 11px 18px;
  border-radius: 0 0 10px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  transition: top 0.2s var(--ease);
}

.skip-link:focus { top: 0; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 0 max(20px, calc((100vw - var(--shell)) / 2 + 20px));
  background: rgba(6, 7, 12, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
}

/* Hairline of accent light under the header. */
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(52, 229, 127, 0.55), transparent);
  opacity: 0.7;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--on-accent);
  background: var(--grad-accent);
  box-shadow: 0 6px 20px -8px rgba(52, 229, 127, 0.9);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.brand-mark svg { width: 19px; height: 19px; stroke-width: 2.4; }

.brand:hover .brand-mark {
  transform: translateY(-1px) rotate(-6deg);
  box-shadow: 0 10px 26px -8px rgba(52, 229, 127, 1);
}

.brand-accent {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav a, .footer-links a {
  position: relative;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.2s, background 0.2s;
}

.nav a:hover, .footer-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.locale-link {
  padding: 7px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-2);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.locale-link:hover {
  color: var(--accent);
  border-color: var(--border-glow);
  background: var(--accent-soft);
}

/* Mobile nav toggle — hidden on desktop, revealed in the media query. */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-start;
  width: min(var(--shell), calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0 56px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.9rem;
}

.site-footer strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.site-footer p { max-width: 46ch; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4 {
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
}

h1 { font-size: clamp(2.1rem, 5.2vw, 3.5rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.85rem); }
h3 { font-size: 1.06rem; letter-spacing: -0.02em; }

.accent {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-muted { color: var(--text-2); }

.text-link {
  color: var(--accent);
  border-bottom: 1px solid rgba(52, 229, 127, 0.3);
  transition: border-color 0.2s;
}

.text-link:hover { border-bottom-color: var(--accent); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 76px 0 60px;
}

.hero-content h1 {
  margin: 18px 0 0;
  letter-spacing: -0.035em;
  line-height: 1.04;
  text-wrap: balance;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead, .page-hero p {
  margin-top: 18px;
  max-width: 56ch;
  font-size: 1.06rem;
  color: var(--text-2);
}

.eyebrow, .eyebrow-text {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

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

.eyebrow-dot, .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(52, 229, 127, 0.7);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 229, 127, 0.6); }
  70%  { box-shadow: 0 0 0 9px rgba(52, 229, 127, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 229, 127, 0); }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-panel {
  position: relative;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(160deg, rgba(52, 229, 127, 0.07), transparent 45%),
    var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card), var(--glow-soft);
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(52, 229, 127, 0.45), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.hero-panel h2 { margin: 12px 0 20px; }

.hero-panel__stats, .stats-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.stat, .stat-box {
  padding: 15px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.28);
  transition: border-color 0.25s, transform 0.25s var(--ease);
}

.stat:hover, .stat-box:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.stat b, .stat-box b, .server-row__stats b {
  display: block;
  font-size: 1.42rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat span, .stat-box span, .server-row__stats span {
  display: block;
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.25s;
}

.button:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--border-glow);
  transform: translateY(-1px);
}

.button:active { transform: translateY(0); }

.button--primary {
  position: relative;
  border-color: transparent;
  color: var(--on-accent);
  background: var(--grad-accent);
  box-shadow: 0 8px 24px -10px rgba(52, 229, 127, 0.9);
}

.button--primary:hover {
  background: var(--grad-accent);
  filter: brightness(1.08);
  box-shadow: 0 12px 32px -10px rgba(52, 229, 127, 1);
}

.button.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.button--block { width: 100%; }

.button--discord {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #5865f2, #7c86ff);
  padding: 15px 30px;
  font-size: 1rem;
  box-shadow: 0 10px 30px -12px rgba(88, 101, 242, 1);
}

.button--discord:hover {
  background: linear-gradient(135deg, #5865f2, #7c86ff);
  filter: brightness(1.1);
  box-shadow: 0 14px 36px -12px rgba(88, 101, 242, 1);
}

.button--discord svg { width: 20px; height: 20px; }

/* ==========================================================================
   Search / filter shells
   ========================================================================== */

.search-bar, .filter-panel, .address-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.search-bar:focus-within, .filter-panel:focus-within {
  border-color: var(--border-glow);
  box-shadow: 0 0 0 4px rgba(52, 229, 127, 0.1);
}

.search-bar svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  color: var(--text-3);
}

.search-bar input,
.filter-panel input,
.filter-panel select,
.address-copy code {
  flex: 1;
  min-width: 0;
  padding: 9px 0;
  border: none;
  outline: none;
  background: none;
  font-size: 0.96rem;
}

.search-bar input::placeholder, .filter-panel input::placeholder { color: var(--text-3); }

.filter-panel {
  flex-wrap: wrap;
  padding: 10px;
}

.filter-panel input {
  flex: 1 1 220px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.filter-panel select {
  flex: 0 1 170px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.filter-panel select option { background: var(--surface-3); color: var(--text); }

/* ==========================================================================
   Sections
   ========================================================================== */

.section { margin-top: 68px; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.section-heading h2 { margin-top: 8px; }

.section-heading > a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

.section-heading > a:hover { text-decoration: underline; }

/* ==========================================================================
   Cards
   ========================================================================== */

.content-card, .notice, .empty-state, .server-row, .tool-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.content-card {
  padding: 26px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s, transform 0.25s var(--ease);
}

.content-card h2 { margin-bottom: 12px; }
.content-card p { color: var(--text-2); }
.content-card h3 { margin-bottom: 6px; }

/* ==========================================================================
   Server list — the toplist is the product, so it gets the most attention.
   Rank numbers come from a CSS counter: no template coupling required.
   ========================================================================== */

.server-list {
  display: grid;
  gap: 9px;
  counter-reset: rank;
}

.server-row {
  position: relative;
  display: grid;
  /* rank | banner | identity+meta | stats  — ::before supplies the rank cell */
  grid-template-columns: 46px 164px minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 13px 18px;
  counter-increment: rank;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
}

.server-row:hover {
  border-color: var(--border-glow);
  background: var(--surface-hover);
}

/* Rank chip, top-left of every row. */
.server-row::before {
  content: counter(rank);
  grid-column: 1;
  justify-self: center;
  font-size: 1.6rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-3);
}

/* Podium places earn the neon. */
.server-list .server-row:nth-child(1)::before {
  font-size: 1.95rem;
  color: var(--accent);
  text-shadow: 0 0 22px rgba(52, 229, 127, 0.55);
}

.server-list .server-row:nth-child(2)::before { font-size: 1.8rem; color: #d6dae2; }
.server-list .server-row:nth-child(3)::before { font-size: 1.7rem; color: var(--gold); }

/* Podium rows get a hairline accent edge instead of a heavy card treatment. */
.server-list .server-row:nth-child(-n+3) {
  background:
    linear-gradient(90deg, rgba(52, 229, 127, 0.05), transparent 34%),
    var(--surface);
}

.server-row.is-sponsored {
  border-color: rgba(245, 196, 81, 0.3);
  background:
    linear-gradient(120deg, rgba(245, 196, 81, 0.07), transparent 42%),
    var(--surface);
}

.server-row.is-sponsored:hover {
  border-color: rgba(245, 196, 81, 0.55);
  box-shadow: var(--shadow-card), 0 18px 50px -28px rgba(245, 196, 81, 0.7);
}

.server-row__banner {
  display: block;
  width: 164px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}

.server-row__banner img, .detail-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-row__banner-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0 12px;
  text-align: center;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(52, 229, 127, 0.18), transparent 60%),
    radial-gradient(120% 140% at 100% 100%, rgba(52, 229, 127, 0.10), transparent 60%),
    var(--surface-3);
}

.server-row__banner-placeholder span {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.server-row__main { min-width: 0; }

.server-row__identity, .profile-identity {
  display: flex;
  align-items: center;
  gap: 11px;
}

.server-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  overflow: hidden;
  background: var(--surface-3);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}

.server-icon img,
.tool-server-icon img,
.server-row__banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Icons are served from /icon/<slug>. A broken or still-loading image
     must not spill its alt text into the tile. */
  font-size: 0;
  color: transparent;
}

.server-icon--large {
  width: 66px;
  height: 66px;
  border-radius: 16px;
  font-size: 1.7rem;
}

.server-row__title { min-width: 0; }

.server-row__topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* The name leads the meta line, so it carries the weight. */
.server-row__topline h3 { margin-right: 2px; }

.server-row__main h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-row__main h3 a { transition: color 0.2s; }
.server-row__main h3 a:hover { color: var(--accent); }

.server-row__main p {
  margin-top: 5px;
  font-size: 0.88rem;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.server-row__address {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Vote CTA gets its own rail so the row stays two lines tall. */
.server-row__cta { display: grid; }
.server-row__cta .button { white-space: nowrap; }

.server-row__address code, .address-copy code {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.86rem;
  color: var(--accent);
}

.server-row__stats {
  display: flex;
  gap: 24px;
  padding-left: 20px;
  border-left: 1px solid var(--border);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.server-row__stats > div { display: flex; flex-direction: column; gap: 1px; min-width: 46px; }

/* ==========================================================================
   Pills, tags, badges
   ========================================================================== */

.category-strip, .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.category-strip { margin-top: 22px; }

.category-strip a, .tag, .mini-badge, .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-2);
  white-space: nowrap;
}

.category-strip a {
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}

.category-strip a:hover {
  color: var(--accent);
  border-color: var(--border-glow);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

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

.status-pill.is-online {
  color: var(--accent);
  border-color: rgba(52, 229, 127, 0.35);
  background: var(--accent-soft);
  box-shadow: 0 0 14px -4px rgba(52, 229, 127, 0.7);
}

.status-pill.is-offline {
  color: var(--text-3);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.mini-badge.is-gold {
  color: var(--gold);
  border-color: rgba(245, 196, 81, 0.35);
  background: var(--gold-bg);
  box-shadow: 0 0 14px -4px rgba(245, 196, 81, 0.6);
}

/* ==========================================================================
   Page hero (interior pages)
   ========================================================================== */

.page-hero { padding: 62px 0 8px; }

.page-hero h1 { margin-top: 14px; }

.page-hero--compact { padding: 52px 0 4px; }

.page-hero--center {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}

.page-hero--center p { margin-left: auto; margin-right: auto; }

.page-hero--center .hero-actions,
.page-hero--center .notice {
  justify-content: center;
  margin-top: 30px;
}

.page-hero .notice { margin-top: 20px; }

.tool-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  flex-wrap: wrap;
}

.tool-hero .hero-actions { margin-top: 0; }

/* ==========================================================================
   Server profile
   ========================================================================== */

.profile-hero {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
  padding: 56px 0 0;
}

.profile-hero__main { min-width: 0; }

.profile-hero__main h1 { margin-top: 10px; }

.profile-identity { margin-bottom: 20px; }

.detail-banner {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 468px;
}

.stats-panel {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}

.address-copy {
  display: inline-flex;
  margin-top: 22px;
  padding: 6px;
}

.address-copy code { flex: 0 1 auto; }

.copy-btn {
  display: grid;
  grid-auto-flow: column;
  place-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.04);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

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

.copy-btn svg { width: 15px; height: 15px; }

.profile-content, .dashboard-grid, .article-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  align-items: start;
}

.article-grid { grid-template-columns: repeat(2, 1fr); }

.fact-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
  font-size: 0.92rem;
}

.fact-list dt {
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.01em;
}

.fact-list dd {
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ==========================================================================
   Tools
   ========================================================================== */

.tool-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 16px;
}

.tool-card {
  position: relative;
  display: block;
  padding: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
}

.tool-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--grad-accent);
  opacity: 0;
  transition: opacity 0.3s;
}

.tool-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card), 0 18px 46px -28px rgba(52, 229, 127, 0.75);
}

.tool-card:hover::after { opacity: 1; }

.tool-card h2 { margin: 14px 0 10px; font-size: 1.16rem; }
.tool-card p { font-size: 0.92rem; }

.tool-result-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tool-result-heading h3 { margin-top: 6px; }

.tool-server-icon {
  width: 52px;
  height: 52px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-3);
}

.tool-facts code {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.85rem;
  color: var(--accent);
}

/* ==========================================================================
   Forms
   ========================================================================== */

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-2);
}

.form-group input,
.form-group textarea,
.form-group select,
textarea[name="admin_note"],
textarea[name="message"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.32);
  font-size: 0.94rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-glow);
  box-shadow: 0 0 0 4px rgba(52, 229, 127, 0.1);
}

.form-group input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-group textarea, textarea {
  min-height: 96px;
  resize: vertical;
  font-family: inherit;
}

.form-group select option { background: var(--surface-3); color: var(--text); }

.field-hint {
  font-size: 0.8rem;
  color: var(--text-3);
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.category-check { cursor: pointer; }

.category-check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.category-check span {
  display: inline-block;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.category-check span:hover { border-color: var(--border-strong); color: var(--text); }

.category-check input:checked + span {
  color: var(--on-accent);
  border-color: transparent;
  background: var(--grad-accent);
  box-shadow: 0 4px 16px -6px rgba(52, 229, 127, 0.9);
}

.category-check input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.category-check input:disabled + span {
  opacity: 0.35;
  cursor: not-allowed;
}

.upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 20px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
  text-align: center;
  transition: border-color 0.25s, background 0.25s;
}

.upload-box:hover {
  border-color: var(--border-glow);
  background: var(--accent-soft);
}

.upload-box strong { font-size: 0.98rem; }
.upload-box span { font-size: 0.85rem; color: var(--text-3); }
.upload-box input { margin-top: 10px; font-size: 0.85rem; }

.token-box {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.4);
  font-size: 0.88rem;
  color: var(--accent);
  overflow-wrap: anywhere;
}

/* ==========================================================================
   Notices
   ========================================================================== */

.notice, .empty-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  font-size: 0.92rem;
  color: var(--text-2);
}

.empty-state { justify-content: center; padding: 44px 20px; }

.notice--error {
  color: var(--danger);
  border-color: rgba(255, 92, 114, 0.3);
  background: var(--danger-bg);
}

/* ==========================================================================
   Vote
   ========================================================================== */

.vote-flow {
  display: grid;
  place-items: center;
}

.vote-card {
  width: min(460px, 100%);
  box-shadow: var(--shadow-card), var(--glow-soft);
}

/* ==========================================================================
   Scroll reveal

   Deliberately additive: content is never hidden by default. site.js marks
   elements .is-visible as they enter the viewport, which only lifts them
   slightly. If the script fails to load, or the CSP blocks it, the page still
   renders fully — no blank sections, no flash of hidden content.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  .server-row.is-visible,
  .stat-box.is-visible,
  .content-card.is-visible {
    animation: rise 0.5s var(--ease) both;
  }
}

@keyframes rise {
  from { opacity: 0.55; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 54px 0 40px;
  }

  .profile-hero { grid-template-columns: 1fr; }
  .profile-content, .dashboard-grid { grid-template-columns: 1fr; }
  .stats-panel { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 860px) {
  .site-header { min-height: 62px; }

  .nav-toggle { display: grid; }

  .nav {
    position: fixed;
    top: 62px;
    left: 0;
    right: 0;
    z-index: 99;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin-left: 0;
    padding: 12px;
    background: rgba(6, 7, 12, 0.97);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.9);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0.25s;
  }

  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav a {
    padding: 13px 14px;
    font-size: 1rem;
    border-radius: 10px;
  }

  .server-row {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px 14px;
    padding: 15px 16px;
  }

  /* banner, main and stats all stack in the second column */
  .server-row__banner,
  .server-row__main,
  .server-row__stats,
  .server-row__cta { grid-column: 2; }

  .server-row::before { align-self: start; font-size: 1.3rem; }
  .server-list .server-row:nth-child(1)::before { font-size: 1.45rem; }
  .server-list .server-row:nth-child(2)::before,
  .server-list .server-row:nth-child(3)::before { font-size: 1.38rem; }

  .server-row__banner { width: 100%; }

  .server-row__stats {
    gap: 26px;
    padding-left: 0;
    padding-top: 14px;
    border-left: none;
    border-top: 1px solid var(--border);
    text-align: left;
  }

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

  .tool-hero { align-items: flex-start; }
}

@media (max-width: 560px) {
  main, .site-footer { width: calc(100% - 28px); }

  h1 { font-size: clamp(1.85rem, 8vw, 2.4rem); }

  .hero { padding: 40px 0 32px; }
  .page-hero { padding: 40px 0 4px; }

  .hero-panel { padding: 22px; }
  .hero-panel__stats { grid-template-columns: 1fr; }
  .stats-panel { grid-template-columns: repeat(2, 1fr); }

  .search-bar { flex-wrap: wrap; padding: 12px; }
  .search-bar input { flex: 1 1 100%; }
  .search-bar .button { width: 100%; }

  .filter-panel select, .filter-panel input { flex: 1 1 100%; }
  .filter-panel .button { width: 100%; }

  .hero-actions .button { flex: 1 1 auto; }

  .content-card { padding: 20px; }

  .server-row { grid-template-columns: 30px minmax(0, 1fr); }
  .server-row__stats { gap: 18px; }
}

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