/*!
 * Cinetide Player 0.1.0 — estilos del reproductor.
 * Todas las reglas están acotadas a .ctp-player / .ctp-modal para no
 * interferir con el tema ni recibir estilos genéricos de él.
 * Clases públicas documentadas en docs/clases-css.md.
 */

.ctp-player,
.ctp-modal {
	--ctp-accent: #19c3b3;
	--ctp-on-accent: #04201d;
	--ctp-radius: 10px;
	--ctp-gap: 12px;
	--ctp-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--ctp-ctrl: 40px;
	--ctp-thumb-w: 112px;
	--ctp-ease: 160ms ease;
	/* Tema oscuro (por defecto). */
	--ctp-bg: #0d1316;
	--ctp-panel: #141b1f;
	--ctp-panel-2: #1b2429;
	--ctp-text: #e9f0f2;
	--ctp-muted: #91a2a9;
	--ctp-border: rgba(255, 255, 255, 0.08);
	--ctp-hover: rgba(255, 255, 255, 0.06);
	--ctp-active-bg: color-mix(in srgb, var(--ctp-active, var(--ctp-accent)) var(--ctp-active-strength, 16%), transparent);
	--ctp-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
	--ctp-pad: 10px;
	--ctp-bar-bg: rgba(0, 0, 0, calc(0.82 * var(--ctp-bar-alpha, 1)));
	--ctp-bar-fg: #fff;
}

.ctp-space-compact {
	--ctp-pad: 6px;
}

.ctp-space-comfortable {
	--ctp-pad: 15px;
}

