/* Video Gimmick Overlay - Wrapper Layout */
#video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2147483647;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    pointer-events: auto;
}

#video-overlay.hidden {
    display: none !important;
}

/* Container for Player & Close Button */
.video-wrapper {
    position: relative;
    /* Limit width to 70vw as requested, but also by height */
    width: 100%;
    /* Will be constrained by max-width */
    max-width: 70vw;

    /* Enforce 16:9 Aspect Ratio */
    aspect-ratio: 16 / 9;

    /* Also constrain by height if screen is wide but short */
    max-height: 70vh;

    /* Center it (though flex parent does this) */
    margin: 0 auto;

    /* Player styling container */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    background: #000;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#video-overlay video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Inside the 16:9 wrapper */
    display: block;
    outline: none;
    border-radius: 8px;
    /* Match wrapper */
}

#close-video-btn {
    position: absolute;
    /* Position relative to the .video-wrapper */
    top: -20px;
    right: -20px;
    z-index: 2147483648;

    font-size: 1.2rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;

    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

#close-video-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    transform: scale(1.1);
}