/* Container for the background animation */
#chess-animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Behind everything */
    overflow: hidden;
    pointer-events: none;
    /* Allow clicking through */
    /* Initialize variables to 0 to prevent errors if JS fails */
    --mouse-x: 0;
    --mouse-y: 0;
}

/* Wrapper handles the position and parallax movement */
.chess-piece-wrapper {
    position: absolute;
    will-change: transform;
    transition: transform 0.2s ease-out;
    /* Smooth out the mouse movement slightly */
    /* 
       Calculate position based on mouse coordinates.
       --depth is set inline in JS. 
       50px is the max movement range.
    */
    transform: translate(calc(var(--mouse-x) * var(--depth) * -30px),
            calc(var(--mouse-y) * var(--depth) * -30px));
}

/* Inner piece handles the visual style and floating animation */
.chess-piece {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: rgba(255, 255, 255, 0.03);
    /* Very subtle opacity */
    display: block;
    /* Animation defined here */
}

/* Gold pieces variation */
.chess-piece.gold {
    color: rgba(255, 196, 37, 0.05);
}

/* Green pieces variation */
.chess-piece.green {
    color: rgba(0, 133, 75, 0.05);
}

/* Idle floating animation */
@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}