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

body.fallen-music-entry-open {
  overflow: hidden;
}

.fallen-music-entry {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  padding: 20px;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(168, 26, 23, 0.28), transparent 38%),
    radial-gradient(circle at 82% 38%, rgba(31, 111, 206, 0.3), transparent 40%),
    rgba(2, 6, 13, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.fallen-music-entry.is-visible {
  visibility: visible;
  opacity: 1;
}

.fallen-music-entry__panel {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  padding: 30px 28px 28px;
  overflow: hidden;
  border: 1px solid rgba(119, 204, 255, 0.5);
  border-radius: 18px;
  background:
    linear-gradient(125deg, rgba(145, 24, 25, 0.13), transparent 42%),
    linear-gradient(235deg, rgba(26, 99, 189, 0.16), transparent 48%),
    rgba(4, 10, 18, 0.97);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.72), 0 0 42px rgba(64, 174, 255, 0.14);
  text-align: center;
}

.fallen-music-entry__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.fallen-music-entry__logo {
  display: block;
  width: 190px;
  height: 190px;
  margin: -16px auto -22px;
  object-fit: contain;
  filter: drop-shadow(0 16px 25px rgba(0, 0, 0, 0.55));
}

.fallen-music-entry__eyebrow {
  margin: 0 0 8px;
  color: #70d9ff;
  font: 700 0.7rem/1.2 Arial, sans-serif;
  letter-spacing: 0.3em;
}

.fallen-music-entry h2 {
  margin: 0;
  color: #f5f7fb;
  font: 700 clamp(1.65rem, 6vw, 2.5rem)/1 Georgia, serif;
  letter-spacing: 0.06em;
}

.fallen-music-entry h2 span {
  color: #69caff;
}

.fallen-music-entry__copy {
  margin: 13px 0 22px;
  color: rgba(226, 237, 247, 0.72);
  font: 400 0.92rem/1.5 Arial, sans-serif;
}

.fallen-music-entry__button {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(117, 210, 255, 0.72);
  border-radius: 10px;
  background: linear-gradient(105deg, #9b191c, #245db0 78%);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.38), 0 0 18px rgba(75, 171, 255, 0.18);
  color: #fff;
  cursor: pointer;
  font: 700 0.78rem/1 Arial, sans-serif;
  letter-spacing: 0.2em;
  transition: filter 160ms ease, transform 160ms ease;
}

.fallen-music-entry__button:hover {
  filter: brightness(1.14);
  transform: translateY(-1px);
}

.fallen-music-entry__button:focus-visible {
  outline: 2px solid #8ee3ff;
  outline-offset: 3px;
}

.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: 198px;
  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-player[data-autoplay-blocked="1"] .fallen-music-toggle {
  border-color: rgba(255, 190, 92, 0.92);
  color: #ffd08a;
  box-shadow:
    0 0 0 3px rgba(255, 164, 61, 0.1),
    0 0 18px rgba(255, 164, 61, 0.32),
    inset 0 0 12px rgba(255, 190, 92, 0.12);
  animation: fallenMusicNeedsClick 1.35s ease-in-out infinite;
}

.fallen-music-toggle,
.fallen-music-next {
  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-next {
  border-color: rgba(183, 99, 139, 0.58);
  background:
    linear-gradient(135deg, rgba(184, 38, 31, 0.13), rgba(42, 111, 204, 0.16)),
    rgba(8, 12, 20, 0.88);
  color: #d9eaff;
}

.fallen-music-toggle:hover:not(:disabled),
.fallen-music-next: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,
.fallen-music-next:focus-visible {
  outline: 2px solid rgba(124, 229, 255, 0.88);
  outline-offset: 2px;
}

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

.fallen-music-toggle svg,
.fallen-music-next 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); }
}

@keyframes fallenMusicNeedsClick {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@media (max-width: 640px) {
  .fallen-music-entry__panel {
    padding: 22px 20px 20px;
  }

  .fallen-music-entry__logo {
    width: 156px;
    height: 156px;
  }

  .fallen-music-player {
    left: 8px;
    bottom: calc(8px + var(--fallen-music-safe-bottom));
    width: 158px;
    height: 43px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fallen-music-entry,
  .fallen-music-entry__button {
    transition: none;
  }

  .fallen-music-player[data-playing="1"]::before {
    animation: none;
  }

  .fallen-music-player[data-autoplay-blocked="1"] .fallen-music-toggle {
    animation: none;
  }

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