/* ═══════════════════════════════════════════
   GameHub — Fable UI فاخر
   خلفية #0a0a0f · نيون بنفسجي #6c63ff · نيون سماوي #00d4ff
   Glassmorphism · Space Grotesk · شبكة متجاوبة
   ═══════════════════════════════════════════ */

:root {
	--bg: #0a0a0f;
	--bg-2: #101018;
	--purple: #6c63ff;
	--cyan: #00d4ff;
	--text: #eceaf6;
	--text-dim: #9a97b8;
	--glass: rgba(255, 255, 255, 0.05);
	--glass-border: rgba(255, 255, 255, 0.10);
	--radius: 16px;
	--grad: linear-gradient(90deg, var(--purple), var(--cyan));
	--shadow-neon: 0 0 22px rgba(108, 99, 255, 0.35), 0 0 44px rgba(0, 212, 255, 0.12);
	--font: 'Space Grotesk', 'Segoe UI', Tahoma, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	line-height: 1.6;
	min-height: 100vh;
	overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.container { width: min(1240px, 100% - 32px); margin-inline: auto; }

/* توهج خلفي ثابت */
.site-glow {
	position: fixed; inset: 0; z-index: -1; pointer-events: none;
	background:
		radial-gradient(600px 400px at 85% -10%, rgba(108, 99, 255, 0.18), transparent 60%),
		radial-gradient(700px 500px at 10% 110%, rgba(0, 212, 255, 0.10), transparent 60%);
}

/* ─── الترويسة ─── */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(10, 10, 15, 0.82);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border-bottom: 1px solid var(--glass-border);
}
.header-inner {
	display: flex; align-items: center; gap: 20px;
	padding: 14px 0;
}
.site-logo { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 700; }
.logo-mark { filter: drop-shadow(0 0 8px rgba(108, 99, 255, 0.8)); }
.logo-accent {
	background: var(--grad);
	-webkit-background-clip: text; background-clip: text;
	-webkit-text-fill-color: transparent;
}

.header-search { position: relative; flex: 1; max-width: 420px; }
.header-search input {
	width: 100%;
	background: var(--glass);
	border: 1px solid var(--glass-border);
	border-radius: 999px;
	padding: 10px 44px 10px 18px;
	color: var(--text);
	font-family: inherit;
	font-size: 14px;
	transition: border-color .2s, box-shadow .2s;
}
.header-search input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(108, 99, 255, .2); outline: none; }
.search-icon { position: absolute; top: 50%; inset-inline-end: 15px; transform: translateY(-50%); opacity: .6; pointer-events: none; }

.header-nav { display: flex; gap: 18px; margin-inline-start: auto; }
.header-nav a { color: var(--text-dim); font-weight: 500; transition: color .2s; }
.header-nav a:hover { color: var(--cyan); }
.menu-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 24px; }

/* شريط التصنيفات */
.cats-bar {
	display: flex; gap: 8px; overflow-x: auto;
	padding: 10px 0 14px;
	scrollbar-width: none;
}
.cats-bar::-webkit-scrollbar { display: none; }
.cat-chip {
	flex: 0 0 auto;
	background: var(--glass);
	border: 1px solid var(--glass-border);
	color: var(--text-dim);
	border-radius: 999px;
	padding: 7px 18px;
	font-size: 13.5px;
	font-weight: 500;
	transition: all .2s;
}
.cat-chip:hover { color: var(--text); border-color: var(--purple); }
.cat-chip.is-active {
	background: var(--grad);
	color: #fff;
	border-color: transparent;
	box-shadow: var(--shadow-neon);
}

/* ─── الأقسام ─── */
.site-main { padding: 28px 0 60px; }
.section-title { font-size: 22px; font-weight: 700; margin-bottom: 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.games-count { color: var(--text-dim); font-size: 14px; }
.featured-section { margin-bottom: 36px; }

/* ─── شبكة الألعاب: 4 أعمدة → 2 على الجوال ─── */
.games-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 18px;
}

/* بطاقة اللعبة — Glassmorphism + توهج hover */
.game-card {
	background: var(--glass);
	border: 1px solid var(--glass-border);
	border-radius: var(--radius);
	overflow: hidden;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
	display: flex; flex-direction: column;
}
.game-card:hover {
	transform: translateY(-6px);
	border-color: rgba(108, 99, 255, 0.6);
	box-shadow: var(--shadow-neon);
}
.game-card-thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-2); }
.game-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.game-card:hover .game-card-thumb img { transform: scale(1.07); }
.game-card-placeholder { display: grid; place-items: center; height: 100%; font-size: 44px; opacity: .5; }

