body {
    background-image: linear-gradient(
        hsl(var(--sl-hue), var(--sl-sat), 90%),
        hsl(var(--sl-hue), var(--sl-sat), 75%)
    );
}

.cake_root {
    width: 100%;
    height: 100vh;
    background-image: linear-gradient(
        hsl(var(--sl-hue), var(--sl-sat), 90%),
        hsl(var(--sl-hue), var(--sl-sat), 75%)
    );
}

.cake_root.hidden {
    opacity: 0;
    transition: opacity 3.5s ease;
}

.cake_root.show {
    opacity: 1;
}

.cake {
    position: absolute;
    width: 250px;
    height: 200px;
    top: 50%;
    left: 50%;
    margin-top: -70px;
    margin-left: -125px;
}

.plate {
    width: 270px;
    height: 110px;
    position: absolute;
    bottom: -10px;
    left: -10px;
    background-color: #ccc;
    border-radius: 50%;
    /* Nilai darken(#ccc, 10%) ~ #b3b3b3 */
    box-shadow:
        0 2px 0 #b3b3b3,
        0 4px 0 #b3b3b3,
        0 5px 40px rgba(0, 0, 0, 0.5); /* rgba(black, 0.5) */
}

.cake > * {
    position: absolute;
}

.layer {
    position: absolute;
    display: block;
    width: 250px;
    height: 100px;
    border-radius: 50%;

    /* Mengganti @include foodColoring($chocolate) */
    /* $chocolate adalah #553c13 */
    background-color: #553c13;
    box-shadow:
        /* lighten(#553c13, 5%) ~ #735730 */
        0 2px 0px #735730,
        /* darken(#553c13, 8.2%) ~ #3a280e */
        0 4px 0px #3a280e,
        /* darken(#553c13, 8.4%) ~ #3a280e */
        0 6px 0px #3a280e,
        /* darken(#553c13, 8.6%) ~ #39270e */
        0 8px 0px #39270e,
        /* darken(#553c13, 8.8%) ~ #39270d */
        0 10px 0px #39270d,
        /* darken(#553c13, 9%) ~ #38260d */
        0 12px 0px #38260d,
        /* darken(#553c13, 9.2%) ~ #38260c */
        0 14px 0px #38260c,
        /* darken(#553c13, 9.4%) ~ #37250c */
        0 16px 0px #37250c,
        /* darken(#553c13, 9.6%) ~ #37250c */
        0 18px 0px #37250c,
        /* darken(#553c13, 9.8%) ~ #36240b */
        0 20px 0px #36240b,
        /* darken(#553c13, 10%) ~ #36240b */
        0 22px 0px #36240b,
        /* darken(#553c13, 10.2%) ~ #35230a */
        0 24px 0px #35230a,
        /* darken(#553c13, 10.4%) ~ #35230a */
        0 26px 0px #35230a,
        /* darken(#553c13, 10.6%) ~ #34220a */
        0 28px 0px #34220a,
        /* darken(#553c13, 10.8%) ~ #342209 */
        0 30px 0px #342209;
}

.layer-top { top: 0px; }
.layer-middle { top: 33px; }
.layer-bottom { top: 66px; }

.icing {
    top: 2px;
    left: 5px;
    background-color: #f0e4d0; /* Menggunakan nilai $vanilla */
    width: 240px;
    height: 90px;
    border-radius: 50%;
    /* &:before dipindahkan ke .icing:before */
}

.icing:before {
    content: "";
    position: absolute;
    top: 4px;
    right: 5px;
    bottom: 6px;
    left: 5px;
    background-color: #f3ead8; /* lighten($vanilla, 3%) ~ #f3ead8 */
    box-shadow:
        0 0 4px #f5eddf, /* lighten($vanilla, 5%) ~ #f5eddf */
        0 0 4px #f5eddf, /* lighten($vanilla, 5%) ~ #f5eddf */
        0 0 4px #f5eddf; /* lighten($vanilla, 5%) ~ #f5eddf */
    border-radius: 50%;
    z-index: 1;
}

.drip {
    display: block;
    width: 50px;
    height: 60px;
    border-bottom-left-radius: 25px;
    border-bottom-right-radius: 25px;
    background-color: #f0e4d0; /* Menggunakan nilai $vanilla */
}

