:root {
	--bg: #0b0f14;
	--bg-raised: #131a22;
	--panel: #1a232e;
	--panel-2: #202c39;
	--border: #2c3a49;
	--text: #e6edf3;
	--text-dim: #93a4b5;
	--accent: #4ade80;
	--accent-dark: #22c55e;
	--mine-green: #3f852e;
	--grass: #5ebd3b;
	--dirt: #9a5a2d;
	--gold: #f6b83d;
	--danger: #ef4444;
	--pixel-font: "Pixelify Sans", sans-serif;
	--font: "Inter", system-ui, sans-serif;
	--shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	scroll-behavior: smooth;
}

body {
	font-family: var(--font);
	background:
		radial-gradient(1200px 600px at 80% -10%, rgba(54, 130, 70, 0.18), transparent 60%),
		radial-gradient(900px 500px at -10% 20%, rgba(246, 184, 61, 0.07), transparent 60%),
		var(--bg);
	color: var(--text);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.container {
	width: min(1200px, 94vw);
	margin-inline: auto;
}

.pixel {
	font-family: var(--pixel-font);
	letter-spacing: 0.03em;
	image-rendering: pixelated;
}

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

/* ---- Header ---- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(11, 15, 20, 0.85);
	backdrop-filter: blur(8px);
	border-bottom: 2px solid var(--border);
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 14px 0;
}

.logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: var(--text);
	font-family: var(--pixel-font);
	font-size: 22px;
}

.logo-block {
	width: 26px;
	height: 26px;
	display: inline-block;
	border-radius: 4px;
	background:
		linear-gradient(135deg, var(--grass) 0 49%, var(--dirt) 50% 100%);
	box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.25), inset 3px 3px 0 rgba(255, 255, 255, 0.15);
}

.nav {
	display: flex;
	gap: 4px;
	margin-left: 8px;
}

.nav-link {
	color: var(--text-dim);
	text-decoration: none;
	padding: 8px 14px;
	border-radius: 8px;
	font-weight: 500;
	transition: background 0.15s, color 0.15s;
}

.nav-link:hover,
.nav-link.active {
	background: var(--panel-2);
	color: var(--text);
}

.upload-btn {
	margin-left: auto;
	background: var(--accent);
	color: #0b0f14;
	font-weight: 700;
	border: none;
	border-radius: 10px;
	padding: 10px 18px;
	cursor: pointer;
	font-size: 15px;
	transition: transform 0.1s, background 0.15s;
}

.upload-btn:hover {
	background: var(--grass);
	transform: translateY(-1px);
}

/* ---- Hero ---- */
.hero {
	padding: 90px 0 70px;
	text-align: center;
	position: relative;
}

.hero::after {
	content: "⛏";
	position: absolute;
	right: 6%;
	top: 40px;
	font-size: 90px;
	opacity: 0.12;
	transform: rotate(15deg);
}

.hero-title {
	font-family: var(--pixel-font);
	font-size: clamp(38px, 6vw, 64px);
	line-height: 1.1;
	margin-bottom: 18px;
	text-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}

.hero-title .accent {
	text-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}

.hero-sub {
	color: var(--text-dim);
	font-size: 18px;
	max-width: 520px;
	margin: 0 auto 30px;
}

.hero-actions {
	display: flex;
	gap: 14px;
	justify-content: center;
	flex-wrap: wrap;
}

/* ---- Buttons ---- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px;
	border-radius: 10px;
	font-weight: 600;
	font-size: 15px;
	text-decoration: none;
	cursor: pointer;
	border: 2px solid transparent;
	transition: transform 0.1s, background 0.15s, box-shadow 0.15s;
}

.btn:hover {
	transform: translateY(-2px);
}

.btn-primary {
	background: linear-gradient(180deg, var(--grass) 0%, var(--mine-green) 100%);
	color: #fff;
	border-color: var(--mine-green);
	box-shadow: 0 4px 12px rgba(62, 133, 46, 0.35);
}

.btn-primary:hover {
	box-shadow: 0 6px 16px rgba(62, 133, 46, 0.45);
}

.btn-secondary {
	background: var(--panel);
	color: var(--text);
	border-color: var(--border);
}

.btn-secondary:hover {
	background: var(--panel-2);
}

.btn-danger {
	background: var(--danger);
	color: #fff;
}

.btn-sm {
	padding: 8px 14px;
	font-size: 14px;
}

/* ---- Gallery ---- */
.gallery-section {
	padding: 20px 0 80px;
}

.gallery-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.section-title {
	font-family: var(--pixel-font);
	font-size: 30px;
}

.search-wrap {
	flex: 1;
	min-width: 240px;
	max-width: 400px;
}

.search-input {
	width: 100%;
	background: var(--panel);
	border: 2px solid var(--border);
	color: var(--text);
	border-radius: 10px;
	padding: 11px 16px;
	font-size: 15px;
	outline: none;
	transition: border-color 0.15s;
}

.search-input:focus {
	border-color: var(--accent);
}

.stats {
	color: var(--text-dim);
	font-size: 14px;
	margin-bottom: 18px;
}

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 20px;
}

.card {
	position: relative;
	background: var(--panel);
	border: 2px solid var(--border);
	border-radius: 14px;
	overflow: hidden;
	cursor: pointer;
	transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
	display: flex;
	flex-direction: column;
	animation: rise 0.4s ease both;
}

.card:hover {
	transform: translateY(-4px);
	border-color: var(--accent);
	box-shadow: var(--shadow);
}

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.card-img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	display: block;
	background: var(--panel-2);
}

