* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body {
  background: #fff;
}

.player-wrapper {
  display: flex;
  width: 100%;
  max-width: 100%;
  background: #f4f4f4;
  border-radius: 8px;
  box-shadow: 0 0 9px rgba(0,0,0,.3);
  overflow: hidden;
}

.artwork {
  width: 120px;
  min-width: 120px;
  height: 120px;
  background: #000;
  flex-shrink: 0;
}

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

.player-body {
  flex: 1;
  padding: 0px 15px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
}

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

.controls button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

#playPause, #mute {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    cursor: pointer;
    font-size: 20px;
    color: #333;
    padding: 0;
}

#playPause:focus, #playPause:active {
    outline: none !important;
    background: transparent !important;
}

#mute {
    font-family: serif;
}

.progress {
  flex: 1;
  height: 6px;
  background: #ddd;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  min-width: 60px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #2d89ef;
}

#volume {
  width: 80px;
  flex-shrink: 0;
}

span#duration {
    color: #e23838;
    font-weight: bold;
}

.nowplaying {
  margin-top: 8px;
  font-size: 14px;
  display: flex;
  gap: 6px;
  align-items: center;
  font-weight: bold;
  min-width: 0;
  color: #474747;
}

.np-label {
  font-weight: bold;
  flex-shrink: 0;
  white-space: nowrap;
  color: #000;
  display: inline-block;
}

@keyframes rubberBand {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.25, 0.75);
  }
  40% {
    transform: scale(0.75, 1.25);
  }
  50% {
    transform: scale(1.15, 0.85);
  }
  65% {
    transform: scale(0.95, 1.05);
  }
  75% {
    transform: scale(1.05, 0.95);
  }
  100% {
    transform: scale(1);
  }
}

.np-label.animate {
  animation: rubberBand 0.8s ease-in-out;
}

.lyrics-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.lyrics {
  margin-top: 6px;
  font-size: 13px;
  color: #555;
  max-height: 40px;
  overflow: hidden;
}

.lyrics-btn {
  background: #fff;
  border: solid 2px rgb(255, 255, 245);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  white-space: nowrap;
}

.lyrics-btn:hover {
  background: #e0e0e0;
}

.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(0,0,0,.6);
}

.modal-content {
  background: #fff;
  max-width: 500px;
  margin: 8% auto;
  padding: 20px;
  border-radius: 12px;
  max-height: 70vh;
  overflow-y: auto;
  text-align: center;
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 20px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 10px;
}

#lyricsModalText {
  line-height: 1.8;
  color: #333;
  font-size: 15px;
  white-space: pre-wrap;
}

#lyricsModalText p {
  margin-bottom: 16px;
  margin-top: 0;
}

#lyricsModalText p:last-child {
  margin-bottom: 0;
}

.close {
  float: right;
  font-size: 22px;
  cursor: pointer;
}

.np-marquee {
  position: relative;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

#nowplaying.marquee:hover {
  animation-play-state: paused;
}

#nowplaying {
  display: inline-block;
  white-space: nowrap;
}

#nowplaying.marquee {
  animation: marquee 14s linear infinite;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

@media (max-width: 768px) {
  .player-wrapper {
    max-width: 100%;
  }

  .artwork {
    width: 100px;
    min-width: 100px;
    height: 100px;
  }

  #volume {
    width: 70px;
  }
}

@media (max-width: 480px) {
  .player-wrapper {
    border-radius: 8px;
  }

  .artwork {
    width: 80px;
    min-width: 80px;
    height: 80px;
  }
  .controls {
    gap: 6px;
  }

  .controls button {
    font-size: 16px;
  }

  .progress {
    min-width: 40px;
  }

  #volume {
    display: none;
  }

  .nowplaying {
    font-size: 12px;
    margin-top: 6px;
  }

  .lyrics {
    font-size: 11px;
    margin-top: 4px;
  }

  .lyrics-btn {
    font-size: 12px;
    padding: 5px 10px;
    margin-top: 6px;
  }
}

@media (max-width: 360px) {
  .artwork {
    width: 70px;
    min-width: 70px;
    height: 70px;
  }

  .controls button {
    font-size: 14px;
  }

  #volume {
    display: none;
  }

  .nowplaying {
    font-size: 11px;
  }

  .lyrics {
    font-size: 10px;
  }
}

@keyframes marquee-scroll {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}