:root {
    --sb-size: 56px;
    --sb-icon-size: 30px;
    --sb-gap: 12px;
    --sb-bottom: 80px;
    --sb-right: 16px;
    --sb-bg-default: var(--color-bg-fixedbtn, #000000);
    --sb-fg-default: var(--color-fixedbtn, #ffffff);
    --sb-pulse: rgba(0, 0, 0, 0.45);
    --sb-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    --sb-stagger: 80ms;
    --sb-overshoot: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-bubble {
    position: fixed;
    right: var(--sb-right);
    bottom: var(--sb-bottom);
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.social-bubble * {
    box-sizing: border-box;
}

.social-bubble__list {
    list-style: none;
    margin: 0 0 var(--sb-gap) 0;
    padding: 0;
    display: flex;
    flex-direction: column-reverse;
    gap: var(--sb-gap);
}

.social-bubble__item {
    opacity: 0;
    transform: translateY(20px) scale(0.5);
    transition:
        opacity 280ms ease,
        transform 320ms var(--sb-overshoot);
    transition-delay: 0ms;
    pointer-events: none;
}

.social-bubble.is-open .social-bubble__item {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: calc(var(--sb-delay) * var(--sb-stagger));
    pointer-events: auto;
}

.social-bubble__link {
    width: var(--sb-size);
    height: var(--sb-size);
    border-radius: 50%;
    background: var(--sb-bg, transparent);
    color: var(--sb-fg-default);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 200ms ease;
}

.social-bubble__link:hover {
    transform: scale(1.06);
}

.social-bubble__link img,
.social-bubble__link svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.social-bubble__trigger {
    position: relative;
    width: var(--sb-size);
    height: var(--sb-size);
    border-radius: 50%;
    border: 0;
    padding: 0;
    cursor: pointer;
    background: transparent;
    color: var(--sb-fg-default);
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    animation:
        sb-idle-rotate 4s ease-in-out infinite,
        sb-idle-pulse 2s ease-out infinite;
}

.social-bubble.is-open .social-bubble__trigger {
    animation: none;
}

.social-bubble__icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        opacity 220ms ease,
        transform 260ms var(--sb-overshoot);
}

.social-bubble__icon img,
.social-bubble__icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    display: block;
}

.social-bubble__icon--open {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.social-bubble__icon--close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.social-bubble.is-open .social-bubble__icon--open {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.social-bubble.is-open .social-bubble__icon--close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

@keyframes sb-idle-rotate {
    0%, 100% { transform: rotate(-8deg); }
    50%      { transform: rotate(8deg); }
}

@keyframes sb-idle-pulse {
    0%   { box-shadow: 0 0 0 0 var(--sb-pulse); }
    70%  { box-shadow: 0 0 0 18px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

@media (max-width: 767px) {
    .social-bubble {
        --sb-size: 48px;
        --sb-icon-size: 25px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .social-bubble__trigger,
    .social-bubble.is-open .social-bubble__trigger {
        animation: none;
    }
    .social-bubble__item,
    .social-bubble__icon {
        transition: opacity 150ms ease;
        transform: none;
    }
    .social-bubble.is-open .social-bubble__item {
        transform: none;
    }
}
