/* Ad overlay — contained inside .player-wrap (Globoplay-style) */

.ad-overlay {

  position: absolute;

  inset: 0;

  z-index: 30;

  display: flex;

  align-items: center;

  justify-content: center;

  background: #000;

  touch-action: manipulation;

}



/* Countdown sobre a live — fundo semi-transparente, stream continua */

.ad-overlay.ad-overlay-countdown {

  background: rgba(0, 0, 0, 0.45);

  backdrop-filter: blur(1px);

  -webkit-backdrop-filter: blur(1px);

  pointer-events: none;

}



.player-wrap.ad-playing .player-mount {

  display: none !important;

}



.ad-overlay.ad-overlay-playing {

  display: block;

}



.ad-overlay.ad-overlay-playing .ad-player-wrap {

  position: absolute;

  inset: 0;

  z-index: 2;

}



.ad-tap-play {

  position: absolute;

  inset: 0;

  z-index: 5;

  display: flex;

  align-items: center;

  justify-content: center;

  margin: 0;

  border: none;

  background: rgba(0, 0, 0, 0.72);

  color: #fff;

  font: inherit;

  font-size: 1rem;

  font-weight: 600;

  cursor: pointer;

  -webkit-tap-highlight-color: transparent;

}



.ad-tap-play:not(.hidden) {

  display: flex;

}



.ad-countdown {

  text-align: center;

  padding: 1.25rem 1.5rem;

  padding-top: max(1.25rem, env(safe-area-inset-top));

  animation: adFadeIn 0.35s ease;

  width: auto;

  max-width: 90%;

  background: rgba(0, 0, 0, 0.55);

  border-radius: 16px;

  border: 1px solid rgba(255, 255, 255, 0.12);

  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

  pointer-events: none;

}



.ad-overlay.ad-overlay-countdown .ad-countdown-label,

.ad-overlay.ad-overlay-countdown .ad-countdown-num,

.ad-overlay.ad-overlay-countdown .ad-countdown-sub {

  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);

}



.ad-countdown-label {

  font-size: clamp(1rem, 3vw, 1.35rem);

  font-weight: 600;

  color: #fff;

  margin-bottom: 0.5rem;

}



.ad-countdown-num {

  font-family: "Syne", sans-serif;

  font-size: clamp(2.5rem, 8vw, 4rem);

  font-weight: 800;

  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));

  -webkit-background-clip: text;

  -webkit-text-fill-color: transparent;

  background-clip: text;

}



.ad-countdown-sub {

  margin-top: 0.75rem;

  font-size: 0.82rem;

  color: var(--text-muted);

}



.ad-player-wrap {

  position: absolute;

  inset: 0;

  display: flex;

  flex-direction: column;

  background: #000;

}



#adVideo {

  flex: 1;

  width: 100%;

  height: 100%;

  min-height: 0;

  object-fit: contain;

  background: #000;

  position: absolute;

  inset: 0;

}



.ad-bar {

  position: absolute;

  left: 0;

  right: 0;

  bottom: 0;

  display: grid;

  grid-template-columns: 1fr auto auto;

  grid-template-areas: "info timer actions";

  align-items: end;

  gap: 0.5rem 0.75rem;

  padding: 2.5rem 1rem max(1rem, env(safe-area-inset-bottom));

  background: linear-gradient(transparent, rgba(0, 0, 0, 0.92));

  pointer-events: none;

}



.ad-bar-left {

  grid-area: info;

  display: flex;

  flex-direction: column;

  gap: 0.15rem;

  min-width: 0;

  pointer-events: none;

}



.ad-sponsored {

  font-size: 0.65rem;

  text-transform: uppercase;

  letter-spacing: 0.15em;

  color: var(--neon-cyan);

  opacity: 0.85;

}



.ad-title {

  font-size: 0.9rem;

  font-weight: 600;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

}



.ad-progress-wrap {

  position: absolute;

  top: 0;

  left: 0;

  right: 0;

  height: 3px;

  background: rgba(255, 255, 255, 0.15);

  z-index: 2;

}



.ad-progress-fill {

  height: 100%;

  width: 0%;

  background: linear-gradient(90deg, var(--neon-violet), var(--neon-cyan));

  transition: width 0.25s linear;

}



.ad-timer {

  grid-area: timer;

  font-size: 0.78rem;

  color: var(--text-muted);

  font-variant-numeric: tabular-nums;

  white-space: nowrap;

  align-self: center;

  pointer-events: none;

}



.ad-actions {

  grid-area: actions;

  display: flex;

  align-items: center;

  gap: 0.5rem;

  flex-shrink: 0;

  pointer-events: auto;

}



.ad-skip {

  padding: 0.65rem 1.1rem;

  min-height: 44px;

  min-width: 44px;

  border-radius: 999px;

  border: 1px solid rgba(255, 255, 255, 0.25);

  background: rgba(255, 255, 255, 0.12);

  color: #fff;

  font-size: 0.82rem;

  font-weight: 500;

  cursor: pointer;

  transition: all 0.2s;

  white-space: nowrap;

  -webkit-tap-highlight-color: transparent;

}



.ad-skip:disabled {

  opacity: 0.55;

  cursor: default;

}



.ad-skip:not(:disabled):hover,

.ad-skip:not(:disabled):active {

  background: rgba(255, 255, 255, 0.22);

  border-color: rgba(255, 255, 255, 0.45);

}



.ad-cta {

  padding: 0.65rem 1.15rem;

  min-height: 44px;

  display: inline-flex;

  align-items: center;

  justify-content: center;

  border-radius: 999px;

  background: linear-gradient(135deg, var(--neon-violet), var(--neon-cyan));

  color: #fff;

  font-size: 0.82rem;

  font-weight: 600;

  text-decoration: none;

  box-shadow: 0 4px 16px var(--accent-glow);

  -webkit-tap-highlight-color: transparent;

}



.ad-cta:active {

  transform: scale(0.98);

}



@keyframes adFadeIn {

  from { opacity: 0; transform: scale(0.98); }

  to { opacity: 1; transform: scale(1); }

}



/* Fullscreen: tudo dentro do player-wrap (stream + anúncios) */

.player-wrap:fullscreen,

.player-wrap:-webkit-full-screen {

  width: 100vw;

  height: 100vh;

  height: 100dvh;

  border-radius: 0;

  background: #000;

}



.player-wrap:fullscreen .ad-overlay,

.player-wrap:-webkit-full-screen .ad-overlay {

  position: absolute;

  inset: 0;

  z-index: 50;

}



@media (max-width: 700px) {

  .ad-bar {

    grid-template-columns: 1fr 1fr;

    grid-template-areas:

      "info info"

      "timer timer"

      "actions actions";

    padding-left: 0.75rem;

    padding-right: 0.75rem;

  }



  .ad-actions {

    width: 100%;

  }



  .ad-skip,

  .ad-cta {

    flex: 1;

    text-align: center;

  }



  .ad-title {

    font-size: 0.82rem;

  }

}



body.lite-mode .ad-overlay {

  backdrop-filter: none;

}