.game-card-badge {
	position: absolute; top: 10px; inset-inline-start: 10px;
	background: rgba(10, 10, 15, 0.75);
	backdrop-filter: blur(6px);
	border: 1px solid var(--glass-border);
	border-radius: 999px;
	padding: 3px 11px;
	font-size: 11px; font-weight: 700;
	color: var(--cyan);
}
.game-card-play {
	position: absolute; inset: 0;
	display: grid; place-items: center;
	font-size: 42px; color: #fff;
	background: rgba(10, 10, 15, 0.45);
	opacity: 0; transition: opacity .25s;
	text-shadow: 0 0 18px var(--purple);
}
.game-card:hover .game-card-play { opacity: 1; }

.game-card-body { padding: 12px 14px 14px; }
.game-card-body h3 { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12px; color: var(--text-dim); }
.game-card-cat { color: var(--purple); }

/* حالات الشبكة */
.empty-state { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--text-dim); }
.grid-loading { display: grid; place-items: center; padding: 30px; }
.spinner {
	width: 40px; height: 40px;
	border: 3px solid var(--glass-border);
	border-top-color: var(--purple);
	border-radius: 50%;
	animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* زر المزيد */
.load-more-wrap { text-align: center; margin-top: 28px; }
.btn {
	display: inline-block;
	border: 0; border-radius: 999px;
	padding: 12px 34px;
	font-size: 15px; font-weight: 700;
	color: #fff;
	background: var(--grad);
	box-shadow: var(--shadow-neon);
	transition: transform .2s, filter .2s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-more { background: var(--glass); border: 1px solid var(--purple); box-shadow: none; }
.btn-more:hover { box-shadow: var(--shadow-neon); }

/* ─── صفحة اللعبة ─── */
.game-layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
.game-layout.has-sidebar { grid-template-columns: 1fr 300px; }
.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-dim); margin-bottom: 10px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--cyan); }
.game-title { font-size: 28px; font-weight: 700; margin-bottom: 16px; }

.player-zone {
	position: relative; z-index: 5;
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--glass-border);
	background: #000;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
}
.player-shell {
	position: relative;
	width: 100%;
	aspect-ratio: var(--gw, 800) / var(--gh, 600);
	max-height: 78vh;
	background: #000;
}
.game-frame, .ruffle-container, .ruffle-container ruffle-player {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	border: 0; display: block;
}
.player-loading, .player-empty {
	position: absolute; inset: 0;
	display: grid; place-items: center; gap: 10px;
	color: var(--text-dim); text-align: center; padding: 20px;
}
.player-loading { grid-auto-flow: row; align-content: center; justify-items: center; }

/* صندوق التحميل EXE/APK */
.download-box {
	position: absolute; inset: 0;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: 12px; text-align: center; padding: 24px;
	background: radial-gradient(circle at center, rgba(108, 99, 255, .15), transparent 70%);
}
.download-icon { font-size: 52px; filter: drop-shadow(0 0 14px var(--cyan)); }
.download-ext { font-size: 12px; color: var(--text-dim); letter-spacing: 2px; }

