/* =========================================================================
   socialbar.css - แถบแสดงจำนวนผู้เล่นที่กำลังออนไลน์ในเกม
   ========================================================================= */

.socialbar {
    position: fixed;
    top: 50%;
    right: 0;
    z-index: 990;
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 138px;
    min-height: 126px;
    padding: 0;
    background: linear-gradient(
        145deg,
        rgba(58, 65, 71, 0.98),
        rgba(35, 41, 46, 0.98)
    );
    border: 1px solid var(--color-border);
    border-right: 0;
    border-radius: 12px 0 0 12px;
    box-shadow: -5px 6px 18px rgba(0, 0, 0, 0.3);
    color: var(--color-text-muted);
    font-size: 0.82rem;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    transform: translate(94px, -50%);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    outline: none;
}

.socialbar:hover,
.socialbar:focus-visible,
.socialbar.is-open {
    box-shadow: -8px 8px 24px rgba(0, 0, 0, 0.38);
    transform: translate(0, -50%);
}

.socialbar-handle {
    position: relative;
    display: flex;
    flex: 0 0 44px;
    align-self: stretch;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.socialbar-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0.8rem 0.45rem;
}

.socialbar-icon {
    color: #60d879;
    font-size: 1.15rem;
}

.socialbar-dot {
    position: absolute;
    top: 10px;
    left: 50%;
    width: 8px;
    height: 8px;
    margin-left: -4px;
    border-radius: 50%;
    background-color: #45c55c;
    box-shadow: 0 0 0 rgba(69, 197, 92, 0.55);
    animation: socialbarPulse 1.8s ease-out infinite;
}

.socialbar-label {
    color: var(--color-text-light);
    font-weight: 500;
}

.socialbar-count {
    display: block;
    min-width: 2ch;
    margin-top: 0.25rem;
    color: #ff9b24;
    font-size: 1.55rem;
    font-weight: 700;
    text-align: center;
}

.socialbar-unit {
    margin-top: 0.05rem;
}

.socialbar.is-unavailable .socialbar-dot {
    background-color: #9ca3aa;
    box-shadow: none;
    animation: none;
}

.socialbar.is-unavailable .socialbar-icon,
.socialbar.is-unavailable .socialbar-count {
    color: #9ca3aa;
}

@keyframes socialbarPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(69, 197, 92, 0.55);
    }

    70% {
        box-shadow: 0 0 0 7px rgba(69, 197, 92, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(69, 197, 92, 0);
    }
}

@media (max-width: 575.98px) {
    .socialbar {
        width: 116px;
        min-height: 108px;
        padding: 0;
        border-radius: 10px 0 0 10px;
        font-size: 0.72rem;
        transform: translate(76px, -50%);
    }

    .socialbar:hover {
        transform: translate(76px, -50%);
    }

    .socialbar:focus-visible,
    .socialbar.is-open {
        transform: translate(0, -50%);
    }

    .socialbar-handle {
        flex-basis: 40px;
    }

    .socialbar-count {
        font-size: 1.25rem;
    }

    .socialbar-dot {
        top: 9px;
        left: 50%;
        width: 7px;
        height: 7px;
        margin-left: -3.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .socialbar-dot {
        animation: none;
    }
}