.ctp-theme-light {
	--ctp-bg: #ffffff;
	--ctp-panel: #f3f6f7;
	--ctp-panel-2: #e8eef0;
	--ctp-text: #10191d;
	--ctp-muted: #56676e;
	--ctp-border: rgba(0, 0, 0, 0.1);
	--ctp-hover: rgba(0, 0, 0, 0.05);
	--ctp-active-bg: color-mix(in srgb, var(--ctp-active, var(--ctp-accent)) calc(var(--ctp-active-strength, 16%) + 2%), #fff);
	--ctp-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* ---------- Aislamiento frente al tema ---------- */

.ctp-player,
.ctp-player *,
.ctp-modal,
.ctp-modal * {
	box-sizing: border-box;
}

.ctp-player {
	container-type: inline-size;
	container-name: ctp;
	position: relative;
	width: 100%;
	margin: 0 auto 1.5em;
	font-family: var(--ctp-font);
	font-size: var(--ctp-fs, 14px);
	line-height: 1.4;
	color: var(--ctp-text);
	text-align: left;
	letter-spacing: normal;
	text-transform: none;
}

.ctp-player .ctp-btn,
.ctp-player .ctp-item-main,
.ctp-modal .ctp-btn,
.ctp-modal .ctp-card {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
	text-decoration: none;
	min-height: 0;
	min-width: 0;
	width: auto;
	height: auto;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.ctp-player ul,
.ctp-modal ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ctp-player li,
.ctp-modal li {
	margin: 0;
	padding: 0;
}

.ctp-player li::before,
.ctp-player li::marker {
	content: none;
}

.ctp-player img,
.ctp-modal img {
	max-width: none;
	height: auto;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	margin: 0;
}

/* Emoji y smileys que WordPress convierte en <img class="emoji|wp-smiley">
   (wp-emoji cuando el navegador no tiene un emoji reciente). Sin esto, el
   reajuste anterior anula el límite del tema y, si falta la hoja de emoji del
   núcleo (temas u optimizadores que la retiran), el SVG ocupa todo el ancho.
   Solo afecta a esas clases: miniaturas, pósteres e iconos no cambian. */
.ctp-player img.emoji,
.ctp-player img.wp-smiley,
.ctp-modal img.emoji,
.ctp-modal img.wp-smiley {
	display: inline !important;
	width: 1em !important;
	height: 1em !important;
	max-width: 1em !important;
	max-height: 1em !important;
	min-width: 0 !important;
	margin: 0 0.07em !important;
	padding: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
	background: none !important;
	vertical-align: -0.1em !important;
	object-fit: contain;
}

.ctp-player [hidden],
.ctp-modal [hidden] {
	display: none !important;
}

/* Icono de sprite PNG (skins gráficas). La hoja contiene 18 iconos en fila
   (Skins::ICONS); --i es la posición y la imagen la define cada skin. */
.ctp-player .ctp-ico,
.ctp-modal .ctp-ico {
	display: block;
	flex: none;
	width: var(--ctp-icon, 24px);
	height: var(--ctp-icon, 24px);
	background-repeat: no-repeat;
	background-size: calc(var(--ctp-icon, 24px) * 18) var(--ctp-icon, 24px);
	background-position: calc(var(--ctp-icon, 24px) * var(--i, 0) * -1) 0;
	pointer-events: none;
}

/* Icono personalizado subido por el administrador. */
.ctp-player .ctp-ico-img,
.ctp-modal .ctp-ico-img {
	display: block;
	flex: none;
	width: var(--ctp-icon, 24px);
	height: var(--ctp-icon, 24px);
	max-width: none;
	object-fit: contain;
	pointer-events: none;
}

.ctp-icon {
	width: var(--ctp-icon, 24px);
	height: var(--ctp-icon, 24px);
	fill: currentColor;
	flex: none;
	display: block;
	pointer-events: none;
}

.ctp-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Foco visible y coherente. */
.ctp-player :focus-visible,
.ctp-modal :focus-visible {
	outline: 2px solid var(--ctp-accent);
	outline-offset: 2px;
}

.ctp-player :focus:not(:focus-visible) {
	outline: none;
}

/* ---------- Estados previos al script ---------- */

.ctp-boot,
.ctp-noscript,
.ctp-admin-notice {
	padding: 24px;
	background: var(--ctp-bg);
	border-radius: var(--ctp-radius);
	color: var(--ctp-muted);
	text-align: center;
}

.ctp-broken .ctp-boot {
	color: #e66;
}

/* ---------- Distribución ---------- */

.ctp-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	background: var(--ctp-bg);
	border-radius: var(--ctp-radius);
	overflow: hidden;
	box-shadow: var(--ctp-shadow);
}

.ctp-list-right .ctp-layout {
	grid-template-columns: minmax(0, 1fr) var(--ctp-list-width, 340px);
}

.ctp-list-right.ctp-list-collapsed .ctp-layout {
	grid-template-columns: minmax(0, 1fr);
}

.ctp-list-collapsed .ctp-sidebar {
	display: none;
}

/* Pantallas estrechas: siempre apilado. */
/* Mayor especificidad que las reglas de .ctp-list-right definidas más abajo. */
@container ctp (max-width: 720px) {
	.ctp-player.ctp-list-right .ctp-layout {
		grid-template-columns: minmax(0, 1fr);
	}
	.ctp-player.ctp-list-right .ctp-sidebar {
		height: auto;
		border-left: 0;
		border-top: 1px solid var(--ctp-border);
	}
	.ctp-player.ctp-list-right .ctp-sidebar-inner {
		position: static;
		max-height: 440px;
	}
}

/* ---------- Escenario (vídeo + controles) ---------- */

.ctp-stage {
	position: relative;
	background: #000;
	min-width: 0;
	display: flex;
	flex-direction: column;
	outline: none;
}

.ctp-screen {
	position: relative;
	width: 100%;
	aspect-ratio: var(--ctp-ratio, 16 / 9);
	background: #000;
	overflow: hidden;
	cursor: pointer;
}

.ctp-media {
	position: absolute;
	inset: 0;
}

.ctp-player .ctp-video {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: contain;
	background: #000;
}

.ctp-player .ctp-video.is-audio {
	object-fit: cover;
}

.ctp-overlay {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	pointer-events: none;
}

.ctp-overlay > * {
	grid-area: 1 / 1;
	pointer-events: auto;
}

.ctp-player .ctp-bigplay {
	width: 76px;
	height: 76px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--ctp-accent);
	color: var(--ctp-on-accent);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
	transition: transform var(--ctp-ease), opacity var(--ctp-ease);
}

.ctp-player .ctp-bigplay {
	--ctp-icon: 38px;
}

.ctp-player .ctp-bigplay .ctp-icon {
	margin-left: 4px;
}

.ctp-player .ctp-bigplay:hover {
	transform: scale(1.06);
}

.ctp-started .ctp-bigplay,
.ctp-loading .ctp-bigplay,
.ctp-has-message .ctp-bigplay {
	opacity: 0;
	pointer-events: none;
	visibility: hidden;
}

.ctp-spinner {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: var(--ctp-accent);
	animation: ctp-spin 0.9s linear infinite;
	display: none;
	pointer-events: none;
}

.ctp-loading:not(.ctp-has-message) .ctp-overlay .ctp-spinner {
	display: block;
}

.ctp-spinner--small {
	display: inline-block;
	width: 16px;
	height: 16px;
	border-width: 2px;
	vertical-align: middle;
	border-color: var(--ctp-border);
	border-top-color: var(--ctp-accent);
}

@keyframes ctp-spin {
	to {
		transform: rotate(360deg);
	}
}

.ctp-message {
	max-width: 80%;
	padding: 18px 22px;
	border-radius: var(--ctp-radius);
	background: rgba(10, 14, 16, 0.88);
	color: #f2f5f6;
	text-align: center;
	cursor: default;
}

.ctp-message .ctp-icon {
	margin: 0 auto 6px;
	width: 28px;
	height: 28px;
	color: #ffb347;
}

.ctp-message p {
	margin: 0 0 10px;
	font-size: 14px;
}

.ctp-message-actions {
	display: flex;
	gap: 8px;
	justify-content: center;
	flex-wrap: wrap;
}

.ctp-player .ctp-retry {
	padding: 8px 14px;
	border-radius: 6px;
	background: var(--ctp-accent);
	color: var(--ctp-on-accent);
	font-weight: 600;
	min-height: 36px;
}

.ctp-no-media .ctp-message .ctp-message-actions {
	display: none;
}

/* ---------- Barra de controles ---------- */

.ctp-controls {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 18px 10px 6px;
	background: linear-gradient(to top, var(--ctp-bar-bg), rgba(0, 0, 0, 0));
	color: var(--ctp-bar-fg);
	transition: opacity 240ms ease, transform 240ms ease;
	z-index: 2;
}

.ctp-is-audio .ctp-controls,
.ctp-minimal .ctp-controls {
	padding-top: 12px;
}

.ctp-idle .ctp-controls,
.ctp-idle .ctp-nowplaying {
	opacity: 0;
	transform: translateY(6px);
	pointer-events: none;
}

.ctp-idle .ctp-screen {
	cursor: none;
}

.ctp-controls-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 4px;
	min-width: 0;
}

