/* css/gamification.css - Retrogaming effects animations */

/* Base Overlay */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.game-overlay.active {
    opacity: 1;
}

/* Common Text Styles */
.effect-text {
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    animation: textPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    z-index: 10;
}

@keyframes textPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Effect 1: FINISH HIM! (Mortal Kombat) */
.mortal-kombat {
    background: radial-gradient(circle, rgba(255,0,0,0.3) 0%, transparent 70%);
    padding: 60px;
}

.mk-text {
    font-size: 4rem;
    color: #FF0000;
    text-shadow: 
        0 0 10px #FF0000,
        0 0 20px #FF0000,
        0 0 30px #FF0000,
        4px 4px 0 #000;
    animation: mkPulse 0.5s ease-in-out infinite alternate;
}

@keyframes mkPulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

/* Effect 2: YOU WIN! (Street Fighter) */
.street-fighter {
    background: linear-gradient(135deg, rgba(255,215,0,0.2) 0%, rgba(255,140,0,0.2) 100%);
    padding: 60px;
}

.sf-text {
    font-size: 5rem;
    color: #FFD700;
    text-shadow:
        0 0 20px #FFD700,
        0 0 40px #FFD700,
        5px 5px 0 #000,
        -2px -2px 0 #FFA500;
    animation: sfBounce 0.6s ease-out;
}

.sf-subtitle {
    font-size: 2rem;
    color: #FFA500;
    margin-top: 20px;
    animation: fadeInUp 0.8s 0.3s both;
}

@keyframes sfBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

/* Effect 3: LEVEL UP! */
.effect-levelup {
    text-align: center;
    animation: slideInFromBottom 0.5s ease-out;
}

.levelup-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 4rem;
    color: #00FF00;
    text-shadow:
        0 0 20px #00FF00,
        0 0 40px #00FF00,
        4px 4px 0 #000;
    margin-bottom: 30px;
}

.xp-bar-container {
    width: 400px;
    height: 40px;
    background: #000;
    border: 4px solid #00FF00;
    margin: 0 auto 20px;
    position: relative;
    box-shadow: 0 0 20px rgba(0,255,0,0.5);
}

