/* ==========================================================================
   Qamuz · Reproductor: album-style player. Colors from the Qamuz tokens
   (qamuz-base.css); --pl-tint comes from the cover of the current song.
   ========================================================================== */

.qz-pl {
	--pl-tint: var(--qz-accent);
	position: relative;
	isolation: isolate;
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
	align-items: flex-start;
	padding: 28px;
	overflow: hidden;
	border: 1px solid var(--qz-line);
	border-radius: 22px;
	background: var(--qz-surface);
	color: var(--qz-ink);
	container: qzpl / inline-size;
}

.qz-pl__loading,
.qz-pl__empty {
	flex-basis: 100%;
	margin: 0;
	color: var(--qz-soft);
	text-align: center;
}

.qz-pl__empty {
	display: grid;
	justify-items: center;
	gap: 14px;
	padding: 24px 0;
}

.qz-pl__empty p {
	margin: 0;
}

.qz-pl__bg {
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		radial-gradient(110% 90% at 0% 0%, color-mix(in srgb, var(--pl-tint) 34%, transparent), transparent 62%),
		radial-gradient(70% 70% at 100% 100%, color-mix(in srgb, var(--pl-tint) 16%, transparent), transparent 65%),
		var(--qz-surface);
	transition: opacity 0.6s;
}

/* ---------- cover + vinyl ---------- */

.qz-pl__art {
	position: relative;
	flex: 0 1 clamp(220px, 36%, 380px);
	min-width: 0;
}

