:root {
  --bg: #07111f;
  --panel: rgba(14, 27, 47, 0.82);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f7fb;
  --muted: #95a8c7;
  --glow: #6ef3d6;
  --shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

button {
  font: inherit;
  color: inherit;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(110, 243, 214, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(255, 138, 61, 0.18), transparent 28%),
    linear-gradient(135deg, #050b15 0%, #091120 55%, #07111f 100%);
}

body.modal-open {
  overflow: hidden;
}

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

.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 24px auto 40px;
}

.hero,
.top-card,
.server-row,
.details,
.hero-copy,
.featured-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

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

.hero-copy::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -80px;
  top: -80px;
  background: radial-gradient(circle, rgba(110, 243, 214, 0.28), transparent 70%);
}

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

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

h1 {
  font-family: "Trebuchet MS", "Arial Narrow", "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
  font-size: clamp(2rem, 6.4vw, 4rem);
  line-height: 0.92;
  margin-bottom: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #b8fff1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  text-transform: lowercase;
}

h2 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

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

.hero-text {
  max-width: 34rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

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

.hero-meta span,
.pill,
.rank-badge,
.details-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  font-size: 0.92rem;
}

.featured-panel {
  padding: 30px;
  position: relative;
  overflow: hidden;
  min-height: 320px;
  border-color: rgba(110, 243, 214, 0.32);
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(110, 243, 214, 0.12),
    0 0 56px rgba(110, 243, 214, 0.1);
}

.featured-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.06), transparent 42%),
    radial-gradient(circle at 84% 20%, rgba(255, 138, 61, 0.2), transparent 30%),
    radial-gradient(circle at 16% 14%, rgba(110, 243, 214, 0.16), transparent 28%);
  pointer-events: none;
}

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

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff6b6b;
  box-shadow: 0 0 0 6px rgba(255, 107, 107, 0.14);
}

.status-dot.online {
  background: var(--glow);
  box-shadow: 0 0 0 6px rgba(110, 243, 214, 0.14);
}

.featured-name {
  font-size: clamp(2.2rem, 5vw, 4rem);
  margin-bottom: 8px;
}

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

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

.stat-box,
.detail-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  padding: 16px;
}

.stat-label,
.mini-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 8px;
}

.stat-value,
.big-value {
  font-size: 1.7rem;
  font-weight: 700;
}

.main-stack {
  display: grid;
  gap: 24px;
}

.site-footer {
  margin-top: 28px;
  padding: 18px 8px 4px;
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  margin: 0;
  line-height: 1.7;
}

.site-footer strong {
  color: var(--text);
  font-weight: 700;
}

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

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

.top-card {
  padding: 18px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  min-height: 250px;
}

.top-card::before {
  content: "";
  position: absolute;
  inset: auto -20% -50% auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110, 243, 214, 0.35), transparent 70%);
}

.rank-badge {
  margin-bottom: 18px;
  width: fit-content;
}

.server-list {
  display: grid;
  gap: 14px;
}

.server-row {
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.server-row:hover,
.server-row.active {
  transform: translateY(-2px);
  border-color: rgba(110, 243, 214, 0.4);
  background: rgba(18, 34, 57, 0.96);
}

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

.server-name-line {
  margin-bottom: 6px;
}

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

.server-icon.fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-weight: 700;
}

.players {
  text-align: right;
}

.details {
  padding: 28px 22px 22px;
}

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

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

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

.rating-box {
  margin-top: 16px;
  margin-bottom: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.rating-status {
  margin-bottom: 6px;
  color: var(--glow);
  font-size: 0.88rem;
  font-weight: 700;
}

.rating-label {
  margin-bottom: 6px;
  font-size: 14px;
}

.stars {
  display: flex;
  gap: 6px;
}

.star {
  font-size: 22px;
  cursor: pointer;
  color: #888;
  transition: 0.2s;
  user-select: none;
}

.star:hover {
  color: gold;
}

.login-btn {
  display: inline-block;
  padding: 8px 14px;
  background: #5865F2;
  color: white;
  border-radius: 6px;
  text-decoration: none;
}

.motd-chip {
  display: block;
  border-radius: 24px;
  line-height: 1.7;
}

.motd-label {
  color: var(--text);
}

.chart-box {
  border-radius: 24px;
  border: 1px solid var(--line);
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
  position: relative;
}

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

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

.chart-axis-text {
  fill: #95a8c7;
  font-size: 11px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.chart-point {
  cursor: pointer;
}

.chart-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 220px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(110, 243, 214, 0.28);
  background: linear-gradient(180deg, rgba(15, 29, 49, 0.98), rgba(9, 18, 32, 0.98));
  color: var(--text);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(110, 243, 214, 0.08);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 3;
  font-size: 0.88rem;
  line-height: 1.35;
}

.chart-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: #0d1a2c;
  border-right: 1px solid rgba(110, 243, 214, 0.22);
  border-bottom: 1px solid rgba(110, 243, 214, 0.22);
  transform: translateX(-50%) rotate(45deg);
}

.chart-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.chart-tooltip.is-below::after {
  top: -7px;
  bottom: auto;
  transform: translateX(-50%) rotate(225deg);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 16, 0.72);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 30;
}

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

.modal-shell {
  width: min(980px, 100%);
  max-height: min(90vh, 920px);
  position: relative;
}

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

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  z-index: 2;
}

.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; }

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

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

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

  .featured-stats,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .server-row {
    grid-template-columns: 1fr;
  }

  .players {
    text-align: left;
  }

  .hero-copy {
    padding: 24px 20px;
  }

  .featured-panel {
    padding: 22px;
    min-height: 0;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .details-head {
    padding-right: 58px;
  }
}

.login-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 16px;
  background: #5865F2;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.2s;
}

.login-btn:hover {
  background: #4752c4;
}