/* شريط الأدوات */
.player-toolbar {
	display: flex; justify-content: space-between; align-items: center;
	gap: 10px; flex-wrap: wrap;
	background: rgba(255, 255, 255, 0.04);
	border-top: 1px solid var(--glass-border);
	padding: 10px 14px;
}
.toolbar-right, .toolbar-left { display: flex; align-items: center; gap: 10px; }
.tool-btn {
	background: var(--glass);
	border: 1px solid var(--glass-border);
	color: var(--text);
	border-radius: 10px;
	padding: 8px 14px;
	font-size: 13px; font-weight: 600;
	transition: all .2s;
}
.tool-btn:hover { border-color: var(--purple); box-shadow: 0 0 12px rgba(108, 99, 255, .3); }
.tool-btn-accent { background: var(--grad); border-color: transparent; color: #fff; }
.tool-btn.liked { border-color: var(--cyan); color: var(--cyan); }
.tool-btn.liked .like-icon::before { content: ''; }
.tool-stat { font-size: 13px; color: var(--text-dim); }

/* لوحات زجاجية عامة */
.glass-panel {
	background: var(--glass);
	border: 1px solid var(--glass-border);
	border-radius: var(--radius);
	backdrop-filter: blur(10px);
	padding: 20px 22px;
}
.game-desc { margin-top: 24px; }
.game-desc h2 { font-size: 18px; margin-bottom: 10px; }
.game-desc-body { color: var(--text-dim); }
.related-section { margin-top: 32px; }

/* الشريط الجانبي / الإعلانات */
.game-sidebar { position: sticky; top: 140px; align-self: start; }
.ad-slot { text-align: center; min-height: 250px; }
.ad-label { display: block; font-size: 10px; letter-spacing: 2px; color: var(--text-dim); margin-bottom: 8px; text-transform: uppercase; }

/* وضع التعتيم (Lights Off) */
.lights-overlay {
	position: fixed; inset: 0; z-index: 40;
	background: rgba(0, 0, 0, 0.92);
	opacity: 0; pointer-events: none;
	transition: opacity .35s ease;
}
body.lights-off .lights-overlay { opacity: 1; pointer-events: auto; }
body.lights-off .player-zone { z-index: 45; box-shadow: 0 0 60px rgba(108, 99, 255, .4); }
body.lights-off .site-header { z-index: 30; }

/* ملء الشاشة */
.player-zone:fullscreen { border-radius: 0; }
.player-zone:fullscreen .player-shell { aspect-ratio: auto; height: calc(100% - 54px); max-height: none; }

/* التنقل بين الصفحات */
.pagination-wrap { margin-top: 28px; text-align: center; }
.pagination-wrap .nav-links { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pagination-wrap .page-numbers {
	background: var(--glass);
	border: 1px solid var(--glass-border);
	border-radius: 10px;
	padding: 8px 15px;
	color: var(--text-dim);
	transition: all .2s;
}
.pagination-wrap .page-numbers:hover { border-color: var(--purple); color: var(--text); }
.pagination-wrap .page-numbers.current { background: var(--grad); color: #fff; border-color: transparent; }

/* 404 */
.error-404 { text-align: center; padding: 70px 24px; margin-top: 30px; }
.e404-code {
	font-size: 90px; font-weight: 800; line-height: 1;
	background: var(--grad);
	-webkit-background-clip: text; background-clip: text;
	-webkit-text-fill-color: transparent;
	filter: drop-shadow(0 0 24px rgba(108, 99, 255, .5));
}
.error-404 h1 { margin: 12px 0 8px; }
.error-404 p { color: var(--text-dim); margin-bottom: 22px; }

/* ─── التذييل ─── */
.site-footer { border-top: 1px solid var(--glass-border); background: var(--bg-2); margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; padding: 34px 0; flex-wrap: wrap; }
.footer-brand p { color: var(--text-dim); font-size: 13px; margin-top: 8px; max-width: 380px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--text-dim); font-size: 14px; }
.footer-links a:hover { color: var(--cyan); }
.footer-bottom { border-top: 1px solid var(--glass-border); padding: 14px 0; text-align: center; color: var(--text-dim); font-size: 12.5px; }

/* ─── الاستجابة ─── */
@media (max-width: 1024px) {
	.games-grid { grid-template-columns: repeat(3, 1fr); }
	.game-layout.has-sidebar { grid-template-columns: 1fr; }
	.game-sidebar { position: static; }
}
@media (max-width: 768px) {
	.games-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.header-nav { display: none; }
	.header-nav.open {
		display: flex; flex-direction: column;
		position: absolute; top: 100%; inset-inline: 0;
		background: rgba(10, 10, 15, 0.97);
		padding: 16px; border-bottom: 1px solid var(--glass-border);
	}
	.menu-toggle { display: block; }
	.game-title { font-size: 21px; }
	.player-shell { max-height: 62vh; }
	.section-title { font-size: 19px; }
}
@media (max-width: 400px) {
	.header-search { max-width: none; }
	.tool-btn { padding: 7px 10px; font-size: 12px; }
}

/* احترام تفضيل تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══════════════════════════════════════
   مبدّل اللغات — 32 لغة مع أعلام الدول
   ═══════════════════════════════════════ */
.lang-btn {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--glass);
	border: 1px solid var(--glass-border);
	color: var(--text);
	border-radius: 999px;
	padding: 7px 14px;
	font-size: 13px; font-weight: 600;
	transition: all .2s;
	flex: 0 0 auto;
}
.lang-btn:hover { border-color: var(--purple); box-shadow: 0 0 14px rgba(108, 99, 255, .3); }
.lang-flag {
	width: 24px; height: 18px;
	border-radius: 3px;
	object-fit: cover;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
	flex: 0 0 auto;
}
.lang-caret { opacity: .6; font-size: 11px; }

.lang-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.lang-modal[hidden] { display: none; }
.lang-backdrop { position: absolute; inset: 0; background: rgba(5, 5, 10, .78); backdrop-filter: blur(6px); }
.lang-dialog {
	position: relative;
	width: min(760px, 100%);
	max-height: 82vh;
	display: flex; flex-direction: column;
	background: linear-gradient(160deg, #14142a, #0c0c16);
	border: 1px solid rgba(108, 99, 255, .4);
	border-radius: 22px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, .7), var(--shadow-neon);
	overflow: hidden;
	animation: langIn .22s ease-out;
}
@keyframes langIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.lang-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid var(--glass-border);
}
.lang-head h2 { font-size: 17px; font-weight: 700; }
.lang-close { background: none; border: 0; color: var(--text-dim); font-size: 18px; padding: 4px 8px; border-radius: 8px; }
.lang-close:hover { color: var(--text); background: var(--glass); }

