/* SaraFilm — pleer va tomosha sahifasi */

body.is-immersive { background: #000; overscroll-behavior: none; }
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: 100vh; 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;
    -webkit-touch-callout: none; touch-action: manipulation;
}
.player video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
/* Ekranni to'ldirish: qora chiziqlarsiz (chetlari kesiladi). Ixcham (telefonda tik) ko'rinishda ma'nosi yo'q. */
.player.is-fill:not(.is-compact) video { object-fit: cover; }
.player.is-compact .player-fill { display: none; }
.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; justify-content: center; gap: 12px; min-height: 76px;
    padding: 18px clamp(64px, 6vw, 96px) 44px;
    background: linear-gradient(rgb(0 0 0 / 0.66), rgb(0 0 0 / 0.28) 55%, transparent);
}
.player-bottom {
    bottom: 0; padding: 72px clamp(14px, 2vw, 28px) calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(transparent, rgb(0 0 0 / 0.5) 45%, rgb(0 0 0 / 0.86));
}
.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); }
/* Film nomi tepada o'rtada, yopish tugmasi o'ng burchakda. */
.player-title {
    min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: center;
    font: 700 clamp(1rem, 1.5vw, 1.3rem)/1.2 var(--font-display); letter-spacing: 0.01em; text-shadow: 0 1px 10px rgb(0 0 0 / 0.7);
}
.player-top .player-close {
    position: absolute; top: 16px; right: clamp(12px, 2vw, 28px); width: 44px; min-width: 44px; padding: 0;
    border-radius: 50%; border: 1.5px solid rgb(255 255 255 / 0.55); background: rgb(0 0 0 / 0.25);
}
.player-top .player-close .icon { width: 20px; height: 20px; }

.player-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
    min-width: 42px; height: 42px; padding: 0 8px; border-radius: 8px; color: rgb(255 255 255 / 0.88);
    transition: color 0.15s, background-color 0.15s, transform 0.15s var(--ease);
}
@media (hover: hover) and (pointer: fine) { .player-btn:hover { color: #fff; background: rgb(255 255 255 / 0.08); } }
.player-btn:active { transform: scale(0.92); }
.player-btn .icon { width: 22px; height: 22px; stroke-width: 1.8; }
/* Joriy sifat nishoni (SD, HD, FHD, 4K) -- sozlamalar belgisining burchagida. */
.player-btn[data-q]::after {
    content: attr(data-q); position: absolute; right: 1px; bottom: 5px; padding: 1px 3px 0; border-radius: 3px;
    background: var(--amber); color: #111; font: 800 0.56rem/1.1 var(--font-display); letter-spacing: 0.02em; pointer-events: none;
}
.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.88rem; }

.player-row { display: flex; align-items: center; gap: 2px; margin-top: 4px; }
.player-gap { flex: 1; }
.player-time { margin-left: 12px; font-size: 0.86rem; font-weight: 500; letter-spacing: 0.02em; white-space: nowrap; color: rgb(255 255 255 / 0.86); }

.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: 9px 0; cursor: pointer; touch-action: none; }
.player-seek-track { position: relative; height: 3px; background: rgb(255 255 255 / 0.22); transition: height 0.15s; }
.player-seek:hover .player-seek-track, .player-seek:focus-visible .player-seek-track { height: 5px; }
.player-seek-track i { position: absolute; inset: 0 auto 0 0; }
.player-seek-track .buffered { background: rgb(255 255 255 / 0.32); }
.player-seek-track .played { background: var(--amber); }
.player-seek-track .played::after {
    content: ''; position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
    background: var(--amber); box-shadow: 0 0 0 3px rgb(0 0 0 / 0.25); transform: scale(0); transition: transform 0.15s var(--ease);
}
.player-seek:hover .player-seek-track .played::after, .player-seek:focus-visible .player-seek-track .played::after { transform: scale(1); }
.player-seek-tip {
    position: absolute; bottom: 24px; transform: translateX(-50%); padding: 4px 7px; border-radius: 4px;
    background: rgb(0 0 0 / 0.85); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; pointer-events: none;
}
.player-seek-tip:has(.player-seek-frame) { display: grid; justify-items: center; gap: 4px; padding: 3px 3px 5px; border-radius: 8px; }
.player-seek-tip[hidden] { display: none; }
.player-seek-frame { display: block; border-radius: 6px; background: #111 no-repeat; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.25); }

/* ---------------------------------------------------------------- markaz: tugma, yuklanish, xabar */
.player-center {
    position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center;
    gap: clamp(28px, 9vw, 64px); pointer-events: none; transition: opacity 0.25s;
}
.player-center > * { pointer-events: auto; }
.player-skip { display: none; }
.player-big {
    flex: none; width: 76px; height: 76px; border-radius: 50%;
    display: none; place-items: center; background: rgb(0 0 0 / 0.42); color: #fff;
    border: 1.5px solid rgb(255 255 255 / 0.6); backdrop-filter: blur(4px);
    transition: transform 0.2s var(--ease), background-color 0.2s;
}
.player-big .icon { width: 30px; height: 30px; margin-left: 4px; stroke: none; }
@media (hover: hover) and (pointer: fine) { .player-big:hover { transform: scale(1.06); background: rgb(0 0 0 / 0.6); } }
.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: 48px; height: 48px; border-width: 3px; border-color: rgb(255 255 255 / 0.18); border-top-color: #fff; }

.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: 22px 26px;
    border-radius: 12px; border: 1px solid rgb(255 255 255 / 0.08); background: rgb(14 14 14 / 0.94); text-align: center; font-weight: 500;
}
.player-note-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------------------------------------------------------------- jonli efir (SaraFilm TV) */
.player.is-live .player-seek { pointer-events: none; }
.player.is-live .player-seek-tip, .player.is-live [data-act='back'], .player.is-live [data-act='forward'],
.player.is-live .player-skip { display: none !important; }
.player.is-live .player-seek .played { background: #ff3b3b; }
.player-live-badge {
    position: absolute; z-index: 4; top: 18px; left: 18px; display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 11px 5px 9px; border-radius: 6px; background: #e52222; color: #fff;
    font: 800 0.78rem/1 var(--font-display, sans-serif); letter-spacing: 0.08em; pointer-events: none;
    box-shadow: 0 4px 14px rgb(229 34 34 / 0.35);
}
.player-live-badge i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: live-dot 1.5s ease-in-out infinite; }
.player.is-behind .player-live-badge { background: rgb(40 40 40 / 0.9); box-shadow: none; }
.player.is-behind .player-live-badge i { background: #999; animation: none; }
@keyframes live-dot { 50% { opacity: 0.25; } }
.player-golive {
    position: absolute; z-index: 6; top: 14px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px; border-radius: 999px; background: #e52222; color: #fff; font-weight: 700; font-size: 0.9rem;
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.4);
}
.player-golive[hidden] { display: none; }
.player-golive .icon { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) { .player-live-badge i { animation: none; } }

