@import url('https://fonts.googleapis.com/css2?family=Henny+Penny&family=Fredoka:wght@400;600;700;900&display=swap');

body {
    font-family: 'Fredoka', sans-serif;
    background-color: #2e1065;
    color: #fff;
    overflow-y: auto;
}

.magic-font {
    font-family: 'Henny Penny', cursive;
}

.magic-text {
    font-family: 'Henny Penny', cursive;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.2), 0 0 20px rgba(139, 92, 246, 0.5);
}

/* Floating Animation */
.animate-float {
    animation: floating 4s ease-in-out infinite;
}

@keyframes floating {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(1deg);
    }
}

/* Rune/Potion Card */
.rune-card {
    background: linear-gradient(135deg, #4338ca, #312e81);
    border: 2px solid #6366f1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 0 15px rgba(99, 102, 241, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.rune-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04), 0 0 30px rgba(168, 85, 247, 0.6);
    border-color: #a855f7;
    z-index: 20;
}

.rune-card:active {
    transform: scale(0.95);
}

.rune-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.rune-card:hover::before {
    transform: translateX(100%);
}

.correct-flash {
    animation: flashGreen 0.5s forwards;
}

.wrong-shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes flashGreen {
    0% {
        background: #4338ca;
        transform: scale(1);
    }

    50% {
        background: #22c55e;
        transform: scale(1.1);
        box-shadow: 0 0 50px #22c55e;
    }

    100% {
        background: #4338ca;
        transform: scale(1);
    }
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-2px, 0, 0);
        background: #ef4444;
    }

    20%,
    80% {
        transform: translate3d(4px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-6px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(6px, 0, 0);
    }
}

/* Bubbles */
@keyframes bubble {
    0% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateY(-30px) scale(1.5);
        opacity: 0;
    }
}

.animate-bubble {
    animation: bubble 2s infinite ease-in;
}

/* Grimoire */
.grimoire-slot {
    aspect-ratio: 1;
    border: 2px dashed #8d6e63;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.1);
}

.grimoire-slot.unlocked {
    border-style: solid;
    border-color: #d4af37;
    background: #5d4037;
    opacity: 1;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Archmage Mode */
.archmage-mode #game-scene {
    animation: rainbow-glow 5s infinite;
}

.archmage-mode #mana-fill {
    box-shadow: 0 0 20px #fff, 0 0 40px #0ea5e9;
    animation: pulse-fast 0.5s infinite;
}

@keyframes rainbow-glow {
    0% {
        filter: hue-rotate(0deg) saturate(1.5);
    }

    100% {
        filter: hue-rotate(360deg) saturate(1.5);
    }
}

@keyframes pulse-fast {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

/* Draggable removed */

.hidden {
    display: none !important;
}

/* High-quality claymation background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('clay_background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -1;
}