/*
 * ZRCO Games header — console dashboard treatment.
 * Keeps the original arcade controls and their existing JavaScript behavior.
 */
#header.zrco-game-header,
#header {
	--zrco-night: #070b16;
	--zrco-panel: #11182a;
	--zrco-panel-2: #171f34;
	--zrco-line: #293451;
	--zrco-text: #f8fafc;
	--zrco-muted: #aab5cc;
	--zrco-violet: #7c5cff;
	--zrco-cyan: #20d9ff;
	position: relative;
	z-index: 10000 !important;
	isolation: isolate;
	width: 100%;
	background:
		radial-gradient(circle at 12% -60%, rgba(124,92,255,.42), transparent 38%),
		radial-gradient(circle at 87% 160%, rgba(32,217,255,.16), transparent 34%),
		var(--zrco-night) !important;
	border-bottom: 1px solid rgba(124,92,255,.45);
	box-shadow: 0 10px 34px rgba(2,6,23,.34);
	color: var(--zrco-text);
}

#header #top-nav {
	position: relative;
	z-index: 10002;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: nowrap;
	gap: clamp(14px,3vw,42px);
	width: min(100% - 32px, 1420px);
	min-height: 82px;
	margin: 0 auto;
	padding: 10px 0;
	box-sizing: border-box;
}

#header .logo {
	float: none;
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
}

#header .custom-logo-link {
	display: flex;
	align-items: center;
	min-height: 54px;
	padding: 0 10px;
	border: 1px solid rgba(124,92,255,.30);
	border-radius: 16px;
	background: linear-gradient(135deg,rgba(124,92,255,.16),rgba(32,217,255,.06));
	box-shadow: inset 0 1px rgba(255,255,255,.08);
}

#header .custom-logo {
	display: block;
	width: auto;
	max-width: 168px;
	height: 54px;
	object-fit: contain;
	filter: drop-shadow(0 4px 12px rgba(0,0,0,.28));
}

#header .menu-main-menu-container {
	min-width: 0;
	margin-left: auto;
}

#header #mt.menu {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: nowrap;
	gap: 9px;
	margin: 0;
	padding: 0;
	list-style: none;
}

#header #mt > li.btn {
	display: block;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 14px;
	background: transparent;
	box-shadow: none;
	filter: none;
	overflow: visible;
}

#header #mt > li > a {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 0 17px;
	border: 1px solid var(--zrco-line);
	border-radius: 14px;
	background: linear-gradient(180deg,var(--zrco-panel-2),var(--zrco-panel));
	box-shadow: inset 0 1px rgba(255,255,255,.05),0 6px 18px rgba(0,0,0,.13);
	color: var(--zrco-muted);
	font-size: 14px;
	font-weight: 750;
	line-height: 1;
	white-space: nowrap;
	transition: transform .18s ease,border-color .18s ease,color .18s ease,background .18s ease;
}

#header #mt > li > a > i {
	display: flex;
	align-items: center;
	gap: 9px;
	font-style: normal;
}

#header #mt > li > a ._mi {
	display: grid;
	place-items: center;
	width: 27px;
	height: 27px;
	margin: 0;
	border-radius: 9px;
	background: rgba(124,92,255,.14);
	color: #a999ff;
	font-size: 14px;
}

#header #mt > li:hover > a,
#header #mt > li.active > a {
	transform: translateY(-2px);
	border-color: rgba(124,92,255,.8);
	background: linear-gradient(180deg,#202946,#151c30);
	color: #fff;
}

#header #mt > li:hover > a ._mi,
#header #mt > li.active > a ._mi {
	background: linear-gradient(135deg,var(--zrco-violet),#5b46df);
	color: #fff;
	box-shadow: 0 5px 15px rgba(124,92,255,.35);
}

#header #mt > li.search > a ._mi {
	background: rgba(32,217,255,.12);
	color: var(--zrco-cyan);
}

#header #mt > li.search:hover > a ._mi,
#header #mt > li.search.active > a ._mi {
	background: linear-gradient(135deg,#0891b2,var(--zrco-cyan));
	color: #06111b;
	box-shadow: 0 5px 15px rgba(32,217,255,.25);
}

#header :is(a,button,input):focus-visible {
	outline: 2px solid var(--zrco-cyan);
	outline-offset: 3px;
}

/* The original category tray now behaves like a game-library drawer. */
#header #tc {
	position: absolute !important;
	z-index: 10005 !important;
	top: calc(100% + 1px);
	left: 50%;
	display: none;
	grid-template-columns: repeat(6,minmax(120px,1fr));
	gap: 8px;
	width: min(calc(100vw - 32px), 1180px);
	max-height: min(62vh,460px);
	margin: 0;
	padding: 18px;
	overflow: auto;
	transform: translateX(-50%);
	border: 1px solid #34415f;
	border-radius: 0 0 20px 20px;
	background: rgba(10,15,29,.98);
	box-shadow: 0 26px 70px rgba(0,0,0,.55);
	backdrop-filter: blur(18px);
	list-style: none;
}

#header #tc[style*="block"] {
	display: grid !important;
}

#header #tc li {
	display: block;
	margin: 0;
	padding: 0;
	list-style: none;
}

