/* Twenty-second in-world pre-roll: cinematic retro panel selling ad inventory. */
.sponsor-interstitial {
  --ad-cyan: #00ffea;
  --ad-deep-cyan: #004c4c;
  --ad-ink: #18181b;
  --ad-duration: 20s;
  position: fixed;
  z-index: 12000;
  inset: 0;
  overflow: hidden;
  color: #fff;
  font-family: "VT323", monospace;
}

.sponsor-interstitial.is-leaving .sponsor-ad-overlay {
  animation: sponsorAdOverlayOut 0.22s ease-in both;
}

.sponsor-interstitial.is-leaving .sponsor-ad-shell {
  animation: sponsorAdShellOut 0.22s ease-in both;
}

.sponsor-ad-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  animation: sponsorAdOverlayIn 0.45s ease-out both;
}

.sponsor-ad-player {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  padding:
    max(0.75rem, env(safe-area-inset-top))
    max(0.75rem, env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom))
    max(0.75rem, env(safe-area-inset-left));
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(0, 255, 234, 0.07), transparent 55%),
    #18181b;
}

.sponsor-ad-grain {
  position: fixed;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.035) 3px 4px);
  mix-blend-mode: overlay;
}

.sponsor-ad-shell {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  margin: auto;
  padding: 1.35rem 1.25rem 1.15rem;
  border: 3px solid var(--ad-cyan);
  border-radius: 16px;
  background: var(--ad-ink);
  box-shadow:
    0 0 28px rgba(0, 255, 234, 0.3),
    inset 0 0 0 1px rgba(0, 255, 234, 0.12),
    0 0 0 5px var(--ad-deep-cyan);
  animation: sponsorAdShellIn 0.55s 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.sponsor-ad-shell::after {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 234, 0.55), transparent);
}

.sponsor-ad-reveal {
  opacity: 0;
  animation-fill-mode: both;
}

.sponsor-ad-reveal--hud {
  animation: sponsorAdSlideDown 0.4s 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.sponsor-ad-reveal--headline {
  animation: sponsorAdPopIn 0.45s 0.75s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.sponsor-ad-reveal--lede {
  animation: sponsorAdFadeUp 0.4s 1s ease-out both;
}

.sponsor-ad-reveal--slot {
  animation: sponsorAdSlotIn 0.5s 1.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) both,
    sponsorAdSlotGlow 2.8s 1.75s ease-in-out infinite;
}

.sponsor-ad-reveal--continue {
  animation: sponsorAdFadeUp 0.4s 1.5s ease-out both;
}

.sponsor-ad-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-family: "Press Start 2P", monospace;
}

.sponsor-ad-label,
.sponsor-ad-brand {
  padding: 3px 6px;
  font-size: clamp(0.34rem, 2vw, 0.42rem);
  letter-spacing: 0.06em;
  line-height: 1.3;
}

.sponsor-ad-label {
  color: #0a0d0e;
  background: var(--ad-cyan);
  box-shadow: 2px 2px 0 rgba(0, 126, 121, 0.85);
}

.sponsor-ad-brand {
  color: var(--ad-cyan);
  border: 1px solid rgba(0, 255, 234, 0.4);
  border-radius: 999px;
  background: rgba(0, 255, 234, 0.06);
}

.sponsor-ad-content {
  text-align: center;
}

.sponsor-ad-headline {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.62rem, 3.6vw, 0.88rem);
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 2px 2px 0 var(--ad-deep-cyan), 0 0 10px rgba(0, 255, 234, 0.25);
}

.sponsor-ad-lede {
  margin: 0.85rem auto 1rem;
  color: #b9c0cc;
  font-size: clamp(1.05rem, 3.8vw, 1.25rem);
  line-height: 1.2;
}

.sponsor-ad-lede a {
  color: var(--ad-cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 255, 234, 0.55);
}

.sponsor-ad-slot {
  margin: 0 auto 1rem;
}

.sponsor-ad-slot-frame {
  position: relative;
  padding: 1.15rem 0.85rem;
  border: 2px dashed rgba(0, 255, 234, 0.38);
  border-radius: 10px;
  background:
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 255, 234, 0.03) 2px 4px),
    rgba(0, 255, 234, 0.04);
  overflow: hidden;
}

.sponsor-ad-slot-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(0, 255, 234, 0.06) 50%, transparent 60%);
  animation: sponsorAdShimmer 3.5s ease-in-out infinite;
  pointer-events: none;
}

