/* ==========================================================================
   Circuit intro video player — minimal, dark, self-contained.
   ========================================================================== */

.cvp {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--r-md, 12px);
    background: #0b0b0c;
    color: #fff;
    font-family: var(--font-body, system-ui, sans-serif);
    -webkit-tap-highlight-color: transparent;
}

/* Phones keep the full-width player; desktop caps it so it stays watchable. */
@media (min-width: 768px) {
    .cvp {
        max-width: 760px;
        margin-inline: auto;
    }
}

.cvp-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: #0b0b0c;
    object-fit: contain;
    cursor: pointer;
}

/* center play button (poster state) */
.cvp-bigplay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(10, 10, 11, .62);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .38);
    transition: transform .16s ease, background .16s ease;
    z-index: 3;
}
.cvp-bigplay:hover { transform: translate(-50%, -50%) scale(1.06); background: rgba(10, 10, 11, .78); }
.cvp-bigplay:focus-visible { outline: 2px solid var(--side-selected, #38bdf8); outline-offset: 3px; }
.cvp-bigplay svg { width: 30px; height: 30px; margin-left: 3px; }
.cvp.is-playing .cvp-bigplay { display: none; }

/* buffering spinner */
.cvp-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cvp-spin .8s linear infinite;
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s ease;
}
.cvp.is-loading .cvp-spinner { opacity: 1; }
@keyframes cvp-spin { to { transform: rotate(360deg); } }

/* control bar */
.cvp-controls {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 14px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, .82), rgba(0, 0, 0, 0));
    opacity: 1;
    transition: opacity .2s ease;
}
.cvp.is-idle:not(.is-paused) .cvp-controls { opacity: 0; }
.cvp.is-idle:not(.is-paused):hover .cvp-controls { opacity: 1; }

.cvp-btn {
    flex: none;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: background .14s ease;
}
.cvp-btn:hover { background: rgba(255, 255, 255, .14); }
.cvp-btn:focus-visible { outline: 2px solid var(--side-selected, #38bdf8); outline-offset: 2px; }
.cvp-btn svg { width: 19px; height: 19px; }
.cvp-btn[aria-pressed="true"] { color: var(--side-selected, #38bdf8); }
/* `.cvp-btn` sets display:grid, which would otherwise beat the UA `[hidden]` rule. */
.cvp-btn[hidden] { display: none; }

.cvp-time {
    flex: none;
    min-width: 42px;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
    color: rgba(255, 255, 255, .92);
}

.cvp-seek {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 22px;
    display: flex;
    align-items: center;
    cursor: pointer;
}
.cvp-seek-track {
    position: relative;
    width: 100%;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .26);
    transition: height .12s ease;
}
.cvp-seek:hover .cvp-seek-track { height: 6px; }
.cvp-seek-buffer,
.cvp-seek-played {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
}
.cvp-seek-buffer { background: rgba(255, 255, 255, .34); }
.cvp-seek-played { background: var(--side-selected, #38bdf8); }

/* settings popover */
.cvp-settings {
    position: absolute;
    right: 12px;
    bottom: 54px;
    z-index: 6;
    min-width: 168px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
    background: rgba(18, 18, 20, .96);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
    backdrop-filter: blur(10px);
}
.cvp-settings[hidden] { display: none; }
.cvp-settings-title {
    padding: 6px 10px 4px;
    color: rgba(255, 255, 255, .55);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.cvp-quality-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: start;
}
.cvp-quality-option:hover { background: rgba(255, 255, 255, .1); }
.cvp-quality-option[aria-checked="true"] { color: var(--side-selected, #38bdf8); }
.cvp-quality-option .cvp-check { opacity: 0; }
.cvp-quality-option[aria-checked="true"] .cvp-check { opacity: 1; }
.cvp-quality-note { padding: 4px 10px 6px; color: rgba(255,255,255,.45); font-size: 11px; }

/* error state */
.cvp-error {
    position: absolute;
    inset: 0;
    z-index: 7;
    display: grid;
    place-items: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    background: rgba(11, 11, 12, .92);
}
.cvp-error[hidden] { display: none; }
.cvp-error p { margin: 0; font-size: 14px; color: rgba(255, 255, 255, .86); }
.cvp-error button {
    padding: 9px 18px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.cvp-error button:hover { background: rgba(255, 255, 255, .2); }

@media (max-width: 520px) {
    .cvp-bigplay { width: 60px; height: 60px; }
    .cvp-controls { gap: 6px; padding: 18px 10px 9px; }
    .cvp-btn { width: 30px; height: 30px; }
    .cvp-time { font-size: 11px; min-width: 36px; }
}
