.gift-nav {
  position: sticky;
  top: 14px;
  z-index: 50;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: calc(100% - 28px);
  margin: 14px auto -72px;
  padding: 6px;
  border: 1px solid var(--border-wine);
  border-radius: 999px;
  background: var(--surface-glass);
  box-shadow: 0 18px 48px rgba(58,23,19,0.14);
  backdrop-filter: blur(18px);
  overflow: visible;
  transition: box-shadow 0.3s ease, background 0.3s ease;
  will-change: transform;
}

.nav-links {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}

.nav-links button {
  min-height: 38px;
  min-width: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.nav-links button.is-active {
  background: var(--wine);
  color: white;
}

.music-slot {
  position: relative;
  display: flex;
  align-items: center;
}

.mini-player {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-solid);
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  padding: 2px 4px 2px 2px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(103,29,44,0.1);
}

.mini-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  min-width: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 8px;
  background: transparent;
  color: var(--wine);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.mini-btn:hover { background: rgba(183,63,85,0.12); }

.mini-btn--play {
  width: 30px; height: 30px;
  padding: 0;
  background: var(--rose);
  color: white;
  font-size: 11px;
  flex-shrink: 0;
}

.mini-btn--play:hover { background: var(--wine); }

.mini-btn--open {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 140px;
  color: var(--muted);
  font-size: 11px;
}

.mini-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 110px;
}

.music-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: 290px;
  max-width: calc(100vw - 28px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  box-shadow: 0 8px 32px rgba(103,29,44,0.18);
  backdrop-filter: blur(20px);
  overflow: hidden;
  animation: playlistIn 0.2s cubic-bezier(0.2,0.8,0.2,1) both;
}

.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(103,29,44,0.08);
}

.playlist-title { font-size: 12px; font-weight: 800; color: var(--wine); }
.playlist-count { font-size: 11px; color: var(--muted); }

.playlist-now-playing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(183,63,85,0.06);
  border-bottom: 1px solid rgba(103,29,44,0.06);
}

.now-playing-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--wine);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.now-playing-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  flex-shrink: 0;
}

.now-playing-bars span {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 2px;
  background: var(--rose);
}

.now-playing-bars.is-active span:nth-child(1) { animation: barBounce 0.6s ease-in-out 0.00s infinite alternate; }
.now-playing-bars.is-active span:nth-child(2) { animation: barBounce 0.6s ease-in-out 0.15s infinite alternate; }
.now-playing-bars.is-active span:nth-child(3) { animation: barBounce 0.6s ease-in-out 0.05s infinite alternate; }
.now-playing-bars.is-active span:nth-child(4) { animation: barBounce 0.6s ease-in-out 0.20s infinite alternate; }

.playlist-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(103,29,44,0.06);
}

.pl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid rgba(103,29,44,0.18);
  border-radius: 50%;
  background: rgba(103,29,44,0.04);
  color: var(--wine);
  font-size: 13px;
  transition: all 0.15s ease;
}

.pl-btn:hover { background: var(--rose); border-color: var(--rose); color: white; transform: scale(1.08); }

.pl-btn.is-active { background: var(--rose); border-color: var(--rose); color: white; }

.pl-btn--shuffle svg { display: block; }
.pl-btn svg, .mini-btn svg { display: block; }

.pl-btn--main {
  width: 38px; height: 38px;
  font-size: 16px;
  background: var(--rose);
  border-color: var(--rose);
  color: white;
  box-shadow: 0 4px 14px rgba(183,63,85,0.35);
}

.pl-btn--main:hover { background: var(--wine); border-color: var(--wine); }

.pl-btn--close {
  font-size: 11px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.pl-btn--close:hover { background: rgba(183,63,85,0.1); color: var(--wine); border-color: transparent; }

.playlist-tracks {
  flex: 1;
  overflow-y: auto;
  min-height: 160px;
  max-height: 210px;
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--rose) transparent;
}

.playlist-tracks::-webkit-scrollbar       { width: 3px; }
.playlist-tracks::-webkit-scrollbar-thumb { background: var(--rose); border-radius: 3px; }

.music-track-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 5px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.music-track-item:hover   { background: rgba(183,63,85,0.1); color: var(--wine); }
.music-track-item.is-active { background: var(--rose); color: white; }

.track-num   { min-width: 16px; font-size: 10px; opacity: 0.4; font-variant-numeric: tabular-nums; }
.track-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-playing-icon { font-size: 11px; animation: trackPulse 0.8s ease-in-out infinite alternate; }


.nav-bear {
  position: fixed;
  right: max(4px, calc((100vw - 760px) / 2 - 14px));
  top: 76px;
  z-index: 52;
  width: 76px;
  height: 76px;
  overflow: visible;
  opacity: 0;
  transform: translateY(8px);
  transition:
          opacity   0.5s cubic-bezier(0.2,0.8,0.2,1),
          transform 0.5s cubic-bezier(0.2,0.8,0.2,1);
  pointer-events: none;
}

.nav-bear.is-dancing {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  will-change: transform, opacity;
}

.nav-bear-lottie {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: translateZ(0);
  backface-visibility: hidden;
}

@media (max-width: 620px) {
  .nav-bear {
    right: 14px;
    top: 74px;
    width: 58px;
    height: 58px;
  }

  .nav-bear-lottie {
    width: 100%;
    height: 100%;
  }
}


.nav-burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.nav-burger:hover { background: rgba(103,29,44,0.06); }

.nav-burger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--wine);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-mobile-menu {
  display: none;
}

@media (max-width: 1100px) {
  .gift-nav {
    width: calc(100% - 28px);
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 14px auto 16px;
    transition: box-shadow 0.3s ease, background 0.3s ease;
  }

  .gift-nav.is-menu-open {
    border-radius: 24px;
  }

  .nav-links {
    display: none;
  }

  .nav-burger {
    display: flex;
  }

  .nav-mobile-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    order: 10;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(103,29,44,0.1);
    animation: playlistIn 0.2s cubic-bezier(0.2,0.8,0.2,1) both;
  }

  .nav-mobile-menu button {
    min-height: 42px;
    border: 0;
    border-radius: 12px;
    padding: 0 16px;
    background: transparent;
    color: var(--muted);
    font-size: 15px;
    font-weight: 800;
    text-align: left;
    transition: background var(--transition), color var(--transition);
  }

  .nav-mobile-menu button.is-active {
    background: var(--wine);
    color: white;
  }

  .music-slot {
  }

  .mini-title {
    display: none;
  }

  .mini-btn--open {
    max-width: none;
  }

  .music-dropdown {
    position: fixed !important;
    inset: 0 !important;
    margin: auto !important;
    width: min(320px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    height: fit-content !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
    z-index: 999 !important;
  }

  .nav-bear {
    right: 14px;
  }
}

/* ── Progress / Seek Bar ── */
.playlist-progress {
  padding: 7px 14px 6px;
  border-bottom: 1px solid rgba(103,29,44,0.06);
}

.progress-bar-track {
  position: relative;
  height: 4px;
  background: rgba(103,29,44,0.13);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 5px;
}

.progress-bar-track:hover { background: rgba(103,29,44,0.2); }

.progress-bar-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0%;
  background: var(--rose);
  border-radius: 2px;
  pointer-events: none;
}

.progress-bar-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--rose);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(183,63,85,0.45);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.progress-bar-track:hover .progress-bar-thumb { opacity: 1; }

.progress-bar-track:active .progress-bar-thumb {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.2);
}

.progress-times {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}