#global-audio-player {
  position: fixed;
  left: 0;
  bottom: -100px;
  width: 100vw;
  z-index: 10000;
  transition: bottom 0.35s cubic-bezier(.73,-0.01,.33,1.04), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}
#global-audio-player.active {
  bottom: 0;
  opacity: 1;
  pointer-events: auto;
}
.audio-player-bar {
  width: 100%;
  min-height: 74px;
  background: linear-gradient(90deg, #202a40 0%, #222b41 100%);
  border-top: 2.5px solid #FFD23E;
  position: relative;
  box-shadow: 0 -6px 48px #0008;
  padding: 8px 0px 8px 0px;
  font-size: 1.18em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ap-left {
  display: flex;
  align-items: center;
  min-width: 0;
  padding-left: 24px;
  gap: 14px;
  flex-shrink: 0;
  max-width: 33vw;
}
.ap-center-wrap {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 430px;
  pointer-events: none; 
}

.ap-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-width: 0;
  pointer-events: auto; 
}
.ap-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.ap-cover {
  width: 54px;
  height: 54px;
  background: #222b41;
  border-radius: 13px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  margin-right: 11px;
}

.ap-cover.vinyl {
  background: none !important;
  box-shadow: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-width: 54px;
  min-height: 54px;
}
.ap-vinyl-svg {
  width: 54px;
  height: 54px;
  display: block;
}
.vinyl-spin .ap-vinyl-svg {
  animation: vinyl-spin 1.2s linear infinite;
}
@keyframes vinyl-spin {
  100% { transform: rotate(360deg);}
}


.ap-title {
  font-weight: 600;
  font-size: 1.08em;
  color: #FFD23E;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ap-author {
  font-size: 0.92em;
  color: #ffe98a;
  margin-top: 2px;
  opacity: 0.85;
}
.ap-episode {
  font-size: 0.96em;
  color: #22e07c;
  font-weight: 500;
}

/* Центр: контролі */
.ap-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: center;
  height: 100%;
}

/* Правий блок: прогрес і закриття */
.ap-right {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 24px;
  flex-shrink: 0;
  max-width: 33vw;
}

.ap-progress {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 420px;
  max-width: 40vw;
  min-width: 300px;
  justify-content: center;
  margin-top: 7px;
}

.ap-btn {
  background: #232b3a;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: #FFD23E;
  font-size: 1.25em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.17s, color 0.17s, box-shadow 0.17s;
  cursor: pointer;
  outline: none;
}

.ap-btn:hover,
.ap-btn:focus,
.ap-btn:active {
  background: #FFD23E;
  color: #222b41;
  box-shadow: 0 2px 10px #FFD23E33;
}

.ap-btn.ap-shuffle.active,
.ap-btn.ap-shuffle.always-on {
  background: #FFD23E;
  color: #222b41;
  box-shadow: 0 2px 10px #FFD23E66;
}

.ap-btn.ap-shuffle.always-on {
  opacity: 0.6;
  pointer-events: none;
}

.ap-btn.ap-close {
  position: static;
  margin-left: 10px;
  font-size: 1.45em;
  background: none;
  color: #FFD23E;
  width: 38px;
  height: 38px;
  box-shadow: none;
}

.ap-progressbar {
  -webkit-appearance: none;
  appearance: none;
  width: 170px;
  flex: 1 1 70px;
  height: 7px;
  border-radius: 7px;
  background: linear-gradient(90deg,#FFD23E 0%,#FFD23E 0%,#bfc4d1 0%, #bfc4d1 100%);
  outline: none;
  transition: background 0.3s;
  margin: 0 6px;
}
.ap-progressbar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFD23E;
  border: 3px solid #fff;
  box-shadow: 0 2px 7px #FFD23E40;
  cursor: pointer;
  transition: background 0.2s;
}
.ap-progressbar::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFD23E;
  border: 3px solid #fff;
  box-shadow: 0 2px 7px #FFD23E40;
  cursor: pointer;
  transition: background 0.2s;
}
.ap-progressbar::-ms-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFD23E;
  border: 3px solid #fff;
  box-shadow: 0 2px 7px #FFD23E40;
  cursor: pointer;
  transition: background 0.2s;
}
.ap-progressbar:focus::-webkit-slider-thumb {
  background: #FFD23E;
}
.ap-progressbar::-webkit-slider-runnable-track {
  height: 7px;
  border-radius: 7px;
}
.ap-progressbar::-ms-fill-lower {
  background: #FFD23E;
  border-radius: 7px;
}
.ap-progressbar::-ms-fill-upper {
  background: #bfc4d1;
  border-radius: 7px;
}
.ap-progressbar::-moz-range-track {
  height: 7px;
  border-radius: 7px;
  background: transparent;
}

