.theater-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    background-color: #0b0b0b;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    -webkit-overflow-scrolling: touch;
    -webkit-tap-highlight-color: transparent;
}

.theater-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.theater-overlay:not(.is-active) * {
    pointer-events: none !important;
    visibility: hidden !important;
}

.theater-nav-bar {
    width: 100%;
    background-color: #0f0f0f;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.theater-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background-color: var(--btn-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 13.5px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.theater-back-btn:hover {
    background-color: var(--btn-hover);
}

.theater-player-section {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 20px 0 20px;
    background: transparent;
    position: static;
    flex-shrink: 0;
}

.theater-player-section .custom-player {
    width: 100%;
    max-width: min(1080px, calc((100vh - 210px) * 16 / 9));
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.75);
}

.theater-player-section .custom-player:fullscreen {
    border-radius: 0 !important;
    max-width: none !important;
    box-shadow: none !important;
}

.theater-info-scroll {
    flex: 1;
    width: 100%;
    max-width: min(1080px, calc((100vh - 210px) * 16 / 9));
    margin: 0 auto;
    padding: 18px 20px 48px 20px;
}

.theater-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 14px;
}

.theater-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 680px) {
    .theater-nav-bar {
        padding: 8px 14px;
    }

    .theater-player-section {
        padding: 0;
        background-color: #000000;
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .theater-player-section .custom-player {
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .theater-info-scroll {
        max-width: 100%;
        padding: 14px 14px 36px 14px;
    }

    .theater-title {
        font-size: 17px;
        margin-bottom: 12px;
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    .theater-overlay.is-active .theater-nav-bar,
    .theater-overlay.is-active .theater-info-scroll {
        display: none !important;
    }

    .theater-overlay.is-active .theater-player-section {
        position: fixed;
        inset: 0;
        padding: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        z-index: 300;
    }

    .theater-overlay.is-active .theater-player-section .custom-player,
    .theater-overlay.is-active .theater-player-section .player-aspect-frame {
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        aspect-ratio: auto !important;
        border-radius: 0 !important;
    }

    .theater-overlay.is-active .theater-player-section .player-media {
        object-fit: contain;
    }
}
