/* === CONTAINER CAROUSEL === */
.custom-carousel {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

/* === ITEM BASE === */
.custom-carousel .item {
    flex: 1 1 clamp(100px, 30%, 100px);
    height: 400px;
    display: flex;
    align-items: flex-end;
    background: #343434 no-repeat center center / cover;
    overflow: hidden;
    position: relative;
    transition: all 0.4s ease-in-out;
    cursor: pointer;
}

/* === OVERLAY GRADIENTE === */
.custom-carousel .item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.2), transparent);
}

/* === DESCRIZIONE ITEM === */
.custom-carousel .item-desc {
    padding: 0 16px 12px;
    color: #fff;
    position: relative;
    z-index: 1;
    overflow: hidden;
    transform: translateY(calc(100% - 54px));
    transition: all 0.4s ease-in-out;
}

.custom-carousel .item-desc img,
.custom-carousel .item-desc p {
    opacity: 0;
    transform: translateY(32px);
    transition: all 0.4s ease-in-out 0.2s;
}

/* === HOVER SOLO DESKTOP === */
@media (min-width: 992px) {
    .custom-carousel .item:hover {
        flex: 1 1 clamp(250px, 50%, 500px);
        box-shadow: 12px 40px 40px rgba(0, 0, 0, 0.25);
    }

    .custom-carousel .item:hover .item-desc {
        transform: none;
    }

    .custom-carousel .item:hover .item-desc img,
    .custom-carousel .item:hover .item-desc p {
        opacity: 1;
        transform: translateY(0);
    }

    /* Disattiva la classe active (mobile) su desktop */
    .custom-carousel .item.active {
        flex: 1 1 clamp(100px, 30%, 100px);
        box-shadow: none;
    }

    .custom-carousel .item.active .item-desc {
        transform: translateY(calc(100% - 54px));
    }

    .custom-carousel .item.active .item-desc img,
    .custom-carousel .item.active .item-desc p {
        opacity: 0;
        transform: translateY(32px);
    }
}

/* === ACTIVE (SOLO MOBILE/TABLET < 992px) === */
.custom-carousel .item.active {
    flex: 1 1 clamp(250px, 50%, 500px);
    box-shadow: 12px 40px 40px rgba(0, 0, 0, 0.25);
}

.custom-carousel .item.active .item-desc {
    transform: none;
}

.custom-carousel .item.active .item-desc img,
.custom-carousel .item.active .item-desc p {
    opacity: 1;
    transform: translateY(0);
}

/* === RESPONSIVE LAYOUT === */

/* Tablet < 992px */
@media (max-width: 991.98px) {
    .game-section .item,
    .game-section .item.active {
        flex: none;
        width: 48% !important;
        max-width: 48% !important;
    }
}

/* Mobile < 576px */
@media (max-width: 575.98px) {
    .game-section .item,
    .game-section .item.active {
        flex: none;
        width: 100% !important;
        max-width: 100% !important;
    }
}
