/* ersy mini player — Spotify-style compact bar */

:root {
  --bar-h: 64px;
  --bar-radius: 12px;
  --bar-inset: 10px;
  --bar-magenta: #ff2d6f;
  --bar-magenta-soft: rgba(255, 45, 111, 0.35);
}

.player-dock {
  display: contents;
}

.bar,
.bar.ersy-playbar,
.vh.audio .vh-box {
  position: fixed;
  left: var(--bar-inset) !important;
  right: var(--bar-inset) !important;
  bottom: calc(var(--bar-inset) + env(safe-area-inset-bottom, 0px)) !important;
  top: auto !important;
  transform: none !important;
  z-index: 60;
  width: auto !important;
  min-height: var(--bar-h);
  height: var(--bar-h) !important;
  padding: 8px 10px 10px !important;
  display: grid;
  align-items: center;
  background: #1a1520 !important;
  border: 0 !important;
  border-radius: var(--bar-radius) !important;
  box-shadow: none !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  overflow: hidden;
  cursor: pointer;
}

.bar-tint {
  display: none;
}

.bar::after,
.vh.audio .vh-box::after {
  display: none;
}

.bar-main,
.vh.audio .vh-grip {
  position: relative;
  z-index: 2;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.bar-left,
.vh.audio .vh-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.bar-center {
  display: none !important;
}

.bar-right,
.vh.audio .vh-controls {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  flex: none;
  min-width: 0;
}

.bar button,
.bar input,
.vh.audio .vh-btn,
.vh.audio .vh-play-main,
.vh.audio .vh-seek,
.vh.audio input,
.vh.audio .vh-meta {
  cursor: pointer;
}

.bar .disc,
.bar .disc img,
.vh.audio .vh-meta img {
  width: 44px !important;
  height: 44px !important;
  flex: none;
  border-radius: 6px !important;
  object-fit: cover;
  object-position: center 20%;
  background: #1a1524;
  display: block;
}

.bar .disc {
  border: 0;
  background: transparent;
  padding: 0;
}

.bar .disc.spin img,
.bar .disc i {
  animation: none;
  border-radius: 6px !important;
}

.bar .disc i {
  display: none;
}

.bar-meta,
.bar-meta-btn,
.vh.audio .vh-text {
  min-width: 0;
  display: grid;
  gap: 2px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.bar-meta strong,
.vh.audio .vh-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  mask-image: none;
  -webkit-mask-image: none;
}

.bar-meta span,
.vh.audio .vh-kind,
.vh.audio .vh-text em {
  display: block;
  font-size: 12px;
  font-weight: 500;
  font-style: normal;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-ico,
.bar-play,
.vh.audio .vh-btn,
.vh.audio .vh-play-main {
  width: 36px !important;
  height: 36px !important;
  border: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: #fff !important;
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  position: relative;
  flex: none;
}

.vh.audio .vh-btn::after,
.vh.audio .vh-play-main::after {
  display: none !important;
}

.bar-ico:hover,
.bar-play:hover,
.vh.audio .vh-btn:hover,
.vh.audio .vh-play-main:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.bar-ico .yt-svg,
.bar-play .yt-svg,
.vh.audio .vh-btn .yt-svg,
.vh.audio .vh-play-main svg {
  width: 20px;
  height: 20px;
}

.bar-save {
  width: 28px !important;
  height: 28px !important;
  margin: 0 2px;
  border: 1.5px solid rgba(255, 255, 255, 0.88) !important;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  color: #fff !important;
}

.bar-save.on {
  border-color: #fff !important;
  color: #fff !important;
}

.bar-save.on::after,
.bar-ico.on::after {
  display: none;
}

.bar-ico.on,
.vh.audio .vh-btn.on {
  color: #ff2d6f !important;
}

.bar-progress,
.bar .bar-progress.seek,
.vh.audio .vh-seekrow {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  z-index: 3;
  height: 2px;
  display: block !important;
  margin: 0;
  padding: 0;
  width: auto;
}

.bar-progress.seek,
.vh.audio .vh-seek {
  height: 2px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  overflow: hidden;
  flex: none;
}

.bar-progress i,
.vh.audio .vh-seek i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 99px;
  background: #fff;
  display: block;
  box-shadow: none;
}

.bar-progress i::after,
.vh.audio .vh-seek i::after,
.bar-seek,
.bar .time,
.vh.audio .vh-time {
  display: none !important;
}

.bar-vol,
.bar-transport {
  display: none !important;
}

.bar-device-wrap {
  position: relative;
}

.bar-dot {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 6px;
  height: 6px;
  margin: 0;
  border-radius: 50%;
  background: var(--bar-magenta);
}

.device-pop {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: min(320px, calc(100vw - 24px));
  padding: 14px;
  border-radius: 16px;
  background: #1a1524;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  display: grid;
  gap: 8px;
  z-index: 70;
}

.device-pop-fixed {
  position: fixed;
  right: calc(var(--bar-inset) + 8px);
  bottom: calc(var(--bar-h) + var(--bar-inset) + 14px);
  z-index: 80;
}

.device-pop > strong {
  font-size: 13px;
  font-weight: 700;
  padding: 2px 6px 8px;
}

.device-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.device-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.device-row.on {
  color: var(--bar-magenta);
}

.device-row span:first-child {
  display: grid;
  place-items: center;
}

.device-row b {
  display: block;
  font-size: 13px;
  font-weight: 650;
}

.device-row em {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-style: normal;
  color: #b3b3b3;
}

.device-note {
  margin: 4px 6px 0;
  font-size: 11px;
  line-height: 1.4;
  color: #a7a7a7;
}

/* Video collapsed into the same mini bar */
.vh.audio {
  pointer-events: none;
}

.vh.audio .vh-box {
  width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  pointer-events: none !important;
}

.vh.audio .vh-now-head,
.vh.audio .vh-stage,
.vh.audio .vh-dots,
.vh.audio .vh-resize,
.vh.audio .vh-art,
.vh.audio .vh-transport,
.vh.audio .vh-controls,
.vh.audio .vh-grip,
.vh.audio [data-vh-min] {
  display: none !important;
}

.vh.audio iframe {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  bottom: 0;
  left: 0;
}

.vh.audio .vh-controls [data-vh-max] {
  display: grid !important;
  place-items: center;
  color: #fff !important;
}

.vh.audio .vh-center {
  display: contents;
}

.vh.audio .vh-meta {
  grid-area: unset;
  margin: 0 !important;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0;
}

.vh.audio .vh-meta {
  order: 1;
  flex: 1;
  min-width: 0;
}

.vh.audio .vh-controls {
  order: 2;
}

.vh.audio .vh-transport {
  order: 3;
  display: flex !important;
  align-items: center;
  margin: 0;
  gap: 0;
}

.vh.audio .vh-seekrow {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  width: auto;
  margin: 0;
  padding: 0;
  display: block !important;
  z-index: 3;
}

.bar-desk {
  display: none !important;
}

@media (min-width: 861px) {
  :root {
    --bar-h: 90px;
    --bar-inset: 0px;
  }

  .bar,
  .bar.ersy-playbar {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 90px !important;
    min-height: 90px !important;
    padding: 0 16px !important;
    border-radius: 0 !important;
    background: #000 !important;
    border: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    overflow: visible;
    cursor: default;
  }

  .bar-main {
    display: grid !important;
    grid-template-columns: minmax(160px, 1fr) minmax(240px, 2fr) minmax(300px, 1.15fr);
    align-items: center;
    gap: 12px 16px;
    height: 100%;
  }

  .bar-left {
    gap: 12px;
  }

  .bar .disc,
  .bar .disc img {
    width: 56px !important;
    height: 56px !important;
    border-radius: 4px !important;
  }

  .bar-meta-btn {
    width: auto;
    max-width: 100%;
    flex: 1;
  }

  .bar-meta strong {
    font-size: 14px;
    font-weight: 600;
  }

  .bar-meta span {
    font-size: 11px;
    color: #b3b3b3;
  }

  .bar-save {
    width: 18px !important;
    height: 18px !important;
    margin: 0;
    border: 1.5px solid rgba(255, 255, 255, 0.7) !important;
    font-size: 11px;
    flex: none;
  }

  .bar-save.on {
    border-color: #1ed760 !important;
    background: #1ed760 !important;
    color: #000 !important;
  }

  .bar-center {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
    max-width: 722px;
    margin: 0 auto;
  }

  .bar-transport {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .bar-center .bar-ico {
    width: 32px !important;
    height: 32px !important;
    color: #b3b3b3 !important;
  }

  .bar-center .bar-ico:hover {
    color: #fff !important;
    background: transparent !important;
  }

  .bar-center .bar-ico.on {
    color: #1ed760 !important;
  }

  .bar-center .bar-ico.on::after {
    display: block !important;
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: currentColor;
  }

  .bar-center .bar-play {
    width: 32px !important;
    height: 32px !important;
    background: #fff !important;
    color: #000 !important;
    margin: 0 8px;
  }

  .bar-center .bar-play:hover {
    transform: scale(1.06);
    background: #fff !important;
  }

  .bar-center .bar-play .yt-svg {
    width: 16px;
    height: 16px;
    color: #000;
  }

  .bar-seek {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .bar-seek .time {
    display: block !important;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: #a7a7a7;
    min-width: 40px;
  }

  .bar-seek .time:last-child {
    text-align: right;
  }

  .bar-seek .seek {
    position: relative;
    flex: 1;
    height: 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.3);
    overflow: visible;
    cursor: pointer;
  }

  .bar-seek .seek i {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 99px;
    background: #fff;
  }

  .bar-seek .seek:hover i {
    background: #1ed760;
  }

  .bar-seek .seek i::after {
    display: none;
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  }

  .bar-seek .seek:hover i::after {
    display: block !important;
  }

  .bar-progress,
  .bar-mobile-progress,
  .bar-mobile-play {
    display: none !important;
  }

  .bar-desk {
    display: inline-grid !important;
  }

  .bar-vol.bar-desk {
    display: flex !important;
    align-items: center;
    gap: 4px;
    flex: 1 1 72px;
    min-width: 72px;
    max-width: 140px;
    margin-right: 4px;
  }

  .bar-right {
    gap: 2px;
    min-width: 0;
    overflow: visible;
  }

  .bar-right .bar-ico,
  .bar-right .bar-play {
    flex: none;
    flex-shrink: 0;
  }

  .bar-right .bar-ico {
    width: 32px !important;
    height: 32px !important;
    color: #b3b3b3 !important;
  }

  .bar-right .bar-ico:hover {
    color: #fff !important;
    background: transparent !important;
  }

  .bar-right .bar-ico.on {
    color: #1ed760 !important;
  }

  .bar-right [data-act="pop-mini"],
  .bar-right [data-act="now-playing"] {
    position: relative;
    z-index: 2;
  }

  .bar-vol-range {
    -webkit-appearance: none;
    appearance: none;
    flex: 1 1 auto;
    width: auto;
    min-width: 52px;
    max-width: 93px;
    height: 4px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 99px;
    background: linear-gradient(
      to right,
      #fff var(--vol, 80%),
      rgba(255, 255, 255, 0.3) var(--vol, 80%)
    );
    accent-color: #fff;
    cursor: pointer;
  }

  .bar-vol-range::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 99px;
    background: transparent;
  }

  .bar-vol-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    margin-top: -4px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    cursor: pointer;
  }

  .bar-vol-range::-moz-range-track {
    height: 4px;
    border-radius: 99px;
    background: transparent;
  }

  .bar-vol-range::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    cursor: pointer;
  }

  .bar-vol-range:hover {
    background: linear-gradient(
      to right,
      #1ed760 var(--vol, 80%),
      rgba(255, 255, 255, 0.3) var(--vol, 80%)
    );
  }

  .bar-vol-range:hover::-webkit-slider-thumb,
  .bar-vol-range:hover::-moz-range-thumb {
    background: #1ed760;
  }

  @media (max-width: 1100px) {
    .bar-right [data-act="lyrics"],
    .bar-right [data-act="queue"] {
      display: none !important;
    }
  }

  .bar-dot {
    background: #1ed760;
  }
}