.ctp-controls-group {
	display: flex;
	align-items: center;
	gap: 2px;
	min-width: 0;
}

.ctp-controls .ctp-btn {
	position: relative;
	flex: none;
	width: var(--ctp-ctrl);
	height: var(--ctp-ctrl);
	display: inline-grid;
	place-items: center;
	color: var(--ctp-bar-fg);
	opacity: 0.92;
	transition: opacity var(--ctp-ease), background var(--ctp-ease), color var(--ctp-ease);
}

.ctp-controls .ctp-btn:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.12);
}

.ctp-controls .ctp-btn[aria-pressed="true"] {
	color: var(--ctp-active, var(--ctp-accent));
	opacity: 1;
}

/* Con iconos de imagen el color no cambia: se marca el estado con un subrayado. */
.ctp-controls .ctp-btn[aria-pressed="true"]:has(.ctp-ico, .ctp-ico-img)::before {
	content: "";
	position: absolute;
	left: 25%;
	right: 25%;
	bottom: 3px;
	height: 3px;
	border-radius: 2px;
	background: var(--ctp-active, var(--ctp-accent));
}

.ctp-controls .ctp-btn[data-mode="one"]::after {
	content: "1";
	position: absolute;
	right: 6px;
	bottom: 6px;
	font-size: 9px;
	font-weight: 700;
	line-height: 1;
}

.ctp-time {
	padding: 0 8px;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	opacity: 0.92;
}

/* Directo: punto rojo antes de la etiqueta «En directo». */
.ctp-live .ctp-time::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 6px;
	border-radius: 50%;
	background: #ff4d4d;
	vertical-align: 1px;
}

.ctp-player .ctp-golive {
	width: auto;
	height: 28px;
	padding: 0 10px;
	border-radius: 14px;
	background: #ff4d4d;
	color: #fff;
	font-size: 0.85em;
	font-weight: 700;
	white-space: nowrap;
	opacity: 1;
}

.ctp-player .ctp-golive:hover {
	background: #e03131;
}

