/*
Theme Name: H5GP Arcade
Theme URI: https://example.com/h5gp-arcade
Author: Your Company
Author URI: https://example.com
Description: Mobile-first, fast, accessible theme for HTML5 Game Platform Pro. Large game thumbnails, persistent category navigation, dark game-player area, keyboard navigation.
Version: 2.0.0
Requires at least: 6.4
Requires PHP: 8.2
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: h5gp-arcade
Requires Plugins: html5-game-platform-pro
*/

/* Design tokens */
:root {
	--h5gp-bg: #0f0f14;
	--h5gp-surface: #17171f;
	--h5gp-surface-alt: #1f1f29;
	--h5gp-text: #f4f4f6;
	--h5gp-text-muted: #9a9aa8;
	--h5gp-accent: #6c5ce7;
	--h5gp-accent-hover: #5849c4;
	--h5gp-success: #2ecc71;
	--h5gp-star: #ffb400;
	--h5gp-radius: 10px;
	--h5gp-max-width: 1280px;
	--h5gp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body.h5gp-body {
	margin: 0;
	background: var(--h5gp-bg);
	color: var(--h5gp-text);
	font-family: var(--h5gp-font);
	line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible {
	outline: 2px solid var(--h5gp-accent);
	outline-offset: 2px;
}

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

/* Header */
.h5gp-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(15, 15, 20, 0.92);
	backdrop-filter: blur(6px);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.h5gp-header-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 0;
}
.h5gp-logo { font-weight: 700; font-size: 1.25rem; color: var(--h5gp-text); }
.h5gp-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.h5gp-nav a { color: var(--h5gp-text-muted); font-weight: 500; }
.h5gp-nav a:hover { color: var(--h5gp-text); }
.h5gp-search-form { display: flex; }
.h5gp-search-form input {
	background: var(--h5gp-surface-alt);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: var(--h5gp-text);
	border-radius: 6px;
	padding: 8px 12px;
	min-width: 160px;
}
.h5gp-btn {
	display: inline-block;
	background: var(--h5gp-accent);
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 8px 16px;
	cursor: pointer;
	font-weight: 600;
}
.h5gp-btn:hover { background: var(--h5gp-accent-hover); }

/* Category nav */
.h5gp-category-nav {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding: 10px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.h5gp-category-nav a {
	white-space: nowrap;
	background: var(--h5gp-surface);
	padding: 6px 14px;
	border-radius: 999px;
	color: var(--h5gp-text-muted);
	font-size: 0.9rem;
}
.h5gp-category-nav a.is-active,
.h5gp-category-nav a:hover { background: var(--h5gp-accent); color: #fff; }

/* Game grid + cards */
.h5gp-section { padding: 32px 0; }
.h5gp-section-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}
.h5gp-section-title h2 { font-size: 1.4rem; margin: 0; }
.h5gp-section-title a { color: var(--h5gp-accent); font-size: 0.9rem; font-weight: 600; }

.h5gp-game-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 16px;
}
@media (max-width: 1100px) { .h5gp-game-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 860px)  { .h5gp-game-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .h5gp-game-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

.h5gp-game-card {
	background: var(--h5gp-surface);
	border-radius: var(--h5gp-radius);
	overflow: hidden;
	transition: transform 0.15s ease;
	display: block;
}
.h5gp-game-card:hover { transform: translateY(-3px); }
.h5gp-game-card img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
	background: var(--h5gp-surface-alt);
}
.h5gp-game-card .h5gp-card-body { padding: 10px 12px; }
.h5gp-game-card .h5gp-card-title {
	font-weight: 600;
	font-size: 0.95rem;
	margin: 0 0 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.h5gp-card-meta {
	display: flex;
	justify-content: space-between;
	font-size: 0.8rem;
	color: var(--h5gp-text-muted);
}
.h5gp-star { color: var(--h5gp-star); }

/* Hero */
.h5gp-hero {
	background: linear-gradient(135deg, var(--h5gp-surface-alt), var(--h5gp-surface));
	border-radius: var(--h5gp-radius);
	padding: 48px 32px;
	margin: 24px 0;
	text-align: center;
}
.h5gp-hero h1 { font-size: 2rem; margin: 0 0 12px; }
.h5gp-hero p { color: var(--h5gp-text-muted); max-width: 560px; margin: 0 auto 20px; }

/* Single game page */
.h5gp-game-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin: 20px 0;
}
.h5gp-game-header h1 { margin: 0; font-size: 1.6rem; }
.h5gp-game-stats { display: flex; gap: 16px; color: var(--h5gp-text-muted); font-size: 0.9rem; }
.h5gp-favorite-btn {
	background: var(--h5gp-surface-alt);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: var(--h5gp-text);
	border-radius: 6px;
	padding: 8px 14px;
	cursor: pointer;
}
.h5gp-favorite-btn.is-active { background: #ff4d6d; border-color: #ff4d6d; }

.h5gp-game-content { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-top: 24px; }
@media (max-width: 900px) { .h5gp-game-content { grid-template-columns: 1fr; } }

.h5gp-panel { background: var(--h5gp-surface); border-radius: var(--h5gp-radius); padding: 20px; margin-bottom: 20px; }
.h5gp-panel h3 { margin-top: 0; }

.h5gp-leaderboard-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 0.9rem; }
.h5gp-leaderboard-rank { color: var(--h5gp-text-muted); width: 24px; }

.h5gp-review { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.h5gp-review-author { font-weight: 600; margin-right: 8px; }

/* Footer */
.h5gp-footer {
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	padding: 32px 0;
	color: var(--h5gp-text-muted);
	font-size: 0.85rem;
	text-align: center;
	margin-top: 40px;
}

/* Accessibility: skip link */
.h5gp-skip-link {
	position: absolute;
	left: -9999px;
	background: var(--h5gp-accent);
	color: #fff;
	padding: 10px 16px;
	z-index: 100;
}
.h5gp-skip-link:focus { left: 16px; top: 16px; }

/* Mobile sticky ad slot */
.h5gp-ad-mobile_sticky {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 40;
	background: var(--h5gp-surface);
	display: none;
}
@media (max-width: 600px) {
	.h5gp-ad-mobile_sticky { display: flex; }
}