.drip1 {
    top: 53px;
    left: 5px;
    transform: skewY(15deg);
    height: 48px;
    width: 40px;
}

.drip2 {
    top: 69px;
    left: 181px;
    transform: skewY(-15deg);
}

.drip3 {
    top: 54px;
    left: 90px;
    width: 80px;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
}

.candle {
    background-color: #7B020B;
    width: 16px;
    height: 50px;
    border-radius: 8px / 4px;
    top: -20px;
    left: 50%;
    margin-left: -8px;
    z-index: 10;
    /* &:before dipindahkan ke .candle:before */
}

.candle:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 16px;
    height: 8px;
    border-radius: 50%;
    background-color: #92020e; /* lighten(#7B020B, 10%) ~ #92020e */
}

.flame {
    position: absolute;
    background-color: orange;
    width: 15px;
    height: 35px;
    border-radius: 10px 10px 10px 10px / 25px 25px 10px 10px;
    top: -34px;
    left: 50%;
    margin-left: -7.5px;
    z-index: 10;
    box-shadow:
        0 0 10px rgba(255, 165, 0, 0.5), /* rgba(orange, 0.5) */
        0 0 20px rgba(255, 165, 0, 0.5),
        0 0 60px rgba(255, 165, 0, 0.5),
        0 0 80px rgba(255, 165, 0, 0.5);
    transform-origin: 50% 90%;
    animation: flicker 1s ease-in-out alternate infinite;
}

@keyframes flicker {
    0% {
        transform: skewX(5deg);
        /* rgba(orange, 0.2) */
        box-shadow:
            0 0 10px rgba(255, 165, 0, 0.2),
            0 0 20px rgba(255, 165, 0, 0.2),
            0 0 60px rgba(255, 165, 0, 0.2),
            0 0 80px rgba(255, 165, 0, 0.2) }
    25% {
        transform: skewX(-5deg);
        /* rgba(orange, 0.5) */
        box-shadow:
            0 0 10px rgba(255, 165, 0, 0.5),
            0 0 20px rgba(255, 165, 0, 0.5),
            0 0 60px rgba(255, 165, 0, 0.5),
            0 0 80px rgba(255, 165, 0, 0.5) }
    50% {
        transform: skewX(10deg);
        /* rgba(orange, 0.3) */
        box-shadow:
            0 0 10px rgba(255, 165, 0, 0.3),
            0 0 20px rgba(255, 165, 0, 0.3),
            0 0 60px rgba(255, 165, 0, 0.3),
            0 0 80px rgba(255, 165, 0, 0.3) }
    75% {
        transform: skewX(-10deg);
        /* rgba(orange, 0.4) */
        box-shadow:
            0 0 10px rgba(255, 165, 0, 0.4),
            0 0 20px rgba(255, 165, 0, 0.4),
            0 0 60px rgba(255, 165, 0, 0.4),
            0 0 80px rgba(255, 165, 0, 0.4) }
    100% {
        transform: skewX(5deg);
        /* rgba(orange, 0.5) */
        box-shadow:
            0 0 10px rgba(255, 165, 0, 0.5),
            0 0 20px rgba(255, 165, 0, 0.5),
            0 0 60px rgba(255, 165, 0, 0.5),
            0 0 80px rgba(255, 165, 0, 0.5) }
}


.wish_btn {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 28px;
    font-size: 20px;
    border-radius: 12px;
    border: none;
    background: #ff4d6d;
    color: white;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 100, 120, 0.5);
    transition: opacity 1.5s ease, transform 0.5s ease;
}

.wish_btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.wish_btn.show {
    opacity: 1;
    transform: translateX(-50%) scale(1.05);
}

.flame.extinguish {
    animation: none !important;
    opacity: 0;
    transform: scale(0.5) translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.smoke {
    position: absolute;
    top: -45px;
    left: 50%;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    background: rgba(200, 200, 200, 0.6);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.smoke.show-smoke {
    animation: smokeUp 1.5s ease-out forwards;
}

@keyframes smokeUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }
    80% {
        transform: translateY(-25px) scale(1.6);
        opacity: 0.5;
    }
    100% {
        transform: translateY(-40px) scale(2);
        opacity: 0;
    }
}

.cake_root.fade-out {
    opacity: 0;
    transition: opacity 3s ease;
}