/* ---------- YouTube y Vimeo (iframe del proveedor) ----------
   Ningún elemento propio se coloca delante del iframe: los controles van
   debajo, los menús se abren hacia abajo y no hay capa ni título encima.
   Tamaño mínimo de 200 × 200 px (normas de YouTube). */
.ctp-embed-box,
.ctp-embed-slot,
.ctp-player .ctp-embed-slot iframe,
.ctp-player .ctp-embed-box iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	border: 0;
}

.ctp-embed .ctp-screen {
	min-width: 200px;
	min-height: 200px;
	cursor: default;
}

.ctp-embed .ctp-overlay,
.ctp-embed .ctp-nowplaying,
.ctp-embed .ctp-captions {
	display: none;
}

.ctp-embed .ctp-controls,
.ctp-embed.ctp-idle .ctp-controls {
	position: relative;
	inset: auto;
	padding-top: 8px;
	background: var(--ctp-panel-2);
	color: var(--ctp-text);
	--ctp-bar-fg: var(--ctp-text);
	--ctp-track: var(--ctp-border);
	/* Debajo del iframe nunca se ocultan: el ratón sobre el vídeo no llega a
	   la página y no podría volver a mostrarlos. */
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

.ctp-embed .ctp-controls .ctp-btn {
	color: var(--ctp-text);
}

.ctp-player.ctp-embed,
.ctp-embed .ctp-layout,
.ctp-embed .ctp-stage {
	overflow: visible;
}

.ctp-embed .ctp-menu {
	bottom: auto;
	top: calc(100% + 6px);
	z-index: 20;
}

.ctp-embed .ctp-stage:fullscreen .ctp-screen {
	flex: 1;
	height: auto;
	aspect-ratio: auto;
}

/* En pantalla completa no hay sitio debajo: el menú se muestra en horizontal
   a la altura de la barra, a la izquierda del botón, sin tapar el vídeo. */
.ctp-embed .ctp-stage:fullscreen .ctp-menu:not([hidden]) {
	display: flex;
	top: 50%;
	bottom: auto;
	right: calc(100% + 6px);
	transform: translateY(-50%);
	padding: 4px;
	white-space: nowrap;
}

.ctp-embed .ctp-stage:fullscreen .ctp-menu-item {
	padding: 6px 10px 6px 24px;
}

/* «Clic para cargar» antes de contactar con YouTube/Vimeo. */
.ctp-consent {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 20px;
	background: radial-gradient(circle at 50% 40%, #24303a, #0b0f12);
	color: #f2f5f6;
	text-align: center;
	cursor: default;
}

.ctp-player .ctp-consent p {
	max-width: 520px;
	margin: 0;
}

.ctp-consent-title {
	font-size: 1.15em;
	font-weight: 700;
}

.ctp-consent-text {
	font-size: 0.92em;
	opacity: 0.85;
}

.ctp-player .ctp-consent-btn {
	margin-top: 8px;
	padding: 10px 18px;
	border-radius: 999px;
	background: var(--ctp-accent);
	color: var(--ctp-on-accent);
	font-weight: 700;
	min-height: 44px;
}

.ctp-has-consent .ctp-bigplay,
.ctp-has-consent .ctp-spinner {
	display: none;
}

/* Rangos (progreso y volumen). */
.ctp-player .ctp-range {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	height: 18px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	--ctp-fill: 0%;
}

.ctp-player .ctp-range:disabled {
	cursor: default;
	opacity: 0.5;
}

.ctp-player .ctp-range::-webkit-slider-runnable-track {
	height: 4px;
	border-radius: 2px;
	background: linear-gradient(to right, var(--ctp-accent) var(--ctp-fill), var(--ctp-track, rgba(255, 255, 255, 0.28)) var(--ctp-fill));
}

.ctp-player .ctp-range::-moz-range-track {
	height: 4px;
	border-radius: 2px;
	background: var(--ctp-track, rgba(255, 255, 255, 0.28));
}

.ctp-player .ctp-range::-moz-range-progress {
	height: 4px;
	border-radius: 2px;
	background: var(--ctp-accent);
}

.ctp-player .ctp-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	margin-top: -5px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ctp-accent) 45%, transparent);
}

.ctp-player .ctp-range::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border: 0;
	border-radius: 50%;
	background: #fff;
}

