/* Sticky mini player — airy translucent white pill, subtle shadow,
   matches the hero radio aesthetic. Hidden on homepage. */

/* The sticky pill is small and sits at bottom-right; it can overlap a
   bit of the footer without losing anything important. No extra body
   padding — that created a visible gap below the footer. */
body[data-page="home"] .sticky-player { display: none !important; }

.sticky-player {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  z-index: 500;
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 12px;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface-card) 80%, transparent);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 10px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(130%);
  opacity: 0;
  transition: transform var(--trans-med), opacity var(--trans-med);
  pointer-events: none;
}
[data-theme='dark'] .sticky-player {
  background: color-mix(in srgb, var(--surface-card) 72%, transparent);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 10px 28px rgba(0, 0, 0, 0.45);
}
.sticky-player.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
@media (min-width: 640px) {
  .sticky-player {
    left: auto;
    width: 420px;
    max-width: calc(100vw - 32px);
  }
}

.sticky-player__play {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: #FF3B47;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  box-shadow:
    0 0 0 1px rgba(255, 59, 71, 0.15),
    0 4px 10px rgba(255, 59, 71, 0.25);
  transition: transform var(--trans-fast), box-shadow var(--trans-fast);
}
.sticky-player__play:hover {
  transform: scale(1.06);
  box-shadow:
    0 0 0 3px rgba(255, 59, 71, 0.15),
    0 6px 14px rgba(255, 59, 71, 0.32);
}
.sticky-player__play:focus-visible { outline: 2px solid #FF3B47; outline-offset: 2px; }
.sticky-player__play svg { width: 15px; height: 15px; }

.sticky-player__info { min-width: 0; overflow: hidden; }
.sticky-player__label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #FF3B47;
  margin-bottom: 1px;
}
.sticky-player__label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
  box-shadow: 0 0 4px currentColor, 0 0 10px rgba(255, 59, 71, 0.35);
  animation: pulse 1.6s ease-in-out infinite;
}
.sticky-player.is-paused .sticky-player__label::before {
  animation: none;
  box-shadow: none;
  opacity: 0.4;
}

.sticky-player__title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: var(--text-primary);
}
.sticky-player__artist {
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-secondary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.sticky-player__bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 16px;
  width: 20px;
  flex-shrink: 0;
}
.sticky-player__bars span {
  display: block;
  flex: 1;
  background: linear-gradient(to top,
    color-mix(in srgb, #FF3B47 55%, transparent) 0%,
    #FF3B47 80%);
  border-radius: 1px;
  animation: viz 1.2s ease-in-out infinite;
}
.sticky-player__bars span:nth-child(1) { height: 40%; animation-delay: 0s; }
.sticky-player__bars span:nth-child(2) { height: 80%; animation-delay: 0.15s; }
.sticky-player__bars span:nth-child(3) { height: 55%; animation-delay: 0.3s; }
.sticky-player__bars span:nth-child(4) { height: 90%; animation-delay: 0.1s; }
.sticky-player.is-paused .sticky-player__bars span { animation-play-state: paused; opacity: 0.3; }

.sticky-player__close,
.sticky-player__mute {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--trans-fast), background var(--trans-fast);
  flex-shrink: 0;
}
.sticky-player__close:hover,
.sticky-player__mute:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.sticky-player__spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid color-mix(in srgb, var(--text-primary) 25%, transparent);
  border-top-color: var(--text-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
