:root {
  --bg: #0a0e1a;
  --bg-soft: #0f1629;
  --panel: rgba(15, 22, 41, 0.85);
  --line: rgba(255, 255, 255, 0.07);
  --text: #f0f4fc;
  --muted: #7b8fad;
  --primary: #10b981;
  --primary-dim: rgba(16, 185, 129, 0.15);
  --secondary: #f59e0b;
  --secondary-dim: rgba(245, 158, 11, 0.12);
  --diamond: #60a5fa;
  --diamond-dim: rgba(96, 165, 250, 0.12);
  --danger: #ef4444;
  --shadow: 0 25px 80px rgba(0, 0, 0, 0.45);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
}

* { box-sizing: border-box; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(16, 185, 129, 0.10), transparent 45%),
    radial-gradient(ellipse at 80% 5%, rgba(245, 158, 11, 0.08), transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(96, 165, 250, 0.06), transparent 50%),
    linear-gradient(180deg, #060a14 0%, #0a0e1a 40%, #0d1220 100%);
  background-attachment: fixed;
}

body.modal-open { overflow: hidden; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent 60%);
}

.shell {
  width: min(1320px, calc(100% - 32px));
  margin: 28px auto 48px;
}

/* ─── Shared panel style ─── */
.hero-copy,
.featured-panel,
.top-card,
.server-row,
.details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

/* ─── Hero ─── */
.hero {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-copy {
  padding: 36px;
  position: relative;
  overflow: hidden;
}

.hero-copy::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  right: -100px;
  top: -100px;
  background: radial-gradient(circle, var(--primary-dim), transparent 70%);
  pointer-events: none;
}

.hero-title-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.hero-logo {
  width: clamp(56px, 6vw, 78px);
  height: clamp(56px, 6vw, 78px);
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  image-rendering: pixelated;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  font-size: clamp(2rem, 6vw, 3.8rem);
  line-height: 0.95;
  margin-bottom: 14px;
  font-weight: 800;
  background: linear-gradient(180deg, #ffffff 0%, #a7f3d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

h2 { font-size: 1.5rem; margin-bottom: 8px; font-weight: 700; }

.hero-text {
  color: var(--muted);
  max-width: 34rem;
  line-height: 1.65;
  margin-bottom: 24px;
}

/* ─── Hero Stats ─── */
.hero-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  min-width: 100px;
}

.hero-stat:nth-child(1) { border-color: var(--primary-dim); }
.hero-stat:nth-child(2) { border-color: var(--secondary-dim); }
.hero-stat:nth-child(3) { border-color: var(--diamond-dim); }

.hero-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.hero-stat:nth-child(1) .hero-stat-value { color: var(--primary); }
.hero-stat:nth-child(2) .hero-stat-value { color: var(--secondary); }
.hero-stat:nth-child(3) .hero-stat-value { color: var(--diamond); }

.hero-stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 2px;
}

/* ─── Featured panel ─── */
.featured-panel {
  padding: 32px;
  position: relative;
  overflow: hidden;
  min-height: 320px;
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(16, 185, 129, 0.08),
    0 0 60px rgba(16, 185, 129, 0.06);
}

.featured-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.04), transparent 42%),
    radial-gradient(circle at 84% 20%, rgba(245, 158, 11, 0.12), transparent 30%),
    radial-gradient(circle at 16% 14%, rgba(16, 185, 129, 0.10), transparent 28%);
  pointer-events: none;
}

.featured-banner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.featured-server-line {
  display: flex;
  gap: 14px;
  align-items: center;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.15);
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--primary);
  box-shadow: 0 0 0 5px var(--primary-dim);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 5px var(--primary-dim); }
  50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.08); }
}

.featured-name {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  margin-bottom: 6px;
  font-weight: 800;
}

.featured-address {
  color: var(--muted);
  margin-bottom: 24px;
}

.featured-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.stat-box {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 6px;
  font-weight: 600;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
}

/* ─── Player bar ─── */
.player-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
}

.player-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), #34d399);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 2px;
}

/* ─── Main layout ─── */
.main-stack {
  display: grid;
  gap: 28px;
}

.section-heading { padding: 6px 4px 0; }

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