.ctp-progress {
	position: relative;
	padding: 0 6px 4px;
	--ctp-buffered: 0;
}

.ctp-progress::before {
	/* Indicador de carga en búfer bajo la pista. */
	content: "";
	position: absolute;
	left: 6px;
	top: 7px;
	height: 4px;
	width: calc((100% - 12px) * var(--ctp-buffered));
	max-width: calc(100% - 12px);
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.22);
	pointer-events: none;
}

.ctp-volume {
	display: flex;
	align-items: center;
}

.ctp-player .ctp-volume-range {
	width: 84px;
	transition: width var(--ctp-ease);
}

/* Menú emergente (velocidad). */
.ctp-menu-wrap {
	position: relative;
}

.ctp-menu-badge {
	position: absolute;
	right: 2px;
	bottom: 4px;
	font-size: 9px;
	font-weight: 700;
	line-height: 1;
	color: var(--ctp-accent);
}

.ctp-player .ctp-menu {
	position: absolute;
	right: 0;
	bottom: calc(100% + 6px);
	min-width: 120px;
	padding: 6px;
	border-radius: 8px;
	background: rgba(16, 22, 25, 0.96);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
	z-index: 5;
}

.ctp-menu-item {
	padding: 8px 12px 8px 28px;
	border-radius: 5px;
	color: #e9f0f2;
	cursor: pointer;
	position: relative;
	white-space: nowrap;
}

.ctp-menu-item:hover,
.ctp-menu-item:focus {
	background: rgba(255, 255, 255, 0.1);
	outline: none;
}

.ctp-menu-item:focus-visible {
	outline: 2px solid var(--ctp-accent);
	outline-offset: -2px;
}

.ctp-menu-item[aria-checked="true"]::before {
	content: "";
	position: absolute;
	left: 10px;
	top: 50%;
	width: 8px;
	height: 8px;
	margin-top: -4px;
	border-radius: 50%;
	background: var(--ctp-accent);
}

/* Título en reproducción (sobre el vídeo). */
.ctp-nowplaying {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	padding: 12px 16px 24px;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	pointer-events: none;
	transition: opacity 240ms ease, transform 240ms ease;
	opacity: 0;
}

.ctp-started .ctp-nowplaying {
	opacity: 1;
}

