/*
Theme Name: Mined
Theme URI: https://example.com/mined
Author: Mined
Description: An extremely light, dark games portal theme. Masonry games grid on the homepage, a wide responsive game player for posts in the Games category, a download layout for Sheet Music, Mods and PDFs, icon menus, and dedicated Ad Placement widget areas for Google AdSense. No jQuery, no web fonts, one small script.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mined
*/

/* ---------- Tokens (edit colors here or in Appearance > Customize > Mined) ---------- */
:root {
	--bg: #0c0d10;
	--surface: #15171b;
	--surface-2: #1d1f25;
	--border: #24262c;
	--accent: #3a3d45;      /* light dark grey accent */
	--accent-hi: #4c5059;
	--text: #ffffff;
	--muted: #9a9ea7;
	--radius: 10px;
	--header-h: 56px;
	--nav-w: 208px;
	--nav-wc: 60px;
	--rail-w: 300px;
	--gap: 10px;
	color-scheme: dark;
}

/* ---------- Light (daytime) palette ----------
   Applied when <html data-theme="light">: automatically during the visitor's daytime,
   or always, depending on Appearance > Customize > Mined > Color mode. */
:root[data-theme="light"] {
	--bg: #f3f4f6;
	--surface: #ffffff;
	--surface-2: #e7e9ed;
	--border: #dcdfe4;
	--accent: #d0d3d9;      /* light grey accent */
	--accent-hi: #bfc3ca;
	--text: #111317;
	--muted: #5d626b;
	color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}
img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--text); }
.entry-content a { text-decoration: underline; text-decoration-color: var(--accent-hi); text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap;
}
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */
.site-header {
	position: fixed; inset: 0 0 auto 0; z-index: 60;
	height: var(--header-h);
	display: flex; align-items: center; gap: 12px;
	padding: 0 16px 0 10px;
	background: var(--bg);
	border-bottom: 1px solid var(--border);
}
.nav-toggle {
	display: grid; place-items: center;
	width: 40px; height: 40px; border: 0; border-radius: 8px;
	background: transparent; color: var(--text);
}
.nav-toggle:hover { background: var(--surface-2); }
.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-name { font-weight: 900; font-size: 21px; letter-spacing: .04em; text-transform: uppercase; font-style: italic; }
.brand img { max-height: 36px; width: auto; }
.header-search {
	flex: 1; max-width: 560px; margin: 0 auto;
	display: flex; align-items: center;
	background: var(--surface-2); border-radius: 999px;
	padding: 0 6px 0 16px; height: 38px;
}
.header-search input {
	flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; height: 100%;
}
.header-search input::placeholder { color: var(--muted); }
.header-search button { border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; width: 32px; height: 32px; }
.header-actions { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.header-actions a {
	display: flex; align-items: center; gap: 6px;
	height: 36px; padding: 0 14px; border-radius: 999px;
	background: var(--surface-2); font-weight: 600; font-size: 14px;
}
.header-actions li:last-child a { background: var(--accent); }
.header-actions a:hover { background: var(--accent-hi); }

/* ---------- Sidebar navigation ---------- */
.site-nav {
	position: fixed; top: var(--header-h); left: 0; bottom: 0; z-index: 50;
	width: var(--nav-w);
	overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
	background: var(--bg);
	border-right: 1px solid var(--border);
	padding: 10px 8px 24px;
	scrollbar-width: thin;
	transition: width .18s ease, transform .2s ease;
}
.nav-menu { list-style: none; margin: 0; padding: 0; }
.nav-menu a {
	display: flex; align-items: center; gap: 12px;
	padding: 6px 10px; min-height: 36px; border-radius: 8px;
	font-weight: 600; font-size: 14.5px; white-space: nowrap;
}
.nav-menu a:hover { background: var(--surface-2); }
.nav-menu .current-menu-item > a,
.nav-menu .current-cat > a { background: var(--accent); }
.nav-menu .sub-menu { display: none; }
.nav-img { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; flex: none; }
.nav-sep { border: 0; border-top: 1px solid var(--border); margin: 10px 6px; }
.nav-heading { color: var(--muted); font-size: 12px; font-weight: 700; padding: 4px 10px 6px; white-space: nowrap; }
.nav-footer { list-style: none; margin: 0; padding: 0 10px; }
.nav-footer a { display: block; color: var(--muted); font-size: 13px; padding: 2px 0; }
.nav-footer a:hover { color: var(--text); }
.nav-copy { color: var(--muted); font-size: 12px; padding: 12px 10px 0; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }

body.nav-collapsed .site-nav { width: var(--nav-wc); }
body.nav-collapsed .nav-label,
body.nav-collapsed .nav-heading,
body.nav-collapsed .nav-footer,
body.nav-collapsed .nav-copy { display: none; }
body.nav-collapsed .nav-menu a { justify-content: center; padding: 6px; }

.nav-scrim { position: fixed; inset: var(--header-h) 0 0 0; background: rgba(0,0,0,.6); z-index: 45; }

/* ---------- Main area ---------- */
.site-main {
	margin-left: var(--nav-w);
	padding: calc(var(--header-h) + 16px) 16px 40px;
	min-height: 100vh;
	transition: margin-left .18s ease;
}
body.nav-collapsed .site-main { margin-left: var(--nav-wc); }

@media (max-width: 900px) {
	.site-nav { width: var(--nav-w) !important; transform: translateX(-100%); }
	body.nav-open .site-nav { transform: none; }
	body.nav-collapsed .nav-label, body.nav-collapsed .nav-heading,
	body.nav-collapsed .nav-footer, body.nav-collapsed .nav-copy { display: revert; }
	body.nav-collapsed .nav-menu a { justify-content: flex-start; padding: 6px 10px; }
	.site-main, body.nav-collapsed .site-main { margin-left: 0; padding: calc(var(--header-h) + 12px) 10px 32px; }
	.header-actions { display: none; }
	.brand-name { font-size: 18px; }
}
@media (max-width: 520px) {
	.brand-name { display: none; }
	.site-header { gap: 8px; padding-right: 10px; }
}

.section-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }
.section-title { font-size: 22px; font-weight: 800; margin: 0; }
.archive-desc { color: var(--muted); margin: -4px 0 14px; max-width: 70ch; }