/* ─── Search bar ─── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  min-width: 260px;
  transition: border-color 0.2s;
}

.search-bar:focus-within {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

.search-icon { color: var(--muted); flex-shrink: 0; }

.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.92rem;
  width: 100%;
  font-family: inherit;
}

.search-bar input::placeholder { color: rgba(255, 255, 255, 0.35); }

.list-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sort-select {
  appearance: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  padding: 10px 36px 10px 14px;
  cursor: pointer;
  transition: border-color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%237b8fad' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.sort-select:hover,
.sort-select:focus {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
  outline: none;
}

.sort-select option {
  background: #0f1629;
  color: var(--text);
}

/* ─── Refresh countdown bar ─── */
.refresh-bar-wrap {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  margin-top: 6px;
  overflow: hidden;
}

.refresh-bar {
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--diamond));
  transform-origin: left;
  animation: refreshDrain var(--refresh-ms, 30000ms) linear forwards;
}

@keyframes refreshDrain {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ─── Discover button ─── */
.discover-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(96, 165, 250, 0.25);
  background: rgba(96, 165, 250, 0.08);
  color: var(--diamond);
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s, border-color 0.25s, box-shadow 0.25s, color 0.25s;
}

.discover-btn svg {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.discover-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(96, 165, 250, 0.25), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}

.discover-btn:hover::before { opacity: 1; }

.discover-btn:hover {
  background: rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.5);
  color: #93c5fd;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(96, 165, 250, 0.2), 0 0 10px rgba(96, 165, 250, 0.1);
}

.discover-btn:hover svg {
  transform: rotate(180deg);
}

.discover-btn:active {
  transform: translateY(0) scale(0.96);
  box-shadow: none;
  transition-duration: 0.1s;
}

.discover-btn.spin svg {
  animation: diceSpin 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes diceSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(360deg) scale(1.3); }
  100% { transform: rotate(720deg) scale(1); }
}

/* ─── Top 3 ─── */
.top-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.top-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  min-height: 240px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.top-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 30px var(--primary-dim);
  border-color: rgba(16, 185, 129, 0.3);
}

.top-card::before {
  content: "";
  position: absolute;
  inset: auto -20% -50% auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  opacity: 0.6;
  pointer-events: none;
}

.top-card:nth-child(1)::before { background: radial-gradient(circle, rgba(245, 158, 11, 0.4), transparent 70%); }
.top-card:nth-child(2)::before { background: radial-gradient(circle, rgba(192, 192, 210, 0.3), transparent 70%); }
.top-card:nth-child(3)::before { background: radial-gradient(circle, rgba(180, 120, 60, 0.35), transparent 70%); }

.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 14px;
  width: fit-content;
  border: 1px solid;
}

.rank-gold {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.25);
}

.rank-silver {
  color: #c0c0d2;
  background: rgba(192, 192, 210, 0.10);
  border-color: rgba(192, 192, 210, 0.20);
}

.rank-bronze {
  color: #d4915e;
  background: rgba(180, 120, 60, 0.12);
  border-color: rgba(180, 120, 60, 0.22);
}

.rank-default {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.server-title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.server-title h3 { margin-bottom: 2px; font-weight: 700; }

.muted, .address { color: var(--muted); }

.top-card .players-line {
  margin-top: 16px;
  font-size: 1.1rem;
}

.top-card .peak-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--secondary);
  background: var(--secondary-dim);
  border: 1px solid rgba(245, 158, 11, 0.18);
}

/* ─── Server list ─── */
.server-list {
  display: grid;
  gap: 10px;
}

.server-row {
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  text-align: left;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.server-row:hover {
  transform: translateY(-3px);
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(18, 34, 57, 0.95);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(16, 185, 129, 0.08);
}

.server-row:active {
  transform: translateY(0);
  box-shadow: none;
  transition-duration: 0.1s;
}

.server-name-line {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 4px;
}

.server-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  image-rendering: pixelated;
}

.server-icon.online-glow {
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.server-icon.fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
  font-weight: 600;
}

.pill-online {
  color: var(--primary);
  border-color: var(--primary-dim);
  background: rgba(16, 185, 129, 0.06);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  animation: pulseOnline 2.5s ease-in-out infinite;
}

@keyframes pulseOnline {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
  50% { box-shadow: 0 0 8px 2px rgba(16, 185, 129, 0.15); }
}

.pill-offline {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.15);
  background: rgba(239, 68, 68, 0.05);
}

.players {
  text-align: right;
}

.big-value {
  font-size: 1.5rem;
  font-weight: 800;
}

.mini-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 6px;
  font-weight: 600;
}

.row-peak {
  font-size: 0.75rem;
  color: var(--secondary);
  font-weight: 600;
}

