:root {
    --sidebar-top: 0px;
}
#user-sidebar {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}
.sidebar-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: var(--sidebar-top);
    background: rgba(4, 4, 4, 0.85);
}
.sidebar-panel {
    position: fixed;
    left: 0;
    top: var(--sidebar-top);
    height: calc(100vh - var(--sidebar-top));
    width: min(380px, 100vw);
    background: rgba(4, 4, 4, 0.85);
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-sizing: border-box;
    overflow-y: auto;
}
#user-sidebar.open .sidebar-panel {
    transform: translateX(0);
}
/* кнопка закриття */
#sidebar-close {
    cursor: pointer;
    font-size: 22px;
    position: absolute;
    right: 15px;
    top: 10px;
    color: #e8e1d6;
}
/* блоки sidebar */
.sidebar-block {
    display: flex;
    flex-direction: column;
}
/* рівні міжрядкові відступи всередині всіх блоків */
.sidebar-block > * + * {
    margin-top: 14px;
}
/* якщо всередині вкладений контейнер (#sidebar-user або #sidebar-guest) */
.sidebar-block > div {
    display: flex;
    flex-direction: column;
}
.sidebar-block > div > * + * {
    margin-top: 14px;
}
/* відступ між блоками */
.sidebar-block + .sidebar-block {
    margin-top: 26px;
}
/* посилання */
.sidebar-block a {
    display: block;
    color: #e8e1d6;
    text-decoration: none;
    font-size: 15px;
    white-space: nowrap;
}
.sidebar-block a:hover {
    opacity: 0.75;
}
/* кнопки */
.sidebar-block button {
    display: block;
    width: 100%;
    text-align: left;
}
/* кнопка logout */
#sidebar-logout .buy-btn {
    width: 100%;
}
/* ім’я та знижка */
#sidebar-user-name,
#sidebar-user-discount {
    color: #e8e1d6;
    line-height: 1.45;
}
#sidebar-user-name {
    font-size: 16px;
    font-weight: 500;
    margin-top: 6px;
}
#sidebar-user-discount {
    font-size: 15px;
    opacity: 0.95;
    margin-top: 8px;
}
#sidebar-user-next-level {
    font-size: 15px;
    line-height: 1.35;
    color: #e8e1d6;
    opacity: 0.95;
    margin-top: 6px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;

    min-height: 48px;
    padding: 10px 14px;
    border-radius: 14px;

    color: #e8e1d6;
    text-decoration: none;
    transition: background 0.25s ease, opacity 0.25s ease;
}
.sidebar-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    top: 3px;
}
.sidebar-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}
.sidebar-label {
    font-size: 15px;
    line-height: 1.2;
}
.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
}
.sidebar-link.is-active {
    background: rgba(255, 255, 255, 0.10);
}
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sidebar-link {
    min-height: 52px;
    padding: 12px 14px;
    border-radius: 16px;
}
.sidebar-label {
    font-size: 15px;
    line-height: 1.25;
}
.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.10);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.sidebar-link.is-active {
    background: rgba(255, 255, 255, 0.11);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        0 8px 20px rgba(0, 0, 0, 0.16);
}
.sidebar-block:first-child {
    margin-bottom: 10px;
}
#sidebar-logout {
    margin-top: auto;
    padding-top: 102px;
}
#sidebar-logout .buy-btn {
    border-radius: 16px;
}
.sidebar-profile {
    align-items: flex-start;
    margin-bottom: 12px;
}
.sidebar-avatar-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 36px;
}
.sidebar-avatar-label {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-decoration: none;
    position: relative;
}
.sidebar-avatar {
    width: 200px;
    height: 200px;
    min-width: 200px;
    min-height: 200px;
    border-radius: 50%;

    display: block;
    overflow: hidden;

    object-fit: cover;
    object-position: center;

    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.03),
        0 10px 24px rgba(0, 0, 0, 0.22);
    background: rgba(255, 255, 255, 0.04);
}
.sidebar-status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;
    background: #f2e6c9;
    color: #111;
    border: 1px solid rgba(17, 17, 17, 0.08);

    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.04em;

    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);

    z-index: 2;
    pointer-events: none;
}

.sidebar-status-badge.is-friends {
    min-width: auto;
    width: auto;
    height: auto;
    padding: 0;

    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;

    top: -6px;
    right: -6px;

    line-height: 0;
    color: transparent;
    filter: none;
}

.sidebar-status-badge.is-friends svg {
    display: block;
    width: 58px;
    height: 58px;
    overflow: visible;
}
.sidebar-status-badge.is-partners {
    min-width: auto;
    width: auto;
    height: auto;
    padding: 0;

    top: 2px;
    right: -4px;

    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;

    display: inline-block;
    line-height: 1;
    z-index: 3;

    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;

    background-image: linear-gradient(
        180deg,
        #fffdf2 0%,
        #fff3c9 16%,
        #f4d989 36%,
        #d9ae4d 56%,
        #fff1be 72%,
        #c78723 88%,
        #8a5712 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;

    text-shadow:
        0 1px 0 rgba(255,255,255,0.62),
        0 0 6px rgba(255, 236, 170, 0.48),
        0 0 14px rgba(255, 214, 112, 0.42),
        0 3px 8px rgba(92, 59, 10, 0.28);

    filter:
        drop-shadow(0 1px 3px rgba(0,0,0,0.18))
        drop-shadow(0 0 8px rgba(255, 224, 130, 0.34))
        drop-shadow(0 0 16px rgba(244, 201, 94, 0.22));
}
.sidebar-avatar-edit {
    font-size: 13px;
    line-height: 1.2;
    color: #e8e1d6;
    opacity: 0.82;
    transition: opacity 0.25s ease;
}
.sidebar-avatar-label:hover .sidebar-avatar-edit {
    opacity: 1;
}
.sidebar-panel {
    scrollbar-width: thin;
    scrollbar-color: rgba(232, 225, 214, 0.35) transparent;
}
.sidebar-panel::-webkit-scrollbar {
    width: 8px;
}
.sidebar-panel::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-panel::-webkit-scrollbar-thumb {
    background: rgba(232, 225, 214, 0.28);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.sidebar-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(232, 225, 214, 0.45);
    background-clip: padding-box;
}
/* прибрати синє підсвічування при тапі */
.sidebar-link,
.sidebar-link *,
.sidebar-block button,
#sidebar-close,
.sidebar-avatar-upload,
.sidebar-avatar-label,
.sidebar-avatar-preview,
#sidebar-avatar-input {
    -webkit-tap-highlight-color: transparent;
}
/* не давати тексту виділятись при тапі */
.sidebar-link,
.sidebar-avatar-label {
    user-select: none;
    -webkit-user-select: none;
}
/* без обводки при тапі/фокусі */
.sidebar-link:focus,
.sidebar-link:active,
.sidebar-avatar-label:focus,
.sidebar-avatar-label:active,
.sidebar-block button:focus,
.sidebar-block button:active,
#sidebar-close:focus,
#sidebar-close:active {
    outline: none;
}