.qz-pl__disc {
	position: absolute;
	top: 4%;
	right: 0;
	width: 92%;
	aspect-ratio: 1;
	border-radius: 50%;
	background:
		radial-gradient(circle, #0b0d12 0 3%, var(--pl-tint) 3.5% 16%, #0b0d12 16.5% 18%, transparent 18.5%),
		repeating-radial-gradient(circle, #121419 0 1.5px, #1c1f26 1.5px 3px);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
	transition: transform 0.6s ease;
}

.qz-pl.is-playing .qz-pl__disc {
	animation: qz-pl-spin 3.2s linear infinite;
}

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

.qz-pl__sleeve {
	position: relative;
	z-index: 1;
	width: 85%;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 16px;
	box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.qz-pl__cover {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(circle at 28% 25%, hsl(var(--h, 190) 85% 62% / 0.9), transparent 55%),
		linear-gradient(140deg, hsl(var(--h, 190) 45% 22%), #0b0f16);
	background-position: center;
	background-size: cover;
	transition: transform 0.6s ease;
}

.qz-pl.is-playing .qz-pl__cover {
	transform: scale(1.03);
}

.qz-pl__big {
	position: absolute;
	bottom: 14px;
	left: 14px;
	display: grid;
	place-items: center;
	width: 58px;
	height: 58px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--qz-accent);
	color: var(--qz-accent-ink);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
	cursor: pointer;
	transition: transform 0.15s ease;
}

.qz-pl__big:hover {
	transform: scale(1.06);
}

/* ---------- now playing ---------- */

.qz-pl__main {
	display: grid;
	flex: 999 1 340px;
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
	min-width: 0;
}

.qz-pl__kicker {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: var(--qz-accent);
	font: 600 12px/1 var(--qz-mono);
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.qz-pl__title {
	margin: 2px 0 0;
	overflow: hidden;
	color: var(--qz-ink);
	font: 700 clamp(22px, 4cqi, 34px)/1.1 var(--qz-display);
	letter-spacing: -0.01em;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.qz-pl__sub {
	margin: 0;
	color: var(--qz-soft);
	font-size: 14px;
}

.qz-pl__ctrl {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
	padding: 10px 14px;
	border: 1px solid var(--qz-line);
	border-radius: 999px;
	background: color-mix(in srgb, var(--qz-bg) 55%, transparent);
	backdrop-filter: blur(8px);
}

.qz-pl__btn {
	display: grid;
	flex: none;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--qz-soft);
	cursor: pointer;
}

.qz-pl__btn:hover {
	color: var(--qz-ink);
}

.qz-pl__btn--play {
	width: 42px;
	height: 42px;
	background: var(--qz-ink);
	color: var(--qz-bg);
}

.qz-pl__btn--play:hover {
	color: var(--qz-bg);
}

.qz-pl__time {
	flex: none;
	min-width: 36px;
	color: var(--qz-soft);
	font: 500 12px/1 var(--qz-mono);
	text-align: center;
}

.qz-pl__ctrl input[type="range"] {
	flex: 1;
	min-width: 0;
	accent-color: var(--qz-accent);
}

/* ---------- lyrics ---------- */

.qz-pl__lyrics {
	position: relative;
	max-height: 132px;
	margin-top: 4px;
	padding: 6px 2px;
	overflow: auto;
	color: color-mix(in srgb, var(--qz-soft) 75%, transparent);
	font: 600 17px/1.75 var(--qz-sans);
	scrollbar-width: none;
	-webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
	mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
}

.qz-pl__lyrics::-webkit-scrollbar {
	display: none;
}

.qz-pl__lyrics.is-plain {
	font-size: 15px;
	white-space: pre-line;
}

.qz-pl__word {
	transition: color 0.15s;
}

.qz-pl__word.is-sung {
	color: var(--qz-ink);
}

.qz-pl__word.is-current {
	color: var(--qz-accent);
	text-shadow: 0 0 18px color-mix(in srgb, var(--qz-accent) 45%, transparent);
}

/* ---------- playlist ---------- */

.qz-pl__list {
	display: grid;
	gap: 2px;
	max-height: 300px;
	margin: 6px 0 0;
	padding: 0;
	overflow: auto;
	list-style: none;
	scrollbar-width: thin;
}

.qz-pl__row {
	display: grid;
	grid-template-columns: 28px 40px minmax(0, 1fr);
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 7px 10px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--qz-ink);
	text-align: left;
	cursor: pointer;
}

.qz-pl__row:hover {
	background: color-mix(in srgb, var(--qz-ink) 6%, transparent);
}

.qz-pl__row.is-current {
	background: color-mix(in srgb, var(--pl-tint) 16%, transparent);
}

.qz-pl__n {
	display: grid;
	place-items: center;
	color: var(--qz-soft);
	font: 600 12px/1 var(--qz-mono);
}

.qz-pl__n .qz-pl__eq {
	display: none;
}

.qz-pl.is-playing .qz-pl__row.is-current .qz-pl__n b {
	display: none;
}

.qz-pl.is-playing .qz-pl__row.is-current .qz-pl__n .qz-pl__eq {
	display: inline-flex;
}

.qz-pl__mini {
	width: 40px;
	height: 40px;
	border-radius: 8px;
	background:
		radial-gradient(circle at 30% 25%, hsl(var(--h, 190) 85% 62% / 0.9), transparent 55%),
		linear-gradient(140deg, hsl(var(--h, 190) 45% 22%), #0b0f16);
	background-position: center;
	background-size: cover;
}

.qz-pl__rowtext {
	display: grid;
	min-width: 0;
}

.qz-pl__rowtext strong,
.qz-pl__rowtext small {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.qz-pl__rowtext strong {
	font: 700 14px/1.3 var(--qz-sans);
}

.qz-pl__row.is-current strong {
	color: var(--qz-accent);
}

.qz-pl__rowtext small {
	color: var(--qz-soft);
	font-size: 12px;
}

/* equalizer bars (playing indicator) */
.qz-pl__eq {
	display: inline-flex;
	align-items: flex-end;
	gap: 2px;
	height: 12px;
}

.qz-pl__eq i {
	width: 3px;
	height: 30%;
	border-radius: 2px;
	background: currentColor;
}

.qz-pl__kicker .qz-pl__eq {
	display: none;
}

.qz-pl.is-playing .qz-pl__kicker .qz-pl__eq {
	display: inline-flex;
}

.qz-pl.is-playing .qz-pl__eq i {
	animation: qz-pl-eq 0.9s ease-in-out infinite;
}

.qz-pl.is-playing .qz-pl__eq i:nth-child(2) {
	animation-delay: -0.3s;
}

.qz-pl.is-playing .qz-pl__eq i:nth-child(3) {
	animation-delay: -0.6s;
}

@keyframes qz-pl-eq {
	0%,
	100% {
		height: 25%;
	}

	50% {
		height: 100%;
	}
}

/* ---------- layouts ---------- */
/* Cover and details sit side by side and wrap when the box is narrow (any column width). */

.qz-pl--stack .qz-pl__art {
	flex: 0 0 min(100%, 340px);
	margin-inline: auto;
}

.qz-pl--stack .qz-pl__main {
	flex-basis: 100%;
}

.qz-pl--nolist:not(.qz-pl--stack) {
	align-items: center;
}

@container qzpl (max-width: 720px) {
	.qz-pl__art {
		flex: 0 0 min(100%, 300px);
		margin-inline: auto;
	}

	.qz-pl__lyrics {
		font-size: 15px;
	}
}

@media (max-width: 680px) {
	.qz-pl {
		gap: 22px;
		padding: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.qz-pl.is-playing .qz-pl__disc,
	.qz-pl.is-playing .qz-pl__eq i {
		animation: none;
	}
}
