/* Custom player layout styling */
.xplay-clean-player-wrap {
    width: 100%;
    background-color: #000000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.xplay-clean-player-wrap .video-js {
    width: 100%;
    aspect-ratio: 16 / 9;
}

.xplay-iframe-ad-gate-host {
    position: relative !important;
}

/* ---- Poster gate (iframe embeds) ---- */
.xcp-gate {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000 center / cover no-repeat;
}
.xcp-gate.has-poster::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
}
.xcp-gate__play {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}
.xcp-gate__play:hover { background: rgba(0, 0, 0, 0.75); transform: scale(1.06); }
.xcp-gate__play[hidden] { display: none; }
.xcp-gate__play svg { width: 34px; height: 34px; margin-left: 4px; fill: #fff; }

/* ---- Ad overlay (iframe gate + mp4 player) ---- */
.xcp-ad {
    position: absolute;
    inset: 0;
    z-index: 30;
    overflow: hidden;
    background: #000;
}
.xcp-ad__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}
.xcp-ad__click {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    cursor: pointer;
}
.xcp-ad__click[hidden],
.xcp-ad__skip[hidden] { display: none !important; }
.xcp-ad__label {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    padding: 3px 8px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font: 600 12px/1.3 sans-serif;
    pointer-events: none;
}
.xcp-ad__mute {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 5;
    padding: 6px 9px;
    border: 0;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}
.xcp-ad__skip {
    position: absolute;
    right: 0;
    bottom: 14px;
    z-index: 5;
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font: 600 14px/1 sans-serif;
    cursor: pointer;
}
.xcp-ad__skip:disabled { cursor: default; opacity: 0.8; }
.xcp-ad__skip:not(:disabled):hover { background: #e62117; border-color: #e62117; }
.xcp-ad__spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    width: 38px;
    height: 38px;
    margin: -19px 0 0 -19px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: xcp-spin 0.8s linear infinite;
    pointer-events: none;
}
@keyframes xcp-spin { to { transform: rotate(360deg); } }

/* While an ad runs in the Video.js player, hide its own chrome and overlays. */
.video-js.xcp-ad-active .vjs-control-bar,
.video-js.xcp-ad-active .vjs-big-play-button,
.video-js.xcp-ad-active .vjs-loading-spinner,
.video-js.xcp-ad-active .vjs-poster,
.video-js.xcp-ad-active .xplay-player-logo,
.video-js.xcp-ad-active .xplay-player-ticker { display: none !important; }

/*
 * Xplay Theme's .iframe-wrapper uses a height:0 + padding-bottom:56.25% trick
 * that only works when its child is an absolutely-positioned <iframe>. Since we
 * replace that iframe with a normal <video>, neutralize the hack here so the
 * wrapper doesn't collapse to zero height. (player.js applies the same fix
 * inline as a fallback for browsers without :has() support.)
 */
.iframe-wrapper:has(> .xplay-clean-player-wrap) {
    height: auto;
    padding-bottom: 0;
}

/*
 * No custom skin here on purpose — the theme's own direct-video player
 * (js/xplay-player.js) doesn't override Video.js's default-skin styling
 * either, so we match it exactly rather than fighting vjs-big-play-centered's
 * own positioning with extra margins (which is what was pushing the play
 * button out from under overflow:hidden and making it disappear).
 */