/* Video feature: the player, its cards and the admin video page. */

.player { display: block; margin: 16px 0; }
.player-box {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    background: #000;
    user-select: none;
    -webkit-user-select: none;
}
.player-box video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-box:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
.player-box:-webkit-full-screen { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
.player-mark {
    position: absolute;
    top: 8%;
    left: 8%;
    z-index: 2;
    pointer-events: none;
    direction: ltr;
    font-family: var(--font-code);
    font-size: clamp(.75rem, 2.2vw, 1.1rem);
    letter-spacing: .08em;
    color: #fff;
    opacity: .35;
    text-shadow: 0 0 3px #000;
}
.player-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}
.player-quality-label { display: inline-flex; align-items: center; gap: 8px; font-size: .95rem; }
.player-quality {
    min-height: 44px;
    padding: 4px 10px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}
.player .btn-small { min-height: 44px; padding: 6px 16px; }

/* Before the first tap: the poster (or a dark screen) and one big play button. Nothing downloads before it. */
.player-start {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: radial-gradient(circle at 50% 50%, rgba(10, 18, 32, .15), rgba(10, 18, 32, .65));
    color: #fff;
    font: 700 1.1rem/1.3 var(--font-title);
    cursor: pointer;
}
.player-start:focus-visible { box-shadow: inset var(--focus-ring); border-radius: var(--radius); }
.player-start-label { padding: 2px 14px; border-radius: var(--radius-pill); background: rgba(10, 18, 32, .7); }
.player-message { margin: 8px 0 0; color: var(--danger); }

/* One stream at a time: another device of the account is playing (dark over the video in both themes). */
.player-takeover {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    padding: 16px;
    background: color-mix(in srgb, var(--navy) 90%, transparent);
    color: var(--on-console);
    text-align: center;
}
.player-takeover[hidden] { display: none; }
.player-takeover-text { margin: 0; max-width: 32ch; font: 700 var(--fs-md)/1.4 var(--font-title); }
.player-takeover .btn { width: auto; }

.video-card { margin: 16px 0; text-align: center; }
.video-card p { margin: 0 0 12px; }
.video-locked { border-color: var(--accent); background: var(--accent-soft); }
.video-locked-title { font-family: var(--font-title); font-size: 1.15rem; }
.video-soon { color: var(--text-muted); }
.video-soon p { margin: 0; }

/* Admin video page */
.upload-form { max-width: 560px; margin-bottom: 24px; }
.upload-progress { width: 100%; height: 12px; margin-bottom: 8px; accent-color: var(--turquoise); }
.upload-status { min-height: 1.7em; margin: 0 0 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions form { margin: 0; }
.row-actions > a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 4px; }
.video-status { white-space: nowrap; font-weight: 500; }
.video-status-ready { color: var(--link); }
.video-status-failed { color: var(--danger); }
.video-status-uploaded, .video-status-transcoding { color: var(--text-muted); }
.video-note { margin: 4px 0 0; max-width: 16rem; }
.error-text {
    max-width: 480px;
    max-height: 200px;
    overflow: auto;
    margin: 6px 0 0;
    padding: 8px;
    border-radius: 8px;
    background: var(--danger-soft);
    font-size: .8rem;
    white-space: pre-wrap;
}
