
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #000000;
  --accent: #ff0033;
  --text: #ffffff;
  --muted: #92909d;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #000000;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.app {
  width: min(100% - 36px, 440px);
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.player {
  padding-top: 65px;
  text-align: center;
}

.cover {
  width: min(100%, 310px);
  aspect-ratio: 1;
  margin: 0 auto 30px;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #49000f, #a00022, #ff0033);
  box-shadow: 0 20px 70px #0007;
  transition: transform 0.3s ease;
}

.cover:hover {
  transform: translateY(-3px);
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  grid-area: 1 / 1;
}

.cover img[hidden],
.track-cover img[hidden],
.cover-placeholder[hidden] {
  display: none;
}

.cover-placeholder {
  grid-area: 1 / 1;
  font-size: 110px;
  color: #ffffffb5;
  user-select: none;
}

.song-info {
  margin-bottom: 25px;
}

.eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.5px;
}

.song-info h1 {
  margin: 10px 0 5px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.8px;
}

.song-info p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.progress-container {
  margin: 0 auto;
}

input[type="range"] {
  display: block;
  width: 100%;
  height: 5px;
  margin: 0;
  border-radius: 20px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--fill, 0%),
    #383838 var(--fill, 0%),
    #383838 100%
  );
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 3px #ff003344;
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
}

.time {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  font-size: 11px;
  color: var(--muted);
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 330px;
  margin: 25px auto 28px;
}

.controls button {
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--text);
  transition: transform 0.2s, color 0.2s;
}

.controls button:hover {
  transform: scale(1.12);
  color: var(--accent);
}

.control-btn {
  font-size: 25px;
  width: 44px;
  height: 44px;
}

.secondary-btn {
  color: var(--muted) !important;
  font-size: 22px;
  width: 38px;
  height: 38px;
}

.secondary-btn.active {
  color: var(--accent) !important;
}

.controls .play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 25px;
  box-shadow: 0 8px 30px #ff003344;
}

.controls .play-btn:hover {
  color: #ffffff;
  background: #ff335c;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 15px;
  max-width: 240px;
  margin: 0 auto 12px;
}

.volume-icon {
  font-size: 19px;
  color: var(--muted);
}

.volume-container input {
  flex: 1;
}

.volume-container span:last-child {
  color: var(--muted);
  font-size: 11px;
  min-width: 32px;
}

.status {
  min-height: 18px;
  font-size: 12px;
  color: #ff6685;
}

.playlist-section {
  margin-top: 44px;
}

.playlist-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.playlist-heading h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.5px;
}

.playlist-heading span {
  color: var(--muted);
  font-size: 12px;
}

.playlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.track {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px;
  gap: 13px;
  border: 1px solid transparent;
  border-radius: 13px;
  text-align: left;
  background: transparent;
  color: var(--text);
  transition: background 0.2s;
}

.track:hover {
  background: #ff00330c;
}

.track.active {
  background: #ff003315;
  border-color: #ff003350;
}

.track-cover {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 9px;
  background: linear-gradient(135deg, #49000f, #ff0033);
  color: #ffffff;
  font-size: 25px;
  overflow: hidden;
}

.track-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track-info {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.track-name {
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.track-artist {
  color: var(--muted);
  font-size: 11px;
}

.track.active .track-name,
.track.active .track-number {
  color: var(--accent);
}

.track-number {
  color: var(--muted);
  font-size: 12px;
  padding: 0 6px;
}

.credits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 25px;
  width: 100%;
  margin-top: auto;
  padding: 45px 0 30px;
  text-align: center;
}

.credit-item {
  display: grid;
  grid-template-rows: 18px minmax(50px, auto) 38px;
  justify-items: center;
  align-items: start;
  gap: 10px;
  min-width: 0;
}

.credit-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #777777;
}

.credit-item strong {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  color: #ffffff;
  text-align: center;
}

.credit-item a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: 38px;
  padding: 0 17px;
  margin: 0;
  border: 1px solid #ff003355;
  border-radius: 8px;
  background: #ff003312;
  color: #ff0033;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: 0.2s ease;
}

.credit-item a:hover {
  background: #ff0033;
  color: #ffffff;
  border-color: #ff0033;
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  .player {
    padding-top: 35px;
  }

  .cover {
    width: min(100%, 270px);
  }

  .song-info h1 {
    font-size: 22px;
  }

  .playlist-section {
    margin-top: 36px;
  }
}

@media (max-width: 360px) {
  .credits {
    gap: 12px;
  }

  .credit-item {
    grid-template-rows: 18px minmax(65px, auto) 38px;
  }

  .credit-item a {
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
