:root {
	--bg: #080711;
	--bg-soft: #100e1d;
	--card: rgba(22, 19, 39, 0.86);
	--card-strong: #17142a;
	--border: rgba(167, 139, 250, 0.18);
	--border-strong: rgba(167, 139, 250, 0.35);
	--text: #f3f0ff;
	--muted: #a29bbd;
	--purple: #9b6cff;
	--purple-strong: #7c3aed;
	--teal: #35d6c2;
	--green: #1ed760;
	--red: #ff6b81;
	--shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
	--radius: 18px;
	--radius-sm: 12px;
	font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
}

* {
	box-sizing: border-box;
}

html,
body {
	min-height: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	line-height: 1.5;
	overflow-x: hidden;
}

.ambient {
	position: fixed;
	inset: -20%;
	z-index: -1;
	background:
		radial-gradient(circle at 15% 10%, rgba(124, 58, 237, 0.32), transparent 32%),
		radial-gradient(circle at 88% 18%, rgba(53, 214, 194, 0.16), transparent 28%),
		radial-gradient(circle at 50% 100%, rgba(124, 58, 237, 0.18), transparent 45%);
	filter: blur(10px);
}

.app {
	width: min(1180px, calc(100% - 32px));
	margin: 0 auto;
	padding: 26px 0 36px;
}

.hidden {
	/* biome-ignore lint/complexity/noImportantStyles: hidden must override component display rules */
	display: none !important;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 20px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	color: var(--text);
	text-decoration: none;
}

.logo {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 14px;
	background: linear-gradient(135deg, var(--purple), #4f46e5 60%, var(--teal));
	font-weight: 800;
	font-size: 1.25rem;
	box-shadow: 0 10px 30px rgba(124, 58, 237, 0.36);
}

.brand-text {
	display: flex;
	flex-direction: column;
	line-height: 1.15;
}

.brand-text strong {
	letter-spacing: 0.02em;
}

.brand-text small {
	color: var(--muted);
	font-size: 0.76rem;
}

.user {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--muted);
	font-size: 0.92rem;
}

.avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 1px solid var(--border-strong);
	background: var(--card-strong);
	object-fit: cover;
}

.card {
	background: linear-gradient(160deg, rgba(30, 26, 52, 0.94), rgba(16, 14, 29, 0.92));
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.center {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 14px;
	padding: 56px 28px;
}

.center h1 {
	margin: 0;
	font-size: clamp(1.6rem, 4vw, 2.3rem);
}

.center p {
	max-width: 560px;
	margin: 0;
}

.eyebrow {
	color: var(--teal);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.muted {
	color: var(--muted);
}

.small-text {
	font-size: 0.86rem;
}

.spinner {
	width: 34px;
	height: 34px;
	border: 3px solid rgba(155, 108, 255, 0.2);
	border-top-color: var(--purple);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

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

.room-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	padding: 22px 24px;
	margin-bottom: 16px;
}

.room-header h1 {
	margin: 4px 0 2px;
	font-size: clamp(1.35rem, 3vw, 1.9rem);
}

.room-header p {
	margin: 0;
}

.badges {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
}

.badge {
	display: inline-flex;
	align-items: center;
	padding: 6px 10px;
	border-radius: 999px;
	border: 1px solid var(--border-strong);
	background: rgba(155, 108, 255, 0.12);
	color: #d8ccff;
	font-size: 0.75rem;
	font-weight: 700;
}

.spotify-badge {
	border-color: rgba(30, 215, 96, 0.38);
	background: rgba(30, 215, 96, 0.12);
	color: #9df5ba;
}

.warning {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 22px 24px;
	margin-bottom: 16px;
	border-color: rgba(255, 184, 77, 0.28);
	background: linear-gradient(160deg, rgba(70, 48, 18, 0.55), rgba(25, 19, 12, 0.85));
}

.warning h2 {
	margin: 2px 0 4px;
	font-size: 1.2rem;
}

.warning p {
	margin: 0;
}

.now-playing {
	display: grid;
	grid-template-columns: 190px minmax(0, 1fr);
	gap: 24px;
	padding: 24px;
	margin-bottom: 16px;
}

.artwork-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 1;
}

.artwork {
	width: 100%;
	height: 100%;
	border-radius: 16px;
	object-fit: cover;
	border: 1px solid var(--border-strong);
	background: #0d0b18;
	box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
}

.artwork.placeholder {
	display: grid;
	place-items: center;
	color: rgba(243, 240, 255, 0.3);
	font-size: 4rem;
	background:
		radial-gradient(circle at 30% 20%, rgba(155, 108, 255, 0.25), transparent 55%), #120f22;
}

.track-info {
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
}

.track-info h2 {
	margin: 0;
	font-size: clamp(1.3rem, 3vw, 2rem);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.track-info p {
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.progress {
	height: 8px;
	margin-top: 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	overflow: hidden;
}

.progress-fill {
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--purple), var(--teal));
	transition: width 0.4s linear;
}

.progress-labels {
	display: flex;
	justify-content: space-between;
	color: var(--muted);
	font-size: 0.76rem;
	font-variant-numeric: tabular-nums;
}

.controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 9px;
	margin-top: 12px;
}

