/* Full-screen clip player (player.html). One .player-slide per video inside
   a vertically snapping .player-feed; static/js/player.js drives playback. */
.player-page {
    background: #000;
    overflow: hidden;
}
.player-page nav.top {
    background: linear-gradient(rgba(0, 0, 0, 0.7), transparent);
    border: none;
    left: 0;
    margin: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 20;
}
.player-root {
    background: #000;
    inset: 0;
    position: fixed;
    z-index: 10;
}
.player-feed {
    height: 100%;
    overflow-y: scroll;
    overscroll-behavior: contain;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}
.player-feed::-webkit-scrollbar {
    display: none;
}
.player-feed.is-locked {
    overflow-y: hidden;
}
.player-slide {
    background: #000;
    color: #fff;
    height: 100%;
    overflow: hidden;
    position: relative;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}
.player-video {
    cursor: pointer;
    display: block;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

/* Shown after the last search result */
.player-end-card {
    align-items: center;
    background: #222;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    justify-content: center;
    padding: 16px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    text-align: center;
}
.player-end-card h2 {
    font-size: 1.1em;
    margin: 0;
    overflow-wrap: anywhere;
    padding: 0;
}
.player-end-card a {
    background: #e5194d;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    padding: 10px 18px;
    text-decoration: none;
}
.player-end-card a:hover {
    background: #8f142d;
}
.player-end-card a + a {
    background: #3a3a3a;
}
.player-end-card a + a:hover {
    background: #4a4a4a;
}

/* Paused / buffering indicators */
.player-state {
    background: rgba(0, 0, 0, 0.45);
    border-radius: 50%;
    display: none;
    font-size: 56px;
    left: 50%;
    padding: 12px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
}
.player-slide.is-paused .player-state {
    display: block;
}
.player-spinner {
    animation: player-spin 0.8s linear infinite;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    border-top-color: #e5194d;
    display: none;
    height: 44px;
    left: 50%;
    margin: -22px 0 0 -22px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    width: 44px;
}
.player-slide.is-buffering:not(.is-paused) .player-spinner {
    display: block;
}
@keyframes player-spin {
    to { transform: rotate(360deg); }
}

/* Title */
.player-top {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
    left: 12px;
    pointer-events: none;
    position: absolute;
    right: 12px;
    text-align: center;
    top: calc(56px + env(safe-area-inset-top));
}
.player-top a {
    pointer-events: auto;
}
.player-title {
    font-size: 0.95em;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    padding: 0;
}
.player-search-label {
    align-items: center;
    color: #fff;
    display: inline-flex;
    font-size: 13px;
    gap: 3px;
    margin-top: 2px;
    max-width: 100%;
    text-decoration: none;
}
.player-search-label:hover {
    text-decoration: underline;
}
.player-search-label .material-icons {
    font-size: 15px;
}
.player-title a {
    -webkit-box-orient: vertical;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    text-decoration: none;
}
:fullscreen .player-top,
:-webkit-full-screen .player-top {
    top: calc(12px + env(safe-area-inset-top));
}

/* Like / dislike / favorite / sound / fullscreen column */
.player-rail {
    align-items: center;
    bottom: calc(112px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: absolute;
    right: 10px;
    z-index: 5;
}
.player-rail .video-actions {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
}
.player-rail .video-actions-message {
    bottom: 0;
    position: absolute;
    right: 58px;
}

/* Author, tags, links and timeline */
.player-bottom {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    bottom: 0;
    left: 0;
    padding: 32px 12px calc(8px + env(safe-area-inset-bottom));
    pointer-events: none;
    position: absolute;
    right: 0;
}
.player-bottom a,
.player-bottom button,
.player-bottom input {
    pointer-events: auto;
}
.player-author {
    color: #fff;
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    text-decoration: none;
}
.player-author:hover {
    text-decoration: underline;
}
.player-tags {
    display: block;
    margin-right: 64px;
}
.player-tags a {
    font-size: 13px;
    line-height: 1.3rem;
    margin-top: 3px;
    padding: 0 8px;
}
/* Plain #hashtags; categories keep their pill. */
.player-tags a.tag:not(.category_tag) {
    background: none;
    font-weight: 600;
    margin-right: 6px;
    padding: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.player-tags a.tag:not(.category_tag):hover {
    text-decoration: underline;
}
.player-tags a.tag:not(.category_tag, .show_tags)::before {
    content: "#";
}
.player-links {
    display: flex;
    gap: 14px;
    margin-top: 2px;
}
.player-link {
    align-items: center;
    background: none;
    border: none;
    color: #b7b7b7;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 0.85em;
    gap: 4px;
    padding: 6px 0;
}
.player-link:hover {
    color: #fff;
}
.player-link .material-icons {
    font-size: 18px;
}
.player-timeline {
    align-items: center;
    display: flex;
    gap: 10px;
}
.player-time {
    color: #b7b7b7;
    flex-shrink: 0;
    font-size: 0.75em;
    font-variant-numeric: tabular-nums;
}
.player-seek {
    --progress: 0%;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
    flex: 1;
    height: 24px;
    margin: 0;
    min-width: 0;
    padding: 0;
    touch-action: none;
}
.player-seek::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #e5194d var(--progress), rgba(255, 255, 255, 0.3) var(--progress));
    border-radius: 2px;
    height: 4px;
}
.player-seek::-moz-range-track {
    background: linear-gradient(to right, #e5194d var(--progress), rgba(255, 255, 255, 0.3) var(--progress));
    border-radius: 2px;
    height: 4px;
}
.player-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    background: #e5194d;
    border-radius: 50%;
    height: 14px;
    margin-top: -5px;
    width: 14px;
}
.player-seek::-moz-range-thumb {
    background: #e5194d;
    border: none;
    border-radius: 50%;
    height: 14px;
    width: 14px;
}

/* Comments / report: bottom sheet on phones, side panel on wide screens */
.player-sheet {
    background: #222;
    border-radius: 12px 12px 0 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    height: 70%;
    left: 0;
    position: absolute;
    right: 0;
    transform: translateY(100%);
    transition: transform 0.2s ease, visibility 0.2s;
    visibility: hidden;
    z-index: 15;
}
.player-sheet.is-open {
    transform: none;
    visibility: visible;
}
.player-sheet-head {
    align-items: center;
    border-bottom: 1px solid #4a4a4a;
    display: flex;
    flex-shrink: 0;
    justify-content: space-between;
    padding: 8px 12px;
}
.player-sheet-head h3 {
    font-size: 1em;
    margin: 0;
}
.player-sheet-close {
    background: none;
    border: none;
    color: #b7b7b7;
    cursor: pointer;
    display: flex;
    padding: 4px;
}
.player-sheet-close:hover {
    color: #fff;
}
.player-sheet-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px;
}
.player-sheet .video-report {
    position: static;
}
.player-sheet .report-toggle-btn:not(.active) {
    display: none;
}
.player-sheet .report-panel {
    display: flex !important;
    position: static;
    width: 100%;
}
.player-sheet .report-panel form {
    width: 100%;
}
.player-sheet .report-panel button[type="submit"] {
    background: #e5194d;
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    padding: 10px;
}
.player-sheet .report-panel button[type="submit"]:hover {
    background: #8f142d;
}
.player-sheet .video-actions-message {
    white-space: normal;
}

@media (min-width: 900px) {
    .player-title {
        font-size: 1.05em;
    }
    .player-rail {
        right: 24px;
    }
    .player-sheet {
        border-radius: 0;
        height: auto;
        left: auto;
        top: 56px; /* below nav.top */
        transform: translateX(100%);
        width: 420px;
    }
    :fullscreen .player-sheet,
    :-webkit-full-screen .player-sheet {
        top: 0;
    }
    /* Keep the title, controls and timeline clear of the open side panel. */
    .player-slide:has(.player-sheet.is-open) .player-top,
    .player-slide:has(.player-sheet.is-open) .player-bottom {
        right: 420px;
    }
    .player-slide:has(.player-sheet.is-open) .player-rail {
        right: 444px;
    }
}
