		*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

		html, body {
			width: 100%; height: 100%;
			background: #000;
			overflow: hidden;
			font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
			color: #fff;
		}

		#wrap {
			position: relative;
			width: 100vw;
			height: 100vh;
			background: #000;
			display: flex;
			align-items: center;
			justify-content: center;
		}

		video {
			width: 100%;
			height: 100%;
			object-fit: contain;
			display: block;
			background: #000;   /* на ТВ (Android) до первого кадра не должно быть стандартной заглушки браузера */
		}

		#grad-top { display: none; }

		#grad-bot {
			position: absolute;
			bottom: 0; left: 0; right: 0;
			height: 90px;
			background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
			opacity: 0;
			transition: opacity 0.4s ease;
			pointer-events: none;
		}

		#wrap.ui-visible #grad-bot { opacity: 1; }

		#dim-overlay { display: none; }

		#wrap.hide-cursor { cursor: none; }

		#top-bar {
			position: absolute;
			top: 0; left: 0; right: 0;
			padding: 18px 20px;
			display: flex;
			align-items: center;
			gap: 10px;
			opacity: 0;
			transition: opacity 0.4s ease;
			pointer-events: none;
		}

		#wrap.ui-visible #top-bar { opacity: 1; pointer-events: auto; }

		#logo {
			display: inline-flex;
			align-items: baseline;
			font-size: 14px;
			font-weight: 600;
			letter-spacing: 0.01em;
			color: #fff;
			text-decoration: none;
			text-shadow: 0 1px 4px rgba(0,0,0,0.5);
			opacity: 0.40;
			transition: opacity 0.15s;
		}

		#logo:hover { opacity: 1; }


		#controls {
			position: absolute;
			bottom: 0; left: 0; right: 0;
			padding: 0 16px 16px;
			opacity: 0;
			transition: opacity 0.4s ease;
			pointer-events: none;
		}

		#wrap.ui-visible #controls { opacity: 1; pointer-events: auto; }

		#live-badge {
			display: inline-flex;
			align-items: center;
			gap: 5px;
			font-size: 10px;
			font-weight: 700;
			letter-spacing: 0.1em;
			color: #fff;
			background: #e53935;
			padding: 3px 8px;
			border-radius: 2px;
			margin-left: 8px;
			flex-shrink: 0;
		}

		#live-badge::before {
			content: '';
			width: 5px; height: 5px;
			background: #fff;
			border-radius: 50%;
			animation: blink 1.6s ease-in-out infinite;
		}

		@keyframes blink {
			0%, 100% { opacity: 1; }
			50% { opacity: 0.3; }
		}



		#btn-row {
			display: flex;
			align-items: center;
			gap: 2px;
		}

		.btn {
			background: none;
			border: none;
			color: #fff;
			cursor: pointer;
			width: 40px; height: 40px;
			display: flex; align-items: center; justify-content: center;
			border-radius: 50%;
			transition: background 0.15s;
			flex-shrink: 0;
		}

		.btn:hover { background: rgba(255,255,255,0.12); }
		.btn:active { background: rgba(255,255,255,0.2); }

		.btn svg { display: block; pointer-events: none; }

		#vol-group {
			display: flex;
			align-items: center;
		}

		#vol-slider-wrap {
			width: 0;
			height: 36px;   /* высота нужна, иначе overflow:hidden обрезает ползунок до тонкой полоски */
			overflow: hidden;
			transition: width 0.2s;
			display: flex;
			align-items: center;
		}

		#vol-group:hover #vol-slider-wrap { width: 84px; }

		/* сенсорные устройства (как в YouTube): громкость регулируется кнопками телефона;
		   кнопка звука видна только когда видео без звука, чтобы можно было его включить */
		#wrap.touch #vol-slider-wrap { display: none; }
		#wrap.touch:not(.is-muted) #vol-group { display: none; }
		#wrap.touch #btn-pip { display: none !important; }   /* картинка в картинке на телефоне не нужна */

		#vol-slider {
			-webkit-appearance: none;
			appearance: none;
			width: 72px;
			height: 3px;
			/* закрашенная часть слева от кружка (как в YouTube); --v = громкость 0..1, обновляется из JS */
			background: linear-gradient(to right, #fff calc(6.5px + (100% - 13px) * var(--v, 1)), rgba(255,255,255,0.3) calc(6.5px + (100% - 13px) * var(--v, 1)));
			border-radius: 99px;
			outline: none;
			cursor: pointer;
			margin: 0 6px;
		}

		#vol-slider::-webkit-slider-thumb {
			-webkit-appearance: none;
			width: 13px; height: 13px;
			background: #fff;
			border-radius: 50%;
			box-shadow: 0 0 3px rgba(0,0,0,0.4);
			cursor: pointer;
		}

		#vol-slider::-moz-range-track { background: transparent; }

		#vol-slider::-moz-range-thumb {
			width: 13px; height: 13px;
			background: #fff;
			border-radius: 50%;
			border: none;
			box-shadow: 0 0 3px rgba(0,0,0,0.4);
			cursor: pointer;
		}

		.spacer { flex: 1; }

		#right-btns {
			display: flex;
			align-items: center;
			gap: 2px;
		}

 

		#big-play {
			position: absolute;
			top: 50%; left: 50%;
			transform: translate(-50%, -50%);
			width: 74px; height: 74px;
			display: flex; align-items: center; justify-content: center;
			transition: opacity 0.2s, transform 0.2s;
			opacity: 0;
			pointer-events: none;
			cursor: pointer;
			filter: drop-shadow(0 2px 10px rgba(0,0,0,0.5));
		}

		#big-play svg { width: 100%; height: 100%; }

		#big-play.visible { opacity: 1; pointer-events: auto; }
		#big-play:hover { transform: translate(-50%, -50%) scale(1.08); }

		#spinner {
			position: absolute;
			top: 50%; left: 50%;
			transform: translate(-50%, -50%);
			width: 40px; height: 40px;
			pointer-events: none;
			opacity: 0;
			transition: opacity 0.2s;
		}

		#spinner.visible { opacity: 1; }

		#spinner svg { animation: spin 0.9s linear infinite; }

		@keyframes spin { to { transform: rotate(360deg); } }

		/* пока видео на паузе и виден треугольник play — никаких спиннеров, надписей и ошибок */
		#wrap.paused #spinner,
		#wrap.paused #reconn,
		#wrap.paused #error { display: none !important; }

		#error {
			position: absolute;
			top: 50%; left: 50%;
			transform: translate(-50%, -50%);
			width: 88%;
			max-width: 360px;
			text-align: center;
			display: none;
			z-index: 5;
		}

		#error svg { margin-bottom: 10px; }
		#error h3 { font-size: 16px; font-weight: 600; color: #fff; }
		#error p { font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.55); margin-top: 6px; }

		#err-retry {
			margin-top: 16px;
			background: none;
			color: #fff;
			border: 1px solid rgba(255,255,255,0.5);
			padding: 8px 22px;
			border-radius: 2px;
			font-size: 13px;
			cursor: pointer;
		}

		#err-retry:hover { background: rgba(255,255,255,0.12); }

		#reconn {
			position: absolute;
			top: calc(50% + 34px); left: 50%;
			transform: translateX(-50%);
			font-size: 13px;
			color: rgba(255,255,255,0.6);
			display: none;
			pointer-events: none;
		}

	@media (max-width: 600px) {
		#top-bar {
			padding: 12px 14px;
		}

		#logo {
			font-size: 12px;
		}

		#big-play {
			width: 52px;
			height: 52px;
		}
	}


		#share {
			position: absolute;
			top: 0; left: 0; right: 0; bottom: 0;
			display: flex;
			align-items: center;
			justify-content: center;
			background: rgba(0,0,0,0.28);
			opacity: 0;
			pointer-events: none;
			transition: opacity 0.25s ease;
			z-index: 25;
		}
		#share.open { opacity: 1; pointer-events: auto; }

		#share-box {
			padding: 18px 24px 16px;
			background: rgba(20,20,20,0.58);
			-webkit-backdrop-filter: blur(18px);
			backdrop-filter: blur(18px);
			border: 1px solid rgba(255,255,255,0.14);
			border-radius: 18px;
			box-shadow: 0 20px 50px rgba(0,0,0,0.45);
			transform: translateY(8px) scale(0.95);
			transition: transform 0.28s cubic-bezier(.2,.8,.2,1);
			max-width: calc(100% - 32px);
		}
		#share.open #share-box { transform: none; }

		#share-title {
			text-align: center;
			font-size: 13px;
			font-weight: 600;
			letter-spacing: 0.02em;
			color: rgba(255,255,255,0.88);
			margin-bottom: 16px;
		}

		#share-row { display: flex; align-items: flex-start; justify-content: center; gap: 18px; }

		.sh-btn {
			display: flex;
			flex-direction: column;
			align-items: center;
			gap: 9px;
			width: 78px;
			background: none;
			border: none;
			color: #fff;
			text-decoration: none;
			cursor: pointer;
			font: inherit;
		}

		.sh-ic {
			display: flex;
			align-items: center;
			justify-content: center;
			width: 54px; height: 54px;
			border-radius: 50%;
			border: 1px solid rgba(255,255,255,0.3);
			background: rgba(255,255,255,0.06);
			transition: background 0.15s, border-color 0.15s, transform 0.15s;
		}

		.sh-ic svg { display: block; pointer-events: none; }
		.sh-btn:hover .sh-ic, .sh-btn:focus-visible .sh-ic { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.55); transform: translateY(-2px); }
		.sh-btn:active .sh-ic { transform: scale(0.95); }
		.sh-btn:focus { outline: none; }

		.sh-lb { font-size: 12px; color: rgba(255,255,255,0.78); white-space: nowrap; }

		#share-note {
			text-align: center;
			min-height: 16px;
			margin-top: 14px;
			font-size: 12px;
			color: rgba(255,255,255,0.7);
			opacity: 0;
			transition: opacity 0.25s;
		}
		#share-note.on { opacity: 1; }

		@media (max-width: 600px) {
			#share-box { padding: 16px 14px 14px; }
			#share-row { gap: 6px; }
			.sh-btn { width: 72px; }
			.sh-ic { width: 50px; height: 50px; }
			#live-badge { margin-left: 4px; }
		}


		/* баннерная реклама: узкая полоса внизу плеера (включается галочкой в админке).
		   Двигаем только transform/opacity (без пересчёта раскладки), чтобы не нагружать видео */
		#adbar {
			position: absolute;
			left: 0; right: 0; bottom: 0;
			z-index: 15;
			display: flex;
			justify-content: center;
			padding: 0 8px;
			pointer-events: none;
			opacity: 0;
			visibility: hidden;
			transform: translateY(120%);
			transition: transform 0.4s cubic-bezier(.2,.8,.2,1), opacity 0.3s ease, visibility 0s linear 0.4s;
		}
		/* баннер грузится невидимым: он на экране (чтобы рекламная сеть его отрисовала), но прозрачный и некликабельный */
		#adbar.pre { visibility: visible; transform: none; transition: none; }
		/* выезжает только когда реклама реально отрисовалась */
		#adbar.on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s, 0s, 0s; }
		#wrap.ui-visible #adbar.on { transform: translateY(-60px); }   /* когда видны кнопки плеера, баннер поднимается над ними */
		#adbox { position: relative; pointer-events: none; background: rgba(0,0,0,0.55); border-radius: 6px 6px 0 0; }
		#adbar.on #adbox { pointer-events: auto; }
		#adfr { width: 100%; height: 100%; overflow: hidden; border-radius: 6px 6px 0 0; }
		#adx {
			position: absolute;
			top: -26px; right: 0;
			width: 24px; height: 24px;
			padding: 0;
			display: flex; align-items: center; justify-content: center;
			background: rgba(0,0,0,0.7);
			color: #fff;
			border: none;
			border-radius: 50%;
			font-size: 12px;
			line-height: 1;
			cursor: pointer;
		}
		#adx:hover { background: rgba(0,0,0,0.9); }

