.content-popup {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(8, 47, 73, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.content-popup.is-open {
  opacity: 1;
  visibility: visible;
}

.content-popup__panel {
  position: relative;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: visible;
  padding: clamp(28px, 5vw, 48px);
  border: 0;
  color: #fff;
  text-align: center;
  background: linear-gradient(135deg, #4fadbeb9 0%, #7fb7df 100%);
  border-radius: 54% 46% 42% 58% / 48% 44% 56% 52%;
  box-shadow: 0 20px 44px rgba(18, 92, 139, 0.4);
  transform: translateY(50px) scale(0.9);
  transition: transform 0.45s cubic-bezier(0.22, 1.35, 0.36, 1);
}

.content-popup.is-open .content-popup__panel {
  transform: translateY(0) scale(1);
  animation: contentPopupLiquid 6s ease-in-out infinite alternate;
}

.content-popup__title {
  margin: 0;
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.08em;
}

.content-popup__close {
  position: absolute;
  top: -18px;
  right: -8px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

@media (max-width: 767px) {
  .content-popup__close {
    top: -14px;
    right: 4px;
  }
}

.content-popup__close:hover,
.content-popup__close:focus-visible {
  background: rgba(255, 255, 255, 0.28);
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

@keyframes contentPopupLiquid {
  0% { border-radius: 54% 46% 42% 58% / 48% 44% 56% 52%; }
  50% { border-radius: 43% 57% 55% 45% / 55% 48% 52% 45%; }
  100% { border-radius: 58% 42% 47% 53% / 44% 56% 46% 54%; }
}

@media (min-width: 768px) {
  .content-popup {
    align-items: center;
    padding: 32px;
  }
}

@media (max-height: 500px) {
  .content-popup {
    align-items: center;
    padding-block: 8px;
  }

  .content-popup__panel {
    max-height: calc(100dvh - 16px);
    padding-block: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .content-popup,
  .content-popup__panel {
    transition-duration: 0.01ms;
  }

  .content-popup.is-open .content-popup__panel {
    animation: none;
  }
}