/* ---------- Buttons & chips ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	height: 40px; padding: 0 18px; border: 0; border-radius: 999px;
	background: var(--accent); color: var(--text); font-weight: 700;
}
.btn:hover { background: var(--accent-hi); }
.btn-icon {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	height: 34px; min-width: 34px; padding: 0 9px; border: 0; border-radius: 8px;
	background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 600;
}
.btn-icon:hover { background: var(--accent-hi); }
.btn-icon.is-active { background: var(--accent); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.chip { flex: none; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: 14px; }
.chip:hover, .chip.is-active { background: var(--accent); }

/* ---------- Masonry games grid (all tiles 16:9) ---------- */
.mined-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	grid-auto-flow: dense;
	gap: var(--gap);
}
@media (max-width: 600px) { .mined-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; } }
.tile {
	position: relative; display: block; overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius);
	background: var(--surface);
	isolation: isolate;
}
.tile.is-large { grid-column: span 2; grid-row: span 2; }
.tile img, .tile-video {
	position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.tile-video { z-index: 1; }
.tile-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.tile-ph .icon { width: 36px; height: 36px; }
.tile-title {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
	padding: 28px 10px 8px;
	background: linear-gradient(transparent, rgba(0,0,0,.85));
	color: #fff; font-weight: 700; font-size: 14px; line-height: 1.25;
	opacity: 0; transform: translateY(4px);
	transition: opacity .15s, transform .15s;
}
.tile:hover .tile-title, .tile:focus-visible .tile-title, .tile.is-large .tile-title { opacity: 1; transform: none; }
.tile.is-large .tile-title { font-size: 18px; padding: 40px 14px 12px; }
.tile:hover { box-shadow: 0 0 0 2px var(--accent-hi); }
.tile-badge {
	position: absolute; top: 6px; left: 6px; z-index: 2;
	padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700;
	background: rgba(12,13,16,.8); color: #fff;
}
@media (hover: none) { .tile-title { opacity: 1; transform: none; } }

.grid-ad { grid-column: 1 / -1; }
.load-more-wrap { display: flex; justify-content: center; margin: 22px 0 6px; }

/* ---------- Ad placements ---------- */
.ad-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto 16px; max-width: 100%; overflow: hidden; }
.ad-slot .ad-unit { width: 100%; display: flex; justify-content: center; }
.ad-label { color: var(--muted); font-size: 11px; margin-top: 3px; align-self: flex-end; }
.ad-empty {
	border: 1px dashed var(--accent-hi); border-radius: 8px; color: var(--muted);
	font-size: 12px; padding: 14px; text-align: center; width: 100%;
}
.ad-empty a { text-decoration: underline; }

