html.mtf-ytm-modal-open,
body.mtf-ytm-modal-open {
  overflow: hidden !important;
  touch-action: none;
  overscroll-behavior: none;
}

.mtf-ytm {
  --mtf-ytm-button-width: 220px;
  --mtf-ytm-mobile-top-gap: 78px;
  --mtf-ytm-mobile-width: 86vw;
  --mtf-ytm-mobile-max-width: 340px;
  --mtf-ytm-ratio: 9/16;
  --mtf-ytm-desktop-max: 420px;
}

.mtf-ytm__btn-center {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0 auto;
  padding: 40px 16px;
  z-index: 10;
  pointer-events: none;
}

.mtf-ytm__open-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: var(--mtf-ytm-button-width);
  min-width: 160px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.2px;
  color: #fff;
  background: linear-gradient(135deg, #0f2a2a, #0a1f1f);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.2s ease;
}

.mtf-ytm__open-btn::before {
  content: '';
  width: 18px;
  height: 18px;
  display: inline-block;
  opacity: 0.92;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") no-repeat center/contain;
  flex: 0 0 18px;
}

.mtf-ytm__open-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.16), transparent 60%);
  opacity: 0.45;
  pointer-events: none;
}

.mtf-ytm__open-btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.mtf-ytm__open-btn:active {
  transform: scale(0.97);
}

@keyframes mtfYtmPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.14), 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(255, 255, 255, 0), 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0), 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
}

.mtf-ytm__open-btn--pulse {
  animation: mtfYtmPulse 2.4s infinite;
}

.mtf-ytm__modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mtf-ytm__modal.is-active {
  display: flex;
}

.mtf-ytm__container {
  position: relative;
  z-index: 2147483647;
  width: min(96vw, var(--mtf-ytm-desktop-max));
  aspect-ratio: var(--mtf-ytm-ratio);
  background: #000;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: mtfYtmModalIn 0.22s ease;
}

@keyframes mtfYtmModalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mtf-ytm__frame-shell {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
}

.mtf-ytm__frame-shell iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.mtf-ytm__poster-play {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: #000;
  overflow: hidden;
}

.mtf-ytm__poster-bg {
  position: absolute;
  inset: 0;
  background: center center / cover no-repeat;
}

.mtf-ytm__poster-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.08)), radial-gradient(circle at center, rgba(255, 255, 255, 0.06), transparent 55%);
}

.mtf-ytm__poster-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.18s ease, background 0.18s ease;
}

.mtf-ytm__poster-play:hover .mtf-ytm__poster-icon {
  transform: translate(-50%, -50%) scale(1.05);
  background: rgba(255, 255, 255, 0.16);
}

.mtf-ytm__poster-icon svg {
  width: 34px;
  height: 34px;
  fill: #fff;
  margin-left: 3px;
}

.mtf-ytm__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 40;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.42);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body.mtf-ytm-modal-open header,
body.mtf-ytm-modal-open .site-header,
body.mtf-ytm-modal-open .header,
body.mtf-ytm-modal-open .sticky-header,
body.mtf-ytm-modal-open .elementor-sticky,
body.mtf-ytm-modal-open .elementor-location-header {
  z-index: 0 !important;
}

body.mtf-ytm-modal-open .mtf-ytm__btn-center {
  opacity: 0;
  pointer-events: none;
}

@media (min-width: 768px) {
  .mtf-ytm__modal {
    padding: 32px;
  }

  .mtf-ytm__container {
    width: min(92vw, var(--mtf-ytm-desktop-max));
    border-radius: 18px;
  }

  .mtf-ytm__close {
    top: 16px;
    right: 16px;
  }
}

@media (max-width: 767px) {
  .mtf-ytm__modal {
    align-items: flex-start;
    justify-content: center;
    padding: max(var(--mtf-ytm-mobile-top-gap), env(safe-area-inset-top)) 16px 16px;
  }

  .mtf-ytm__container {
    width: min(var(--mtf-ytm-mobile-width), var(--mtf-ytm-mobile-max-width));
    border-radius: 20px;
    margin: 0 auto;
  }

  .mtf-ytm__close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 26px;
  }

  .mtf-ytm__poster-icon {
    width: 68px;
    height: 68px;
  }

  .mtf-ytm__poster-icon svg {
    width: 30px;
    height: 30px;
  }

  .mtf-ytm__open-btn {
    width: min(86vw, 320px);
    min-width: 0;
    padding: 14px 18px;
    font-size: 16px;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }

  .mtf-ytm__open-btn::before {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }
}
