.ad-slot {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 18px;
  isolation: isolate;
  background: linear-gradient(145deg,#151923,#080b12);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 22px 55px rgba(0,0,0,.28);
}
.ad-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(225,6,0,.12);
}
.ad-slot > span {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 3;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(4,7,13,.78);
  color: #fff;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.ad-slot a, .ad-slot img { display: block; width: 100%; height: 100%; }
.ad-slot img { object-fit: cover; }
.ad-slot-title { display: none; }

.ad-slot-top_banner {
  max-width: 1220px;
  height: 190px;
  margin: 20px auto 28px;
  padding: 8px;
  border-color: rgba(225,6,0,.28);
  background: radial-gradient(circle at 18% 0%,rgba(225,6,0,.22),transparent 32%), linear-gradient(145deg,#151923,#07090f);
}
.ad-slot-top_banner img {
  object-fit: contain;
  border-radius: 14px;
  background: #080b12;
}

.ad-slot-in_feed {
  grid-column: 1 / -1;
  min-height: 150px;
  margin: 10px 0 12px;
  padding: 8px;
  border-color: rgba(225,6,0,.22);
}
.ad-slot-in_feed img {
  max-height: 230px;
  object-fit: cover;
  border-radius: 14px;
}
.ad-slot-in_feed.is-filter-hidden { display: none !important; }

.ad-slot-article_bottom {
  min-height: 160px;
  margin: 22px 0;
}
.ad-slot-article_bottom img { max-height: 250px; object-fit: cover; }

.ad-rail {
  position: fixed;
  top: 162px;
  width: 170px;
  height: min(600px, calc(100vh - 220px));
  min-height: 440px;
  z-index: 18;
  border-radius: 22px;
  display: none;
  overflow: visible;
}
.ad-rail-left { left: max(12px, calc((100vw - 1500px) / 2 - 195px)); }
.ad-rail-right { right: max(12px, calc((100vw - 1500px) / 2 - 195px)); }
.ad-rail.is-hidden { display: none !important; }
.ad-rail-item {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(.985);
  transition: opacity .28s ease, transform .28s ease;
}
.ad-rail-item.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.ad-rail .ad-slot {
  width: 100%;
  height: 100%;
}
.ad-rail-close {
  position: absolute;
  top: -12px;
  right: -12px;
  z-index: 8;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg,#e10600,#ff3b30);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(225,6,0,.28), 0 10px 24px rgba(0,0,0,.22);
  transition: transform .18s ease, box-shadow .18s ease;
}
.ad-rail-close:hover {
  transform: translateY(-1px) scale(1.06);
  box-shadow: 0 16px 32px rgba(225,6,0,.34), 0 12px 30px rgba(0,0,0,.24);
}
.ad-rail .ad-slot-title {
  display: none !important;
}
.ad-rail img { border-radius: inherit; }

@media (min-width: 1860px) {
  .ad-rail { display: block; }
}
@media (max-width: 900px) {
  .ad-rail {
    display: none !important;
  }
}
@media (max-width: 760px) {
  .ad-slot-top_banner {
    height: 110px;
    margin: 12px 12px 16px;
    padding: 5px;
    border-radius: 14px;
  }
  .ad-slot-in_feed,
  .ad-slot-article_bottom {
    min-height: 96px;
    border-radius: 14px;
  }
}

.ad-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.ad-popup.open { display: flex; }
.ad-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4,7,13,.72);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.ad-popup-dialog {
  position: relative;
  z-index: 2;
  width: min(92vw, 520px);
  max-height: 86vh;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.35);
  background: #fff;
}
.ad-popup-dialog img {
  width: 100%;
  max-height: calc(86vh - 58px);
  object-fit: contain;
  background: #fff;
  display: block;
}
.ad-popup-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(145deg,#fff,#fff6f6);
  border-top: 1px solid rgba(225,6,0,.12);
}
.ad-popup-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}
.ad-popup-options input {
  width: 16px;
  height: 16px;
  accent-color: var(--red,#e10600);
}
.ad-popup-options button {
  border: 0;
  border-radius: 999px;
  padding: 8px 13px;
  background: var(--red,#e10600);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(225,6,0,.20);
}
.ad-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--red,#e10600);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 10px 22px rgba(225,6,0,.28);
}
@media (max-width: 520px) {
  .ad-popup-options {
    align-items: stretch;
    flex-direction: column;
  }
  .ad-popup-options button {
    width: 100%;
  }
}
