/* Custom theater chrome. Native <video> has controls hidden. */

.kp {
    --kp-accent: #38bdf8;
    --kp-text: #f4f7fb;
    --kp-muted: rgba(244, 247, 251, 0.72);
    --kp-track: rgba(255, 255, 255, 0.22);
    --kp-buf: rgba(255, 255, 255, 0.38);
    position: relative;
    background: #05070c;
    color: var(--kp-text);
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(78vh, 100dvh);
    overflow: hidden;
    user-select: none;
    font-family: Inter, system-ui, sans-serif;
}
.kp.is-fs {
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
    max-height: 100%;
}
.kp.is-audio {
    aspect-ratio: 16 / 7;
    min-height: 280px;
}

.kp-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    vertical-align: middle;
}
.kp.is-audio .kp-video {
    height: 0;
    width: 0;
    opacity: 0;
    pointer-events: none;
}

.kp-audio-poster {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #0c1220;
    pointer-events: none;
}
.kp-audio-mark {
    font-size: 11px;
    letter-spacing: 0.28em;
    font-weight: 600;
    color: var(--kp-accent);
}
.kp-audio-title {
    font-size: 1.35rem;
    font-weight: 600;
    max-width: 80%;
    text-align: center;
}

.kp-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--kp-accent);
    border-radius: 50%;
    animation: kp-spin 0.7s linear infinite;
    z-index: 4;
}
@keyframes kp-spin { to { transform: rotate(360deg); } }

.kp-error {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 32px;
    text-align: center;
    background: #0a0e16;
    color: #fecaca;
    font-size: 0.95rem;
    line-height: 1.45;
}

.kp-bigplay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 76px;
    height: 76px;
    margin: -38px 0 0 -38px;
    border: 0;
    border-radius: 50%;
    background: rgba(8, 14, 24, 0.78);
    color: #fff;
    cursor: pointer;
    z-index: 3;
    display: grid;
    place-items: center;
}
.kp-bigplay svg { width: 34px; height: 34px; fill: currentColor; margin-left: 4px; }
.kp.is-playing .kp-bigplay { display: none; }

.kp-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, transparent 22%, transparent 62%, rgba(0,0,0,.72) 100%);
    opacity: 1;
    transition: opacity 0.25s ease;
    pointer-events: none;
    z-index: 2;
}
.kp.is-playing.is-idle .kp-overlay { opacity: 0; }
.kp.is-playing.is-idle { cursor: none; }
.kp-top, .kp-bottom { pointer-events: auto; }
.kp-bottom { padding: 0 12px 10px; }

.kp-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 0;
}
.kp-title {
    font-size: 0.95rem;
    font-weight: 500;
    text-shadow: 0 1px 8px #000;
}
.kp-badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.55);
    color: var(--kp-accent);
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.kp-progress {
    height: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}
.kp-progress-track {
    position: relative;
    width: 100%;
    height: 4px;
    background: var(--kp-track);
    border-radius: 2px;
}
.kp.is-playing.is-idle .kp-progress-track { height: 3px; }
.kp-progress:hover .kp-progress-track,
.kp-progress:focus-visible .kp-progress-track { height: 6px; }
.kp-buffered, .kp-played {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    pointer-events: none;
}
.kp-buffered { background: var(--kp-buf); }
.kp-played { background: var(--kp-accent); }
.kp-thumb {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}
.kp-progress:hover .kp-thumb,
.kp-progress:focus-visible .kp-thumb { opacity: 1; }
.kp-time-tip {
    position: absolute;
    bottom: 18px;
    transform: translateX(-50%);
    background: #111827;
    color: #fff;
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 4px;
    pointer-events: none;
}

.kp-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 40px;
}
.kp-spacer { flex: 1; }
.kp-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--kp-text);
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    cursor: pointer;
    border-radius: 6px;
}
.kp-btn:hover, .kp-btn.is-on { background: rgba(255, 255, 255, 0.1); }
.kp-btn.is-on { color: var(--kp-accent); }
.kp-btn svg, .kp-bigplay svg, .kp svg { width: 20px; height: 20px; fill: currentColor; }
.kp-bigplay svg { width: 34px; height: 34px; }

.kp-time {
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--kp-muted);
    padding: 0 6px;
    cursor: pointer;
    white-space: nowrap;
}
.kp-sep { opacity: 0.55; }

.kp-vol {
    display: flex;
    align-items: center;
    gap: 4px;
}
.kp-vol-range {
    width: 0;
    opacity: 0;
    accent-color: var(--kp-accent);
    transition: width 0.15s ease, opacity 0.15s ease;
}
.kp-vol:hover .kp-vol-range,
.kp-vol:focus-within .kp-vol-range {
    width: 72px;
    opacity: 1;
}

.kp-speed { position: relative; }
.kp-speed-btn {
    width: auto;
    min-width: 38px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
}
.kp-speed-menu {
    position: absolute;
    right: 0;
    bottom: 42px;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.12);
    min-width: 108px;
    padding: 6px;
    z-index: 6;
}
.kp-speed-menu button {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--kp-text);
    text-align: left;
    padding: 7px 10px;
    font-size: 13px;
    cursor: pointer;
}
.kp-speed-menu button:hover,
.kp-speed-menu button.is-on { background: rgba(56, 189, 248, 0.16); color: var(--kp-accent); }

.kp-help {
    position: absolute;
    inset: 0;
    z-index: 8;
    background: rgba(0, 0, 0, 0.62);
    display: grid;
    place-items: center;
    padding: 24px;
}
.kp-help-card {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 22px 26px;
    max-width: 420px;
    width: 100%;
}
.kp-help-card h3 { margin: 0 0 12px; font-size: 1rem; }
.kp-help-card dl {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 6px 16px;
    margin: 0 0 12px;
    font-size: 13px;
}
.kp-help-card dt { color: var(--kp-accent); font-weight: 600; }
.kp-help-card dd { margin: 0; color: var(--kp-muted); }
.kp-help-card p { margin: 0; font-size: 12px; color: var(--kp-muted); }

@media (max-width: 640px) {
    .kp-title { display: none; }
    .kp-vol-range { display: none; }
    .kp-speed-btn { font-size: 11px; }
    .kp-btn { width: 34px; height: 34px; }
}
