.tpp-floating-player,
.tpp-modal {
    box-sizing: border-box;
}

.tpp-floating-player *,
.tpp-modal * {
    box-sizing: border-box;
}

.tpp-floating-player {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 190px;
    aspect-ratio: 9 / 16;
    z-index: 999990;
    border-radius: 14px;
    overflow: visible;
    background: #000;
    box-shadow: 0 14px 45px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, opacity 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.tpp-floating-player:hover:not(.is-dragging) {
    transform: translateY(-3px);
}

.tpp-floating-player.is-dragging {
    transition: none;
}

.tpp-floating-player.is-hidden {
    display: none;
}

.tpp-floating-open {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    cursor: grab;
    background: #000;
    touch-action: none;
}

.tpp-floating-player.is-dragging .tpp-floating-open {
    cursor: grabbing;
}

.tpp-floating-open:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 4px;
}

.tpp-floating-open iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none;
}

.tpp-floating-close,
.tpp-modal-close {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    font-family: Arial, sans-serif !important;
    font-weight: 400 !important;
    line-height: 1 !important;
}

.tpp-floating-close {
    position: absolute;
    top: -11px;
    right: -11px;
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    aspect-ratio: 1 / 1;
    z-index: 3;
    background: #fff !important;
    color: #111 !important;
    font-size: 23px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.tpp-floating-close:hover,
.tpp-floating-close:focus-visible {
    transform: scale(1.06);
}

.tpp-expand-label {
    position: absolute;
    left: 50%;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transform: translateX(-50%);
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
}

.tpp-play-icon {
    font-size: 10px;
}

.tpp-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 999999;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.tpp-modal.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.tpp-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(4px);
}

.tpp-modal-content {
    position: relative;
    width: min(430px, calc(100vw - 48px));
    height: min(82vh, 765px);
    aspect-ratio: 9 / 16;
    z-index: 1;
    overflow: visible;
    border-radius: 16px;
    background: #000;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
    transform: scale(0.96);
    transition: transform 0.2s ease;
}

.tpp-modal.is-open .tpp-modal-content {
    transform: scale(1);
}

.tpp-modal-content iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 16px;
    background: #000;
}

.tpp-modal-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    aspect-ratio: 1 / 1;
    z-index: 2;
    background: #fff !important;
    color: #111 !important;
    font-size: 31px !important;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.35);
}

.tpp-modal-close:hover,
.tpp-modal-close:focus-visible {
    transform: scale(1.05);
}

body.tpp-modal-open {
    overflow: hidden !important;
}

@media (max-width: 600px) {
    .tpp-floating-player {
        left: 12px;
        bottom: 14px;
        width: 118px;
        border-radius: 12px;
    }

    .tpp-floating-open {
        border-radius: 12px;
    }

    .tpp-floating-close {
        width: 30px !important;
        min-width: 30px !important;
        max-width: 30px !important;
        height: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;
        border-radius: 50% !important;
    }

    .tpp-expand-label {
        bottom: 8px;
        padding: 6px 8px;
        font-size: 10px;
    }

    .tpp-modal {
        padding: 18px;
    }

    .tpp-modal-content {
        width: min(390px, calc(100vw - 36px));
        height: min(78vh, 694px);
    }

    .tpp-modal-close {
        top: -13px;
        right: -10px;
        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
        border-radius: 50% !important;
        font-size: 28px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tpp-floating-player,
    .tpp-modal,
    .tpp-modal-content {
        transition: none;
    }
}