.button {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 9px 14px;
	border: 1px solid var(--border-strong);
	border-radius: 10px;
	background: rgba(155, 108, 255, 0.1);
	color: var(--text);
	font: inherit;
	font-size: 0.88rem;
	font-weight: 650;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		transform 0.15s ease;
}

.button:hover {
	background: rgba(155, 108, 255, 0.2);
	border-color: var(--purple);
}

.button:active {
	transform: translateY(1px);
}

.button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.button.primary {
	border-color: transparent;
	background: linear-gradient(135deg, var(--purple-strong), var(--purple));
	box-shadow: 0 10px 24px rgba(124, 58, 237, 0.26);
}

.button.primary:hover {
	background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

.button.danger {
	border-color: rgba(255, 107, 129, 0.36);
	background: rgba(255, 107, 129, 0.12);
	color: #ffc1ca;
}

.button.spotify {
	border-color: transparent;
	background: var(--green);
	color: #05220e;
}

.button.small {
	padding: 6px 10px;
	font-size: 0.78rem;
}

.button.ghost {
	background: transparent;
	border-color: transparent;
	color: var(--muted);
}

.volume {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-left: 4px;
	color: var(--muted);
	font-size: 0.82rem;
}

.volume input {
	width: 110px;
	accent-color: var(--purple);
}

.volume output {
	min-width: 38px;
	color: var(--text);
	font-variant-numeric: tabular-nums;
}

.columns {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
	gap: 16px;
	align-items: start;
}

.queue-card,
.tools {
	padding: 20px 22px;
}

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

.section-head h2 {
	margin: 0;
	font-size: 1.1rem;
}

.queue {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 520px;
	overflow: auto;
	scrollbar-width: thin;
}

.queue li {
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border: 1px solid transparent;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.025);
}

.queue li:hover {
	border-color: var(--border);
	background: rgba(155, 108, 255, 0.07);
}

.queue-index {
	color: var(--muted);
	font-size: 0.76rem;
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.queue-track {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.queue-title,
.result-title,
.saved-title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 0.9rem;
	font-weight: 650;
}

.queue-meta,
.result-meta,
.saved-meta {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--muted);
	font-size: 0.76rem;
}

.queue-duration {
	color: var(--muted);
	font-size: 0.76rem;
	font-variant-numeric: tabular-nums;
}

.tabs {
	display: flex;
	gap: 6px;
	padding: 4px;
	margin-bottom: 14px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.18);
}

.tab {
	flex: 1;
	padding: 8px 10px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-size: 0.82rem;
	font-weight: 700;
	cursor: pointer;
}

.tab.active {
	background: rgba(155, 108, 255, 0.18);
	color: var(--text);
}

