.yt-custom {
	position: relative;
	width: 100%;
	aspect-ratio: var(--ratio, 16 / 9); /* proporcje ustawiane z PHP dla każdego filmu */
	background: #000;
	overflow: hidden;
}

.yt-custom__frame,
.yt-custom__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Warstwa nad iframe: miniatura przed startem i w pauzie,
   przezroczysta podczas odtwarzania (kliknięcie = pauza) */
.yt-custom__overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	padding: 0;
	border: 0;
	cursor: pointer;
	background: #000 var(--poster) center / cover no-repeat;
}
.yt-custom.is-playing .yt-custom__overlay {
	background: transparent;
}
.yt-custom.needs-tap .yt-custom__overlay {
	opacity: 0;
	pointer-events: none;
}
.yt-custom__overlay:focus-visible {
	outline: 3px solid #fff;
	outline-offset: -3px;
}

/* Duży przycisk play */
.yt-custom__big-play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 56px;
	height: 56px;
	margin: -28px 0 0 -28px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .6);
}
.yt-custom__big-play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -10px 0 0 -6px;
	border-style: solid;
	border-width: 10px 0 10px 17px;
	border-color: transparent transparent transparent #fff;
}
.yt-custom.is-playing .yt-custom__big-play { display: none; }
.yt-custom.is-loading .yt-custom__big-play { opacity: .5; }

/* Pasek sterowania */
.yt-custom__controls {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 3;
	display: none;
	align-items: center;
	gap: 4px;
	padding: 4px 6px;
	background: linear-gradient(transparent, rgba(0, 0, 0, .7));
	transition: opacity .2s;
}
.yt-custom.is-started .yt-custom__controls { display: flex; }

/* Na urządzeniach z myszką wszystkie przyciski są ukryte,
   dopóki kursor nie znajdzie się nad filmem (lub fokus z klawiatury) */
@media (hover: hover) {
	.yt-custom .yt-custom__big-play,
	.yt-custom .yt-custom__controls {
		opacity: 0;
		transition: opacity .2s;
	}
	.yt-custom:hover .yt-custom__big-play,
	.yt-custom:hover .yt-custom__controls,
	.yt-custom:focus-within .yt-custom__big-play,
	.yt-custom:focus-within .yt-custom__controls {
		opacity: 1;
	}
}

.yt-custom__btn {
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	background: none;
	color: #fff;
	font-size: 14px;
	line-height: 30px;
	cursor: pointer;
}
.yt-custom__btn:focus-visible { outline: 2px solid #fff; }

.yt-custom__progress {
	flex: 1 1 auto;
	min-width: 0;
	accent-color: #fff;
	cursor: pointer;
}

/* Pełny ekran */
.yt-custom:fullscreen { width: 100%; height: 100%; aspect-ratio: auto; }
.yt-custom:-webkit-full-screen { width: 100%; height: 100%; }