.sponsor-ad-slot-label {
  display: block;
  margin-bottom: 0.55rem;
  color: #8feee5;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.38rem, 2.2vw, 0.44rem);
  letter-spacing: 0.08em;
}

.sponsor-ad-slot-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 1.6em;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.72rem, 4vw, 0.95rem);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sponsor-ad-typewriter {
  color: rgba(255, 255, 255, 0.55);
}

.sponsor-ad-cursor {
  color: var(--ad-cyan);
  animation: sponsorAdCursor 0.55s steps(2) infinite;
}

.sponsor-ad-continue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 48px;
  margin-top: 0.15rem;
  padding: 0.85rem 1rem;
  color: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.52rem, 3vw, 0.62rem);
  letter-spacing: 0.04em;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.sponsor-ad-continue.is-ready {
  color: #0a0a1a;
  border: none;
  background: linear-gradient(135deg, #00ffea 0%, #00ff88 100%);
  box-shadow: 0 0 16px rgba(0, 255, 234, 0.35), 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.sponsor-ad-continue.is-ready:hover,
.sponsor-ad-continue.is-ready:focus-visible {
  transform: scale(1.02);
  box-shadow: 0 0 22px rgba(0, 255, 234, 0.5), 0 4px 14px rgba(0, 0, 0, 0.3);
  outline: none;
}

.sponsor-ad-continue.is-ready:active {
  transform: scale(0.98);
}

.sponsor-ad-continue-arrow {
  opacity: 0.7;
}

.sponsor-ad-progress {
  position: fixed;
  z-index: 6;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
}

.sponsor-ad-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--ad-cyan);
  transform: scaleX(0);
  transform-origin: left;
  box-shadow: 0 0 12px var(--ad-cyan);
  animation: sponsorAdProgress var(--ad-duration) linear 1.65s forwards;
}

@keyframes sponsorAdOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sponsorAdOverlayOut {
  to { opacity: 0; }
}

@keyframes sponsorAdShellIn {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(24px);
  }
  65% {
    transform: scale(1.02) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes sponsorAdShellOut {
  to {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
}

@keyframes sponsorAdSlideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sponsorAdFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sponsorAdPopIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes sponsorAdSlotIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sponsorAdSlotGlow {
  0%, 100% {
    box-shadow: 0 0 0 rgba(0, 255, 234, 0);
  }
  50% {
    box-shadow: 0 0 18px rgba(0, 255, 234, 0.12);
  }
}

@keyframes sponsorAdShimmer {
  0%, 100% { transform: translateX(-120%); }
  50% { transform: translateX(120%); }
}

@keyframes sponsorAdCursor {
  50% { opacity: 0; }
}

@keyframes sponsorAdProgress {
  to { transform: scaleX(1); }
}

@media (max-width: 480px) {
  .sponsor-ad-player {
    justify-content: center;
    padding-top: max(0.5rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .sponsor-ad-shell {
    padding: 1.1rem 0.95rem 1rem;
    border-radius: 14px;
  }

  .sponsor-ad-hud {
    margin-bottom: 0.85rem;
  }

  .sponsor-ad-headline {
    line-height: 1.65;
  }

  .sponsor-ad-lede {
    margin: 0.7rem auto 0.85rem;
  }

  .sponsor-ad-slot-frame {
    padding: 1rem 0.7rem;
  }

  .sponsor-ad-continue {
    min-height: 52px;
    font-size: 0.56rem;
  }
}

@media (max-height: 640px) {
  .sponsor-ad-player {
    justify-content: flex-start;
    padding-top: max(0.5rem, env(safe-area-inset-top));
  }

  .sponsor-ad-shell {
    margin-top: auto;
    margin-bottom: auto;
    padding: 1rem 1rem 0.9rem;
  }

  .sponsor-ad-hud {
    margin-bottom: 0.65rem;
  }

  .sponsor-ad-lede {
    margin: 0.55rem auto 0.7rem;
  }

  .sponsor-ad-slot {
    margin-bottom: 0.75rem;
  }

  .sponsor-ad-slot-frame {
    padding: 0.85rem 0.65rem;
  }

  .sponsor-ad-continue {
    min-height: 44px;
    padding: 0.7rem 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sponsor-interstitial * {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }

  .sponsor-ad-reveal {
    opacity: 1 !important;
  }

  .sponsor-ad-progress span {
    animation-delay: 0s !important;
  }
}
