/* 🌌✨ Cosmic Pulse Effect for Divine Tier (Whale Package) - Supreme Visual Magic */

/* ========== Divine Cosmic Pulse - Ultimate Tier Effect ========== */
.rarity-card-divine {
    position: relative;
    overflow: visible !important;
}

/* Cosmic Pulse Base Animation - FIXED: Removed scale transforms to prevent layout issues */
@keyframes cosmic-pulse {
    0%, 100% {
        filter: brightness(1) contrast(1);
    }
    25% {
        filter: brightness(1.2) contrast(1.1) hue-rotate(10deg);
    }
    50% {
        filter: brightness(1.3) contrast(1.2) hue-rotate(-10deg);
    }
    75% {
        filter: brightness(1.1) contrast(1.05) hue-rotate(5deg);
    }
}

/* Apply cosmic pulse to divine cards */
.rarity-card-divine {
    animation: cosmic-pulse 4s ease-in-out infinite, aura-breathing 6s ease-in-out infinite;
}

/* Aura Breathing Effect - Reduced to 60% */
@keyframes aura-breathing {
    0%, 100% {
        box-shadow: 
            0 0 18px rgba(255, 215, 0, 0.24),
            0 0 36px rgba(255, 255, 255, 0.18),
            0 0 54px rgba(0, 255, 255, 0.12),
            inset 0 0 18px rgba(255, 255, 255, 0.06);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(255, 215, 0, 0.36),
            0 0 60px rgba(255, 255, 255, 0.3),
            0 0 90px rgba(0, 255, 255, 0.18),
            inset 0 0 30px rgba(255, 255, 255, 0.12);
    }
}

/* Enhanced Divine Glow with Cosmic Energy - Reduced to 60% */
.rarity-card-divine .card-glow {
    background: 
        radial-gradient(circle at 30% 30%, 
            rgba(255, 255, 255, 0.36), 
            transparent 40%),
        radial-gradient(circle at 70% 70%, 
            rgba(255, 215, 0, 0.3), 
            transparent 40%),
        radial-gradient(circle at 50% 50%, 
            rgba(0, 255, 255, 0.18), 
            transparent 50%),
        conic-gradient(from 0deg at 50% 50%,
            rgba(255, 0, 255, 0.12),
            rgba(0, 255, 255, 0.12),
            rgba(255, 255, 0, 0.12),
            rgba(255, 0, 255, 0.12));
    animation: cosmic-glow-rotate 8s linear infinite;
    transform: scale(1.2);
    opacity: 0.6;
}

@keyframes cosmic-glow-rotate {
    0% { transform: rotate(0deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1.2); }
}

/* Cosmic Particle Storm */
.rarity-card-divine .card-particles::before,
.rarity-card-divine .card-particles::after {
    content: '✨';
    position: absolute;
    font-size: 30px;
    animation: cosmic-particle-dance 6s linear infinite;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 1));
}

.rarity-card-divine .card-particles::before {
    animation-delay: 0s;
    color: #ffd700;
}

.rarity-card-divine .card-particles::after {
    animation-delay: 3s;
    color: #00ffff;
}

@keyframes cosmic-particle-dance {
    0% {
        transform: translate(-50px, -50px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(150px, 150px) rotate(720deg);
        opacity: 0;
    }
}

/* Divine Aurora with Cosmic Colors */
.rarity-card-divine .card-aurora {
    background: 
        linear-gradient(0deg, 
            transparent 0%, 
            rgba(255, 255, 255, 0.2) 20%,
            rgba(255, 215, 0, 0.3) 40%,
            rgba(0, 255, 255, 0.2) 60%,
            rgba(255, 0, 255, 0.1) 80%,
            transparent 100%);
    animation: cosmic-aurora-flow 7s ease-in-out infinite;
}

@keyframes cosmic-aurora-flow {
    0%, 100% {
        transform: translateY(-100%) scaleY(0.5);
        opacity: 0;
    }
    50% {
        transform: translateY(0) scaleY(1);
        opacity: 1;
    }
}

/* Divine Halo with Cosmic Energy */
.rarity-card-divine .card-halo {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 215, 0, 0.2) 30%,
        transparent 70%);
    animation: halo-pulse 3s ease-in-out infinite;
}