/* ---------------------------------------------------------------- keyingi qism (pastki o'ng burchak) */
.player-upnext {
    position: absolute; z-index: 6; right: clamp(16px, 3vw, 40px); bottom: calc(var(--dock, 96px) + 16px);
    display: grid; grid-template-columns: 200px minmax(0, 290px); gap: 16px; align-items: center; padding: 12px;
    border-radius: 16px; background: rgb(14 14 14 / 0.9); border: 1px solid rgb(255 255 255 / 0.1);
    box-shadow: 0 18px 50px rgb(0 0 0 / 0.55); backdrop-filter: blur(10px);
    animation: upnext-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.player-upnext[hidden], .player-after[hidden] { display: none; }
@keyframes upnext-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
.upnext-art { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #222; display: grid; place-items: center; }
.upnext-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upnext-art::after { content: ''; position: absolute; inset: 0; background: rgb(0 0 0 / 0.35); transition: background-color 0.2s; }
.upnext-art:hover::after { background: rgb(0 0 0 / 0.15); }
.upnext-ring { position: relative; z-index: 1; width: 56px; height: 56px; transform: rotate(-90deg); }
.upnext-ring circle { fill: rgb(0 0 0 / 0.35); stroke: rgb(255 255 255 / 0.25); stroke-width: 3; }
.upnext-ring .is-run { fill: none; stroke: #ffa31a; stroke-linecap: round; stroke-dasharray: 132; stroke-dashoffset: 132; animation: upnext-ring linear forwards; }
@keyframes upnext-ring { to { stroke-dashoffset: 0; } }
.upnext-play { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; color: #fff; }
.upnext-play .icon { width: 20px; height: 20px; margin-left: 3px; }
.upnext-text { display: grid; gap: 6px; min-width: 0; color: #fff; }
.upnext-kicker { color: rgb(255 255 255 / 0.7); font-size: 0.85rem; font-weight: 600; }
.upnext-kicker b { color: #ffa31a; }
.upnext-title { font-size: 1rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.upnext-actions { display: flex; gap: 8px; margin-top: 4px; }
.upnext-actions .btn { white-space: nowrap; }

/* ---------------------------------------------------------------- film tugadi: "Endi nima ko'ramiz?" */
.player-after {
    position: absolute; z-index: 6; inset: 0; display: grid; place-items: center; padding: 24px; overflow-y: auto;
    background: radial-gradient(80% 70% at 50% 40%, rgb(20 20 20 / 0.82), rgb(8 8 8 / 0.96)); color: #fff;
    animation: after-in 0.5s ease both;
}
@keyframes after-in { from { opacity: 0; } }
.player.is-after .player-top, .player.is-after .player-bottom, .player.is-after .player-big { opacity: 0; pointer-events: none; }
.after-inner { display: grid; gap: clamp(12px, 3vh, 22px); justify-items: center; width: min(100%, 760px); text-align: center; }
.after-kicker { color: rgb(255 255 255 / 0.6); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.8rem; }
.after-title { margin-top: -14px; font: 800 clamp(1.6rem, 3.4vw, 2.4rem) / 1.1 var(--font-display, sans-serif); }
/* Afisha kengligi ekran balandligiga ham qaraydi: yotqizilgan telefonda uchalasi va tugmalar sig'adi. */
.after-list { --w: min(220px, calc((100vh - 290px) * 0.667), calc((100vw - 96px) / 3)); display: grid; grid-template-columns: repeat(3, max(96px, var(--w))); justify-content: center; gap: clamp(12px, 2.4vw, 24px); width: 100%; }
.after-list a { display: grid; gap: 8px; text-align: left; }
.after-list .poster { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; transition: transform 0.3s; }
.after-list .poster:not(.has-tint) { background: #222; }
.after-list a:hover .poster { transform: translateY(-4px); }
.after-list img { width: 100%; height: 100%; object-fit: cover; }
.after-list b { font-size: 0.95rem; line-height: 1.3; }
.after-list small { color: rgb(255 255 255 / 0.6); }
.after-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.after-actions .icon { width: 17px; height: 17px; }
@media (max-width: 760px) {
    .player-upnext { grid-template-columns: 112px minmax(0, 1fr); gap: 10px; left: 12px; right: 12px; padding: 10px; bottom: calc(var(--dock, 80px) + 10px); }
    .upnext-ring { width: 40px; height: 40px; }
    .upnext-actions .btn { padding-inline: 12px; }
    .after-list { gap: 10px; }
    .after-list b { font-size: 0.82rem; }
    .after-list small { display: none; }
}
@media (prefers-reduced-motion: reduce) { .player-upnext, .player-after { animation: none; } }
.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);
    /* Joy almashganda ekran bo'ylab sirpanmaydi (ko'zga tashlanardi): so'nadi va yangi joyda asta paydo bo'ladi. */
    transition: opacity 1.2s ease;
}

/* ---------------------------------------------------------------- menyu (sifat, audio, tezlik, subtitr) */
.player-menu {
    position: absolute; right: clamp(14px, 2vw, 28px); bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 6;
    min-width: 260px; max-height: min(60vh, 420px); overflow-y: auto; padding: 6px;
    border-radius: 10px; border: 1px solid rgb(255 255 255 / 0.08); background: rgb(14 14 14 / 0.95);
    box-shadow: 0 18px 48px rgb(0 0 0 / 0.6); backdrop-filter: blur(10px); animation: menu-in 0.2s var(--ease);
}
.player-menu-title { padding: 8px 12px 6px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgb(255 255 255 / 0.45); }
.player-item {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px;
    border-radius: 6px; color: rgb(255 255 255 / 0.92); font-size: 0.9rem; font-weight: 500; text-align: left;
}
@media (hover: hover) and (pointer: fine) { .player-item:hover { background: rgb(255 255 255 / 0.08); color: #fff; } }
.player-item:active { background: rgb(255 255 255 / 0.08); }
.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; }

/* ---------------------------------------------------------------- "Obuna kerak": treyler va taklif */
.paywall { position: relative; isolation: isolate; width: 100%; height: 100%; min-height: min(78vh, 620px); overflow: hidden; background: #000; color: #fff; display: flex; align-items: flex-end; }
.paywall-media, .paywall-media > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.paywall-media { z-index: -2; }
.paywall-art { object-position: 50% 25%; }
.paywall-art.is-poster { filter: blur(30px) saturate(1.3); transform: scale(1.3); opacity: 0.7; }
.paywall-video { opacity: 0; transition: opacity 1.2s ease; }
.paywall.is-playing .paywall-video { opacity: 1; }
.paywall.is-done .paywall-video { opacity: 0.45; filter: blur(4px); transition: opacity 0.8s, filter 0.8s; }
.paywall-shade {
    position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(0deg, rgb(0 0 0 / 0.92) 0%, rgb(0 0 0 / 0.55) 38%, rgb(0 0 0 / 0.1) 70%),
                linear-gradient(90deg, rgb(0 0 0 / 0.75) 0%, rgb(0 0 0 / 0.2) 55%, transparent 80%);
}
.paywall-body { display: grid; gap: 16px; justify-items: start; max-width: 640px; padding: clamp(24px, 5vw, 64px); }
.paywall-badge {
    display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px;
    background: #ffa31a; color: #1b1205; font-weight: 800; font-size: 0.85rem; letter-spacing: 0.02em;
}
.paywall-badge .icon { width: 16px; height: 16px; }
.paywall-title { font-size: clamp(1.9rem, 4.2vw, 3.4rem); line-height: 1.02; text-wrap: balance; }
.paywall-logo img { max-width: min(100%, 480px); max-height: clamp(80px, 18vh, 180px); object-fit: contain; object-position: left bottom; filter: drop-shadow(0 4px 18px rgb(0 0 0 / 0.5)); }
.paywall-text { color: rgb(255 255 255 / 0.85); font-size: clamp(1rem, 1.5vw, 1.15rem); line-height: 1.5; max-width: 48ch; }
.paywall-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.paywall-actions .btn:not(.btn-primary) { background: rgb(255 255 255 / 0.14); color: #fff; backdrop-filter: blur(8px); }
.paywall-actions .btn:not(.btn-primary):hover { background: rgb(255 255 255 / 0.24); }
.paywall.is-done .paywall-actions .btn-primary { animation: paywall-pulse 1.6s ease-in-out 2; }
@keyframes paywall-pulse { 50% { box-shadow: 0 0 0 10px rgb(255 163 26 / 0.25); } }
.paywall-note { display: inline-flex; align-items: center; gap: 8px; color: rgb(255 255 255 / 0.65); font-size: 0.88rem; }
.paywall-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff4d4d; animation: paywall-blink 1.4s ease-in-out infinite; }
@keyframes paywall-blink { 50% { opacity: 0.3; } }
.paywall:not(.is-playing) .paywall-note { visibility: hidden; }
.paywall.is-done .paywall-note { visibility: visible; color: #ffa31a; font-weight: 700; }
.paywall-sound { position: absolute; z-index: 2; right: clamp(16px, 3vw, 32px); bottom: clamp(24px, 5vw, 64px); }
.paywall:not(.is-playing) .paywall-sound { display: none; }
.paywall-progress { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 3px; background: rgb(255 255 255 / 0.15); }
.paywall-progress i { display: block; height: 100%; background: #ffa31a; transform: scaleX(0); transform-origin: left; transition: transform 0.25s linear; }
.paywall:not(.has-trailer) .paywall-progress { display: none; }
@media (max-width: 760px) {
    .paywall { min-height: min(70vh, 560px); }
    .paywall-body { padding: 20px 16px 28px; gap: 12px; }
    .paywall-actions { width: 100%; }
    .paywall-actions .btn { flex: 1 1 100%; justify-content: center; }
    .paywall-sound { top: 12px; bottom: auto; right: 12px; }
}
@media (prefers-reduced-motion: reduce) { .paywall-dot, .paywall.is-done .paywall-actions .btn-primary { animation: none; } }
.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; }
}

/* Telefon (tik holat): boshqaruv tugmalari bitta qatorga sig'sin. Ovoz telefonning o'z tugmalari bilan boshqariladi. */
@media (max-width: 520px) {
    .player-volume { display: none; }
    .player-row { gap: 0; }
    .player-btn { min-width: 38px; padding: 0 4px; }
    .player-time { font-size: 0.76rem; margin-left: 2px; }
}

/* "Audio va subtitrlar" tugmasi: kompyuterda yozuvi bilan, telefonda faqat belgi */
.player-tracks { padding: 0 10px; }
.player-tracks span { font-weight: 600; font-size: 0.88rem; white-space: nowrap; }
.player-menu-title:not(:first-child) { margin-top: 6px; padding-top: 12px; border-top: 1px solid rgb(255 255 255 / 0.1); }
@media (max-width: 760px) {
    .player-tracks { padding: 0 4px; background: none; }
    .player-tracks span { display: none; }
}

/* ---------------------------------------------------------------- sensorli ekran (telefon, planshet) */
/* Asosiy boshqaruv ekran o'rtasida, yirik: orqaga 10 s / ijro-pauza / oldinga 10 s. Pastda: vaqt chizig'i va sozlamalar. */
@media (hover: none), (pointer: coarse) {
    .player-skip {
        display: grid; place-items: center; flex: none; width: 54px; height: 54px; border-radius: 50%;
        background: rgb(0 0 0 / 0.38); color: #fff; backdrop-filter: blur(4px);
    }
    .player-skip .icon { width: 30px; height: 30px; stroke-width: 2; }
    .player-skip:active, .player-big:active { transform: scale(0.92); }
    .player:not(.is-loading):not(.is-blocked) .player-big { display: grid; background: rgb(0 0 0 / 0.42); color: #fff; box-shadow: none; }
    .player-big, .player-big.player-big { width: 76px; height: 76px; }
    .player-big .icon { margin-left: 0; }
    .player.is-paused .player-big .icon { margin-left: 4px; }
    .player:not(.is-paused) .player-big .icon { stroke: currentColor; stroke-width: 2.4; }
    .player.is-idle .player-center { opacity: 0; }
    .player.is-idle .player-center > * { pointer-events: none; }
    .player.is-loading .player-skip, .player.is-blocked .player-skip { display: none; }
    /* O'rtadagi tugmalar borligi uchun pastki qatorda takrorlanmaydi. */
    .player-row > [data-act='toggle'], .player-row > [data-act='back'], .player-row > [data-act='forward'] { display: none; }
    .player-volume { display: none; }

    .player-bottom { padding-top: 40px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgb(0 0 0 / 0.9)); }
    .player-seek { padding: 16px 0; }
    .player-seek-track, .player-seek:hover .player-seek-track { height: 4px; }
    .player-seek-track .played::after { right: -7px; width: 14px; height: 14px; margin-top: -7px; transform: scale(1); }
    .player-row { gap: 8px; margin-top: 2px; }
    .player-time { margin-left: 2px; font-size: 0.92rem; font-weight: 600; color: #fff; }
    .player-row .player-btn { min-width: 46px; height: 46px; padding: 0 10px; border-radius: 10px; }
    .player-row .player-btn .icon { width: 24px; height: 24px; }
    .player-tracks span, .player-next span { display: inline; font-size: 0.88rem; }
    .player-top .player-btn { min-width: 44px; height: 44px; }

    /* Menyu pastdan chiqadigan varaq ko'rinishida, qatorlari barmoqqa mos. */
    .player-menu {
        left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); min-width: 0; max-height: 70dvh;
        padding: 10px; border-radius: 18px; z-index: 7; background: rgb(22 25 25);
    }
    .player-item { min-height: 52px; font-size: 1.02rem; }
    .player-menu-title { font-size: 0.9rem; }
}
/* Telefon yotiq holatda yoki planshet: menyu butun kenglikka yoyilmaydi. */
@media (hover: none) and (min-width: 600px), (pointer: coarse) and (min-width: 600px) { .player-menu { left: auto; width: 360px; max-height: 76dvh; } }

/* ---------------------------------------------------------------- telefon: tik holat va to'liq ekran */
.play-under { display: none; }

/* Tik holat: video ekran tepasida, boshqaruv paneli uning ostida (videoni to'smaydi), keyin film nomi. */
@media (hover: none) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
    .play-page { display: block; height: auto; min-height: 100vh; min-height: 100dvh; background: var(--bg); }
    .play-under { display: grid; justify-items: start; gap: 10px; width: 100%; padding: 20px 16px 32px; text-align: left; }
    .play-under h1 { margin: 0; max-width: none; font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
    .play-under a { display: inline-flex; align-items: center; gap: 8px; justify-self: start; min-height: 44px; color: var(--ink-2); font-weight: 600; }
    .play-under a .icon { width: 20px; height: 20px; }
}

/* To'liq ekran API'siz brauzer (iPhone): pleer butun sahifani egallaydi. */
.player.is-full { position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100vh; height: 100dvh; aspect-ratio: auto; }
/* Telefon tik turgan bo'lsa, pleer 90 gradusga burilib, ekranni yonlamasiga to'liq egallaydi. */
.player.is-rotated {
    position: fixed; top: 0; left: 100vw; right: auto; bottom: auto; z-index: 1000;
    width: 100vh; width: 100dvh; height: 100vw; aspect-ratio: auto; transform-origin: top left; transform: rotate(90deg);
}
.play-page:fullscreen { display: block; width: 100%; height: 100%; min-height: 0; background: #000; }
.play-page:fullscreen .play-under { display: none; }
html.player-locked, html.player-locked body { overflow: hidden; }

/* ---------------------------------------------------------------- telefon tik holatda: ixcham pleer
   Sinf JS'da qo'yiladi (burilgan to'liq ekranda brauzer oynasi tor bo'lib qolaveradi, pleer esa keng).
   Tuzilishi: tepada 16:9 video (nom va "yopish" uning ustida, ijroda yashirinadi), ostida qora boshqaruv paneli --
   vaqt chizig'i, chapda joriy vaqt / o'ngda davomiylik, bir qator tugmalar: o'rtada katta ijro tugmasi va ±10 s,
   chapda til va sozlamalar, o'ngda kichik oyna (yoki keyingi qism) va to'liq ekran. Panel doim ko'rinadi. */
.player.is-compact {
    --dock: 128px;
    /* Video maydoni 16:9 (kino formatidagi keng kadr shu maydon ichida), 4:3 kabi torroq kadr -- o'z nisbatida. */
    --video-h: min(calc(100vw / min(var(--ratio, 1.7778), 1.7778)), 62dvh);
    height: auto; aspect-ratio: auto; overflow: visible; cursor: auto; background: #000;
}
.player.is-compact video { aspect-ratio: auto; height: var(--video-h); object-fit: contain; }

/* Ijro tugmasi panelda -- video ustida takrorlanmaydi (videoga bosish ham ijro / pauza). */
.player.is-compact .player-center { display: none; }

.player.is-compact .player-spinner { bottom: var(--dock); }
.player.is-compact .player-spinner .spinner { width: 40px; height: 40px; }
.player.is-compact .player-note { top: calc((100% - var(--dock)) / 2); padding: 14px 16px; gap: 10px; font-size: 0.88rem; }
.player.is-compact .player-subs, .player.is-compact.is-idle .player-subs { bottom: calc(var(--dock) + 10px); padding: 0 16px; }
.player.is-compact .player-subs span { font-size: calc(0.92rem * var(--sub-scale, 1)); }
.player.is-compact .player-badge { top: 14px; font-size: 0.85rem; padding: 6px 12px; }

/* Tepa: nom chapda, "yopish" o'ngda -- video ustida, yengil soya bilan. */
.player.is-compact .player-top {
    min-height: 0; justify-content: flex-start; gap: 8px; padding: 10px 56px 30px 16px;
    background: linear-gradient(rgb(0 0 0 / 0.62), rgb(0 0 0 / 0.22) 60%, transparent);
}
.player.is-compact .player-title { flex: 1; font-size: 0.95rem; font-weight: 700; text-align: left; }
.player.is-compact .player-top .player-close {
    top: 6px; right: 8px; width: 38px; min-width: 38px; height: 38px; border: 0; background: rgb(40 40 40 / 0.72);
}
.player.is-compact .player-top .player-close .icon { width: 20px; height: 20px; }

/* Pastki panel */
.player.is-compact .player-bottom, .player.is-compact.is-idle .player-bottom {
    position: relative; height: var(--dock); padding: 0 12px 10px; background: #000;
    opacity: 1; transform: none; pointer-events: auto;
}
.player.is-compact .player-seek { margin: 0 4px; padding: 16px 0 14px; }
.player.is-compact .player-seek-track, .player.is-compact .player-seek:hover .player-seek-track {
    height: 4px; border-radius: 99px; background: rgb(255 255 255 / 0.2);
}
.player.is-compact .player-seek-track i { border-radius: inherit; }
.player.is-compact .player-seek-track .played::after {
    width: 16px; height: 16px; margin-top: -8px; right: -8px; transform: scale(1);
    box-shadow: 0 0 0 4px rgb(0 0 0 / 0.5); transition: transform 0.15s var(--ease);
}
.player.is-compact .player-seek:active .player-seek-track .played::after { transform: scale(1.3); }
.player.is-compact .player-seek-tip { bottom: 30px; }

.player.is-compact .player-time {
    position: absolute; left: 16px; right: 16px; top: 36px; display: flex; justify-content: space-between; margin: 0;
    font-size: 0.74rem; font-weight: 600; letter-spacing: 0.03em; color: rgb(255 255 255 / 0.62); pointer-events: none;
}
.player.is-compact .player-time-now { color: #fff; }
.player.is-compact .player-time-sep { display: none; }

/* Tugmalar qatori: ijro guruhi doim o'rtada (bo'sh katakchalar qolsa ham), yon tugmalar chetlarda. */
.player.is-compact .player-row {
    display: grid; grid-template-columns: 44px 44px minmax(0, 1fr) 48px 62px 48px minmax(0, 1fr) 44px 44px;
    align-items: center; gap: 0; margin-top: 22px;
}
.player.is-compact .player-row > * { display: none; }
.player.is-compact .player-row > .player-btn {
    display: inline-flex; grid-row: 1; min-width: 0; width: 44px; height: 44px; padding: 0; border-radius: 50%;
    background: none; color: rgb(255 255 255 / 0.9); justify-self: center;
}
.player.is-compact .player-row > .player-btn:active { background: rgb(255 255 255 / 0.12); }
.player.is-compact .player-row .player-btn .icon { width: 24px; height: 24px; }
.player.is-compact .player-row > [data-menu='tracks'] { grid-column: 1; }
.player.is-compact .player-row > [data-menu='settings'] { grid-column: 2; }
.player.is-compact .player-row > [data-act='back'] { grid-column: 4; width: 48px; height: 48px; }
.player.is-compact .player-row > [data-act='toggle'] { grid-column: 5; width: 58px; height: 58px; background: #fff; color: #0c0c0c; }
.player.is-compact .player-row > [data-act='toggle']:active { background: rgb(255 255 255 / 0.82); }
.player.is-compact .player-row > [data-act='forward'] { grid-column: 6; width: 48px; height: 48px; }
.player.is-compact .player-row > [data-act='back'] .icon, .player.is-compact .player-row > [data-act='forward'] .icon { width: 28px; height: 28px; }
.player.is-compact .player-row > [data-act='toggle'] .icon { width: 26px; height: 26px; }
.player.is-compact.is-paused .player-row > [data-act='toggle'] .icon { margin-left: 3px; }
.player.is-compact .player-row > [data-act='pip'] { grid-column: 8; }
.player.is-compact .player-row > [data-act='next'] { grid-column: 8; }
.player.is-compact.has-next .player-row > [data-act='pip'] { display: none; }
.player.is-compact .player-row > [data-act='fullscreen'] { grid-column: 9; }
.player.is-compact .player-row > .player-time { display: flex; }
.player.is-compact .player-row > [data-act='fill'] { display: none; }
.player.is-compact .player-tracks span, .player.is-compact .player-next span { display: none; }
.player.is-compact .player-btn[data-q]::after { right: 0; bottom: 4px; }
/* Efir: surish yo'q -- o'rtada faqat ijro tugmasi. */
.player.is-compact.is-live .player-row > [data-act='back'], .player.is-compact.is-live .player-row > [data-act='forward'] { display: none !important; }

/* Menyu -- pleer ichida pastdan chiqadigan varaq; ortidagi video xiralashadi (bosilsa -- yopiladi). */
.player.is-compact.has-menu::after { content: ''; position: absolute; inset: 0; z-index: 6; background: rgb(0 0 0 / 0.55); animation: after-in 0.2s ease both; }
.player.is-compact.has-menu .player-bottom { z-index: 7; }
.player.is-compact .player-menu {
    position: absolute; left: 0; right: 0; bottom: 0; width: auto; min-width: 0; z-index: 7;
    max-height: calc(var(--video-h) + var(--dock) - 12px); padding: 22px 8px 10px; border: 0;
    border-radius: 20px 20px 0 0; background: rgb(24 26 27); box-shadow: 0 -12px 40px rgb(0 0 0 / 0.5);
    animation: sheet-in 0.28s var(--ease) both;
}
.player.is-compact .player-menu::before {
    content: ''; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px;
    border-radius: 99px; background: rgb(255 255 255 / 0.22);
}
.player.is-compact .player-item { min-height: 48px; font-size: 0.98rem; border-radius: 10px; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .player.is-compact .player-menu, .player.is-compact.has-menu::after { animation: none; } }
/* Burilgan to'liq ekranda brauzer oynasi tor, pleer esa keng: menyu o'ng tomonda, pleer balandligidan oshmaydi. */
.player.is-rotated .player-menu { position: absolute; left: auto; right: 16px; bottom: 16px; width: 360px; max-height: calc(100vw - 32px); }

/* Ikki marta bosib o'tkazilganda ko'rsatkich: "+ 10 s" / "− 10 s" */
.player-flash {
    position: absolute; z-index: 4; top: 50%; padding: 10px 16px; border-radius: 999px; pointer-events: none;
    background: rgb(0 0 0 / 0.6); color: #fff; font-weight: 700; font-size: 1rem; transform: translateY(-50%);
    animation: flash-in 0.65s var(--ease) both;
}
.player-flash[data-side='left'] { left: 12%; }
.player-flash[data-side='right'] { right: 12%; }
.player.is-compact .player-flash { top: calc((100% - var(--dock)) / 2); font-size: 0.9rem; padding: 8px 14px; }
@keyframes flash-in { 0% { opacity: 0; scale: 0.85; } 20%, 70% { opacity: 1; scale: 1; } 100% { opacity: 0; } }

/* ---------------------------------------------------------------- film sahifasi ichidagi pleer */
/* Pleer alohida sahifada emas: film sahifasining tepasida, fon rasmi turadigan joyda. */
.title-hero.is-watching { padding-top: 0; }
.title-hero.is-watching .title-head { grid-template-columns: minmax(0, 1fr); padding-top: clamp(20px, 3vw, 36px); }
.title-hero.is-watching .title-name { font-size: clamp(1.5rem, 3vw, 2.4rem); }
.title-hero.is-watching .title-logo img { max-height: 90px; }
.play-page.play-inline { height: min(78vh, 760px); min-height: 0; background: #000; }
.play-inline .play-under { display: none; }
.play-inline .play-blocked { min-height: 0; padding: 48px 20px; }
/* Telefon tik holatda: balandlik video va uning ostidagi boshqaruv paneliga teng. */
@media (hover: none) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
    .play-page.play-inline { height: auto; min-height: 0; }
}
/* Telefon yotiq holatda (to'liq ekransiz): pleer ekran balandligini egallaydi. */
@media (hover: none) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
    .play-page.play-inline { height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); }
}
.play-page.play-inline:fullscreen { height: 100%; }
/* Zaxira to'liq ekran (brauzer API bermaganda): sayt sarlavhasi va pastki menyu pleer ustiga chiqmasin. */
html.player-locked .site-header, html.player-locked .tabbar { display: none; }
html.player-locked .title-hero.is-watching { z-index: 1000; }

/* Tomosha paytida film nomi, reyting va janrlar sahifada takrorlanmaydi: nom pleerning o'zida turadi. */
.title-hero.is-watching .title-name, .title-hero.is-watching .title-logo, .title-hero.is-watching .title-original,
.title-hero.is-watching .title-meta, .title-hero.is-watching .scores, .title-hero.is-watching .chips { display: none; }
.title-hero.is-watching .title-actions { margin-top: 0; }
/* Pleer tepasi: kompyuterda chapda "orqaga", telefonda nom chapda va o'ngda "yopish" tugmasi. */
.player-close .ic-back { display: none; }
/* Pleer ochilmagan bo'lsa (video yo'q, obuna kerak), film nomi sahifada ko'rinib turadi. */
.title-hero.is-watching:has(.play-blocked) .title-name, .title-hero.is-watching:has(.play-blocked) .title-logo,
.title-hero.is-watching:has(.play-blocked) .title-meta { display: block; }
.title-hero.is-watching:has(.play-blocked) .title-actions { margin-top: 20px; }

/* ---------------------------------------------------------------- qo'shimcha imkoniyatlar */
/* Subtitr o'lchami va foni (pleer sozlamalaridan) */
.player-subs span { font-size: calc(clamp(1rem, 2.3vw, 1.75rem) * var(--sub-scale, 1)); }
.player.subs-plain .player-subs span { background: none; text-shadow: 0 0 4px #000, 0 1px 3px #000, 0 0 12px rgb(0 0 0 / 0.8); font-weight: 600; }

/* Doimiy ko'rsatkich: 2x tezlik, ovoz, yorug'lik */
.player-badge {
    position: absolute; z-index: 5; top: 16%; left: 50%; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px;
    background: rgb(0 0 0 / 0.65); color: #fff; font-weight: 700; font-size: 0.95rem; white-space: nowrap; pointer-events: none;
}

/* Qismlar ro'yxati */
.player-eps span { font-weight: 600; font-size: 0.88rem; }
.player.is-compact .player-eps { display: none !important; }     /* tik holatda ro'yxat sahifaning o'zida turadi */
.player-menu.is-wide { width: min(420px, calc(100% - 24px)); }
.player-seasons { display: flex; gap: 6px; padding: 4px 4px 10px; overflow-x: auto; scrollbar-width: none; }
.player-seasons .chip { flex: none; min-height: 34px; padding: 0 12px; font-size: 0.85rem; background: rgb(255 255 255 / 0.1); color: #fff; }
.player-seasons .chip[aria-pressed='true'] { background: #fff; color: #111; }
.player-item:disabled { opacity: 0.45; cursor: default; }
.player-item.is-on:disabled { opacity: 1; }
.player-menu.is-wide .player-item span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 760px) { .player-eps span { display: none; } }
@media (hover: none), (pointer: coarse) { .player:not(.is-compact) .player-eps span { display: inline; } }

/* Klaviatura yorliqlari */
.player-keys {
    position: absolute; z-index: 8; inset: 0; margin: auto; width: min(440px, calc(100% - 32px)); height: fit-content;
    padding: 22px 24px; border-radius: 18px; background: rgb(22 25 25 / 0.97); box-shadow: 0 18px 48px rgb(0 0 0 / 0.6);
}
.player-keys h3 { margin-bottom: 12px; font-size: 1.05rem; font-weight: 700; }
.player-keys div { display: flex; justify-content: space-between; gap: 20px; padding: 8px 0; border-bottom: 1px solid rgb(255 255 255 / 0.08); }
.player-keys div:last-child { border-bottom: 0; }
.player-keys dt { font-weight: 600; white-space: nowrap; }
.player-keys dd { color: rgb(255 255 255 / 0.7); text-align: right; }

/* Film logotipi (nom o'rnida) */
.player-title.has-logo { overflow: visible; }
.player-logo { display: inline-grid; justify-items: center; gap: 6px; }
.player-logo img { display: block; max-width: min(440px, 38vw); max-height: clamp(44px, 9vh, 88px); width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 2px 10px rgb(0 0 0 / 0.6)); }
.player-logo small { font-size: clamp(0.85rem, 1.1vw, 1rem); font-weight: 600; letter-spacing: 0.02em; color: rgb(255 255 255 / 0.85); }
.player.is-compact .player-logo { justify-items: start; }
.player.is-compact .player-logo img { max-height: 34px; max-width: 58vw; }
.player.is-compact .player-logo small { font-size: 0.78rem; }

/* "Audio va subtitrlar" oynasi: ustunlar yonma-yon (Kinopoisk/Netflix uslubida), telefonda ketma-ket. */
.player-menu.is-tracks { padding: 14px 10px 10px; }
.player-cols { display: grid; gap: 4px 18px; }
.player-cols.is-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.player-col { min-width: 0; }
.player-col .player-item span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.player-col .player-item.is-on { color: #fff; font-weight: 700; }
.player-col .player-item.is-on .icon { color: var(--amber); }
.player-col-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.player-mini {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px;
    color: rgb(255 255 255 / 0.85); font-size: 0.74rem; font-weight: 700; letter-spacing: 0; text-transform: none;
}
.player-mini .icon { width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) { .player-mini:hover { background: rgb(255 255 255 / 0.1); color: #fff; } }
@media (hover: hover) and (pointer: fine) and (min-width: 761px) {
    .player-menu.is-tracks { width: min(600px, calc(100% - 28px)); max-height: min(64vh, 460px); }
    .player-menu.is-tracks:has(.player-cols:not(.is-two)) { width: min(340px, calc(100% - 28px)); }
}
@media (max-width: 760px), (hover: none), (pointer: coarse) {
    .player-cols.is-two { grid-template-columns: minmax(0, 1fr); }
    .player-col + .player-col { margin-top: 6px; padding-top: 8px; border-top: 1px solid rgb(255 255 255 / 0.1); }
}
@media (hover: none) and (min-width: 700px), (pointer: coarse) and (min-width: 700px) {
    /* Planshet yoki telefon yotiq holatda: joy yetadi -- ustunlar yonma-yon */
    .player-menu.is-tracks { width: min(600px, calc(100% - 16px)); }
    .player-cols.is-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .player-col + .player-col { margin-top: 0; padding-top: 0; border-top: 0; }
}
.player-col > .player-menu-title { display: flex; align-items: center; min-height: 34px; padding-top: 0; padding-bottom: 0; }

/* "Film yoqdimi?" -- film 90% ko'rilganda o'ng yuqori burchakda (videoni to'smaydi), bir bosishda baho. */
.player-rate {
    position: absolute; z-index: 6; top: clamp(70px, 10%, 110px); right: clamp(14px, 2vw, 28px); display: grid; gap: 10px;
    width: min(340px, calc(100% - 28px)); padding: 14px 16px; border-radius: 14px; background: rgb(18 18 18 / 0.88);
    border: 1px solid rgb(255 255 255 / 0.1); box-shadow: 0 14px 40px rgb(0 0 0 / 0.5); backdrop-filter: blur(10px); color: #fff;
    animation: upnext-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.player-rate[hidden] { display: none; }
.player-rate p { display: grid; gap: 2px; padding-right: 26px; }
.player-rate p b { font-size: 1rem; }
.player-rate p span { color: rgb(255 255 255 / 0.65); font-size: 0.82rem; }
.player-rate-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.player-rate-row button { min-height: 38px; padding: 0 4px; border-radius: 9px; background: rgb(255 255 255 / 0.1); color: #fff; font-weight: 600; font-size: 0.84rem; }
.player-rate-row button:hover { background: var(--amber); color: #111; }
.player-rate-close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: rgb(255 255 255 / 0.7); }
.player-rate-close .icon { width: 16px; height: 16px; }
.player.is-compact .player-rate { top: 8px; right: 8px; left: 8px; width: auto; padding: 10px 12px; gap: 8px; }
.player.is-after .player-rate { display: none; }
@media (prefers-reduced-motion: reduce) { .player-rate { animation: none; } }