/* For Firefox */
.ap-progressbar::-moz-range-progress {
  background-color: #FFD23E;
  height: 7px;
  border-radius: 7px;
}
.ap-progressbar::-moz-range-track {
  background-color: #bfc4d1;
  height: 7px;
  border-radius: 7px;
}

.ap-progressbar:focus {
  outline: none;
  box-shadow: 0 0 0 2px #FFD23E66;
}
.ap-time {
  font-size: 0.96em;
  color: #FFD23E;
  min-width: 42px;
  text-align: right;
  user-select: none;
}

.ap-btn.ap-close:hover {
  background: #FFD23E;
  color: #222b41;
  box-shadow: 0 2px 10px #FFD23E22;
}

/* MOBILE */
@media (max-width: 700px) {
  .audio-player-bar {
    display: none !important;
  }
  .audio-player-bar-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(90deg, #202a40 0%, #222b41 100%);
    border-top: 2.5px solid #FFD23E;
    box-shadow: 0 -6px 48px #0008;
    padding: 10px 2vw 14px 2vw;
    font-size: 1.08em;
    min-height: 0;
    width: 100vw;
  }
  .ap-mobile-row {
    display: flex;
    align-items: center;
    width: 100%;
  }
  .ap-mobile-title-row {
    justify-content: space-between;
    font-weight: 600;
    font-size: 1.08em;
    color: #FFD23E;
    margin-bottom: 2px;
  }
  .ap-mobile-title-row .ap-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #FFD23E;
    font-size: 1.08em;
  }
  .ap-mobile-title-row .ap-btn.ap-close {
    margin-left: 10px;
    font-size: 1.45em;
    background: none;
    color: #FFD23E;
    width: 38px;
    height: 38px;
    box-shadow: none;
  }
  .ap-mobile-progress-row {
    justify-content: center;
    gap: 7px;
    margin-bottom: 2px;
  }
  .ap-mobile-progress-row .ap-progressbar {
    width: 100px;
    min-width: 55px;
    max-width: 60vw;
    flex: 1 1 70px;
    height: 7px;
  }
  .ap-mobile-progress-row .ap-progressbar::-webkit-slider-thumb {
    margin-top: -5px;
  }
  .ap-mobile-progress-row .ap-progressbar::-webkit-slider-runnable-track {
    height: 7px;
  }
  .ap-mobile-progress-row .ap-progressbar::-moz-range-thumb {
    margin-top: -5px;
  }
  .ap-mobile-progress-row .ap-progressbar::-ms-thumb {
    margin-top: -5px;
  }
  .ap-mobile-controls-row {
    justify-content: center;
    gap: 18px;
    margin-top: 2px;
  }
  .ap-mobile-controls-row .ap-btn {
    width: 48px;
    height: 48px;
    font-size: 1.45em;
  }
  .audio-player-bar-mobile {
    display: flex;
  }
}
@media (min-width: 701px) {
  .audio-player-bar-mobile {
    display: none !important;
  }
}


@media (max-width: 400px) {
  .ap-cover { width: 22px; height: 22px;}
  .ap-left { padding-left: 7px;}
  .ap-meta { min-width: 44px;}
  .ap-title, .ap-episode { font-size: 0.82em;}
  .ap-progressbar { width: 70px; min-width: 35px;}
  .ap-btn, .ap-btn.ap-close { width: 25px; height: 25px; font-size: 0.9em;}
}