/*
Theme Name: Game Station
Theme URI: https://game.makegame.store
Author: Game Station
Author URI: https://game.makegame.store
Description: A responsive game portal theme with multi-language support. Inspired by modern game platforms. Supports desktop and mobile, ready for translation.
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: game-station
Tags: custom-menu, custom-logo, featured-images, footer-widgets, full-width-template, sticky-post, theme-options, threaded-comments, translation-ready, block-styles, wide-blocks, responsive-layout, one-column, two-columns, right-sidebar, flexible-header, accessibility-ready

Game Station - Free online games portal. Multi-language, responsive.
*/

/* --------------------------------------------------------------------------
   CSS Variables (Poki-inspired palette)
   -------------------------------------------------------------------------- */
:root {
	--gs-primary: #6366f1;
	--gs-primary-hover: #4f46e5;
	--gs-accent: #f59e0b;
	--gs-bg: #0f172a;
	--gs-bg-card: #1e293b;
	--gs-bg-card-hover: #334155;
	--gs-text: #f8fafc;
	--gs-text-muted: #94a3b8;
	--gs-border: #334155;
	--gs-radius: 12px;
	--gs-radius-sm: 8px;
	--gs-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
	--gs-transition: 0.2s ease;
	--gs-header-height: 64px;
	--gs-container: min(1200px, 100% - 2rem);
}

/* Reset & base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	background: var(--gs-bg);
	color: var(--gs-text);
	line-height: 1.6;
	font-size: 16px;
}

a { color: var(--gs-primary); text-decoration: none; transition: color var(--gs-transition); }
a:hover { color: var(--gs-accent); }
img { max-width: 100%; height: auto; display: block; }

/* Layout */
.gs-site {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}
.gs-main { flex: 1; }

/* Container */
.gs-container {
	width: var(--gs-container);
	margin-left: auto;
	margin-right: auto;
	padding-left: 1rem;
	padding-right: 1rem;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.gs-header {
	position: sticky;
	top: 0;
	z-index: 100;
	height: var(--gs-header-height);
	background: rgba(15, 23, 42, 0.95);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--gs-border);
}
.gs-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 1rem;
}
.gs-logo {
	font-weight: 700;
	font-size: 1.5rem;
	color: var(--gs-text);
}
.gs-logo:hover { color: var(--gs-text); opacity: 0.9; }
.gs-logo img { max-height: 36px; width: auto; }

.gs-nav { display: flex; align-items: center; gap: 1.5rem; }
.gs-nav a {
	color: var(--gs-text-muted);
	font-weight: 500;
}
.gs-nav a:hover { color: var(--gs-text); }
.gs-nav-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; flex-wrap: wrap; }

/* Language switcher */
.gs-lang-switcher {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}
.gs-lang-switcher a {
	padding: 0.35rem 0.6rem;
	border-radius: var(--gs-radius-sm);
	font-size: 0.875rem;
	color: var(--gs-text-muted);
}
.gs-lang-switcher a:hover,
.gs-lang-switcher a.active { color: var(--gs-text); background: var(--gs-bg-card); }

/* Mobile menu toggle */
.gs-menu-toggle {
	display: none;
	background: none;
	border: none;
	color: var(--gs-text);
	padding: 0.5rem;
	cursor: pointer;
	font-size: 1.5rem;
	line-height: 1;
}

/* --------------------------------------------------------------------------
   Hero (front page)
   -------------------------------------------------------------------------- */
.gs-hero {
	padding: 3rem 0;
	text-align: center;
}
.gs-hero h1 {
	margin: 0 0 0.5rem;
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	font-weight: 700;
	color: var(--gs-text);
}
.gs-hero p {
	margin: 0;
	color: var(--gs-text-muted);
	font-size: 1.125rem;
}

/* --------------------------------------------------------------------------
   Category tabs (horizontal scroll on mobile)
   -------------------------------------------------------------------------- */
.gs-categories {
	padding: 0.5rem 0 1.5rem;
	border-bottom: 1px solid var(--gs-border);
	margin-bottom: 2rem;
}
.gs-categories-inner {
	display: flex;
	gap: 0.5rem;
	overflow-x: auto;
	scrollbar-width: thin;
	padding-bottom: 0.5rem;
	-webkit-overflow-scrolling: touch;
}
.gs-categories-inner::-webkit-scrollbar { height: 4px; }
.gs-categories-inner::-webkit-scrollbar-thumb { background: var(--gs-border); border-radius: 4px; }
.gs-cat-link {
	display: inline-block;
	padding: 0.5rem 1rem;
	white-space: nowrap;
	border-radius: var(--gs-radius-sm);
	background: var(--gs-bg-card);
	color: var(--gs-text-muted);
	font-weight: 500;
	font-size: 0.9375rem;
	transition: background var(--gs-transition), color var(--gs-transition);
}
.gs-cat-link:hover,
.gs-cat-link.current { background: var(--gs-primary); color: var(--gs-text); }

/* --------------------------------------------------------------------------
   Section title
   -------------------------------------------------------------------------- */
.gs-section-title {
	margin: 0 0 1.25rem;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--gs-text);
}

