.ad-popup {
  position: fixed;
  width: min(380px, calc(100vw - 18px));
  background: #fff7f7;
  color: #171723;
  border: 2px solid #ff2e2e;
  border-radius: 14px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  z-index: 9999;
  transform-origin: center;
  animation: adThrob 2s ease-in-out infinite;
}

@keyframes adThrob {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.35);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 24px 46px rgba(0, 0, 0, 0.44);
  }
}

.ad-popup__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(90deg, #ff3131, #ff6d6d);
  color: #fff;
  cursor: move;
  user-select: none;
}

.ad-popup__title {
  margin: 0;
  font: 900 0.88rem/1.1 "Segoe UI", sans-serif;
  letter-spacing: 0.2px;
}

.ad-popup__close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  font: 900 1rem/1 "Segoe UI", sans-serif;
  cursor: pointer;
}

.ad-popup__close:hover {
  background: rgba(0, 0, 0, 0.5);
}

.ad-popup__body {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.ad-popup__img {
  width: 100%;
  height: clamp(260px, 45vh, 420px);
  object-fit: contain;
  object-position: center center;
  background: #150f13;
  border-radius: 9px;
  border: 1px solid #ffb5b5;
}

.ad-popup__msg {
  margin: 0;
  font: 800 1.02rem/1.33 "Segoe UI", sans-serif;
}

.ad-popup__cta {
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, #16b36b, #1fd47b);
  color: #fff;
  font: 900 1.02rem/1 "Segoe UI", sans-serif;
  letter-spacing: 0.3px;
  cursor: pointer;
}

@media (max-width: 640px) {
  .ad-popup {
    width: min(340px, calc(100vw - 14px));
  }

  .ad-popup__img {
    height: clamp(220px, 40vh, 320px);
  }

  .ad-popup__msg {
    font-size: 0.96rem;
  }
}
