/*
Theme Name: Kauferbay Games
Theme URI: https://example.com
Author: Your Name
Description: A responsive WordPress theme for an HTML5 game platform — homepage discovery sections (featured, popular, new, categories, recently played, leaderboard), and a game page template with an embedded player, fullscreen, ratings, and high scores. Ticket-stub / neo-brutalist visual style: warm paper background, thick ink borders, hard offset shadows, chunky rounded display type.
Version: 3.0.0
Requires at least: 5.9
Requires PHP: 7.4
License: GPL v2 or later
Text Domain: game-hub
*/

/* ============================================================
   Design tokens
   ============================================================ */
:root {
	--paper: #F7F3EA;
	--paper-alt: #FFFDF8;
	--ink: #14131F;
	--ink-soft: #5B5A6C;
	--accent: #FF5A36;
	--accent-2: #2F6FED;
	--accent-3: #FFD23F;
	--accent-4: #34B27A;
	--accent-5: #8B5CF6;
	--line: var(--ink);
	--radius-sm: 8px;
	--radius-md: 14px;
	--radius-lg: 20px;
	--shadow-sm: 3px 3px 0 var(--ink);
	--shadow-md: 5px 5px 0 var(--ink);
	--shadow-lg: 7px 7px 0 var(--ink);
	--border: 2.5px solid var(--ink);
	--font-display: 'Space Grotesk', sans-serif;
	--font-shout: 'Archivo Black', sans-serif;
	--font-body: 'Inter', sans-serif;
	--max-width: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 700;
	margin: 0 0 0.4em;
	letter-spacing: -0.01em;
}

.gh-wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Utility: the tactile "pressable" shadow interaction used on every button/card */
.gh-pressable {
	border: var(--border);
	box-shadow: var(--shadow-md);
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.gh-pressable:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.gh-pressable:active { transform: translate(2px, 2px); box-shadow: none; }

/* ============================================================
   Header
   ============================================================ */
.gh-header {
	position: sticky;
	top: 0;
	z-index: 40;
	background: var(--paper-alt);
	border-bottom: 3px solid var(--ink);
}

.gh-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 0;
	gap: 20px;
	position: relative;
}

.gh-logo {
	font-family: var(--font-shout);
	font-size: 1.3rem;
	display: flex;
	align-items: center;
	gap: 12px;
}

.gh-logo-mark {
	position: relative;
	width: 34px;
	height: 34px;
	border-radius: 9px;
	background: var(--accent);
	border: 2.5px solid var(--ink);
	transform: rotate(-8deg);
	display: inline-block;
	flex-shrink: 0;
}
.gh-logo-mark::after {
	content: '';
	position: absolute;
	top: 50%; left: 50%;
	width: 11px; height: 11px;
	background: var(--accent-3);
	border: 2px solid var(--ink);
	border-radius: 50%;
	transform: translate(-50%, -50%);
}

.gh-nav-toggle {
	display: none;
	background: var(--paper-alt);
	border: var(--border);
	border-radius: var(--radius-sm);
	color: var(--ink);
	padding: 7px 10px;
	font-size: 1.1rem;
	cursor: pointer;
	box-shadow: var(--shadow-sm);
}

.gh-nav {
	display: flex;
	gap: 8px;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 0.98rem;
}

.gh-nav a {
	padding: 8px 14px;
	border-radius: 999px;
	border: 2.5px solid transparent;
	transition: border-color 0.12s ease, background 0.12s ease;
}
.gh-nav a:hover, .gh-nav a.current {
	border-color: var(--ink);
	background: var(--accent-3);
}

@media (max-width: 780px) {
	.gh-nav-toggle { display: inline-flex; }
	.gh-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--paper-alt);
		flex-direction: column;
		gap: 0;
		border-bottom: 3px solid var(--ink);
		padding: 8px;
	}
	.gh-nav.is-open { display: flex; }
	.gh-nav a { display: block; padding: 12px 14px; }
}

/* ============================================================
   Section scaffolding
   ============================================================ */