/* ---------- Game page ---------- */
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail-w); gap: 16px; align-items: start; }
.game-player { background: var(--surface); border-radius: 12px; overflow: hidden; }
.game-stage-wrap { background: #000; display: flex; justify-content: center; }
.game-stage {
	position: relative;
	width: min(100%, calc((100vh - var(--header-h) - 96px) * var(--ar, 1.7778)));
	aspect-ratio: var(--ar, 1.7778);
	background: #000;
}
.game-stage iframe, .game-stage > embed, .game-stage > object, .game-stage > canvas {
	position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.game-cover {
	position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0;
	background: #000 center / cover no-repeat;
	display: grid; place-items: center; overflow: hidden;
}
.game-cover::before { content: ""; position: absolute; inset: -20px; background: inherit; filter: blur(18px) brightness(.45); }
.game-cover-inner { position: relative; display: grid; justify-items: center; gap: 14px; }
.game-cover-inner img { width: min(320px, 50vw); aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.play-btn {
	display: inline-flex; align-items: center; gap: 8px;
	height: 48px; padding: 0 28px; border-radius: 999px;
	background: var(--text); color: var(--bg); font-weight: 800; font-size: 17px;
}
.play-btn .icon { fill: currentColor; stroke: none; }
.game-cover:hover .play-btn { transform: scale(1.04); }
.game-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.game-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
.game-bar-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.game-bar-title img { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; }
.game-bar-title h1 { font-size: 16px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-actions { display: flex; gap: 6px; }
.game-below-ads { display: flex; gap: 16px; justify-content: center; align-items: flex-start; flex-wrap: wrap; margin: 16px 0 4px; }
.game-below-ads .ad-slot { margin: 0; flex: 0 1 auto; }
.game-below-ads .ad-slot:first-child { flex: 1 1 480px; max-width: 760px; }
.game-rail { position: sticky; top: calc(var(--header-h) + 16px); }
.rail-title { font-size: 16px; font-weight: 800; margin: 4px 0 10px; }
.rail-list { display: grid; gap: var(--gap); }
.rail-list .tile-title { opacity: 1; transform: none; }

body.game-fs .game-stage { position: fixed; inset: 0; z-index: 100; width: 100vw; height: 100vh; aspect-ratio: auto; }
body.game-fs .fs-close { display: flex; }
.fs-close { display: none; position: fixed; top: 10px; right: 10px; z-index: 101; }

@media (max-width: 1100px) {
	.game-layout { grid-template-columns: 1fr; }
	.game-rail { position: static; }
	.rail-list { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (max-width: 600px) {
	.game-stage { width: 100%; }
	.game-actions .btn-label { display: none; }
}

/* ---------- Content ---------- */
.card { background: var(--surface); border-radius: 12px; padding: 20px 22px; }
.entry-content { max-width: 78ch; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content img, .entry-content figure { border-radius: 8px; }
.entry-content blockquote { margin: 1em 0; padding-left: 14px; border-left: 3px solid var(--accent-hi); color: var(--muted); }
.entry-content pre, .entry-content code { background: var(--surface-2); border-radius: 6px; }
.entry-content pre { padding: 12px; overflow-x: auto; }
.entry-content table { border-collapse: collapse; width: 100%; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 6px 10px; }
.content-block { margin-top: 16px; }
.breadcrumbs { color: var(--muted); font-size: 13px; margin: 12px 2px; }
.breadcrumbs a { color: var(--text); font-weight: 600; }
.breadcrumbs a:hover { text-decoration: underline; }
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.alignleft { float: left; margin: 0 1em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1em; }
.aligncenter { display: block; margin: 0 auto; }
.wp-caption-text, figcaption { color: var(--muted); font-size: 13px; }

/* ---------- Download page (Sheet Music, Mods, PDFs) ---------- */
.dl-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail-w); gap: 16px; align-items: start; max-width: 1280px; }
.dl-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; background: var(--surface); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.dl-thumb img { width: 100%; border-radius: 8px; display: block; }
.dl-thumb-ph {
	aspect-ratio: 3/4; border-radius: 8px; background: var(--surface-2);
	display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); font-weight: 800;
}
.dl-thumb-ph .icon { width: 34px; height: 34px; }
.dl-info h1 { font-size: 26px; margin: 4px 0 12px; }
.dl-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.dl-cats a { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); }
.dl-meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 18px; font-size: 14px; }
.dl-meta dt { color: var(--muted); }
.dl-meta dd { margin: 0; font-weight: 600; }
.btn-download { height: 48px; padding: 0 24px; border-radius: 12px; font-size: 16px; }
.btn-download small { font-weight: 500; color: var(--muted); font-size: 13px; }
.dl-rail { position: sticky; top: calc(var(--header-h) + 16px); }
.dl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.dl-item { display: flex; gap: 12px; padding: 10px; background: var(--surface); border-radius: var(--radius); align-items: flex-start; }
.dl-item:hover { box-shadow: 0 0 0 2px var(--accent-hi); }
.dl-item-thumb { width: 64px; flex: none; }
.dl-item-thumb img { width: 64px; height: 84px; object-fit: cover; border-radius: 6px; display: block; }
.dl-item-thumb .dl-thumb-ph { width: 64px; height: 84px; aspect-ratio: auto; font-size: 11px; }
.dl-item-thumb .dl-thumb-ph .icon { width: 22px; height: 22px; }
.dl-item h3 { font-size: 15px; margin: 0 0 4px; }
.dl-item p { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dl-item-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.rail-list.dl-list { grid-template-columns: 1fr; }
@media (max-width: 1100px) { .dl-layout { grid-template-columns: 1fr; } .dl-rail { position: static; } }
@media (max-width: 600px) { .dl-card { grid-template-columns: 90px minmax(0, 1fr); gap: 14px; padding: 14px; } .dl-info h1 { font-size: 20px; } .dl-meta { grid-template-columns: 1fr 1fr; } }

/* ---------- Standard post / page ---------- */
.standard { max-width: 860px; }
.standard .post-hero img { border-radius: 12px; width: 100%; margin-bottom: 16px; }
.standard h1 { font-size: 30px; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.pagination .page-numbers { padding: 6px 12px; border-radius: 8px; background: var(--surface-2); }
.pagination .current { background: var(--accent); }
.comments-area { margin-top: 16px; }
.comments-area input:not([type=submit]):not([type=checkbox]), .comments-area textarea {
	width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}
.comments-area input[type=submit] { border: 0; border-radius: 999px; background: var(--accent); padding: 8px 18px; font-weight: 700; }
.empty-state { color: var(--muted); padding: 30px 0; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
.post-tags a { padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.post-tags a:hover { background: var(--accent); }
.game-stage:fullscreen { aspect-ratio: auto; width: 100%; }
