.mb-vk-clips {
    --mb-vk-accent: var(--theme-base-color, #70419a);
    order: var(--order-index, 16);
    padding: 72px 0 76px;
    background: var(--darkerblack_bg_black);
    color: #202020;
}

.mb-vk-clips__community-icon {
    display: block;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin-right: 12px;
}

.mb-vk-clips__rail {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.mb-vk-clips__card {
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.mb-vk-clips__media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    background: #e7e4e1;
    box-shadow: 0 8px 26px rgba(28, 23, 20, .08);
    transform: translateZ(0);
}

.mb-vk-clips__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.mb-vk-clips__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(16, 12, 10, .38) 100%);
    pointer-events: none;
}

.mb-vk-clips__play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 7px 22px rgba(0, 0, 0, .17);
    transform: translate(-50%, -50%);
    transition: transform .2s ease, background .2s ease;
}

.mb-vk-clips__play span {
    position: absolute;
    left: 21px;
    top: 17px;
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid var(--mb-vk-accent);
}

.mb-vk-clips__duration {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 4px 7px;
    border-radius: 6px;
    background: rgba(20, 17, 15, .72);
    color: #fff;
    font-size: 12px;
    line-height: 1;
}

.mb-vk-clips__card:hover .mb-vk-clips__media img {
    transform: scale(1.025);
}

.mb-vk-clips__card:hover .mb-vk-clips__play {
    background: #fff;
    transform: translate(-50%, -50%) scale(1.06);
}

.mb-vk-clips-modal {
    position: fixed;
    z-index: 10050;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.mb-vk-clips-modal.is-open {
    display: flex;
}

.mb-vk-clips-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(18, 15, 14, .78);
    cursor: pointer;
}

.mb-vk-clips-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(430px, calc(100vw - 48px));
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: 18px;
    background: #111;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .4);
}

.mb-vk-clips-modal__frame,
.mb-vk-clips-modal__frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.mb-vk-clips-modal__close {
    position: absolute;
    z-index: 2;
    right: 10px;
    top: 10px;
    width: 40px;
    height: 40px;
    padding: 0 0 3px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #2b2826;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

html.mb-vk-clips-lock {
    overflow: hidden;
}

@media (max-width: 1199px) {
    .mb-vk-clips__rail { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .mb-vk-clips__card:nth-child(n+5) { display: none; }
}

@media (max-width: 767px) {
    .mb-vk-clips { padding: 46px 0 50px; }
    .mb-vk-clips__rail {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        margin-right: calc(var(--theme-page-width-padding, 16px) * -1);
        padding-right: var(--theme-page-width-padding, 16px);
        padding-bottom: 8px;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .mb-vk-clips__rail::-webkit-scrollbar { display: none; }
    .mb-vk-clips__card,
    .mb-vk-clips__card:nth-child(n+5) {
        display: block;
        flex: 0 0 min(61vw, 240px);
        scroll-snap-align: start;
    }
    .mb-vk-clips__media { border-radius: 14px; }
    .mb-vk-clips__play { width: 48px; height: 48px; }
    .mb-vk-clips__play span { left: 20px; top: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    .mb-vk-clips__media img,
    .mb-vk-clips__play { transition: none; }
}