.gh-section {
	padding: 48px 0;
	border-bottom: 3px dashed rgba(20,19,31,0.18);
}

.gh-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 24px;
	gap: 16px;
	flex-wrap: wrap;
}

.gh-section-head h2 { font-size: 1.7rem; }

.gh-section-link {
	font-family: var(--font-display);
	font-weight: 700;
	color: var(--ink);
	background: var(--accent-3);
	border: 2.5px solid var(--ink);
	border-radius: 999px;
	padding: 6px 14px;
	white-space: nowrap;
	box-shadow: var(--shadow-sm);
}

/* ============================================================
   Featured hero — poster card with a flat colour caption band
   ============================================================ */
.gh-hero {
	display: grid;
	grid-template-columns: 1.6fr 1fr;
	gap: 24px;
}

.gh-hero-main {
	position: relative;
	border-radius: var(--radius-lg);
	overflow: hidden;
	min-height: 360px;
	background: var(--paper-alt);
	display: flex;
	align-items: flex-end;
	border: var(--border);
	box-shadow: var(--shadow-lg);
	transform: rotate(-0.6deg);
}

.gh-hero-main img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gh-hero-main::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 0%, transparent 52%, var(--ink) 52%, var(--ink) 100%);
}

.gh-hero-content {
	position: relative;
	padding: 28px 30px;
	z-index: 1;
	color: var(--paper);
}

.gh-hero-content .gh-card-tag {
	position: static;
	display: inline-flex;
	margin-bottom: 12px;
	transform: rotate(-3deg);
}

.gh-hero-content h3 {
	font-family: var(--font-shout);
	font-size: 2rem;
	margin-bottom: 12px;
	color: #fff;
}

.gh-hero-cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 6px;
	background: var(--accent);
	color: #fff;
	font-family: var(--font-display);
	font-weight: 700;
	padding: 12px 24px;
	border-radius: 999px;
	border: 2.5px solid var(--paper);
	box-shadow: 4px 4px 0 rgba(0,0,0,0.35);
}

.gh-hero-side {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.gh-hero-side-item {
	display: flex;
	gap: 12px;
	align-items: center;
	background: var(--paper-alt);
	border-radius: var(--radius-md);
	padding: 12px;
	border: var(--border);
	box-shadow: var(--shadow-sm);
	flex: 1;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.gh-hero-side-item:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-md); }

.gh-hero-side-item img, .gh-hero-side-item .gh-card-thumb-fallback {
	width: 72px;
	height: 72px;
	border-radius: var(--radius-sm);
	border: 2px solid var(--ink);
	object-fit: cover;
	flex-shrink: 0;
}

.gh-hero-side-item h4 { font-size: 1rem; margin: 0 0 4px; }
.gh-hero-side-item .gh-card-rating { font-size: 0.85rem; color: var(--ink-soft); }

@media (max-width: 860px) {
	.gh-hero { grid-template-columns: 1fr; }
	.gh-hero-main { transform: none; }
}

/* ============================================================
   Cards + horizontal rows (Popular, Recently Played, Similar)
   ============================================================ */
.gh-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 20px;
}

.gh-row {
	display: flex;
	gap: 18px;
	overflow-x: auto;
	padding: 4px 4px 14px;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
}
.gh-row .gh-card { flex: 0 0 190px; scroll-snap-align: start; }