.xp-bar {
    height: 100%;
    background: linear-gradient(90deg, #00FF00 0%, #00FF00 100%);
    width: 0;
    animation: fillBar 1.5s ease-out 0.5s forwards;
    box-shadow: inset 0 0 20px rgba(255,255,255,0.5);
}

@keyframes fillBar {
    to { width: 100%; }
}

.levelup-subtitle {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5rem;
    color: #FFD700;
    animation: fadeInUp 0.8s 0.8s both;
}

@keyframes slideInFromBottom {
    from { transform: translateY(100vh); }
    to { transform: translateY(0); }
}

/* Effect 4: PERFECT! */
.perfect-text {
    animation: perfectScale 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.perfect-main {
    font-size: 5rem;
    color: #FF00FF;
    text-shadow:
        0 0 30px #FF00FF,
        0 0 60px #FF00FF,
        5px 5px 0 #000;
}

@keyframes perfectScale {
    0% { transform: scale(0) rotate(-180deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Effect 5: CRITICAL HIT! */
.critical-hit {
    animation: criticalShake 0.5s;
}

.critical-main {
    font-size: 4rem;
    color: #FF0000;
    text-shadow:
        0 0 20px #FF0000,
        6px 6px 0 #000;
}

.critical-damage {
    font-size: 6rem;
    color: #FFFF00;
    margin-top: 20px;
    text-shadow:
        0 0 30px #FFFF00,
        0 0 60px #FFFF00,
        6px 6px 0 #8B0000;
    animation: damageNumber 0.8s ease-out;
}

@keyframes damageNumber {
    0% { transform: translateY(50px) scale(0); opacity: 0; }
    50% { transform: translateY(-20px) scale(1.2); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Effect 6: ACHIEVEMENT UNLOCKED */
.effect-achievement {
    text-align: center;
    animation: achievementSlide 0.6s ease-out;
}

.trophy-icon {
    font-size: 8rem;
    animation: trophyDrop 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    filter: drop-shadow(0 0 20px #FFD700);
}

@keyframes trophyDrop {
    0% { transform: translateY(-200vh) rotate(0deg); }
    60% { transform: translateY(20px) rotate(360deg); }
    100% { transform: translateY(0) rotate(360deg); }
}

.achievement-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 2.5rem;
    color: #FFD700;
    margin: 20px 0;
    text-shadow:
        0 0 20px #FFD700,
        4px 4px 0 #000;
}

.achievement-desc {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    color: #00FFFF;
    animation: fadeInUp 1s 0.5s both;
}

/* Effect 7: FLAWLESS VICTORY */
.flawless-victory {
    animation: flawlessEntry 0.8s;
}

.flawless-main {
    font-size: 5rem;
    color: #00FFFF;
    text-shadow:
        0 0 30px #00FFFF,
        0 0 60px #00FFFF,
        6px 6px 0 #000;
}

.flawless-sub {
    font-size: 3rem;
    color: #FF00FF;
    margin-top: 20px;
    text-shadow:
        0 0 20px #FF00FF,
        4px 4px 0 #000;
    animation: fadeInUp 0.8s 0.3s both;
}

@keyframes flawlessEntry {
    0% { transform: scale(3) rotate(360deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Effect 8: HADOUKEN! */
.energy-wave {
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(0,191,255,0.8) 0%, transparent 70%);
    border-radius: 50%;
    left: -200px;
    top: 50%;
    transform: translateY(-50%);
    animation: energyBlast 1.5s ease-out;
    box-shadow: 
        0 0 50px #00BFFF,
        0 0 100px #00BFFF,
        0 0 150px #00BFFF;
}

@keyframes energyBlast {
    0% { left: -200px; transform: translateY(-50%) scale(0.5); }
    50% { transform: translateY(-50%) scale(1.5); }
    100% { left: calc(100% + 200px); transform: translateY(-50%) scale(0.5); }
}

.hadouken-text {
    z-index: 11;
}

.hadouken-main {
    font-size: 4rem;
    color: #00BFFF;
    text-shadow:
        0 0 30px #00BFFF,
        0 0 60px #00BFFF,
        5px 5px 0 #000;
    animation: hadoukenShout 0.3s ease-out;
}

@keyframes hadoukenShout {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Effect 9: FATALITY! */
.fatality-text .fatality-main {
    font-size: 5rem;
    color: #8B0000;
    text-shadow:
        0 0 40px #FF0000,
        0 0 80px #FF0000,
        6px 6px 0 #000;
    animation: fatalityBoom 0.6s ease-out;
}

@keyframes fatalityBoom {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    75% { transform: scale(1.1); }
}

/* Effect 10: COMBO! */
.combo-text {
    animation: comboSlam 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.combo-main {
    font-size: 4rem;
    color: #FFA500;
    text-shadow:
        0 0 20px #FFA500,
        0 0 40px #FFA500,
        5px 5px 0 #000;
}

.combo-counter {
    font-size: 6rem;
    color: #FF4500;
    margin-top: 20px;
    text-shadow:
        0 0 30px #FF4500,
        0 0 60px #FF4500,
        6px 6px 0 #000;
    animation: comboCount 0.3s 0.3s both;
}

@keyframes comboSlam {
    0% { transform: translateY(-100vh) rotate(-45deg); }
    70% { transform: translateY(10px) rotate(5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

@keyframes comboCount {
    0% { transform: scale(0); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* Particle Effects */
.particle {
    position: absolute;
    font-size: 2rem;
    animation: particleFall 2s ease-out forwards;
    pointer-events: none;
}

@keyframes particleFall {
    0% { 
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% { 
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Star Particles */
.star-particle {
    position: absolute;
    font-size: 2rem;
    top: 50%;
    left: 50%;
    animation: starBurst 1.5s ease-out forwards;
}

@keyframes starBurst {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) translateX(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) rotate(720deg) translateX(200px);
        opacity: 0;
    }
}

/* Explosion Particles */
.explosion-particle {
    position: absolute;
    font-size: 1.5rem;
    top: 50%;
    left: 50%;
    animation: explode 1s ease-out forwards;
}

@keyframes explode {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(var(--distance)) scale(0.5);
        opacity: 0;
    }
}

/* Confetti */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Screen Effects */
.game-overlay.flash-effect {
    animation: screenFlash 0.5s;
}

@keyframes screenFlash {
    0%, 100% { background: transparent; }
    50% { background: rgba(255, 255, 255, 0.8); }
}

.game-overlay.shake-effect {
    animation: screenShake 0.5s;
}

@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-10px, -10px); }
    20%, 40%, 60%, 80% { transform: translate(10px, 10px); }
}

.game-overlay.glitch-effect {
    animation: glitchEffect 0.3s infinite;
}

@keyframes glitchEffect {
    0%, 100% { 
        clip-path: inset(0); 
        transform: translate(0);
    }
    20% { 
        clip-path: inset(20% 0 30% 0); 
        transform: translate(-5px, 5px);
    }
    40% { 
        clip-path: inset(60% 0 10% 0); 
        transform: translate(5px, -5px);
    }
    60% { 
        clip-path: inset(10% 0 70% 0); 
        transform: translate(-5px, -5px);
    }
    80% { 
        clip-path: inset(50% 0 20% 0); 
        transform: translate(5px, 5px);
    }
}

.game-overlay.red-flash {
    animation: redFlash 0.8s;
}

@keyframes redFlash {
    0%, 100% { background: transparent; }
    25%, 75% { background: rgba(139, 0, 0, 0.8); }
    50% { background: rgba(255, 0, 0, 0.9); }
}

/* Utility animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .mk-text, .sf-text, .perfect-main, .critical-main, .hadouken-main, .flawless-main, .combo-main {
        font-size: 2rem;
    }
    
    .levelup-text, .achievement-text {
        font-size: 1.5rem;
    }
    
    .critical-damage, .combo-counter {
        font-size: 3rem;
    }
    
    .trophy-icon {
        font-size: 4rem;
    }
    
    .xp-bar-container {
        width: 80%;
    }
}