@keyframes halo-pulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translateX(-50%) scale(1.3);
        opacity: 1;
    }
}

/* Divine Card Base Styling */
.rarity-card-divine,
.rarity-divine,
[data-rarity="divine"] {
    position: relative;
    border: 3px solid transparent;
    background: linear-gradient(135deg,
        rgba(255, 107, 0, 0.2), 
        rgba(255, 69, 0, 0.15),
        rgba(255, 140, 0, 0.2));
    overflow: visible !important;
}

/* Divine Border - Cosmic Energy Flow */
.rarity-card-divine::before {
    content: '';
    position: absolute;
    inset: -3px;
    padding: 3px;
    border-radius: var(--radius-lg);
    background: conic-gradient(from 0deg at 50% 50%,
        #ff6b00, #ff4500, #ff8c00, #ffd700, 
        #00ffff, #ff00ff, #ff6b00);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, 
                  linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: divine-border-rotate 3s linear infinite;
}

@keyframes divine-border-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Divine Rarity Badge */
.rarity-divine .rarity-badge {
    background: linear-gradient(135deg, #ff6b00, #ff4500, #ffd700);
    color: #fff;
    font-weight: 900;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border: 2px solid #ffd700;
    animation: divine-badge-pulse 2s ease-in-out infinite;
}

@keyframes divine-badge-pulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 20px rgba(255, 107, 0, 0.5);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
    }
}

