:root {
	--bg: #0f141a;
	--card: #171b22;
	--text: #e8eef5;
	--muted: #9aa8b6;
	--accent: #2aa1ff;
	--border: #2a323c;
	--glow: rgba(42, 161, 255, 0.25);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family:
		'SF Pro Display', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
	color: var(--text);
	background: radial-gradient(
		circle at 20% 0%,
		#1a2430 0%,
		var(--bg) 55%,
		#0b0f14 100%
	);
	min-height: 100vh;
}

.top {
	padding: 16px 8px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 14px;
}

.top-actions {
	display: inline-flex;
	gap: 8px;
}

.filter-button {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	border: 1px solid var(--border);
	background: #10161e;
	color: var(--muted);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.filter-button:disabled {
	opacity: 0.45;
	cursor: default;
}

.filter-icon {
	width: 22px;
	height: 22px;
	filter: invert(65%) sepia(8%) saturate(530%) hue-rotate(173deg)
		brightness(92%) contrast(92%);
}

.filter-button.active {
	color: #2aa1ff;
	border-color: #2aa1ff;
	box-shadow: 0 0 0 4px var(--glow);
}

.filter-button.active .filter-icon {
	filter: invert(57%) sepia(79%) saturate(4446%) hue-rotate(189deg)
		brightness(103%) contrast(101%);
}

.favorite-button {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	border: 1px solid var(--border);
	background: rgba(16, 22, 30, 0.9);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 2;
}

.favorite-button.outline {
	position: static;
	background: transparent;
	width: 100%;
	height: 100%;
}

.favorite-icon {
	width: 18px;
	height: 18px;
	display: block;
	background: var(--muted);
	-webkit-mask: url('/icons/favorite.svg') center / contain no-repeat;
	mask: url('/icons/favorite.svg') center / contain no-repeat;
}

.favorite-button.active .favorite-icon,
.filter-button.active .favorite-icon {
	background: var(--accent);
}

.filter-button.hidden {
	display: none;
}

.brand-logo {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid var(--border);
	background: #111821;
}

.brand-text h1 {
	margin: 0 0 4px;
	font-size: 28px;
	letter-spacing: 0.4px;
}

.brand-text p {
	margin: 0;
	color: var(--muted);
}

main {
	padding: 0 8px 32px;
}

.search {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #10161e;
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 8px 12px;
	margin-bottom: 10px;
}

.search input {
	flex: 1;
	background: transparent;
	border: none;
	color: var(--text);
	font-size: 16px;
	outline: none;
}

.search input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.search-clear {
	font-size: 20px;
	width: 20px;
	height: 20px;
	border: none;
	background: transparent;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding-right: 0;
}

.search-clear.hidden {
	display: none;
}

.search.hidden {
	display: none;
}

.load-more {
	min-height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 8px;
}

.load-more.hidden {
	display: none;
}

.spinner.small {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid #1a2330;
	border-top-color: var(--accent);
	animation: spin 0.8s linear infinite;
	opacity: 0;
}

.load-more.loading .spinner.small {
	opacity: 1;
}

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

.close-icon {
	width: 20px;
	height: 20px;
	display: block;
	background: #ffffff;
	-webkit-mask: url('/icons/close.svg') center / contain no-repeat;
	mask: url('/icons/close.svg') center / contain no-repeat;
}

.filter-modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: flex-end;
	justify-content: center;
	z-index: 50;
}

.filter-modal.hidden {
	display: none;
}

.filter-sheet {
	width: 100%;
	max-width: 520px;
	background: #121821;
	border-radius: 18px 18px 0 0;
	border: 1px solid var(--border);
	padding: 16px;
	box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.4);
}

.filter-sheet-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.filter-sheet-header h3 {
	margin: 0;
	font-size: 18px;
}

.filter-close {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	border: 1px solid var(--border);
	background: #10161e;
	color: var(--text);
	cursor: pointer;
	font-size: 16px;
}

.filter-options {
	display: grid;
	gap: 10px;
	max-height: 50vh;
	overflow-y: auto;
	padding-bottom: 12px;
}

.filter-option {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #10161e;
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 12px 14px;
	cursor: pointer;
}

.filter-option input {
	width: 18px;
	height: 18px;
	appearance: none;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: #0f141a;
	display: grid;
	place-items: center;
}

.filter-option input::after {
	content: '';
	width: 10px;
	height: 10px;
	border-radius: 3px;
	background: #2aa1ff;
	transform: scale(0);
	transition: transform 0.12s ease;
}

.filter-option input:checked::after {
	transform: scale(1);
}

.filter-option.selected {
	border-color: #2aa1ff;
}

.filter-apply {
	width: 100%;
	background: #2aa1ff;
	color: #fff;
	border: none;
	border-radius: 12px;
	padding: 12px 16px;
	font-weight: 600;
	cursor: pointer;
	font-size: 16px;
}

