.amp-player {
	--amp-bg: #ffffff;
	--amp-surface: #f7f7f8;
	--amp-border: #e3e3e6;
	--amp-black: #111111;
	--amp-muted: #6b6b6f;
	--amp-active-bg: #f0f0f1;
	--amp-radius: 14px;

	background: var(--amp-bg);
	color: var(--amp-black);
	border-radius: var(--amp-radius);
	padding: 26px;
	max-width: 620px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, "Vazirmatn", Arial, sans-serif;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
	border: 1px solid var(--amp-border);
	box-sizing: border-box;
}

.amp-player * {
	box-sizing: border-box;
}

.amp-heading {
	color: var(--amp-black);
	font-size: 1.3rem;
	font-weight: 700;
	margin: 0 0 18px;
	text-align: center;
	letter-spacing: 0.01em;
}

/* Now playing */
.amp-now-playing {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 20px;
}

.amp-art {
	flex: 0 0 auto;
	width: 54px;
	height: 54px;
	border-radius: 10px;
	background: var(--amp-black);
	display: flex;
	align-items: center;
	justify-content: center;
}

.amp-art-mark {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #ffffff;
}

.amp-meta {
	min-width: 0;
}

.amp-track-number {
	display: block;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--amp-muted);
	margin-bottom: 3px;
}

.amp-title {
	margin: 0;
	font-size: 1.12rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--amp-black);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.amp-subtitle {
	margin: 2px 0 0;
	font-size: 0.92rem;
	color: var(--amp-muted);
}

.amp-genre {
	margin: 2px 0 0;
	font-size: 0.78rem;
	color: var(--amp-muted);
	opacity: 0.85;
}

/* Controls */
.amp-controls {
	background: var(--amp-surface);
	border: 1px solid var(--amp-border);
	border-radius: 12px;
	padding: 16px 18px;
	margin-bottom: 16px;
}

.amp-audio {
	display: none;
}

.amp-transport {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-bottom: 14px;
}

.amp-btn {
	background: transparent;
	border: none;
	color: var(--amp-black);
	cursor: pointer;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, transform 0.1s ease;
}

.amp-btn:hover {
	background: var(--amp-active-bg);
}

.amp-btn:active {
	transform: scale(0.94);
}

.amp-btn.amp-repeat {
	color: var(--amp-muted);
}

.amp-btn.amp-repeat.is-active {
	color: #ffffff;
	background: var(--amp-black);
}

.amp-play {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--amp-black);
	color: #ffffff;
	margin: 0 4px;
}

.amp-play:hover {
	background: #2b2b2b;
}

/* Pure-CSS icons: no SVG/font/icon-set dependency, so they render
   even if a theme resets or hides those. */
.amp-icon {
	display: block;
	position: relative;
}

.amp-icon-play {
	width: 0;
	height: 0;
	border-top: 7px solid transparent;
	border-bottom: 7px solid transparent;
	border-left: 11px solid currentColor;
	margin-left: 3px;
}

.amp-icon-pause {
	width: 12px;
	height: 14px;
}

.amp-icon-pause::before,
.amp-icon-pause::after {
	content: "";
	position: absolute;
	top: 0;
	width: 4px;
	height: 14px;
	background: currentColor;
}

.amp-icon-pause::before { left: 0; }
.amp-icon-pause::after { right: 0; }

.amp-icon-skip {
	display: flex;
	align-items: center;
	gap: 2px;
	width: 16px;
	height: 14px;
}

.amp-icon-skip .amp-icon-tri {
	width: 0;
	height: 0;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
	border-left: 9px solid currentColor;
}

.amp-icon-skip .amp-icon-bar {
	width: 3px;
	height: 12px;
	background: currentColor;
}

.amp-icon-skip-back {
	flex-direction: row-reverse;
}

.amp-icon-skip-back .amp-icon-tri {
	border-left: none;
	border-right: 9px solid currentColor;
}

.amp-icon-repeat {
	width: 15px;
	height: 15px;
	border: 2px solid currentColor;
	border-radius: 50%;
	border-bottom-color: transparent;
	border-left-color: transparent;
	transform: rotate(45deg);
}

