.rickroll-card {
  --rickroll-spectrum: linear-gradient(115deg,#ff5be6,#ffdd50 22%,#b5ff7a 40%,#56ffff 58%,#aeb7ff 76%,#ff75ef 94%);
  --rickroll-burst-time: 780ms;
  position: relative;
  isolation: isolate;
  border: 4px solid transparent;
  background: linear-gradient(#080919,#080919) padding-box,var(--rickroll-spectrum) border-box;
  animation: rickroll-border-pulse 2.1s ease-in-out var(--rickroll-burst-time) infinite;
}

.rickroll-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 12px #ffedffd0;
  animation: rickroll-border-shine 2.1s ease-in-out var(--rickroll-burst-time) infinite;
}

.rickroll-stage {
  position: relative;
  aspect-ratio: 2 / 1;
  min-height: 18rem;
  max-height: 31rem;
  overflow: hidden;
  background: #080919;
}

.rickroll-picture,.rickroll-gif {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.rickroll-gif {object-fit: cover;object-position: center 41%}

.rickroll-picture {
  background: #080919 url("./rickroll-fireworks-still.webp") center 41% / cover no-repeat;
  animation: rickroll-picture-reveal 920ms ease-out var(--rickroll-burst-time) both;
}

.rickroll-burst {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center,#ffd39368,#f642d83b 35%,transparent 67%);
  animation: rickroll-burst-light var(--rickroll-burst-time) ease-out both;
}

.rickroll-burst::before,.rickroll-burst::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(114%,44rem);
  aspect-ratio: 1;
  border-radius: 50%;
}

.rickroll-burst::before {
  background: repeating-conic-gradient(from 6deg,#fff4b9 0deg 1deg,transparent 2deg 9deg,#ff79de 10deg 11deg,transparent 12deg 18deg,#86ffff 19deg 20deg,transparent 22deg 29deg);
  mask-image: radial-gradient(circle,transparent 8%,#000 25%,#0008 44%,transparent 67%);
  animation: rickroll-burst-rays var(--rickroll-burst-time) ease-out both;
}

.rickroll-burst::after {
  background: radial-gradient(circle,#fffdf4 0 3%,#ffed9a 7%,#ff9351c7 13%,transparent 30%),
              radial-gradient(circle,transparent 28%,#ffdba8b3 29%,#ff75e983 31%,transparent 34%);
  animation: rickroll-burst-core var(--rickroll-burst-time) ease-out both;
}

.rickroll-title {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 50%;
  width: min(87%,29rem);
  height: auto;
  transform: translateX(-50%);
  transform-origin: 50% 32%;
  pointer-events: none;
  overflow: visible;
  animation: rickroll-title-reveal 1.6s ease-out calc(var(--rickroll-burst-time) + 160ms) both;
}

.rickroll-title text {
  font-family: Impact,"Arial Black",system-ui,sans-serif;
  font-weight: 900;
  font-size: 50px;
  letter-spacing: 1px;
  fill: #fff4ac;
  stroke: #251233;
  stroke-width: 5px;
  stroke-linejoin: round;
  paint-order: stroke fill;
  filter: drop-shadow(0 3px 3px #030414) drop-shadow(0 0 5px #ffab4f96);
}

.rickroll-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080919;
  padding: 13px;
}

@keyframes rickroll-title-reveal {
  from {opacity: 0;transform: translateX(-50%) scale(.4)}
  to {opacity: 1;transform: translateX(-50%) scale(1)}
}

@keyframes rickroll-picture-reveal {from{opacity:0}to{opacity:1}}
@keyframes rickroll-burst-light {0%,100%{opacity:0}34%,58%{opacity:1}}
@keyframes rickroll-burst-rays {
  0% {opacity:0;transform:translate(-50%,-50%) scale(.12) rotate(-12deg)}
  34% {opacity:1;transform:translate(-50%,-50%) scale(.48) rotate(-4deg)}
  100% {opacity:0;transform:translate(-50%,-50%) scale(1.7) rotate(8deg)}
}
@keyframes rickroll-burst-core {
  0% {opacity:0;transform:translate(-50%,-50%) scale(.08)}
  32% {opacity:1;transform:translate(-50%,-50%) scale(.42)}
  100% {opacity:0;transform:translate(-50%,-50%) scale(1.5)}
}

@keyframes rickroll-border-pulse {
  0%,100% {box-shadow: 0 0 5px #fb638d,0 0 12px #3bdbdf7d}
  50% {box-shadow: 0 0 11px #fff9f2cf,-3px 0 20px #ff5edaa6,3px 0 22px #58fff2a3}
}

@keyframes rickroll-border-shine {
  0%,100% {opacity: .42}
  50% {opacity: 1}
}

@media (max-width: 640px) {
  .rickroll-stage {aspect-ratio: 1;min-height: 0;max-height: none}
  .rickroll-picture {background-image: url("./rickroll-fireworks-mobile-still.webp")}
  .rickroll-title {width: min(92%,26rem)}
}

@media (prefers-reduced-motion: reduce) {
  .rickroll-card,.rickroll-card::after,.rickroll-title,.rickroll-picture {animation: none}
  .rickroll-burst {display:none}
  .rickroll-card {box-shadow: 0 0 8px #f986e58c,0 0 12px #56ffff61}
}
