/* 🌟♾️ Transcendent Rarity - The Bridge Between Legend and Myth! ♾️🌟 */

/* ========== Transcendent Tier (6) - Reality Warping ========== */

.rarity-card-transcendent,
.rarity-transcendent,
[data-rarity="transcendent"] {
    border: 3px solid transparent;
    border-image: linear-gradient(45deg,
            rgba(255, 183, 0, 0.5),
            rgba(255, 183, 0, 0.8),
            rgba(255, 215, 0, 0.8),
            rgba(255, 183, 0, 0.5)) 1;
    background: linear-gradient(135deg,
            rgba(255, 183, 0, 0.08),
            rgba(255, 183, 0, 0.12),
            rgba(255, 215, 0, 0.08),
            rgba(255, 183, 0, 0.08));
    position: relative;
    overflow: hidden;
}

/* Transcendent Glow Effect - Prismatic */
.rarity-card-transcendent .card-glow {
    background: radial-gradient(circle at center,
            rgba(255, 183, 0, 0.5),
            rgba(255, 215, 0, 0.3),
            transparent 70%);
    animation: transcendent-pulse 3s ease-in-out infinite;
    filter: opacity(0.8);
}

/* Reality Warp Border Animation */
.rarity-card-transcendent::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 215, 0, 0.4),
            rgba(255, 183, 0, 0.6),
            rgba(255, 215, 0, 0.4),
            transparent);
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    animation: transcendent-border-flow 3s linear infinite;
}

/* Prismatic Shift Effect */
.rarity-card-transcendent::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 70%);
    transform: translateX(-100%);
    animation: transcendent-shimmer 4s ease-in-out infinite;
}

/* Particle System for Transcendent */
.rarity-card-transcendent .card-particles {
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 183, 0, 0.4) 0%, transparent 2%),
        radial-gradient(circle at 80% 70%, rgba(255, 215, 0, 0.4) 0%, transparent 2%),
        radial-gradient(circle at 40% 80%, rgba(255, 149, 0, 0.4) 0%, transparent 2%);
    background-size: 300% 300%;
    animation: transcendent-particles 6s linear infinite;
}

/* Single Light Ball (not hovered) */
.rarity-card-transcendent .light-ball {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #ffd700, #ffb700);
    border-radius: 50%;
    top: -10px;
    left: 50%;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    animation: single-light-fall 4s ease-in-out infinite;
    opacity: 0;
}

/* Hover State - Light Ball Rainfall */
.rarity-card-transcendent:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow:
        0 20px 40px rgba(255, 183, 0, 0.4),
        0 0 80px rgba(255, 183, 0, 0.2),
        inset 0 0 30px rgba(255, 215, 0, 0.1);
    overflow: visible;
}

.rarity-card-transcendent:hover::before {
    opacity: 0;
    /* Hide rotation on hover */
}

.rarity-card-transcendent:hover .card-glow {
    animation-duration: 1.5s;
    transform: scale(1.2);
}

/* Light Rainfall Container */
.rarity-card-transcendent .light-rainfall {
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 120%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rarity-card-transcendent:hover .light-rainfall {
    opacity: 1;
}

/* Individual Light Balls */
.light-rainfall .light-drop {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle,
            rgba(255, 215, 0, 1) 0%,
            rgba(255, 183, 0, 0.8) 50%,
            transparent 70%);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
    animation: rainfall 3s linear infinite;
}

.light-drop:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
}

.light-drop:nth-child(2) {
    left: 20%;
    animation-delay: 0.5s;
}

.light-drop:nth-child(3) {
    left: 30%;
    animation-delay: 1s;
}

.light-drop:nth-child(4) {
    left: 40%;
    animation-delay: 1.5s;
}

.light-drop:nth-child(5) {
    left: 50%;
    animation-delay: 2s;
}

.light-drop:nth-child(6) {
    left: 60%;
    animation-delay: 0.3s;
}

.light-drop:nth-child(7) {
    left: 70%;
    animation-delay: 0.8s;
}

.light-drop:nth-child(8) {
    left: 80%;
    animation-delay: 1.3s;
}

.light-drop:nth-child(9) {
    left: 90%;
    animation-delay: 1.8s;
}

