:root {
  color-scheme: dark;
  --ink: #03050a;
  --panel: rgba(7, 14, 25, 0.92);
  --cyan: #74eeff;
  --cyan-hot: #d9fbff;
  --violet: #a46cff;
  --coral: #ff4d73;
  --amber: #ffcf5b;
  --muted: #78909e;
  --text: #e8fbff;
  --line: rgba(116, 238, 255, 0.2);
  --display: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", "Liberation Mono", monospace;
  --ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--ui);
  background:
    radial-gradient(circle at 50% -10%, rgba(82, 194, 238, 0.17), transparent 39%),
    radial-gradient(circle at 92% 66%, rgba(145, 92, 255, 0.1), transparent 28%),
    linear-gradient(155deg, #070b14, #020308 68%);
  -webkit-font-smoothing: antialiased;
}

.grid-field,
.scan-field {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
}

.grid-field {
  opacity: 0.55;
  background:
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(116, 238, 255, 0.035) 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(116, 238, 255, 0.035) 80px);
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.scan-field {
  opacity: 0.1;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(132, 234, 255, 0.12) 4px);
  mix-blend-mode: screen;
}

.stats-header,
.stats-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.stats-header {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  color: rgba(217, 251, 255, 0.74);
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-decoration: none;
}

.back-link span {
  color: var(--cyan);
  font-size: 1rem;
  transition: transform 140ms ease;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--cyan-hot);
}

.back-link:hover span,
.back-link:focus-visible span {
  transform: translateX(-3px);
}

.back-link:focus-visible,
#refreshStatistics:focus-visible {
  outline: 2px solid var(--cyan-hot);
  outline-offset: 4px;
}

.server-scope {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: rgba(176, 204, 211, 0.62);
  font-family: var(--display);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}

.server-scope i {
  width: 7px;
  height: 7px;
  background: #62ffce;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(98, 255, 206, 0.82);
}

.stats-shell {
  padding: clamp(54px, 8vw, 104px) 0 64px;
}

.stats-hero {
  text-align: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin: 0 0 13px;
  color: var(--cyan);
  font-family: var(--display);
  font-size: clamp(0.52rem, 1vw, 0.68rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.eyebrow span {
  width: clamp(24px, 5vw, 62px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan));
}

.eyebrow span:last-child {
  transform: scaleX(-1);
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.25rem, 6.5vw, 5.2rem);
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: -0.075em;
  text-shadow: 0 0 28px rgba(116, 238, 255, 0.14);
}

h1 span {
  color: transparent;
  -webkit-text-stroke: 1px var(--cyan);
  text-shadow: 0 0 22px rgba(116, 238, 255, 0.34);
}

.hero-copy {
  margin: 18px auto 0;
  color: rgba(194, 220, 227, 0.7);
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  line-height: 1.65;
}

.primary-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: clamp(38px, 6vw, 68px);
}

.stat-card {
  position: relative;
  min-height: clamp(230px, 28vw, 326px);
  padding: clamp(24px, 4.5vw, 50px);
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(11, 27, 43, 0.96), rgba(5, 10, 19, 0.9)),
    var(--panel);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}

.stat-card::before {
  position: absolute;
  top: 0;
  right: 18%;
  left: 0;
  height: 3px;
  content: '';
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent);
}

.stat-card::after {
  position: absolute;
  right: -12%;
  bottom: -55%;
  width: 58%;
  aspect-ratio: 1;
  content: '';
  background: radial-gradient(circle, var(--glow), transparent 68%);
}

.stat-card--cyan {
  --accent: var(--cyan);
  --glow: rgba(116, 238, 255, 0.15);
}

.stat-card--violet {
  --accent: var(--violet);
  --glow: rgba(164, 108, 255, 0.16);
}

.card-index,
.stat-label,
.stat-card small {
  position: relative;
  z-index: 1;
  font-family: var(--display);
}

.card-index {
  color: rgba(120, 144, 158, 0.62);
  font-size: 0.57rem;
  letter-spacing: 0.13em;
}