.filter-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.filter-reset {
	width: 100%;
	background: transparent;
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 12px 16px;
	font-weight: 600;
	cursor: pointer;
	font-size: 16px;
}

.filter-reset:disabled {
	opacity: 0.5;
	cursor: default;
}

.grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px 8px;
}

.card {
	display: flex;
	flex-direction: column;
	background: transparent;
	border: none;
	border-radius: 0;
	overflow: hidden;
	box-shadow: none;
	cursor: pointer;
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease;
	position: relative;
	height: 220px;
}

.skeleton-card {
	pointer-events: none;
}

.skeleton-thumb {
	background: #1b2330;
	position: relative;
	overflow: hidden;
}

.skeleton-line {
	height: 12px;
	border-radius: 6px;
	background: #1b2330;
	position: relative;
	overflow: hidden;
	margin: 6px 0;
}

.skeleton-line.short {
	width: 55%;
}

.skeleton-thumb::after,
.skeleton-line::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(255, 255, 255, 0.08),
		transparent
	);
	animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
	from {
		transform: translateX(-100%);
	}
	to {
		transform: translateX(100%);
	}
}

.card:hover {
	transform: none;
	box-shadow: none;
}

.card-sold {
	cursor: default;
	opacity: 0.7;
	transform: none !important;
}

.sold-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 12px;
	padding: 6px 10px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(4px);
}

.reserved-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: rgba(255, 193, 7, 0.85);
	color: #1b1b1b;
	font-size: 12px;
	padding: 6px 10px;
	border-radius: 999px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	backdrop-filter: blur(4px);
}

.detail-status {
	align-self: center;
}

.detail-status.hidden {
	display: none;
}

.detail-top .sold-badge,
.detail-top .reserved-badge {
	position: static;
}

.thumb {
	background: #121821;
	height: 170px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--muted);
	font-size: 14px;
}

.thumb.empty {
	background: #2a3038;
	color: #c7d0da;
	font-size: 32px;
	border-radius: 8px;
}

.thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 8px;
}

.card-body {
	padding: 6px 0 0;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.card-title {
	margin: 0 0 6px;
	font-size: 16px;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.card-date {
	color: var(--muted);
	font-size: 13px;
	margin-top: auto;
}

.detail {
	max-width: 900px;
	margin: 0 auto;
	background: var(--card);
	border-radius: 18px;
	border: 1px solid var(--border);
	box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
	padding: 0;
	position: relative;
	overflow: hidden;
}

.detail-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	position: absolute;
	top: 14px;
	left: 14px;
	right: 14px;
	z-index: 2;
}

.detail.hidden,
.grid.hidden {
	display: none;
}

.swiper.hidden {
	display: none;
}

.empty-state {
	text-align: center;
	color: var(--muted);
	padding: 24px 0;
	font-size: 15px;
}

.empty-state.hidden {
	display: none;
}

.back {
	border: 1px solid var(--border);
	background: #10161e;
	color: var(--text);
	width: 40px;
	height: 40px;
	padding: 0;
	border-radius: 12px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

.back:hover {
	border-color: var(--accent);
	box-shadow: 0 0 0 4px var(--glow);
}

.back svg {
	width: 22px;
	height: 22px;
}

.detail-body {
	margin-top: 0;
	display: grid;
	gap: 8px;
}

.swiper {
	width: 100%;
	height: 320px;
	border-radius: 18px 18px 0 0;
	border: none;
	background: #0f141a;
	overflow: hidden;
	margin: 0;
}

.detail-content {
	display: grid;
	gap: 14px;
	padding: 16px;
}

.detail-actions {
	display: grid;
	grid-template-columns: 44px 1fr;
	gap: 10px;
	align-items: center;
}

.swiper-slide {
	display: flex;
	align-items: center;
	justify-content: center;
}

.swiper-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #0f141a;
}

.empty-slide {
	color: #c7d0da;
	font-size: 40px;
	background: #2a3038;
	display: flex;
	align-items: center;
	justify-content: center;
}

.swiper-slide.empty-slide.swiper-slide-active {
	display: flex;
}

.detail-text {
	white-space: pre-wrap;
	margin: 0;
	font-family: 'SF Mono', 'Menlo', 'Courier New', monospace;
	font-size: 15px;
	line-height: 1.5;
	color: var(--text);
}

.detail.no-photos .detail-content {
	margin-top: 48px;
}

.source-link {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	background: #2aa1ff;
	color: #ffffff;
	text-decoration: none;
	padding: 12px 16px;
	border-radius: 12px;
	font-weight: 600;
	letter-spacing: 0.2px;
}

.source-link.hidden {
	display: none;
}

@media (max-width: 600px) {
	.top h1 {
		font-size: 24px;
	}
	.swiper {
		height: 240px;
	}
}
.detail-title {
	margin: 0;
	font-size: 20px;
	line-height: 1.3;
}
