/* ── Playlist header ── */
.playlist-header {
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.playlist-cover {
  width: 140px;
  height: 140px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  flex-shrink: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
}

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

.playlist-meta {
  text-align: center;
}

.playlist-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.playlist-desc {
  font-size: 13px;
  color: var(--text-3);
}

.playlist-contributors {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.contributor-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px 4px 4px;
}

.contributor-chip img,
.contributor-chip .chip-avatar {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-1);
  flex-shrink: 0;
}

.contributor-chip span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.playlist-count {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ── Track list ── */
.track-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 24px;
}

.track-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
}

.track-item:active {
  background: var(--bg-2);
}

.track-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: var(--bg-3);
  flex-shrink: 0;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
  position: relative;
}

.track-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.track-thumb-fallback {
  color: var(--text-3);
  font-size: 20px;
}

.track-body {
  flex: 1;
  min-width: 0;
}

.track-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.track-added-by {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
}

.track-added-by.text-avatar,
.track-added-by.emoji-avatar {
  background: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.track-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.track-artist {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-comment {
  font-size: 12px;
  color: var(--text-2);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-link-icon {
  flex-shrink: 0;
  color: var(--text-3);
  font-size: 14px;
  padding: 4px;
}

/* ── Track wrap (for lyrics button layout) ── */
.track-item-wrap {
  position: relative;
}

.track-lyrics-btn {
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 13px;
  padding: 6px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.track-lyrics-btn:active { opacity: 1; }

/* ── Lyrics sheet ── */
.lyrics-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 100;
}
.lyrics-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.lyrics-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 20px);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 101;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}
.lyrics-sheet.show {
  transform: translateY(0);
}

.lyrics-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.lyrics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.lyrics-song-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-1);
}

.lyrics-song-artist {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.lyrics-close {
  background: var(--bg-2);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.lyrics-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.lyrics-body p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-1);
  letter-spacing: -0.2px;
  margin: 0;
}

.lyrics-body br {
  display: block;
  content: '';
  margin: 8px 0;
}

/* ── Empty state ── */
.playlist-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-3);
  padding: 48px 24px;
  text-align: center;
}

.playlist-empty-icon {
  font-size: 40px;
  opacity: 0.4;
}

.playlist-empty-text {
  font-size: 14px;
  line-height: 1.6;
}