.stat-label {
  display: block;
  margin-top: clamp(25px, 4vw, 44px);
  color: rgba(217, 251, 255, 0.78);
  font-size: clamp(0.68rem, 1.3vw, 0.88rem);
  font-weight: 800;
  letter-spacing: 0.15em;
}

.stat-value {
  position: relative;
  z-index: 1;
  display: block;
  margin: 3px 0 8px;
  color: var(--accent);
  font-family: var(--display);
  font-size: clamp(4.2rem, 11vw, 8.6rem);
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: -0.09em;
  text-shadow: 0 0 28px var(--glow);
}

.stat-card small {
  color: rgba(176, 204, 211, 0.66);
  font-size: clamp(0.58rem, 1vw, 0.7rem);
  letter-spacing: 0.06em;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
  border: 1px solid var(--line);
  background: rgba(5, 11, 20, 0.78);
}

.detail-stats article {
  min-width: 0;
  padding: 23px 22px;
  border-right: 1px solid var(--line);
}

.detail-stats article:last-child {
  border-right: 0;
}

.detail-stats span,
.detail-stats strong,
.detail-stats small {
  display: block;
  font-family: var(--display);
}

.detail-stats span {
  color: rgba(176, 204, 211, 0.66);
  font-size: 0.54rem;
  letter-spacing: 0.11em;
}

.detail-stats strong {
  margin: 7px 0 5px;
  color: var(--cyan-hot);
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  letter-spacing: -0.045em;
}

.detail-stats small {
  color: rgba(120, 144, 158, 0.66);
  font-size: 0.52rem;
  line-height: 1.35;
}

.scope-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 22px;
  padding: 21px 23px;
  background: linear-gradient(90deg, rgba(255, 207, 91, 0.08), transparent 65%);
  border: 1px solid rgba(255, 207, 91, 0.22);
  border-left: 3px solid var(--amber);
}

.scope-marker {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #071019;
  font-family: var(--display);
  font-weight: 900;
  background: var(--amber);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.scope-note h2 {
  margin: 0 0 7px;
  color: #ffe59b;
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.11em;
}

.scope-note p {
  max-width: 940px;
  margin: 0;
  color: rgba(194, 220, 227, 0.68);
  font-size: 0.74rem;
  line-height: 1.6;
}

.stats-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.timestamps {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 30px;
}

.timestamps p,
.refresh-control p {
  margin: 0;
  color: rgba(120, 144, 158, 0.7);
  font-family: var(--display);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
}

.timestamps time {
  margin-left: 7px;
  color: rgba(217, 251, 255, 0.72);
}

.refresh-control {
  display: grid;
  justify-items: end;
  gap: 9px;
}

.refresh-control p[data-state='ready'] {
  color: #62ffce;
}

.refresh-control p[data-state='error'] {
  color: #ff7895;
}

#refreshStatistics {
  min-height: 42px;
  padding: 0 17px;
  color: #061018;
  font-family: var(--display);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  background: var(--cyan);
  border: 0;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
}

#refreshStatistics:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--cyan-hot);
}

#refreshStatistics:disabled {
  cursor: wait;
  opacity: 0.5;
}

@media (max-width: 780px) {
  .primary-stats {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 220px;
  }

  .detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-stats article:nth-child(2) {
    border-right: 0;
  }

  .detail-stats article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .stats-footer {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .refresh-control {
    justify-items: start;
  }
}

@media (max-width: 520px) {
  .stats-header,
  .stats-shell {
    width: min(100% - 28px, 1180px);
  }

  .stats-header {
    min-height: 66px;
  }

  .server-scope {
    display: none;
  }

  .stats-shell {
    padding-top: 46px;
  }

  h1 span {
    display: block;
    margin-top: 7px;
  }

  .primary-stats {
    margin-top: 34px;
  }

  .stat-card {
    padding: 24px;
  }

  .detail-stats {
    grid-template-columns: 1fr;
  }

  .detail-stats article,
  .detail-stats article:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .detail-stats article:last-child {
    border-bottom: 0;
  }

  .scope-note {
    grid-template-columns: 1fr;
  }

  .timestamps {
    display: grid;
  }
}

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