.row {
	display: flex;
	gap: 8px;
}

input[type="search"],
input[type="url"] {
	width: 100%;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.24);
	color: var(--text);
	font: inherit;
	font-size: 0.88rem;
	outline: none;
}

input[type="search"]:focus,
input[type="url"]:focus {
	border-color: var(--purple);
	box-shadow: 0 0 0 3px rgba(155, 108, 255, 0.14);
}

.results,
.saved-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 12px;
	max-height: 430px;
	overflow: auto;
	scrollbar-width: thin;
}

.result-item,
.saved-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	padding: 10px;
	border: 1px solid var(--border);
	border-radius: 11px;
	background: rgba(255, 255, 255, 0.025);
}

.result-item:hover,
.saved-item:hover {
	border-color: var(--border-strong);
}

.result-info,
.saved-info {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.result-actions,
.saved-actions {
	display: flex;
	gap: 6px;
}

.spotify-box {
	margin-top: 14px;
	padding: 14px;
	border: 1px solid rgba(30, 215, 96, 0.24);
	border-radius: 12px;
	background: rgba(30, 215, 96, 0.06);
}

.spotify-box p {
	margin: 0 0 10px;
	color: var(--muted);
	font-size: 0.84rem;
}

.spotify-library {
	margin-top: 18px;
}

.spotify-library .section-head {
	align-items: flex-start;
}

.spotify-library .section-head h2 {
	margin: 0;
}

.spotify-library .section-head .saved-actions {
	flex-shrink: 0;
}

.import-status {
	margin-top: 14px;
	padding: 12px 14px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.18);
	font-size: 0.84rem;
}

.import-status strong {
	display: block;
	margin-bottom: 4px;
}

.import-status.error {
	border-color: rgba(255, 107, 129, 0.35);
	background: rgba(255, 107, 129, 0.08);
}

.import-status.done {
	border-color: rgba(53, 214, 194, 0.32);
	background: rgba(53, 214, 194, 0.07);
}

.import-status.partial {
	border-color: rgba(255, 196, 87, 0.35);
	background: rgba(255, 196, 87, 0.08);
}

.import-bar {
	height: 6px;
	margin: 8px 0 6px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	overflow: hidden;
}

.import-bar > span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--purple), var(--teal));
}

.footer {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 22px;
	color: var(--muted);
	font-size: 0.74rem;
}

.toast {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 20;
	max-width: min(420px, calc(100vw - 40px));
	padding: 12px 16px;
	border: 1px solid var(--border-strong);
	border-radius: 12px;
	background: #1b1730;
	box-shadow: var(--shadow);
	font-size: 0.86rem;
}

.toast.error {
	border-color: rgba(255, 107, 129, 0.45);
	background: #2a1520;
}

.toast.success {
	border-color: rgba(53, 214, 194, 0.4);
	background: #102522;
}

.empty-state {
	padding: 20px 10px;
	color: var(--muted);
	text-align: center;
	font-size: 0.86rem;
}

@media (max-width: 860px) {
	.now-playing {
		grid-template-columns: 1fr;
	}

	.artwork-wrap {
		width: min(260px, 70vw);
		margin: 0 auto;
	}

	.columns {
		grid-template-columns: 1fr;
	}

	.room-header,
	.warning {
		flex-direction: column;
		align-items: stretch;
	}

	.badges {
		justify-content: flex-start;
	}
}

@media (max-width: 560px) {
	.app {
		width: min(100% - 20px, 1180px);
		padding-top: 16px;
	}

	.topbar {
		align-items: flex-start;
	}

	.user #username {
		display: none;
	}

	.center {
		padding: 40px 18px;
	}

	.room-header,
	.now-playing,
	.queue-card,
	.tools {
		padding: 18px;
	}

	.row {
		flex-direction: column;
	}

	.row .button {
		width: 100%;
	}

	.footer {
		flex-direction: column;
	}
}
