:root {
  --bg: #000;
  --shell: #0a0a0a;
  --panel: #121212;
  --panel-2: #181818;
  --panel-3: #202020;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #fff;
  --soft: #d7d7d7;
  --muted: #a7a7a7;
  --quiet: #727272;
  --green: #1ed760;
  --green-hover: #3be477;
  --red: #e91429;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(30, 215, 96, 0.08) 0, transparent 230px),
    var(--bg);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 10, 10, 0.86);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.32);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel-2);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.brand strong,
.brand small {
  display: block;
  overflow-wrap: anywhere;
}

.brand strong {
  font-size: 15px;
  font-weight: 800;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.nav a {
  min-width: 92px;
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.nav a.active,
.nav a:hover {
  color: #000;
  background: var(--green);
}

.page-grid,
.dashboard-grid,
.detail-grid {
  display: grid;
  gap: 16px;
}

.page-grid {
  margin-top: 16px;
}

.dashboard-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.stats-hero {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: end;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 0%, rgba(30, 215, 96, 0.18), transparent 30%),
    linear-gradient(135deg, #1d1d1d, #101010 62%);
}

.stats-title {
  max-width: 740px;
  color: var(--text);
  font-size: 48px;
  font-weight: 850;
  line-height: 0.98;
  letter-spacing: 0;
}

.stats-copy {
  max-width: 720px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.stats-hero-panel {
  display: grid;
  gap: 7px;
  justify-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
}

.stats-hero-panel span,
.stats-hero-panel small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stats-hero-panel strong {
  color: var(--green);
  font-size: 38px;
  font-weight: 850;
  line-height: 1;
}

.detail-grid {
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.94fr);
  margin-top: 16px;
}

.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.45fr);
  gap: 16px;
  align-items: stretch;
}

.home-hero-grid-single {
  grid-template-columns: 1fr;
}

.mini-grid {
  display: grid;
  gap: 16px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.card.pad {
  padding: 18px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-title,
.detail-title,
.moment-title {
  color: var(--text);
  font-weight: 850;
  letter-spacing: 0;
}

.section-title {
  font-size: 22px;
  line-height: 1.12;
}

.detail-title {
  max-width: 900px;
  font-size: 72px;
  line-height: 0.92;
  overflow-wrap: anywhere;
}

.moment-title {
  font-size: 30px;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.hero-copy {
  max-width: 720px;
  margin-top: 12px;
  color: var(--soft);
  font-size: 18px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.muted,
.item-meta,
.stat-sub {
  color: var(--muted);
}

.item-meta,
.stat-sub {
  font-size: 14px;
  line-height: 1.35;
}

.spotify-icon {
  display: block;
  width: 20px;
  height: 20px;
}

.spotify-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #000;
  background: var(--green);
  text-decoration: none;
  box-shadow: 0 14px 38px rgba(30, 215, 96, 0.22);
  transition: transform 160ms ease, background 160ms ease;
}

.spotify-icon-button:hover {
  transform: scale(1.04);
  background: var(--green-hover);
}

.spotify-icon-button-with-label {
  width: auto;
  min-height: 48px;
  padding: 0 18px;
  gap: 10px;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

.cover,
.cover-placeholder {
  display: block;
  width: 132px;
  height: 132px;
  border-radius: 8px;
}

.cover {
  object-fit: cover;
  background: var(--panel-3);
}

.cover-placeholder,
.stat-cover-placeholder,
.artist-cover-placeholder,
.history-cover-placeholder,
.moment-cover-placeholder {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--green);
  background: linear-gradient(135deg, #222, #101010);
  font-weight: 850;
}

.spotlight-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 28px;
  min-height: 520px;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.2), rgba(18, 18, 18, 0.92) 58%),
    var(--panel);
}

.spotlight-card::before {
  content: "";
  position: absolute;
  inset: -22%;
  background-image: var(--art);
  background-size: cover;
  background-position: center;
  filter: blur(42px) saturate(1.25);
  opacity: 0.5;
  transform: scale(1.04);
}

.spotlight-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.58)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), #121212);
}

.spotlight-media,
.spotlight-copy {
  position: relative;
  z-index: 1;
}

.spotlight-media {
  align-self: center;
  min-width: 0;
}

.spotlight-media .cover,
.spotlight-media .cover-placeholder {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.62);
}

.spotlight-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 12px 4px;
}

.spotlight-main-link,
.moment-card-link,
.track-link,
.list-item a {
  color: inherit;
  text-decoration: none;
}

.spotlight-main-link:hover .detail-title,
.moment-card-link:hover .moment-title,
.track-link:hover .item-title {
  color: var(--green);
}

.card-kicker-row,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-kicker-row .eyebrow {
  margin: 0;
}

.spotlight-meta,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips {
  margin-top: 18px;
}

.chip,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(18, 18, 18, 0.64);
  font-size: 13px;
  font-weight: 800;
}

.chip:first-child {
  color: #000;
  border-color: transparent;
  background: var(--green);
}

.moment-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  padding: 12px;
  align-self: stretch;
  background: var(--panel-2);
}

.moment-cover,
.moment-cover-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 300px;
  border-radius: 8px;
}

.moment-cover {
  display: block;
  object-fit: cover;
  background: var(--panel-3);
}

.moment-card-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 4px 4px 8px;
}

.moment-copy {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.now-playing {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  align-items: center;
  background: var(--panel-2);
}

.stats-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  min-height: 148px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent),
    var(--panel-2);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 16px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(30, 215, 96, 0.1);
}

.stat-card:nth-child(2)::after {
  background: rgba(255, 255, 255, 0.08);
}

