:root {
  --bg: #0b1120;
  --panel: #131c31;
  --panel-2: #1a2742;
  --border: #2b3a5f;
  --text: #eef4ff;
  --muted: #a7b6d4;
  --accent: #60a5fa;
  --accent-2: #93c5fd;
  --good: #22c55e;
  --bad: #ef4444;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top, rgba(96, 165, 250, 0.14), transparent 30%),
    linear-gradient(180deg, #0b1120 0%, #0a1020 100%);
  color: var(--text);
}

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

.container {
  width: min(1150px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(11, 17, 32, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  transition: 0.2s ease;
}

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

.hero {
  padding: 34px 0 18px;
}

.hero-card {
  background: linear-gradient(
    180deg,
    rgba(26, 39, 66, 0.95),
    rgba(19, 28, 49, 0.96)
  );
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.banner-placeholder {
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(
      135deg,
      rgba(96, 165, 250, 0.25),
      rgba(147, 197, 253, 0.08)
    ),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.03) 0 14px,
      rgba(255, 255, 255, 0.01) 14px 28px
    );
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.banner-inner {
  max-width: 760px;
}

.banner-tag {
  display: inline-block;
  margin-bottom: 14px;
  padding: 7px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.banner-placeholder h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
}

.banner-placeholder p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
}

.hero-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  padding: 24px;
}

.hero-left h2 {
  margin: 0 0 10px;
  font-size: 1.7rem;
}

.hero-left p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent), #3b82f6);
  color: white;
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.28);
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.07);
}

.hero-right {
  display: grid;
  gap: 12px;
  align-content: start;
}

.mini-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 16px;
}

.mini-panel h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.mini-panel p,
.mini-panel li {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.mini-panel ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.section {
  padding: 28px 0;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-title h2 {
  margin: 0;
  font-size: 1.7rem;
}

.section-title p {
  margin: 0;
  color: var(--muted);
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  overflow: visible;
  height: 100%;
  z-index: 0;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;

  background: linear-gradient(
    180deg,
    rgba(19, 28, 49, 0.98),
    rgba(17, 24, 39, 0.98)
  );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  z-index: 100;
}

.card-shell {
  position: relative;
  border-radius: inherit;
  overflow: visible;
  height: 100%;
}

.card-inner {
  padding: 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-top {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 12px;
  margin-bottom: 14px;
}

.server-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

.accent-sb3 {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.accent-evo {
  background: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.accent-play {
  background: #eab308;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.4);
}

.accent-offline {
  background: #ef4444;
}

.server-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.server-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0f172a;
  object-fit: contain;
  padding: 4px;
  flex-shrink: 0;
}

.server-name {
  margin: 0;
  font-size: 1.2rem;
}

.pack-version {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(96, 165, 250, 0.15);
  color: #bfdbfe;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(96, 165, 250, 0.18);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

a.pack-version:hover {
  background: rgba(96, 165, 250, 0.24);
  border-color: rgba(96, 165, 250, 0.32);
  transform: translateY(-1px);
}

.pack-version .ext-icon {
  width: 12px;
  height: 12px;
  opacity: 0.8;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.pack-version:hover .ext-icon {
  transform: translate(1px, -1px);
  opacity: 1;
}

.server-subtitle-wrapper {
  position: relative;
}

.server-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 84px;
  position: relative;
}

.server-subtitle-tooltip {
  position: absolute;
  top: 0;
  left: -12px;
  width: 340px;
  max-width: min(340px, calc(100vw - 32px));
  background: rgba(11, 17, 32, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition:
    opacity 0.2s ease 2s,
    transform 0.2s ease 2s,
    visibility 0s linear 2s;
}

.server-subtitle-wrapper.tooltip-left .server-subtitle-tooltip {
  left: auto;
  right: -12px;
}

.subtitle-expandable {
  cursor: help;
}

.subtitle-expandable:hover {
  z-index: 50;
}

.subtitle-expandable:hover .server-subtitle-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.subtitle-expandable:not(:hover) .server-subtitle-tooltip {
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    visibility 0s linear 0.15s;
}

.subtitle-expandable .server-subtitle::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.8em;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(19, 28, 49, 0),
    rgba(19, 28, 49, 0.92) 70%,
    rgba(19, 28, 49, 1)
  );
}

.card-bottom {
  margin-top: auto;
}

.status-pill {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  align-self: center;
}

.status-pill.online {
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.3);
}

.status-pill.offline {
  color: #fee2e2;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.3);
}

.server-meta {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.meta-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  align-items: start;
}

.meta-label {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

.meta-value {
  display: flex;
  align-items: center;
  gap: 8px;
}

code.join-code {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #dbeafe;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.92rem;
}

.motd {
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 48px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 14px;
}

.small-btn {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  transition: 0.2s ease;
}

.small-btn:hover {
  background: rgba(255, 255, 255, 0.07);
}

.small-btn.primary {
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(96, 165, 250, 0.35);
  color: #dbeafe;
}

.small-btn.primary:hover {
  background: rgba(96, 165, 250, 0.24);
}

.notice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.footer {
  padding: 28px 0 40px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.loading {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.network-stats {
  display: flex;
  gap: 32px;
  margin-top: 14px;
  align-items: center;
  justify-content: center;
}

.network-stat {
  display: flex;
  flex-direction: column;
}

.network-stat span {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}

.network-stat label {
  font-size: 0.85rem;
  color: var(--muted);
}

.player-heads {
  display: flex;
  gap: 3px;
}

.player-heads img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  image-rendering: pixelated;
  border: 1px solid rgba(255,255,255,0.15);
  background: #0f172a;
  margin-left: -4px;
}

.player-heads img:first-child {
  margin-left: 0;
}

.player-heads img:hover {
  transform: translateY(-2px) scale(1.1);
  border-color: rgba(255,255,255,0.35);
}

@media (max-width: 900px) {
  .hero-content,
  .notice-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .nav {
    justify-content: center;
  }

  .meta-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .banner-placeholder {
    min-height: 200px;
  }

  .server-subtitle-tooltip {
    left: 0;
    right: auto;
    width: min(92vw, 340px);
  }

  .server-subtitle-wrapper.tooltip-left .server-subtitle-tooltip {
    left: auto;
    right: 0;
  }
}
