#rapid-game-container {
    position: relative;
    width: 100%;
    max-width: 100vw;
    height: 600px;
    max-height: 90vh;
    background-color: #ffffff20;
    padding-bottom: 20px;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    user-select: none;
}

#rapid-top-card {
    z-index: 4;
    scale: 1;
}

.rapid-play-again-img {
    pointer-events: none;
    width: 50%;
    object-fit: contain;
}

.rapid-play-again-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    opacity: 1;
    pointer-events: all;
    width: 100%;
    transition: opacity 0.5s ease-out;
}

.rapid-play-again-text {
    pointer-events: none;
}

.rapid-play-again-button:hover>.rapid-play-again-text {
    font-size: 24px;
}

.rapid-play-again-text {
    font-size: 20px;
    transition: font-size 0.5s ease-out;
}

.rapid-card.play-again {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.rapid-card.play-again > .rapid-card-img {
    display: none;
}

.rapid-card:not(.play-again) > .rapid-play-again-button {
    opacity: 0;
    pointer-events: none;
    width: 0;
}


.rapid-card {
    position: absolute;
    top: calc(50% + 0px);
    left: 50%;
    translate: -50% -50%;
    display: flex;
    justify-content: center;
    align-items: flex-end;

    width: 200px;
    height: 200px;
    border-radius: 20px;
    background-color: white;
    /* background-position: top center;
    background-size: cover;
    background-repeat: no-repeat; */
    overflow: hidden;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.5);
}

.rapid-card:first-child {
    /* transition: opacity 0.5s ease; */
}

.rapid-card-stack {
    --advance: 0;
}

.stack-card {
    background-color: white;
    /* border: 1px solid black; */
    transition: all calc(0.5s * var(--advance)) ease-in-out;
}


.stack-card:nth-of-type(1).play-again .rapid-play-again-button, .stack-card:nth-of-type(1):not(.play-again) .rapid-card-img{
    opacity: var(--advance);
    transition: opacity calc(0.5s * var(--advance)) ease-in-out;
}

.stack-card:nth-of-type(1) {
    margin-top: calc(15px * (1 - var(--advance)));
    scale: calc(0.9 + 0.1 * var(--advance));
    z-index: 3;
}

.stack-card:nth-of-type(2) {
    margin-top: calc(30px - 15px * var(--advance));
    scale: calc(0.81 + (0.09 * var(--advance)));
    z-index: 2;
}

.stack-card:nth-of-type(3) {
    margin-top: calc(45px - 15px * var(--advance));
    scale: calc(0.73 + (0.08 * var(--advance)));
    opacity: var(--advance);
    z-index: 1;
}


.rapid-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
}

.rapid-card-img:not(.checkmark) {
    filter: drop-shadow(0px 0px 10px black);
    object-fit: cover;
    object-position: center bottom;
}

#rapid-prompt {
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 30px;
    text-align: center;
    color: black;
    text-wrap: balance;
    word-wrap: break-word;
}

.bin-container-container {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    /* background-color: red; */
}

.bin-container {
    display: flex;
    /* flex-grow: 0; */
    width: 150px;
    flex-direction: column;
    gap: 20px;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.left-bin-container > .bin:first-child {
    /* border-top-left-radius: 20px; */
}

.left-bin-container > .bin:last-child {
    /* border-bottom-left-radius: 20px; */
}

.right-bin-container > .bin:first-child {
    /* border-top-right-radius: 20px; */
}

.right-bin-container > .bin:last-child {
    /* border-bottom-right-radius: 20px; */
}

.bin {
    width: 100%;
    max-width: 150px;
    min-width: 90px;
    /* height: 150px; */
    flex-grow: 1;
    border-radius: 0px;
    background-color: #ffffff50;
    /* margin: 10px; */
    cursor: pointer;
}

.bin[data-answer="undefined"], .bin[data-answer=""] {
    display: none;
}

.bin:is(.correct, .bin.incorrect) * {
    transition: scale 0.5s ease-out;
    scale: 1.2;
}


.bin:hover {
    background-color: #ffffff80;
}

.bin.correct {
    background-color: #00ff0050 !important;
    /* color: green; */
}

.bin.incorrect {
    background-color: #ff000050 !important;
    /* color: red; */
}


.bin-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

img[src=''] {
    display: none;
}

.bin-text {
    text-wrap: balance;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 20px;
    pointer-events: none;

}

.bin-container-container.text-bins .bin-img {
    display: none;
}

.bin-container-container.img-bins .bin-text {
    display: none;
}

.rapid-game-stats-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    /* background-color: red; */
    height: 100%;
    max-width: 300px;
}

.rapid-streak-high-score.play-again {
    animation: flash 0.2s 3 linear, grow 0.5s infinite ease-in-out;
}