.ctp-nowplaying-title {
	display: block;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* Subtítulos dibujados por el reproductor: suben cuando la barra es visible. */
.ctp-captions {
	position: absolute;
	left: 6%;
	right: 6%;
	bottom: calc(var(--ctp-ctrl) + 30px);
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	text-align: center;
	pointer-events: none;
	transition: bottom 240ms ease;
	font-size: calc(clamp(14px, 3.2cqi, 30px) * var(--ctp-cap-size, 1));
	line-height: 1.35;
}

.ctp-idle .ctp-captions,
.ctp-minimal .ctp-captions {
	bottom: 6%;
}

.ctp-cue {
	display: inline;
	padding: 0.08em 0.4em;
	border-radius: 4px;
	background: rgba(0, 0, 0, var(--ctp-cap-bg, 0.75));
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
	white-space: pre-line;
}

.ctp-fullscreen .ctp-captions {
	font-size: calc(clamp(18px, 2.4vw, 44px) * var(--ctp-cap-size, 1));
}

/* Controles reducidos en contenedores pequeños. */
@container ctp (max-width: 520px) {
	.ctp-player .ctp-volume-range {
		display: none;
	}
	.ctp-time {
		font-size: 12px;
		padding: 0 4px;
	}
}

/* Contenedores estrechos: se ocultan primero los controles que tienen
   alternativa (anterior/siguiente están en el pie de la lista). Los botones
   conservan su tamaño táctil. */
@container ctp (max-width: 480px) {
	.ctp-player:not(.ctp-list-hidden) .ctp-controls .ctp-prev,
	.ctp-player:not(.ctp-list-hidden) .ctp-controls .ctp-next,
	.ctp-controls .ctp-repeat,
	.ctp-controls .ctp-shuffle {
		display: none;
	}
}

@container ctp (max-width: 400px) {
	.ctp-controls .ctp-listtoggle {
		display: none;
	}
}

@container ctp (max-width: 340px) {
	.ctp-controls .ctp-speed {
		display: none;
	}
}

/* ---------- Lista lateral ---------- */

.ctp-sidebar {
	position: relative;
	min-width: 0;
	background: var(--ctp-panel);
	border-left: 1px solid var(--ctp-border);
}

/* Derecha: la altura la marca el vídeo; la lista se desplaza dentro. */
.ctp-list-right .ctp-sidebar-inner {
	position: absolute;
	inset: 0;
}

.ctp-list-bottom .ctp-sidebar {
	border-left: 0;
	border-top: 1px solid var(--ctp-border);
}

.ctp-list-bottom .ctp-sidebar-inner {
	max-height: 460px;
}

.ctp-sidebar-inner {
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.ctp-sidebar-head,
.ctp-sidebar-foot {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: var(--ctp-pad);
	flex: none;
	background: var(--ctp-panel-2);
}

.ctp-sidebar-head {
	border-bottom: 1px solid var(--ctp-border);
}

.ctp-sidebar-foot {
	border-top: 1px solid var(--ctp-border);
}

.ctp-sidebar-title {
	flex: 1;
	min-width: 0;
	font-weight: 600;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	padding: 0 4px;
}

.ctp-player .ctp-select {
	flex: 1;
	min-width: 0;
	height: 38px;
	margin: 0;
	padding: 0 32px 0 12px;
	border: 1px solid var(--ctp-border);
	border-radius: 7px;
	background-color: var(--ctp-bg);
	background-image: linear-gradient(45deg, transparent 50%, var(--ctp-muted) 50%), linear-gradient(135deg, var(--ctp-muted) 50%, transparent 50%);
	background-position: right 16px center, right 11px center;
	background-size: 5px 5px;
	background-repeat: no-repeat;
	color: var(--ctp-text);
	font: inherit;
	font-weight: 600;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
	cursor: pointer;
}

.ctp-player .ctp-select option {
	background: var(--ctp-panel);
	color: var(--ctp-text);
}

.ctp-sidebar .ctp-btn {
	width: 38px;
	height: 38px;
	display: inline-grid;
	place-items: center;
	flex: none;
	color: var(--ctp-text);
	background: var(--ctp-bg);
	border: 1px solid var(--ctp-border);
	border-radius: 7px;
}

.ctp-sidebar .ctp-btn:hover {
	border-color: var(--ctp-accent);
	color: var(--ctp-accent);
}

/* «Reproducir toda la lista». */
.ctp-sidebar-actions {
	flex: none;
	padding: var(--ctp-pad) var(--ctp-pad) 0;
}

.ctp-sidebar-actions:has(.ctp-playall[hidden]) {
	display: none;
}

.ctp-player .ctp-sidebar .ctp-playall {
	width: 100%;
	height: auto;
	min-height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 6px 12px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
}

.ctp-player .ctp-sidebar .ctp-playall[aria-pressed="true"] {
	border-color: var(--ctp-active, var(--ctp-accent));
	color: var(--ctp-active, var(--ctp-accent));
	background: var(--ctp-active-bg);
}

/* Estado de la reproducción automática dentro del botón (0.3.3). */
.ctp-playall-state {
	flex: none;
	padding: 2px 8px;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-size: 0.8em;
	font-weight: 700;
	line-height: 1.3;
	opacity: 0.75;
}

.ctp-player .ctp-sidebar .ctp-playall[aria-pressed="true"] .ctp-playall-state {
	border-color: transparent;
	background: var(--ctp-active, var(--ctp-accent));
	color: var(--ctp-on-accent);
	opacity: 1;
}

/* Avance automático bloqueado: aviso debajo del vídeo, nunca encima. */
.ctp-resume {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px 12px;
	padding: 8px 12px;
	background: var(--ctp-panel-2);
	color: var(--ctp-text);
	border-top: 1px solid var(--ctp-border);
	font-size: 0.92em;
}

/* Archivos propios con la barra sobre el vídeo: franja en la parte superior. */
.ctp-resume.ctp-resume--over {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 4;
	background: rgba(0, 0, 0, 0.78);
	color: #fff;
	border-top: 0;
	cursor: default;
}

.ctp-player .ctp-resume-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 38px;
	padding: 0 14px;
	border-radius: 999px;
	background: var(--ctp-accent);
	color: var(--ctp-on-accent);
	font-weight: 700;
}

/* Listas del reproductor (mismas entradas del desplegable) bajo los vídeos. */
.ctp-listnav {
	margin-top: var(--ctp-pad);
	border-top: 1px solid var(--ctp-border);
}

.ctp-listnav-title {
	padding: var(--ctp-pad) var(--ctp-pad) 4px;
	color: var(--ctp-muted);
	font-size: 0.85em;
	font-weight: 600;
}

.ctp-player .ctp-listnav-item {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	min-height: 0;
	margin: 0;
	padding: var(--ctp-pad);
	border: 0;
	border-left: 3px solid transparent;
	border-bottom: 1px solid var(--ctp-border);
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: var(--ctp-text);
	font: inherit;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	text-align: left;
	text-decoration: none;
	overflow-wrap: anywhere;
	cursor: pointer;
}

.ctp-player .ctp-listnav-item:hover {
	background: var(--ctp-hover);
}

.ctp-player .ctp-listnav-item[aria-current="true"] {
	background: var(--ctp-active-bg);
	border-left-color: var(--ctp-active, var(--ctp-accent));
	font-weight: 600;
}

.ctp-items-scroll {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--ctp-border) transparent;
}

