:root {
	--bg: #f9fbf6;
	--surface: #ffffff;
	--panel: #f1f7ee;
	--ink: #18221c;
	--muted: #5d6e63;
	--line: #d8e2d4;
	--brand: #2d8a56;
	--brand-ink: #0f2f1d;
	--danger: #bd3d30;
	--radius: 14px;
	--shadow: 0 14px 40px rgba(24, 34, 28, 0.09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: "Manrope", system-ui, -apple-system, Segoe UI, sans-serif;
	color: var(--ink);
	background:
		radial-gradient(circle at 80% -10%, rgba(106, 185, 125, 0.25), transparent 35%),
		radial-gradient(circle at 0% 100%, rgba(146, 209, 149, 0.2), transparent 35%),
		var(--bg);
}

h1, h2, h3, .brand {
	font-family: "Space Grotesk", "Manrope", sans-serif;
}

.container {
	width: min(1150px, 92vw);
	margin: 0 auto;
}

.site-head {
	position: sticky;
	top: 0;
	backdrop-filter: blur(8px);
	background: rgba(249, 251, 246, 0.8);
	border-bottom: 1px solid var(--line);
	z-index: 50;
}

.nav-wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 0;
}

.brand {
	text-decoration: none;
	color: var(--brand-ink);
	font-weight: 700;
	font-size: 1.2rem;
}

.top-nav {
	display: flex;
	gap: 1rem;
}

.top-nav a {
	text-decoration: none;
	color: var(--ink);
	font-weight: 600;
}

.hero {
	padding: 2.5rem 0 1.5rem;
}

.hero-grid {
	display: grid;
	grid-template-columns: 1.2fr 1fr;
	gap: 1.4rem;
	align-items: start;
}

.chip {
	display: inline-flex;
	margin: 0 0 0.8rem;
	padding: 0.4rem 0.75rem;
	background: #dcefd9;
	border: 1px solid #cae7c4;
	border-radius: 999px;
	color: #1e653f;
	font-weight: 700;
	font-size: 0.82rem;
}

h1 {
	margin: 0;
	line-height: 1.1;
	font-size: clamp(1.9rem, 2.6vw, 3.1rem);
}

.lead {
	max-width: 62ch;
	color: var(--muted);
}

.rule-grid {
	margin-top: 1rem;
	display: grid;
	grid-template-columns: repeat(2, minmax(130px, 1fr));
	gap: 0.75rem;
}

.rule-grid article {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 0.8rem;
	box-shadow: var(--shadow);
}

.rule-grid strong {
	display: block;
	margin-bottom: 0.25rem;
}

.rule-grid span {
	color: var(--muted);
	font-size: 0.92rem;
}

.section {
	padding: 1.2rem 0;
}

.section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.8rem;
	margin-bottom: 0.8rem;
}

.section-head h2 {
	margin: 0;
}

.dashboard-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(220px, 1fr));
	gap: 1rem;
}

.panel {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1rem;
	box-shadow: var(--shadow);
}

.upload-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(180px, 1fr));
	gap: 0.8rem;
	align-items: end;
}

label {
	display: grid;
	gap: 0.35rem;
	font-weight: 600;
	font-size: 0.93rem;
}

input, select {
	width: 100%;
	border: 1px solid #c8d6c7;
	background: #fcfefb;
	border-radius: 10px;
	padding: 0.62rem 0.7rem;
	font: inherit;
	color: var(--ink);
}

input:focus, select:focus {
	outline: 2px solid #8ec89f;
	outline-offset: 1px;
}

.btn {
	border: 1px solid transparent;
	border-radius: 10px;
	padding: 0.65rem 0.9rem;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	background: var(--brand);
	color: #fff;
	transition: transform 180ms ease, filter 180ms ease;
}

.btn:hover {
	transform: translateY(-1px);
	filter: brightness(1.02);
}

.btn.ghost {
	background: transparent;
	color: var(--brand-ink);
	border-color: #bfd8c2;
}

.badge {
	border: 1px solid #c7dec9;
	background: #eaf6e8;
	color: #255f3d;
	border-radius: 999px;
	padding: 0.2rem 0.65rem;
	font-size: 0.82rem;
	font-weight: 700;
}

.badge.bad {
	background: #fcebe8;
	border-color: #f2c3bd;
	color: var(--danger);
}

.muted {
	color: var(--muted);
	margin-bottom: 0;
}

.small {
	font-size: 0.84rem;
}

.controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	align-items: center;
	justify-content: end;
}

#search {
	min-width: 240px;
}

.filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.filters button {
	border: 1px solid #bed3bf;
	background: #f7fbf5;
	color: #295336;
	border-radius: 999px;
	padding: 0.36rem 0.7rem;
	cursor: pointer;
	font-weight: 700;
	font-size: 0.8rem;
}

.filters button.active {
	background: #2d8a56;
	color: #fff;
	border-color: #2d8a56;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(4, minmax(160px, 1fr));
	gap: 0.95rem;
}

.card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: var(--shadow);
}

.card img {
	display: block;
	width: 100%;
	height: 170px;
	object-fit: cover;
}

.meta {
	padding: 0.7rem;
}

.title {
	margin: 0;
	font-weight: 800;
}

.by, .price {
	margin: 0.25rem 0;
	color: var(--muted);
	font-size: 0.88rem;
}

.actions {
	display: flex;
	gap: 0.5rem;
}

.actions .btn {
	width: 100%;
}

.list {
	display: grid;
	gap: 0.6rem;
}

.item-row {
	background: #f8fcf6;
	border: 1px solid #d8e5d4;
	border-radius: 10px;
	padding: 0.65rem;
	display: flex;
	justify-content: space-between;
	gap: 0.8rem;
	align-items: center;
}

.item-actions {
	display: flex;
	gap: 0.5rem;
}

.danger {
	background: var(--danger);
}

.modal {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	background: rgba(7, 12, 9, 0.72);
	opacity: 0;
	visibility: hidden;
	transition: opacity 220ms ease;
	z-index: 80;
}

.modal.open {
	opacity: 1;
	visibility: visible;
}

.modal-card {
	width: min(820px, 92vw);
	background: #ffffff;
	border: 1px solid #d4e0d1;
	border-radius: 14px;
	padding: 1rem;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

.close-modal {
	float: right;
	border: 0;
	background: transparent;
	font-size: 1rem;
	cursor: pointer;
}

.preview-wrap {
	position: relative;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid #d7e3d4;
}

.preview-wrap img {
	width: 100%;
	height: clamp(180px, 42vw, 450px);
	object-fit: contain; /* Changed from 'cover' so they can see the FULL artwork without cropping */
	background: #0f1712; /* Dark backdrop for vertical/square phone wallpapers */
	/* REMOVED THE BLUR AND SCALE! Now it is crystal clear. */
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: none; /* Prevents them from dragging the image to their desktop */
}

.preview-wrap::after {
	content: "WALLPAPER MARKET PREVIEW • DO NOT COPY • WALLPAPER MARKET PREVIEW •";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	color: rgba(255, 255, 255, 0.35);
	font-size: clamp(1rem, 2vw, 1.5rem);
	font-weight: 800;
	letter-spacing: 2px;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
	background: repeating-linear-gradient(
		-45deg,
		rgba(0, 0, 0, 0.15),
		rgba(0, 0, 0, 0.15) 20px,
		transparent 20px,
		transparent 40px
	);
	pointer-events: none; /* Lets them click through, but burns the watermark over screenshots */
}

.watermark {
	position: absolute;
	inset: auto auto 0.65rem 0.65rem;
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	border-radius: 999px;
	padding: 0.34rem 0.58rem;
	font-weight: 700;
}

.modal-actions {
	margin-top: 0.7rem;
	display: flex;
	gap: 0.55rem;
}

.hidden {
	display: none;
}

.toast {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	background: #1c3023;
	color: #fff;
	padding: 0.6rem 0.85rem;
	border-radius: 10px;
	opacity: 0;
	transform: translateY(8px);
	transition: 220ms ease;
	pointer-events: none;
	z-index: 100;
}

.toast.show {
	opacity: 1;
	transform: translateY(0);
}

.site-foot {
	margin-top: 1.4rem;
	padding: 1.2rem 0 2.2rem;
	color: var(--muted);
	border-top: 1px solid var(--line);
}

@media (max-width: 1040px) {
	.gallery { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
	.dashboard-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 780px) {
	.hero-grid, .dashboard-grid, .upload-grid { grid-template-columns: 1fr; }
	.gallery { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
	.section-head { align-items: start; flex-direction: column; }
	.controls { justify-content: start; }
	#search { min-width: 100%; }
}

@media (max-width: 500px) {
	.gallery { grid-template-columns: 1fr; }
	.item-row { flex-direction: column; align-items: start; }
}
