:root {
  color-scheme: dark;
  --bg: #030914;
  --panel: rgba(10, 28, 49, 0.68);
  --panel-strong: rgba(12, 35, 62, 0.82);
  --stroke: rgba(96, 166, 255, 0.18);
  --stroke-strong: rgba(96, 166, 255, 0.34);
  --text: #f6f9ff;
  --muted: #aeb9cc;
  --blue: #4f9cff;
  --blue-soft: #1b6ff2;
  --green: #2fe279;
  --red: #ff454f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -8%, rgba(74, 148, 255, 0.26), transparent 34rem),
    radial-gradient(circle at 20% 82%, rgba(0, 150, 255, 0.12), transparent 28rem),
    linear-gradient(145deg, #020712 0%, #06172a 52%, #03101d 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(rgba(255,255,255,0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent 72%);
}

.page-shell {
  width: min(1430px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 38px;
}

.hero {
  display: grid;
  justify-items: center;
  text-align: center;
  padding-top: 4px;
}

.logo {
  width: clamp(96px, 9vw, 138px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(79, 156, 255, 0.48));
}

h1 {
  margin: 6px 0 4px;
  font-size: clamp(2.6rem, 5.2vw, 4.35rem);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
}

h1 span,
.updated strong {
  color: var(--blue);
}

.hero p {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.28rem);
}

.updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.7vw, 1.08rem);
}

.updated svg,
.metric svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.summary,
.servers-panel,
.footer-actions {
  margin-top: 28px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(7, 22, 41, 0.74), rgba(7, 24, 45, 0.5));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}

.metric {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 106px;
  padding: 22px;
  border-right: 1px solid rgba(96, 166, 255, 0.15);
}

.metric:last-child {
  border-right: 0;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.metric span {
  display: block;
  color: #d0d8e7;
  font-size: 1rem;
}

.metric strong {
  display: block;
  margin-top: 2px;
  font-size: 2.25rem;
  line-height: 1;
}

.metric-online .metric-icon {
  color: var(--green);
  border: 1px solid rgba(47, 226, 121, 0.28);
  background: rgba(47, 226, 121, 0.12);
}

.metric-online strong {
  color: var(--green);
}

.metric-offline .metric-icon {
  color: var(--red);
  border: 1px solid rgba(255, 69, 79, 0.3);
  background: rgba(255, 69, 79, 0.12);
}

.metric-offline strong {
  color: var(--red);
}

.metric-total .metric-icon {
  color: var(--blue);
  border: 1px solid rgba(79, 156, 255, 0.34);
  background: rgba(79, 156, 255, 0.14);
}

.metric-total strong {
  color: var(--blue);
}

.servers-panel {
  padding: 22px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(8, 25, 45, 0.82), rgba(4, 17, 31, 0.64));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}

.servers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.server {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 46px;
  gap: 14px;
  padding: 8px 10px 8px 14px;
  border: 1px solid rgba(96, 166, 255, 0.12);
  border-radius: 8px;
  background: rgba(9, 27, 49, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.server-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
  font-size: 1.08rem;
  font-weight: 650;
}

.flag {
  width: 28px;
  flex: 0 0 28px;
  font-size: 1.3rem;
  line-height: 1;
  text-align: center;
}

.title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 30px;
  padding: 0 10px;
  flex: 0 0 auto;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 800;
}

.is-online .status-badge {
  color: var(--green);
  border: 1px solid rgba(47, 226, 121, 0.2);
  background: rgba(47, 226, 121, 0.12);
  box-shadow: 0 0 20px rgba(47, 226, 121, 0.08);
}

.is-offline .status-badge {
  color: var(--red);
  border: 1px solid rgba(255, 69, 79, 0.24);
  background: rgba(255, 69, 79, 0.12);
  box-shadow: 0 0 20px rgba(255, 69, 79, 0.08);
}

.empty {
  grid-column: 1 / -1;
  min-height: 90px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed rgba(96, 166, 255, 0.2);
  border-radius: 8px;
}

.servers[data-error="true"] .empty {
  color: var(--red);
}

.footer-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding-bottom: 6px;
}

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--stroke-strong);
  border-radius: 8px;
  color: var(--text);
  background: rgba(8, 25, 45, 0.72);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
  text-decoration: none;
  font-weight: 750;
}

.action-primary {
  border-color: rgba(79, 156, 255, 0.46);
  background: linear-gradient(135deg, var(--blue-soft), #2d8cff);
  box-shadow: 0 18px 46px rgba(45, 140, 255, 0.22);
}

.action:hover {
  transform: translateY(-1px);
  transition: transform 160ms ease, border-color 160ms ease;
  border-color: rgba(79, 156, 255, 0.72);
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 28px, 720px);
    padding-top: 30px;
  }

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

  .metric {
    justify-content: flex-start;
    border-right: 0;
    border-bottom: 1px solid rgba(96, 166, 255, 0.15);
  }

  .metric:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 20px, 430px);
    padding: 24px 0 28px;
  }

  .hero p {
    max-width: 330px;
  }

  .updated {
    flex-wrap: wrap;
    justify-content: center;
  }

  .servers-panel {
    padding: 12px;
  }

  .servers {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .server {
    min-height: 42px;
    padding: 7px 8px 7px 10px;
  }

  .server-name {
    gap: 8px;
    font-size: 1rem;
  }

  .status-badge {
    min-width: 72px;
    min-height: 28px;
    font-size: 0.78rem;
  }

  .footer-actions {
    flex-direction: column;
  }

  .action {
    width: 100%;
  }
}