/* ─── Details modal ─── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 16, 0.75);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 30;
  animation: backdropIn 0.25s ease;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-backdrop.is-hidden { display: none; }

.modal-shell {
  width: min(1000px, 100%);
  max-height: min(90vh, 920px);
  position: relative;
  animation: modalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-shell .details {
  max-height: min(90vh, 920px);
  overflow: auto;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  color: var(--muted);
  transition: background 0.25s, color 0.25s, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s, box-shadow 0.25s;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
  transform: rotate(90deg);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}
.modal-close:active {
  transform: rotate(90deg) scale(0.9);
  transition-duration: 0.1s;
}

.details {
  padding: 32px 28px 24px;
}

.details-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-right: 56px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.detail-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.details-chips {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.details-chip {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
  line-height: 1.6;
}

.motd-chip { line-height: 1.7; }
.motd-label { color: var(--text); font-weight: 700; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.10);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  transition: background 0.2s, transform 0.15s;
  margin-left: 12px;
}

.copy-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(16, 185, 129, 0.25) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.copy-btn:hover::before { transform: translateX(100%); }
.copy-btn:hover {
  background: rgba(16, 185, 129, 0.20);
  border-color: rgba(16, 185, 129, 0.5);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25), 0 0 8px rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}
.copy-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: none;
  transition-duration: 0.1s;
}
.copy-btn.copied {
  color: #34d399;
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.version-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--secondary);
  background: var(--secondary-dim);
  border: 1px solid rgba(245, 158, 11, 0.18);
}

/* ─── Chart ─── */
.chart-box {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  position: relative;
}

.chart {
  width: 100%;
  height: 280px;
  display: block;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-top: 10px;
  font-size: 0.82rem;
  gap: 10px;
  flex-wrap: wrap;
}

.chart-axis-text {
  fill: var(--muted);
  font-size: 11px;
  font-family: inherit;
}

.chart-point { cursor: pointer; }

.chart-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 220px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.25);
  background: linear-gradient(180deg, rgba(15, 22, 41, 0.98), rgba(10, 14, 26, 0.98));
  color: var(--text);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 3;
  font-size: 0.85rem;
  line-height: 1.35;
}

.chart-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: rgba(10, 14, 26, 0.98);
  border-right: 1px solid rgba(16, 185, 129, 0.2);
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
  transform: translateX(-50%) rotate(45deg);
}

.chart-tooltip.is-visible { opacity: 1; transform: translateY(0); }
.chart-tooltip.is-below::after { top: -6px; bottom: auto; transform: translateX(-50%) rotate(225deg); }

/* ─── Footer ─── */
.site-footer {
  margin-top: 32px;
  padding: 20px 8px 8px;
  color: var(--muted);
  text-align: center;
}

.site-footer p { margin: 0; line-height: 1.7; }
.footer-bot-info { font-weight: 600; color: var(--text); margin-top: 4px; }

/* ─── Minecraft text ─── */
.minecraft-text {
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}

