/* Reproductor Musical — estética tipo Spotify
   Prefijo .rpm- para evitar colisiones con el tema. */

.rpm-envoltorio {
	width: 100%;
	display: flex;
	justify-content: center;
	box-sizing: border-box;
}

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

.rpm-reproductor {
	--rpm-fondo: #5b1e63;
	--rpm-texto: #ffffff;
	--rpm-acento: #c58ad0;
	--rpm-ancho: 760px;
	--rpm-radio: 26px;

	position: relative;
	display: flex;
	gap: 32px;
	align-items: stretch;
	width: 100%;
	max-width: var(--rpm-ancho);
	padding: 26px;
	border-radius: var(--rpm-radio);
	background: linear-gradient(135deg, var(--rpm-fondo) 0%, color-mix(in srgb, var(--rpm-fondo) 78%, #000 22%) 100%);
	border: 1px solid color-mix(in srgb, var(--rpm-acento) 45%, transparent);
	box-shadow: 0 18px 45px rgba(0, 0, 0, .35);
	color: var(--rpm-texto);
	font-family: inherit;
	transition: background .45s ease, border-color .45s ease;
}

/* Fallback para navegadores sin color-mix */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
	.rpm-reproductor {
		background: var(--rpm-fondo);
		border-color: rgba(255, 255, 255, .25);
	}
}

.rpm-reproductor.rpm-tema-claro {
	box-shadow: 0 12px 32px rgba(0, 0, 0, .15);
}

/* ---------- Portada ---------- */

.rpm-portada {
	flex: 0 0 auto;
	width: 42%;
	max-width: 300px;
	aspect-ratio: 1 / 1;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 10px 26px rgba(0, 0, 0, .4);
	background: rgba(0, 0, 0, .25);
}

.rpm-portada img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
	border-radius: 0;
}

/* ---------- Columna de datos ---------- */

.rpm-datos {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding-right: 8px;
}

.rpm-titulo {
	margin: 0 0 10px;
	font-size: clamp(28px, 4vw, 46px);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -.01em;
	color: var(--rpm-texto);
	overflow-wrap: anywhere;
}

.rpm-artista {
	margin: 0 0 28px;
	font-size: clamp(16px, 1.7vw, 21px);
	font-weight: 500;
	color: var(--rpm-acento);
	overflow-wrap: anywhere;
}

/* ---------- Controles ---------- */

.rpm-controles {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: auto;
	flex-wrap: wrap;
}

.rpm-tiempo {
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	opacity: .85;
	min-width: 42px;
	flex: 0 0 auto;
}

.rpm-duracion {
	text-align: right;
}

.rpm-barra {
	flex: 1 1 120px;
	min-width: 90px;
	padding: 8px 0;
	cursor: pointer;
	outline: none;
}

.rpm-barra-fondo {
	position: relative;
	height: 5px;
	border-radius: 4px;
	background: rgba(255, 255, 255, .28);
}

.rpm-tema-claro .rpm-barra-fondo {
	background: rgba(0, 0, 0, .18);
}

.rpm-barra-progreso {
	position: relative;
	height: 100%;
	width: 0;
	border-radius: 4px;
	background: var(--rpm-texto);
}

.rpm-barra-punto {
	position: absolute;
	top: 50%;
	right: -6px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--rpm-texto);
	transform: translateY(-50%) scale(0);
	transition: transform .15s ease;
}

.rpm-barra:hover .rpm-barra-punto,
.rpm-barra:focus-visible .rpm-barra-punto,
.rpm-reproductor.rpm-activo .rpm-barra-punto {
	transform: translateY(-50%) scale(1);
}

.rpm-barra:focus-visible .rpm-barra-fondo {
	box-shadow: 0 0 0 2px var(--rpm-acento);
}

/* Volumen */

.rpm-volumen {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
}

.rpm-btn-silencio {
	background: none;
	border: 0;
	padding: 2px;
	cursor: pointer;
	color: var(--rpm-texto);
	line-height: 0;
	opacity: .85;
}

.rpm-btn-silencio:hover {
	opacity: 1;
}

.rpm-reproductor.rpm-silenciado .rpm-ondas {
	opacity: .25;
}

.rpm-rango-volumen {
	width: 68px;
	height: 4px;
	appearance: none;
	-webkit-appearance: none;
	background: rgba(255, 255, 255, .28);
	border-radius: 4px;
	cursor: pointer;
	margin: 0;
	padding: 0;
}

.rpm-tema-claro .rpm-rango-volumen {
	background: rgba(0, 0, 0, .18);
}

.rpm-rango-volumen::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: var(--rpm-texto);
	border: 0;
	cursor: pointer;
}

.rpm-rango-volumen::-moz-range-thumb {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: var(--rpm-texto);
	border: 0;
	cursor: pointer;
}

/* Botón principal */

.rpm-btn-reproducir {
	flex: 0 0 auto;
	width: 58px;
	height: 58px;
	margin-left: auto;
	border: 0;
	border-radius: 50%;
	background: var(--rpm-texto);
	color: var(--rpm-fondo);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
	transition: transform .15s ease;
}

.rpm-btn-reproducir:hover {
	transform: scale(1.06);
}

.rpm-btn-reproducir:active {
	transform: scale(.97);
}

.rpm-icono-pausa {
	display: none;
}

.rpm-reproductor.rpm-activo .rpm-icono-play {
	display: none;
}

.rpm-reproductor.rpm-activo .rpm-icono-pausa {
	display: block;
}

/* Aviso de configuración (solo editores) */

.rpm-aviso {
	padding: 12px 16px;
	border-left: 4px solid #d63638;
	background: #fcf0f1;
	color: #3c434a;
	font-size: 14px;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
	.rpm-reproductor {
		flex-direction: column;
		gap: 20px;
		padding: 20px;
	}

	.rpm-portada {
		width: 100%;
		max-width: none;
	}

	.rpm-btn-reproducir {
		width: 52px;
		height: 52px;
	}

	.rpm-volumen {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rpm-reproductor,
	.rpm-btn-reproducir,
	.rpm-barra-punto {
		transition: none;
	}
}
