:root {
	--bg-dark: #0d1117;
	--bg-panel: #161b22;
	--bg-card: #1c2330;
	--bg-hover: #243044;
	--border: #2d3a4f;
	--text: #e6edf3;
	--text-muted: #8b9cb3;
	--accent: #00d4aa;
	--accent-2: #00b4d8;
	--warning: #f0a500;
	--torrent: #6fdc6f;
	--ftp: #ff9f43;
	--early: #00d4ff;
	--radius: 10px;
	--shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
	--container: 1200px;
	--font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--font);
	background: var(--bg-dark) url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231a2230' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
	color: var(--text);
	line-height: 1.6;
	min-height: 100vh;
}

a { color: var(--accent-2); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

.container {
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 20px;
}

/* Header */
.site-header {
	background: linear-gradient(180deg, #121820 0%, var(--bg-dark) 100%);
	border-bottom: 1px solid var(--border);
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: var(--shadow);
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 16px 20px;
	flex-wrap: wrap;
}

.site-branding { flex: 1; min-width: 200px; }

.site-title {
	font-size: 1.6rem;
	font-weight: 800;
	color: var(--text);
	letter-spacing: -0.5px;
	text-transform: uppercase;
}

.site-title:hover { color: var(--accent); }

.site-tagline {
	margin: 4px 0 0;
	font-size: 0.85rem;
	color: var(--text-muted);
}

.custom-logo-link img { max-height: 60px; width: auto; }

.main-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
}

.main-nav a {
	display: block;
	padding: 8px 14px;
	color: var(--text);
	border-radius: 6px;
	font-size: 0.9rem;
	font-weight: 600;
}

.main-nav a:hover,
.main-nav .current-menu-item a {
	background: var(--bg-hover);
	color: var(--accent);
}

.header-search { min-width: 200px; }

.search-form {
	display: flex;
	gap: 6px;
}

.search-field {
	flex: 1;
	background: var(--bg-panel);
	border: 1px solid var(--border);
	color: var(--text);
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 0.9rem;
}

.search-submit,
.btn,
.dl-btn {
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #0d1117;
	border: none;
	padding: 8px 16px;
	border-radius: 6px;
	font-weight: 700;
	cursor: pointer;
	font-size: 0.85rem;
	transition: transform 0.15s, box-shadow 0.15s;
}

.search-submit:hover,
.btn:hover,
.dl-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
	color: #0d1117;
}

.menu-toggle {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
}

.menu-toggle span {
	display: block;
	width: 24px;
	height: 2px;
	background: var(--text);
	margin: 5px 0;
	transition: 0.3s;
}

/* Layout */
.site-content { padding: 32px 20px 60px; }

.content-grid {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 32px;
	max-width: var(--container);
	margin: 0 auto;
}

.main-column { min-width: 0; }

.page-title {
	font-size: 1.75rem;
	margin: 0 0 24px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--accent);
	color: var(--text);
}