.gh-card {
	display: block;
	background: var(--paper-alt);
	border: var(--border);
	border-radius: var(--radius-md);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.gh-card:hover { transform: translate(-3px, -3px) rotate(-0.6deg); box-shadow: var(--shadow-md); }

.gh-card-thumb {
	position: relative;
	aspect-ratio: 4 / 3;
	background: var(--paper);
	border-bottom: var(--border);
}
.gh-card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.gh-card-thumb-fallback {
	width: 100%; height: 100%;
	display: flex; align-items: center; justify-content: center;
	font-family: var(--font-shout);
	font-size: 2rem;
	color: var(--ink);
	background: var(--accent-3);
}

.gh-card-tag {
	position: absolute;
	top: 8px;
	left: 8px;
	background: var(--accent-3);
	color: var(--ink);
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	padding: 4px 10px;
	border-radius: 999px;
	border: 2px solid var(--ink);
	transform: rotate(-4deg);
}

.gh-card-body { padding: 13px; }
.gh-card-title { font-size: 1.02rem; margin-bottom: 4px; }
.gh-card-rating { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }

.gh-new-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	background: var(--accent);
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	padding: 4px 9px;
	border-radius: 999px;
	border: 2px solid var(--ink);
	transform: rotate(6deg);
	z-index: 1;
}

.gh-empty-note { color: var(--ink-soft); font-style: italic; }

/* ============================================================
   Category tiles — flat colour blocks, distinct from the card grid
   (background colour is set inline per-tile from front-page.php)
   ============================================================ */
.gh-category-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 16px;
}

.gh-category-tile {
	border-radius: var(--radius-md);
	padding: 22px 16px;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.05rem;
	min-height: 96px;
	display: flex;
	align-items: flex-end;
	border: var(--border);
	box-shadow: var(--shadow-sm);
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.gh-category-tile:hover { transform: translate(-3px,-3px); box-shadow: var(--shadow-md); }

/* ============================================================
   Leaderboard — scoreboard-ticket table, not another card grid
   ============================================================ */
.gh-leaderboard {
	width: 100%;
	border-collapse: collapse;
	border: var(--border);
	border-radius: var(--radius-md);
	overflow: hidden;
	background: var(--paper-alt);
}
.gh-leaderboard th, .gh-leaderboard td {
	text-align: left;
	padding: 13px 14px;
	border-bottom: 2px solid rgba(20,19,31,0.12);
}
.gh-leaderboard th {
	font-family: var(--font-display);
	color: var(--ink);
	font-weight: 700;
	font-size: 0.82rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	background: var(--accent-3);
	border-bottom: var(--border);
}
.gh-leaderboard tbody tr:nth-child(odd) { background: rgba(20,19,31,0.03); }
.gh-leaderboard td.gh-lb-score {
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	color: var(--ink);
}
.gh-leaderboard td.gh-lb-rank {
	font-family: var(--font-display);
	font-weight: 700;
}
.gh-leaderboard tbody tr:nth-child(1) td.gh-lb-rank,
.gh-leaderboard tbody tr:nth-child(2) td.gh-lb-rank,
.gh-leaderboard tbody tr:nth-child(3) td.gh-lb-rank {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px; height: 26px;
	border-radius: 50%;
	border: 2px solid var(--ink);
	margin: 4px 0;
}
.gh-leaderboard tbody tr:nth-child(1) td.gh-lb-rank { background: var(--accent-3); }
.gh-leaderboard tbody tr:nth-child(2) td.gh-lb-rank { background: #E3E1D8; }
.gh-leaderboard tbody tr:nth-child(3) td.gh-lb-rank { background: #F0B884; }

/* ============================================================
   Advertisement slots — honest, clearly labeled placeholders
   ============================================================ */
.gh-ad-slot { margin: 0 0 20px; }
.gh-ad-placeholder {
	border: 2.5px dashed var(--ink);
	border-radius: var(--radius-md);
	min-height: 90px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--paper-alt);
	color: var(--ink-soft);
	font-weight: 600;
	font-size: 0.82rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* ============================================================
   Single game page
   ============================================================ */
.gh-game-page {
	display: grid;
	grid-template-columns: 2.2fr 1fr;
	gap: 30px;
	padding: 36px 0;
}

@media (max-width: 920px) {
	.gh-game-page { grid-template-columns: 1fr; }
}

.gh-game-title { font-family: var(--font-shout); font-size: 1.9rem; margin-bottom: 8px; }
.gh-game-meta { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 20px; display: flex; gap: 14px; flex-wrap: wrap; font-weight: 600; }
.gh-game-meta a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent-3); text-decoration-thickness: 3px; }

.gh-player {
	position: relative;
	background: var(--paper-alt);
	border: var(--border);
	border-radius: var(--radius-lg);
	padding: 14px;
	margin-bottom: 24px;
	box-shadow: var(--shadow-lg);
}

.gh-player-frame-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: var(--radius-md);
	overflow: hidden;
	background: #000;
	border: 2px solid var(--ink);
}

