.dms3-ytp {
    font-family: inherit;
    margin: 1rem 0;
    padding: 0px;
    border-radius: 4px;
}

.dms3-ytp-heading {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: #000;
}

.dms3-ytp-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 830px) {
    .dms3-ytp-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 530px) {
    .dms3-ytp-grid {
        grid-template-columns: 1fr;
    }
}

.dms3-ytp-card {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #111;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.dms3-ytp-card:hover,
.dms3-ytp-card:focus-visible {
    transform: scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    outline: none;
}

.dms3-ytp-thumb {
    position: absolute;
    inset: 0;
}

.dms3-ytp-thumb img {
    width: 100% !important;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dms3-ytp-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(52px, 20%, 76px);
    height: clamp(52px, 20%, 76px);
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
    transition: background 0.2s ease, transform 0.2s ease;
}

.dms3-ytp-card:hover .dms3-ytp-play {
    background: rgba(0, 0, 0, 0.7);
    transform: translate(-50%, -50%) scale(1.05);
}

.dms3-ytp-play .fa-play {
    color: #fff;
    font-size: clamp(1.1rem, 3.5vw, 1.6rem);
    margin-left: 4px;
}

.dms3-ytp-btn {
    padding: 12px 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dms3-ytp-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.18);
}

.dms3-ytp-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dms3-ytp-actions {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.dms3-ytp-actions.is-hidden {
    display: none;
}

.dms3-ytp-status {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    text-align: center;
}

.dms3-ytp-error {
    padding: 12px;
    border: 1px solid #e57373;
    background: #ffebee;
    border-radius: 8px;
}

/* Modal */
body.dms3-ytp-modal-open {
    overflow: hidden;
}

.dms3-ytp-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.dms3-ytp-modal[hidden] {
    display: none;
}

.dms3-ytp-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.88);
    cursor: pointer;
}

.dms3-ytp-modal-dialog {
    position: relative;
    width: min(960px, 100%);
    z-index: 1;
}

.dms3-ytp-modal-close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.dms3-ytp-modal-close:hover,
.dms3-ytp-modal-close:focus-visible {
    background: rgba(255, 255, 255, 0.3);
    outline: none;
}

.dms3-ytp-modal-player iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 12px;
    display: block;
}

@media (max-width: 530px) {
    .dms3-ytp-modal {
        padding: 16px;
    }

    .dms3-ytp-modal-close {
        top: -36px;
        width: 36px;
        height: 36px;
    }
}