/* Game cards list */
.games-list {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.game-card {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

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

.game-card-link {
	display: grid;
	grid-template-columns: 140px 1fr;
	gap: 20px;
	padding: 16px;
	color: inherit;
}

.game-card-cover {
	border-radius: 8px;
	overflow: hidden;
	background: var(--bg-panel);
	aspect-ratio: 3/4;
}

.game-card-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.game-card-title {
	margin: 0 0 8px;
	font-size: 1.15rem;
	color: var(--text);
	line-height: 1.3;
}

.game-card-excerpt {
	margin: 8px 0;
	color: var(--text-muted);
	font-size: 0.9rem;
}

.game-card-meta {
	display: flex;
	gap: 12px;
	font-size: 0.8rem;
	color: var(--text-muted);
}

.game-type {
	color: var(--accent);
	font-weight: 600;
}

/* Badges */
.game-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 8px 0;
}

.badge {
	font-size: 0.7rem;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.badge-default { background: #2d3a4f; color: var(--text); }
.badge-torrent { background: rgba(111, 220, 111, 0.2); color: var(--torrent); border: 1px solid var(--torrent); }
.badge-ftp { background: rgba(255, 159, 67, 0.2); color: var(--ftp); border: 1px solid var(--ftp); }
.badge-early { background: rgba(0, 212, 255, 0.2); color: var(--early); border: 1px solid var(--early); }
.badge-repack { background: rgba(0, 212, 170, 0.2); color: var(--accent); border: 1px solid var(--accent); }

/* Single game */
.single-game { max-width: var(--container); margin: 0 auto; }

.post-nav {
	display: flex;
	justify-content: space-between;
	margin-bottom: 20px;
	font-size: 0.85rem;
}

.game-header {
	display: grid;
	grid-template-columns: 220px 1fr;
	gap: 28px;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 24px;
	margin-bottom: 24px;
}

.game-header-cover {
	border-radius: 8px;
	overflow: hidden;
	box-shadow: var(--shadow);
}

.game-title {
	margin: 0 0 12px;
	font-size: 1.6rem;
	line-height: 1.25;
}

.game-meta-line {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 12px;
	font-size: 0.85rem;
	color: var(--text-muted);
}

.meta-tag {
	background: var(--bg-hover);
	padding: 3px 10px;
	border-radius: 4px;
	color: var(--accent);
	font-weight: 600;
}

.game-quick-info {
	display: grid;
	gap: 6px;
	font-size: 0.9rem;
	margin-top: 12px;
}

.steam-link {
	color: var(--torrent) !important;
	font-weight: 600;
}

/* Tabs */
.game-tabs {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
}

.tab-nav {
	display: flex;
	flex-wrap: wrap;
	background: var(--bg-panel);
	border-bottom: 1px solid var(--border);
}

.tab-btn {
	background: none;
	border: none;
	color: var(--text-muted);
	padding: 14px 20px;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	transition: 0.2s;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
	color: var(--accent);
	border-bottom-color: var(--accent);
	background: var(--bg-card);
}

.tab-panel {
	display: none;
	padding: 24px;
}

.tab-panel.active { display: block; }

.tab-panel h3 {
	margin: 0 0 16px;
	color: var(--accent);
	font-size: 1.1rem;
}

.game-description { margin-bottom: 24px; }

/* Downloads */
.download-section { margin-top: 24px; }

.download-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.download-item {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px 16px;
	align-items: center;
	background: var(--bg-panel);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 12px 16px;
}

.dl-host {
	font-weight: 700;
	color: var(--warning);
	font-size: 0.9rem;
}

.dl-file {
	grid-column: 1;
	font-size: 0.8rem;
	color: var(--text-muted);
	font-family: monospace;
}

.dl-btn { grid-column: 2; grid-row: 1 / 3; white-space: nowrap; }

.dl-torrent {
	background: linear-gradient(135deg, var(--torrent), #4caf50);
}

.torrent-section .dl-host { color: var(--torrent); }

/* Screenshots */
.screenshots-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
}

.screenshot-item {
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid var(--border);
	transition: transform 0.2s;
}

.screenshot-item:hover { transform: scale(1.02); }

.gameplay-embed {
	position: relative;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
	border-radius: 8px;
}

.gameplay-embed iframe {
	position: absolute;
	top: 0; left: 0;
	width: 100%; height: 100%;
}

.feature-list {
	padding-left: 20px;
}

.feature-list li { margin-bottom: 6px; }

.game-tags {
	margin-top: 24px;
	padding: 16px;
	background: var(--bg-panel);
	border-radius: var(--radius);
}

.game-tags a {
	display: inline-block;
	margin: 4px 8px 4px 0;
	padding: 4px 10px;
	background: var(--bg-hover);
	border-radius: 4px;
	font-size: 0.85rem;
}

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 20px; }

.widget {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px;
}

.widget-title {
	margin: 0 0 14px;
	font-size: 1rem;
	color: var(--accent);
	padding-bottom: 8px;
	border-bottom: 1px solid var(--border);
}

.widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.widget li { margin-bottom: 8px; }

.widget a { color: var(--text); font-size: 0.9rem; }
.widget a:hover { color: var(--accent); }

.latest-games li {
	padding: 6px 0;
	border-bottom: 1px solid var(--border);
}

.latest-games li:last-child { border: none; }

/* Pagination */
.pagination {
	margin-top: 32px;
	text-align: center;
}

.pagination .page-numbers {
	display: inline-block;
	padding: 8px 14px;
	margin: 2px;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 6px;
	color: var(--text);
}

.pagination .current {
	background: var(--accent);
	color: #0d1117;
	border-color: var(--accent);
}

/* Footer */
.site-footer {
	background: var(--bg-panel);
	border-top: 1px solid var(--border);
	padding: 40px 20px;
	margin-top: 40px;
}

.footer-inner {
	max-width: var(--container);
	margin: 0 auto;
	text-align: center;
}

.footer-nav ul {
	list-style: none;
	padding: 0;
	display: flex;
	justify-content: center;
	gap: 20px;
	flex-wrap: wrap;
	margin: 16px 0;
}

.copyright {
	color: var(--text-muted);
	font-size: 0.85rem;
}

.error-404 {
	text-align: center;
	padding: 60px 20px;
}

.error-404 h1 {
	font-size: 5rem;
	margin: 0;
	color: var(--accent);
}

.no-results {
	padding: 40px;
	text-align: center;
	color: var(--text-muted);
	background: var(--bg-card);
	border-radius: var(--radius);
}

/* Responsive */
@media (max-width: 900px) {
	.content-grid {
		grid-template-columns: 1fr;
	}

	.sidebar { order: -1; }

	.game-header {
		grid-template-columns: 1fr;
		text-align: center;
	}

	.game-header-cover {
		max-width: 220px;
		margin: 0 auto;
	}

	.game-badges { justify-content: center; }
}

@media (max-width: 640px) {
	.menu-toggle { display: block; }

	.main-nav {
		display: none;
		width: 100%;
		order: 4;
	}

	.main-nav.is-open { display: block; }

	.main-nav ul { flex-direction: column; }

	.header-search { width: 100%; order: 3; }

	.game-card-link {
		grid-template-columns: 100px 1fr;
		gap: 12px;
		padding: 12px;
	}

	.game-card-title { font-size: 1rem; }

	.tab-btn {
		padding: 10px 12px;
		font-size: 0.75rem;
	}

	.download-item {
		grid-template-columns: 1fr;
	}

	.dl-btn {
		grid-column: 1;
		grid-row: auto;
		text-align: center;
	}
}
