/* Film theatre — one markup, one CSS, one JS. Not restyled per page. */

.theatre {
    position: fixed;
    inset: 0;
    z-index: 998;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

.theatre:fullscreen,
.theatre:-webkit-full-screen {
    background: #000;
}

#video_overlay {
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#video_overlay.is-in {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.theatre-stage {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.theatre.is-open .theatre-stage {
    pointer-events: auto;
}

#video-wrapper {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #000;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#video-wrapper.is-in {
    opacity: 1;
    visibility: visible;
}

#theatre-host,
#theatre-host > div {
    position: absolute;
    inset: 0;
    padding: 0 !important;
    width: 100%;
    height: 100% !important;
}

#theatre-host {
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#theatre-host.is-out {
    opacity: 0;
    visibility: hidden;
}

#theatre-host iframe {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    pointer-events: none;
}

.theatre-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.theatre.is-chrome .theatre-play {
    opacity: 1;
    pointer-events: auto;
}

.theatre-play i {
    display: block;
    margin-left: 3px;
}

.theatre.is-playing .theatre-play i {
    margin-left: 0;
}

.theatre-skip {
    position: absolute;
    top: 50%;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.theatre.is-chrome .theatre-skip {
    opacity: 1;
    pointer-events: auto;
}

#theatre-prev {
    left: 50%;
    transform: translate(calc(-50% - 100px), -50%);
}

#theatre-next {
    left: 50%;
    transform: translate(calc(-50% + 100px), -50%);
}

.theatre-mute {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.theatre.is-muted .theatre-mute {
    opacity: 1;
    pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
    .theatre-mute {
        display: none;
    }
}

.theatre-dock,
#share-video,
#close-video {
    transition: opacity 0.4s ease;
}

.theatre:not(.is-chrome) .theatre-dock,
.theatre:not(.is-chrome) #share-video,
.theatre:not(.is-chrome) #close-video {
    opacity: 0;
    pointer-events: none;
}

.theatre.is-open:not(.is-chrome),
.theatre.is-open:not(.is-chrome) * {
    cursor: none;
}

.theatre-dock {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
    pointer-events: none;
}

.theatre.is-open.is-chrome .theatre-dock,
.theatre.is-open.is-chrome #share-video,
.theatre.is-open.is-chrome #close-video {
    pointer-events: auto;
}


.theatre-title-clip {
    position: relative;
    overflow: hidden;
    height: 16px;
    margin: 0 0 10px;
}

.theatre-title {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    margin: 0;
    text-align: center;
    font-size: 12px;
    letter-spacing: var(--font-track-wide);
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    transition: transform 0.4s ease;
}

.theatre-title-client {
    font-weight: var(--font-bold);
    font-variation-settings: "wght" var(--font-bold);
}

.theatre-title-name {
    font-weight: var(--font-regular);
    font-variation-settings: "wght" var(--font-regular);
}

.theatre-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theatre-time {
    flex: 0 0 auto;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.7);
    min-width: 2.4em;
}

.theatre-time-end {
    text-align: right;
}

.theatre-bar button {
    flex: 0 0 auto;
    border: 0;
    background: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
}

@media (max-width: 840px), (hover: none), (pointer: coarse) {
    #theatre-full {
        display: none;
    }
}

.theatre-scrub {
    flex: 1 1 auto;
    height: 22px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
}

.theatre-scrub.is-drag {
    cursor: grabbing;
}

.theatre-scrub-track {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.28);
    position: relative;
}

.theatre-scrub-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: #fff;
}

.theatre-scrub-dot {
    position: absolute;
    top: 50%;
    left: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    transform: translate(-50%, -50%);
}
