/* Music Player — square card, cover on top */
.music-player {
  position: fixed;
  left: 30px;
  bottom: 30px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: .5rem;
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  padding: 1rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}

/* cover */
.music-player .song-cover {
  width: 120px !important;
  height: 120px !important;
  border-radius: 14px;
  object-fit: cover;
  margin: .25rem 0 .4rem;
  user-select: none;
  -webkit-user-drag: none;
}

/* title */
.music-player .track-title {
  order: 1;
  font-size: .95rem;
  color: #222;
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* time + seek */
.player-slider {
  order: 2;
  display: flex;
  align-items: center;
  gap: .4rem;
  width: 100%;
  margin: 0;
}
.player-slider input[type="range"] { flex: 1; min-width: 0; }

/* controls row */
.player-controls {
  order: 3;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  width: 100%;
  padding: 0.2rem 0;
  box-sizing: border-box;
}

/* bottom (volume) */
.player-bottom {
  order: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  margin-top: 1.2rem;
}
#volume-slider { flex: 1; min-width: 0; }

/* buttons */
.music-player button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  box-shadow: none;
  border-radius: 10px;          /* small rounding for hover ring */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  transition: transform 0.1s, box-shadow 0.1s, outline-color 0.1s;
  outline: none;
  position: relative;
  transform: none !important;   /* prevent accidental scaling */
}
.music-player button:active {
  transform: scale(0.97);
  box-shadow: 0 0 0 2px #2222;
}
.music-player button:hover {
  background: #f3f3f3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* icons (force consistent size, no tint) */
.music-player button img {
  display: block;
  width: 22px !important;
  height: 22px !important;
  object-fit: contain;
  margin: auto;
  pointer-events: none;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
}

/* ensure specific buttons never get transformed/greyed by other CSS */
#prev-btn, #fastbackward-btn, #play-btn, #pause-btn,
#forward-btn, #fastforward-btn, #loop-btn, #shuffle-btn {
  transform: none !important;
  opacity: 1 !important;
  filter: none !important;
}

/* some styles use positional selectors for fading last icons; cancel that */
.player-controls button:nth-last-child(1),
.player-controls button:nth-last-child(2) {
  opacity: 1 !important;
  filter: none !important;
}

/* force loop & shuffle to appear black even if the PNGs are grey.
   If your source icons are white, these will also render black. */
#loop-btn img,
#shuffle-btn img {
  filter: grayscale(1) brightness(0) !important;  /* pushes to solid black */
}

/* Active (toggled) styles: colored circular background and white icon */
#loop-btn.is-active, #shuffle-btn.is-active {
  background: linear-gradient(135deg, #ff6b6b, #ff3b6b);
  box-shadow: 0 6px 18px rgba(255,59,107,0.18);
}

#loop-btn.is-active img, #shuffle-btn.is-active img {
  /* make the icon white when active */
  filter: brightness(0) invert(1) !important;
}

/* sliders */
.music-player input[type="range"]{
  -webkit-appearance:none;
  appearance:none;
  height:4px;
  background:#d9d9d9;
  border-radius:999px;
  cursor:pointer
}
.music-player input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:14px;
  height:14px;
  background:#222;
  border-radius:50%;
  border:2px solid #fff;
  box-shadow:0 1px 3px rgba(0,0,0,.15)
}
.music-player input[type="range"]::-moz-range-thumb{
  width:14px;
  height:14px;
  background:#222;
  border:2px solid #fff;
  border-radius:50%
}

/* prevent any global grayscale on images in the player */
.music-player img {
  filter: none !important;
  opacity: 1 !important;
}

/* mobile */
@media (max-width: 480px){
  .music-player{
    left:4vw;
    bottom:12px;
    width:min(92vw,360px);
    min-width:auto;
    max-width:min(92vw,360px);
    padding:.85rem;
    gap:.45rem
  }
  .music-player .song-cover{
    width:36vw;
    height:36vw;
    max-width:140px;
    max-height:140px
  }
  .music-player button {
    width: 22px !important;
    height: 22px !important;
  }
  .music-player button img {
    width: 22px !important;
    height: 22px !important;
  }
}
