@keyframes krathongFloat {
    0% {
        transform: rotate(0deg) translateY(0px);
    }

    10% {
        transform: rotate(5deg) translateY(5px);
    }

    13% {
        transform: rotate(5deg) translateY(5px);
    }

    30% {
        transform: rotate(-5deg) translateY(0px);
    }

    33% {
        transform: rotate(-5deg) translateY(0px);
    }

    50% {
        transform: rotate(5deg) translateY(5px);
    }

    53% {
        transform: rotate(5deg) translateY(5px);
    }

    70% {
        transform: rotate(-5deg) translateY(0px);
    }

    73% {
        transform: rotate(-5deg) translateY(0px);
    }

    90% {
        transform: rotate(5deg) translateY(5px);
    }

    93% {
        transform: rotate(5deg) translateY(5px);
    }

    100% {
        transform: rotate(0deg) translateY(0px);
    }
}

@keyframes krathongMove {
    0% {
        opacity: 0;
        transform: translateX(-200px);
    }

    1% {
        opacity: 1;
    }

    99% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateX(2000px);
    }
}

.krathongMove {
    opacity: 0;
    animation: 60s cubic-bezier(0.4, 0, 0.25, 1) 0s infinite normal none running krathongMove;
}

.krathongWrapper {
    width: 200px;
    position: relative;
    animation: 12s cubic-bezier(0.4, 0, 0.25, 1) 0s infinite normal none running krathongFloat;
    height: 150px;
}

.krathongWrapper>img {
    width: 100%;
    position: absolute;
}

.krathongWrapper>.krathong {
    z-index: 31;
}

/* .krathongWrapper>.krathongFront {
    z-index: 33;
    top: 43px;
}

.krathongWrapper>.krathongBack {
    z-index: 31;
}

.krathongWrapper>.krathongInner {
    z-index: 32;
    height: 50px;
    top: 40px;
    left: 50%;
    right: 50%;
    transform: translateX(-50%);
} */
/* 
.krathongWrapper>.wishKra {
    z-index: 35;
    background: rgba(255, 255, 255, .6);
    border-radius: 10px;
    width: 110%;
    padding: 10px;
    color: #333;
    bottom: 170px;
    position: absolute;
    opacity: 1;
    transition: .2s cubic-bezier(0.4, 0, 0.25, 1);
}

.krathongWrapper:hover>.wishKra {
    opacity: 1;
    transition: .2s cubic-bezier(0.4, 0, 0.25, 1);
}

.krathongWrapper:hover>.wishKra.active,
.krathongWrapper>.wishKra.active {
    transform: ;
    width: fit-content;
    max-width: 110%;
    z-index: 35;
    background: rgba(255, 255, 255, .6);
    border-radius: 10px;
    width: 110%;
    padding: 10px;
    color: #333;
    bottom: 170px;
    position: absolute;
    left: 50%;
    opacity: 1;
    transition: .2s cubic-bezier(0.4, 0, 0.25, 1);
} */

.wishBubble {
    position: absolute;
    top: 0px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    border-radius: 15px;
    padding: 5px 10px;
    font-size: 1.255rem;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    z-index: 34;
    position: relative;
    /* max-width: 200px; */
    white-space: normal;
    word-break: break-word;
}

/* สร้างหางของ bubble */
.wishBubble::after {
    content: "";
    position: absolute;
    bottom: -6px;
    /* ตำแหน่งหางให้เชื่อมกับ bubble */
    left: 20px;
    /* ปรับตำแหน่งหางให้ตรงกับความต้องการ */
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(255, 255, 255, 0.9);
}


.nameBubble {
    position: absolute;
    bottom: -30px;
    /* เลื่อน bubble ลงใต้กระทง */
    right: -10px;
    background-color: #ffcc00;
    color: #333;
    border-radius: 15px;
    padding: 5px 10px;
    font-size: 1.2em;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    z-index: 59;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1; /* Limits to 1 line */
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    white-space: normal;
    
    /* Size constraints */
    max-width: 155px;
    max-height: 2.4em; /* Adjusted for single line */
    line-height: 1.2em;
    
}
