/* ==========================================================================
   FiveBase — Dark editorial/terminal design
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  /* Colors */
  --bg: #0a0b0f;
  --bg-elevated: #111218;
  --surface: #15161c;
  --surface-hover: #1b1c24;
  --border: #24252e;
  --border-strong: #31323d;

  --text: #e8e9ec;
  --text-muted: #8b8d96;
  --text-dim: #5a5c65;

  --accent: #ff6b1a;
  --accent-hover: #ff8034;
  --accent-dim: rgba(255, 107, 26, 0.12);
  --accent-border: rgba(255, 107, 26, 0.3);

  --success: #3ecf8e;
  --success-dim: rgba(62, 207, 142, 0.1);
  --danger: #f04438;
  --danger-dim: rgba(240, 68, 56, 0.1);

  /* Type */
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* Layout */
  --max-width: 1280px;
  --radius: 6px;
  --radius-lg: 10px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0, 0.1, 1);
  --t-fast: 120ms var(--ease);
  --t-med: 220ms var(--ease);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 48px 48px;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 900px 520px at 50% -120px, rgba(255, 107, 26, 0.07), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: white; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 11, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text);
  flex-shrink: 0;
}
.logo-mark {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: white;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 4px 12px rgba(255, 107, 26, 0.2);
  position: relative;
}
.logo-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 50%);
}
.logo-text span { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav a {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface); }

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.15);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text-muted);
}
.nav-toggle:hover { background: var(--surface); color: var(--text); }

/* ==========================================================================
   Hero (home)
   ========================================================================== */

.hero { padding: 80px 0 48px; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-family: var(--font-mono);
}
.hero-eyebrow-badge {
  padding: 2px 8px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(36px, 6vw, 62px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
  max-width: 900px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-subtitle {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-muted);
  max-width: 620px;
  margin-bottom: 40px;
  line-height: 1.55;
}

/* Search */
.search-wrap { position: relative; max-width: 720px; }
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px 6px 6px 18px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-bar:focus-within {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 1px var(--accent-border), 0 0 24px rgba(255, 107, 26, 0.08);
}
.search-bar svg { color: var(--text-dim); flex-shrink: 0; }
.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 14px 0;
  font-size: 15px;
  color: var(--text);
  min-width: 0;
}
.search-bar input::placeholder { color: var(--text-dim); }
.search-bar button.search-submit {
  background: var(--accent);
  color: white;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: background var(--t-fast), transform var(--t-fast);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.search-bar button.search-submit:hover { background: var(--accent-hover); }
.search-bar button.search-submit:active { transform: scale(0.97); }

.search-hint {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-dim);
}
.search-hint-tag {
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
}
.search-hint-tag:hover { color: var(--text); border-color: var(--border-strong); }

/* ==========================================================================
   Legal pages (Impressum)
   ========================================================================== */

.legal-page { padding: 64px 0 48px; max-width: 760px; }
.legal-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.legal-subtitle {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 40px;
}
.legal-domain {
  display: inline-block;
  padding: 6px 12px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 40px;
}
.legal-section { margin-bottom: 32px; }
.legal-section h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.legal-section p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}
.legal-section a { color: var(--accent); }
.legal-section a:hover { text-decoration: underline; }
.legal-note {
  padding: 14px 18px;
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 24px;
}

/* ==========================================================================
   Server banner / icon on detail page
   ========================================================================== */

.detail-banner {
  width: 100%;
  height: 140px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
  position: relative;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
}
.detail-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-banner-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 56px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(255, 107, 26, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 107, 26, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
}

.detail-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
}
.detail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-icon-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
}

.detail-header-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
}
.detail-header-text { flex: 1; min-width: 0; }

/* Flag icons (SVG from flagcdn.com) */
.flag-icon {
  width: 18px;
  height: 13px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -2px;
}

/* Region selector in header */
.region-selector {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.region-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
  font-family: inherit;
  white-space: nowrap;
}
.region-button:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.region-button-chevron { color: var(--text-dim); flex-shrink: 0; }
.region-button-label { font-family: var(--font-mono); font-size: 12px; }
.region-button-globe { width: 16px; height: 12px; display: grid; place-items: center; }

