.balloon {
    position: absolute;
    width: 70px;
    height: 90px;
    background: hsl(0, 70%, 80%);
    border-radius: 60% 60% 50% 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    overflow: visible;
}

.balloon img {
    width: 85%;
    height: auto;
    border-radius: 50%;
}

.balloon-string {
    position: absolute;
    width: 2px;
    height: 75px;
    background: #82FF2E;
    bottom: -75px;
    left: 50%;
    transform-origin: top;
    animation: string-snake 1.5s ease-in-out infinite;
}

@keyframes string-snake {
    0% {
        transform: translateX(-50%) rotate(0deg);
    }
    25% {
        transform: translateX(-50%) rotate(5deg);
    }
    50% {
        transform: translateX(-50%) rotate(-5deg);
    }
    75% {
        transform: translateX(-50%) rotate(8deg);
    }
    100% {
        transform: translateX(-50%) rotate(0deg);
    }
}

.fragment {
    position: absolute;
    width: 10px;
    height: 10px;
    background: hsl(0, 70%, 80%);
    border-radius: 50%;
    animation: explode 1s ease-out forwards;
}

.balloon-window {
    position: absolute;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 30px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    font-size: 15px;
    font-weight: bold;
    color: #ff69b4;
    z-index: 1000;
    text-align: center;
    animation: fade-in 0.5s ease-in-out;
}

@keyframes explode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(calc(120px - 60%), calc(-120px)) scale(0.5);
        opacity: 0;
    }
}

@keyframes fade-in {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.balloon-window .close-message {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff69b4;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
}

.balloon-window .close-message:hover {
    background: #ff85c0;
}
