:root {
    /* 
        fill – растягивает (искажает)
        contain – вписывает (без обрезки)
        cover – заполняет (с обрезкой)
        none – оригинальный размер
        scale-down – уменьшает (как none/contain)
    */       
        --object-fit-banner: fill;
        --grid-video-size: 250px; /*    Размер блоков в сетке    */
    }
    
    
    @media(max-width: 1020px){
        :root {--object-fit-banner: cover}    
    }
    
    #backgroundModal .modal-content::-webkit-scrollbar,
    .background-overlay-content::-webkit-scrollbar {
        width: 10px;
    }
    
    #backgroundModal .modal-content::-webkit-scrollbar-track,
    .background-overlay-content::-webkit-scrollbar-track {
        background: transparent;
        border-radius: 0;
    }
    
    #backgroundModal .modal-content::-webkit-scrollbar-thumb,
    .background-overlay-content::-webkit-scrollbar-thumb {
        background-color: #007bff;
        border-radius: 2px;
    }
    
    #backgroundModal .modal-content::-webkit-scrollbar-thumb:hover,
    .background-overlay-content::-webkit-scrollbar-thumb:hover {
        background-color: #207ab7;
    }
    
    .profile_animated_background {
        position: absolute;
        width: 100%;
        height: 100%;
        left: 0;
        top: 0;
        overflow: hidden;
        pointer-events: none;
    }
    
    .profile_animated_background > video {
        height: 100%;
        width: 100%;
        object-fit: var(--object-fit-banner);
    }
    
    .block-video {
        background: rgb(27, 29, 36);
        border-radius: 10px;
        padding: 17px;
        user-select: none;
        display: flex;
        flex-direction: column;
        gap: 7px;
    }
    
    .block-video .video-btn {
        position: relative;
        width: 100%;
        border-radius: 2px;
        background: rgba(93, 158, 255, 0.1);
        color: rgb(93, 158, 255) !important;
        border: none;
        border-radius: var(--bs-border-radius);
        height: auto;
        -webkit-backface-visibility: unset;
        outline: none;
        padding: 12px;
        color: #fff;
        font-size: 16px;
        font-weight: 400;
        font-family: inherit;
        -webkit-transform: unset;
        text-align: center;
        cursor: pointer;
        transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    }
    
    .block-video .video-btn:hover {
        background: rgb(93 158 255 / 25%);
    }
    
    .block-video .video-btn.dell {
        margin-top: 6px;
        background: rgb(251, 71, 75);
        color: #ffffff!important;
    }
    
    .block-video .video-btn.dell:hover {
        background: rgb(182, 65, 68);
    }
    
    .block-video .video-btn.buy {
        margin-top: 6px;
        background: rgb(251, 71, 75);
        color: #ffffff!important;
    }
    
    .block-video .video-btn.buy:hover {
        background: rgb(182, 65, 68);
    }
    
    #backgroundModal .modal-dialog {
        max-width: 80vw;
        width: auto;
        height: auto;
    }
    
    #backgroundModal .modal-header {
        padding-bottom: 40px;
    }
    
    #backgroundModal .modal-title {
        color: #7289da;
        font-size: 1.5rem;
        text-align: center;
        letter-spacing: -0.5px;
    }
    
    #backgroundModal .modal-content {
        max-height: 92vh;
        overflow-y: auto;
        background: radial-gradient(63.94% 1024px at 50% 200px, #244372 0%, #161A1F 100%);
        overflow-x: hidden;
    }
    
    #backgroundPreviews {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(var(--grid-video-size), 1fr));
        gap: 20px;
        padding: 0;
    }
    
    .background-item {
        position: relative;
        border-radius: 5px;
        overflow: hidden;
        padding: 10px;
        box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .14), 0 2px 1px -1px rgba(0, 0, 0, .12), 0 1px 3px 0 rgba(0, 0, 0, .2);
        display: flex;
        flex-direction: column;
        z-index: 1;
        background: radial-gradient(63.94% 1024px at 50% 200px, #244372 0%, #161A1F 100%);
        cursor: pointer;
        -webkit-backdrop-filter: blur(20px) saturate(180%) brightness(60%);
        backdrop-filter: blur(20px) saturate(180%) brightness(60%);
        justify-content: space-evenly;
        perspective-origin: inherit;
        transition-duration: .4s;
        transition-timing-function: cubic-bezier(0, 0.73, 0.48, 1);
        transition-property: transform;
        transform-origin: 50% 50%;
    }
    
    .background-preview {
        width: 100%;
        height: 150px;
        position: relative;
    }
    
    .background-item:hover {
        filter: brightness(1.1) contrast(0.95) saturate(1);
        transform: scale(1.3);
        z-index: 2;
        box-shadow: 3px 8px 8px 3px rgba(0, 0, 0, .596);
    }
    
    .background-preview video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        z-index: 1;
        opacity: 0;
        transition: opacity 0.2s ease-in-out;
    }
    
    .background-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        position: relative;
        z-index: 2;
    }
    
    .background-info {
        padding: 10px 10px 0 10px;
        text-align: center;
    }
    
    .background-name {
        font-weight: bold;
        color: #c5cbd8;
        text-transform: uppercase;
        letter-spacing: 1.2px;
        text-align: center;
        margin-bottom: 15px;
    }
    
    #backgroundModal .modal-header .close {
        position: absolute;
        border: none;
        top: 9px;
        right: 10px;
        z-index: 10;
        background: linear-gradient(0deg, #3D4450, #3D4450);
        border-radius: 6px;
        color: #efeaea;
        padding: 12px 25px;
        font-size: 1rem;
        font-weight: 400;
        letter-spacing: 1.5px;
        height: auto !important;
        width: auto !important;
        letter-spacing: 1px;
        transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    }
    
    #backgroundModal .modal-header .close:hover {
        background: rgb(182, 65, 68);
    }
    
    .background-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.8);
        display: none;
        z-index: 2000;
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
    }
    
    .background-overlay.open {
        opacity: 1;
    }
    
    .background-overlay-content {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        border-radius: 5px;
        max-width: 90%;
        border-radius: 20px;
        max-height: 80%;
        width: auto!important;
        overflow: auto;
        padding: 20px 25px;
        background: url(../assets/diamonds_tile.png) no-repeat, radial-gradient(100% 1000px at 20% 0px, #182333 5%, #171c22 100%);
        background-size: 100%;
        background-position: center top;
    }
    
    .background-overlay-content video {
        width: 100%
    }
    
    #notification-container {
        position: fixed;
        bottom: 50px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 2001;
    }
    
    #notification-container .notification {
        background-color: rgba(255, 255, 255, 0.9);
        color: #333;
        padding: 10px 20px;
        border-radius: 5px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
        margin-bottom: 10px;
    }
    
    #notification-container .notification.show {
        opacity: 1;
    }
    
    #notification-container .notification.success {
        background-color: rgba(144, 238, 144, 0.9);
        color: #228B22;
    }
    
    #notification-container .notification.error {
        background-color: rgba(240, 128, 128, 0.9);
        color: #B22222;
    }
    
    .background-overlay .btn-group {
        margin-top: 20px;
        width: 100%;
        gap: 10px;
    }
    
    .background-overlay .btn-group .video-btn.back {
        width: 30%;
        background: linear-gradient(0deg, #25282d, #24272d), #353535;
        color: #efeaea!important;
    }
    
    .background-overlay .btn-group .video-btn.back:hover {
        background: linear-gradient(0deg, #424956, #454f60), #3b9dee;
    }
    
    .bottom_under {
        position: relative;
    }
    
    @media(max-width:992px) {
        #backgroundModal .modal-dialog {
            max-width: 100%;
        }
        .background-overlay .btn-group .video-btn.back {
            width: auto;
        }
    }
    
    .profile_animated_background video {
        opacity: 0;
        filter: blur(10px);
        transition: opacity 0.5s ease, filter 0.5s ease;
    }
    
    .profile_animated_background video.is-visible {
        opacity: 1;
        filter: blur(0);
    }
    
    .profile-page-top .profile-page-top-body .profile-page-top-background::after {
        background: radial-gradient(ellipse at center, transparent 0%, rgb(20 20 20 / 29%) 30%, rgb(20 20 20 / 74%) 60%, rgb(20 20 20 / 61%) 100%);
    }
    
    .profile-page-top-background[data-has-background="1"] {
		opacity: 1!important;
        background-image: unset!important;
    }