*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-hover: #252525;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --text-muted: #888;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --playing: #22c55e;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.player {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.player-header {
  margin-bottom: 1.25rem;
  text-align: center;
}

.player-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.playlist {
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.track-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem;
}

.track-list li {
  margin: 0;
}

.track-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.track-item:hover {
  background: var(--surface-hover);
}

.track-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
  font-weight: 500;
}

.track-item.playing {
  color: var(--playing);
}

.now-playing {
  margin-bottom: 1rem;
  min-height: 1.5em;
}

.now-playing-label {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.time {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 2.5rem;
}

.time:last-of-type {
  text-align: right;
}

.seek {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}

.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.seek::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  border: none;
  background: var(--surface-hover);
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  background: var(--border);
}

.btn:active {
  transform: scale(0.96);
}

.btn-icon {
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  line-height: 1;
}

.btn-play {
  width: 52px;
  height: 52px;
  font-size: 1.25rem;
  background: var(--accent);
  color: #fff;
}

.btn-play:hover {
  background: var(--accent-hover);
}

.btn-play.playing {
  background: var(--playing);
}

.btn-play.playing:hover {
  background: #16a34a;
}

/* Scrollbar */
.playlist::-webkit-scrollbar {
  width: 8px;
}

.playlist::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}

.playlist::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.playlist::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