.ctp-item {
	position: relative;
	border-bottom: 1px solid var(--ctp-border);
	border-left: 3px solid transparent;
	transition: background var(--ctp-ease);
	cursor: pointer;
}

.ctp-item:hover {
	background: var(--ctp-hover);
}

.ctp-item.is-active {
	background: var(--ctp-active-bg);
	border-left-color: var(--ctp-active, var(--ctp-accent));
}

.ctp-player .ctp-item-main {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	padding: var(--ctp-pad) var(--ctp-pad) var(--ctp-pad) calc(var(--ctp-pad) - 1px);
	text-align: left;
	border-radius: 0;
}

.ctp-player .ctp-item-main:focus-visible {
	outline-offset: -2px;
}

.ctp-thumb {
	position: relative;
	flex: none;
	width: var(--ctp-thumb-w);
	aspect-ratio: 16 / 9;
	border-radius: 6px;
	overflow: hidden;
	background: var(--ctp-panel-2);
	display: grid;
	place-items: center;
	color: var(--ctp-muted);
}

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

.ctp-thumbs-small {
	--ctp-thumb-w: 72px;
}

.ctp-thumbs-large {
	--ctp-thumb-w: 156px;
}

.ctp-duration {
	position: absolute;
	right: 4px;
	bottom: 4px;
	padding: 1px 5px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.78);
	color: #fff;
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	line-height: 1.4;
}

.ctp-item-text {
	min-width: 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ctp-item-title {
	font-weight: 600;
	font-size: 1em;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
}

.ctp-item.is-active .ctp-item-title {
	color: var(--ctp-active, var(--ctp-accent));
}

.ctp-item-meta {
	color: var(--ctp-muted);
	font-size: 12px;
}

.ctp-item-desc {
	padding: 0 12px var(--ctp-pad) calc(var(--ctp-pad) * 2 - 1px + var(--ctp-thumb-w));
	margin-top: -4px;
	color: var(--ctp-muted);
	font-size: 0.9em;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.ctp-thumbs-none .ctp-item-desc {
	padding-left: 9px;
}

.ctp-item-desc p {
	margin: 0 0 4px;
}

.ctp-item-desc a {
	color: var(--ctp-accent);
	text-decoration: underline;
}

/* En listas estrechas la descripción va bajo la miniatura. */
@container ctp (max-width: 420px) {
	.ctp-item-desc {
		padding-left: 12px;
	}
}

.ctp-list-status {
	padding: 16px;
	color: var(--ctp-muted);
	text-align: center;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	justify-content: center;
}

.ctp-list-status:empty {
	display: none;
}

.ctp-player .ctp-more {
	display: block;
	width: calc(100% - 20px);
	height: auto;
	margin: 10px;
	padding: 10px;
	text-align: center;
	color: var(--ctp-accent);
	font-weight: 600;
}

.ctp-sentinel {
	height: 1px;
}

.ctp-search {
	--ctp-icon: 18px;
	position: relative;
	flex: 1;
	min-width: 0;
	color: var(--ctp-muted);
}

/* Lupa dentro del campo, sea SVG, sprite de skin o icono personalizado. */
.ctp-search .ctp-icon,
.ctp-player .ctp-search .ctp-ico,
.ctp-player .ctp-search .ctp-ico-img {
	position: absolute;
	left: 10px;
	top: 50%;
	width: 18px;
	height: 18px;
	margin-top: -9px;
	opacity: 0.8;
}

.ctp-player .ctp-search-input {
	width: 100%;
	height: 38px;
	margin: 0;
	padding: 0 10px 0 34px;
	border: 1px solid var(--ctp-border);
	border-radius: 7px;
	background: var(--ctp-bg);
	color: var(--ctp-text);
	font: inherit;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.ctp-player .ctp-search-input::placeholder {
	color: var(--ctp-muted);
	opacity: 1;
}

.ctp-player .ctp-search-input:focus {
	border-color: var(--ctp-accent);
}

.ctp-sidebar-nav {
	display: flex;
	gap: 6px;
	flex: none;
}

/* ---------- Ventana de listas ---------- */

.ctp-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 24px;
	background: rgba(4, 8, 10, 0.78);
	font-family: var(--ctp-font);
	font-size: var(--ctp-fs, 14px);
	line-height: 1.4;
	color: var(--ctp-text);
	animation: ctp-fade 160ms ease;
}

@keyframes ctp-fade {
	from {
		opacity: 0;
	}
}

.ctp-modal-panel {
	width: min(1100px, 100%);
	max-height: 100%;
	overflow: auto;
	padding: 20px;
	border-radius: 14px;
	background: var(--ctp-bg);
	box-shadow: var(--ctp-shadow);
}

.ctp-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.ctp-modal .ctp-modal-title {
	margin: 0;
	padding: 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--ctp-text);
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
}

.ctp-modal .ctp-modal-close {
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--ctp-panel-2);
}

