
:root {
    --rainbow-color1: #B725CB ;
    --rainbow-color2: #a01caf ;
    --elegant-glow-color1: #F7A8B8;
    --elegant-glow-color2: #F1C6D3;
    --elegant-glow-highlight: rgba(255, 188, 204, 0.7); 
    --legendary-color1: #1046a9; 
    --legendary-color2: #B725CB ; 
  }
  
  #card-top[data-rarity="rare rainbow"], 
  #card-bottom[data-rarity="rare rainbow"] {
    z-index: 10;
    background: transparent !important;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: 50% 50%;
    transform-origin: center;
  }

  #card-top[data-rarity="rare rainbow"]:before,
  #card-bottom[data-rarity="rare rainbow"]:before,
  #card-top[data-rarity="rare rainbow"]:after,
  #card-bottom[data-rarity="rare rainbow"]:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    background-repeat: no-repeat;
    mix-blend-mode: color-dodge;
    transition: all .33s ease;
  }
  
  #card-top[data-rarity="rare rainbow"]:before,
  #card-bottom[data-rarity="rare rainbow"]:before {
    background-position: 50% 50%;
    background-size: 300% 300%;
    background-image: linear-gradient(
      115deg,
      transparent 0%,
      var(--rainbow-color1) 25%,
      transparent 47%,
      transparent 53%,
      var(--rainbow-color2) 75%,
      transparent 100%
    );
    z-index: 1;
  }
  
  #card-top[data-rarity="rare rainbow"]:after,
  #card-bottom[data-rarity="rare rainbow"]:after {
    opacity: 1;
    background-image: url("https://assets.codepen.io/13471/sparkles.gif"), 
      url(https://assets.codepen.io/13471/holo.png), 
      linear-gradient(125deg, #ff008450 15%, #fca40040 30%, #ffff0030 40%, #00ff8a20 60%, #00cfff40 70%, #cc4cfa50 85%);
    background-position: 50% 50%;
    background-size: 160%;
    background-blend-mode: overlay;
    z-index: 2;
    filter: brightness(1) contrast(1);
    transition: all .33s ease;
    mix-blend-mode: color-dodge;
    opacity: .75;
  }
  
#card #card-top:after,
#card #card-bottom:after {
    filter: brightness(1) contrast(1);
    opacity: 1;
}


  
@keyframes holoGradient {
  0%, 100% {
    opacity: 0.5;
    background-position: 50% 50%;
    filter: brightness(.5) contrast(1);
  }
  5%, 9% {
    background-position: 100% 100%;
    opacity: 1;
    filter: brightness(.75) contrast(1.25);
  }
  13%, 17% {
    background-position: 0% 0%;
    opacity: .88;
  }
  35%, 39% {
    background-position: 100% 100%;
    opacity: 1;
    filter: brightness(.5) contrast(1);
  }
  55% {
    background-position: 0% 0%;
    opacity: 1;
    filter: brightness(.75) contrast(1.25);
  }
}

@keyframes holoSparkle {
  0%, 100% {
    opacity: .75; background-position: 50% 50%; filter: brightness(1.2) contrast(1.25);
  }
  5%, 8% {
    opacity: 1; background-position: 40% 40%; filter: brightness(.8) contrast(1.2);
  }
  13%, 16% {
    opacity: .5; background-position: 50% 50%; filter: brightness(1.2) contrast(.8);
  }
  35%, 38% {
    opacity: 1; background-position: 60% 60%; filter: brightness(1) contrast(1);
  }
  55% {
    opacity: .33; background-position: 45% 45%; filter: brightness(1.2) contrast(1.25);
  }
}

@keyframes holoCard {
  0%, 100% {
    transform: rotateZ(0deg) rotateX(0deg) rotateY(0deg);
  }
  5%, 8% {
    transform: rotateZ(0deg) rotateX(6deg) rotateY(-20deg);
  }
  13%, 16% {
    transform: rotateZ(0deg) rotateX(-9deg) rotateY(32deg);
  }
  35%, 38% {
    transform: rotateZ(3deg) rotateX(12deg) rotateY(20deg);
  }
  55% {
    transform: rotateZ(-3deg) rotateX(-12deg) rotateY(-27deg);
  }
}
  

#card-top[data-rarity="subtle elegance"]:before,
#card-bottom[data-rarity="subtle elegance"]:before,
#card-top[data-rarity="subtle elegance"]:after,
#card-bottom[data-rarity="subtle elegance"]:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    transition: all 0.4s ease;
}

#card-top[data-rarity="subtle elegance"]:before {
    background-image: radial-gradient(
        circle,
        var(--elegant-glow-color1),
        transparent 10%
    );
    background-size: 250% 250%;
    animation: subtleGlow 5s infinite alternate;
    z-index: 1;
    opacity: 0.8;
    mix-blend-mode:  overlay;
}

#card-top[data-rarity="subtle elegance"]:after,
#card-bottom[data-rarity="subtle elegance"]:after {
    background-image: url("https://assets.codepen.io/13471/sparkles.gif"), 
        linear-gradient(
            135deg,
            var(--elegant-glow-highlight),
            rgba(255, 255, 255, 0.1)
        );
    background-size: 220%;
    mix-blend-mode: overlay;
    opacity: 0.6;
    animation: subtlePulse 3s infinite ease-in-out;
}

#card-top[data-rarity="subtle elegance"]:hover:after,
#card-top[data-rarity="subtle elegance"]:hover ~ #card-bottom[data-rarity="subtle elegance"]:after,
#card-bottom[data-rarity="subtle elegance"]:hover:after,
#card-bottom[data-rarity="subtle elegance"]:hover ~ #card-top[data-rarity="subtle elegance"]:after {
    filter: brightness(1.1);
    opacity: 1;
}

@keyframes subtleGlow {
    0% {
        background-position: 40% 40%;
        opacity: 0.7;
    }
    50% {
        background-position: 60% 60%;
        opacity: 1;
    }
    100% {
        background-position: 50% 50%;
        opacity: 0.8;
    }
}

@keyframes subtlePulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

#card-top[data-rarity="legendary"], 
#card-bottom[data-rarity="legendary"] {
    z-index: 10;
    background: linear-gradient(120deg, var(--legendary-color1), var(--legendary-color2));
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    outline: 3px solid white;
    overflow: hidden;
    transform-origin: center;
    transition: all 0.3s ease;
}

#card-top[data-rarity="legendary"]:before,
#card-bottom[data-rarity="legendary"]:before {
    content: "";
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, var(--legendary-color1), var(--legendary-color2));
    opacity: 0.5;
    filter: blur(8px);
    z-index: 1;
    transition: opacity 0.3s ease, filter 0.3s ease;
}


#card-top[data-rarity="legendary"]:after,
#card-bottom[data-rarity="legendary"]:after {
    content: "";
    position: absolute;
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
    border-radius: 12px;
    z-index: 2;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

#card-top[data-rarity="legendary"]:hover:after,
#card-bottom[data-rarity="legendary"]:hover:after {
    opacity: 0.6;
}

#card-top[data-rarity="legendary"]:hover {
    transform: scale(1.07) rotate(3deg);
}

#card-top[data-rarity="legendary"] {
    background-image: url('https://assets.codepen.io/13471/sparkles.gif');
    background-size: cover;
    background-position: center;
}
