/* TV for YouTube: scoped under .yttv so themes are untouched. */
.yttv {
	--yttv-bg: #0a0a0b;
	--yttv-fg: #fafafa;
	--yttv-muted: #a1a1aa;
	--yttv-line: rgba(255, 255, 255, 0.12);
	--yttv-pill: rgba(255, 255, 255, 0.08);
	position: relative;
	max-width: 100%;
	color: var(--yttv-fg);
	font-family: inherit;
	outline: none;
}

.yttv *,
.yttv *::before,
.yttv *::after {
	box-sizing: border-box;
}

.yttv:focus-visible {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #18181b;
	border-radius: 14px;
}

/* Channel pills */
.yttv-top {
	margin: 0 0 10px;
}

.yttv-pills {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	scrollbar-width: none;
}

.yttv-pills::-webkit-scrollbar {
	display: none;
}

.yttv-pill {
	flex: 0 0 auto;
	padding: 6px 12px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 13px;
	line-height: 1.2;
	cursor: pointer;
	opacity: 0.7;
}

.yttv-pill.is-on {
	background: #18181b;
	border-color: #18181b;
	color: #fafafa;
	opacity: 1;
}

/* TV stage */
.yttv-stage {
	position: relative;
	overflow: hidden;
	border-radius: 14px;
	background: var(--yttv-bg);
}

.yttv-scroller {
	height: min(78vh, 760px);
	overflow-y: auto;
	overscroll-behavior: contain;
	scroll-snap-type: y mandatory;
	scrollbar-width: none;
}

.yttv-scroller::-webkit-scrollbar {
	display: none;
}

.yttv-slide {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	/* The parallax moves each picture inside its own slide; without this the
	   next one slid up into the current slide on the inline TV. */
	overflow: hidden;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.yttv-media {
	position: relative;
	flex: 1;
	min-height: 0;
	background: var(--yttv-bg);
}

.yttv-poster,
.yttv-frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.yttv-poster {
	object-fit: contain;
	opacity: 0.55;
}

/* Touch screens: a cross-origin iframe swallows touches, so a layer above it
   catches swipes and taps; the bottom strip stays open for YouTube's controls. */
.yttv-tap {
	position: absolute;
	inset: 0 0 56px 0;
	display: none;
}

@media (pointer: coarse) {
	.yttv-tap {
		display: block;
	}
}

.yttv-info {
	padding: 12px 16px 14px;
	border-top: 1px solid var(--yttv-line);
}

.yttv-title {
	margin: 0;
	color: var(--yttv-fg);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.yttv-meta {
	margin: 4px 0 0;
	color: var(--yttv-muted);
	font-size: 12px;
}

.yttv-flash {
	position: absolute;
	left: 50%;
	top: 42%;
	z-index: 3;
	transform: translate(-50%, -50%);
	padding: 10px 18px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	pointer-events: none;
	opacity: 0;
}

.yttv-flash.is-on {
	animation: yttv-flash 1.2s ease-out;
}

@keyframes yttv-flash {
	0% { opacity: 0; transform: translate(-50%, -40%); }
	15% { opacity: 1; transform: translate(-50%, -50%); }
	75% { opacity: 1; }
	100% { opacity: 0; }
}

.yttv-mute {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	padding: 6px 12px;
	border: 1px solid var(--yttv-line);
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font: inherit;
	font-size: 12px;
	cursor: pointer;
}

.yttv-nav {
	position: absolute;
	right: 12px;
	top: 50%;
	z-index: 3;
	display: flex;
	flex-direction: column;
	gap: 8px;
	transform: translateY(-50%);
}

.yttv-navbtn {
	width: 36px;
	height: 36px;
	border: 1px solid var(--yttv-line);
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 16px;
	cursor: pointer;
}

@media (pointer: coarse) {
	.yttv-nav {
		display: none;
	}
}

.yttv-hint {
	margin: 8px 0 0;
	font-size: 12px;
	opacity: 0.7;
}

@media (max-width: 640px) {
	.yttv-scroller {
		height: calc(100svh - 140px);
	}

	.yttv-stage {
		border-radius: 10px;
	}
}

/* Gallery and carousel */
.yttv-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
}

.yttv-row {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(260px, 32%);
	gap: 14px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 6px;
}

.yttv-row .yttv-card {
	scroll-snap-align: start;
}

.yttv-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.yttv-thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 10px;
	background: #0a0a0b;
}

