* {
    font-family: 'Fredoka', sans-serif;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: #0f1219;
    overflow-x: hidden;
}

/* Title sparkle effect */
.title-sparkle {
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

/* Sparkle animations */
.sparkle {
    animation: sparkle 2s ease-in-out infinite;
    position: absolute;
}

.sparkle.delay-1 {
    animation-delay: 0.3s;
}

.sparkle.delay-2 {
    animation-delay: 0.6s;
}

@keyframes sparkle {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% { 
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Mascot bounce */
.mascot-bounce {
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

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

/* Stat item hover */
.stat-item {
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: scale(1.05);
}

/* Counter animation */
.counter-animation {
    animation: countPop 0.3s ease-out;
}

@keyframes countPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Glow card */
.glow-card {
    box-shadow: 0 0 30px rgba(0, 212, 170, 0.1);
}

/* Subject card hover */
.subject-card {
    position: relative;
    overflow: hidden;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.5s ease;
}

.subject-card:hover::before {
    left: 100%;
}

/* Streak fire animation */
.streak-fire {
    animation: fireGlow 1.5s ease-in-out infinite;
}

@keyframes fireGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(249, 115, 22, 0.3); }
    50% { box-shadow: 0 0 20px rgba(249, 115, 22, 0.6); }
}

/* Answer button */
.answer-btn {
    position: relative;
    overflow: hidden;
}

.answer-btn:not(:disabled):hover {
    transform: translateX(5px);
}

.answer-btn:not(:disabled):active {
    transform: scale(0.98);
}

/* Correct answer animation */
.correct-answer {
    animation: correctPulse 0.5s ease-out;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Shake animation for wrong answers */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

/* Achievement popup */
.achievement-popup {
    animation: achievementSlide 0.5s ease-out, achievementGlow 2s ease-in-out infinite;
}

@keyframes achievementSlide {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes achievementGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.3); }
    50% { box-shadow: 0 0 40px rgba(251, 191, 36, 0.6); }
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.confetti-particle {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confettiFall 2s ease-out forwards;
}

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

/* Progress ring glow */
svg circle:last-of-type {
    filter: drop-shadow(0 0 6px rgba(0, 212, 170, 0.5));
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .subject-card {
        padding: 1.25rem !important;
    }
    
    .subject-card .text-5xl {
        font-size: 2.5rem;
    }
    
    h1 {
        font-size: 2rem !important;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #3f4451;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Selection color */
::selection {
    background: rgba(0, 212, 170, 0.3);
    color: white;
}

/* Focus styles for accessibility */
button:focus-visible {
    outline: 2px solid #00d4aa;
    outline-offset: 2px;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}