.stacked-cards {
    position: relative;
}
.stacked-cards .cardwrapper {
    position: relative;
    max-width: calc(100% - 90px);
    margin: 0 auto;
    padding-left: 0;
    z-index: 1; 
}

 
.stacked-cards .card-.active {
    z-index: 100000 !important;
}
.stacked-cards .card-.active ~ .card-{
    --dimension: -1;
}
.stacked-cards .card- {
    --dimension: 1;

    transition: .3s all ease !important;
    margin-top: 5px;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 3px 6px 0px #333;
    list-style: none;
    width: 65%;
    position: absolute;
    left: 50%;
    translate: calc(-50% + ((var(--i) - var(--var)) * 45px)) 0;
    scale: calc( 1 - ( (var(--i) - var(--var)) * -0.045 * var(--dimension)) );
    transition: 0.5s ease transform;
    z-index: calc( 1 * var(--dimension) * (var(--i) - var(--var)) );
} 

.stacked-cards .card-:after {
    bottom: 0;
    content: "";
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}
.stacked-cards .card-.active:after {
    display: none;
}
.stacked-cards .card- img {
    position: relative;
    display: block;
    max-width: 100%;
    height: auto;
    z-index: 4;
}
.stacked-cards .card-.active {
    cursor: default;
    box-shadow: 0 5px 10px 0px #333;
    transition: 0.5s ease transform;
}

@media only screen and (max-width: 575px) {
    .stacked-cards .cardwrapper { 
        max-width: calc(100% - 30px); 
    }
    .stacked-cards .card- { 
        width: 100%; 
    } 
}