/*
Theme Name: APKVision Pro
Theme URI: https://apkvision.me/
Author: APKVision.me
Author URI: https://apkvision.me/
Description: An accessible, responsive classic theme for an independent Android game catalog, with native Customizer controls and download-manager integration.
Version: 1.0.1
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.3
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: apkvision-pro
Tags: custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, two-columns, dark-mode
*/

:root {
	--apk-bg: #f3f4f6;
	--apk-surface: #ffffff;
	--apk-soft: #f5f6f8;
	--apk-text: #24282e;
	--apk-muted: #626b76;
	--apk-border: #e2e5e9;
	--apk-accent: #b92e21;
	--apk-on-accent: #ffffff;
	--apk-header: #f51f42;
	--apk-shadow: 0 4px 16px rgba(25, 31, 38, .045);
	--apk-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--apk-font-size: 16px;
	--apk-container: 960px;
	--apk-grid-columns: 8;
	color-scheme: light;
}

[data-theme="dark"] {
	--apk-bg: #121518;
	--apk-surface: #1b1f23;
	--apk-soft: #252a30;
	--apk-text: #edf0f3;
	--apk-muted: #aab3bd;
	--apk-border: #333a42;
	--apk-accent: #ff8477;
	--apk-on-accent: #17191d;
	--apk-header: #dd2341;
	--apk-shadow: 0 4px 18px rgba(0, 0, 0, .18);
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 70px; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--apk-bg);
	color: var(--apk-text);
	font-family: var(--apk-font-family);
	font-size: var(--apk-font-size);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	overflow-wrap: break-word;
}
body.nav-open { overflow: hidden; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--apk-accent); text-decoration-thickness: .08em; text-underline-offset: .16em; }
a:hover { text-decoration: underline; }
button, input, textarea, select { color: inherit; font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
h1, h2, h3, h4, p, figure { margin-top: 0; }
h1, h2, h3, h4 { color: var(--apk-text); line-height: 1.22; overflow-wrap: anywhere; }
h1 { font-size: 2.25rem; letter-spacing: -.025em; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.1rem; }
input, textarea, select {
	max-width: 100%;
	border: 1px solid var(--apk-border);
	border-radius: 9px;
	background: var(--apk-surface);
}
input:focus, textarea:focus, select:focus { border-color: var(--apk-accent); }
:focus-visible { outline: 3px solid var(--apk-accent); outline-offset: 3px; }
::selection { background: var(--apk-accent); color: var(--apk-on-accent); }

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.screen-reader-text:focus {
	z-index: 100000;
	top: 8px;
	left: 8px;
	width: auto;
	height: auto;
	clip: auto;
	padding: 12px 18px;
	border-radius: 8px;
	background: var(--apk-surface);
	color: var(--apk-text);
	font-weight: 700;
}
.container { width: min(calc(100% - 32px), var(--apk-container)); margin-inline: auto; }
.site-main { min-height: 65vh; padding-block: 24px 48px; outline: none; }
.eyebrow {
	margin-bottom: 8px;
	color: var(--apk-accent);
	font-size: .73rem;
	font-weight: 750;
	letter-spacing: .09em;
	text-transform: uppercase;
}
.text-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.button {
	display: inline-flex;
	min-height: 43px;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 10px 16px;
	border: 1px solid transparent;
	border-radius: 9px;
	font-weight: 650;
	line-height: 1.25;
	text-decoration: none;
}
.button:hover { text-decoration: none; }
.button-download { background: var(--apk-accent); color: var(--apk-on-accent); }
.button-download:hover { filter: brightness(.94); }
.button-secondary { border-color: var(--apk-border); background: var(--apk-surface); color: var(--apk-text); }
.button-quiet { min-height: 37px; padding: 7px 11px; border-color: var(--apk-border); background: var(--apk-surface); color: var(--apk-text); font-size: .83rem; }

/* Compact catalog header. */
.site-header {
	position: sticky;
	z-index: 1000;
	top: 0;
	height: 48px;
	background: var(--apk-header);
	box-shadow: 0 2px 4px rgba(40, 20, 25, .14);
	color: #ffffff;
}
.admin-bar .site-header { top: 32px; }
.header-inner { position: relative; display: flex; height: 48px; align-items: center; justify-content: center; }
.site-branding { max-width: 62%; border-radius: 2px; background: #ffffff; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.site-brand {
	display: block;
	overflow: hidden;
	padding: 6px 12px;
	color: #17191d;
	font-size: .91rem;
	font-weight: 800;
	letter-spacing: .015em;
	line-height: 1.25;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
}
.site-brand:hover { text-decoration: none; }
.custom-logo-link { display: flex; padding: 4px 9px; background: #ffffff; }
.custom-logo { display: block; width: auto; max-width: 210px; height: 26px; object-fit: contain; }
.header-icon {
	display: grid;
	width: 40px;
	height: 40px;
	place-items: center;
	border: 0;
	border-radius: 7px;
	background: transparent;
	color: #ffffff;
}
.header-icon:hover { background: rgba(255, 255, 255, .1); }
.header-icon:focus-visible { outline-color: #ffffff; }
.nav-toggle { position: absolute; left: 0; display: none; }
.js .nav-toggle { display: grid; }
.site-search { position: absolute; right: 0; }
.site-search summary { list-style: none; }
.site-search summary::-webkit-details-marker { display: none; }
.header-search-panel {
	position: absolute;
	z-index: 1010;
	top: 45px;
	right: 0;
	width: min(360px, calc(100vw - 32px));
	padding: 12px;
	border: 1px solid var(--apk-border);
	border-radius: 11px;
	background: var(--apk-surface);
	box-shadow: 0 12px 35px rgba(0, 0, 0, .18);
	color: var(--apk-text);
}

/* Off-canvas menu enhances a visible, no-JS navigation list. */
.nav-scrim { display: none; }
.primary-navigation { border-bottom: 1px solid var(--apk-border); background: var(--apk-surface); }
.nav-panel { width: min(calc(100% - 32px), var(--apk-container)); margin-inline: auto; padding-block: 10px; }
.nav-panel-heading { display: none; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.nav-close { display: none; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 8px; background: var(--apk-soft); color: var(--apk-text); }
.primary-menu, .primary-menu ul { padding: 0; margin: 0; list-style: none; }
.primary-menu { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.primary-menu a { display: block; padding: 8px 3px; color: var(--apk-text); font-weight: 550; }
.primary-menu .current-menu-item > a, .primary-menu .current_page_item > a { color: var(--apk-accent); }
.primary-menu ul { padding-left: 16px; }
.nav-theme-toggle {
	display: flex;
	width: 100%;
	align-items: center;
	gap: 11px;
	margin-top: 12px;
	padding: 12px 10px;
	border: 1px solid var(--apk-border);
	border-radius: 9px;
	background: var(--apk-soft);
	color: var(--apk-text);
	text-align: left;
}
[data-theme="light"] .theme-icon-sun, [data-theme="dark"] .theme-icon-moon { display: none; }
.js .primary-navigation {
	position: fixed;
	z-index: 1200;
	inset: 0 auto 0 0;
	width: min(340px, 88vw);
	border: 0;
	box-shadow: 10px 0 36px rgba(0, 0, 0, .2);
	overflow-y: auto;
	transform: translateX(-104%);
	visibility: hidden;
	transition: transform .2s ease, visibility .2s;
}
.js .primary-navigation.is-open { transform: translateX(0); visibility: visible; }
.js .nav-panel { width: auto; margin: 0; padding: 18px; }
.js .nav-panel-heading { display: flex; }
.js .nav-close { display: grid; }
.js .primary-menu { display: block; }
.js .primary-menu li { border-bottom: 1px solid var(--apk-border); }
.js .primary-menu li li { border: 0; }
.js .primary-menu a { padding: 12px 7px; }
.js .nav-scrim { position: fixed; z-index: 1190; inset: 0; display: block; background: rgba(10, 13, 17, .55); }

/* Search and ad placements. */
.search-form-row { display: flex; align-items: stretch; }
.search-form-row input[type="search"] { width: 100%; min-width: 0; height: 45px; padding: 9px 12px; border-radius: 9px 0 0 9px; }
.search-submit {
	display: grid;
	flex: 0 0 46px;
	place-items: center;
	border: 0;
	border-radius: 0 9px 9px 0;
	background: var(--apk-accent);
	color: var(--apk-on-accent);
}
.ad-placement { margin-block: 18px; text-align: center; }
.ad-label { display: block; margin-bottom: 5px; color: var(--apk-muted); font-size: .63rem; letter-spacing: .08em; text-transform: uppercase; }
.ad-content { min-height: 1px; }
.ad-content img { display: inline-block; }
.content-primary .ad-placement { width: 100%; margin-block: 16px; }

/* Homepage introduction and tabbed game grid. */
.home-hero { padding: 5px 0 22px; }
.home-hero h1 { max-width: 760px; margin-bottom: 9px; font-size: 1.95rem; }
.home-intro { max-width: 800px; margin-bottom: 0; color: var(--apk-muted); font-size: .95rem; }
.home-discovery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.discovery-card { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border: 1px solid var(--apk-border); border-radius: 11px; background: var(--apk-surface); color: var(--apk-text); box-shadow: var(--apk-shadow); }
.discovery-card:hover { border-color: var(--apk-accent); color: var(--apk-text); text-decoration: none; }
.discovery-card strong, .discovery-card small { display: block; }
.discovery-card strong { font-size: .86rem; line-height: 1.3; }
.discovery-card small { margin-top: 3px; color: var(--apk-muted); font-size: .66rem; line-height: 1.35; }
.discovery-arrow { flex: 0 0 auto; color: var(--apk-accent); font-size: 1.3rem; line-height: 1; }
#game-collections, #game-categories { scroll-margin-top: 65px; }
.home-games, .home-collections {
	padding: 20px;
	margin-bottom: 24px;
	border: 1px solid var(--apk-border);
	border-radius: 16px;
	background: var(--apk-surface);
	box-shadow: var(--apk-shadow);
}
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin-bottom: 5px; }
.section-heading p { margin-bottom: 0; color: var(--apk-muted); font-size: .85rem; }
.home-tab-list {
	display: flex;
	gap: 4px;
	padding: 5px;
	margin: 18px 0 20px;
	border-radius: 11px;
	background: var(--apk-soft);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: thin;
}
.home-tab-list a { flex: 0 0 auto; padding: 8px 13px; border-radius: 8px; color: var(--apk-muted); font-size: .86rem; }
.home-tab-list a:hover { color: var(--apk-text); text-decoration: none; }
.home-tab-list a[aria-selected="true"] { background: var(--apk-surface); box-shadow: 0 2px 7px rgba(20, 25, 30, .08); color: var(--apk-text); font-weight: 650; }
.home-panel-heading { margin-bottom: 16px; font-size: 1.2rem; }
.home-tabs.is-enhanced .home-panel-heading { display: none; }
.panel-empty { padding: 24px 14px; border: 1px dashed var(--apk-border); border-radius: 10px; color: var(--apk-muted); text-align: center; }
.panel-empty p { margin: 0; }
.home-panel-footer { display: flex; justify-content: center; padding-top: 17px; margin-top: 20px; border-top: 1px solid var(--apk-border); }
.home-panel-footer .button { min-height: 38px; padding-block: 8px; font-size: .82rem; }
.home-apps-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 24px; padding: 20px; margin-bottom: 24px; border: 1px solid var(--apk-border); border-radius: 16px; background: var(--apk-surface); box-shadow: var(--apk-shadow); }
.home-apps-guide h2 { margin-bottom: 10px; font-size: 1.35rem; }
.home-apps-guide p { margin-bottom: 0; color: var(--apk-muted); font-size: .85rem; }
.home-apps-search p { margin-top: 12px; font-size: .76rem; }

/* Icon cards and horizontal archive cards. */
.game-grid { display: grid; min-width: 0; }
.game-grid-icons { grid-template-columns: repeat(var(--apk-grid-columns), minmax(0, 1fr)); gap: 20px 12px; }
.game-card { min-width: 0; border: 1px solid var(--apk-border); border-radius: 14px; background: var(--apk-surface); box-shadow: var(--apk-shadow); }
.game-card-link { display: flex; height: 100%; align-items: center; gap: 14px; padding: 15px; color: var(--apk-text); }
.game-card-link:hover { color: var(--apk-text); text-decoration: none; }
.game-card-icon { display: block; flex: 0 0 88px; width: 88px; aspect-ratio: 1; overflow: hidden; border-radius: 15px; background: var(--apk-soft); }
.game-icon-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.game-card-body { min-width: 0; }
.game-card-title { display: -webkit-box; margin: 0 0 7px; overflow: hidden; color: var(--apk-text); font-size: 1rem; font-weight: 600; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.game-card-version { display: inline-flex; max-width: 100%; overflow: hidden; padding: 2px 6px; border-radius: 5px; background: var(--apk-soft); color: var(--apk-muted); font-size: .7rem; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.game-card-updated { display: block; margin-top: 6px; color: var(--apk-muted); font-size: .67rem; }
.game-card-compact { border: 0; background: transparent; box-shadow: none; }
.game-card-compact .game-card-link { display: block; padding: 0; }
.game-card-compact .game-card-icon { width: 100%; border-radius: 16px; }
.game-card-compact .game-card-title { min-height: 2.6em; margin-top: 8px; margin-bottom: 0; font-size: .82rem; font-weight: 500; }
.game-card-compact .game-card-version { margin-top: 5px; }
.archive-game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.game-card, .collection-card { transition: transform .17s ease, border-color .17s ease, box-shadow .17s ease; }
	.game-card:hover, .collection-card:hover { transform: translateY(-2px); }
	.game-card:not(.game-card-compact):hover { border-color: var(--apk-muted); }
	.game-card-compact:hover .game-card-title { color: var(--apk-accent); }
}

/* Original pastel category collection cards. */
.collection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.collection-card {
	--collection-a: #dff2e5;
	--collection-b: #bde2ca;
	display: grid;
	min-height: 180px;
	grid-template-columns: minmax(0, 1fr) 126px;
	align-items: center;
	gap: 16px;
	padding: 20px;
	border-radius: 15px;
	background: linear-gradient(135deg, var(--collection-a), var(--collection-b));
	color: #253029;
}
.collection-card[data-tone="1"] { --collection-a: #fff0d9; --collection-b: #f4d4ae; }
.collection-card[data-tone="2"] { --collection-a: #e9edff; --collection-b: #ccd7f4; }
.collection-card[data-tone="3"] { --collection-a: #f3e9fb; --collection-b: #dec9ef; }
.collection-card[data-tone="4"] { --collection-a: #e3f4f2; --collection-b: #c0e1de; }
.collection-card[data-tone="5"] { --collection-a: #fdebf0; --collection-b: #efc8d2; }
[data-theme="dark"] .collection-card { --collection-a: #203e30; --collection-b: #2c4c3b; color: var(--apk-text); }
[data-theme="dark"] .collection-card[data-tone="1"] { --collection-a: #433224; --collection-b: #57402d; }
[data-theme="dark"] .collection-card[data-tone="2"] { --collection-a: #29324d; --collection-b: #334263; }
[data-theme="dark"] .collection-card[data-tone="3"] { --collection-a: #3b2c48; --collection-b: #4b3659; }
[data-theme="dark"] .collection-card[data-tone="4"] { --collection-a: #203d3d; --collection-b: #295050; }
[data-theme="dark"] .collection-card[data-tone="5"] { --collection-a: #442b34; --collection-b: #563440; }
.collection-card:hover { color: inherit; text-decoration: none; }
.collection-copy { display: flex; min-width: 0; align-items: flex-start; flex-direction: column; }
.collection-count { padding: 3px 7px; margin-bottom: 13px; border-radius: 6px; background: rgba(255, 255, 255, .62); color: #46514a; font-size: .68rem; }
[data-theme="dark"] .collection-count { background: rgba(0, 0, 0, .2); color: var(--apk-muted); }
.collection-copy strong { font-size: 1.22rem; font-weight: 600; line-height: 1.28; }
.collection-action { display: inline-flex; align-items: center; gap: 8px; margin-top: 17px; font-size: .8rem; font-weight: 600; }
.collection-art { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.collection-art:empty { display: none; }
.collection-art > span { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 12px; box-shadow: 0 4px 10px rgba(20, 25, 30, .1); }

/* Archives and native pagination. */
.breadcrumbs { margin: 0 0 22px; color: var(--apk-muted); font-size: .72rem; text-transform: uppercase; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumbs li + li::before { content: "›"; opacity: .65; }
.breadcrumbs a { color: var(--apk-muted); }
.archive-header { margin-bottom: 20px; }
.archive-header h1 { margin-bottom: 8px; font-size: 2.15rem; }
.archive-description { max-width: 830px; color: var(--apk-muted); }
.archive-description > :last-child { margin-bottom: 0; }
.archive-search { max-width: 560px; margin-top: 16px; }
.archive-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 0 16px; }
.result-count { flex: 0 0 auto; margin: 0; color: var(--apk-muted); font-size: .82rem; }
.sort-links { display: flex; max-width: 100%; gap: 3px; padding: 4px; border-radius: 10px; background: #e3e6ea; overflow-x: auto; scrollbar-width: thin; }
[data-theme="dark"] .sort-links { background: var(--apk-soft); }
.sort-links a { flex: 0 0 auto; padding: 7px 11px; border-radius: 7px; color: var(--apk-muted); font-size: .78rem; white-space: nowrap; }
.sort-links a:hover { color: var(--apk-text); text-decoration: none; }
.sort-links a[aria-current="page"] { background: var(--apk-surface); color: var(--apk-text); font-weight: 650; }
.navigation.pagination { margin-top: 28px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.page-numbers {
	display: inline-grid;
	min-width: 39px;
	min-height: 39px;
	place-items: center;
	padding: 7px 10px;
	border: 1px solid var(--apk-border);
	border-radius: 8px;
	background: var(--apk-surface);
	color: var(--apk-text);
	font-size: .84rem;
}
.page-numbers.current { border-color: var(--apk-text); background: var(--apk-text); color: var(--apk-surface); }
.page-numbers.dots { border-color: transparent; background: transparent; }
.empty-state { padding: 38px 22px; border: 1px solid var(--apk-border); border-radius: 14px; background: var(--apk-surface); color: var(--apk-muted); text-align: center; }
.empty-state > svg { margin-bottom: 14px; color: var(--apk-muted); }
.empty-state h2 { margin-bottom: 9px; }
.empty-state p { max-width: 590px; margin-inline: auto; }
.empty-state .button { margin-top: 8px; }

/* Standard content and widget sidebar. */
.content-layout { display: grid; grid-template-areas: "primary sidebar"; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 24px; }
.content-primary { grid-area: primary; min-width: 0; }
.widget-area { grid-area: sidebar; min-width: 0; }
.apk-layout-left .content-layout { grid-template-areas: "sidebar primary"; grid-template-columns: 280px minmax(0, 1fr); }
.apk-layout-none .content-layout { grid-template-areas: "primary"; grid-template-columns: minmax(0, 1fr); }
.apk-layout-none .widget-area { display: none; }
.widget { padding: 18px; margin-bottom: 18px; border: 1px solid var(--apk-border); border-radius: 13px; background: var(--apk-surface); }
.widget-title { margin-bottom: 13px; font-size: 1.05rem; }
.widget ul { padding-left: 19px; }
.widget-empty { margin-bottom: 0; color: var(--apk-muted); font-size: .88rem; }
.sidebar-category-list, .sidebar-game-list { padding: 0 !important; margin: 0; list-style: none; }
.sidebar-category-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--apk-border); }
.sidebar-category-list li:last-child { border: 0; }
.sidebar-category-list span { color: var(--apk-muted); font-size: .75rem; }
.sidebar-game-list li { padding: 8px 0; }
.sidebar-game-list a { display: block; color: var(--apk-text); font-weight: 600; }
.sidebar-game-list small { color: var(--apk-muted); }

/* Game detail and its dedicated sticky table of contents. */
.game-detail-hero { display: flex; align-items: center; gap: 20px; padding: 20px; margin-bottom: 20px; border: 1px solid var(--apk-border); border-radius: 16px; background: var(--apk-surface); box-shadow: var(--apk-shadow); }
.game-detail-icon { flex: 0 0 128px; width: 128px; aspect-ratio: 1; overflow: hidden; border-radius: 20px; background: var(--apk-soft); }
.game-detail-heading { min-width: 0; }
.game-detail-heading h1 { margin: 5px 0 12px; font-size: 2rem; }
.game-detail-categories { display: flex; flex-wrap: wrap; gap: 8px; font-size: .77rem; }
.game-quick-facts { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 0; margin: 0; list-style: none; }
.game-quick-facts li { display: flex; flex-direction: column; }
.game-quick-facts span { color: var(--apk-muted); font-size: .68rem; text-transform: uppercase; }
.game-quick-facts strong { font-size: .86rem; font-weight: 600; }
.game-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; align-items: start; gap: 20px; }
.game-content-column { grid-column: 1; grid-row: 1; min-width: 0; }
.game-sidebar { grid-column: 2; grid-row: 1; min-width: 0; }
.game-sidebar-sticky { position: sticky; top: 68px; }
.admin-bar .game-sidebar-sticky { top: 100px; }
.game-sidebar-download { width: 100%; margin-bottom: 12px; }
.game-toc { overflow: hidden; border: 1px solid var(--apk-border); border-radius: 12px; background: var(--apk-surface); }
.game-toc a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--apk-border); color: var(--apk-text); font-size: .82rem; }
.game-toc a:last-child { border-bottom: 0; }
.game-toc a:hover { background: var(--apk-soft); text-decoration: none; }
.game-panel { padding: 20px; margin-bottom: 20px; border: 1px solid var(--apk-border); border-radius: 14px; background: var(--apk-surface); box-shadow: var(--apk-shadow); }
.game-panel > h2:first-child, .game-panel > .eyebrow + h2 { margin-bottom: 14px; }
.game-panel section, .game-panel article { scroll-margin-top: 70px; }
#about, #details, #screenshots, #download, #related { scroll-margin-top: 70px; }
.entry-content { color: var(--apk-text); line-height: 1.7; }
.entry-content > :last-child { margin-bottom: 0; }
.entry-content h2, .entry-content h3, .entry-content h4 { margin-top: 1.5em; }
.entry-content a { overflow-wrap: anywhere; }
.entry-content blockquote { padding: 12px 18px; margin-inline: 0; border-left: 4px solid var(--apk-accent); background: var(--apk-soft); }
.entry-content pre { max-width: 100%; padding: 15px; overflow: auto; border-radius: 8px; background: var(--apk-soft); }
.entry-content table, .comment-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: 9px; border: 1px solid var(--apk-border); text-align: left; }
.content-notice { margin-bottom: 0; color: var(--apk-muted); }
.facts-table-wrap { overflow-x: auto; }
.game-facts table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.game-facts th, .game-facts td { padding: 11px 12px; border-bottom: 1px solid var(--apk-border); text-align: left; vertical-align: top; }
.game-facts tr:nth-child(odd) { background: var(--apk-soft); }
.game-facts tr:last-child th, .game-facts tr:last-child td { border-bottom: 0; }
.game-facts th { width: 42%; color: var(--apk-muted); font-weight: 500; }
.game-facts code { overflow-wrap: anywhere; }
.game-resources { display: flex; flex-wrap: wrap; gap: 9px 16px; padding: 14px 0 0; margin: 14px 0 0; border-top: 1px solid var(--apk-border); list-style: none; font-size: .82rem; }
.game-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gallery-item { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 11px; background: var(--apk-soft); }
.gallery-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.download-panel { border-color: var(--apk-accent); }
.download-panel > p:not(.eyebrow) { color: var(--apk-muted); }
.download-version { display: inline-flex; padding: 4px 8px; margin-bottom: 14px; border-radius: 6px; background: var(--apk-soft); color: var(--apk-muted); font-size: .77rem; }
.download-action { margin: 8px 0 13px; }
.download-action .button { min-width: 210px; }
.download-direct-link { display: flex; width: fit-content; margin-top: 11px; font-size: .8rem; }
.download-options { margin-bottom: 20px; }
.download-options > :last-child { margin-bottom: 0; }
.download-panel > small { display: block; color: var(--apk-muted); }
.related-game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 10px; }
.related-game-grid .game-card-title { font-size: .76rem; }

/* Comments and standard entries. */
.standard-entry { padding: 24px; }
.entry-header h1 { margin-bottom: 9px; }
.entry-meta { display: flex; gap: 8px; margin-bottom: 20px; color: var(--apk-muted); font-size: .8rem; }
.entry-featured-image { margin-bottom: 20px; }
.entry-featured-image img { display: block; border-radius: 10px; }
.post-navigation { margin-bottom: 20px; }
.post-navigation .nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.post-navigation a { display: block; height: 100%; padding: 13px; border: 1px solid var(--apk-border); border-radius: 10px; background: var(--apk-surface); }
.post-navigation a > span { display: block; color: var(--apk-muted); font-size: .7rem; text-transform: uppercase; }
.post-navigation .nav-next { text-align: right; }
.post-tags { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; list-style: none; }
.post-tags a { display: block; padding: 5px 9px; border-radius: 6px; background: var(--apk-soft); }
.comments-title { font-size: 1.25rem; }
.comment-list { padding: 0; margin: 0; list-style: none; }
.comment-list .comment { padding: 16px 0; border-top: 1px solid var(--apk-border); }
.comment-list .children { padding-left: 24px; list-style: none; }
.comment-body { min-width: 0; }
.comment-meta { margin-bottom: 8px; font-size: .8rem; }
.comment-metadata { font-size: .7rem; }
.comment-content { overflow-wrap: anywhere; }
.comment-content > :last-child { margin-bottom: 0; }
.comment-reply-link { font-size: .78rem; font-weight: 650; }
.comment-respond { margin-top: 20px; }
.comment-reply-title { font-size: 1.2rem; }
.comment-form label { display: block; margin-bottom: 5px; font-size: .82rem; font-weight: 600; }
.comment-form input:not([type="checkbox"]):not([type="submit"]), .comment-form textarea { width: 100%; padding: 10px 12px; }
.comment-form textarea { min-height: 130px; resize: vertical; }
.comment-form .submit, .form-submit input { min-height: 42px; padding: 10px 17px; border: 0; border-radius: 8px; background: var(--apk-accent); color: var(--apk-on-accent); }
.comment-notes, .logged-in-as, .no-comments { color: var(--apk-muted); font-size: .82rem; }

/* Download landing page and 404. */
.download-main { max-width: calc(var(--apk-container) - 120px); }
.download-page { max-width: 760px; margin-inline: auto; }
.download-page-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.download-page-header h1 { margin-bottom: 8px; font-size: 1.85rem; }
.download-page-header p:last-child { margin-bottom: 0; color: var(--apk-muted); }
.download-page-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0; margin: 0 0 22px; list-style: none; }
.download-page-facts li { padding: 12px; border-radius: 9px; background: var(--apk-soft); }
.download-page-facts span, .download-page-facts strong { display: block; }
.download-page-facts span { color: var(--apk-muted); font-size: .7rem; text-transform: uppercase; }
.download-source-note { color: var(--apk-muted); font-size: .82rem; }
.compact-empty { padding: 20px; margin-block: 18px; background: var(--apk-soft); }
.compact-empty h2 { font-size: 1.1rem; }
.error-404 { max-width: 680px; padding: 36px; margin: 30px auto; text-align: center; }
.error-404 .search-form { max-width: 480px; margin: 22px auto; }
.error-code { margin-bottom: 0; color: var(--apk-accent); font-size: 4rem; font-weight: 800; line-height: 1; }

/* Compact light footer. */
.site-footer { border-top: 1px solid var(--apk-border); background: var(--apk-surface); color: var(--apk-muted); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; padding-block: 18px; font-size: .67rem; letter-spacing: .025em; text-transform: uppercase; }
.footer-identity { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-brand { color: var(--apk-text); font-weight: 750; }
.footer-menu { display: flex; flex-wrap: wrap; gap: 16px; padding: 0; margin: 0; list-style: none; }
.footer-menu a { color: var(--apk-muted); }
.footer-custom-text { flex-basis: 100%; }
.footer-custom-text > :last-child { margin-bottom: 0; }

/* Content Engine public forms and submission feedback. */
.apkvision-public-form { max-width: 680px; padding: 20px; border: 1px solid var(--apk-border); border-radius: 12px; background: var(--apk-surface); }
.entry-content .apkvision-public-form { margin-block: 20px; }
.apkvision-public-form p { margin: 0 0 16px; }
.apkvision-public-form label { display: block; font-size: .86rem; font-weight: 600; }
.apkvision-public-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), .apkvision-public-form textarea { display: block; width: 100%; min-height: 44px; padding: 10px 12px; margin-top: 6px; border: 1px solid var(--apk-border); border-radius: 8px; background: var(--apk-surface); color: var(--apk-text); }
.apkvision-public-form textarea { min-height: 160px; resize: vertical; }
.apkvision-public-form input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; margin: 0 7px 0 0; vertical-align: middle; }
.apkvision-public-form button.button { min-height: 44px; padding: 10px 17px; border: 0; border-radius: 8px; background: var(--apk-accent); color: var(--apk-on-accent); }
.apkvision-public-form .description { color: var(--apk-muted); font-size: .78rem; }
.apkvision-public-form > :last-child { margin-bottom: 0; }
.apkvision-public-form .apkvision-hp { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.apkvision-form-success, .apkvision-form-error { max-width: 680px; padding: 12px 14px; margin: 0 0 16px; border: 1px solid; border-radius: 9px; font-size: .88rem; }
.apkvision-form-success { border-color: #8fc7a3; background: #eef9f2; color: #195c34; }
.apkvision-form-error { border-color: #e2a39d; background: #fff1ef; color: #8c241b; }
[data-theme="dark"] .apkvision-form-success { border-color: #356d49; background: #193426; color: #b8e7c8; }
[data-theme="dark"] .apkvision-form-error { border-color: #81473f; background: #3c2422; color: #ffc1ba; }

@media (max-width: 1100px) {
	.game-grid-icons { grid-template-columns: repeat(6, minmax(0, 1fr)); }
	.related-game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
	.archive-game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.content-layout, .apk-layout-left .content-layout { grid-template-areas: "primary" "sidebar"; grid-template-columns: minmax(0, 1fr); }
	.widget-area { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
	.apk-layout-none .widget-area { display: none; }
}

@media (max-width: 800px) {
	.home-discovery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.home-apps-guide { grid-template-columns: minmax(0, 1fr); gap: 18px; }
	.game-detail-layout { grid-template-columns: minmax(0, 1fr); }
	.game-content-column, .game-sidebar { grid-column: 1; grid-row: auto; }
	.game-sidebar-sticky { position: static; }
	.game-sidebar-download { width: auto; min-width: 190px; }
	.game-toc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.game-toc a:nth-child(odd) { border-right: 1px solid var(--apk-border); }
	.game-sidebar { margin-bottom: 18px; }
}

@media (max-width: 640px) {
	html { scroll-padding-top: 60px; }
	.container { width: calc(100% - 24px); }
	.site-main { padding-block: 18px 34px; }
	.site-header, .header-inner { height: 46px; }
	.admin-bar .site-header { top: 0; }
	.site-brand { max-width: 190px; padding: 6px 9px; font-size: .78rem; }
	.custom-logo { max-width: 170px; height: 24px; }
	.header-icon { width: 37px; height: 37px; }
	.home-hero { padding-top: 2px; }
	.home-hero h1 { font-size: 1.65rem; }
	.home-intro { font-size: .86rem; }
	.home-games, .home-collections { padding: 15px; border-radius: 12px; }
	.home-discovery { gap: 8px; }
	.discovery-card { padding: 11px; }
	.discovery-card small { font-size: .63rem; }
	.home-apps-guide { padding: 16px; border-radius: 12px; }
	.home-panel-footer .button { width: 100%; }
	.section-heading { gap: 10px; }
	.section-heading h2 { font-size: 1.35rem; }
	.section-heading p { font-size: .76rem; }
	.button-quiet { padding-inline: 9px; font-size: .72rem; }
	.home-tab-list { margin-block: 15px 18px; }
	.home-tab-list a { padding: 7px 11px; font-size: .78rem; }
	.game-grid-icons { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 10px; }
	.game-card-compact .game-card-icon { border-radius: 12px; }
	.game-card-compact .game-card-title { font-size: .75rem; }
	.collection-grid { grid-template-columns: 1fr; gap: 12px; }
	.collection-card { min-height: 165px; grid-template-columns: minmax(0, 1fr) 112px; padding: 17px; }
	.collection-copy strong { font-size: 1.08rem; }
	.archive-header h1 { font-size: 1.8rem; }
	.archive-toolbar { align-items: flex-start; flex-direction: column; gap: 10px; }
	.sort-links { width: 100%; }
	.archive-game-grid { grid-template-columns: 1fr; gap: 11px; }
	.game-card-icon { flex-basis: 82px; width: 82px; border-radius: 13px; }
	.game-card-updated { display: none; }
	.widget-area { grid-template-columns: 1fr; gap: 0; }
	.game-detail-hero { gap: 15px; padding: 15px; }
	.game-detail-icon { flex-basis: 96px; width: 96px; border-radius: 16px; }
	.game-detail-heading h1 { font-size: 1.55rem; }
	.game-quick-facts { gap: 8px 14px; }
	.game-panel { padding: 16px; border-radius: 12px; }
	.game-toc a { padding: 10px; font-size: .75rem; }
	.related-game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.download-page-header { align-items: flex-start; }
	.download-page-facts { grid-template-columns: 1fr; }
	.download-page-header h1 { font-size: 1.45rem; }
	.standard-entry { padding: 18px; }
	.post-navigation .nav-links { grid-template-columns: 1fr; }
	.post-navigation .nav-next { text-align: left; }
	.comment-list .children { padding-left: 12px; }
	.footer-inner { align-items: flex-start; flex-direction: column; gap: 9px; padding-block: 15px; }
}

@media (max-width: 380px) {
	.home-games, .home-collections { padding: 12px; }
	.game-grid-icons { column-gap: 8px; }
	.game-detail-hero { align-items: flex-start; }
	.game-detail-icon { flex-basis: 80px; width: 80px; }
	.game-detail-heading h1 { font-size: 1.35rem; }
	.game-gallery { gap: 8px; }
	.download-page-header { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
