/* Video embed player – iframe-safe, modern overlay UI */

/* Full-viewport layout – ONLY on embed iframe pages */
html.embed-page,
html.embed-page body.embed-body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    overflow: hidden;
}

html.embed-page body.embed-body .vplayer,
html.embed-page body.embed-body .vplayer__stage {
    width: 100%;
    height: 100%;
    min-height: 220px;
}

/* Inline player on match pages */
.match-video .vplayer,
.player-page .vplayer {
    width: 100%;
    height: auto;
    min-height: 0;
}

.vplayer__stage {
    position: relative;
    width: 100%;
    background: #0f172a;
    border-radius: 0;
    overflow: hidden;
}

.match-video .vplayer__stage,
.player-page .vplayer__stage {
    height: auto;
    min-height: 240px;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
}

.player-page .vplayer__stage {
    max-height: 72vh;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}

.vplayer__poster,
.vplayer__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.vplayer__poster {
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 2;
    transition: opacity .35s ease;
}

.vplayer.is-playing .vplayer__poster {
    opacity: 0;
    pointer-events: none;
}

.vplayer__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.55) 55%, rgba(0,0,0,.75) 100%);
}

.vplayer__top,
.vplayer__center {
    position: relative;
    z-index: 1;
}

.vplayer__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
}

.vplayer__brand {
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #93c5fd;
}

.vplayer__match-link {
    color: #e2e8f0;
    font-size: .8rem;
    text-decoration: none;
}

.vplayer__match-link:hover {
    color: #fff;
}

.vplayer__center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
}

.vplayer__title {
    margin: 0 0 .35rem;
    color: #fff;
    font-size: clamp(1.1rem, 3vw, 1.75rem);
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.vplayer__meta {
    margin: 0 0 1.25rem;
    color: #cbd5e1;
    font-size: .9rem;
}

.vplayer__play {
    width: 84px;
    height: 84px;
    border: 0;
    border-radius: 50%;
    background: rgba(37, 99, 235, .92);
    box-shadow: 0 8px 30px rgba(37, 99, 235, .45);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform .2s ease, background .2s ease;
}

.vplayer__play:hover {
    transform: scale(1.06);
    background: #2563eb;
}

.vplayer__play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 14px 0 14px 24px;
    border-color: transparent transparent transparent #fff;
    margin-left: 6px;
}

.vplayer__cta {
    position: relative;
    z-index: 1;
    display: block;
    margin: 0 1.25rem 1.25rem;
    padding: .9rem 1rem;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    font-size: .95rem;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(239, 68, 68, .35);
}

.vplayer__cta:hover {
    filter: brightness(1.05);
    text-decoration: none;
}

.vplayer__video {
    object-fit: cover;
    background: #000;
    z-index: 1;
    opacity: 0;
    transition: opacity .35s ease;
}

.vplayer.is-playing .vplayer__video {
    opacity: 1;
    z-index: 3;
}

.player-page {
    padding: 1.5rem 0 2rem;
}

.match-video {
    margin: 1.5rem 0;
    width: 100%;
}

.match-video__heading {
    margin: 0 0 .75rem;
    font-size: 1.25rem;
}

/* ── Embed code (YouTube-style) ─────────────────────────────────────────── */
.match-video .embed-code,
.player-page .embed-code {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.embed-code {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.embed-code__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.embed-code__hint {
    margin: 0 0 0.85rem;
    font-size: 0.875rem;
    color: #64748b;
}

.embed-code__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    width: 100%;
    align-items: stretch;
}

.embed-code__input {
    width: 100%;
    min-width: 0;
    min-height: 3.5rem;
    padding: 0.75rem 0.9rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #0f172a;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    resize: none;
    box-sizing: border-box;
}

.embed-code__copy {
    min-width: 7.5rem;
    height: 100%;
    padding: 0 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: #2563eb;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.embed-code__copy:hover {
    background: #1d4ed8;
}

.embed-code__copy.is-copied {
    background: #16a34a;
}

@media (max-width: 640px) {
    .embed-code__row {
        grid-template-columns: 1fr;
    }

    .embed-code__copy {
        width: 100%;
        min-height: 2.75rem;
    }
}

/* Smaller title inside player (page already has h1) */
.match-video .vplayer__title {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
}

/* Safety: never lock document scroll outside embed iframe pages */
html:not(.embed-page),
html:not(.embed-page) body {
    overflow: auto;
    height: auto;
    min-height: 0;
}
