/* ═══════════════════════════════════════════════════════════════
   MOCK REWARDED VIDEO AD — Styles
   Simulates a real rewarded video ad player UI.
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlay ── */
.mad-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  /* block all interaction behind */
  pointer-events: auto;
}
.mad-overlay.mad-visible { opacity: 1; }
.mad-overlay.mad-fade-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

/* ── Animated backdrop ── */
.mad-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(30, 25, 15, 0.98) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 60%, rgba(40, 30, 15, 0.95) 0%, transparent 50%),
    linear-gradient(160deg, #0a0806 0%, #14100a 40%, #1a150e 70%, #0a0806 100%);
  animation: madBackdropShift 8s ease-in-out infinite alternate;
}
@keyframes madBackdropShift {
  0%   { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

/* ── Player container (16:9) ── */
.mad-player {
  position: relative;
  width: min(88vw, 720px);
  aspect-ratio: 16 / 9;
  max-height: 80vh;
  background: linear-gradient(170deg, #12100c 0%, #1e1a14 45%, #12100c 100%);
  border: 1px solid rgba(212, 165, 69, 0.18);
  border-radius: 10px;
  box-shadow:
    0 0 80px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(212, 165, 69, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

/* ── Sponsored tag ── */
.mad-sponsored {
  position: absolute;
  top: 14px;
  left: 16px;
  font-family: 'Crimson Text', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(212, 165, 69, 0.75);
  letter-spacing: 3px;
  text-transform: uppercase;
  z-index: 3;
}

/* ── Close button ── */
.mad-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(20, 18, 14, 0.85);
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.1rem;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 4;
}
.mad-close-btn:hover {
  border-color: rgba(212, 165, 69, 0.6);
  color: #d4a545;
  background: rgba(40, 34, 22, 0.95);
  box-shadow: 0 0 12px rgba(212, 165, 69, 0.2);
}
.mad-close-btn.mad-hidden {
  display: none;
}
.mad-close-btn.mad-fade-in {
  animation: madCloseAppear 0.4s ease both;
}
@keyframes madCloseAppear {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Center content ── */
.mad-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  position: relative;
  padding: 20px;
}

/* ── Shimmer animation (fake video surface) ── */
.mad-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(212, 165, 69, 0.03) 42%,
    rgba(212, 165, 69, 0.06) 50%,
    rgba(212, 165, 69, 0.03) 58%,
    transparent 70%
  );
  background-size: 250% 100%;
  animation: madShimmer 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes madShimmer {
  0%   { background-position: 150% 0; }
  100% { background-position: -50% 0; }
}

/* ── Play icon ── */
.mad-icon {
  opacity: 0.3;
  animation: madIconPulse 2.5s ease-in-out infinite;
}
@keyframes madIconPulse {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(1.05); }
}

/* ── Main label ── */
.mad-label {
  font-family: 'Crimson Text', serif;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 1.5px;
  text-align: center;
}
.mad-label.mad-pulse {
  animation: madTextPulse 2s ease-in-out infinite;
}
@keyframes madTextPulse {
  0%, 100% { opacity: 0.65; }
  50%      { opacity: 1; }
}
.mad-label.mad-complete {
  color: #d4a545;
  text-shadow: 0 0 16px rgba(212, 165, 69, 0.4);
  animation: madCompletePop 0.5s ease both;
}
@keyframes madCompletePop {
  0%   { transform: scale(0.9); opacity: 0; }
  60%  { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Countdown ── */
.mad-countdown {
  font-family: 'Crimson Text', serif;
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.5px;
  text-align: center;
  transition: color 0.3s ease;
}
.mad-seconds {
  font-weight: 700;
  color: rgba(212, 165, 69, 0.7);
  font-variant-numeric: tabular-nums;
  min-width: 1.6em;
  display: inline-block;
  text-align: center;
}
.mad-countdown.mad-reward-granted {
  color: rgba(212, 165, 69, 0.6);
  font-style: italic;
}

/* ── Progress bar ── */
.mad-bar-wrap {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.mad-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #a07828, #d4a545, #e8c060);
  transition: width 1s linear;
  box-shadow: 0 0 8px rgba(212, 165, 69, 0.3);
}

/* ── Footer ── */
.mad-footer {
  padding: 8px 16px;
  text-align: center;
  font-family: 'Crimson Text', serif;
  font-size: clamp(0.7rem, 1.4vw, 0.82rem);
  color: rgba(255, 255, 255, 0.18);
  letter-spacing: 0.5px;
  font-style: italic;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.25);
}

/* ═══════════════ Responsive ═══════════════ */

@media (max-width: 600px) {
  .mad-player {
    width: 96vw;
    border-radius: 6px;
  }
  .mad-content { gap: 10px; padding: 14px; }
  .mad-icon svg { width: 48px; height: 48px; }
  .mad-sponsored { font-size: 0.68rem; top: 8px; left: 10px; }
  .mad-close-btn { width: 28px; height: 28px; font-size: 0.95rem; line-height: 26px; top: 8px; right: 8px; }
  .mad-footer { padding: 6px 10px; }
}

@media (max-height: 420px) {
  .mad-player {
    width: min(96vw, 560px);
    max-height: 92vh;
  }
  .mad-content { gap: 6px; padding: 8px; }
  .mad-icon svg { width: 36px; height: 36px; }
  .mad-bar-wrap { height: 3px; }
  .mad-footer { padding: 4px 8px; }
}
