.top-bar {
    position: fixed;
    top: calc(88px + env(safe-area-inset-top, 0px));
    left: 0;
    width: 100%;
    background: #0d111d;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 1000;
}

.top-bar::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    height: calc(88px + env(safe-area-inset-top, 0px));
    background: #0d111d;
    z-index: -1;
    pointer-events: none;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
}

.menu-btn span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: #ffffff;
    border-radius: 2px;
}

.top-bar-logo {
    height: 36px;
    object-fit: contain;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wallet-info {
    background: linear-gradient(90deg, #0d111d 2%, rgba(47, 91, 234, 0.4) 100%);
    border: none;
    padding: 8px 38px 8px 14px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    height: 42px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.wallet-info:active {
    transform: scale(0.98);
}

.wallet-info .ton-icon {
    width: 24px;
    height: 24px;
}

#balance-amount {
    color: #ffffff;
}

.balance-add-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(47, 91, 234, 0.5);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.balance-add-btn:active {
    transform: translateY(-50%) scale(0.9);
    background: rgba(47, 91, 234, 0.7);
}


.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2f5bea 0%, #0f1a4d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    font-weight: 700;
    border: none;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.user-avatar:active {
    transform: scale(0.95);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.side-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #0d111d;
    z-index: 2001;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding-top: calc(88px + env(safe-area-inset-top, 0px));
    border-right: none;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
}

.side-menu.show {
    transform: translateX(0);
}

.side-menu-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: none;
}

.side-menu-avatar {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2f5bea 0%, #0f1a4d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

.side-menu-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.side-menu-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.side-menu-name {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-menu-id {
    font-size: 13px;
    color: #8892b0;
    font-weight: 500;
}

.side-menu-links {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    gap: 8px;
    flex: 1;
}


.side-menu-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    color: #8892b0;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.side-menu-link:hover, .side-menu-link:active {
    background: rgba(47, 91, 234, 0.1);
    color: #ffffff;
}


.side-menu-link i {
    font-size: 22px;
    line-height: 1;
}

.side-menu-footer {
    padding: 0 20px 20px 20px;
    border-top: none;
}

.side-menu-support {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: #4ade80;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s;
}

.side-menu-support:hover, .side-menu-support:active {
    background: rgba(74, 222, 128, 0.1);
    opacity: 0.9;
}

.side-menu-support i {
    font-size: 22px;
    line-height: 1;
}