/* Custom Styles for Real Magic Lamp Experience */

:root {
    --primary: #6200EE;
    --primaryLight: #BB86FC;
    --gold: #FFD700;
}

/* Base UI Styles */
body {
    background: radial-gradient(circle at center, #1A0B3C 0%, #0F0524 100%);
    overflow-x: hidden;
}

/* Category Selection */
.cat-btn.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

/* Shake Animation for Input Error */
@keyframes shake-x {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}
.animate-shake {
    animation: shake-x 0.4s;
}

/* Lamp Vibration (When rubbing) */
@keyframes intense-vibrate {
    0% { transform: translate(0, 0) rotate(0); filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6)); }
    20% { transform: translate(-3px, 1px) rotate(-2deg); filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.9)) brightness(1.2); }
    40% { transform: translate(3px, -1px) rotate(2deg); }
    60% { transform: translate(-3px, -1px) rotate(-2deg); }
    80% { transform: translate(3px, 1px) rotate(2deg); filter: drop-shadow(0 0 35px rgba(255, 215, 0, 1)) brightness(1.3); }
    100% { transform: translate(0, 0) rotate(0); filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6)); }
}

.lamp-shaking #magic-lamp-svg {
    animation: intense-vibrate 0.15s linear infinite;
}

/* Lamp Dimming (When answer is shown) */
.lamp-dimmed {
    opacity: 0.1;
    transform: scale(0.85) translateY(10px);
    filter: blur(10px);
}

/* Smoke Particles Animation (Thick and Clear) */
@keyframes thick-smoke {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0.5);
        filter: blur(2px);
    }
    20% {
        opacity: 1;
        filter: blur(8px);
    }
    100% {
        opacity: 0;
        transform: translate(-100px, -250px) scale(8);
        filter: blur(40px);
    }
}

.smoke-puff {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(187,134,252,0.9) 50%, transparent 80%);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 25;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }

/* Answer Reveal Card Pop */
@keyframes answer-pop {
    0% { opacity: 0; transform: translate(-50%, 40px) scale(0.8); filter: blur(10px); }
    100% { opacity: 1; transform: translate(-50%, 0) scale(1); filter: blur(0); }
}

.answer-visible {
    animation: answer-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* History Log Styles */
#log-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

#log-container::-webkit-scrollbar {
    width: 4px;
}

#log-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    #magic-lamp-svg {
        width: 160px;
        height: 100px;
    }
    #smoke-origin {
        top: 25px;
        left: -10px;
    }
}