/* =========================================================
   Ad slots + Download countdown gate
   ========================================================= */

/* Ad slot — generic container. Drop your AdSense/Adsterra/Ezoic snippet inside.
   Default state shows a faint "Advertisement" label until the network fills it. */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 18px auto;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--bg-sunken);
  color: var(--ink-4);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-height: 90px;
  position: relative;
  overflow: hidden;
}
.ad-slot-label {
  position: absolute;
  top: 6px; left: 10px;
  font-size: 9px;
  opacity: .6;
}

/* Leaderboard / responsive — top of result page, marketing pages */
.ad-slot-leaderboard { min-height: 90px; max-width: 970px; }
@media (max-width: 640px) { .ad-slot-leaderboard { min-height: 100px; } }

/* In-grid native — same vertical 9:16 aspect as a story card */
.ad-slot-card {
  aspect-ratio: 9 / 16;
  min-height: 0;
  margin: 0;
  border-style: solid;
  border-color: var(--line);
}

/* Sticky mobile bottom bar — only shows below 768px */
.ad-slot-sticky {
  position: fixed;
  left: 8px; right: 8px; bottom: 8px;
  margin: 0;
  min-height: 60px;
  max-width: none;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  z-index: 50;
  display: none;
}
@media (max-width: 768px) { .ad-slot-sticky { display: flex; } }
/* Hide sticky bar when player or countdown is active — they take focus */
body.dl-gate-open .ad-slot-sticky,
body.menu-open .ad-slot-sticky { display: none; }

/* Interstitial — used inside the download countdown */
.ad-slot-interstitial {
  margin: 8px 0 16px;
  min-height: 250px;
  max-width: 360px;
}

/* =========================================================
   Download countdown gate (5s engagement delay + ad slot)
   ========================================================= */
.dl-gate {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .2s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.dl-gate.is-open { opacity: 1; }

.dl-gate-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 28px 22px 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  text-align: center;
  transform: translateY(8px) scale(.98);
  transition: transform .2s ease;
}
.dl-gate.is-open .dl-gate-card {
  transform: translateY(0) scale(1);
}

.dl-gate-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 20px; line-height: 1;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.dl-gate-close:hover { background: var(--bg-sunken); color: var(--ink-1); }

.dl-gate-head { margin-bottom: 16px; }
.dl-gate-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-1);
  margin-bottom: 4px;
}
.dl-gate-sub {
  color: var(--ink-3);
  font-size: 13.5px;
}
.dl-gate-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--accent-hover);
  display: inline-block;
  min-width: 16px;
}

.dl-gate-progress {
  height: 4px;
  background: var(--bg-sunken);
  border-radius: 2px;
  overflow: hidden;
  margin: 4px 0 14px;
}
.dl-gate-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
}

.dl-gate-cancel {
  width: 100%;
  margin-top: 12px;
}

@media (max-width: 480px) {
  .dl-gate-card {
    max-width: none;
    padding: 24px 18px 16px;
    border-radius: 16px;
  }
  .ad-slot-interstitial { min-height: 200px; }
}