/* --------------------------------------------------------------------------
   Game grid
   -------------------------------------------------------------------------- */
.gs-game-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 1.25rem;
	padding: 0 0 2rem;
}
@media (min-width: 640px) {
	.gs-game-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.5rem; }
}
@media (min-width: 1024px) {
	.gs-game-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

.gs-game-card {
	background: var(--gs-bg-card);
	border-radius: var(--gs-radius);
	overflow: hidden;
	box-shadow: var(--gs-shadow);
	transition: transform var(--gs-transition), box-shadow var(--gs-transition);
}
.gs-game-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.4);
}
.gs-game-card a { color: inherit; display: block; }
.gs-game-card a:hover { color: inherit; }
.gs-game-card-thumb {
	aspect-ratio: 4/3;
	object-fit: cover;
	width: 100%;
	background: var(--gs-border);
}
.gs-game-card-body { padding: 0.75rem; }
.gs-game-card-title {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* --------------------------------------------------------------------------
   Single game page – fullscreen iframe
   -------------------------------------------------------------------------- */
/* Hide header/footer on single game so iframe can be fullscreen */
body.single-game .gs-header,
body.single-game .gs-footer {
	display: none;
}
body.single-game .gs-main {
	padding: 0;
	margin: 0;
	max-width: none;
}
body.single-game .gs-site {
	min-height: 100vh;
}

.gs-single-game.gs-single-game-fullscreen {
	position: fixed;
	inset: 0;
	z-index: 1;
	padding: 0;
	margin: 0;
}

.gs-game-embed-wrap.gs-game-embed-fullscreen {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: #000;
}
.gs-game-embed-wrap.gs-game-embed-fullscreen iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: none;
}

/* Back button overlay */
.gs-game-back {
	position: fixed;
	top: 1rem;
	left: 1rem;
	z-index: 10;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.5rem 1rem;
	background: rgba(15, 23, 42, 0.9);
	color: var(--gs-text);
	border-radius: var(--gs-radius-sm);
	font-weight: 500;
	font-size: 0.9375rem;
	backdrop-filter: blur(6px);
	transition: background var(--gs-transition);
}
.gs-game-back:hover {
	background: var(--gs-bg-card);
	color: var(--gs-text);
}

/* No URL fallback */
.gs-single-game-no-url {
	padding: 3rem 1rem;
}
.gs-single-game-no-url h1 { margin: 0 0 0.5rem; }
.gs-single-game-no-url p { color: var(--gs-text-muted); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.gs-footer {
	background: var(--gs-bg-card);
	border-top: 1px solid var(--gs-border);
	padding: 2rem 0;
	margin-top: 3rem;
}
.gs-footer-inner {
	display: grid;
	gap: 2rem;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 1rem;
}
@media (min-width: 640px) {
	.gs-footer-inner { grid-template-columns: 1fr auto auto; align-items: start; }
}
.gs-footer-brand { font-weight: 700; font-size: 1.125rem; margin-bottom: 0.5rem; }
.gs-footer p { margin: 0 0 0.5rem; color: var(--gs-text-muted); font-size: 0.875rem; }
.gs-footer-nav ul { list-style: none; margin: 0; padding: 0; }
.gs-footer-nav a { color: var(--gs-text-muted); font-size: 0.875rem; }
.gs-footer-nav a:hover { color: var(--gs-text); }
.gs-footer-bottom {
	grid-column: 1 / -1;
	padding-top: 1rem;
	border-top: 1px solid var(--gs-border);
	color: var(--gs-text-muted);
	font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   Archive / taxonomy
   -------------------------------------------------------------------------- */
.gs-archive-header { padding: 2rem 0 1rem; }
.gs-archive-header h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.gs-archive-header p { margin: 0; color: var(--gs-text-muted); font-size: 0.9375rem; }

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.gs-pagination-wrap {
	padding: 2rem 0;
}
.gs-pagination-wrap .nav-links {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}
.gs-pagination-wrap .nav-links a,
.gs-pagination-wrap .nav-links span {
	display: inline-block;
	padding: 0.5rem 1rem;
	border-radius: var(--gs-radius-sm);
	background: var(--gs-bg-card);
	color: var(--gs-text);
	font-weight: 500;
	text-decoration: none;
}
.gs-pagination-wrap .nav-links a:hover { background: var(--gs-primary); color: var(--gs-text); }
.gs-pagination-wrap .nav-links .current { background: var(--gs-primary); }
.gs-placeholder { background: linear-gradient(135deg, var(--gs-border) 0%, var(--gs-bg-card) 100%); }

/* --------------------------------------------------------------------------
   Mobile: show hamburger, hide nav
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
	.gs-menu-toggle { display: block; }
	.gs-nav-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--gs-bg); flex-direction: column; padding: 1rem; border-bottom: 1px solid var(--gs-border); }
	.gs-nav-menu.is-open { display: flex; }
	.gs-lang-switcher { margin-left: auto; }
}

/* RTL support */
[dir="rtl"] .gs-header-inner,
[dir="rtl"] .gs-footer-inner { direction: rtl; }
[dir="rtl"] .gs-nav-menu { flex-direction: row; }