.lang-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 8px;
	padding: 18px 22px 24px;
	overflow-y: auto;
}
.lang-item {
	display: flex; align-items: center; gap: 10px;
	padding: 10px 12px;
	border-radius: 12px;
	border: 1px solid transparent;
	color: var(--text-dim);
	font-size: 14px;
	transition: all .18s;
}
.lang-item:hover { background: var(--glass); border-color: var(--glass-border); color: var(--text); }
.lang-item.is-active {
	background: rgba(108, 99, 255, .18);
	border-color: var(--purple);
	color: #fff; font-weight: 600;
}
.lang-item .lang-flag { width: 28px; height: 21px; }
.lang-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ═══════════════════════════════════════
   قسم ألعاب البنات
   ═══════════════════════════════════════ */
.girls-section {
	margin-bottom: 36px;
	padding: 22px;
	border-radius: 20px;
	border: 1px solid rgba(255, 105, 180, .28);
	background:
		radial-gradient(500px 300px at 90% 0%, rgba(255, 105, 180, .12), transparent 65%),
		var(--glass);
}
.section-more { color: var(--cyan); font-size: 13.5px; font-weight: 600; }
.section-more:hover { text-decoration: underline; }
.chip-girls.is-active { background: linear-gradient(90deg, #ff5fa2, #b06cff); }
.nav-girls { color: #ff8ec0 !important; font-weight: 600; }

.girls-types {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 10px;
	margin-bottom: 20px;
}
.girls-type {
	display: flex; flex-direction: column; align-items: center; gap: 6px;
	padding: 14px 8px;
	border-radius: 14px;
	background: rgba(255, 255, 255, .05);
	border: 1px solid var(--glass-border);
	transition: all .2s;
	text-align: center;
}
.girls-type:hover {
	transform: translateY(-3px);
	border-color: rgba(255, 105, 180, .65);
	box-shadow: 0 0 18px rgba(255, 105, 180, .28);
}
.girls-type-icon { font-size: 26px; line-height: 1; }
.girls-type-name { font-size: 12px; color: var(--text-dim); }

/* ═══════════════════════════════════════
   الصفحات الثابتة ونموذج التواصل
   ═══════════════════════════════════════ */
.static-page { max-width: 820px; padding-top: 8px; }
.page-title { font-size: 30px; font-weight: 700; margin: 8px 0 18px; }
.page-body { line-height: 1.85; color: var(--text-dim); }
.page-body h3 { color: var(--text); font-size: 17px; margin: 22px 0 8px; }
.page-body p { margin-bottom: 12px; }
.page-body ul { padding-inline-start: 22px; margin-bottom: 12px; }
.page-body li { margin-bottom: 6px; }
.page-body a { color: var(--cyan); }

.contact-form { margin-top: 20px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.form-row input, .form-row textarea {
	width: 100%;
	background: rgba(0, 0, 0, .25);
	border: 1px solid var(--glass-border);
	border-radius: 10px;
	padding: 11px 14px;
	color: var(--text);
	font-family: inherit; font-size: 14px;
}
.form-row input:focus, .form-row textarea:focus {
	outline: none; border-color: var(--purple);
	box-shadow: 0 0 0 3px rgba(108, 99, 255, .18);
}
.form-ok { color: #4ade80; font-weight: 600; }
.form-error { color: #f87171; margin-bottom: 12px; }
.gh-hp { position: absolute; left: -9999px; }

/* أعمدة التذييل */
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 { font-size: 14px; margin-bottom: 4px; }
.footer-col a { color: var(--text-dim); font-size: 13.5px; }
.footer-col a:hover { color: var(--cyan); }

/* دعم اتجاه RTL للغات العربية والعبرية والأردية */
[dir="rtl"] .lang-caret { transform: scaleX(-1); }
[dir="rtl"] .breadcrumb span { transform: scaleX(-1); display: inline-block; }

/* استجابة الأقسام الجديدة */
@media (max-width: 1024px) {
	.girls-types { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
	.girls-types { grid-template-columns: repeat(3, 1fr); }
	.lang-btn-text { display: none; }
	.lang-btn { padding: 7px 10px; }
	.lang-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 14px; }
	.page-title { font-size: 23px; }
	.footer-inner { gap: 20px; }
}
@media (max-width: 480px) {
	.girls-types { grid-template-columns: repeat(3, 1fr); gap: 8px; }
	.girls-section { padding: 16px 12px; }
}
