.mms-popup-modal {
  --mms-popup-width: 560px;
  --mms-popup-mobile-width: 92vw;
  --mms-popup-bg: #fff;
  --mms-popup-text: #111;
  --mms-popup-radius: 22px;
  --mms-popup-overlay: rgba(0,0,0,.58);
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  color: var(--mms-popup-text);
  font-family: inherit;
}
.mms-popup-modal.is-visible { display: block; }
.mms-popup-modal[aria-hidden="true"] { display: none; }
.mms-popup-overlay {
  position: absolute;
  inset: 0;
  background: var(--mms-popup-overlay);
  backdrop-filter: blur(2px);
}
.mms-popup-dialog {
  width: min(var(--mms-popup-width), calc(100vw - 32px));
  max-height: min(88vh, 900px);
  overflow: auto;
  position: absolute;
  left: 50%;
  background: var(--mms-popup-bg);
  color: var(--mms-popup-text);
  border-radius: var(--mms-popup-radius);
  box-shadow: 0 24px 90px rgba(0,0,0,.30);
  transform: translateX(-50%);
  padding: 24px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}
.mms-popup-placement-top .mms-popup-dialog { top: 8vh; }
.mms-popup-placement-center .mms-popup-dialog { top: 50%; transform: translate(-50%, -50%); }
.mms-popup-placement-lower .mms-popup-dialog { top: 62%; transform: translate(-50%, -50%); }
.mms-popup-placement-bottom .mms-popup-dialog { bottom: 5vh; }
.mms-popup-close {
  position: sticky;
  float: right;
  top: 0;
  margin: -16px -14px 6px 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(20,20,20,.10);
  color: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 4;
}
.mms-popup-close:hover { background: rgba(20,20,20,.18); }
.mms-popup-body { position: relative; z-index: 2; }
.mms-popup-media {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  border-radius: calc(var(--mms-popup-radius) * .66);
  margin: 0 0 16px;
  object-fit: contain;
}
.mms-popup-video { max-height: 58vh; background: #000; }
.mms-popup-message { font-size: clamp(16px, 2.4vw, 20px); line-height: 1.5; }
.mms-popup-message p:first-child { margin-top: 0; }
.mms-popup-message p:last-child { margin-bottom: 0; }
.mms-popup-cta-wrap { margin: 20px 0 0; text-align: center; }
.mms-popup-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: #111;
  color: #fff !important;
  text-decoration: none;
  font-weight: 700;
}
.mms-popup-sound {
  margin-top: 14px;
  border: 1px solid rgba(0,0,0,.18);
  background: rgba(255,255,255,.9);
  color: #111;
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
}

.mms-popup-animation-fade.is-visible .mms-popup-dialog { animation: mmsFade .28s ease both; }
.mms-popup-animation-fade_zoom.is-visible .mms-popup-dialog { animation: mmsFadeZoom .34s ease both; }
.mms-popup-animation-slide_up.is-visible .mms-popup-dialog { animation: mmsSlideUp .34s ease both; }
.mms-popup-animation-slide_down.is-visible .mms-popup-dialog { animation: mmsSlideDown .34s ease both; }
.mms-popup-animation-pop.is-visible .mms-popup-dialog { animation: mmsPop .42s cubic-bezier(.2,1.25,.35,1) both; }
@keyframes mmsFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mmsFadeZoom { from { opacity: 0; scale: .94; } to { opacity: 1; scale: 1; } }
@keyframes mmsSlideUp { from { opacity: 0; translate: 0 32px; } to { opacity: 1; translate: 0 0; } }
@keyframes mmsSlideDown { from { opacity: 0; translate: 0 -32px; } to { opacity: 1; translate: 0 0; } }
@keyframes mmsPop { 0% { opacity: 0; scale: .86; } 70% { opacity: 1; scale: 1.035; } 100% { opacity: 1; scale: 1; } }

.mms-popup-fx { pointer-events: none; position: absolute; inset: 0; overflow: hidden; border-radius: inherit; z-index: 1; }
.mms-popup-effect-sparkles .mms-popup-fx::before,
.mms-popup-effect-glitter .mms-popup-fx::before {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.9) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 30%, rgba(255,215,120,.9) 0 1px, transparent 2px),
    radial-gradient(circle at 40% 80%, rgba(180,220,255,.9) 0 1px, transparent 2px),
    radial-gradient(circle at 85% 70%, rgba(255,255,255,.9) 0 1px, transparent 2px);
  background-size: 110px 110px;
  animation: mmsSparkle 4s linear infinite;
  opacity: .70;
}
.mms-popup-effect-glitter .mms-popup-fx::before { background-size: 52px 52px; animation-duration: 2.2s; opacity: .85; }
.mms-popup-effect-shine .mms-popup-fx::before {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  width: 35%;
  left: -45%;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-14deg);
  animation: mmsShine 2.8s ease-in-out infinite;
}
@keyframes mmsSparkle { from { transform: translate3d(0,0,0) rotate(0deg); } to { transform: translate3d(26px,30px,0) rotate(10deg); } }
@keyframes mmsShine { 0% { left: -45%; } 48%, 100% { left: 115%; } }

@media (max-width: 700px) {
  .mms-popup-dialog {
    width: var(--mms-popup-mobile-width);
    padding: 18px;
    max-height: 84vh;
  }
  .mms-popup-placement-top .mms-popup-dialog { top: 5vh; }
  .mms-popup-placement-bottom .mms-popup-dialog { bottom: 3vh; }
  .mms-popup-video { max-height: 48vh; }
}

@media (prefers-reduced-motion: reduce) {
  .mms-popup-dialog,
  .mms-popup-fx::before { animation: none !important; }
}
