#kankkulas-well {
    margin: 16px 16px 48px 16px;
    max-width: 500px;

    > button {
        width: 100%;
        font-weight: 500;
        height: 40px;

        img {
            height: 22px;
            margin-left: 8px;
        }

        &.waiting img {
            animation: rotate 1s 0.2s infinite linear;
        }
    }

    #well {
        margin: 24px auto 12px auto;
        position: relative;
        display: flex;
        container: well / inline-size;
        overflow: hidden;

        .coin {
            animation: coinRise 0.15s 0.2s forwards linear, coinFlight 0.4s 1.35s linear;
            position: absolute;
            right: 68%;
            top: 58%;
            z-index: 3;
            width: 6cqw;
            aspect-ratio: 1;
        }
    }

    #background {
        z-index: 4;
        width: 100%;
    }

    #coins-thrown {
        position: absolute;
        right: 14%;
        bottom: 4%;
        border-radius: 10000px;
        padding: 1cqw 2cqw 1cqw 1cqw;
        background: var(--card-bg-color);
        border: 1cqw solid var(--card-border-color);
        z-index: 10;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 4cqw;

        img {
            width: 6cqw;
            aspect-ratio: 1;
        }
    }

    #seal {
        position: absolute;
        left: 20%;
        top: 40%;
        z-index: 2;
        width: 22%;

        &.throwing {
            animation: throw 1.8s forwards;
        }
    }

    .meta {
        color: var(--meta-info-color);
        font-size: 0.9rem;
        text-align: center;
    }

    .award-container {
        position: absolute;
        height: 100%;
        width: 100%;
        top: 0;
        left: 0;
        z-index: 6;
        opacity: 0;
        animation: show-award 10s forwards;
        animation-delay: 1.9s;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;

        &:last-of-type {
            z-index: 7;
        }

        &::after {
            content: "";
            position: absolute;
            height: 100%;
            width: 100%;
            top: 0;
            left: 0;
            z-index: 2;
            background: conic-gradient(
                var(--tag-gold-bg-color),
                var(--button-bg-color),
                var(--tag-gold-bg-color),
                var(--button-bg-color),
                var(--tag-gold-bg-color),
                var(--button-bg-color),
                var(--tag-gold-bg-color),
                var(--button-bg-color),
                var(--tag-gold-bg-color),
                var(--button-bg-color),
                var(--tag-gold-bg-color),
                var(--button-bg-color),
                var(--tag-gold-bg-color),
                var(--button-bg-color),
                var(--tag-gold-bg-color)
            );
            -webkit-mask-image: radial-gradient(circle at center, white 15%, transparent 60%);
            mask-image: radial-gradient(circle at center, white 15%, transparent 60%);
            animation: rotate 6s infinite linear reverse;
        }

        &::before {
            content: "";
            position: absolute;
            height: 100%;
            width: 100%;
            top: 0;
            left: 0;
            z-index: 4;
            animation: rotate 8s infinite linear;
            background-image: url("../img/star.svg");
            background-repeat: no-repeat;
            background-position: center;
            opacity: 0.9;
        }

        .award {
            z-index: 5;
            color: white;
            aspect-ratio: 1;
            display: flex;
            background: radial-gradient(var(--tag-gold-bg-color), transparent 66%);
            padding: 20px;

            img {
                margin: auto;
            }
        }
    }
}

@keyframes throw {
    5% { transform: translateY(0) }
    13% { transform: translateY(3%) }
    20% { transform: translateY(0) }
    75% { transform: translateY(0) }
    80% { transform: translate(10%, -5%) }
    100% { transform: translate(0) }
}

@keyframes coinRise {
    0% { transform: translate(0, 0) }
    100% { transform: translate(0, -100%) }
}

@keyframes coinFlight {
    0% { transform: translate(0, -100%); animation-timing-function: cubic-bezier(0.33333, 0.66667, 0.66667, 1); }
    10% { transform: translate(50%, -170%); }
    20% { transform: translate(100%, -230%); }
    30% { transform: translate(150%, -280%); }
    40% { transform: translate(200%, -290%); }
    50% { transform: translate(250%, -300%); animation-timing-function: cubic-bezier(0.33333, 0, 0.66667, 0.33333); }
    60% { transform: translate(300%, -290%); }
    70% { transform: translate(350%, -280%); }
    80% { transform: translate(400%, -230%); }
    90% { transform: translate(450%, -170%); }
    100% { transform: translate(500%, -50%); }
}

@keyframes show-award {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    4%, 96% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0);
    }
}

@keyframes rotate {
    from { transform: rotate(0deg) }
    to { transform: rotate(360deg) }
}
