/* Music: a cassette that shows progress, a ranked chart, artists with a genre mix, and recent plays by day. */

/* Now playing. Reels show progress: the left one empties as the right one fills. */

.now-playing { display: grid; gap: 14px; width: 264px; }

.cassette {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 264px;
  height: 168px;
  padding: 12px 14px 0;
  background: #2A2826;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06), 0 8px 20px -8px rgb(0 0 0 / 0.35);
}

.cassette-label {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 104px;
  padding: 8px 12px 10px;
  background: #F3EFE6;
  border-top: 8px solid var(--ch);
  border-radius: 6px;
}

.cassette-line { display: flex; justify-content: space-between; gap: 8px; color: #57544E; font: 11px var(--mono); }
.cassette-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cassette-window {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding: 0 6px;
  background: #2A2826;
  border-radius: 21px;
}

.reel-slot { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; }

.reel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #5B4232;
  border-radius: 50%;
  transition: width 1s, height 1s;
}
.reel--left { width: var(--left, 25px); height: var(--left, 25px); }
.reel--right { width: var(--right, 25px); height: var(--right, 25px); }

.hub { width: 14px; height: 14px; background: #F3EFE6; border: 3px dotted #2A2826; border-radius: 50%; animation: spin 3s linear infinite paused; }
.cassette.is-playing .hub { animation-play-state: running; }

.tape { flex: 1; height: 14px; margin: 0 8px; background: linear-gradient(90deg, #5B4232 var(--tape, 50%), #3A3531 var(--tape, 50%)); border-radius: 2px; }

.cassette-foot { width: 150px; height: 28px; margin-top: auto; background: #3A3734; clip-path: polygon(9% 0, 91% 0, 100% 100%, 0 100%); }

@keyframes spin { to { transform: rotate(1turn); } }

.np-caption { display: grid; gap: 3px; min-height: 66px; }
.np-state { color: var(--muted); font-size: 13px; }
.np-title { overflow: hidden; font-size: 16px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.np-artist { overflow: hidden; color: var(--muted); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }

/* Chart and artists side by side */

.chart-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 56px; }
.artists-head { min-height: 34px; }

.chart-row {
  display: grid;
  grid-template-columns: 24px 40px minmax(0, 1fr) 36px auto;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  border-top: 1px solid var(--hair);
}
.chart-row--loading { grid-template-columns: 24px 40px minmax(0, 1fr); }

.chart-rank { color: var(--faint); font: 12px var(--mono); text-align: right; }
.chart-cover { width: 40px; height: 40px; border-radius: 3px; }
.chart-track { display: grid; gap: 2px; min-width: 0; }
.chart-title { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.chart-artist { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.chart-move { color: var(--faint); font: 12px var(--mono); }
.chart-move--up { color: var(--ch); }
.chart-time { color: var(--meta); font: 12px var(--mono); }

.artists { display: grid; gap: 14px; align-content: start; }

.artist-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 14px; }
.artist-photo { width: 52px; height: 52px; border-radius: 50%; }
.artist-text { display: grid; gap: 2px; min-width: 0; }
.artist-name { font-size: 15px; font-weight: 500; }
.artist-genres { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.genre-mix { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.genre-mix-title { margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.genre-bar { display: flex; gap: 2px; height: 8px; overflow: hidden; border-radius: 4px; }
.genre-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.genre-legend li { display: flex; align-items: center; gap: 6px; }

/* Recently played, grouped by day */

.days { position: relative; padding-left: 120px; }

.day { position: relative; padding: 14px 0; border-top: 1px solid var(--hair); }
.day-label { position: absolute; top: 16px; left: -120px; color: var(--meta); font: 12px var(--mono); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  padding: 6px 12px 6px 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.chip-art { width: 28px; height: 28px; border-radius: 3px; }
.chip-text { display: grid; min-width: 0; }
.chip-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-text span:first-child { font-size: 13px; }
.chip-text span:last-child { color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .chart-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

@media (max-width: 560px) {
  .now-playing, .cassette { width: 100%; max-width: 264px; }
  .chart-row { grid-template-columns: 20px 40px minmax(0, 1fr) auto; }
  .chart-time { display: none; }
  .days { padding-left: 0; }
  .day-label { position: static; display: block; margin-bottom: 8px; }
  .chip { max-width: 100%; }
}