.ctp-modal .ctp-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 14px;
}

.ctp-modal .ctp-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: 100%;
	padding: 8px 8px 12px;
	border-radius: 10px;
	background: var(--ctp-panel);
	border: 2px solid transparent;
	text-align: left;
	transition: border-color var(--ctp-ease), transform var(--ctp-ease);
}

.ctp-modal .ctp-card:hover {
	border-color: color-mix(in srgb, var(--ctp-accent) 60%, transparent);
	transform: translateY(-2px);
}

.ctp-modal .ctp-card[aria-current="true"] {
	border-color: var(--ctp-accent);
}

.ctp-card-thumb {
	aspect-ratio: 16 / 9;
	border-radius: 6px;
	overflow: hidden;
	background: var(--ctp-panel-2);
	display: grid;
	place-items: center;
	color: var(--ctp-muted);
}

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

.ctp-card-title {
	font-weight: 700;
	font-size: 15px;
	padding: 0 4px;
}

.ctp-card-meta {
	color: var(--ctp-muted);
	font-size: 12.5px;
	padding: 0 4px;
}

/* ---------- Pantalla completa ---------- */

.ctp-stage:fullscreen {
	width: 100%;
	height: 100%;
	justify-content: center;
}

.ctp-stage:fullscreen .ctp-screen {
	aspect-ratio: auto;
	height: 100%;
}

.ctp-stage:-webkit-full-screen {
	width: 100%;
	height: 100%;
}

.ctp-stage:-webkit-full-screen .ctp-screen {
	height: 100%;
}

/* ---------- Táctil y accesibilidad ---------- */

@media (pointer: coarse) {
	.ctp-player,
	.ctp-modal {
		--ctp-ctrl: 44px;
	}
	.ctp-sidebar .ctp-btn,
	.ctp-player .ctp-search-input,
	.ctp-player .ctp-select {
		height: 44px;
	}
	.ctp-sidebar .ctp-btn {
		width: 44px;
	}
	.ctp-player .ctp-sidebar .ctp-playall,
	.ctp-player .ctp-resume-btn,
	.ctp-player .ctp-listnav-item {
		min-height: 44px;
	}
	.ctp-player .ctp-volume-range {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ctp-player *,
	.ctp-modal,
	.ctp-modal * {
		transition: none !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
	.ctp-spinner {
		animation: ctp-spin 2.4s linear infinite !important;
	}
}

@media (forced-colors: active) {
	.ctp-item.is-active {
		border-left-color: Highlight;
	}
	.ctp-controls .ctp-btn[aria-pressed="true"] {
		color: Highlight;
	}
}
