/* ═══════════════════════════════════════════
   FLOATING FROSTED GLASS TAB BAR
   Glassmorphism · Elevation · Rounded Container
   ═══════════════════════════════════════════ */

/* ── Nav container ── */
nav {
  position: fixed;
  bottom: calc(var(--safe-b) + 16px);
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 32px), 480px);

  height: var(--nav-h);

  /* Frosted glass */
  background: rgba(18, 16, 13, 0.72);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);

  /* Pill shape */
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.09);

  /* Elevation */
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.55),
    0 2px 8px  rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);

  display: flex;
  align-items: stretch;
  z-index: 100;

  /* Prevent iOS overscroll bleed */
  -webkit-transform: translateX(-50%) translateZ(0);
  transform: translateX(-50%) translateZ(0);
}

/* Safari PWA: push up from true bottom */
@media all and (display-mode: standalone) {
  nav {
    bottom: calc(max(var(--safe-b), env(safe-area-inset-bottom, 0px)) + 16px);
  }
}

/* ── Nav buttons ── */
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  color: rgba(138, 131, 120, 0.7);
  cursor: pointer;
  transition: color 0.2s, transform 0.15s;
  padding: 8px 0;
  position: relative;
  border-radius: 28px;
  -webkit-tap-highlight-color: transparent;
}

.nav-btn:active {
  transform: scale(0.92);
}

.nav-btn.active {
  color: var(--accent);
}

/* Active pill highlight */
.nav-btn.active::before {
  content: '';
  position: absolute;
  inset: 6px 8px;
  background: rgba(200, 169, 110, 0.1);
  border-radius: 18px;
  border: 1px solid rgba(200, 169, 110, 0.15);
}

.nav-btn svg {
  width: 21px;
  height: 21px;
  position: relative;
  z-index: 1;
}

.nav-btn span {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

/* Active dot indicator */
.nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.8;
}

/* ── Player bar — floats above nav ── */
#player-bar {
  background: rgba(14, 12, 10, 0.88);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border: 1px solid rgba(200, 169, 110, 0.2);
  border-radius: 20px;
  padding: 10px 14px;
  display: none;
  align-items: center;
  gap: 12px;
  position: fixed;
  bottom: calc(var(--safe-b) + 16px + var(--nav-h) + 10px);
  left: 50%;
  transform: translateX(-50%) translateZ(0);
  -webkit-transform: translateX(-50%) translateZ(0);
  width: min(calc(100% - 32px), 480px);
  z-index: 99;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#player-bar.visible { display: flex; }

@media all and (display-mode: standalone) {
  #player-bar {
    bottom: calc(max(var(--safe-b), env(safe-area-inset-bottom, 0px)) + 16px + var(--nav-h) + 10px);
  }
}

#player-thumb {
  width: 40px; height: 40px;
  background: var(--bg4);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  border: 1px solid var(--border);
}
#player-info { flex: 1; min-width: 0; }
#player-title {
  font-family: 'Fraunces', serif;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#player-artist { font-size: 10px; color: var(--text2); letter-spacing: 0.05em; }
#player-play {
  width: 36px; height: 36px;
  background: var(--accent);
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  color: #080808;
  flex-shrink: 0;
}
#player-progress {
  position: absolute;
  bottom: 0; left: 14px; right: 14px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
}
#player-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  border-radius: 2px;
  transition: width 0.5s linear;
}
audio { display: none; }

/* ── Toast — clears floating nav ── */
#toast {
  position: fixed;
  bottom: calc(var(--safe-b) + 16px + var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(30, 28, 24, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
