:root {
  --home-player-height: 88px;
}

/* The audio element stays in the shell while only the home controls are shown. */
body:not(.is-home) #player {
  display: none;
}

#player.music-player {
  position: relative;
  inset: auto;
  width: 100%;
  height: var(--home-player-height);
  padding: 8px 6.4%;
  margin: 0;
  z-index: 35;
  border: 0;
  border-top: 1px solid rgba(154, 129, 147, 0.12);
  background: rgba(255, 251, 254, 0.2);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#player .player-inner {
  width: 100%;
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

#player .player-main {
  min-width: 0;
  min-height: 42px;
  gap: 12px;
}

#player .player-cover {
  width: 36px;
  height: 36px;
  border-radius: 5px;
  box-shadow: none;
  opacity: 0.8;
}

#player .player-info {
  gap: 0;
}

#player .now-playing {
  display: none;
}

#player .player-title {
  font-size: 12px;
  line-height: 1.6;
  color: #806979;
}

#player .player-artist {
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.5px;
  color: #a38f9c;
}

#player .player-controls {
  flex-shrink: 0;
  gap: 4px;
}

#player .player-controls .icon-button,
#player .player-main > .icon-button {
  min-width: 36px;
  min-height: 42px;
  padding: 9px;
  margin: 0;
  color: #a28797;
}

#player .player-controls .icon-button .icon,
#player .player-main > .icon-button .icon {
  width: 15px;
  height: 15px;
  color: inherit;
}

#player .player-play {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(174, 139, 159, 0.36);
  background: rgba(255, 251, 255, 0.25);
  color: #aa7e94;
  box-shadow: none;
}

#player .player-play .icon {
  width: 16px;
  height: 16px;
}

#player .player-play:hover {
  background: rgba(255, 251, 255, 0.55);
}

#player .player-bottom {
  min-width: 0;
  min-height: 24px;
  margin-top: 0;
  gap: 14px;
}

#player .player-time {
  flex-shrink: 0;
  font-size: 8px;
  gap: 4px;
  color: #a38f9c;
}

#player .player-seek {
  min-width: 0;
  height: 24px;
}

#player .volume-control {
  flex-shrink: 0;
  gap: 6px;
}

#player .volume-control .icon-button {
  min-width: 24px;
  min-height: 24px;
  padding: 4px;
}

#player .volume-control .icon {
  width: 13px;
  height: 13px;
}

#player .volume-range {
  width: 56px;
}

#player .playlist {
  left: auto;
  right: 6.4%;
  bottom: calc(100% + 8px);
  width: min(360px, calc(100% - 24px));
  max-height: min(420px, calc(100svh - 112px));
  overflow-y: auto;
  border-radius: 14px;
}

#player .track-details {
  min-width: 0;
}

#player .track-details strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 700px) {
  :root {
    --home-player-height: calc(96px + env(safe-area-inset-bottom));
  }

  #player.music-player {
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  }

  #player .player-main {
    min-height: 44px;
    gap: 6px;
  }

  #player .player-cover {
    width: 32px;
    height: 32px;
  }

  #player .player-title {
    font-size: 11px;
  }

  #player .player-artist {
    font-size: 8px;
  }

  #player .player-controls {
    gap: 0;
  }

  #player .player-controls .icon-button,
  #player .player-main > .icon-button {
    min-width: 36px;
    min-height: 44px;
    padding: 9px;
  }

  #player .player-bottom {
    min-height: 28px;
    gap: 9px;
  }

  #player .player-seek {
    height: 28px;
  }

  #player .volume-control {
    gap: 4px;
  }

  #player .volume-control .icon-button {
    min-width: 28px;
    min-height: 28px;
    padding: 6px;
  }

  #player .volume-range {
    width: 42px;
  }

  #player .playlist {
    right: 12px;
  }
}
