/* === Reset === */
*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* === Base === */
body {
	background: #0a0a0a;
	color: #fff;
	font-family: 'Outfit', system-ui, -apple-system, sans-serif;
	min-height: 100vh;
	display: flex;
	justify-content: center;
	align-items: center;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* === Container === */
#container {
	width: 100%;
	max-width: 720px;
	min-height: 100vh;
	min-height: 100dvh;
	position: relative;
	overflow: hidden;
	margin: 0 auto;
}

/* ========================================
   NOW PLAYING VIEW
   ======================================== */

/* Blurred album art background */
.artwork {
	position: absolute;
	inset: 0;
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	opacity: 0.45;
	filter: blur(80px) saturate(1.4);
	transform: scale(1.3);
	z-index: 0;
}

/* Main content area — centered */
#main {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	min-height: 100dvh;
	padding: 2rem 1.5rem;
	gap: 1rem;
}

/* Album artwork */
.art_image {
	width: min(500px, 80vw);
	height: auto;
	border-radius: 10px;
	box-shadow:
		0 8px 40px rgba(0, 0, 0, 0.6),
		0 2px 12px rgba(0, 0, 0, 0.4);
}

/* Track info text block */
.text {
	text-align: center;
	max-width: min(500px, 85vw);
}

.track {
	font-weight: 700;
	font-size: clamp(1.25rem, 4vw, 2rem);
	line-height: 1.2;
	margin-top: 0.5rem;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.artist {
	font-weight: 400;
	font-size: clamp(1.1rem, 3.5vw, 1.75rem);
	color: #e0e0e0;
	margin-top: 0.15rem;
}

.album {
	font-size: clamp(0.85rem, 2.5vw, 1.2rem);
	color: #8d9194;
	font-weight: 300;
	font-style: italic;
	margin-top: 0.25rem;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
}

.number {
	font-weight: 400;
	margin-top: 0.75rem;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #8d9194;
}

/* ========================================
   LAST PLAYED / IDLE VIEW
   ======================================== */

#container.last_played {
	background: #111113;
	display: flex;
	flex-direction: column;
	padding: 1.5rem;
	gap: 1rem;
	min-height: 100vh;
	min-height: 100dvh;
}

/* Username */
.user {
	font-weight: 700;
	font-size: clamp(1.5rem, 5vw, 2rem);
	letter-spacing: -0.02em;
}

/* Stat boxes row */
.stats-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

.stat_box {
	background: #161618;
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 12px;
	padding: 2.5rem 1rem 1.25rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	position: relative;
	min-height: 130px;
}

.stat_box .header {
	position: absolute;
	top: 0.75rem;
	left: 1rem;
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #6b6e72;
}

.stat_box .scrobbles {
	font-size: clamp(2rem, 6vw, 2.75rem);
	font-weight: 700;
	color: #fff;
	text-align: center;
	letter-spacing: -0.02em;
}

.stat_box .play_box {
	text-align: center;
}

.stat_box .track {
	font-size: clamp(0.95rem, 2.5vw, 1.25rem);
	font-weight: 600;
	color: #fff;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	text-align: center;
	margin-top: 0;
}

.stat_box .artist {
	margin-top: 0.35rem;
	font-size: clamp(0.8rem, 2vw, 0.95rem);
	color: #8d9194;
	font-weight: 400;
	text-align: center;
}

/* Section label */
.list {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #6b6e72;
	margin-top: 0.25rem;
}

/* Album art grid */
.albums {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0.6rem;
	flex-grow: 1;
}

.top_albums {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 8px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
	transition: transform 0.2s ease;
}

.top_albums:hover {
	transform: scale(1.04);
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Small phones */
@media (max-width: 400px) {
	.albums {
		grid-template-columns: repeat(3, 1fr);
	}

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

	.stat_box {
		min-height: 100px;
	}

	#container.last_played {
		padding: 1.25rem 1rem;
	}
}

/* Tablets and wider phones */
@media (min-width: 401px) and (max-width: 599px) {
	.albums {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Desktop — add breathing room */
@media (min-width: 720px) {
	body {
		padding: 2rem;
	}

	#container {
		min-height: auto;
		border-radius: 16px;
	}

	#container.last_played {
		min-height: auto;
		padding: 2rem;
	}

	#main {
		min-height: 720px;
	}
}

/* ========================================
   EMBED MODE (inside iframe)
   Transparent background, dark cards float
   on the parent page's background.
   ======================================== */

html.embed body {
	background: transparent;
	padding: 0;
	min-height: auto;
}

html.embed #container {
	min-height: auto;
	border-radius: 12px;
}

html.embed #container.last_played {
	background: transparent;
	min-height: auto;
	padding: 0.75rem 0;
	gap: 0.6rem;
}

html.embed .user {
	color: #1a1a1a;
}

html.embed .list {
	color: #888;
}

html.embed .stat_box {
	background: #1a1a1e;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
	min-height: 110px;
	padding-top: 2rem;
}

html.embed .albums {
	gap: 0.5rem;
}

html.embed .top_albums {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

html.embed #main {
	min-height: auto;
}

html.embed .artwork {
	border-radius: 12px;
}
