/* ── NexusX Cosmetics Rendering Engine ────────────────────────────────────── */

/* === Avatar Frames === */
.frame-fire {
    box-shadow: 0 0 8px rgba(239,68,68,0.6), 0 0 20px rgba(239,68,68,0.3);
    border: 2px solid #ef4444;
    animation: frame-fire 1.5s ease-in-out infinite;
}
@keyframes frame-fire {
    0%, 100% { box-shadow: 0 0 8px rgba(239,68,68,0.6), 0 0 20px rgba(239,68,68,0.3); }
    50% { box-shadow: 0 0 15px rgba(239,68,68,0.8), 0 0 30px rgba(239,68,68,0.4); }
}

.frame-lightning {
    box-shadow: 0 0 8px rgba(250,204,21,0.6), 0 0 20px rgba(250,204,21,0.3);
    border: 2px solid #facc15;
    animation: frame-lightning 0.8s ease-in-out infinite;
}
@keyframes frame-lightning {
    0%, 100% { box-shadow: 0 0 8px rgba(250,204,21,0.6); }
    25% { box-shadow: 0 0 20px rgba(250,204,21,1), 0 0 40px rgba(250,204,21,0.5); }
    50% { box-shadow: 0 0 5px rgba(250,204,21,0.3); }
    75% { box-shadow: 0 0 15px rgba(250,204,21,0.8); }
}

