/* Explain: Styles for cartoon shadows, game boards, feedback popups, and animations. */
.cartoon-shadow {
    box-shadow: 4px 6px 0px 0px rgba(43,45,66,0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cartoon-shadow:hover {
    transform: translateY(-2px);
    box-shadow: 4px 8px 0px 0px rgba(43,45,66,0.2);
}

.cartoon-shadow:active {
    transform: translateY(2px);
    box-shadow: 2px 3px 0px 0px rgba(43,45,66,0.15);
}

.game-board {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 4px solid #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.dropzone {
    transition: all 0.3s ease;
}

.dropzone.drag-over {
    background-color: var(--accent-color) !important;
    border-color: var(--primary-color) !important;
    transform: scale(1.05);
}

/* Confetti animation */
.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f00;
    pointer-events: none;
    animation: pop 1s forwards ease-out;
    z-index: 50;
}

@keyframes pop {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(var(--dy)) translateX(var(--dx)) rotate(var(--rot)) scale(0);
        opacity: 0;
    }
}

/* Level page "How to Play" guide body text */
.level-guide__text p {
    margin-bottom: 1rem;
}

.level-guide__text p:last-child {
    margin-bottom: 0;
}

.level-guide__text strong {
    color: var(--primary-color);
}

/* Wrong-answer sad emoji (single 1s fade) */
.wrong-emoji {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    z-index: 70;
}

.wrong-emoji__face {
    font-size: 7rem;
    line-height: 1;
    transform: scale(0.4);
    filter: drop-shadow(0 10px 20px rgba(43, 45, 66, 0.25));
}

.wrong-emoji.is-showing {
    animation: sadFade 1s ease-out forwards;
}

.wrong-emoji.is-showing .wrong-emoji__face {
    animation: sadPop 1s ease-out forwards;
}

@keyframes sadFade {
    0% { opacity: 0; }
    20% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes sadPop {
    0% { transform: scale(0.4) translateY(0); }
    30% { transform: scale(1.15) translateY(0); }
    100% { transform: scale(1) translateY(-60px); }
}

/* Level complete transition screen (level-to-level) */
.level-complete-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(43, 45, 66, 0.55);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.level-complete-overlay[hidden] {
    display: none;
}

.level-complete-overlay.is-visible {
    opacity: 1;
}

.level-complete-card {
    width: 100%;
    max-width: 30rem;
    background: #ffffff;
    border-radius: 2rem;
    border: 4px solid #ffffff;
    box-shadow: 0 20px 45px rgba(43, 45, 66, 0.3);
    overflow: hidden;
    text-align: center;
    transform: scale(0.85);
    opacity: 0;
}

.level-complete-overlay.is-visible .level-complete-card {
    animation: levelPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes levelPop {
    0% {
        transform: scale(0.85);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Paywall lock overlay (shared by level + exam pages) */
.level-lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(43, 45, 66, 0.6);
    backdrop-filter: blur(4px);
}

.level-lock-overlay[hidden] {
    display: none;
}

.level-lock-card {
    width: 100%;
    max-width: 32rem;
    background: #ffffff;
    border-radius: 2rem;
    border: 4px solid #ffffff;
    box-shadow: 0 20px 45px rgba(43, 45, 66, 0.3);
    padding: 2rem 1.5rem;
    text-align: center;
}

/* Locked quest node on the map */
.map-node-locked {
    position: relative;
}

.map-node-lock {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(43, 45, 66, 0.5);
    color: #ffffff;
    z-index: 5;
}

.map-node-lock i {
    font-size: 1.875rem;
}