/* Rarity Badge Styling - Prismatic */
.rarity-card-transcendent .rarity-badge,
.rarity-transcendent .rarity-badge {
    background: linear-gradient(135deg,
            rgba(255, 183, 0, 0.8),
            rgba(255, 215, 0, 0.8));
    color: #000;
    text-shadow: 0 0 10px rgba(255, 183, 0, 0.8);
    box-shadow: 0 0 20px rgba(255, 183, 0, 0.5);
    animation: badge-float 3s ease-in-out infinite;
    backdrop-filter: blur(10px);
}

.rarity-card-transcendent .rarity-badge .badge-stars {
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

/* Special Effects for Staking/Token Cards */
.energy-pool-card.rarity-card-transcendent .pool-energy-field,
.token-price-card.rarity-card-transcendent .price-glow {
    background: radial-gradient(circle at center,
            rgba(255, 183, 0, 0.3),
            rgba(255, 215, 0, 0.2),
            transparent);
    animation: energy-transcend 4s ease-in-out infinite;
}

/* Animations */
@keyframes transcendent-pulse {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.1);
    }
}

@keyframes transcendent-border-flow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes transcendent-shimmer {
    0% {
        transform: translateX(-100%);
    }

    50%,
    100% {
        transform: translateX(200%);
    }
}

/* ========== Diamond Package Custom Styling ========== */
.rarity-card-legendary[data-package="diamond"] {
    border-color: #ff9500;
    background: linear-gradient(135deg,
            rgba(255, 149, 0, 0.08),
            rgba(255, 149, 0, 0.12),
            rgba(255, 183, 0, 0.08),
            rgba(255, 149, 0, 0.08));
}

.rarity-card-legendary[data-package="diamond"] .card-glow {
    background: radial-gradient(circle at center,
            rgba(255, 149, 0, 0.5),
            rgba(255, 183, 0, 0.3),
            transparent 70%);
}

.rarity-card-legendary[data-package="diamond"] .rarity-badge {
    background: linear-gradient(135deg, #ff9500, #ffd700);
    color: #fff;
}

.rarity-card-legendary[data-package="diamond"] .discount-badge {
    background: linear-gradient(135deg, #ff9500, #ffd700);
}

/* ========== Rainbow Package Effect (Mythic/Whale) ========== */
.rainbow-package {
    position: relative;
    overflow: visible;
}

/* Animated Rainbow Border */
.rainbow-package::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg,
            #ff0000, #ff7f00, #ffff00, #00ff00,
            #0000ff, #4b0082, #8b00ff, #ff0000);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: rainbow-border 8s linear infinite;
    opacity: 0.8;
}

/* Rainbow Glow Effect */
.rainbow-package .card-glow {
    background: radial-gradient(circle at center,
            rgba(255, 0, 255, 0.3),
            rgba(0, 255, 255, 0.3),
            rgba(255, 255, 0, 0.3),
            transparent 70%);
    animation: rainbow-glow 4s ease-in-out infinite;
}

/* Rainbow Text Effect */
.rainbow-text {
    background: linear-gradient(45deg,
            #ff0000, #ff7f00, #ffff00, #00ff00,
            #0000ff, #4b0082, #8b00ff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-text 6s linear infinite;
    font-weight: bold;
}

/* Rainbow Button */
.rainbow-button {
    position: relative;
    background: linear-gradient(45deg,
            #ff0000, #ff7f00, #ffff00, #00ff00,
            #0000ff, #4b0082, #8b00ff);
    background-size: 300% 300%;
    animation: rainbow-bg 5s linear infinite;
    overflow: hidden;
}

.rainbow-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    animation: rainbow-shine 3s ease-in-out infinite;
}

/* Rainbow Particle Effect */
.rainbow-package .card-particles {
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 0, 0, 0.4) 0%, transparent 2%),
        radial-gradient(circle at 40% 50%, rgba(255, 255, 0, 0.4) 0%, transparent 2%),
        radial-gradient(circle at 60% 70%, rgba(0, 255, 0, 0.4) 0%, transparent 2%),
        radial-gradient(circle at 80% 40%, rgba(0, 255, 255, 0.4) 0%, transparent 2%),
        radial-gradient(circle at 30% 80%, rgba(255, 0, 255, 0.4) 0%, transparent 2%);
    background-size: 300% 300%;
    animation: rainbow-particles 10s linear infinite;
}

/* Enhanced Rainbow on Hover */
.rainbow-package:hover {
    transform: translateY(-10px) scale(1.04);
    box-shadow:
        0 25px 50px rgba(255, 0, 255, 0.4),
        0 0 100px rgba(0, 255, 255, 0.3),
        0 0 150px rgba(255, 255, 0, 0.2),
        inset 0 0 40px rgba(255, 255, 255, 0.1);
}