#header #tc a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 44px;
	padding: 0 13px;
	border: 1px solid #25314b;
	border-radius: 11px;
	background: #121a2c;
	color: #d9e1f0;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

#header #tc a:hover {
	border-color: var(--zrco-violet);
	background: #1a2440;
	color: #fff;
	transform: translateY(-1px);
}

#header #tc li:last-child a {
	justify-content: center;
	background: linear-gradient(135deg,#6749f3,#4130b5);
	border-color: transparent;
	color: #fff;
}

/* Search, favorites and history output must sit above game cards. */
#toggle {
	position: relative;
	z-index: 9999;
}

@media (max-width: 880px) {
	#header #top-nav {
		width: min(100% - 24px, 760px);
		min-height: 72px;
		gap: 9px;
		padding: 8px 0;
	}
	#header .custom-logo-link {
		min-height: 48px;
		padding-inline: 7px;
		border-radius: 13px;
	}
	#header .custom-logo {
		max-width: 124px;
		height: 46px;
	}
	#header #mt.menu {
		gap: 6px;
	}
	#header #mt > li > a {
		width: 45px;
		min-height: 45px;
		padding: 0;
		border-radius: 13px;
	}
	#header #mt > li > a > i {
		display: grid;
		place-items: center;
	}
	#header #mt > li > a ._mi {
		width: 28px;
		height: 28px;
	}
	#header #mt > li > a span {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0,0,0,0);
		white-space: nowrap;
		border: 0;
	}
	#header #tc {
		grid-template-columns: repeat(3,minmax(0,1fr));
		width: calc(100vw - 20px);
		padding: 12px;
		border-radius: 0 0 16px 16px;
	}
}

@media (max-width: 520px) {
	#header #top-nav {
		width: calc(100% - 16px);
		gap: 6px;
	}
	#header .custom-logo {
		max-width: 102px;
		height: 42px;
	}
	#header #mt.menu {
		gap: 4px;
	}
	#header #mt > li > a {
		width: 39px;
		min-height: 41px;
		border-radius: 11px;
	}
	#header #mt > li > a ._mi {
		width: 25px;
		height: 25px;
		font-size: 13px;
	}
	#header #tc {
		grid-template-columns: repeat(2,minmax(0,1fr));
		max-height: calc(100vh - 88px);
	}
	#header #tc a {
		min-height: 42px;
		padding-inline: 10px;
		font-size: 12px;
	}
}

@media (max-width: 370px) {
	#header .custom-logo-link {
		border: 0;
		background: transparent;
	}
	#header .custom-logo {
		max-width: 84px;
	}
	#header #mt > li > a {
		width: 36px;
	}
}

/* Bright arcade palette — balanced for the site's colorful game grid. */
#header.zrco-game-header,
#header {
	--zrco-night: #f7f9ff;
	--zrco-panel: #ffffff;
	--zrco-panel-2: #f7f8ff;
	--zrco-line: #d9def0;
	--zrco-text: #172033;
	--zrco-muted: #4a5670;
	background:
		radial-gradient(circle at 12% -70%, rgba(124,92,255,.22), transparent 38%),
		radial-gradient(circle at 88% 150%, rgba(32,217,255,.22), transparent 38%),
		linear-gradient(105deg,#ffffff 0%,#f5f4ff 56%,#effcff 100%) !important;
	border-bottom-color: #d6d9ef;
	box-shadow: 0 8px 26px rgba(44,58,100,.16);
	color: var(--zrco-text);
}

#header .custom-logo-link {
	border-color: #d8d9f2;
	background: linear-gradient(135deg,#ffffff,#f1f0ff);
	box-shadow: 0 6px 18px rgba(73,63,140,.10),inset 0 1px #fff;
}

#header #mt > li > a {
	border-color: #d9deec;
	background: linear-gradient(180deg,#ffffff,#f4f6fb);
	box-shadow: 0 5px 15px rgba(44,58,100,.09),inset 0 1px #fff;
	color: #4c5870;
}

#header #mt > li:hover > a,
#header #mt > li.active > a {
	border-color: #8b74ff;
	background: linear-gradient(180deg,#ffffff,#eeebff);
	color: #1e2940;
	box-shadow: 0 7px 20px rgba(93,72,190,.17);
}

#header #mt > li > a ._mi {
	background: #ece9ff;
	color: #6248db;
}

#header #mt > li.search > a ._mi {
	background: #dff9ff;
	color: #078ca9;
}

#header #tc {
	border-color: #d6dced;
	background: rgba(250,251,255,.98);
	box-shadow: 0 24px 55px rgba(40,52,88,.24);
}

#header #tc a {
	border-color: #dce1ee;
	background: #ffffff;
	color: #34405a;
	box-shadow: 0 3px 10px rgba(45,57,91,.06);
}

#header #tc a:hover {
	border-color: #8068f3;
	background: #f1efff;
	color: #211a4a;
	box-shadow: 0 6px 16px rgba(92,72,180,.13);
}

#header #tc li:last-child a {
	background: linear-gradient(135deg,#7b5cff,#4e55d8);
	color: #fff;
}
