/* SaraFilm — pleer va tomosha sahifasi */

body.is-immersive { background: #000; }
body.is-immersive .site-header,
body.is-immersive .site-footer,
body.is-immersive .tabbar { display: none; }
body.is-immersive main { padding: 0 !important; }

.play-page { position: relative; width: 100%; height: 100dvh; background: #000; display: grid; place-items: center; }

.player {
    position: relative; width: 100%; height: 100%; overflow: hidden; background: #000; color: #fff;
    outline: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.player video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.player.is-idle { cursor: none; }

/* ---------------------------------------------------------------- ustki va pastki panel */
.player-top, .player-bottom {
    position: absolute; left: 0; right: 0; z-index: 4;
    transition: opacity 0.25s, transform 0.3s var(--ease);
}
.player-top {
    top: 0; display: flex; align-items: center; gap: 12px;
    padding: 16px clamp(12px, 2.4vw, 32px) 48px;
    background: linear-gradient(rgb(0 0 0 / 0.72), transparent);
}
.player-bottom {
    bottom: 0; padding: 56px clamp(12px, 2.4vw, 32px) calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(transparent, rgb(0 0 0 / 0.82));
}
.player.is-idle .player-top, .player.is-idle .player-bottom { opacity: 0; pointer-events: none; }
.player.is-idle .player-top { transform: translateY(-10px); }
.player.is-idle .player-bottom { transform: translateY(10px); }
.player-title { font-weight: 600; font-size: clamp(0.95rem, 1.3vw, 1.15rem); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-shadow: 0 1px 8px rgb(0 0 0 / 0.6); }

.player-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
    min-width: 44px; height: 44px; padding: 0 10px; border-radius: 10px; color: #fff;
    transition: background-color 0.15s, transform 0.15s var(--ease);
}
.player-btn:hover { background: rgb(255 255 255 / 0.16); }
.player-btn:active { transform: scale(0.92); }
.player-btn .icon { width: 24px; height: 24px; stroke-width: 2; }
.player-btn [href$='#play'], .player-big .icon { fill: currentColor; }
.player-row [data-act='toggle'] .icon { fill: currentColor; }
.player-next span { font-weight: 600; font-size: 0.92rem; }

.player-row { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.player-gap { flex: 1; }
.player-time { margin-left: 10px; font-size: 0.9rem; font-weight: 500; white-space: nowrap; color: rgb(255 255 255 / 0.9); }

.player-volume { display: flex; align-items: center; }
.player-volume input {
    width: 0; opacity: 0; height: 4px; margin: 0; accent-color: var(--amber); cursor: pointer;
    transition: width 0.25s var(--ease), opacity 0.2s, margin 0.25s;
}
.player-volume:hover input, .player-volume:focus-within input { width: 84px; opacity: 1; margin: 0 8px 0 2px; }

/* ---------------------------------------------------------------- vaqt chizig'i */
.player-seek { position: relative; padding: 10px 0; cursor: pointer; touch-action: none; }
.player-seek-track { position: relative; height: 4px; border-radius: 99px; background: rgb(255 255 255 / 0.26); overflow: hidden; transition: height 0.15s; }
.player-seek:hover .player-seek-track, .player-seek:focus-visible .player-seek-track { height: 7px; }
.player-seek-track i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; }
.player-seek-track .buffered { background: rgb(255 255 255 / 0.36); }
.player-seek-track .played { background: var(--amber); }
.player-seek-tip {
    position: absolute; bottom: 26px; transform: translateX(-50%); padding: 4px 8px; border-radius: 8px;
    background: rgb(20 22 22 / 0.94); font-size: 0.82rem; font-weight: 600; pointer-events: none;
}

/* ---------------------------------------------------------------- markaz: tugma, yuklanish, xabar */
.player-big {
    position: absolute; inset: 0; margin: auto; z-index: 3; width: 84px; height: 84px; border-radius: 50%;
    display: none; place-items: center; background: var(--amber); color: var(--amber-ink);
    box-shadow: 0 12px 40px rgb(0 0 0 / 0.5); transition: transform 0.2s var(--ease);
}
.player-big .icon { width: 34px; height: 34px; margin-left: 4px; stroke: none; }
.player-big:hover { transform: scale(1.08); }
.player.is-paused:not(.is-loading):not(.is-blocked) .player-big { display: grid; }

.player-spinner { position: absolute; inset: 0; z-index: 2; display: none; place-items: center; pointer-events: none; }
.player.is-loading .player-spinner, .player-spinner.is-visible { display: grid; }
.player-spinner .spinner { width: 52px; height: 52px; border-width: 4px; border-color: rgb(255 255 255 / 0.2); border-top-color: var(--amber); }

.player-note {
    position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%, -50%);
    display: grid; gap: 16px; justify-items: center; max-width: min(90%, 460px); padding: 24px 28px;
    border-radius: 18px; background: rgb(22 25 25 / 0.94); text-align: center; font-weight: 500;
}
.player-note-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.player.is-blocked video { opacity: 0.25; }

/* ---------------------------------------------------------------- subtitr va suv belgisi */
.player-subs {
    position: absolute; z-index: 2; left: 0; right: 0; bottom: clamp(64px, 12%, 130px);
    display: flex; justify-content: center; padding: 0 5%; text-align: center; pointer-events: none;
    transition: bottom 0.25s;
}
.player.is-idle .player-subs { bottom: clamp(28px, 6%, 64px); }
.player-subs span {
    padding: 0.18em 0.6em; border-radius: 6px; background: rgb(0 0 0 / 0.62);
    font-size: clamp(1rem, 2.3vw, 1.75rem); font-weight: 500; line-height: 1.4; text-wrap: balance;
}
.player-mark {
    position: absolute; z-index: 1; left: 10%; top: 12%; pointer-events: none;
    font-size: clamp(0.7rem, 1.1vw, 0.9rem); font-weight: 600; letter-spacing: 0.04em;
    color: rgb(255 255 255 / 0.16); text-shadow: 0 0 2px rgb(0 0 0 / 0.25);
    transition: left 1.5s ease, top 1.5s ease;
}

/* ---------------------------------------------------------------- menyu (sifat, audio, tezlik, subtitr) */
.player-menu {
    position: absolute; right: clamp(12px, 2.4vw, 32px); bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 6;
    min-width: 250px; max-height: min(60vh, 420px); overflow-y: auto; padding: 8px;
    border-radius: 14px; background: rgb(22 25 25 / 0.96); box-shadow: 0 18px 48px rgb(0 0 0 / 0.6);
    animation: menu-in 0.2s var(--ease);
}
.player-menu-title { padding: 8px 12px 6px; font-size: 0.82rem; font-weight: 600; color: rgb(255 255 255 / 0.6); }
.player-item {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px;
    border-radius: 10px; color: #fff; font-size: 0.95rem; font-weight: 500; text-align: left;
}
.player-item:hover { background: rgb(255 255 255 / 0.12); }
.player-item > i, .player-item > .icon { width: 18px; height: 18px; flex: none; }
.player-item span { flex: 1; }
.player-item small { color: rgb(255 255 255 / 0.62); font-size: 0.85rem; }
.player-item.is-on { color: var(--amber); }
.player-item-head { margin-bottom: 4px; border-bottom: 1px solid rgb(255 255 255 / 0.1); border-radius: 10px 10px 0 0; font-weight: 600; }
.player-item-row .icon { width: 16px; height: 16px; opacity: 0.6; }

/* ---------------------------------------------------------------- to'siq ekrani */
.play-blocked { display: grid; justify-items: center; gap: 16px; max-width: 560px; padding: 32px 20px; text-align: center; color: var(--ink); }
.play-blocked h1 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
.play-blocked p { color: var(--ink-2); max-width: 46ch; }
.play-blocked p b { color: var(--ink); }
.play-blocked-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.toast-link { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; margin-left: 6px; }

@media (max-width: 760px) {
    .player-volume input { display: none; }
    .player-next span { display: none; }
    .player-btn { min-width: 40px; height: 40px; padding: 0 6px; }
    .player-time { font-size: 0.8rem; margin-left: 4px; }
    .player-menu { left: 12px; right: 12px; min-width: 0; }
    .player-big { width: 68px; height: 68px; }
}
