.music {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-bottom: 140px;
}

.music-intro h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.music-intro p {
  margin: 6px 0 0;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.albums {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.album {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.album-header {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.album-cover {
  width: 140px;
  height: 140px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  align-self: start;
  justify-self: start;
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-button {
  border: 0;
  padding: 0;
  background: transparent;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.cover-placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg);
}

.album-title {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.album-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.album-spotify {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.album-spotify img {
  width: 100%;
  height: 100%;
  display: block;
  filter: invert(1) grayscale(1) contrast(1.15);
}

.album-spotify:hover,
.album-spotify:focus {
  opacity: 1;
}

.album-artist {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.track-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 13px;
}

.track-table th,
.track-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-table th {
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.track-table td {
  vertical-align: middle;
}

.track-table td:nth-child(1) {
  width: auto;
}

.track-table td:nth-child(2) {
  width: 26%;
  color: var(--muted);
}

.track-table td:nth-child(3) {
  width: 10%;
  text-align: right;
}

.track-table td:nth-child(4),
.track-table td:nth-child(5),
.track-table td:nth-child(6),
.track-table td:nth-child(7),
.track-table td:nth-child(8) {
  width: 8%;
  text-align: right;
}

.track-table td:nth-child(3),
.track-table td:nth-child(5),
.track-table td:nth-child(6),
.track-table td:nth-child(7) {
  color: var(--muted);
}

.track {
  border: 0;
  background: transparent;
  padding: 6px 6px;
  text-align: left;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: var(--ink);
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.track-status {
  width: 12px;
  display: inline-flex;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: -0.02em;
}

.track.is-active .track-status::before {
  content: "▶";
  font-size: 12px;
}

.track.is-playing .track-status::before {
  content: "❚❚";
  font-size: 11px;
}

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

.track:hover,
.track:focus {
  border-color: var(--accent);
  color: var(--accent);
}

.track.is-active {
  border-color: var(--ink);
  color: var(--ink);
}

.music-player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  color: #fff;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding-right: 14px;
  z-index: 50;
}

.cover-preview {
  position: fixed;
  left: 20px;
  bottom: 96px;
  width: 360px;
  height: 360px;
  background: #000;
  display: grid;
  place-items: center;
  z-index: 55;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-preview.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.player-cover {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  border: 0;
  padding: 0;
  background: transparent;
}

.player-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.player-progress input[type="range"],
.player-volume input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  background: transparent;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

.player-progress input[type="range"]::-webkit-slider-runnable-track,
.player-volume input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: #fff;
  border-radius: 999px;
}

.player-progress input[type="range"]::-moz-range-track,
.player-volume input[type="range"]::-moz-range-track {
  height: 2px;
  background: #fff;
  border-radius: 999px;
}

.player-progress input[type="range"]::-webkit-slider-thumb,
.player-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  margin-top: -4px;
}

.player-progress input[type="range"]::-moz-range-thumb,
.player-volume input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 0;
}

.player-progress input[type="range"]::-moz-range-track,
.player-volume input[type="range"]::-moz-range-track {
  height: 2px;
  background: #fff;
  border-radius: 999px;
}

.player-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  min-width: 0;
  margin-top: -2px;
}

.player-track {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -2px;
}

.player-btn {
  border: 0;
  background: transparent;
  color: #fff;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
}

.player-btn[data-shuffle] {
  font-size: 16px;
}

.player-btn.is-active {
  text-decoration: underline;
}

.player-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-progress input[type="range"] {
  width: 240px;
}

.player-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.player-volume input[type="range"] {
  width: 120px;
}

.player-time {
  font-family: var(--mono);
  font-size: 12px;
}

.player-progress input[type="range"],
.player-volume input[type="range"] {
  touch-action: manipulation;
}

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

  .album-cover {
    width: 110px;
    height: 110px;
    aspect-ratio: 1 / 1;
    align-self: start;
    justify-self: start;
  }

  .music-player {
    grid-template-columns: 64px 1fr;
    gap: 12px;
  }

  .player-controls {
    grid-column: 2;
  }

  .player-progress {
    grid-column: 2;
  }

  .player-volume {
    grid-column: 2;
  }

  .player-progress input[type="range"] {
    width: 100%;
  }

  .player-volume input[type="range"] {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .album-header {
    grid-template-columns: 110px 1fr;
    align-items: start;
    gap: 16px;
  }

  .album-cover {
    width: 110px;
    height: 110px;
    aspect-ratio: 1 / 1;
    justify-self: start;
    align-self: start;
  }

  .album-meta {
    grid-column: 2;
  }

  .music-player {
    grid-template-columns: 76px 1fr auto;
    grid-auto-rows: auto;
    align-items: center;
    gap: 0px;
  }

  .cover-preview {
    left: 12px;
    bottom: 104px;
    width: 288px;
    height: 288px;
  }

  .player-info {
    grid-column: 2;
    margin-top: -14px;
  }

  .player-controls {
    grid-column: 3;
    justify-self: end;
    margin-top: -16px;
  }

  .player-progress {
    grid-column: 2 / -1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: -32px;
  }

  .player-controls,
  .player-progress {
    flex-wrap: nowrap;
  }

  .player-progress input[type="range"] {
    width: 100%;
  }

  .player-volume {
    display: none;
  }

  .track-table {
    width: 100%;
    max-width: none;
    margin-top: 0;
    table-layout: fixed;
  }

  .track-table th:nth-child(2),
  .track-table td:nth-child(2),
  .track-table th:nth-child(3),
  .track-table td:nth-child(3),
  .track-table th:nth-child(4),
  .track-table td:nth-child(4),
  .track-table th:nth-child(6),
  .track-table td:nth-child(6),
  .track-table th:nth-child(7),
  .track-table td:nth-child(7),
  .track-table th:nth-child(8),
  .track-table td:nth-child(8) {
    display: none;
  }

  .track-table th:nth-child(5),
  .track-table td:nth-child(5) {
    text-align: right;
    width: 28%;
  }

  .track-table th:nth-child(1),
  .track-table td:nth-child(1) {
    width: 72%;
  }
}