.rainbow-package:hover::before {
    opacity: 1;
    animation-duration: 3s;
}

/* Rainbow Animations */
@keyframes rainbow-border {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

@keyframes rainbow-glow {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

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

    100% {
        background-position: 200% 50%;
    }
}

@keyframes rainbow-bg {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

@keyframes rainbow-shine {
    0% {
        left: -100%;
    }

    50%,
    100% {
        left: 200%;
    }
}

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

    100% {
        background-position: 100% 100%;
    }
}

@keyframes transcendent-particles {
    0% {
        background-position: 0% 0%;
    }

    50% {
        background-position: 100% 100%;
    }

    100% {
        background-position: 0% 0%;
    }
}

@keyframes energy-transcend {

    0%,
    100% {
        opacity: 0.5;
        filter: hue-rotate(0deg);
    }

    25% {
        filter: hue-rotate(10deg);
    }

    50% {
        opacity: 0.8;
        filter: hue-rotate(-10deg);
    }

    75% {
        filter: hue-rotate(5deg);
    }
}

@keyframes badge-float {

    0%,
    100% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-5px) rotate(5deg);
    }
}

/* Transcendent Text Effects */
.rarity-card-transcendent .rarity-text {
    background: linear-gradient(45deg, #ff9500, #ffd700, #ff9500);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-transcend 3s ease-in-out infinite;
}

@keyframes text-transcend {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.3);
    }
}

@keyframes single-light-fall {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(-50%);
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateY(120px) translateX(-50%);
    }
}

@keyframes rainfall {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateY(120px);
    }
}

/* Visual Hierarchy Check */
/* 
   Legendary: Solid orange, simple glow
   Transcendent: Gradient orange-gold, reality warp effects
   Mythic: Rainbow effects (Leviathan)
   Divine: Cosmic pulse with orange-gold gradient (Whale)
   Angelic: Full celestial effects with white-gold (Cosmic)
*/

/* Integration with Enhanced Cards System */
.rarity-card-transcendent.enhanced {
    animation: transcendent-shift 4s ease-in-out infinite;
}

@keyframes transcendent-shift {

    0%,
    100% {
        filter: hue-rotate(0deg) brightness(1);
    }

    33% {
        filter: hue-rotate(-5deg) brightness(1.05);
    }

    66% {
        filter: hue-rotate(5deg) brightness(1.05);
    }
}

/* Transcendent Button Styling - Prismatic */
.btn-purchase.transcendent {
    background: linear-gradient(135deg,
            rgba(255, 183, 0, 0.8),
            rgba(255, 215, 0, 0.8));
    border: 2px solid transparent;
    border-image: linear-gradient(45deg,
            rgba(255, 183, 0, 0.8),
            rgba(255, 215, 0, 0.8)) 1;
    color: #000;
    font-weight: 700;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.btn-purchase.transcendent::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
}

.btn-purchase.transcendent:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 10px 30px rgba(255, 183, 0, 0.4),
        0 0 60px rgba(255, 183, 0, 0.2);
}

.btn-purchase.transcendent:hover::before {
    animation: transcendent-button-shine 0.5s ease;
}

@keyframes transcendent-button-shine {
    0% {
        transform: rotate(45deg) translateX(-100%);
    }

    100% {
        transform: rotate(45deg) translateX(100%);
    }
}

/* Transcendent Discount Badge - Prismatic */
.discount-badge.transcendent {
    background: linear-gradient(135deg,
            rgba(255, 183, 0, 0.8),
            rgba(255, 215, 0, 0.8));
    color: #000;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(255, 183, 0, 0.5);
    backdrop-filter: blur(5px);
}

/* ========== Angelic Tier (9) - Ultimate Celestial ========== */
.rarity-card-angelic,
.rarity-angelic,
[data-rarity="angelic"] {
    position: relative;
    border: 3px solid transparent;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.15),
            rgba(255, 215, 0, 0.1),
            rgba(255, 255, 255, 0.15));
    overflow: visible !important;
}