.card-body {
	padding: 12px 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.card-title {
	font-weight: 600;
	font-size: 15px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.card-author {
	color: var(--text-dim);
	font-size: 13px;
	margin-top: 2px;
}

.card-res {
	flex-shrink: 0;
	font-family: var(--pixel-font);
	font-size: 12px;
	color: var(--gold);
	background: rgba(246, 184, 61, 0.12);
	border: 1px solid rgba(246, 184, 61, 0.35);
	padding: 3px 8px;
	border-radius: 6px;
	white-space: nowrap;
}

.card-fallback {
	width: 100%;
	aspect-ratio: 16 / 9;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--panel-2);
	color: var(--text-dim);
	font-size: 14px;
	border-bottom: 2px solid var(--border);
}

.grid-status {
	text-align: center;
	color: var(--text-dim);
	padding: 40px 0;
	font-size: 15px;
}

.loading-dots::after {
	content: "";
	animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
	0% {
		content: "";
	}
	25% {
		content: ".";
	}
	50% {
		content: "..";
	}
	75% {
		content: "...";
	}
}

/* ---- Modal ---- */
.modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(6, 10, 14, 0.75);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	z-index: 100;
}

.modal {
	background: var(--bg-raised);
	border: 2px solid var(--border);
	border-radius: 16px;
	padding: 28px;
	width: min(520px, 100%);
	max-height: 92vh;
	overflow-y: auto;
	position: relative;
	box-shadow: var(--shadow);
	animation: rise 0.25s ease both;
}

.modal .pixel {
	font-size: 26px;
	margin-bottom: 18px;
}

.modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: none;
	border: none;
	color: var(--text-dim);
	font-size: 26px;
	cursor: pointer;
	line-height: 1;
}

.modal-close:hover {
	color: var(--text);
}

.dropzone {
	display: block;
	border: 3px dashed var(--border);
	border-radius: 12px;
	padding: 30px 20px;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
	margin-bottom: 20px;
}

.dropzone:hover,
.dropzone.dragover {
	border-color: var(--accent);
	background: rgba(74, 222, 128, 0.06);
}

.dz-icon {
	font-size: 44px;
	margin-bottom: 8px;
}

.dz-text {
	font-weight: 600;
	font-size: 16px;
}

.dz-hint {
	color: var(--text-dim);
	font-size: 13px;
	margin-top: 4px;
}

.preview {
	margin-top: 14px;
}

.preview img {
	max-width: 100%;
	max-height: 200px;
	border-radius: 8px;
	border: 2px solid var(--border);
	display: block;
	margin-inline: auto;
}

.field {
	margin-bottom: 16px;
}

.field label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--text-dim);
}

.field input {
	width: 100%;
	background: var(--panel);
	border: 2px solid var(--border);
	color: var(--text);
	border-radius: 10px;
	padding: 11px 14px;
	font-size: 15px;
	outline: none;
}

.field input:focus {
	border-color: var(--accent);
}

.submit-btn {
	width: 100%;
	margin-top: 6px;
}

.form-msg {
	margin-top: 12px;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
}

.form-msg.ok {
	color: var(--accent);
}

.form-msg.err {
	color: var(--danger);
}

/* ---- Lightbox ---- */
.lightbox {
	position: fixed;
	inset: 0;
	background: rgba(6, 10, 14, 0.92);
	backdrop-filter: blur(6px);
	z-index: 110;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
	overflow-y: auto;
}

.lightbox-content {
	display: flex;
	gap: 24px;
	max-width: 1100px;
	width: 100%;
	animation: rise 0.25s ease both;
}

.lightbox-img-wrap {
	flex: 1 1 60%;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #000;
	border-radius: 10px;
	overflow: hidden;
	border: 2px solid var(--border);
}

.lightbox-img-wrap img {
	max-width: 100%;
	max-height: 78vh;
	object-fit: contain;
	display: block;
}

.lightbox-img-wrap.error {
	align-items: center;
	justify-content: center;
}

.lightbox-fallback {
	color: var(--text-dim);
	font-size: 15px;
	padding: 20px;
	text-align: center;
}

.lightbox-meta {
	flex: 0 0 280px;
	min-width: 240px;
	background: var(--panel);
	border: 2px solid var(--border);
	border-radius: 12px;
	padding: 24px;
}

.lightbox-meta h3 {
	font-family: var(--pixel-font);
	font-size: 28px;
	margin-bottom: 10px;
	color: var(--text);
}

.lightbox-sub {
	color: var(--text-dim);
	margin-bottom: 24px;
	font-size: 15px;
	line-height: 1.8;
}

.lightbox-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.lightbox-close {
	position: absolute;
	top: 18px;
	right: 24px;
	background: var(--panel);
	border: 2px solid var(--border);
	border-radius: 50%;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--text);
	font-size: 28px;
	cursor: pointer;
	z-index: 120;
	transition: border-color 0.15s, color 0.15s;
}

.lightbox-close:hover {
	border-color: var(--accent);
	color: var(--accent);
}

/* ---- Footer ---- */
.site-footer {
	margin-top: auto;
	border-top: 2px solid var(--border);
	padding: 22px 0;
	color: var(--text-dim);
	font-size: 14px;
	text-align: center;
}

@media (max-width: 720px) {
	.hero {
		padding: 60px 0 50px;
	}

	.nav {
		display: none;
	}

	.lightbox {
		padding: 20px;
	}

	.lightbox-content {
		flex-direction: column;
		gap: 16px;
	}

	.lightbox-img-wrap {
		flex: 1;
		min-height: 0;
	}

	.lightbox-img-wrap img {
		max-height: 50vh;
	}

	.lightbox-meta {
		flex: none;
		width: 100%;
		min-width: 0;
	}
}