.ytg-gallery {
    --ytg-gap: 24px;
    --ytg-radius: 24px;
    --ytg-surface: #f5f7fb;
    --ytg-border: rgba(15, 23, 42, 0.08);
    --ytg-text: #0f172a;
    --ytg-muted: #475569;
    position: relative;
    width: 100%;
}

.ytg-gallery__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ytg-gap);
    align-items: start;
}

.ytg-card {
    min-width: 0;
}

.ytg-card--featured {
    grid-column: 1 / -1;
}

.ytg-card__media {
    position: relative;
    width: 100%;
    height: 225px;
    border-radius: var(--ytg-radius);
    overflow: hidden;
    background: #000;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.12);
}

.ytg-card--featured .ytg-card__media {
    height: 500px;
}

section.ytg-gallery .ytg-card__frame,
section.ytg-gallery .ytg-card__preview {
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    position: absolute;
    inset: 0;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: var(--ytg-radius) !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    background: #000 !important;
    color: inherit !important;
    text-align: inherit !important;
    text-decoration: none !important;
}

.ytg-card__thumb,
.ytg-card__backfill {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%!important;
    object-fit: cover;
}

.ytg-card__backfill {
    transform: scale(1.12);
    filter: blur(14px) brightness(0.55);
}

.ytg-card__thumb {
    z-index: 1;
}

.ytg-card__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.04) 0%, rgba(15, 23, 42, 0.14) 58%, rgba(15, 23, 42, 0.52) 100%);
    transition: background 180ms ease;
}

.ytg-card__preview:hover .ytg-card__overlay,
.ytg-card__preview:focus .ytg-card__overlay {
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0.2) 58%, rgba(15, 23, 42, 0.58) 100%);
}

.ytg-card__play-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: 999px;
}

.ytg-card--featured .ytg-card__play-badge {
    width: 104px;
    height: 104px;
}

.ytg-card__play {
    width: 44px;
    height: auto;
}

.ytg-card--featured .ytg-card__play {
    width: 54px;
}

.ytg-card__meta {
    padding: 16px 8px 0;
}

.ytg-card__title {
    margin: 0;
    color: var(--ytg-text);
    font-size: 20px !important;
    font-weight: 700;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ytg-card--featured .ytg-card__title {
    font-size: 1.35rem;
}

.ytg-card__channel {
    margin: 8px 0 0;
    color: var(--ytg-muted);
    font-size: 0.95rem;
    line-height: 1.4;
}

.ytg-gallery__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 36px;
}

.ytg-gallery__load-more {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 150px !important;
    min-height: 50px !important;
    padding: 0 32px !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    border-radius: 999px !important;
    background: white;
    color: var(--ytg-text) !important;
    font-size: 0.98rem !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease !important;
}

.ytg-gallery__load-more:hover,
.ytg-gallery__load-more:focus {
    background: #090088!important;
    border-color: rgba(15, 23, 42, 0.2) !important;
    color: white!important;
    outline: none !important;
}

.ytg-gallery__load-more[hidden] {
    display: none !important;
}

.ytg-gallery__empty {
    padding: 28px;
    border: 1px solid var(--ytg-border);
    border-radius: var(--ytg-radius);
    background: var(--ytg-surface);
    color: var(--ytg-text);
    text-align: center;
}

.ytg-gallery__end-message {
    margin: 0;
    color: var(--ytg-muted);
    font-size: 0.95rem;
    text-align: center;
}

.ytg-gallery__end-message[hidden] {
    display: none !important;
}

.ytg-modal-open {
    overflow: hidden;
}

.ytg-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
}

.ytg-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 75%);
    backdrop-filter: blur(6px);
}

.ytg-modal__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
    width: min(860px, calc(100vw - 120px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 40px 0;
}

.ytg-modal__content {
    position: relative;
    z-index: 2;
    width: 100%;
    border-radius: 34px;
    overflow: hidden;
    background: black;
    box-shadow: 0 36px 100px rgba(0, 0, 0, 0.48);
}

.ytg-modal__player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.ytg-modal__frame {
    width: 100%;
    height: 100%;
    border: 0;
}

.ytg-modal__meta {
    padding: 18px 20px 22px;
    background: black;
}

.ytg-modal__title {
    margin: 0;
    color: #fff !important;
    font-size: 20px !important;
    font-weight: 700;
}

.ytg-modal__date {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
}

.ytg-modal__close {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #fff !important;
    cursor: pointer !important;
    transition: transform 160ms ease, opacity 160ms ease !important;
}

.ytg-modal__close:hover,
.ytg-modal__close:focus {
    outline: none !important;
}

.ytg-modal__close {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: flex-end;
    z-index: 3;
    width: 46px !important;
    height: 46px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.14) !important;
    backdrop-filter: blur(8px);
    font-size: 25px !important;
    font-weight: 300 !important;
    line-height: 0 !important;
}

@media (max-width: 980px) {
    .ytg-gallery {
        --ytg-gap: 18px;
        --ytg-radius: 20px;
    }
    
    .ytg-card--featured .ytg-card__media {
        border-radius: 0px!important;
    }

    .ytg-gallery__grid {
        grid-template-columns: 1fr;
    }

.ytg-card:not(.ytg-card--featured) {
        padding: 0 20px;
    }

    .ytg-card__media,
    .ytg-card--featured .ytg-card__media {
        height: 260px;
    }
    
    .ytg-modal__close {
        font-size: 26px !important;
    }

    .ytg-card__media,
    .ytg-card--featured .ytg-card__media {
        height: 260px;
    }

    .ytg-card__play-badge {
        width: 76px;
        height: 76px;
    }

    .ytg-card--featured .ytg-card__play-badge {
        width: 84px;
        height: 84px;
    }

    .ytg-card__play,
    .ytg-card--featured .ytg-card__play {
        width: 40px;
    }

    .ytg-card--featured .ytg-card__title {
        font-size: 1.12rem;
    }

    .ytg-gallery__actions {
        margin-top: 28px;
    }

    .ytg-gallery__load-more {
        width: 50% !important;
    }

    .ytg-modal__dialog {
        width: calc(100vw - 20px);
    }

    .ytg-modal__content {
        border-radius: 22px;
        width: 100%;
    }

    .ytg-modal__meta {
        padding: 16px 18px 18px;
    }

    .ytg-modal__title {
        font-size: 1rem;
    }

    .ytg-modal__close {
        width: 44px !important;
        height: 44px !important;
    }

    .ytg-modal__close {
        font-size: 26px !important;
    }
}