@keyframes hover {
    to {
        translate: 0px 12px;
    }
}

.hands {
    --cards: 4;
    --curvature: 70deg;
    counter-reset: cards;
    position: absolute;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    transform: translateY(15vmin);
    transform-style: preserve-3d;
}

.hands > * {
    --hue: calc(360deg / var(--cards) * var(--index));
    --curve: calc(var(--curvature) * ((var(--index) - (var(--cards) - 1) / 2) / var(--cards)));
    position: absolute;
    counter-increment: cards;
    flex: 0 0 auto;
    width: 15vw;
    max-width: 20vh;
    aspect-ratio: 2/3;
    transform-origin: 50% 100%;
    transform: rotate(var(--curve)) translateY(-225%);
    transition: all 0.3s;
    cursor: pointer;
    font-size: 4vmin;
    transform-style: preserve-3d;
}

.hands > *::before {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    background-image: var(--img);
    background-size: cover;
    background-position: center;
    border: solid 2px hsla(var(--hue), 50%, 40%, 1);
    transition: all 0.3s, translate 0s;
    box-shadow: 0px 4px 10px hsla(var(--hue), 80%, 80%, 0);
    pointer-events: none;
}

.hands > *:hover {
    animation: hover 1s ease-in-out infinite alternate forwards;
}

.hands > *:hover::before {
    transform: translateY(-42.5%) rotate(calc(var(--curve) * -1)) scale(1.2);
    transition-duration: 0.2s, 0s;
    box-shadow: 0px 4px 15px hsla(var(--hue), 80%, 70%, 0.6);
    border: solid 2px hsla(var(--hue), 80%, 70%, 1);
    translate: 0px 0px 1px;
}

/* Per-card styles */
.hands:has(li:nth-child(1)) { --cards: 1; }
.hands > *:nth-child(1) {
    --index: 0;
    --img: url('../games/images/shaders2.png');
}

.hands:has(li:nth-child(2)) { --cards: 2; }
.hands > *:nth-child(2) {
    --index: 1;
    --img: url('../games/images/UC.png');
}

.hands:has(li:nth-child(3)) { --cards: 3; }
.hands > *:nth-child(3) {
    --index: 2;
    --img: url('../games/images/Satori.png');
}

.hands:has(li:nth-child(4)) { --cards: 4; }
.hands > *:nth-child(4) {
    --index: 3;
    --img: url('../games/images/Iamai.png');
}

/* Add more if needed using this pattern */
