/* Game Theme Custom Styles */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* More professional font */
}

/* Animated Grid Background */
.game-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.05; /* Much more subtle */
    background-image: repeating-linear-gradient(0deg, transparent, transparent 50px, #1e40af 50px, #1e40af 51px), repeating-linear-gradient(90deg, transparent, transparent 50px, #1e40af 50px, #1e40af 51px);
}

/* Smooth animations */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glitch effect on hover - Make it subtle */
.glitch:hover {
    animation: subtleGlow 0.3s ease-in-out;
}

@keyframes subtleGlow {
    0%, 100% {
        transform: translate(0);
    }

    50% {
        box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 5px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #2563eb;
    }

/* Pulse animation for XP counter */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ============================================
   XP SYSTEM ANIMATIONS
   ============================================ */

/* XP Counter Gain Animation */
.xp-gain {
    animation: xpPulse 0.5s ease-out;
}

@keyframes xpPulse {
    0% {
        transform: scale(1);
        color: #3b82f6;
    }

    50% {
        transform: scale(1.3);
        color: #2563eb;
        text-shadow: 0 0 10px #3b82f6;
    }

    100% {
        transform: scale(1);
        color: #3b82f6;
    }
}

/* XP Notification Popup */
.xp-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: rgba(30, 41, 59, 0.95);
    border: 2px solid #3b82f6;
    border-left: 4px solid #10b981;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 9999;
    animation: slideInRight 0.3s ease-out, fadeOutRight 0.3s ease-in 2.7s;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Achievement Popup */
.achievement-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: 4px solid #3b82f6;
    padding: 30px;
    border-radius: 12px;
    z-index: 10000;
    animation: achievementAppear 0.5s ease-out;
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.4);
}

.achievement-content {
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
}

.achievement-icon {
    font-size: 48px;
    animation: bounce 1s ease-in-out infinite;
}

.achievement-title {
    font-size: 12px;
    color: #3b82f6;
    font-weight: bold;
    letter-spacing: 2px;
}

.achievement-name {
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin: 4px 0;
}

.achievement-desc {
    font-size: 14px;
    color: #cbd5e1;
}

@keyframes achievementAppear {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-180deg);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1) rotate(10deg);
    }

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

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .xp-notification {
        right: 10px;
        top: 80px;
        padding: 10px 15px;
        font-size: 14px;
    }

    .achievement-popup {
        width: 90%;
        padding: 20px;
    }

    .achievement-content {
        flex-direction: column;
        text-align: center;
    }
}