.amp-icon-repeat::after {
	content: "";
	position: absolute;
	top: -4px;
	right: -2px;
	width: 0;
	height: 0;
	border-left: 3.5px solid transparent;
	border-right: 3.5px solid transparent;
	border-bottom: 5px solid currentColor;
	transform: rotate(90deg);
}

/* Progress bar — always left to right, even inside an RTL player */
.amp-progress-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	direction: ltr;
}

.amp-time {
	font-size: 0.75rem;
	color: var(--amp-muted);
	min-width: 34px;
	text-align: center;
	direction: ltr;
}

.amp-seek {
	flex: 1;
	direction: ltr;
	appearance: none;
	-webkit-appearance: none;
	height: 4px;
	border-radius: 2px;
	background: var(--amp-border);
	outline: none;
}

.amp-seek::-webkit-slider-thumb {
	appearance: none;
	-webkit-appearance: none;
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background: var(--amp-black);
	cursor: pointer;
}

.amp-seek::-moz-range-thumb {
	width: 13px;
	height: 13px;
	border: none;
	border-radius: 50%;
	background: var(--amp-black);
	cursor: pointer;
}

/* Lyrics */
.amp-lyrics-toggle {
	background: transparent;
	border: 1px solid var(--amp-border);
	color: var(--amp-black);
	border-radius: 8px;
	padding: 6px 14px;
	font-size: 0.85rem;
	cursor: pointer;
	margin-bottom: 12px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.amp-lyrics-toggle:hover {
	background: var(--amp-active-bg);
}

.amp-caret {
	display: inline-block;
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	transition: transform 0.2s ease;
}

.amp-lyrics-toggle.is-open .amp-caret {
	transform: rotate(180deg);
}

.amp-lyrics {
	white-space: pre-line;
	background: var(--amp-surface);
	border: 1px solid var(--amp-border);
	border-radius: 10px;
	padding: 14px 16px;
	margin-bottom: 16px;
	font-size: 0.9rem;
	line-height: 1.8;
	color: var(--amp-muted);
	max-height: 260px;
	overflow-y: auto;
}

/* Playlist */
.amp-playlist-heading {
	color: var(--amp-black);
	font-size: 0.82rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	margin: 0 0 10px;
}

.amp-playlist {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 340px;
	overflow-y: auto;
}

.amp-track {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.amp-track:hover {
	background: var(--amp-surface);
}

.amp-track.is-active {
	background: var(--amp-active-bg);
}

.amp-track-index {
	flex: 0 0 auto;
	width: 22px;
	text-align: center;
	font-size: 0.8rem;
	color: var(--amp-muted);
}

.amp-track.is-active .amp-track-index {
	color: var(--amp-black);
	font-weight: 700;
}

.amp-track-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.amp-track-title {
	font-size: 0.92rem;
	color: var(--amp-black);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.amp-track.is-active .amp-track-title {
	font-weight: 700;
}

.amp-track-artist {
	font-size: 0.78rem;
	color: var(--amp-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.amp-track-playing-indicator {
	flex: 0 0 auto;
	display: none;
	align-items: flex-end;
	gap: 2px;
	height: 14px;
}

.amp-track.is-active.is-playing .amp-track-playing-indicator {
	display: flex;
}

.amp-track-playing-indicator span {
	width: 3px;
	background: var(--amp-black);
	animation: amp-bounce 0.9s ease-in-out infinite;
}

.amp-track-playing-indicator span:nth-child(1) { height: 6px; animation-delay: 0s; }
.amp-track-playing-indicator span:nth-child(2) { height: 12px; animation-delay: 0.15s; }
.amp-track-playing-indicator span:nth-child(3) { height: 8px; animation-delay: 0.3s; }

@keyframes amp-bounce {
	0%, 100% { transform: scaleY(0.4); }
	50% { transform: scaleY(1); }
}

.amp-empty {
	color: var(--amp-muted);
	font-style: italic;
}

@media (max-width: 480px) {
	.amp-player {
		padding: 18px;
	}
	.amp-title {
		font-size: 1rem;
	}
}