.stat-card:nth-child(3)::after {
  background: rgba(233, 20, 41, 0.12);
}

.stat-card:nth-child(4)::after {
  background: rgba(30, 215, 96, 0.18);
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.stat-value {
  margin-top: 16px;
  color: var(--text);
  font-size: 42px;
  font-weight: 850;
  line-height: 0.95;
}

.recent-card {
  grid-column: span 7;
}

.top-card {
  grid-column: span 5;
}

.recent-card,
.top-card {
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  gap: 16px;
  background: var(--panel-2);
}

.chart-head {
  align-items: flex-start;
  padding-bottom: 4px;
}

.chart-head .eyebrow {
  margin-bottom: 8px;
}

.chart-list {
  gap: 8px;
  height: 100%;
  align-self: stretch;
  grid-auto-rows: 1fr;
}

.list {
  display: grid;
  gap: 0;
}

.card.pad > .section-title + .list {
  margin-top: 8px;
}

.list-item,
.track-row {
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.chart-item {
  padding: 0;
  border-top: 0;
}

.list-item:first-child,
.track-row:first-child {
  border-top: 0;
}

.recent-card .track-link,
.stats-list-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.chart-row {
  grid-template-columns: 34px 56px minmax(0, 1fr) auto;
  gap: 12px;
  height: 100%;
  min-height: 64px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.028);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.recent-card .chart-row,
.top-card .chart-row {
  grid-template-columns: 34px 56px minmax(0, 1fr) auto;
}

.chart-row:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
  transform: translateY(-1px);
}

.stats-list-copy,
.history-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.chart-bar {
  height: 4px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.chart-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), rgba(30, 215, 96, 0.28));
}

.chart-count {
  min-width: 44px;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.stat-cover,
.stat-cover-placeholder,
.artist-cover,
.artist-cover-placeholder {
  width: 54px;
  height: 54px;
  border-radius: 6px;
}

.stat-cover,
.artist-cover,
.history-cover {
  display: block;
  object-fit: cover;
}

.history-item {
  padding: 12px 0;
}

.history-item .track-link {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.history-cover,
.history-cover-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 6px;
}

.home-track-item .track-link {
  grid-template-columns: 34px 56px minmax(0, 1fr);
}

.home-track-rank {
  align-self: center;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.item-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--text);
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #000;
  background: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.rank-badge-1 {
  background: var(--green);
}

.rank-badge-2 {
  background: #fff;
}

.rank-badge-3 {
  background: #c9b29b;
}

.rank-badge-4 {
  color: var(--text);
  background: var(--panel-3);
}

.detail-hero {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  padding: 22px;
  align-items: center;
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
}

.detail-hero .cover,
.detail-hero .cover-placeholder {
  width: 190px;
  height: 190px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
}

.empty {
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.history-panel {
  grid-column: 1 / -1;
  background: var(--panel-2);
}

.history-loader {
  min-height: 32px;
  padding-top: 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.history-sentinel {
  height: 1px;
}

.section-link {
  color: var(--green);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.section-link:hover {
  color: var(--green-hover);
}

.sticky-card {
  position: sticky;
  top: 18px;
}

@media (max-width: 980px) {
  .home-hero-grid,
  .spotlight-card,
  .detail-grid,
  .stats-hero {
    grid-template-columns: 1fr;
  }

  .spotlight-card {
    min-height: 0;
  }

  .spotlight-copy {
    gap: 26px;
    padding: 0;
  }

  .detail-title {
    font-size: 52px;
  }

  .stats-hero-panel {
    justify-items: start;
  }

  .stats-row,
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .recent-card,
  .top-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 18px, 1280px);
    padding: 10px 0 32px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .nav a {
    min-width: 0;
    padding: 10px 8px;
  }

  .stats-row,
  .dashboard-grid,
  .now-playing,
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .spotlight-card {
    padding: 14px;
  }

  .detail-title {
    font-size: 38px;
    line-height: 1.02;
  }

  .stats-title {
    font-size: 36px;
    line-height: 1.04;
  }

  .section-title {
    font-size: 20px;
  }

  .stat-value {
    font-size: 36px;
  }

  .chart-row {
    grid-template-columns: 30px 48px minmax(0, 1fr);
  }

  .recent-card .chart-row,
  .top-card .chart-row {
    grid-template-columns: 30px 48px minmax(0, 1fr);
  }

  .chart-count {
    grid-column: 3;
    justify-self: start;
    margin-top: 2px;
  }

  .cover,
  .cover-placeholder,
  .detail-hero .cover,
  .detail-hero .cover-placeholder {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .card-kicker-row,
  .section-head {
    align-items: flex-start;
  }

  .spotify-icon-button-with-label {
    width: 48px;
    min-width: 48px;
    padding: 0;
  }

  .spotify-icon-button-with-label span {
    display: none;
  }
}

@media (max-width: 460px) {
  .card.pad,
  .now-playing,
  .detail-hero {
    padding: 14px;
  }

  .home-track-item .track-link {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .home-track-rank {
    display: none;
  }

  .history-item .track-link,
  .stats-list-row,
  .recent-card .track-link {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
  }

  .chart-row {
    grid-template-columns: 28px 48px minmax(0, 1fr);
  }

  .recent-card .chart-row,
  .top-card .chart-row {
    grid-template-columns: 28px 48px minmax(0, 1fr);
  }

  .history-cover,
  .history-cover-placeholder,
  .stat-cover,
  .stat-cover-placeholder,
  .artist-cover,
  .artist-cover-placeholder {
    width: 48px;
    height: 48px;
  }
}
