:root {
  color-scheme: dark;
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #eef2ff;
  background:
    radial-gradient(circle at 16% 0%, rgba(109, 124, 255, .22), transparent 34%),
    linear-gradient(180deg, #08111f, #060913);
}

main {
  width: min(1040px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 46px);
}

.btn {
  border: 1px solid #394169;
  border-radius: 999px;
  padding: 11px 15px;
  background: #202744;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
}

.panel {
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 22px;
  background: rgba(13, 18, 32, .92);
  padding: 20px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, .34);
}

.metric-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.metric-head h2 {
  margin: 0 0 5px;
}

.metric-head p {
  margin: 0;
  color: #aab6d8;
}

.metric-head strong {
  font-size: 36px;
}

.count-roll {
  display: inline-flex;
  color: inherit;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

.chart-bg {
  fill: #0b1020;
  stroke: #273052;
}

.grid line {
  stroke: #25304f;
  stroke-width: 1;
}

.axis-labels text {
  fill: #8d98c6;
  font-size: 13px;
}

.line {
  fill: none;
  stroke: #65e6bf;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(101, 230, 191, .4));
}

.dots circle {
  fill: #6d7cff;
  stroke: #fff;
  stroke-width: 2;
  cursor: pointer;
  transition: r .16s ease, fill .16s ease;
}

.dots circle:hover,
.dots circle:focus {
  r: 7;
  fill: #65e6bf;
  outline: none;
}

.chart-tip {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  min-width: 150px;
  border: 1px solid #4d5f96;
  border-radius: 12px;
  background: #080d1d;
  color: #eef2ff;
  padding: 10px 12px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .45);
  opacity: 0;
  transform: translate(-50%, -115%);
  transition: opacity .12s ease;
  font-size: 13px;
}

.chart-tip.show {
  opacity: 1;
}

.chart-tip b {
  display: block;
  font-size: 18px;
  margin-top: 3px;
}

.chart-tip small {
  display: block;
  margin-top: 5px;
  color: #aab6d8;
}

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

.leader-title {
  margin: 20px 0 8px;
}

.mini-grid div,
.dist-row {
  border: 1px solid #283153;
  border-radius: 14px;
  background: #0b1020;
  padding: 12px;
}

.mini-grid span,
.dist-row span {
  display: block;
  color: #9fb0d1;
  font-size: 13px;
}

.mini-grid b {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.dist-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 70px;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}

.dist-link {
  color: inherit;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease;
}

.dist-link:hover {
  transform: translateY(-2px);
  border-color: #6d7cff;
}

.dist-bar {
  width: 100%;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: #1b2440;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
}

.dist-bar::-webkit-progress-bar {
  background: #1b2440;
  border-radius: 999px;
}

.dist-bar::-webkit-progress-value {
  background: linear-gradient(90deg, #25d0a2, #6d7cff);
  border-radius: 999px;
}

.dist-bar::-moz-progress-bar {
  background: linear-gradient(90deg, #25d0a2, #6d7cff);
  border-radius: 999px;
}

.empty {
  color: #aab6d8;
}

.user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #394169;
  flex-shrink: 0;
  margin-right: 8px;
}

.leader-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin-right: 6px;
  vertical-align: middle;
}

.updated {
  margin-top: 14px;
  color: #9fb0d1;
}

@media (max-width: 620px) {
  .metric-head,
  nav {
    flex-direction: column;
    align-items: flex-start;
  }

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

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