.rapid-x-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    align-items: center;
    width: 100%;
    /* height: 100%; */
    height: 40px;
    /* background-color: blue; */

}

.rapid-x {
    position: relative;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    background-color: white;
    border: 2px solid black;
}

.rapid-x.active {
    background-color: rgb(230, 8, 8);
    background-image: url(./res/x-mark.png);
    background-position: center;
    background-size: 75%;
    backdrop-filter: invert;
    background-repeat: no-repeat;
}

/* .rapid-x.active::before {
    content: "X";
    position: absolute;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    font-size: 30px;
    text-align: center;
} */


.rapid-streak-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    /* background-color: red; */
    width: 100%;
}

.rapid-streak-text-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 80px;
}

#rapid-streak-flame-img {
    height: 70%;
    object-fit: contain;
    margin-right: 10px
}

.rapid-streak-high-score {
    margin: 20px 0 -20px 0;
}

#rapid-streak-number {
    font-size: 36px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

#rapid-streak-number.add-score::after {
    position: absolute;
    top: -100%;
    content: "+"attr(data-added-score);
    font-size: 20px;
    width: max-content;
    color: green;

    -webkit-animation-name: slideOutUp;
    animation-name: slideOutUp;
    -webkit-animation-duration: 1s;
    animation-duration: 1s;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
}

.streak-bar {
    width: 200px;
    height: 30px;
    border-radius: 15px;
    background-color: #ffffff50;
    overflow: hidden;
}

.streak-bar-fill {
    height: 100%;
    background-image: linear-gradient(90deg,rgb(245, 243, 190), rgb(255, 216, 78), rgb(254, 150, 46), rgb(254, 67, 29) 150px);
    width: 50%;
    /* transition: width 0.5s ease-out; */
}

#rapid-tutorial-playing-img {
    height: 300px !important;
}

.rapid-share-container:not(.play-again) {
    display: none;
}

#share-button {
    cursor: pointer;
    display: flex;
    /* height: 30px; */
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: max-content;
    padding: 8px;
    border-radius: 10px;
    font-size: 20px;
    gap: 5px;
    color: black;
    background-color: white;
}

.rapid-card-safe-area {
    height: calc(100% - 10px);
    padding-top: 10px;
}

@media (max-width: 650px) {
    .bin-container-container {
        gap: 20px;
        max-width: 90vw;
    }

    .bin-container {
        flex-grow: 1;
        width: 0;
    }
    .bin {
        max-width: 100%;
    }

    .rapid-game-stats-container {
        width: 120px;
        flex-grow: 1;
    }

    .rapid-x {
        width: 25px;
        height: 25px;
    }

    .rapid-x-container {
        flex-wrap: wrap;
        max-width: 100%;
    }

    .rapid-card {
        width: 130px;
        height: 130px;
    }

    #rapid-streak-number {
        font-size: 26px;
    }
    
    #rapid-streak-flame-img {
        height: 50%;
    }

    .streak-bar {
        width: 130px;
    }
}

.slideInLeft {
    -webkit-animation-name: slideInLeft;
    animation-name: slideInLeft;
    -webkit-animation-duration: 1s;
    animation-duration: 1s;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
}
@-webkit-keyframes slideInLeft {
    0% {
        -webkit-transform: translateX(-100%);
        transform: translateX(-100%);
        visibility: visible;
    }
    100% {
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }
}
@keyframes slideInLeft {
    0% {
        -webkit-transform: translateX(-100%);
        transform: translateX(-100%);
        visibility: visible;
    }
    100% {
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }
} 

.slideOutRight {
    -webkit-animation-name: slideOutRight;
    animation-name: slideOutRight;
    -webkit-animation-duration: 1s;
    animation-duration: 1s;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
}
@-webkit-keyframes slideOutRight {
    0% {
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }
    100% {
        visibility: hidden;
        -webkit-transform: translateX(100%);
        transform: translateX(100%);
    }
}
@keyframes slideOutRight {
    0% {
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }
    100% {
            visibility: hidden;
            -webkit-transform: translateX(100%);
            transform: translateX(100%);
    }
} 


.slideOutUp {
    -webkit-animation-name: slideOutUp;
    animation-name: slideOutUp;
    -webkit-animation-duration: 1s;
    animation-duration: 1s;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
}
@-webkit-keyframes slideOutUp {
    0% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
    100% {
        visibility: hidden;
        -webkit-transform: translateY(-100%);
        transform: translateY(-100%);
    }
}
@keyframes slideOutUp {
    0% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        visibility: hidden;
        -webkit-transform: translateY(-100%);
        transform: translateY(-100%);
        opacity: 0;
    }
}

@keyframes flash {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

@keyframes grow {
    0% {
        scale: 1;
    }
    50% {
        scale: 1.1;
    }
    100% {
        scale: 1;
    }
}