.yttv-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ── The play button ───────────────────────────────────────────────────
   Brushed graphite with a top highlight, ringed by a rotating green energy
   band and a soft breathing glow. Used on every thumbnail and facade, and
   as the pause / play badge in the TV. */
.yttv-play,
.yttv-state {
	--yttv-energy: #3dff8f;
	position: absolute;
	left: 50%;
	top: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	color: #f3f5f7;
	background:
		radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 52%),
		radial-gradient(circle at 50% 120%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 55%),
		linear-gradient(160deg, #7a7f87 0%, #3a3e44 38%, #16181b 58%, #2c2f35 78%, #5b6068 100%);
	box-shadow:
		inset 0 1px 1px rgba(255, 255, 255, 0.55),
		inset 0 -2px 5px rgba(0, 0, 0, 0.65),
		0 0 0 2px rgba(8, 10, 12, 0.92),
		0 6px 16px rgba(0, 0, 0, 0.45);
	transform: translate(-50%, -50%);
	transition: transform 0.2s ease;
}

.yttv-play svg,
.yttv-state svg {
	width: 44%;
	height: 44%;
	fill: currentColor;
	filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.7));
}

/* The ring: a conic gradient masked to a 3px band just outside the button. */
.yttv-play::before,
.yttv-state::before {
	content: "";
	position: absolute;
	inset: -6px;
	padding: 3px;
	border-radius: 50%;
	background: conic-gradient(
		rgba(61, 255, 143, 0.18) 0deg,
		var(--yttv-energy) 70deg,
		#d6ffe6 96deg,
		var(--yttv-energy) 122deg,
		rgba(61, 255, 143, 0.18) 200deg,
		var(--yttv-energy) 290deg,
		rgba(61, 255, 143, 0.18) 360deg
	);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
	filter: drop-shadow(0 0 4px rgba(61, 255, 143, 0.9));
	animation: yttv-ring 2.2s linear infinite;
	pointer-events: none;
}

.yttv-play::after,
.yttv-state::after {
	content: "";
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	box-shadow: 0 0 16px 3px rgba(61, 255, 143, 0.42);
	animation: yttv-breathe 1.8s ease-in-out infinite;
	pointer-events: none;
}

@keyframes yttv-ring {
	to { transform: rotate(360deg); }
}

@keyframes yttv-breathe {
	50% { opacity: 0.35; }
}

.yttv-thumb:hover .yttv-play,
.yttv-facade:hover .yttv-play {
	transform: translate(-50%, -50%) scale(1.06);
}

