#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    gap: 1rem;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#loader .square {
    width: 30px;
    height: 30px;
    animation: square-morph 2s infinite ease-in-out;
}

#loader .square:nth-child(1) {
    background-color: var(--wca-yellow);
    animation-delay: 0s;
}
#loader .square:nth-child(2) {
    background-color: var(--wca-cyan);
    animation-delay: 0.2s;
}
#loader .square:nth-child(3) {
    background-color: var(--wca-pink);
    animation-delay: 0.4s;
}
#loader .square:nth-child(4) {
    background-color: var(--wca-blue);
    animation-delay: 0.6s;
}

@keyframes square-morph {
    0%, 100% {
        border-radius: 4px;
        transform: rotate(0deg);
    }
    50% {
        border-radius: 50%;
        transform: rotate(180deg);
    }
}

