:root {
  --peach: #f8a68b;
  --peach-soft: #fde3d8;
  --cream: #fff6f0;
  --coral: #ef6a4c;
  --coral-dark: #d4502f;
  --ink: #3b2219;
  --ink-soft: #7a5748;
  --radius: 28px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, #ffd0bd 0, transparent 45%),
    radial-gradient(circle at 90% 90%, #ffb89f 0, transparent 50%),
    var(--peach);
}

.player {
  width: 100%;
  max-width: 420px;
  background: var(--cream);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  box-shadow: 0 24px 60px rgba(120, 50, 30, 0.28), 0 2px 0 #fff inset;
}

/* Header */
.brand { text-align: center; margin-bottom: 20px; }
.brand h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.02em;
}
/* Now playing */
.now-playing {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: var(--peach-soft);
  border-radius: 20px;
  margin-bottom: 18px;
}
.art {
  flex: none;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: #fff;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--peach), var(--coral));
  box-shadow: 0 8px 18px rgba(239, 106, 76, 0.4);
}
.meta { min-width: 0; }
#trackTitle {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#trackArtist { color: var(--ink-soft); font-size: 0.9rem; margin-top: 2px; }

/* Sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 99px;
  background: var(--peach-soft);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--coral);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(239, 106, 76, 0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--coral);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(239, 106, 76, 0.5);
}
input[type="range"]:focus-visible { box-shadow: 0 0 0 3px rgba(239, 106, 76, 0.35); }

.times {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* Buttons */
button {
  font: inherit;
  border: 0;
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
button:focus-visible { outline: 3px solid rgba(239, 106, 76, 0.45); outline-offset: 2px; }

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin: 18px 0 14px;
}
.controls button {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.15rem;
  background: var(--peach-soft);
}
.controls button:hover { transform: scale(1.08); background: var(--peach); }
#playPause {
  width: 72px;
  height: 72px;
  font-size: 1.6rem;
  color: #fff;
  background: var(--coral);
  box-shadow: 0 10px 22px rgba(239, 106, 76, 0.45);
}
#playPause:hover { background: var(--coral-dark); }

.extras {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.extras > button {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: transparent;
  opacity: 0.45;
  font-size: 1.05rem;
}
.extras > button:hover { opacity: 0.85; }
.extras > button.active { opacity: 1; background: var(--peach-soft); box-shadow: inset 0 0 0 2px var(--coral); }
.volume { flex: 1; display: flex; align-items: center; gap: 10px; }

/* Playlist */
#playlist {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--peach) transparent;
}
#playlist:empty::before {
  content: "Your playlist is empty — add some tunes";
  display: block;
  padding: 18px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
#playlist li {
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s ease;
}
#playlist li:hover { background: var(--peach-soft); }
#playlist li.active {
  background: var(--coral);
  color: #fff;
  font-weight: 700;
}

/* Add files */
.add-files {
  display: block;
  text-align: center;
  padding: 14px;
  border: 2px dashed var(--peach);
  border-radius: 16px;
  color: var(--coral-dark);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.add-files:hover { background: var(--peach-soft); border-color: var(--coral); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