.frame-rainbow {
    border: 3px solid transparent;
    background-clip: padding-box;
    animation: frame-rainbow 3s linear infinite;
    box-shadow: 0 0 10px rgba(168,85,247,0.4);
}
@keyframes frame-rainbow {
    0% { border-color: #ef4444; box-shadow: 0 0 10px rgba(239,68,68,0.4); }
    16% { border-color: #f59e0b; box-shadow: 0 0 10px rgba(245,158,11,0.4); }
    33% { border-color: #22c55e; box-shadow: 0 0 10px rgba(34,197,94,0.4); }
    50% { border-color: #06b6d4; box-shadow: 0 0 10px rgba(6,182,212,0.4); }
    66% { border-color: #8b5cf6; box-shadow: 0 0 10px rgba(139,92,246,0.4); }
    83% { border-color: #ec4899; box-shadow: 0 0 10px rgba(236,72,153,0.4); }
    100% { border-color: #ef4444; box-shadow: 0 0 10px rgba(239,68,68,0.4); }
}

.frame-neon {
    box-shadow: 0 0 6px rgba(6,182,212,0.8), 0 0 15px rgba(6,182,212,0.4), inset 0 0 6px rgba(6,182,212,0.2);
    border: 2px solid #06b6d4;
    animation: frame-neon 2s ease-in-out infinite;
}
@keyframes frame-neon {
    0%, 100% { box-shadow: 0 0 6px rgba(6,182,212,0.8), 0 0 15px rgba(6,182,212,0.4); }
    50% { box-shadow: 0 0 10px rgba(6,182,212,1), 0 0 25px rgba(6,182,212,0.6); }
}

.frame-pixel {
    border: 3px solid #22c55e;
    image-rendering: pixelated;
    box-shadow: 0 0 0 2px #0d1117, 0 0 0 4px #22c55e;
}

.frame-disco {
    animation: frame-disco 0.5s steps(6) infinite;
}
@keyframes frame-disco {
    0% { border-color: #ef4444; box-shadow: 0 0 15px #ef4444; }
    16% { border-color: #fbbf24; box-shadow: 0 0 15px #fbbf24; }
    33% { border-color: #22c55e; box-shadow: 0 0 15px #22c55e; }
    50% { border-color: #06b6d4; box-shadow: 0 0 15px #06b6d4; }
    66% { border-color: #a855f7; box-shadow: 0 0 15px #a855f7; }
    83% { border-color: #ec4899; box-shadow: 0 0 15px #ec4899; }
    100% { border-color: #ef4444; box-shadow: 0 0 15px #ef4444; }
}

.frame-gold {
    border: 3px solid #ffd700;
    box-shadow: 0 0 10px rgba(255,215,0,0.4), 0 0 20px rgba(255,215,0,0.2);
}

.frame-diamond {
    border: 3px solid #67e8f9;
    box-shadow: 0 0 10px rgba(103,232,249,0.4), 0 0 20px rgba(103,232,249,0.2);
    animation: frame-diamond 3s ease-in-out infinite;
}
@keyframes frame-diamond {
    0%, 100% { box-shadow: 0 0 10px rgba(103,232,249,0.4); }
    50% { box-shadow: 0 0 20px rgba(103,232,249,0.8), 0 0 40px rgba(103,232,249,0.3); }
}

/* === Name Effects === */
.name-glow {
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor;
    animation: name-glow 2s ease-in-out infinite;
}
@keyframes name-glow {
    0%, 100% { text-shadow: 0 0 5px currentColor, 0 0 10px currentColor; }
    50% { text-shadow: 0 0 15px currentColor, 0 0 30px currentColor, 0 0 45px currentColor; }
}

.name-bounce {
    display: inline-block;
    animation: name-bounce 1.5s ease-in-out infinite;
}
@keyframes name-bounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-4px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-2px); }
}

.name-glitch {
    animation: name-glitch 3s steps(2) infinite;
}
@keyframes name-glitch {
    0%, 90%, 100% { transform: translate(0); filter: none; }
    92% { transform: translate(-2px, 1px); filter: hue-rotate(90deg); }
    94% { transform: translate(2px, -1px); filter: hue-rotate(-90deg); }
    96% { transform: translate(-1px, -1px); filter: hue-rotate(45deg); }
    98% { transform: translate(1px, 1px); }
}

.name-typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: name-typewriter 3s steps(20) infinite;
}
@keyframes name-typewriter {
    0% { width: 0; }
    50%, 100% { width: 100%; }
}

.name-rainbow {
    background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e, #06b6d4, #8b5cf6, #ec4899, #ef4444);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: name-rainbow 3s linear infinite;
}
@keyframes name-rainbow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* === Leaderboard Trails === */
.trail-fire::after {
    content: '';
    position: absolute; right: -10px; top: 50%; transform: translateY(-50%);
    width: 30px; height: 20px;
    background: radial-gradient(circle, rgba(239,68,68,0.6) 0%, transparent 70%);
    animation: trail-flicker 0.5s ease-in-out infinite;
}
@keyframes trail-flicker {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.trail-stars::after {
    content: '✦';
    position: absolute; right: -8px; top: 50%; transform: translateY(-50%);
    color: #fbbf24; font-size: 0.7rem;
    animation: trail-twinkle 1s ease-in-out infinite;
}
@keyframes trail-twinkle {
    0%, 100% { opacity: 0.3; transform: translateY(-50%) scale(0.8); }
    50% { opacity: 1; transform: translateY(-50%) scale(1.2); }
}

.trail-lightning::after {
    content: '⚡';
    position: absolute; right: -8px; top: 50%; transform: translateY(-50%);
    font-size: 0.7rem;
    animation: trail-flash 0.8s ease-in-out infinite;
}
@keyframes trail-flash {
    0%, 60%, 100% { opacity: 0.2; }
    30% { opacity: 1; }
}

/* === Podium Skins === */
.podium-gold-throne {
    background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(201,168,76,0.1)) !important;
    border-color: rgba(255,215,0,0.3) !important;
}

.podium-ice {
    background: linear-gradient(135deg, rgba(103,232,249,0.1), rgba(6,182,212,0.05)) !important;
    border-color: rgba(103,232,249,0.3) !important;
}

.podium-lava {
    background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(249,115,22,0.1)) !important;
    border-color: rgba(239,68,68,0.3) !important;
}

/* === Entrance Effects (triggered via JS) === */
.entrance-confetti { animation: entrance-pop 0.5s ease-out; }
.entrance-fireworks { animation: entrance-burst 0.8s ease-out; }
.entrance-sparkles { animation: entrance-sparkle 1s ease-out; }
.entrance-lightning { animation: entrance-flash 0.3s ease-out; }
.entrance-smoke { animation: entrance-fade 1s ease-out; }

@keyframes entrance-pop {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes entrance-burst {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); }
}
@keyframes entrance-sparkle {
    0% { opacity: 0; filter: brightness(2); }
    100% { opacity: 1; filter: brightness(1); }
}
@keyframes entrance-flash {
    0% { opacity: 0; filter: brightness(3); }
    50% { opacity: 1; filter: brightness(2); }
    100% { filter: brightness(1); }
}
@keyframes entrance-fade {
    0% { opacity: 0; filter: blur(10px); }
    100% { opacity: 1; filter: blur(0); }
}

/* === Pet Animations === */
.pet-bob { animation: pet-bob 2s ease-in-out infinite; }
.pet-spin { animation: pet-spin 4s linear infinite; }
.pet-wiggle { animation: pet-wiggle 1.5s ease-in-out infinite; }

@keyframes pet-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
@keyframes pet-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes pet-wiggle {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

/* === Rarity Borders === */
.rarity-common { border-left: 3px solid #9ca3af; }
.rarity-rare { border-left: 3px solid #3b82f6; }
.rarity-epic { border-left: 3px solid #a855f7; }
.rarity-legendary { border-left: 3px solid #f59e0b; }

.rarity-glow-legendary {
    box-shadow: 0 0 10px rgba(245,158,11,0.3);
    animation: rarity-legendary-glow 2s ease-in-out infinite;
}
@keyframes rarity-legendary-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(245,158,11,0.3); }
    50% { box-shadow: 0 0 20px rgba(245,158,11,0.5), 0 0 30px rgba(245,158,11,0.2); }
}
