/* Reklama admin belgilagan foizli joyda videoning ustida turadi. */
.video-box.custom-video-player { aspect-ratio: auto; }
.video-box.custom-video-player:not(.ad-is-expanded) { max-width: min(var(--ad-width-limit, 360px), calc((100vh - 240px) * .5625)); max-width: min(var(--ad-width-limit, 360px), calc((100dvh - 240px) * .5625)); }
.ad-player { position: relative; width: 100%; display: flex; flex-direction: column; margin: 0 auto; background: #000; }
.video-advertisement { position: absolute; z-index: 2; pointer-events: none; user-select: none; }
.video-advertisement img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ad-player-media { position: relative; flex: 0 0 auto; width: 100%; height: 0; padding-top: 177.777778%; min-height: 0; overflow: hidden; isolation: isolate; }
.video-box .ad-player-media > iframe { position: absolute; inset: 0; display: block; width: 100% !important; height: 100% !important; max-width: none; max-height: none; }
.ad-fullscreen-button { position: absolute; right: 8px; bottom: 48px; z-index: 5; display: inline-flex; align-items: center; justify-content: center; gap: 6px; max-width: calc(100% - 16px); border: 0; border-radius: 6px; padding: 8px 10px; min-height: 44px; background: transparent; color: #fff; font: 700 14px/1.2 Arial, sans-serif; text-shadow: 0 1px 3px #000, 0 0 5px #000; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.youtube-play-gate { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: #000; }
.youtube-play-gate[hidden] { display: none; }
.youtube-play-gate:not([hidden]) ~ .ad-fullscreen-button { bottom: 8px; }
.youtube-start-button { display: grid; place-items: center; width: 76px; height: 76px; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.youtube-start-button svg { width: 38px; height: 38px; fill: currentColor; }
.youtube-start-button:disabled { opacity: .6; cursor: wait; }
.youtube-play-gate[data-state="loading"] .youtube-start-button { position: relative; cursor: progress; }
.youtube-play-gate[data-state="loading"] .youtube-start-button svg { visibility: hidden; }
.youtube-play-gate[data-state="loading"] .youtube-start-button::after { content: ""; position: absolute; width: 30px; height: 30px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: youtube-loading-spin .8s linear infinite; }
.youtube-player-status { position: absolute; top: calc(50% + 50px); left: 12px; right: 12px; margin: 0; color: #fff; font: 14px/1.4 Arial, sans-serif; text-align: center; }
.youtube-player-status:empty { display: none; }
@keyframes youtube-loading-spin { to { transform: rotate(360deg); } }
.ad-fullscreen-icon { flex: 0 0 18px; width: 18px; height: 18px; filter: drop-shadow(0 1px 2px #000); }
.ad-fullscreen-close, .ad-fullscreen-button[aria-expanded="true"] .ad-fullscreen-open { display: none; }
.ad-fullscreen-button[aria-expanded="true"] .ad-fullscreen-close { display: inline; }
.ad-fullscreen-button:focus-visible { outline: 3px solid #70e18a; outline-offset: -3px; }
.youtube-start-button:focus-visible { outline: 3px solid #70e18a; outline-offset: 4px; }
.custom-video-player.telegram-mode { --ad-width-limit: 420px; min-height: 0; overflow: hidden; border-radius: 18px; background: #000; }
.custom-video-player.telegram-mode:not(.has-advertisement):not(.ad-is-expanded) .ad-player-media { height: auto; padding-top: 0; }
.custom-video-player.telegram-mode:not(.has-advertisement) .telegram-holder { min-height: 280px; }
.has-advertisement.telegram-mode .ad-player-media { background: #fff; }
.has-advertisement.telegram-mode .telegram-holder { height: 100%; min-height: 0; overflow-y: auto; }
.has-advertisement.telegram-mode .telegram-holder { position: absolute; inset: 0; width: 100%; }
body.ad-player-expanded { overflow: hidden; }
/* Qisqa ekranda til tanlash va QR tugmasi uchun ham joy qoldiramiz. */
@media (max-height: 740px) {
    .video-box.custom-video-player:not(.ad-is-expanded) { max-width: min(330px, calc((100vh - 210px) * .5625)); max-width: min(330px, calc((100dvh - 210px) * .5625)); }
}
@media (orientation: landscape) and (max-height: 500px) {
    .custom-video-player:not(.ad-is-expanded) .youtube-play-gate:not([hidden]) ~ .ad-fullscreen-button .ad-fullscreen-label { display: none; }
    .custom-video-player:not(.ad-is-expanded) .youtube-player-status { display: none; }
}
/* Ushbu klass native fullscreen va telefonlardagi sahifa ichidagi rejimda bir xil. */
.video-box.custom-video-player.ad-is-expanded { position: fixed; inset: 0; z-index: 10000; display: flex !important; align-items: center; justify-content: center; width: 100%; max-width: none; height: 100vh; height: 100dvh; height: var(--qr-expanded-height, 100dvh); margin: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); border-radius: 0; background: #000; overflow: hidden; box-shadow: none; }
.ad-is-expanded .ad-player { flex: 0 0 auto; align-self: center; max-width: 100%; margin: auto; }
.custom-video-player.ad-is-expanded.telegram-mode .telegram-holder { height: 100%; min-height: 0; overflow-y: auto; }