.mc-color-black { color: #d9e1ef; }
.mc-color-dark-blue { color: #8ab4ff; }
.mc-color-dark-green { color: #7ef0a4; }
.mc-color-dark-aqua { color: #78f0eb; }
.mc-color-dark-red { color: #ff8d8d; }
.mc-color-dark-purple { color: #d9a3ff; }
.mc-color-gold { color: #ffd36e; }
.mc-color-gray { color: #d2d9e6; }
.mc-color-dark-gray { color: #9fb0cc; }
.mc-color-blue { color: #8ab4ff; }
.mc-color-green { color: #8fffb1; }
.mc-color-aqua { color: #7df9ff; }
.mc-color-red { color: #ff8b8b; }
.mc-color-light-purple { color: #ff9df1; }
.mc-color-yellow { color: #fff27b; }
.mc-color-white { color: #f4f7fb; }
.mc-bold { font-weight: 700; }
.mc-italic { font-style: italic; }
.mc-underline { text-decoration: underline; }
.mc-strike { text-decoration: line-through; }
.mc-obfuscated { text-shadow: 0 0 6px currentColor; }

/* ─── Animations ─── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.hero-copy { animation: fadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.featured-panel { animation: scaleIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.15s backwards; }
.section-heading { animation: fadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.2s backwards; }
.list-head { animation: fadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.25s backwards; }
.hero-stats .hero-stat { animation: fadeSlideIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.hero-stats .hero-stat:nth-child(1) { animation-delay: 0.1s; }
.hero-stats .hero-stat:nth-child(2) { animation-delay: 0.18s; }
.hero-stats .hero-stat:nth-child(3) { animation-delay: 0.26s; }

.top-card {
  animation: fadeSlideIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(0.1s + var(--i, 0) * 0.09s);
}

.server-row {
  animation: fadeSlideIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(0.05s + var(--i, 0) * 0.04s);
}

.server-row:nth-child(n+15) {
  animation-delay: calc(0.05s + 14 * 0.04s);
}

/* ─── Lookup CTA ─── */
.lookup-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 18px 24px;
  margin-top: 12px;
  border-radius: var(--radius);
  border: 1px dashed rgba(96, 165, 250, 0.3);
  background: rgba(96, 165, 250, 0.04);
  color: var(--diamond);
  font-size: 1rem;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s, border-color 0.25s, box-shadow 0.25s, color 0.25s;
  animation: fadeSlideIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.8s backwards;
}

.lookup-cta::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.15), transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1), height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.lookup-cta:hover::before { width: 600px; height: 600px; }

.lookup-cta:hover {
  background: rgba(96, 165, 250, 0.10);
  border-color: rgba(96, 165, 250, 0.5);
  border-style: solid;
  color: #93c5fd;
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(96, 165, 250, 0.15), 0 0 20px rgba(96, 165, 250, 0.08);
}

.lookup-cta:hover svg {
  animation: lookupPulse 0.6s ease;
}

.lookup-cta:active {
  transform: translateY(0) scale(0.98);
  box-shadow: none;
  transition-duration: 0.1s;
}

@keyframes lookupPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.25) rotate(-10deg); }
  100% { transform: scale(1); }
}

/* ─── Lookup modal ─── */
.lookup-shell { max-width: 560px; }

.lookup-content {
  padding: 32px 28px 24px;
}

.lookup-content h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.lookup-content > .muted {
  margin-bottom: 20px;
}

.lookup-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.lookup-input-row input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lookup-input-row input:focus {
  border-color: rgba(96, 165, 250, 0.5);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.lookup-go {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.12);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
}

.lookup-go::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(16, 185, 129, 0.2) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.lookup-go:hover::before { transform: translateX(100%); }

.lookup-go:hover {
  background: rgba(16, 185, 129, 0.20);
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
}

.lookup-go:active {
  transform: translateY(0) scale(0.96);
  box-shadow: none;
  transition-duration: 0.1s;
}

.lookup-go:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ─── Lookup result ─── */
.lookup-result {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 20px;
  animation: fadeSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.lookup-result .lookup-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.lookup-result .lookup-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xs);
  object-fit: cover;
}

.lookup-result .lookup-icon-fallback {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--muted);
}

.lookup-result .lookup-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.lookup-result .lookup-stat {
  text-align: center;
  padding: 10px 6px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.lookup-result .lookup-stat .mini-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.lookup-result .lookup-stat .big-value {
  font-size: 1.2rem;
}

.lookup-error {
  text-align: center;
  padding: 20px;
  color: var(--danger);
  animation: fadeSlideIn 0.3s ease;
}

.lookup-loading {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  animation: fadeIn 0.3s ease;
}

.lookup-loading .spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Responsive ─── */
@media (max-width: 1040px) {
  .hero, .top-grid { grid-template-columns: 1fr; }
  .details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 16px, 100%);
    margin: 12px auto 24px;
  }

  .hero-copy, .featured-panel, .details, .server-row, .top-card {
    border-radius: 16px;
  }

  .hero-copy { padding: 24px 18px; }
  .hero-title-row { gap: 12px; }
  .hero-logo { width: 48px; height: 48px; border-radius: 12px; }
  .hero-stats { gap: 8px; }
  .hero-stat { padding: 10px 14px; min-width: 80px; }
  .hero-stat-value { font-size: 1.2rem; }

  .featured-panel { padding: 22px; min-height: 0; }
  .featured-stats { grid-template-columns: 1fr; }

  .list-head { flex-direction: column; align-items: stretch; }
  .list-controls { flex-direction: column; }
  .search-bar { min-width: 0; }
  .sort-select { width: 100%; }
  .discover-btn { width: 100%; justify-content: center; }

  .server-row { grid-template-columns: 1fr; gap: 10px; }
  .players { text-align: left; }

  .details-grid { grid-template-columns: 1fr; }
  .details-head { padding-right: 50px; }
  .details { padding: 24px 18px 18px; }

  .modal-backdrop { padding: 8px; }
  .modal-shell { width: min(95vw, 100%); }
}
