:root {
	--card-min-width: 160px;
	--sidebar-width: 240px;
	--topbar-height: 60px;
	--gap: 1rem;
	--accent1: #f0f;
	--accent2: #ff0;
}

@font-face {
	font-family: Lucida Bright;
	src: url(lucida-bright.ttf);
}

/* Reset */
* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	font-family: Lucida Bright, serif;
}

body {
	background: #111 url('dither.gif') repeat;
}

body, a, button {
	color: #eef;
}

/* --- Base layout (desktop default) --- */

/* Topbar */
.topbar {
	background: #000;
	height: var(--topbar-height);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 1rem;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 2000;
	border-bottom: 3px double var(--accent1);
}

.row1,
.row2 {
	display: flex;
	align-items: center;
}

.row1 {
	gap: 0.75rem;
}

.row1 img {
	height: 50px;
}

.row2 {
	gap: 1rem;
}

.now-playing {
	font-size: 0.85rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 300px;
}

.hamburger {
	font-size: 1.5rem;
	cursor: pointer;
	display: none;
}

/* Layout */
.layout {
	display: flex;
	margin-top: var(--topbar-height);
}

/* Sidebar */
.sidebar {
	background: #000;
	width: var(--sidebar-width);
	padding: 1rem;
	border-right: 1px solid var(--accent1);
	height: calc(100vh - var(--topbar-height));
	position: sticky;
	top: var(--topbar-height);
	z-index: 1500;
}

.sidebar ul {
	list-style: none;
}

.sidebar li {
	margin-bottom: 1rem;
}

.sidebar a {
	text-decoration: none;
}

/* Content */
.content {
	flex: 1;
	padding: 1rem;
}

/* Grid */
.product-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width), 1fr));
	gap: var(--gap);
}

.album-card {
	background: #000;
	border-radius: 6px;
	padding: 1rem;
	border: 1px solid var(--accent1);
	cursor: pointer;
	transition: box-shadow 0.2s ease;
}

.album-card:hover {
	box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.album-card img {
	width: 100%;
	border-radius: 4px;
}

.album-title {
	margin-top: 0.75rem;
}

.album-artist {
	margin-top: 0.75rem;
	text-align: right;
	color: #aab;
}

/* Modal */
.modal {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.6);
	justify-content: center;
	align-items: center;
	z-index: 1000;
}

.modal-content {
	background: rgba(0,0,0,0.8);
	width: 80%;
	max-width: 1000px;
	max-height: 80vh;
	overflow-y: auto;
	border-radius: 8px;
	border: 3px double var(--accent2);
	padding: 2rem;
	position: relative;
}

.close-btn {
	position: absolute;
	top: 1rem;
	right: 1rem;
	font-size: 1.2rem;
	border: none;
	background: none;
	cursor: pointer;
}

/* Modal content */
.modal-art {
	width: 100%;
	max-width: 400px;
	margin-bottom: 1rem;
	border: 6px inset #000;
}

.track {
	margin-bottom: 1rem;
}

.track-title {
	font-size: 0.9rem;
	margin-bottom: 0.25rem;
}

.track-button {
	width: 100%;
	padding: 0.5rem;
	border: none;
	background: #333;
	cursor: pointer;
	text-align: left;
	border-radius: 4px;
}

.track-button:hover {
	background: #eef;
	color: #000;
}

/* Mobile */
.menu-toggle {
	display: none;
}

/* --- Mobile layout --- */

@media (max-width: 768px) {
	.topbar {
		height: calc(var(--topbar-height) * 2);
		flex-direction: column;
		align-items: stretch;
		padding: 0.5rem 1rem;
	}
	
	.row1 {
		display: flex;
		align-items: center;
		gap: 0.75rem;
		width: 100%;
	}
	
	.row1 img {
		flex: 0 0 auto;
	}
	
	.now-playing {
		flex: 1 1 auto;
		max-width: none;

		/* Allow up to 2 lines */
		white-space: normal;
		overflow: hidden;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}
	
	.row2 {
		position: relative;
		width: 100%;
		margin-top: 0.5rem;
	}
	
	.hamburger {
		display: block;
	}
	
	/* Row 2: audio full width */
	.row2 audio {
		width: 100%;
	}
	
	/* Sidebar offset must match new topbar height */
	.sidebar {
		position: fixed;
		left: -100%;
		top: calc(var(--topbar-height) * 2);
		height: calc(100vh - (var(--topbar-height) * 2));
		transition: left 0.2s ease;
		z-index: 1500;
	}
	
	.menu-toggle:checked ~ .layout .sidebar {
		left: 0;
	}
	
	.layout {
		flex-direction: column;
		margin-top: calc(var(--topbar-height) * 2);
	}
	
	.modal {
		align-items: flex-start; /* stop vertical centering */
		padding-top: calc(var(--topbar-height) * 2);
	}
	
	.modal-content {
		margin-top: 1rem; /* do not let topbar overlap */
		max-height: calc(100vh - (var(--topbar-height) * 2) - 2rem);
	}
}