.gh-game-frame, .gh-player-frame-wrap iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.gh-fullscreen-btn {
	position: absolute;
	right: 14px;
	bottom: 14px;
	background: var(--accent-3);
	color: var(--ink);
	border: 2.5px solid var(--ink);
	border-radius: var(--radius-sm);
	padding: 8px 14px;
	font-family: var(--font-display);
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
	z-index: 2;
	box-shadow: var(--shadow-sm);
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.gh-fullscreen-btn:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-md); }
.gh-fullscreen-btn:active { transform: translate(2px,2px); box-shadow: none; }

.gh-embed-missing { padding: 40px; text-align: center; color: var(--ink-soft); font-weight: 600; }

.gh-poster {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ink);
}
.gh-poster img { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
.gh-poster .gh-card-thumb-fallback { position: absolute; inset: 0; font-size: 3rem; border: 0; }

.gh-play-btn {
	position: relative;
	z-index: 1;
	background: var(--accent);
	color: #fff;
	border: 2.5px solid #fff;
	border-radius: 999px;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.1rem;
	padding: 14px 30px;
	cursor: pointer;
	box-shadow: 4px 4px 0 rgba(0,0,0,0.4);
	transition: transform 0.12s ease;
}
.gh-play-btn:hover { transform: translate(-2px,-2px); }

.gh-panel {
	background: var(--paper-alt);
	border: var(--border);
	border-radius: var(--radius-md);
	padding: 22px;
	margin-bottom: 22px;
	box-shadow: var(--shadow-sm);
}
.gh-panel h2 { font-size: 1.25rem; }
.gh-panel .gh-instructions-body { color: var(--ink-soft); }

/* Rating control */
.gh-rating { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gh-stars { display: flex; gap: 4px; }
.gh-star {
	background: none;
	border: none;
	font-size: 1.7rem;
	line-height: 1;
	color: rgba(20,19,31,0.2);
	cursor: pointer;
	padding: 2px;
	transition: transform 0.1s ease;
}
.gh-star.is-filled, .gh-star.is-hover { color: var(--accent); transform: scale(1.12); }
.gh-rating-summary { color: var(--ink-soft); font-size: 0.9rem; font-weight: 600; }
.gh-rating-thanks { color: var(--accent-4); font-size: 0.9rem; font-weight: 700; }

/* High scores */
.gh-score-form { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.gh-score-form input {
	background: var(--paper);
	border: 2.5px solid var(--ink);
	border-radius: var(--radius-sm);
	padding: 9px 12px;
	color: var(--ink);
	flex: 1;
	min-width: 120px;
	font-family: var(--font-body);
}
.gh-score-form button {
	background: var(--accent-2);
	color: #fff;
	border: 2.5px solid var(--ink);
	border-radius: var(--radius-sm);
	padding: 9px 18px;
	font-family: var(--font-display);
	font-weight: 700;
	cursor: pointer;
	box-shadow: var(--shadow-sm);
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.gh-score-form button:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-md); }
.gh-score-form button:active { transform: translate(2px,2px); box-shadow: none; }

/* Sidebar */
.gh-sidebar-heading {
	font-size: 0.8rem;
	color: var(--ink-soft);
	font-family: var(--font-display);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 12px;
}

/* ============================================================
   Footer
   ============================================================ */
.gh-footer {
	padding: 34px 0 54px;
	color: var(--ink-soft);
	font-size: .9rem;
	text-align: center;
	border-top: 3px solid var(--ink);
	background: var(--paper-alt);
	font-weight: 600;
}