/* Divine Discount Badge */
.discount-badge.divine {
    background: linear-gradient(135deg, #ff6b00, #ff4500, #ffd700);
    color: #fff;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border: 2px solid #ffd700;
    animation: divine-badge-pulse 2s ease-in-out infinite;
}

/* Divine Button */
.btn-purchase.divine {
    background: linear-gradient(135deg, #ff6b00, #ff4500, #ffd700);
    border: 3px solid #ffd700;
    color: #fff;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.btn-purchase.divine:hover {
    transform: translateY(-5px) scale(1.08);
    box-shadow: 
        0 20px 50px rgba(255, 107, 0, 0.5),
        0 0 100px rgba(255, 215, 0, 0.3);
}

/* Divine Sparkles */
.btn-divine-sparkles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
}

.btn-divine-sparkles::before,
.btn-divine-sparkles::after {
    content: '✦';
    position: absolute;
    font-size: 24px;
    color: #ffd700;
    animation: divine-sparkle-flow 3s linear infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

.btn-divine-sparkles::before {
    left: -30px;
    top: 20%;
    animation-delay: 0s;
}

.btn-divine-sparkles::after {
    left: -30px;
    bottom: 20%;
    animation-delay: 1.5s;
}

@keyframes divine-sparkle-flow {
    to { transform: translateX(calc(100% + 60px)); }
}

/* Divine Max Benefit Indicator */
.max-benefit-indicator.divine {
    background: linear-gradient(135deg, #ff6b00, #ff4500, #ffd700);
    color: #fff;
    animation: divine-shine 2s ease-in-out infinite;
}

/* Divine Text Effect */
.divine-text {
    background: linear-gradient(45deg, #ff6b00, #ff4500, #ffd700, #ff6b00);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: divine-text-flow 3s ease-in-out infinite;
    font-weight: bold;
}

@keyframes divine-text-flow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ========== Mythic Rainbow Effect for Leviathan ========== */
.rarity-card-mythic.rainbow-package {
    position: relative;
    overflow: visible;
}

/* Rainbow Border Animation - Enhanced for Mythic */
.rarity-card-mythic.rainbow-package::before {
    content: '';
    position: absolute;
    inset: -4px;
    padding: 4px;
    border-radius: var(--radius-lg);
    background: linear-gradient(45deg,
        #ff0080, #ff8000, #ffff00, #00ff00,
        #0080ff, #8000ff, #ff0080);
    background-size: 400% 400%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, 
                  linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: mythic-rainbow-border 3s ease-in-out infinite;
    filter: brightness(1.2);
}

@keyframes mythic-rainbow-border {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Mythic Rainbow Glow - Enhanced for Rainbow Package */
.rarity-card-mythic.rainbow-package .card-glow {
    background: conic-gradient(from 0deg at 50% 50%,
        rgba(255, 0, 128, 0.6),
        rgba(255, 128, 0, 0.6),
        rgba(255, 255, 0, 0.6),
        rgba(0, 255, 0, 0.6),
        rgba(0, 128, 255, 0.6),
        rgba(128, 0, 255, 0.6),
        rgba(255, 0, 128, 0.6));
    animation: mythic-rainbow-spin 4s linear infinite;
    transform: scale(1.1);
}

@keyframes mythic-rainbow-spin {
    0% { transform: rotate(0deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1.1); }
}

/* Mythic Aurora Effect - Enhanced Rainbow */
.rarity-card-mythic.rainbow-package .card-aurora {
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 0, 128, 0.4),
        rgba(255, 128, 0, 0.4),
        rgba(255, 255, 0, 0.4),
        rgba(0, 255, 0, 0.4),
        rgba(0, 255, 255, 0.4),
        rgba(128, 0, 255, 0.4),
        transparent);
    animation: mythic-aurora-sweep 3s ease-in-out infinite;
}

@keyframes mythic-aurora-sweep {
    0%, 100% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Rainbow Button for Mythic */
.btn-purchase.rainbow-button {
    background: linear-gradient(45deg,
        #ff0080, #ff8000, #ffff00, #00ff00,
        #0080ff, #8000ff, #ff0080);
    background-size: 300% 300%;
    animation: rainbow-button-flow 3s ease-in-out infinite;
    color: white;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

@keyframes rainbow-button-flow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.btn-purchase.rainbow-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 15px 40px rgba(255, 0, 128, 0.4),
        0 10px 30px rgba(128, 0, 255, 0.3);
}

/* Rainbow text effect */
.rainbow-text {
    background: linear-gradient(45deg,
        #ff0080, #ff8000, #ffff00, #00ff00,
        #0080ff, #8000ff, #ff0080);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-text-flow 3s ease-in-out infinite;
}

@keyframes rainbow-text-flow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Mythic Rainbow Particles */
.rarity-card-mythic.rainbow-package .card-particles {
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 0, 128, 0.5) 0%, transparent 2%),
        radial-gradient(circle at 40% 50%, rgba(255, 255, 0, 0.5) 0%, transparent 2%),
        radial-gradient(circle at 60% 70%, rgba(0, 255, 0, 0.5) 0%, transparent 2%),
        radial-gradient(circle at 80% 40%, rgba(0, 255, 255, 0.5) 0%, transparent 2%),
        radial-gradient(circle at 30% 80%, rgba(255, 0, 255, 0.5) 0%, transparent 2%);
    background-size: 300% 300%;
    animation: mythic-rainbow-particles 8s linear infinite;
}

@keyframes mythic-rainbow-particles {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

/* Mythic Hover Effect */
.rarity-card-mythic.rainbow-package:hover {
    transform: translateY(-10px) scale(1.04);
    box-shadow: 
        0 25px 50px rgba(255, 0, 255, 0.5),
        0 0 100px rgba(0, 255, 255, 0.4),
        0 0 150px rgba(255, 255, 0, 0.3),
        inset 0 0 40px rgba(255, 255, 255, 0.2);
}

/* Special Centered Card Enhancement */
.special-centered {
    grid-column: 1 / -1;
    max-width: 600px;
    margin: 0 auto;
}

/* Divine Sparkles for Button */
.btn-divine-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.btn-divine-sparkles::before,
.btn-divine-sparkles::after {
    content: '✦';
    position: absolute;
    font-size: 20px;
    color: #ffd700;
    animation: sparkle-float 3s linear infinite;
}

.btn-divine-sparkles::before {
    left: 20%;
    animation-delay: 0s;
}

.btn-divine-sparkles::after {
    left: 80%;
    animation-delay: 1.5s;
}

@keyframes sparkle-float {
    0% {
        transform: translateY(100%) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100%) rotate(360deg);
        opacity: 0;
    }
}