/* Stream stats page — aligned with configurator tokens and surfaces */

#stats-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#stats-header {
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  background: rgba(17, 17, 17, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--cfg-border2);
  position: sticky;
  top: 0;
  z-index: 10;
}

.stats-back-link {
  font-size: 12px;
  color: var(--cfg-muted);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.stats-back-link:hover {
  color: var(--cfg-text);
  text-decoration: underline;
}

.stats-logo {
  flex-shrink: 0;
}

.stats-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stats-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--cfg-text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stats-subtitle {
  font-size: 12px;
  color: var(--cfg-muted);
  line-height: 1.3;
}

.stats-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.stats-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stats-surface {
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 0.5px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}

.stats-metric {
  background: var(--cfg-bg);
  border: 0.5px solid var(--cfg-border2);
  border-radius: 11px;
  padding: 12px 14px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.stats-metric-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cfg-muted);
}

.stats-metric-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--cfg-accent);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stats-metric-hint {
  font-size: 11px;
  line-height: 1.35;
  color: var(--cfg-muted);
  margin-top: 4px;
}

.stats-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-block-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cfg-muted);
  margin: 0;
}

.stats-block-desc {
  font-size: 12px;
  color: var(--cfg-muted);
  line-height: 1.5;
  margin: -4px 0 0;
}

.stats-block-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-inline-empty {
  font-size: 13px;
  color: var(--cfg-muted);
  margin: 4px 0 0;
}

.stats-chart-wrap {
  position: relative;
  width: 100%;
  height: min(360px, 52vh);
  min-height: 260px;
  margin-top: 4px;
}

.stats-empty-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 80px;
}

.stats-empty-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
  padding: 28px 22px;
}

.stats-empty {
  font-size: 16px;
  font-weight: 600;
  color: var(--cfg-text);
  margin: 0 0 8px;
}

.stats-empty-hint {
  font-size: 13px;
  color: var(--cfg-muted);
  line-height: 1.5;
  margin: 0 0 16px;
}

.stats-empty-link {
  display: inline-block;
  font-size: 13px;
  color: var(--cfg-accent);
  text-decoration: none;
  font-weight: 500;
}
.stats-empty-link:hover {
  text-decoration: underline;
}

.stats-banger-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--cfg-bg);
  border: 0.5px solid var(--cfg-border2);
  border-radius: 11px;
  transition: border-color 0.12s, background 0.12s;
}
.stats-banger-item:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.02);
}

.stats-banger-art {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--cfg-surface2);
}

.stats-banger-info {
  flex: 1;
  min-width: 0;
}

.stats-banger-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--cfg-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-banger-artist {
  font-size: 12px;
  color: var(--cfg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-banger-time {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--cfg-muted);
  flex-shrink: 0;
}

.stats-top-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--cfg-bg);
  border: 0.5px solid var(--cfg-border2);
  border-radius: 11px;
}
.stats-top-item:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.stats-top-rank {
  width: 24px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--cfg-muted);
  flex-shrink: 0;
}

.stats-top-art {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--cfg-surface2);
}

.stats-top-info {
  flex: 1;
  min-width: 0;
}

.stats-top-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--cfg-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-top-artist {
  font-size: 12px;
  color: var(--cfg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-top-count {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--cfg-accent);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  #stats-header {
    flex-wrap: wrap;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .cfg-header-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
}
