main {
  display: flex; gap: 24px;
}

.player {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}

.cover-section { width: 100%; display: flex; justify-content: center; }

.cover-art {
  width: 320px; height: 320px; object-fit: cover;
  border-radius: var(--radius); box-shadow: 0 8px 32px var(--shadow);
  background: var(--bg-card); transition: opacity 0.3s;
}
.cover-art[src=""] { opacity: 0; }

.player-body { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 14px; }

.track-info { text-align: center; }

.track-title {
  font-size: 1.3rem; font-weight: 700; color: var(--text-primary);
  margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.track-genre {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent); background: var(--accent-glow);
  padding: 2px 10px; border-radius: 10px;
}

.waveform-container {
  width: 100%; height: 64px; border-radius: var(--radius-sm);
  background: var(--bg-card); overflow: hidden; position: relative;
}
.waveform-container wave { overflow: hidden !important; }
.waveform-container.loading::after {
  content: "Loading waveform..."; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.8rem;
}

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

.time {
  font-size: 0.8rem; font-variant-numeric: tabular-nums;
  color: var(--text-secondary); min-width: 36px;
}
.time:last-child { text-align: right; }

.progress-bar {
  flex: 1; -webkit-appearance: none; appearance: none; height: 4px;
  border-radius: 2px; background: var(--border); outline: none; cursor: pointer;
}
.progress-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); cursor: pointer; box-shadow: 0 0 6px var(--accent-glow);
  transition: transform 0.15s;
}
.progress-bar::-webkit-slider-thumb:hover { transform: scale(1.2); }
.progress-bar::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
  cursor: pointer; border: none;
}
.progress-bar::-moz-range-track { height: 4px; border-radius: 2px; background: var(--border); }

.controls {
  display: flex; align-items: center; justify-content: center; gap: 12px;
}

.ctrl-btn {
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 10px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s; line-height: 1;
}
.ctrl-btn svg { display: block; pointer-events: none; }
.ctrl-btn:hover {
  color: var(--accent); background: var(--bg-hover);
  transform: scale(1.12); box-shadow: 0 0 12px var(--accent-glow);
}
.ctrl-btn:active { transform: scale(0.95); }
.ctrl-btn.active { color: var(--accent); }

.play-btn {
  width: 48px; height: 48px; background: var(--accent);
  color: var(--bg-primary); box-shadow: 0 4px 16px var(--accent-glow);
}
.play-btn svg.play-icon { margin-left: 2px; }
.play-btn svg.pause-icon { margin-left: 0; }
.play-btn:hover {
  background: var(--accent-hover); color: var(--bg-primary);
  transform: scale(1.08); box-shadow: 0 6px 20px var(--accent-glow);
}
.ctrl-btn.small { font-size: 1rem; padding: 6px; }

.volume-row { display: flex; align-items: center; justify-content: center; gap: 10px; }

.volume-slider {
  -webkit-appearance: none; appearance: none; width: 120px; height: 4px;
  border-radius: 2px; background: var(--border); outline: none; cursor: pointer;
}
.volume-slider:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-secondary); cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.volume-slider::-webkit-slider-thumb:hover {
  background: var(--text-primary); transform: scale(1.2);
}
.volume-slider::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-secondary); cursor: pointer; border: none;
}
.volume-slider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--border); }

.sidebar {
  width: 360px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 12px;
}

.search-box { max-width: 1400px; margin: 0 auto; padding: 0 24px 12px; }

.search-box input {
  width: 100%; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 20px;
  background: var(--bg-card); color: var(--text-primary);
  font-size: 0.875rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-box input::placeholder { color: var(--text-muted); }

.genre-filters { display: flex; flex-wrap: wrap; gap: 6px; }

.genre-btn {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--bg-card); color: var(--text-secondary);
  font-size: 0.8rem; font-weight: 500; cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.genre-btn:hover {
  background: var(--bg-hover); color: var(--text-primary); border-color: var(--text-muted);
}
.genre-btn.active {
  background: var(--accent); color: var(--bg-primary); border-color: var(--accent); font-weight: 600;
}

.song-list {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px; min-height: 200px;
  max-height: calc(100vh - 250px);
}

.song-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background 0.15s;
}
.song-item:hover { background: var(--bg-hover); }
.song-item.active { background: var(--bg-active, #2a2a2a); }
.song-item.active .song-name { color: var(--accent); }

.song-thumb {
  width: 36px; height: 36px; border-radius: 4px;
  object-fit: cover; background: var(--bg-card); flex-shrink: 0;
}

.song-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.song-name {
  font-size: 0.85rem; font-weight: 500; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.song-genre { font-size: 0.7rem; color: var(--text-muted); }

.playing-indicator {
  font-size: 1rem; color: var(--accent); flex-shrink: 0;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.empty-state { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }

@media (max-width: 900px) {
  main { flex-direction: column; }
  .sidebar { width: 100%; }
  .cover-art { width: 240px; height: 240px; }
}

@media (max-width: 480px) {
  .cover-art { width: 180px; height: 180px; }
  .controls { gap: 8px; }
  .ctrl-btn { font-size: 1rem; padding: 6px; }
  .play-btn { font-size: 1.3rem; width: 40px; height: 40px; }
}