/* TV: the badge over the picture. Hidden until a tap. */
.yttv-state {
	top: 46%;
	z-index: 3;
	width: 84px;
	height: 84px;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, -50%) scale(0.88);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.yttv-state.is-held {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.yttv-state.is-blink {
	animation: yttv-blink 0.9s ease-out;
}

@keyframes yttv-blink {
	0% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
	20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
	100% { opacity: 0; transform: translate(-50%, -50%) scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
	.yttv-play::before,
	.yttv-state::before,
	.yttv-play::after,
	.yttv-state::after {
		animation: none;
	}
}

.yttv-card-title {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.yttv-card-meta {
	font-size: 12px;
	opacity: 0.65;
}

.yttv-empty {
	padding: 12px 14px;
	border: 1px dashed #d4d4d8;
	border-radius: 8px;
	font-size: 14px;
}

@media (max-width: 640px) {
	.yttv-row {
		grid-auto-columns: 82%;
	}
}

/* ── Full screen TV (the default) ─────────────────────────────────────
   Covers the window and the page underneath stops scrolling. Solid bands,
   never laid over the player (YouTube draws its own title and controls on
   the picture): top bar, the video, its title, then the sponsor bar. */
html.yttv-lock,
html.yttv-lock body {
	overflow: hidden !important;
	overscroll-behavior: none;
}

.yttv.is-full {
	position: fixed;
	inset: 0;
	z-index: 99990;
	max-width: none;
	margin: 0;
	background: #000;
	color: #fff;
}

body.admin-bar .yttv.is-full {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .yttv.is-full {
		top: 46px;
	}
}

.yttv.is-full:focus-visible {
	box-shadow: none;
}

.yttv.is-full .yttv-stage {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	border-radius: 0;
}

.yttv.is-full .yttv-topbar {
	position: relative;
	z-index: 4;
	flex: none;
	display: flex;
	align-items: center;
	gap: 14px;
	height: 56px;
	padding: 0 max(16px, 3vw);
	border-bottom: 1px solid var(--yttv-line);
	background: var(--yttv-bg);
}

.yttv.is-full .yttv-home {
	flex-shrink: 0;
	max-width: 30vw;
	overflow: hidden;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.yttv.is-full .yttv-top {
	flex: 1;
	min-width: 0;
	margin: 0;
}

.yttv.is-full .yttv-pill {
	border-color: rgba(255, 255, 255, 0.24);
	color: #fff;
	opacity: 1;
}

.yttv.is-full .yttv-pill.is-on {
	border-color: #fff;
	background: #fff;
	color: #0a0a0b;
}

.yttv.is-full .yttv-mute {
	position: static;
	flex-shrink: 0;
}

.yttv.is-full .yttv-scroller {
	flex: 1;
	min-height: 0;
	height: auto;
}

.yttv.is-full .yttv-slide {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
}

/* The picture layer the parallax moves. */
.yttv.is-full .yttv-media {
	will-change: transform;
	transform-origin: 50% 50%;
}

.yttv.is-full .yttv-poster {
	object-fit: cover;
	opacity: 0.45;
}

.yttv.is-full .yttv-info {
	position: relative;
	z-index: 2;
	flex: none;
	padding: 12px max(16px, 3vw) 14px;
	background: var(--yttv-bg);
	opacity: var(--yttv-fade, 1);
}

.yttv.is-full .yttv-title {
	font-size: clamp(15px, 1.6vw, 20px);
}

.yttv.is-full .yttv-nav {
	right: max(16px, 3vw);
	transition: opacity 0.35s ease;
}

/* Idle: the arrows and the cursor step back; the bands stay put. */
.yttv.is-full.is-idle .yttv-nav {
	opacity: 0;
}

.yttv.is-full.is-idle .yttv-media {
	cursor: none;
}

/* First-visit hint, above the title band. */
.yttv-tip {
	position: absolute;
	left: 50%;
	bottom: calc(var(--yttv-below, 0px) + 128px);
	z-index: 5;
	transform: translateX(-50%);
	padding: 8px 14px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	font-size: 13px;
	white-space: nowrap;
	pointer-events: none;
	transition: opacity 0.5s ease;
}

.yttv-tip.is-gone {
	opacity: 0;
}

@media (max-width: 640px) {
	.yttv.is-full .yttv-home {
		display: none;
	}

	.yttv-tip {
		width: max-content;
		max-width: 86vw;
		white-space: normal;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.yttv-media {
		transform: none !important;
	}
}

/* ── TV styles ─────────────────────────────────────────────────────────
   guide: a channel column beside the picture. guide_grid: the same column
   with each channel's next three videos. solo: no channel controls. On
   phones the column is a drawer behind the Channels button. */
.yttv.has-guide {
	--yttv-guide-w: 280px;
}

.yttv.yttv-style-guide-grid {
	--yttv-guide-w: 340px;
}

.yttv.has-guide:not(.is-full) .yttv-top {
	margin: 0;
}

.yttv.yttv-style-solo:not(.is-full) .yttv-top {
	display: none;
}

.yttv-body {
	position: relative;
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.yttv-body > .yttv-stage {
	flex: 1;
	min-width: 0;
}

.yttv-guide {
	display: flex;
	flex: none;
	flex-direction: column;
	width: var(--yttv-guide-w);
	height: min(78vh, 760px);
	overflow: hidden;
	border: 1px solid var(--yttv-line);
	border-radius: 14px;
	background: var(--yttv-bg);
	color: var(--yttv-fg);
}

.yttv-guide-head {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: space-between;
	height: 48px;
	padding: 0 14px;
	border-bottom: 1px solid var(--yttv-line);
}

.yttv-guide-title {
	color: var(--yttv-muted);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.yttv-guide-close {
	display: none;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 1px solid var(--yttv-line);
	border-radius: 999px;
	background: transparent;
	color: #fff;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.yttv-guide-list {
	position: relative;
	flex: 1;
	min-height: 0;
	padding: 6px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.yttv-ch {
	border-radius: 12px;
	transition: background 0.2s ease;
}

.yttv-ch + .yttv-ch {
	margin-top: 2px;
}

.yttv-ch.is-on {
	background: rgba(255, 255, 255, 0.06);
	box-shadow: inset 0 0 0 1px rgba(61, 255, 143, 0.28);
}

.yttv-ch-pick {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.yttv-ch-pick:hover {
	background: rgba(255, 255, 255, 0.06);
}

.yttv-ch-pick:focus-visible {
	outline: 2px solid #3dff8f;
	outline-offset: -2px;
}

/* The same brushed graphite as the play button; the channel on now wears
   the green ring. */
.yttv-ch-avatar {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	color: #f3f5f7;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
	background:
		radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 55%),
		linear-gradient(160deg, #7a7f87 0%, #3a3e44 38%, #16181b 58%, #2c2f35 78%, #5b6068 100%);
	box-shadow:
		inset 0 1px 1px rgba(255, 255, 255, 0.5),
		inset 0 -2px 4px rgba(0, 0, 0, 0.6),
		0 0 0 1px rgba(8, 10, 12, 0.9);
}

.yttv-ch.is-on .yttv-ch-avatar {
	box-shadow:
		inset 0 1px 1px rgba(255, 255, 255, 0.5),
		inset 0 -2px 4px rgba(0, 0, 0, 0.6),
		0 0 0 2px #0a0a0b,
		0 0 0 4px #3dff8f,
		0 0 14px 3px rgba(61, 255, 143, 0.45);
	animation: yttv-onair 1.8s ease-in-out infinite;
}

@keyframes yttv-onair {
	50% {
		box-shadow:
			inset 0 1px 1px rgba(255, 255, 255, 0.5),
			inset 0 -2px 4px rgba(0, 0, 0, 0.6),
			0 0 0 2px #0a0a0b,
			0 0 0 4px rgba(61, 255, 143, 0.6),
			0 0 6px 1px rgba(61, 255, 143, 0.25);
	}
}

.yttv-ch-text {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.yttv-ch-name,
.yttv-ch-now {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.yttv-ch-name {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
}

.yttv-ch-now {
	margin-top: 2px;
	color: var(--yttv-muted);
	font-size: 12px;
}

.yttv-ch.is-on .yttv-ch-now::before {
	content: "Now ";
	color: #3dff8f;
	font-weight: 700;
}

/* guide_grid: three thumbnails under the row, lined up with the name. */
.yttv-ch-next {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 6px;
	padding: 0 8px 10px 54px;
}

.yttv-ch-thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--yttv-line);
	border-radius: 7px;
	background: #000;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.yttv-ch-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.82;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.yttv-ch-thumb:hover,
.yttv-ch-thumb:focus-visible {
	border-color: rgba(61, 255, 143, 0.7);
	box-shadow: 0 0 10px rgba(61, 255, 143, 0.35);
	outline: none;
}

.yttv-ch-thumb:hover img,
.yttv-ch-thumb:focus-visible img {
	opacity: 1;
	transform: scale(1.06);
}

/* Phones only: the button that opens the guide. */
.yttv-chbtn {
	display: none;
	align-items: center;
	gap: 8px;
	max-width: 100%;
	padding: 7px 14px;
	border: 1px solid #18181b;
	border-radius: 999px;
	background: #18181b;
	color: #fafafa;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}

.yttv-chbtn::before {
	content: "";
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #3dff8f;
	box-shadow: 0 0 8px rgba(61, 255, 143, 0.8);
}

.yttv-chbtn-label {
	flex: none;
	font-weight: 700;
}

.yttv-chbtn-now {
	min-width: 0;
	overflow: hidden;
	color: var(--yttv-muted);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.yttv-guide-scrim {
	display: none;
}

/* Full screen: the guide is the left column from top to bottom, the TV
   (top bar, picture, bands) fills the rest. */
.yttv.is-full.has-guide .yttv-stage {
	left: var(--yttv-guide-w);
}

.yttv.is-full .yttv-guide {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	z-index: 6;
	height: auto;
	border: 0;
	border-right: 1px solid var(--yttv-line);
	border-radius: 0;
}

.yttv.is-full .yttv-guide-head {
	height: 56px;
	padding: 0 16px;
}

.yttv.is-full .yttv-chbtn {
	border-color: rgba(255, 255, 255, 0.24);
	background: transparent;
}

@media (max-width: 760px) {
	.yttv.has-guide .yttv-chbtn {
		display: inline-flex;
	}

	.yttv.has-guide:not(.is-full) .yttv-top {
		margin: 0 0 10px;
	}

	.yttv-body {
		display: block;
	}

	.yttv.has-guide .yttv-guide {
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 8;
		width: min(86vw, 340px);
		height: auto;
		border: 0;
		border-right: 1px solid var(--yttv-line);
		border-radius: 0 14px 14px 0;
		box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
		transform: translateX(-104%);
		visibility: hidden;
		transition: transform 0.25s ease, visibility 0s linear 0.25s;
	}

	.yttv.has-guide.is-guide-open .yttv-guide {
		transform: none;
		visibility: visible;
		transition: transform 0.25s ease;
	}

	.yttv.has-guide .yttv-guide-scrim {
		position: absolute;
		inset: 0;
		z-index: 7;
		display: block;
		background: rgba(0, 0, 0, 0.55);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.25s ease;
	}

	.yttv.has-guide.is-guide-open .yttv-guide-scrim {
		opacity: 1;
		pointer-events: auto;
	}

	.yttv.has-guide .yttv-guide-close {
		display: inline-flex;
	}

	.yttv.is-full.has-guide .yttv-stage {
		left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.yttv.has-guide .yttv-guide,
	.yttv.has-guide .yttv-guide-scrim {
		transition: none;
	}

	.yttv-ch.is-on .yttv-ch-avatar {
		animation: none;
	}
}

/* ── Sponsor bar ──────────────────────────────────────────────────────
   Under the inline TV, gallery or carousel; the last band of the full
   screen TV. Rotates one at a time, two side by side, or one. */
.yttv-sponsors {
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 60px;
	margin-top: 10px;
	padding: 8px 14px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.02);
}

.yttv-sponsors-label {
	flex-shrink: 0;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.6;
}

.yttv-sponsors-track {
	display: flex;
	flex: 1;
	min-width: 0;
	gap: 12px;
}

.yttv-sponsor {
	display: none;
	flex: 1;
	min-width: 0;
	align-items: center;
	gap: 10px;
	padding: 6px 10px;
	border-radius: 10px;
	color: inherit;
	text-decoration: none;
	transition: background 0.2s;
}

.yttv-sponsor:hover {
	background: rgba(127, 127, 127, 0.12);
}

.yttv-sponsor.is-on {
	display: flex;
	animation: yttv-sponsor-in 0.45s ease;
}

/* No JavaScript: the first sponsor still shows. */
.yttv-sponsors:not(.is-rotate):not(.is-pair):not(.is-single) .yttv-sponsor:first-child {
	display: flex;
}

@keyframes yttv-sponsor-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

.yttv-sponsor img {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	object-fit: contain;
	background: #fff;
}

.yttv-sponsor-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.yttv-sponsor-name {
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.yttv-sponsor-line {
	overflow: hidden;
	font-size: 12px;
	text-overflow: ellipsis;
	white-space: nowrap;
	opacity: 0.7;
}

/* Full screen: a solid dark band along the bottom, always in view. */
.yttv.is-full .yttv-sponsors {
	position: relative;
	z-index: 3;
	flex: none;
	min-height: 64px;
	margin: 0;
	padding: 8px max(16px, 3vw);
	border: 0;
	border-top: 1px solid var(--yttv-line);
	border-radius: 0;
	background: #111113;
	color: #fff;
}

@media (max-width: 640px) {
	.yttv-sponsors.is-pair .yttv-sponsor.is-on + .yttv-sponsor.is-on {
		display: none;
	}

	.yttv-sponsors-label {
		writing-mode: vertical-rl;
		transform: rotate(180deg);
		font-size: 9px;
	}
}

/* ── Continue reading ticker ──────────────────────────────────────────
   A slim band that scrolls the site's latest articles; hover pauses it. */
.yttv-reading {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 44px;
	margin-top: 10px;
	padding: 0 14px;
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.02);
}

.yttv-reading-label {
	flex-shrink: 0;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.6;
}

.yttv-reading-window {
	position: relative;
	flex: 1;
	min-width: 0;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
	mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
}

.yttv-reading-track {
	display: flex;
	width: max-content;
	gap: 28px;
}

.yttv-reading.is-moving .yttv-reading-track {
	animation: yttv-ticker var(--yttv-ticker-s, 40s) linear infinite;
}

.yttv-reading:hover .yttv-reading-track,
.yttv-reading:focus-within .yttv-reading-track {
	animation-play-state: paused;
}

@keyframes yttv-ticker {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

.yttv-read {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: inherit;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}

.yttv-read:hover span {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.yttv-read img {
	width: 28px;
	height: 28px;
	border-radius: 6px;
	object-fit: cover;
}

.yttv-read + .yttv-read::before {
	content: "";
	width: 4px;
	height: 4px;
	margin-right: 20px;
	border-radius: 999px;
	background: currentColor;
	opacity: 0.35;
}

.yttv.is-full .yttv-reading {
	flex: none;
	height: 46px;
	margin: 0;
	padding: 0 max(16px, 3vw);
	border: 0;
	border-top: 1px solid var(--yttv-line);
	border-radius: 0;
	background: var(--yttv-bg);
	color: #fff;
}

@media (prefers-reduced-motion: reduce) {
	.yttv-reading.is-moving .yttv-reading-track {
		animation: none;
	}

	.yttv-reading-window {
		overflow-x: auto;
	}
}

/* ── Views: gallery columns, list, shorts, theater, latest ────────── */
.yttv-grid {
	grid-template-columns: repeat(var(--yttv-cols, 3), minmax(0, 1fr));
}

@media (max-width: 900px) {
	.yttv-grid {
		grid-template-columns: repeat(min(var(--yttv-cols, 3), 2), minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.yttv-grid {
		grid-template-columns: 1fr;
	}
}

.yttv-card-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

/* List: thumbnail left, text right. */
.yttv-list-view {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.yttv-card.is-row {
	display: grid;
	grid-template-columns: minmax(160px, 34%) 1fr;
	gap: 16px;
	align-items: start;
}

.yttv-card-desc {
	font-size: 13px;
	line-height: 1.5;
	opacity: 0.75;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

@media (max-width: 560px) {
	.yttv-card.is-row {
		grid-template-columns: 1fr;
	}
}

/* Shorts: vertical cards. Not ".yttv-shorts": the block root carries that
   class for this view (yttv-<layout>), so the whole player became the grid. */
.yttv-shorts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 14px;
}

.yttv-thumb.is-vertical {
	aspect-ratio: 9 / 16;
}

/* Header: channel name, count, Subscribe. */
.yttv-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 12px;
}

.yttv-head-name {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
}

.yttv-head-sub {
	margin: 2px 0 0;
	font-size: 13px;
	opacity: 0.65;
}

.yttv-subscribe {
	flex-shrink: 0;
	padding: 8px 16px;
	border-radius: 999px;
	background: #ff0033;
	color: #fff !important;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none !important;
}

.yttv-subscribe:hover {
	filter: brightness(1.08);
}

/* Search and Load more. */
.yttv-tools:empty {
	display: none;
}

.yttv-tools {
	margin: 0 0 12px;
}

.yttv-search {
	box-sizing: border-box;
	width: 100%;
	max-width: 360px;
	height: 38px;
	padding: 0 12px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 8px;
	font: inherit;
	font-size: 14px;
}

.yttv-more {
	display: block;
	margin: 16px auto 0;
	padding: 9px 20px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.yttv-more[hidden] {
	display: none;
}

/* Theater: big player, list beside it (below on phones). */
.yttv-theater-wrap {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 18px;
	align-items: start;
}

.yttv-theater-stage {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 12px;
	background: #0a0a0b;
}

.yttv-theater-info {
	padding: 12px 2px 0;
}

.yttv-theater-info .yttv-title {
	color: inherit;
	font-size: 18px;
}

.yttv-theater-info .yttv-meta {
	color: inherit;
	opacity: 0.65;
}

.yttv-theater-desc {
	margin: 8px 0 0;
	font-size: 14px;
	line-height: 1.55;
	opacity: 0.8;
}

.yttv-theater-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 560px;
	overflow-y: auto;
}

.yttv-theater-item {
	display: grid;
	grid-template-columns: 140px 1fr;
	gap: 10px;
	padding: 6px;
	border: 0;
	border-radius: 10px;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.yttv-theater-item:hover,
.yttv-theater-item.is-on {
	background: rgba(127, 127, 127, 0.14);
}

.yttv-theater-item img {
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 8px;
	object-fit: cover;
}

.yttv-theater-item-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.yttv-theater-item .yttv-card-title {
	font-size: 13px;
}

@media (max-width: 900px) {
	.yttv-theater-wrap {
		grid-template-columns: 1fr;
	}

	.yttv-theater-list {
		max-height: none;
	}
}

/* Facade: a thumbnail until clicked (no player loads before that). */
.yttv-facade {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: #0a0a0b;
	cursor: pointer;
}

.yttv-facade img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.yttv-play.is-big {
	width: 76px;
	height: 76px;
}

.yttv-theater-stage .yttv-frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* Lightbox. */
.yttv-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99995;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.86);
}

/* Never taller than the window: width follows the height for 16:9. */
.yttv-lightbox-box {
	width: min(1100px, 100%, calc((100vh - 140px) * 16 / 9));
}

.yttv-lightbox-media {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 12px;
	background: #000;
}

.yttv-lightbox.is-vertical .yttv-lightbox-box {
	width: min(420px, 100%);
}

.yttv-lightbox.is-vertical .yttv-lightbox-media {
	aspect-ratio: 9 / 16;
	max-height: 84vh;
	margin: 0 auto;
}

.yttv-lightbox-media .yttv-frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.yttv-lightbox-title {
	margin: 12px 0 0;
	color: #fff;
	font-size: 16px;
	font-weight: 600;
}

.yttv-lightbox-close,
.yttv-lightbox-nav {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.yttv-lightbox-close {
	top: 16px;
	right: 16px;
}

.yttv-lightbox-nav {
	top: 50%;
	transform: translateY(-50%);
}

.yttv-lightbox-nav.is-prev {
	left: 16px;
}

.yttv-lightbox-nav.is-next {
	right: 16px;
}

@media (max-width: 640px) {
	.yttv-lightbox {
		padding: 56px 12px 12px;
	}

	.yttv-lightbox-nav {
		top: auto;
		bottom: 16px;
		transform: none;
	}
}

/* Everything except the full-screen TV sits on the theme's page: use its
   text colour. The inline TV's channel pills and bottom bar are on the page
   too (they were white on white); its dark stage keeps its own colour. */
.yttv:not(.is-full) {
	color: inherit;
}

.yttv-stage {
	color: var(--yttv-fg);
}


/* ------------------------------------------------------------------ */
/* Floating mini player and floating post embeds                        */
/* ------------------------------------------------------------------ */
.yttv-float { position: static; }
.yttv-float-box {
	font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 9998;
	width: 360px;
	max-width: calc(100vw - 32px);
	border-radius: 12px;
	overflow: hidden;
	background: var(--yttv-bg);
	color: var(--yttv-fg);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
	font-size: 13px;
	line-height: 1.3;
}
.yttv-float-head {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 6px 6px 6px 8px;
	border-bottom: 1px solid var(--yttv-line);
}
.yttv-float-name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-weight: 600;
}
.yttv-float-btn {
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 8px;
	background: var(--yttv-pill);
	color: var(--yttv-fg);
	font-size: 16px;
	line-height: 28px;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}
.yttv-float-btn:hover { background: rgba(255, 255, 255, 0.16); }
.yttv-float-shuffle[aria-pressed="true"] { background: var(--yttv-fg); color: var(--yttv-bg); }
.yttv-float-screen { position: relative; aspect-ratio: 16 / 9; background: #000; }
.yttv-float-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yttv-float-mute {
	position: absolute;
	left: 8px;
	bottom: 8px;
	border: 0;
	border-radius: 999px;
	padding: 4px 10px;
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	font-size: 12px;
	cursor: pointer;
}
.yttv-float-grip {
	position: absolute;
	left: 0;
	top: 0;
	width: 18px;
	height: 18px;
	cursor: nwse-resize;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0 2px, transparent 2px 5px, rgba(255, 255, 255, 0.5) 5px 7px, transparent 7px);
	opacity: 0.6;
}
.yttv-pip {
	position: fixed !important;
	right: 16px !important;
	z-index: 9999 !important;
	margin: 0 !important;
	max-width: calc(100vw - 32px) !important;
	border: 0;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
	background: #000;
}
.yttv-pip-holder { width: 100%; }
.yttv-pip-close {
	position: fixed;
	right: 8px;
	z-index: 9999;
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 999px;
	background: #0a0a0b;
	color: #fff;
	font-size: 16px;
	line-height: 28px;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
@media (max-width: 640px) {
	.yttv-float-box { width: min(360px, calc(100vw - 32px)) !important; }
	.yttv-float-grip { display: none; }
}
