/**
 * Оболочка видеоплеера (Plyr) — страница фильма / сериал.
 */

.kinotarjima-player-shell {
	width: 100%;
	max-width: 1100px;
	margin: 1.25rem auto 2rem;
}

.kinotarjima-player__header {
	margin-bottom: 12px;
}

.kinotarjima-player__episodes {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.kinotarjima-player__episodes--single {
	opacity: 0.85;
}

.kinotarjima-player__episodes--single .kinotarjima-player__ep {
	cursor: default;
	pointer-events: none;
}

.kinotarjima-player__ep {
	appearance: none;
	border: 1px solid rgba(255, 255, 255, 0.15);
	background: linear-gradient(180deg, rgba(52, 65, 82, 0.95), rgba(28, 36, 46, 0.98));
	color: #e8eef5;
	font-size: 0.875rem;
	font-weight: 600;
	padding: 10px 16px;
	border-radius: 999px;
	cursor: pointer;
	transition:
		background 0.2s,
		border-color 0.2s,
		transform 0.15s,
		box-shadow 0.2s;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.kinotarjima-player__ep:hover {
	border-color: rgba(245, 179, 1, 0.45);
	transform: translateY(-1px);
}

.kinotarjima-player__ep.is-active {
	background: linear-gradient(135deg, #ffe566, #f5b301);
	color: #1a1a1a;
	border-color: rgba(245, 179, 1, 0.8);
	box-shadow: 0 4px 16px rgba(245, 179, 1, 0.35);
}

/* Варианты качества (480 / 720 / 1080) — под плеером */
.kinotarjima-player__qualities {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	margin-top: 14px;
	padding: 12px 14px;
	background: linear-gradient(160deg, rgba(38, 53, 69, 0.95), rgba(28, 38, 48, 0.98));
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.kinotarjima-player__qualities-label {
	font-size: 0.8rem;
	font-weight: 700;
	color: #9ecae8;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.kinotarjima-player__qualities-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.kinotarjima-player__q {
	appearance: none;
	border: 1px solid rgba(255, 255, 255, 0.18);
	background: rgba(0, 0, 0, 0.25);
	color: #e8eef5;
	font-size: 0.82rem;
	font-weight: 700;
	padding: 8px 14px;
	border-radius: 8px;
	cursor: pointer;
	transition:
		background 0.2s,
		border-color 0.2s,
		color 0.2s;
}

.kinotarjima-player__q:hover {
	border-color: rgba(126, 184, 216, 0.5);
	color: #fff;
}

.kinotarjima-player__q.is-active {
	background: linear-gradient(135deg, #4a7ab0, #355a82);
	border-color: rgba(126, 184, 216, 0.65);
	color: #fff;
}

/* 16:9 + скругление под Plyr / VK iframe */
.kinotarjima-player__stage {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	max-height: min(70vh, 620px);
	background: #0a0e14;
	border-radius: 14px;
	overflow: hidden;
	box-shadow:
		0 8px 32px rgba(0, 0, 0, 0.45),
		inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.kinotarjima-player__video-wrap {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.kinotarjima-player__embed-wrap {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: #000;
}

.kinotarjima-player__vk-iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.kinotarjima-player__stage video {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: contain;
	vertical-align: middle;
}

.kinotarjima-player__stage .plyr {
	height: 100%;
	border-radius: 14px;
}

.kinotarjima-player__stage .plyr__video-wrapper {
	height: 100%;
}

/* Тема Plyr под сайт */
.kinotarjima-player-shell {
	--plyr-color-main: #f5b301;
	--plyr-video-background: #0a0e14;
	--plyr-menu-background: rgba(18, 24, 32, 0.95);
	--plyr-tooltip-background: rgba(18, 24, 32, 0.95);
}

.kinotarjima-player__error {
	margin: 12px 0 0;
	padding: 12px 16px;
	border-radius: 10px;
	background: rgba(231, 76, 60, 0.15);
	border: 1px solid rgba(231, 76, 60, 0.4);
	color: #fadbd8;
	font-size: 0.9rem;
}

@media (max-width: 600px) {
	.kinotarjima-player__episodes {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 6px;
		gap: 6px;
		scrollbar-width: thin;
	}

	.kinotarjima-player__ep {
		flex: 0 0 auto;
		white-space: nowrap;
	}

	.kinotarjima-player__stage {
		border-radius: 10px;
		max-height: none;
	}
}