.region-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  padding: 4px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity var(--t-fast), transform var(--t-fast);
  max-height: 60vh;
  overflow-y: auto;
}
.region-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.region-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: background var(--t-fast), color var(--t-fast);
  user-select: none;
}
.region-option:hover { background: var(--surface); color: var(--text); }
.region-option.selected {
  background: var(--accent-dim);
  color: var(--accent);
}
.region-option-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.region-option-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}
.region-option.selected .region-option-count { color: var(--accent); opacity: 0.7; }

.region-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 2px;
}

/* Responsive: compact on mobile */
@media (max-width: 640px) {
  .region-button { padding: 6px 8px; font-size: 12px; }
  .region-button-label { display: none; }
  .region-menu { right: -40px; min-width: 200px; }
}

/* ==========================================================================
   Live stats bar
   ========================================================================== */

.live-stats {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.live-stat {
  background: var(--bg-elevated);
  padding: 28px 24px;
  position: relative;
}
.live-stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-family: var(--font-mono);
}
.live-stat-label-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}
.live-stat-value {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}
.live-stat-meta { margin-top: 8px; font-size: 13px; color: var(--text-dim); }

/* ==========================================================================
   Section
   ========================================================================== */

.section { padding: 64px 0; }
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.section-title-group h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.section-title-group p { font-size: 14px; color: var(--text-muted); }
.section-title-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.section-title-meta::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
}
.section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.section-link:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface); }

/* ==========================================================================
   Server card grid
   ========================================================================== */

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.server-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: border-color var(--t-med), background var(--t-med), transform var(--t-med);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 180px;
  text-align: left;
}
.server-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateY(-2px);
}
.server-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--t-med);
}
.server-card:hover::after { transform: scaleY(1); }

.server-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.server-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}
.server-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}
.server-trend.up { background: var(--success-dim); color: var(--success); }
.server-trend.down { background: var(--danger-dim); color: var(--danger); }
.server-trend.flat { background: var(--surface-hover); color: var(--text-muted); }

.server-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  line-clamp: 1;
  color: var(--text);
}

.server-meta { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  padding: 3px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.tag.accent { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-border); }

.server-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.server-stat { display: flex; flex-direction: column; gap: 2px; }
.server-stat-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.server-stat-value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.server-stat-value .max { color: var(--text-dim); font-weight: 400; }

.player-bar {
  height: 3px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 6px;
}
.player-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 400ms var(--ease);
}

/* ==========================================================================
   Servers list page
   ========================================================================== */

.filters-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  padding: 48px 0;
}
.filters-sidebar { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 6px; }

.filter-group { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.filter-group:last-child { border-bottom: none; }

.filter-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-family: var(--font-mono);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-reset {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.filter-reset:hover { color: var(--accent); }

.filter-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  margin: 2px 0;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: all var(--t-fast);
  border: 1px solid transparent;
  user-select: none;
}
.filter-option:hover { background: var(--surface); color: var(--text); }
.filter-option.selected {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent-border);
}
.filter-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.filter-option.selected .filter-count { color: var(--accent); }

.filter-range { display: flex; gap: 8px; }
.filter-range input {
  flex: 1;
  width: 0;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  transition: border-color var(--t-fast);
}
.filter-range input:focus { border-color: var(--accent-border); }

.filter-search {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  outline: none;
  margin-bottom: 24px;
  transition: border-color var(--t-fast);
}
.filter-search:focus { border-color: var(--accent-border); }

/* List toolbar */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}
.list-count { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.list-count strong { color: var(--text); font-weight: 700; }

.sort-dropdown select {
  padding: 8px 36px 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8d96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.sort-dropdown select:hover { border-color: var(--border-strong); }

/* List rows (denser than cards, shown on wider viewports) */
.server-row {
  display: grid;
  grid-template-columns: 40px 1fr 160px 100px 80px 90px;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.server-row:hover { border-color: var(--border-strong); background: var(--surface-hover); }

.server-row-rank {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  font-weight: 600;
}
.server-row-main { min-width: 0; }
.server-row-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.server-row-tags { display: flex; gap: 4px; flex-wrap: wrap; max-height: 18px; overflow: hidden; }
.server-row-tags .tag { font-size: 10px; padding: 2px 6px; }

.server-row-players { font-family: var(--font-mono); font-size: 14px; font-weight: 600; text-align: right; }
.server-row-players .max { color: var(--text-dim); font-weight: 400; }
.server-row-mini-bar { height: 2px; background: var(--border); border-radius: 100px; margin-top: 4px; overflow: hidden; }
.server-row-mini-bar-fill { height: 100%; background: var(--accent); }

.server-row-trend { text-align: right; }
.server-row-meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); text-align: center; text-transform: uppercase; }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.pagination button:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); }
.pagination button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.pagination button:disabled { opacity: 0.35; cursor: not-allowed; }

