:root {
  --fallen-music-safe-bottom: env(safe-area-inset-bottom, 0px);
}

.fallen-music-player {
  position: fixed;
  left: 14px;
  bottom: calc(14px + var(--fallen-music-safe-bottom));
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 154px;
  height: 46px;
  padding: 6px 11px 6px 7px;
  overflow: hidden;
  border: 1px solid rgba(90, 215, 255, 0.45);
  border-radius: 13px;
  background:
    linear-gradient(115deg, rgba(90, 215, 255, 0.11), transparent 44%),
    rgba(3, 9, 14, 0.92);
  box-shadow:
    0 13px 34px rgba(0, 0, 0, 0.55),
    0 0 22px rgba(90, 215, 255, 0.12),
    inset 0 0 0 1px rgba(238, 248, 255, 0.035);
  color: #eafaff;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.fallen-music-player::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, #59d9ff, transparent);
  box-shadow: 0 0 12px rgba(89, 217, 255, 0.88);
  opacity: 0.8;
}

.fallen-music-player[data-playing="1"]::before {
  animation: fallenMusicPulse 1.7s ease-in-out infinite;
}

.fallen-music-toggle {
  position: relative;
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(90, 215, 255, 0.55);
  border-radius: 9px;
  outline: 0;
  background:
    radial-gradient(circle at 50% 28%, rgba(238, 248, 255, 0.16), transparent 45%),
    rgba(90, 215, 255, 0.09);
  color: #7ce5ff;
  cursor: pointer;
  box-shadow: inset 0 0 12px rgba(90, 215, 255, 0.08);
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.fallen-music-toggle:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(124, 229, 255, 0.9);
  background-color: rgba(90, 215, 255, 0.16);
  color: #effcff;
}

.fallen-music-toggle:focus-visible {
  outline: 2px solid rgba(124, 229, 255, 0.88);
  outline-offset: 2px;
}

.fallen-music-toggle:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.fallen-music-toggle svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.fallen-music-volume {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: rgba(177, 232, 248, 0.76);
}

.fallen-music-volume svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.fallen-music-range {
  width: 100%;
  height: 16px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  outline: 0;
  background: transparent;
  cursor: pointer;
}

.fallen-music-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(90, 215, 255, 0.85), rgba(90, 215, 255, 0.18));
  box-shadow: 0 0 8px rgba(90, 215, 255, 0.14);
}

.fallen-music-range::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(124, 229, 255, 0.9);
  border-radius: 50%;
  background: #eafaff;
  box-shadow: 0 0 9px rgba(90, 215, 255, 0.64);
}

.fallen-music-range::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(90, 215, 255, 0.85), rgba(90, 215, 255, 0.18));
}

.fallen-music-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(124, 229, 255, 0.9);
  border-radius: 50%;
  background: #eafaff;
  box-shadow: 0 0 9px rgba(90, 215, 255, 0.64);
}

.fallen-music-range:focus-visible {
  filter: drop-shadow(0 0 5px rgba(90, 215, 255, 0.82));
}

.fallen-music-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes fallenMusicPulse {
  0%, 100% { opacity: 0.36; transform: scaleY(0.58); }
  50% { opacity: 1; transform: scaleY(1); }
}

@media (max-width: 640px) {
  .fallen-music-player {
    left: 8px;
    bottom: calc(8px + var(--fallen-music-safe-bottom));
    width: 142px;
    height: 43px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fallen-music-player[data-playing="1"]::before {
    animation: none;
  }

  .fallen-music-toggle {
    transition: none;
  }
}
