.card-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    align-content: center;
    flex-direction: row;
}

.card-popup-content {
    position: fixed;
    bottom: 0;
    background-color: var(--background-color);
    border-radius: 2.525rem 2.525rem 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease, height 0.3s ease;
    height: 70dvh;
    overflow: hidden;
    width: -webkit-fill-available;
    -webkit-overflow-scrolling: touch;
    max-width: 26rem;
    max-height: calc(100dvh - var(--tg-content-safe-area-inset-top, 0px) - 50px);
    touch-action: pan-y pinch-zoom;
    border-top: 0.065rem solid var(--border-color);
}

.card-popup-handle {
    width: 40px;
    height: 4px;
    background-color: var(--text-color);
    z-index: 1;
    border-radius: 2px;
    margin: 8px auto;
    cursor: grab;
    position: absolute;
    left: calc(50% - 20px);
}

    .card-popup-handle:active {
        cursor: grabbing;
    }

.card-popup-inner-content {
    padding-top: 0;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background-color: var(--background-color);
    position: relative;
    touch-action: pan-y pinch-zoom;
    overscroll-behavior: contain;
}

.popup-buttons-container {
    display: flex;
    max-width: 90%;
    gap: 0.5rem;
    margin: 1rem auto;
    width: -webkit-fill-available;
    grid-template-columns: repeat(3, 1fr);
    flex-wrap: nowrap;
    align-items: center;
    justify-items: center;
    justify-content: center;
    flex-direction: row;
}

.popup-action-button {
    font-weight: 600;
    flex: 1;
    /* min-width: 100%; */
    padding: 0.3rem 0.5rem;
    border-radius: 2.5rem;
    background-color: var(--block-color);
    border: 0.065rem solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

    .popup-action-button:hover {
        background-color: var(--border-color);
    }

/* Стили для скролла */
.card-popup-inner-content::-webkit-scrollbar {
    width: 6px;
}

.card-popup-inner-content::-webkit-scrollbar-track {
    background: transparent;
}

.card-popup-inner-content::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

    .card-popup-inner-content::-webkit-scrollbar-thumb:hover {
        background-color: var(--primary-color);
    }

.popup-banner-container {
    position: relative;
    width: calc(100% + 30px); /* Adjust for padding to go full width */
    margin-left: -15px; /* Pull left to cover padding */
    margin-right: -15px; /* Pull right to cover padding */
    height: 200px; /* Example height for the banner area */
    background-color: var(--muted-color);
    overflow: hidden;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.popup-avatar-container {
    position: absolute;
    bottom: -45px;
    left: 32px;
    width: 100px;
    height: 100px;
    scale: 0.85;
    border-radius: 50%;
    background-color: var(--background-color);
    padding: 5px;
    box-shadow: 0 0 0 2px var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

#popup-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.popup-user-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 40px; /* Space for the avatar to overlap */
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.popup-stats-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    width: 100%; /* Take full width */
    justify-content: flex-start; /* Align to start */
}

.popup-about-section,
.popup-games-section {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

    .popup-about-section .ticket-about,
    .popup-games-section .ticket-about {
        margin-bottom: 10px;
    }

#popup-banner-card {
    /* overflow: hidden; */
    margin-bottom: 0.25rem;
    opacity: 1;
    border-radius: 2.525rem;
    border-bottom-right-radius: 0.5rem;
    /* border-bottom-right-radius: 0; */
    border-bottom-left-radius: 0.5rem;
    /* box-shadow: 0.25rem 0.25rem 0.3125rem #0000001c, inset 0.25rem 0.25rem 0.3125rem #00000033, inset -0.25rem -0.25rem 0.375rem #46464617; */
    width: 100%;
    aspect-ratio: 2.95;
    /* mask-image: linear-gradient(to bottom, transparent, white 10%, white 80%, transparent); */
    /* -webkit-mask-image: linear-gradient(to bottom, transparent, white 0%, white 76%, transparent); */
    /* background-color: #0000001c; */
    /* border: 0.0325rem solid var(--border-color); */
    /* padding: 1.1rem; */
    flex-shrink: 0;
    position: relative;
}

#popup-banner-img {
    opacity: 0.8;
    object-position: center;
    /* border-radius: 2.525rem; */
    aspect-ratio: 2.95;
    /* border-bottom-right-radius: 0; */
    /* border-bottom-left-radius: 0; */
    object-fit: cover;
    width: 100%;
    height: 100%;
    /*    padding: 0.325rem;*/
    border-radius: inherit;
}

#popup-ticket-user-info {
    margin-top: -0.2rem;
    font-size: 1.4rem;
    width: fit-content;
    /* height: 1rem; */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    align-content: center;
    flex-wrap: wrap;
    margin-left: 124px;
    /* margin-bottom: 1rem; */
    gap: 0.2rem;
    /* padding-top: 9rem; */
}

.popup-other-information {
    width: -webkit-fill-available;
    height: -webkit-fill-available;
}

.popup-stats {
    position: absolute;
    display: flex;
    gap: 0.3rem;
    right: 0rem;
    bottom: 0rem;
    border-top-left-radius: 0.6rem;
    background-color: var(--background-color);
    padding: 0.3rem;
}

#popup-ticket-likes-div {
    width: fit-content;
    height: 1.226rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 400;
    font-size: 0.9rem;
    align-content: center;
    flex-wrap: wrap;
    background-color: var(--border-color);
    border-radius: 0.35rem;
    padding: 0.4rem;
    /* box-shadow: inset 0.25rem 0.25rem 0.3125rem #0e0e0e42, inset -0.125rem -0.1875rem 0.1875rem #42424217; */
}

.about-text-popup {
    max-height: 10rem;
    font-weight: 400;
    /*    margin-bottom: 1rem;*/
    font-size: 1rem;
    /* margin: 0; */
    color: white;
    /* max-height: 11dvh; */
    /* height: 30%; */
    width: 90%;
    margin-left: 5%;
    /* max-width: 17rem; */
    /* margin: 1.25rem; */
    overflow-y: scroll;
    flex-shrink: 0;
    /* mask-image: linear-gradient(to bottom, transparent, white 10%, white 80%, transparent); */
    -webkit-mask-image: none; /* По умолчанию без маски */
    transition: -webkit-mask-image 0.3s ease;
}

    .about-text-popup.scrollable {
        -webkit-mask-image: linear-gradient( to bottom, transparent, white 5%, white 89%, transparent );
    }

.popup-block {
    background-color: var(--block-color);
    border-radius: 1rem;
    width: 90%;
    margin: auto;
    height: -webkit-fit-content;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.popup-ticket-about {
    color: var(--text-secondary-color);
    margin-left: 5%;
    font-size: 1rem;
    font-weight: 600;
}

#popup-ticket-nick {
    font-size: inherit;
    color: var(--text-color);
    margin-right: 0.4rem;
    font-weight: 500;
}

/*ACCOUNTS*/
/* Стили для блока аккаунтов */
.popup-block {
    margin-bottom: 1rem;
}

.popup-ticket-about {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.account-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, 1fr);
    width: 90%;
    margin-left: 5%;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary-color);
}

.account-element {
    height: 3rem;
    width: 100%;
    gap: 0.5rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    align-content: center;
    flex-direction: row;
    background: var(--border-color);
    border-radius: 16px;
    cursor: pointer;
}

.account-element-img {
    height: 2rem;
    width: fit-content;
    margin-left: 0.5rem;
}

    .account-element-img img {
        height: 100%;
    }

.account-element-text {
    color: var(--primary-color);
    font-weight: 600;
}