/* ==========================================================================
   Server detail page
   ========================================================================== */

.detail-hero { padding: 48px 0 32px; border-bottom: 1px solid var(--border); }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
  font-family: var(--font-mono);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text); }

.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.detail-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--success-dim);
  color: var(--success);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.detail-status.offline { background: var(--danger-dim); color: var(--danger); }
.detail-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

.detail-title {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 12px;
  color: var(--text);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-endpoint {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.detail-endpoint:hover { border-color: var(--border-strong); color: var(--text); }

.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--t-fast);
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--border-strong); background: var(--surface-hover); }

/* Detail stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 32px 0;
}
.stat-cell {
  background: var(--bg-elevated);
  padding: 20px;
}
.stat-cell-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.stat-cell-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}
.stat-cell-sub {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

/* Chart */
.chart-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 8px;
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.chart-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.chart-range-tabs { display: flex; gap: 4px; }
.chart-range-tab {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--t-fast);
}
.chart-range-tab:hover { color: var(--text); border-color: var(--border-strong); }
.chart-range-tab.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-border); }

.chart-canvas-wrap { position: relative; height: 320px; }

/* Info cards */
.info-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-top: 32px;
}
.info-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.info-panel h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  font-family: var(--font-mono);
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-row-label { color: var(--text-muted); }
.info-row-value { font-family: var(--font-mono); color: var(--text); font-weight: 500; }
.info-row-value a { color: var(--accent); }
.info-row-value a:hover { text-decoration: underline; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ==========================================================================
   Loading + empty states
   ========================================================================== */

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  height: 180px;
  border-radius: var(--radius-lg);
}

.empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}
.empty-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-desc { font-size: 14px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 200ms, transform 200ms;
  pointer-events: none;
  z-index: 1000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 80px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-inner p { font-size: 13px; color: var(--text-dim); }
.footer-links { display: flex; gap: 20px; font-size: 13px; }
.footer-links a { color: var(--text-muted); transition: color var(--t-fast); }
.footer-links a:hover { color: var(--accent); }

/* ==========================================================================
   Entry animations
   ========================================================================== */

.fade-in { animation: fadeIn 400ms var(--ease) both; }
.fade-up { animation: fadeUp 500ms var(--ease) both; }
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.stagger > * { animation: fadeUp 400ms var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 40ms; }
.stagger > *:nth-child(3) { animation-delay: 80ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; }
.stagger > *:nth-child(6) { animation-delay: 200ms; }
.stagger > *:nth-child(7) { animation-delay: 240ms; }
.stagger > *:nth-child(8) { animation-delay: 280ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

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

@media (max-width: 960px) {
  .filters-layout { grid-template-columns: 1fr; }
  .filters-sidebar {
    position: static;
    max-height: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    background: var(--bg-elevated);
    margin-bottom: 24px;
  }
  .info-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .live-stats { grid-template-columns: repeat(2, 1fr); }
  .server-row {
    grid-template-columns: 30px 1fr 100px 70px;
    padding: 12px 14px;
  }
  .server-row-lang-cell, .server-row-trend { display: none; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .hero { padding: 48px 0 32px; }
  .section { padding: 40px 0; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .header-inner { gap: 12px; height: 56px; }
  .nav { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--bg-elevated); border-bottom: 1px solid var(--border); flex-direction: column; padding: 8px; }
  .nav.open { display: flex; }
  .nav a { width: 100%; }
  .nav-toggle { display: flex; }
  .header-actions .status-pill { display: none; }
  .live-stats { grid-template-columns: 1fr 1fr; }
  .live-stat { padding: 20px 16px; }
  .live-stat-value { font-size: 24px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1; justify-content: center; }
  .server-row { grid-template-columns: 1fr 70px; }
  .server-row-rank, .server-row-meta, .server-row-trend, .server-row-lang-cell { display: none; }
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
