/* Compact server and account controls shown five seconds after the main UI opens. */
.server-status,
.user-info {
    box-sizing: border-box;
}

.server-status {
    transition:
        width .55s cubic-bezier(.22, 1, .36, 1),
        min-width .55s cubic-bezier(.22, 1, .36, 1),
        max-width .55s cubic-bezier(.22, 1, .36, 1),
        height .55s cubic-bezier(.22, 1, .36, 1),
        padding .55s cubic-bezier(.22, 1, .36, 1),
        gap .4s ease,
        color .25s ease,
        background-color .25s ease,
        border-color .25s ease,
        box-shadow .25s ease;
    overflow: hidden;
}

.server-status #serverStatusText {
    display: block;
    max-width: 210px;
    white-space: nowrap;
    opacity: 1;
    transition: max-width .42s ease, opacity .2s ease;
}

.server-status.is-compact {
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 46px !important;
    padding: 0 !important;
    gap: 0 !important;
    justify-content: center;
    border-radius: 50% !important;
}

.server-status.is-compact #serverStatusText {
    max-width: 0;
    opacity: 0;
}

.server-status.is-compact .status-dot {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    animation: none;
}

.server-status.is-compact.online {
    color: #fff !important;
    background: #16a34a !important;
    border-color: #15803d !important;
    box-shadow: 0 10px 26px rgba(22, 163, 74, .3), 0 0 0 4px rgba(34, 197, 94, .15) !important;
}

.server-status.is-compact.online .status-dot {
    background: #fff !important;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, .2) !important;
}

.server-status.is-compact.offline {
    color: #fff !important;
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    box-shadow: 0 10px 26px rgba(220, 38, 38, .28), 0 0 0 4px rgba(239, 68, 68, .13) !important;
}

.server-status.is-compact.offline .status-dot {
    background: #fff !important;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, .18) !important;
}

.server-status.is-compact.connecting {
    color: #fff !important;
    background: #d97706 !important;
    border-color: #b45309 !important;
    box-shadow: 0 10px 26px rgba(217, 119, 6, .27), 0 0 0 4px rgba(245, 158, 11, .14) !important;
}

.server-status.is-compact.connecting .status-dot {
    background: #fff !important;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, .18) !important;
}

.user-info {
    overflow: hidden;
    transition:
        width .55s cubic-bezier(.22, 1, .36, 1),
        min-width .55s cubic-bezier(.22, 1, .36, 1),
        height .55s cubic-bezier(.22, 1, .36, 1),
        padding .55s cubic-bezier(.22, 1, .36, 1),
        gap .4s ease,
        border-radius .55s cubic-bezier(.22, 1, .36, 1),
        opacity .18s ease,
        transform .18s ease,
        visibility .18s ease !important;
}

.user-info .user-avatar,
.user-info .user-details {
    transition: max-width .38s ease, opacity .2s ease, transform .38s ease;
}

.user-info.is-compact {
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 46px !important;
    padding: 0 !important;
    gap: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, .98) !important;
    border: 2px solid #60a5fa !important;
    box-shadow: 0 10px 28px rgba(37, 99, 235, .22), 0 0 0 4px rgba(96, 165, 250, .12) !important;
}

.user-info.is-compact .user-avatar,
.user-info.is-compact .user-details {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    margin: 0 !important;
    opacity: 0;
    overflow: hidden;
    transform: scale(.72);
    pointer-events: none;
}

.user-info.is-compact .logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    color: #2563eb;
    font-size: 18px;
    background: transparent;
}

.user-info.is-compact .logout-btn:hover,
.user-info.is-compact .logout-btn:focus-visible {
    color: #fff;
    background: #dc2626;
    outline: none;
}

/* The compact exit control remains available while the page is scrolled. */
.user-info.is-compact.user-info-hidden {
    opacity: 1;
    transform: none;
    visibility: visible;
    pointer-events: auto;
}

@media (max-width: 860px) {
    .user-info.is-compact {
        position: fixed !important;
        top: 14px !important;
        right: 14px !important;
        left: auto !important;
        margin: 0 !important;
    }

    .server-status.is-compact {
        left: 14px !important;
        right: auto !important;
        bottom: 14px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .server-status,
    .server-status #serverStatusText,
    .user-info,
    .user-info .user-avatar,
    .user-info .user-details {
        transition-duration: .01ms !important;
    }
}
