.player {
	flex-shrink: 0;
	width: 100%;
	margin-top: 15px;
	padding: 16px;
	background: var(--item_bg_color);
	backdrop-filter: blur(var(--card_filter));
	-webkit-backdrop-filter: blur(var(--card_filter));
	position: relative;
	overflow: hidden;
	--pl-line: color-mix(in srgb, var(--main_text_color) 18%, transparent);
	--pl-state: color-mix(in srgb, var(--main_text_color) 8%, transparent);
}
.player::before {
	content: "";
	position: absolute;
	inset: -50% -20% auto -20%;
	height: 140px;
	background: var(--pl-accent, #747bff);
	filter: blur(52px);
	opacity: 0.16;
	pointer-events: none;
	transition: background var(--m3-slow-dur) var(--m3-slow);
}

.playerTop {
	display: flex;
	gap: 12px;
	align-items: center;
	position: relative;
}

.playerCover {
	position: relative;
	width: 46px;
	height: 46px;
	flex-shrink: 0;
	animation: coverSpin 14s linear infinite;
	animation-play-state: paused;
}

.playerCover span {
	position: absolute;
	inset: 0;
	background-color: var(--pl-accent, #747bff);
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
	clip-path: var(--morph-clip);
	transition: background-color var(--m3-slow-dur) var(--m3-slow);
}

.player.playing .playerCover {
	animation-play-state: running;
}

@keyframes coverSpin {
	to {
		transform: rotate(360deg);
	}
}

.playerMeta {
	min-width: 0;
	flex: 1;
}

.playerTitle {
	font-size: 13px;
	font-weight: 800;
	line-height: 1.3;
	color: var(--main_text_color);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.playerArtist {
	font-size: 11px;
	margin-top: 2px;
	opacity: 0.6;
	color: var(--item_left_text_color);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.playerSeek {
	--pl-wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='16'%3E%3Cpath d='M0 8 q 3 -5 6 0 t 6 0 t 6 0 t 6 0' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
	position: relative;
	height: 22px;
	margin-top: 14px;
	padding: 0 3px;
	display: flex;
	align-items: center;
	cursor: pointer;
	touch-action: none;
}

.playerSeek .track {
	width: 100%;
	height: 16px;
	position: relative;
}

.playerSeek .fill {
	position: absolute;
	left: 0;
	top: 50%;
	width: var(--pl-p, 0%);
	height: 16px;
	box-sizing: border-box;
	border-right: 5px solid transparent;
	transform: translateY(-50%);
	background: var(--pl-accent, #747bff);
	background-clip: padding-box;
	-webkit-mask-image: var(--pl-wave);
	mask-image: var(--pl-wave);
	-webkit-mask-repeat: repeat-x;
	mask-repeat: repeat-x;
	-webkit-mask-size: 24px 16px;
	mask-size: 24px 16px;
	-webkit-mask-position: 0 50%;
	mask-position: 0 50%;
	transition: background-color var(--m3-slow-dur) var(--m3-slow);
}

.player.playing .playerSeek .fill {
	animation: plWave 1.05s linear infinite;
}

@keyframes plWave {
	to {
		-webkit-mask-position: -24px 50%;
		mask-position: -24px 50%;
	}
}

.playerSeek .rest {
	position: absolute;
	left: var(--pl-p, 0%);
	right: 0;
	top: 50%;
	height: 4px;
	margin-left: 5px;
	transform: translateY(-50%);
	border-radius: var(--m3-r-full);
	background: var(--pl-line);
}

.playerSeek .knob {
	position: absolute;
	top: 50%;
	left: var(--pl-p, 0%);
	width: 4px;
	height: 16px;
	border-radius: var(--m3-r-full);
	background: var(--pl-accent, #747bff);
	transform: translate(-50%, -50%);
	transition:
		height var(--m3-fast-dur) var(--m3-fast),
		background-color var(--m3-slow-dur) var(--m3-slow);
}
.playerSeek:hover .knob,
.playerSeek:active .knob {
	height: 22px;
}

@media (prefers-reduced-motion: reduce) {
	.player.playing .playerSeek .fill {
		animation: none;
	}
}

.playerTime {
	display: flex;
	justify-content: space-between;
	margin-top: 2px;
	font-size: 10px;
	font-variant-numeric: tabular-nums;
	opacity: 0.5;
	color: var(--item_left_text_color);
}

.playerControls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: 12px;
}

.playerControls button,
.playerVol button {
	border: none;
	background: transparent;
	color: var(--main_text_color);
	display: grid;
	place-items: center;
	cursor: pointer;
	transition:
		background-color var(--m3-effects-dur) var(--m3-effects),
		border-radius var(--m3-fast-dur) var(--m3-fast),
		transform var(--m3-fast-dur) var(--m3-fast);
}

.playerControls .prev,
.playerControls .next {
	width: 38px;
	height: 38px;
	border-radius: var(--m3-r-full);
}

.playerControls .prev:hover,
.playerControls .next:hover,
.playerVol button:hover {
	background: var(--pl-state);
}

.playerControls .prev:active,
.playerControls .next:active {
	border-radius: var(--m3-r-s);
	transform: scale(0.88);
}

.playerControls .play {
	width: 68px;
	height: 40px;
	border-radius: var(--m3-r-full);
	background: var(--pl-accent, #747bff);
	color: #fff;
	box-shadow: 0 10px 22px -12px var(--pl-accent, #747bff);
	transition:
		border-radius var(--m3-spatial-dur) var(--m3-spatial),
		background-color var(--m3-slow-dur) var(--m3-slow),
		transform var(--m3-fast-dur) var(--m3-fast);
}

.player.playing .playerControls .play {
	border-radius: var(--m3-r-m);
}

.playerControls .play:active {
	border-radius: var(--m3-r-xs);
	transform: scale(0.94);
}

.playerControls svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.playerControls .play svg {
	width: 22px;
	height: 22px;
}

.playerVol {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 14px;
	color: var(--item_left_text_color);
}

.playerVol button {
	width: 30px;
	height: 30px;
	flex-shrink: 0;
	border-radius: var(--m3-r-s);
	color: inherit;
}

.playerVol button:active {
	transform: scale(0.88);
}

.playerVol svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.player.muted .playerVol .mute {
	color: var(--pl-accent, #747bff);
}

.playerVol .listToggle {
	border-radius: var(--m3-r-s);
	transition:
		background-color var(--m3-effects-dur) var(--m3-effects),
		border-radius var(--m3-spatial-dur) var(--m3-spatial),
		color var(--m3-effects-dur) var(--m3-effects),
		transform var(--m3-spatial-dur) var(--m3-spatial);
}

.player.open .playerVol .listToggle {
	background: var(--m3-accent-soft);
	border-radius: var(--m3-r-full);
	color: var(--pl-accent, #747bff);
}

.playerVol input {
	flex: 1;
	min-width: 0;
	height: 16px;
	background: transparent;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.playerVol input::-webkit-slider-runnable-track {
	height: 4px;
	border-radius: var(--m3-r-full);
	background: var(--pl-line);
}

.playerVol input::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 4px;
	height: 14px;
	margin-top: -5px;
	border: none;
	border-radius: var(--m3-r-full);
	background: var(--pl-accent, #747bff);
}

.playerVol input::-moz-range-track {
	height: 4px;
	border-radius: var(--m3-r-full);
	background: var(--pl-line);
}

.playerVol input::-moz-range-thumb {
	width: 4px;
	height: 14px;
	border: none;
	border-radius: var(--m3-r-full);
	background: var(--pl-accent, #747bff);
}

.playerList {
	display: grid;
	grid-template-rows: 0fr;
	opacity: 0;
	overflow: hidden;
	transition:
		grid-template-rows var(--m3-spatial-dur) var(--m3-spatial),
		opacity var(--m3-effects-dur) var(--m3-effects),
		margin-top var(--m3-spatial-dur) var(--m3-spatial);
}

.player.open .playerList {
	grid-template-rows: 1fr;
	opacity: 1;
	margin-top: 12px;
}

.playerListInner {
	min-height: 0;
	display: grid;
	gap: 2px;
	padding-top: 12px;
	border-top: 1px solid var(--pl-line);
}

.playerList button {
	display: grid;
	grid-template-columns: 28px 1fr;
	gap: 10px;
	align-items: center;
	width: 100%;
	padding: 7px 10px;
	border: none;
	border-radius: var(--m3-r-m);
	background: transparent;
	color: var(--item_left_text_color);
	font-family: inherit;
	text-align: left;
	cursor: pointer;
	transition:
		background-color var(--m3-effects-dur) var(--m3-effects),
		border-radius var(--m3-fast-dur) var(--m3-fast);
}

.playerList button:hover {
	background: var(--pl-state);
}

.playerList button:active {
	border-radius: var(--m3-r-xs);
}

.playerList button.current {
	background: var(--m3-accent-soft);
}

.playerList .th {
	position: relative;
	width: 28px;
	height: 28px;
	border-radius: var(--m3-r-xs);
	overflow: hidden;
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
}

.playerList .tx {
	min-width: 0;
	display: grid;
}

.playerList .t {
	font-size: 11.5px;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	opacity: 0.75;
}

.playerList .a {
	font-size: 10px;
	line-height: 1.3;
	opacity: 0.45;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.playerList button.current .t {
	color: var(--main_text_color);
	opacity: 1;
}

.playerList .eq {
	position: absolute;
	inset: 0;
	display: none;
	align-items: flex-end;
	justify-content: center;
	gap: 2px;
	padding-bottom: 8px;
	background: rgba(0, 0, 0, 0.55);
}

.playerList button.current .eq {
	display: flex;
}

.playerList .eq s {
	width: 2px;
	height: 3px;
	border-radius: var(--m3-r-full);
	background: var(--pl-accent, #747bff);
}

.player.playing .playerList button.current .eq s {
	animation: plEq 0.9s ease-in-out infinite;
}

.playerList .eq s:nth-child(2) {
	animation-delay: 0.18s;
}

.playerList .eq s:nth-child(3) {
	animation-delay: 0.36s;
}

@keyframes plEq {
	0%,
	100% {
		height: 3px;
	}

	50% {
		height: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.player.playing .playerCover,
	.player.playing .playerSeek .fill,
	.player.playing .playerList button.current .eq s {
		animation: none;
	}
}
