.stats-page {
  padding: 4rem 0 3rem
}

.page-head {
  margin-bottom: 1.3rem;
  max-width: 52rem
}

.page-head h1 {
  font-size: clamp(1.8rem, 3.7vw, 3rem);
  margin-bottom: .7rem
}

.page-description {
  font-size: 1.02rem
}

.global-error {
  margin-bottom: 1rem;
  border: 1px solid rgba(239, 68, 68, .45);
  border-radius: .95rem;
  background: rgba(239, 68, 68, .08);
  color: #ef4444;
  padding: .75rem .9rem;
  font-weight: 600
}

.loading-container,
.shard-loading {
  width: 100%;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center
}

.loading-spinner {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(59, 130, 246, .2);
  border-top-color: var(--accent-main);
  border-radius: 50%;
  animation: .9s linear infinite spin
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1rem
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 1rem;
  padding: 1rem;
  transition: transform .2s, border-color .2s, box-shadow .2s
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-main);
  box-shadow: 0 12px 24px rgba(30, 64, 175, .2)
}

.stat-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text-secondary);
  font-size: .9rem;
  margin-bottom: .6rem
}

.stat-label i {
  color: var(--accent-main)
}

.stat-value {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  line-height: 1.15;
  color: var(--text-color)
}

.odometer.odometer-auto-theme,
.odometer.odometer-theme-minimal {
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.1
}

.odometer.odometer-auto-theme .odometer-digit,
.odometer.odometer-theme-minimal .odometer-digit {
  background: 0 0;
  box-shadow: none;
  color: var(--text-color)
}

.panel {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 1.25rem;
  padding: 1rem;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .14)
}

.shards-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
  margin-bottom: .8rem
}

.shards-head h2 {
  font-size: clamp(1.2rem, 2.2vw, 1.8rem)
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap
}

.panel-title-group h2 {
  margin: 0
}

.pagination-container {
  display: flex;
  align-items: center;
  gap: .5rem
}

.current-page,
.pagination-arrow {
  border: 1px solid var(--border-soft);
  border-radius: .7rem;
  min-width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, .06);
  color: var(--text-color);
  font-weight: 700
}

.pagination-arrow {
  cursor: pointer;
  transition: border-color .2s, background-color .2s
}

.pagination-arrow:hover:not(:disabled) {
  border-color: var(--accent-main);
  background: rgba(59, 130, 246, .2)
}

.pagination-arrow:disabled {
  opacity: .5;
  cursor: not-allowed
}

.shards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem
}

.shard-card {
  border: 1px solid var(--border-soft);
  border-radius: 1rem;
  padding: .9rem;
  background: rgba(59, 130, 246, .06)
}

.shard-card h3 {
  margin: 0 0 .7rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem
}

.shard-title-container {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
  width: 100%
}

.shard-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.shard-id {
  flex-shrink: 0;
  color: var(--text-secondary)
}

.shard-status-indicator {
  width: .7rem;
  height: .7rem;
  border-radius: 999px;
  flex-shrink: 0
}

.shard-status-good {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, .75)
}

.shard-status-medium {
  background: #eab308;
  box-shadow: 0 0 10px rgba(234, 179, 8, .75)
}

.shard-status-bad {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, .75)
}

.shard-stats {
  display: grid;
  gap: .45rem
}

.shard-stat {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  font-size: .9rem;
  color: var(--text-secondary)
}

.shard-stat span:last-child {
  color: var(--text-color);
  font-weight: 700
}

.music-nodes-panel {
  margin-top: 1rem
}

.music-nodes-head {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: .8rem;
  margin-bottom: .8rem
}

.music-nodes-head h2 {
  font-size: clamp(1.2rem, 2.2vw, 1.8rem)
}

.music-nodes-summary {
  border: 1px solid var(--border-soft);
  border-radius: .75rem;
  padding: .35rem .65rem;
  background: rgba(34, 197, 94, .1);
  color: var(--text-color);
  font-weight: 700;
  white-space: nowrap
}

.music-nodes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem
}

.music-node-card {
  border: 1px solid var(--border-soft);
  border-radius: 1rem;
  padding: .9rem;
  background: rgba(59, 130, 246, .06)
}

.music-node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap
}

.music-node-title-wrap {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
  flex: 1
}

.music-node-name {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.music-node-status-indicator {
  width: .7rem;
  height: .7rem;
  border-radius: 999px;
  flex-shrink: 0
}

.music-node-ping {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .28rem .65rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0
}

.music-node-ping-good {
  color: #22c55e;
  background: rgba(34, 197, 94, .12)
}

.music-node-ping-medium {
  color: #f59e0b;
  background: rgba(245, 158, 11, .12)
}

.music-node-ping-bad {
  color: #ef4444;
  background: rgba(239, 68, 68, .12)
}

.music-node-ping-neutral {
  color: var(--text-secondary);
  background: rgba(148, 163, 184, .12)
}

.node-status-online {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, .75)
}

.node-status-offline {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, .75)
}

.music-node-load-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: .8rem;
  margin-top: .75rem
}

.music-node-load-ring {
  --progress: 0;
  --ring-color: #22c55e;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--progress) * 1%), rgba(148, 163, 184, .2) 0);
  display: grid;
  place-items: center;
  box-shadow: 0 0 18px rgba(15, 23, 42, .3);
  flex-shrink: 0
}

.music-node-load-inner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-color);
  background: var(--card-bg)
}

.music-node-details {
  display: grid;
  gap: .45rem;
  margin-top: 0;
  flex: 1;
  min-width: 0
}

.music-node-detail {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  font-size: .9rem;
  color: var(--text-secondary)
}

.music-node-detail span:last-child {
  color: var(--text-color);
  font-weight: 700
}

.music-node-empty,
.music-node-error {
  grid-column: 1/-1;
  border: 1px dashed var(--border-soft);
  border-radius: .95rem;
  padding: 1rem;
  text-align: center
}

.music-node-empty {
  color: var(--text-secondary)
}

.music-node-error {
  color: #ef4444
}

.error-message,
.no-shards-message {
  grid-column: 1/-1;
  border: 1px dashed var(--border-soft);
  border-radius: .95rem;
  padding: 1rem;
  text-align: center
}

.no-shards-message {
  color: var(--text-secondary)
}

.error-message {
  color: #ef4444
}

@media (max-width:1180px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr))
  }

  .music-nodes-grid,
  .shards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }
}

@media (max-width:820px) {
  .stats-page {
    padding: 3.3rem 0 2.5rem
  }

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

  .shards-head {
    flex-direction: column;
    align-items: flex-start
  }

  .music-nodes-head {
    flex-direction: row;
    align-items: center
  }
}

@media (max-width:560px) {

  .music-nodes-grid,
  .shards-grid,
  .stats-grid {
    grid-template-columns: 1fr
  }

  .panel {
    padding: .8rem
  }
}