/* Angelic Multi-Layer Border Animation */
.rarity-card-angelic::before {
    content: '';
    position: absolute;
    inset: -3px;
    padding: 3px;
    border-radius: var(--radius-lg);
    background: linear-gradient(45deg,
            #ffffff, #ffd700, #00ffff, #ff00ff,
            #ffff00, #00ff00, #ff0080, #ffd700);
    background-size: 800% 800%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: angelic-border-flow 2s ease-in-out infinite;
    filter: brightness(1.5) contrast(1.2);
}

@keyframes angelic-border-flow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Angelic Glow */
.rarity-card-angelic .card-glow {
    background:
        radial-gradient(circle at 30% 30%,
            rgba(255, 255, 255, 0.6),
            transparent 40%),
        radial-gradient(circle at 70% 70%,
            rgba(255, 215, 0, 0.5),
            transparent 40%),
        radial-gradient(circle at 50% 50%,
            rgba(0, 255, 255, 0.3),
            transparent 50%);
    animation: angelic-glow-shift 4s ease-in-out infinite;
    transform: scale(1.2);
}

@keyframes angelic-glow-shift {

    0%,
    100% {
        opacity: 0.8;
        transform: scale(1.2) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.3) rotate(180deg);
    }
}

/* Angelic Halo */
.rarity-card-angelic .card-halo {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 100px;
    background: radial-gradient(ellipse at center,
            rgba(255, 255, 255, 0.4) 0%,
            rgba(255, 215, 0, 0.2) 20%,
            rgba(0, 255, 255, 0.1) 40%,
            transparent 70%);
    filter: blur(20px);
    animation: angelic-halo-pulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes angelic-halo-pulse {

    0%,
    100% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1);
    }
}

/* Angelic Badge */
.rarity-angelic .rarity-badge {
    background: linear-gradient(45deg,
            #ffffff, #ffd700, #ffffff);
    color: #000;
    font-weight: 900;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    border: 2px solid #ffd700;
    animation: angelic-badge-shine 2s ease-in-out infinite;
}

@keyframes angelic-badge-shine {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.8),
            0 0 60px rgba(255, 215, 0, 0.4);
    }

    50% {
        box-shadow: 0 0 50px rgba(255, 255, 255, 1),
            0 0 100px rgba(255, 215, 0, 0.6);
    }
}

/* Angelic Discount Badge */
.discount-badge.angelic {
    background: linear-gradient(135deg, #ffffff, #ffd700);
    color: #000;
    font-weight: 900;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Angelic Button */
.btn-purchase.angelic {
    background: linear-gradient(135deg,
            #ffffff, #ffd700, #00ffff, #ff00ff);
    background-size: 300% 300%;
    animation: angelic-button-gradient 4s ease infinite;
    border: 3px solid rgba(255, 255, 255, 0.8);
    color: #000;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes angelic-button-gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Angelic Effects Container */
.angelic-effects {
    position: absolute;
    inset: -20px;
    pointer-events: none;
}

.angelic-ring {
    position: absolute;
    inset: -10px;
    border: 2px solid transparent;
    border-image: linear-gradient(45deg, #ffd700, #ffffff, #00ffff, #ff00ff) 1;
    border-radius: var(--radius-lg);
    animation: angelic-ring-rotate 10s linear infinite;
}

.angelic-burst {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 215, 0, 0.1) 30%,
            rgba(0, 255, 255, 0.05) 60%,
            transparent 100%);
    animation: angelic-burst-pulse 3s ease-in-out infinite;
}

@keyframes angelic-ring-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes angelic-burst-pulse {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Angelic Text Effect */
.angelic-text {
    background: linear-gradient(45deg, #ffffff, #ffd700, #ffffff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: angelic-text-shimmer 3s ease-in-out infinite;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

@keyframes angelic-text-shimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Angelic Max Benefit Indicator */
.max-benefit-indicator.angelic {
    background: linear-gradient(45deg, #ffd700, #ffffff, #ffd700);
    color: #000;
    animation: angelic-indicator-shine 2s ease-in-out infinite;
}

@keyframes angelic-indicator-shine {

    0%,
    100% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.05);
        filter: brightness(1.3);
    }
}

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

.btn-angelic-sparkles::before,
.btn-angelic-sparkles::after {
    content: '✨';
    position: absolute;
    font-size: 20px;
    animation: angelic-sparkle-travel 3s linear infinite;
}

.btn-angelic-sparkles::before {
    top: 20%;
    left: -20px;
}

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

@keyframes angelic-sparkle-travel {
    to {
        transform: translateX(calc(100% + 40px));
    }
}