/*
Theme Name: FapBox
Description: Catalog theme for the FapBox game directory. Requires the FapBox Core plugin for the content model.
Version: 2.0.0
Text Domain: fapbox
*/

/*
 * Design note: in this catalog the cover art is the product. Everything here
 * is arranged so the artwork is the largest, brightest thing on screen and
 * the interface gets out of its way - dense grid, minimal chrome, metadata
 * layered onto the art rather than parked in a box underneath it.
 *
 * Type is one superfamily on a width axis: Archivo condensed for titles that
 * must fit a narrow card, expanded for rail headings. One font file, two
 * distinct voices.
 */

:root {
	/* Deep wine-black rather than neutral: the ground should feel like a
	   dim room, not a terminal. */
	--bg:        #0D0810;
	--bg-2:      #130C16;
	--surface:   #1A1119;
	--surface-2: #241823;
	--line:      #2E1F2A;
	--line-hi:   #45303D;
	--ink:       #F8F1F5;
	--ink-mid:   #CDB8C4;
	--mute:      #96808C;
	--accent:    #E8265C;
	--accent-hi: #FF5C87;
	--accent-dim:#5E1129;
	--accent-grad: linear-gradient(135deg, #FF4E7D 0%, #D01E58 100%);
	--brass:     #F0B84B;

	/* Corners are soft everywhere; the artwork is the only thing allowed
	   to have hard edges. */
	--radius:    10px;
	--radius-lg: 16px;
	--radius-pill: 999px;

	--glow: 0 0 0 1px rgba(232, 38, 92, .55), 0 14px 40px rgba(232, 38, 92, .20);
	--lift: 0 10px 30px rgba(0, 0, 0, .45);

	--w:   1560px;
	--gap: 14px;
}

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 15.5px;
	line-height: 1.62;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent-hi); text-decoration: none; }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.1; text-wrap: balance; }

/* Rail headings: expanded, uppercase, tight - reads as a storefront shelf label. */
.rail-title {
	font-size: clamp(1rem, 1.6vw, 1.22rem);
	font-stretch: 112%;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

h1 {
	font-size: clamp(1.8rem, 3.4vw, 2.6rem);
	font-stretch: 108%;
	letter-spacing: -0.015em;
}
h2 { font-size: 1.2rem; font-stretch: 108%; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--w); margin: 0 auto; padding: 0 22px; }
/* The key art breaks out to 100vw, which is wider than the content box
   whenever a vertical scrollbar is showing. Clipped here so that overhang
   cannot give the whole page a horizontal scrollbar. `clip` rather than
   `hidden`: hidden would turn .wrap into a scroll container and break
   position: sticky in the header. */
body { overflow-x: clip; }

/* ---------------------------------------------------------- header ---- */
.site-header {
	position: sticky; top: 0; z-index: 40;
	background: rgba(11, 7, 9, 0.88);
	backdrop-filter: saturate(140%) blur(10px);
	border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 26px; height: 56px; }

.brand {
	font-size: 1.18rem; font-weight: 700; font-stretch: 118%;
	letter-spacing: -0.02em; color: var(--ink); white-space: nowrap;
}
.brand span { color: var(--accent); }
.brand:hover { color: var(--ink); }

.nav { display: flex; gap: 20px; flex: 1; }
.nav a {
	color: var(--ink-mid); font-size: 0.76rem; font-weight: 600;
	text-transform: uppercase; letter-spacing: 0.09em;
	padding: 4px 0; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a.is-active { color: var(--ink); border-bottom-color: var(--accent); }

.search-form { display: flex; }
.search-form input {
	background: var(--surface-2); border: 1px solid var(--line);
	border-right: 0; color: var(--ink); font: inherit; font-size: 0.84rem;
	padding: 9px 16px; width: 210px;
	border-radius: var(--radius-pill) 0 0 var(--radius-pill);
}
.search-form input::placeholder { color: var(--mute); }
.search-form input:focus { outline: none; border-color: var(--line-hi); }
.search-form button {
	background: var(--accent); border: 1px solid var(--accent); color: #fff;
	font: inherit; font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
	letter-spacing: 0.07em; padding: 9px 18px; cursor: pointer;
	border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
}
.search-form button:hover { background: var(--accent-hi); border-color: var(--accent-hi); }

.nav-toggle { display: none; background: none; border: 0; color: var(--ink); font-size: 1.35rem; cursor: pointer; }

@media (max-width: 940px) {
	.nav {
		display: none; position: absolute; top: 56px; left: 0; right: 0;
		flex-direction: column; gap: 14px; padding: 16px 22px;
		background: var(--bg-2); border-bottom: 1px solid var(--line);
	}
	.nav.is-open { display: flex; }
	.nav-toggle { display: block; order: 3; }
	.search-form input { width: 130px; }
}

/* ------------------------------------------------------- page furniture */
main.wrap { padding-top: 26px; padding-bottom: 60px; }

.page-head { margin-bottom: 22px; }
.eyebrow {
	font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em;
	text-transform: uppercase; color: var(--accent); margin: 0 0 9px;
}
.page-head .lede { color: var(--ink-mid); max-width: 60ch; margin: 10px 0 0; font-size: 0.95rem; }
.count { color: var(--mute); font-size: 0.8rem; margin: 8px 0 0; }

.section { margin: 34px 0; }
.section:first-of-type { margin-top: 0; }
.section-head {
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px; margin-bottom: 13px;
	padding-bottom: 9px; border-bottom: 1px solid var(--line);
}
.section-head a { font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
	letter-spacing: 0.09em; color: var(--mute); white-space: nowrap; }
.section-head a:hover { color: var(--accent-hi); }

/* --------------------------------------------------------------- grid -- */
.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
	gap: var(--gap);
}

/*
 * The card IS the artwork. A 5:4 box matches what itch.io and most stores
 * ship, so covers land uncropped instead of losing their top and bottom.
 */
.card { position: relative; }

.card-link {
	display: block; position: relative;
	aspect-ratio: 5 / 4;
	background: var(--surface-2);
	border-radius: var(--radius-lg);
	overflow: hidden;
	color: var(--ink);
	box-shadow: 0 0 0 1px var(--line);
	transition: box-shadow .22s ease, transform .22s ease;
}
.card-link:hover,
.card-link:focus-visible {
	box-shadow: var(--glow);
	transform: translateY(-3px);
	color: var(--ink);
}

.card-art { position: absolute; inset: 0; }
.card-art img {
	width: 100%; height: 100%; object-fit: cover;
	transition: transform .35s cubic-bezier(.2, .7, .3, 1);
}
.card-link:hover .card-art img { transform: scale(1.045); }

.card-ph {
	width: 100%; height: 100%; display: grid; place-items: center;
	background: linear-gradient(150deg, var(--surface-2), var(--bg-2));
	color: var(--line-hi); font-size: 2.4rem; font-weight: 700; font-stretch: 118%;
}

/* Scrim keeps the title legible over any artwork, bright or dark. */
.card-scrim {
	position: absolute; left: 0; right: 0; bottom: 0;
	padding: 30px 12px 11px;
	background: linear-gradient(to top,
		rgba(6, 4, 5, .94) 0%,
		rgba(6, 4, 5, .78) 45%,
		rgba(6, 4, 5, 0) 100%);
}
.card-title {
	font-size: 0.9rem; font-weight: 600; font-stretch: 92%;
	line-height: 1.22; letter-spacing: 0.005em;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
	overflow: hidden;
}

/* Secondary metadata is there when wanted, not competing when not. */
.card-meta {
	display: flex; flex-wrap: wrap; gap: 3px 9px;
	font-size: 0.7rem; color: var(--ink-mid);
	max-height: 0; opacity: 0; overflow: hidden;
	transition: max-height .18s ease, opacity .18s ease, margin-top .18s ease;
}
.card-link:hover .card-meta,
.card-link:focus-visible .card-meta { max-height: 2.4em; opacity: 1; margin-top: 3px; }
.card-meta .dev { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.badge {
	position: absolute; top: 10px; left: 10px; z-index: 2;
	background: var(--accent-grad); color: #fff;
	font-size: 0.61rem; font-weight: 700; letter-spacing: 0.09em;
	text-transform: uppercase; padding: 4px 9px; border-radius: var(--radius-pill);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}
.badge.own { background: linear-gradient(135deg, #FFD37A, #E0A238); color: #241905; }

@media (hover: none) {
	/* No hover on touch: show the metadata rather than hiding it forever. */
	.card-meta { max-height: 2.4em; opacity: 1; margin-top: 3px; }
}

/* -------------------------------------------------------------- chips -- */
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
	font-size: 0.74rem; font-weight: 500; color: var(--ink-mid);
	background: var(--surface); border: 1px solid var(--line);
	padding: 5px 13px; border-radius: var(--radius-pill); white-space: nowrap;
	transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent-hi); background: var(--surface-2); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .n { color: var(--mute); font-variant-numeric: tabular-nums; margin-left: 4px; }

/* ------------------------------------------------------------ filters -- */
.filters {
	display: flex; flex-direction: column; gap: 9px;
	margin-bottom: 22px; padding-bottom: 16px;
	border-bottom: 1px solid var(--line);
}
.filter-row { display: flex; gap: 10px; align-items: baseline; }
.filter-row > b {
	flex: 0 0 74px;
	font-size: 0.64rem; font-weight: 700; letter-spacing: 0.13em;
	text-transform: uppercase; color: var(--mute); padding-top: 4px;
}
@media (max-width: 640px) {
	.filter-row { flex-direction: column; gap: 5px; }
	.filter-row > b { flex: none; }
}

/* -------------------------------------------------------- single game -- */
.game-layout {
	display: grid; grid-template-columns: minmax(0, 1fr) 316px;
	gap: 38px; align-items: start;
}
@media (max-width: 980px) { .game-layout { grid-template-columns: 1fr; gap: 26px; } }

/* ---- key art -------------------------------------------------------
   Full bleed: edge to edge of the window, not of the content column. Boxed
   inside the container it read as a banner someone had dropped onto the
   page; running to the edges it reads as the page's own backdrop.

   100vw plus a negative margin back to the viewport's left edge is the one
   technique that survives whatever padding the container happens to have.
   overflow-x is clipped on the page shell so the 100vw cannot create a
   horizontal scrollbar when a vertical one is present. */
.game-keyart {
	position: relative;
	width: 100vw; margin-left: calc(50% - 50vw);
	height: 360px; overflow: hidden;
	margin-top: calc(var(--gap) * -1);
	pointer-events: none;
}
.game-keyart img {
	width: 100%; height: 100%; object-fit: cover; object-position: center 26%;
	opacity: .5;
}
.game-keyart::after {
	content: ""; position: absolute; inset: 0;
	background:
		linear-gradient(to top, var(--bg) 0%, var(--bg) 12%, rgba(13,8,16,.42) 60%, rgba(13,8,16,.10) 100%),
		linear-gradient(to right, rgba(13,8,16,.72) 0%, rgba(13,8,16,.24) 46%, rgba(13,8,16,0) 84%);
}
.game-layout.has-keyart { position: relative; z-index: 1; margin-top: -278px; }
@media (max-width: 980px) {
	.game-keyart { height: 250px; }
	.game-layout.has-keyart { margin-top: -196px; }
}
@media (max-width: 620px) {
	.game-keyart { height: 200px; }
	.game-layout.has-keyart { margin-top: -158px; }
}

/* ---- gallery -------------------------------------------------------
   One rail holding the trailer and every screenshot, scrolled sideways.
   Two separate presentations of the same pictures on one page was the
   thing that looked unfinished.

   Every tile is a button: clicking one opens the viewer, video included,
   so the whole gallery behaves the same way throughout. */
.game-media {
	display: grid; grid-auto-flow: column; grid-auto-columns: 348px;
	gap: 18px; overflow-x: auto;
	padding: 4px 4px 16px; margin: 0 -4px var(--gap);
	scroll-snap-type: x proximity;
	scrollbar-width: thin; scrollbar-color: var(--line-hi) transparent;
}
.media-item {
	position: relative; display: block; margin: 0; padding: 0; border: 0;
	aspect-ratio: 16 / 9; overflow: hidden; cursor: zoom-in;
	background: #0B0710; border-radius: var(--radius-lg);
	box-shadow: 0 0 0 1px var(--line), var(--lift);
	scroll-snap-align: start;
}
.media-item img {
	display: block; width: 100%; height: 100%; object-fit: cover;
	transition: transform .35s cubic-bezier(.2,.7,.3,1);
}
.media-item:hover img { transform: scale(1.05); }
.media-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* The trailer tile: a still with a play badge, not an inline player. It has
   to look like something you open, because that is what it does. */
.media-item.is-video { cursor: pointer; }
.media-item.is-video::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(to top, rgba(6,3,6,.55), rgba(6,3,6,.08));
}
.media-play {
	position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
	z-index: 1; width: 66px; height: 66px; border-radius: 50%;
	display: grid; place-items: center; color: #fff;
	background: var(--accent-grad);
	box-shadow: 0 10px 30px rgba(232, 38, 92, .45);
	transition: transform .25s cubic-bezier(.2,.7,.3,1);
}
.media-item.is-video:hover .media-play { transform: translate(-50%, -50%) scale(1.08); }
.media-play svg { margin-left: 3px; }

@media (max-width: 620px) {
	.game-media { grid-auto-columns: 78vw; gap: 12px; }
}

/* A panel whose text came from the store, not from us. Said quietly, but
   said - the visitor should always be able to tell which is which. */
.panel-note {
	margin: 0; padding: 10px 18px 14px;
	font-size: 0.74rem; color: var(--mute);
}

.game-hero { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 24px; }
.game-cover {
	width: 224px; flex: 0 0 224px; border-radius: var(--radius-lg);
	overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 18px 44px rgba(0,0,0,.55);
}
.game-cover img { aspect-ratio: 5 / 4; object-fit: cover; width: 100%; }
@media (max-width: 620px) {
	.game-hero { flex-direction: column; }
	.game-cover { width: 168px; flex-basis: auto; }
}

.btn {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%; padding: 15px 22px; cursor: pointer;
	font: inherit; font-size: 0.88rem; font-weight: 700;
	text-transform: uppercase; letter-spacing: 0.09em;
	background: var(--accent-grad); color: #fff; border: 0;
	border-radius: var(--radius); box-shadow: 0 8px 24px rgba(232, 38, 92, .28);
	transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 12px 30px rgba(232, 38, 92, .38); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line-hi); color: var(--ink-mid); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent-hi); box-shadow: none; }
.btn.brass { background: linear-gradient(135deg, #FFD37A, #E0A238); color: #241905; box-shadow: 0 8px 24px rgba(240, 184, 75, .26); }
.btn.brass:hover { color: #241905; box-shadow: 0 12px 30px rgba(240, 184, 75, .34); }

.facts { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.facts .row {
	display: grid; grid-template-columns: 104px 1fr; gap: 12px;
	padding: 11px 20px; border-bottom: 1px solid var(--line); font-size: 0.85rem;
}
.facts .row:last-child { border-bottom: 0; }
.facts dt { color: var(--mute); margin: 0; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; padding-top: 2px; }
.facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.facts dl { margin: 0; }

.prose { color: var(--ink-mid); max-width: 70ch; font-size: 0.95rem; }
.prose h2 { color: var(--ink); margin: 30px 0 12px; }
.prose ul { padding-left: 1.1em; }
.prose li { margin-bottom: 5px; }

/* --------------------------------------------------------- play modal -- */
.play-overlay {
	position: fixed; inset: 0; z-index: 90; display: none;
	background: rgba(4, 2, 3, .9); padding: 18px;
}
.play-overlay.is-open { display: flex; align-items: center; justify-content: center; }
.play-modal {
	width: min(1240px, 100%); height: min(780px, 100%);
	background: var(--surface); border: 1px solid var(--line-hi);
	border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden;
}
.play-head {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line);
}
.play-head .t { font-weight: 600; font-size: 0.86rem; }
.play-head button {
	background: none; border: 0; color: var(--mute);
	cursor: pointer; font-size: 1rem; padding: 4px 9px;
}
.play-head button:hover { color: var(--ink); }
.play-body { flex: 1; background: #000; }
.play-body iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ----------------------------------------------------------- age gate -- */
.age-gate {
	position: fixed; inset: 0; z-index: 100; padding: 24px;
	background: var(--bg); display: grid; place-items: center;
}
.age-gate .box {
	max-width: 440px; text-align: center;
	display: flex; flex-direction: column; gap: 15px;
	padding: 36px 32px; background: var(--surface);
	border: 1px solid var(--line); border-radius: var(--radius);
}
.age-gate p { margin: 0; color: var(--ink-mid); font-size: 0.9rem; }
.age-gate .actions { display: flex; gap: 9px; }
body.age-locked { overflow: hidden; }

/* --------------------------------------------------------- pagination -- */
.pagination { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin: 38px 0 0; }
.pagination .page-numbers {
	border-radius: var(--radius-pill) !important; padding: 8px 16px; font-size: 0.83rem; color: var(--ink-mid);
	border: 1px solid var(--line); border-radius: var(--radius);
	font-variant-numeric: tabular-nums;
}
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent-hi); }
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ----------------------------------------------------------- comments -- */
.rating-stars { display: flex; gap: 3px; direction: rtl; justify-content: flex-start; margin-bottom: 12px; }
.rating-stars input { display: none; }
.rating-stars label { cursor: pointer; font-size: 1.3rem; color: var(--line-hi); transition: color .12s; }
.rating-stars input:checked ~ label,
.rating-stars label:hover,
.rating-stars label:hover ~ label { color: var(--brass); }

.comment-list { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.comment-list li {
	background: var(--surface); border: 1px solid var(--line);
	border-radius: var(--radius); padding: 13px 15px;
}
.comment-form input[type=text], .comment-form input[type=email],
.comment-form input[type=url], .comment-form textarea {
	width: 100%; margin-bottom: 9px; padding: 9px 12px;
	background: var(--surface-2); border: 1px solid var(--line);
	border-radius: var(--radius); color: var(--ink); font: inherit; font-size: 0.88rem;
}
.comment-form textarea:focus, .comment-form input:focus { outline: none; border-color: var(--line-hi); }
.comment-form .submit {
	background: var(--accent); border: 1px solid var(--accent); color: #fff;
	font: inherit; font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
	letter-spacing: 0.08em; padding: 10px 20px; border-radius: var(--radius); cursor: pointer;
}
.comment-form .submit:hover { background: var(--accent-hi); }

/* ------------------------------------------------------------- footer -- */
.site-footer {
	border-top: 1px solid var(--line); margin-top: 56px;
	padding: 28px 0 46px; background: var(--bg-2);
	color: var(--mute); font-size: 0.82rem;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 22px 40px; justify-content: space-between; }
.site-footer a { color: var(--mute); }
.site-footer a:hover { color: var(--accent-hi); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; align-content: flex-start; }
.legal { max-width: 58ch; font-size: 0.76rem; line-height: 1.5; margin: 0; }

/* ---------------------------------------------------------- utilities -- */
.stack { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--mute); }
.tabnum { font-variant-numeric: tabular-nums; }
.screen-reader-text {
	position: absolute; width: 1px; height: 1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
	html { scroll-behavior: auto; }
	.card-link:hover { transform: none; }
	.card-link:hover .card-art img { transform: none; }
}

/* Rail headings apply wherever a section header sits, without every template
   having to remember a class name. */
.section-head h2,
.section-head .rail-title {
	font-size: clamp(1rem, 1.6vw, 1.2rem);
	font-stretch: 112%;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

/*
 * Curated rows scroll sideways instead of wrapping. A wrapping grid of 12
 * gives eight tiles and then a ragged four, which reads as a mistake; a rail
 * always ends flush and lets a section hold more than one screenful.
 */
.grid.rail {
	grid-template-columns: none;
	grid-auto-flow: column;
	/* A fixed track, not 1fr: with 1fr a short rail stretches its cards to
	   fill the row and ends up looking like a different component from the
	   rail above it. Every shelf should read at the same scale. */
	grid-auto-columns: 196px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	/* overflow-x also clips vertically, which cut the hover glow and the
	   lifted card off at the rail's edges. Padding gives them room; the
	   negative margin keeps the row aligned with everything else. */
	padding: 12px 6px 16px;
	margin: -12px -6px 0;
	scrollbar-width: thin;
	scrollbar-color: var(--line-hi) transparent;
}
.grid.rail .card { scroll-snap-align: start; }
/* One fixed track for every rail. minmax() let a long rail shrink to its
   minimum while a short one stayed at its maximum, so two shelves on the
   same page rendered at different scales. */
@media (max-width: 720px) { .grid.rail { grid-auto-columns: 158px; } }
.grid.rail::-webkit-scrollbar { height: 8px; }
.grid.rail::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 4px; }
.grid.rail::-webkit-scrollbar-track { background: transparent; }

/* The front page leads with product, not with a masthead. */
.home .page-head { margin-bottom: 26px; }
.home .page-head h1 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); }

/* ---------------------------------------------------------- downloads -- */
.downloads {
	border: 1px solid var(--line); border-radius: var(--radius);
	background: var(--surface); overflow: hidden;
}
.downloads-head {
	padding: 9px 14px; border-bottom: 1px solid var(--line);
	font-size: 0.68rem; font-weight: 700; letter-spacing: 0.13em;
	text-transform: uppercase; color: var(--mute);
}
.dl {
	display: block; padding: 11px 20px; border-bottom: 1px solid var(--line);
	color: var(--ink); font-size: 0.83rem;
}
.dl:last-of-type { border-bottom: 0; }
.dl:hover { background: var(--surface-2); color: var(--ink); }
.dl-name {
	display: block; overflow: hidden; text-overflow: ellipsis;
	white-space: nowrap; font-weight: 500;
}
.dl-meta { display: flex; gap: 10px; font-size: 0.72rem; color: var(--mute); margin-top: 2px; }
.dl-os { color: var(--ink-mid); }
.downloads-note {
	margin: 0; padding: 10px 20px 12px; border-top: 1px solid var(--line);
	font-size: 0.7rem; color: var(--mute); line-height: 1.4;
}

/* -------------------------------------------------------------- panels --
 * The game page is a set of labelled blocks, not one column of prose.
 * Each answers a different question, so each gets its own frame and a
 * header you can find by scanning rather than reading.
 */
.panel {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	margin-bottom: var(--gap);
	overflow: hidden;
}
.panel-head {
	display: flex; align-items: center; gap: 8px;
	padding: 13px 20px; border-bottom: 1px solid var(--line);
	background: transparent;
	font-size: 0.68rem; font-weight: 700; letter-spacing: 0.13em;
	text-transform: uppercase; color: var(--ink-mid);
}
.panel-head svg { width: 14px; height: 14px; flex: none; color: var(--accent); }
.panel-body { padding: 18px 20px; }

/* The one-line answer to "what is this game" - sized to be read first. */
.panel.summary .panel-body {
	font-size: 1.08rem; line-height: 1.55; color: var(--ink); font-weight: 500;
}
.panel.overview .panel-body { color: var(--ink-mid); font-size: 0.94rem; }
.panel.overview p:last-child { margin-bottom: 0; }

/* Features are a checklist, not a paragraph - two columns, no bullets. */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.feature {
	display: flex; gap: 10px; align-items: flex-start;
	background: var(--surface-2); border: 1px solid var(--line);
	border-radius: var(--radius); padding: 12px 15px;
	font-size: 0.88rem; color: var(--ink-mid);
}
.feature::before {
	content: ""; flex: none; width: 5px; height: 5px; margin-top: 7px;
	border-radius: 50%; background: var(--accent);
}

/* Source text is kept verbatim and clearly demoted: it is evidence, not copy. */
.panel.source .panel-body { color: var(--mute); font-size: 0.88rem; }
.panel.source .panel-body a { color: var(--ink-mid); text-decoration: underline; }
.panel.source .panel-body p:last-child { margin-bottom: 0; }

.panel .facts, .panel .downloads { border: 0; border-radius: 0; background: transparent; }
.panel .facts .row:last-child { border-bottom: 0; }

/* The developer's original text is reference material, not the page's copy.
   Collapsed by default so the rewrite leads and the source stays available. */
.panel.source .panel-body { padding: 0; }
.source-details summary {
	list-style: none; cursor: pointer;
	padding: 14px 20px; color: var(--ink-mid); font-size: 0.86rem;
	display: flex; align-items: center; gap: 8px;
}
.source-details summary::-webkit-details-marker { display: none; }
.source-details summary::before {
	content: "+"; width: 18px; height: 18px; flex: none;
	display: grid; place-items: center; border-radius: 50%;
	background: var(--surface-2); border: 1px solid var(--line-hi);
	font-size: 0.8rem; line-height: 1; color: var(--accent);
}
.source-details[open] summary::before { content: "\2212"; }
.source-details summary:hover { color: var(--ink); }
.source-details .source-text { padding: 2px 20px 18px; }
.source-details .source-text p { margin: 0 0 0.9em; }
.source-details .source-text p:last-child { margin-bottom: 0; }

/* ----------------------------------------------------------- term hub -- */
.term-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: var(--gap);
	margin-bottom: 34px;
}
.term-card {
	display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
	padding: 16px 18px; background: var(--surface);
	border: 1px solid var(--line); border-radius: var(--radius-lg);
	color: var(--ink); transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.term-card:hover {
	border-color: transparent; box-shadow: var(--glow);
	transform: translateY(-2px); color: var(--ink);
}
.term-name { font-weight: 600; font-size: 0.98rem; font-stretch: 104%; }
.term-count { color: var(--mute); font-size: 0.82rem; }

/* =====================================================================
 * Ambient ground
 *
 * Two fixed blooms behind everything. They give the page depth without
 * putting anything on it: the artwork stays the only real colour, and the
 * background reads as a lit room rather than a flat panel.
 * ===================================================================== */
@keyframes fapbox-drift {
	0%   { transform: translate3d(0, 0, 0) scale(1); }
	50%  { transform: translate3d(-3%, 2%, 0) scale(1.08); }
	100% { transform: translate3d(0, 0, 0) scale(1); }
}

body::before {
	content: "";
	position: fixed; inset: -20%; z-index: -2; pointer-events: none;
	/* Slow enough to be felt rather than watched - a room where the light
	   shifts, not a screensaver. */
	animation: fapbox-drift 44s ease-in-out infinite;
	background:
		radial-gradient(56vw 46vw at 12% -6%, rgba(232, 38, 92, .16), transparent 62%),
		radial-gradient(48vw 40vw at 92% 8%, rgba(126, 44, 214, .13), transparent 66%),
		radial-gradient(70vw 50vw at 50% 108%, rgba(232, 38, 92, .08), transparent 70%);
}

/* Fine grain stops the large flat areas from banding on dark screens. */
body::after {
	content: "";
	position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .035;
	background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'>\
<filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter>\
<rect width='140' height='140' filter='url(%23n)'/></svg>");
}

/* ---------------------------------------------------------------- hero */
.hero {
	position: relative;
	margin: -26px -22px 30px;
	padding: 66px 22px 52px;
	overflow: hidden;
	border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: var(--w); margin: 0 auto; position: relative; z-index: 2; }

/* Real covers, blurred into a backdrop. Decoration made of inventory. */
.hero-art {
	position: absolute; inset: -12% -4%; z-index: 0;
	display: grid; grid-auto-flow: column; grid-auto-columns: 15%;
	gap: 10px; opacity: .30;
	filter: blur(26px) saturate(135%);
	transform: rotate(-4deg) scale(1.12);
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; border-radius: 24px; }
.hero::after {
	content: ""; position: absolute; inset: 0; z-index: 1;
	background: linear-gradient(180deg,
		rgba(13, 8, 16, .72) 0%,
		rgba(13, 8, 16, .86) 55%,
		var(--bg) 100%);
}

.hero h1 {
	font-size: clamp(2.2rem, 4.4vw, 3.4rem);
	font-stretch: 116%;
	letter-spacing: -0.03em;
	line-height: 0.98;
}
.hero-lede {
	margin: 14px 0 0; max-width: 54ch;
	font-size: 1.06rem; color: var(--ink-mid);
}
.hero-stats {
	display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 22px;
	font-size: 0.86rem; color: var(--mute);
}
.hero-stats b {
	color: var(--ink); font-size: 1.24rem; font-weight: 700;
	font-stretch: 110%; margin-right: 6px;
}

@media (max-width: 700px) {
	.hero { padding: 46px 22px 38px; }
	.hero-art { grid-auto-columns: 28%; }
}

/* Shelf subtitles: a curated row should say why it is curated. */
.section-head > div { display: flex; flex-direction: column; gap: 3px; }
.section-lede { margin: 0; font-size: 0.82rem; color: var(--mute); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ------------------------------------------------------- scrollbars --
 * Every horizontal scroller gets the same treatment. The default one is a
 * bright bar on a dark page and it was the loudest thing on the screen.
 */
.grid.rail, .game-media, .table-scroll {
	scrollbar-width: thin;
	scrollbar-color: var(--line-hi) transparent;
}
.grid.rail::-webkit-scrollbar,
.game-media::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar { height: 6px; }
.grid.rail::-webkit-scrollbar-track,
.game-media::-webkit-scrollbar-track,
.table-scroll::-webkit-scrollbar-track { background: transparent; }
.grid.rail::-webkit-scrollbar-thumb,
.game-media::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb {
	background: var(--line-hi); border-radius: var(--radius-pill);
}
.grid.rail:hover::-webkit-scrollbar-thumb,
.game-media:hover::-webkit-scrollbar-thumb { background: var(--accent-dim); }

/* --------------------------------------------------------- reveal ---
 * Sections rise into place once, on first sight. The hidden state is
 * applied only when JavaScript is running, so a failed script leaves a
 * readable page rather than an empty one.
 */
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.is-visible {
	opacity: 1; transform: none;
	transition: opacity .5s cubic-bezier(.2, .7, .3, 1), transform .5s cubic-bezier(.2, .7, .3, 1);
}

@media (prefers-reduced-motion: reduce) {
	.js .reveal, .js .reveal.is-visible { opacity: 1; transform: none; transition: none; }
	body::before, .hero-art { animation: none; }
}

/* ---------------------------------------------------------- spotlight --
 * The hero used to be an empty rectangle with a blur behind it. It is now
 * the most valuable slot on the site: our own titles first, then a paid
 * placement, then an editorial pick. Never decoration.
 */
/*
 * The hero is an explicit five-cell layout, not a flow. Column widths and
 * row spans come from the sketch: wordmark top left, a short wide tile top
 * right, a tall narrow one between them, the biggest block bottom right,
 * a small one under the wordmark, spotlight down the full right edge.
 * Every tile names its own cell, so nothing moves when content changes.
 */
.hero-inner {
	display: grid;
	grid-template-columns:
		minmax(0, 2fr)      /* wordmark + tile-d */
		minmax(0, 0.82fr)   /* tile-b, tall and narrow */
		minmax(0, 1.85fr)   /* tile-a and tile-c */
		minmax(0, 452px);   /* spotlight */
	grid-template-rows: 118px 104px 140px;
	gap: 12px 16px;
}

.hero-copy  { grid-column: 1; grid-row: 1 / 3; align-self: center; }
.hero-tile.tile-a { grid-column: 3; grid-row: 1; }
.hero-tile.tile-b { grid-column: 2; grid-row: 2 / 4; }
.hero-tile.tile-c { grid-column: 3; grid-row: 2 / 4; }
.hero-tile.tile-d { grid-column: 1; grid-row: 3; justify-self: end; width: min(100%, 280px); }
.hero-inner .spotlight { grid-column: 4; grid-row: 1 / 4; }

@media (max-width: 1240px) {
	.hero-inner {
		grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1.6fr);
		grid-template-rows: auto 104px 128px;
	}
	.hero-copy { grid-column: 1 / 4; grid-row: 1; }
	.hero-tile.tile-a { grid-column: 3; grid-row: 2; }
	.hero-tile.tile-b { grid-column: 2; grid-row: 2 / 4; }
	.hero-tile.tile-c { grid-column: 3; grid-row: 3; }
	.hero-tile.tile-d { grid-column: 1; grid-row: 2 / 4; width: auto; justify-self: stretch; }
	.hero-inner .spotlight { grid-column: 1 / 4; grid-row: 4; }
}

@media (max-width: 720px) {
	.hero-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto 92px 92px auto; }
	.hero-copy { grid-column: 1 / 3; grid-row: 1; }
	.hero-tile.tile-a { grid-column: 1 / 3; grid-row: 2; }
	.hero-tile.tile-b { grid-column: 1; grid-row: 3; }
	.hero-tile.tile-c { grid-column: 2; grid-row: 3; }
	.hero-tile.tile-d { grid-column: 1 / 3; grid-row: 4; }
	.hero-inner .spotlight { grid-column: 1 / 3; grid-row: 5; }
}

.spotlight {
	position: relative; display: grid; grid-template-columns: 168px minmax(0, 1fr);
	gap: 18px; padding: 18px; align-items: center;
	background: rgba(26, 17, 25, .72);
	border: 1px solid var(--line-hi);
	border-radius: var(--radius-lg);
	backdrop-filter: blur(14px) saturate(130%);
	color: var(--ink);
	box-shadow: 0 22px 60px rgba(0, 0, 0, .5);
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.spotlight:hover { transform: translateY(-3px); box-shadow: var(--glow); border-color: transparent; color: var(--ink); }
.spotlight.is-own { border-color: rgba(240, 184, 75, .5); }

.spotlight-kind {
	position: absolute; top: -10px; left: 18px;
	background: var(--accent-grad); color: #fff;
	font-size: 0.6rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
	padding: 4px 11px; border-radius: var(--radius-pill);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
.spotlight.is-own .spotlight-kind { background: linear-gradient(135deg, #FFD37A, #E0A238); color: #241905; }

.spotlight-art { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 26px rgba(0,0,0,.45); }
.spotlight-art img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }

.spotlight-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.spotlight-genre { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.spotlight-title { font-size: 1.24rem; font-weight: 700; font-stretch: 106%; line-height: 1.15; }
.spotlight-dev { font-size: 0.8rem; color: var(--mute); }
.spotlight-sum { font-size: 0.86rem; color: var(--ink-mid); margin-top: 4px; }
.spotlight-cta { margin-top: 8px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-hi); }

@media (max-width: 560px) {
	.spotlight { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; }
	.spotlight-sum { display: none; }
}

/* ------------------------------------------------------------ shots ---- */
.grid.rail { cursor: grab; }
/* While a drag is in progress the pointer says so, and clicks are suppressed
   in JS - otherwise every drag ends by opening whatever it finished on. */
.is-dragging { cursor: grabbing !important; scroll-snap-type: none !important; }
.is-dragging a, .is-dragging img { pointer-events: none; }

/* --------------------------------------------------------- lightbox ---
 * Sized like a viewer, not like a wallpaper. The previous version let the
 * image fill the whole viewport, so a tall screenshot ran under the title
 * bar and behind the filmstrip and you were looking at the middle of it.
 *
 * Everything here is bounded in viewport units rather than percentages:
 * a percentage max-height inside a grid track resolves against a height
 * the browser has not settled yet, which is how the "contain" ended up
 * containing nothing.
 */
.lightbox {
	position: fixed; inset: 0; z-index: 120; display: none;
	background: rgba(6, 3, 6, .96);
	backdrop-filter: blur(8px);
}
/* Clear of the WordPress admin bar when an editor is logged in - without
   this the title row sits underneath it and reads as a rendering fault. */
body.admin-bar .lightbox { padding-top: 32px; }
@media screen and (max-width: 782px) {
	body.admin-bar .lightbox { padding-top: 46px; }
}
/* Flex column rather than grid rows: the stage claims whatever is left
   after the title row and the filmstrip, and the picture is sized against
   that. Subtracting a guessed chrome height in vh instead is how the image
   ended up 16px taller than the space it had and slid under the strip - and
   the guess would be wrong again the next time either row changed. */
.lightbox.is-open { display: flex; flex-direction: column; }

.lightbox-bar {
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px; padding: 12px 26px; color: var(--ink-mid);
	flex: 0 0 auto;
}
.lightbox-title { font-size: 0.95rem; font-weight: 700; color: var(--ink); }
.lightbox-count { font-size: 0.82rem; color: var(--mute); font-variant-numeric: tabular-nums; }

.lightbox-stage {
	position: relative; display: grid; place-items: center;
	padding: 0 84px;
	flex: 1 1 auto; min-height: 0;
}
/* The frame the picture lives in. Generous - the point of opening something
   full size is to see it - but still bounded, so nothing runs under the
   title row or behind the filmstrip, and the arrows keep their own space.
   Viewport units throughout: a percentage max-height inside a grid track
   resolves against a height the browser has not settled, which is how
   "contain" ended up containing nothing. */
.lightbox-stage img,
.lightbox-stage video,
.lightbox-stage iframe {
	/* The picture is given the whole frame and fitted into it, rather than
	   capped at its own pixel size. Nutaku's screenshots are only 960x540,
	   so max-width/max-height left them sitting small in the middle of a
	   1900px screen - the one thing a full-size view must not do.
	   object-fit scales up as well as down and never distorts.

	   Positioned absolutely because a flex item's computed height stays
	   `auto` even once its used height is known, so `height: 100%` on a
	   child silently does nothing and the picture grows past the strip.
	   Against an absolute containing block the percentage does resolve. */
	position: absolute; top: 0; bottom: 0; left: 50%;
	transform: translateX(-50%);
	width: min(1700px, calc(100vw - 150px));
	height: 100%;
	object-fit: contain;
	/* No frame: with `contain` the element is the frame, not the picture,
	   so a radius or a shadow would outline empty space beside it. */
	background: transparent;
	border-radius: 0;
	box-shadow: none;
}
.lightbox-stage video,
.lightbox-stage iframe { display: block; border: 0; }
.lightbox-stage [hidden] { display: none !important; }

.lightbox-btn {
	background: rgba(36, 24, 35, .82); border: 1px solid var(--line-hi);
	color: var(--ink); width: 46px; height: 46px; border-radius: 50%;
	display: grid; place-items: center; cursor: pointer;
	font-size: 1.15rem; line-height: 1; transition: background .16s, border-color .16s;
}
.lightbox-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.lightbox-prev, .lightbox-next {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
}
/* Outside the picture, not on top of it. */
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

/* Filmstrip: where you are in the set, and one click to anywhere in it.
   Centred, because a left-aligned strip under a centred image reads as a
   misalignment rather than a choice. */
.lightbox-strip {
	display: flex; justify-content: center; gap: 8px;
	flex: 0 0 auto;
	overflow-x: auto; padding: 12px 26px 18px;
	scrollbar-width: thin; scrollbar-color: var(--line-hi) transparent;
}
.strip-cell {
	position: relative; flex: none; padding: 0; border: 1px solid transparent;
	background: none; border-radius: 6px; overflow: hidden; cursor: pointer;
	width: 104px; height: 60px; opacity: .4;
	transition: opacity .16s, border-color .16s;
}
.strip-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip-cell:hover { opacity: .85; }
.strip-cell.is-current { opacity: 1; border-color: var(--accent); }
/* A play glyph on the trailer's thumbnail, so its place in the set is
   obvious before you land on it. */
.strip-cell.is-video::after {
	content: ""; position: absolute; left: 50%; top: 50%;
	transform: translate(-50%, -50%);
	border-style: solid; border-width: 7px 0 7px 12px;
	border-color: transparent transparent transparent #fff;
	filter: drop-shadow(0 1px 3px rgba(0,0,0,.8));
}

body.lightbox-open { overflow: hidden; }

@media (max-width: 860px) {
	.lightbox-stage { padding: 0 14px; }
	.lightbox-stage img,
	.lightbox-stage video,
	.lightbox-stage iframe {
		width: calc(100vw - 28px);
	}
	.lightbox-prev { left: 8px; }
	.lightbox-next { right: 8px; }
	.lightbox-strip { justify-content: flex-start; }
	.strip-cell { width: 76px; height: 46px; }
}

/* -------------------------------------------------------- hero tiles --
 * A bento of real destinations. Sizes vary on purpose: an even grid of four
 * identical boxes reads as a placeholder, an uneven one reads as a layout.
 */
.hero-tile {
	position: relative; overflow: hidden;
	display: flex; align-items: flex-end;
	padding: 12px 14px;
	border-radius: var(--radius);
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--ink);
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.hero-tile:hover {
	transform: translateY(-2px); border-color: transparent;
	box-shadow: var(--glow); color: var(--ink);
}

.hero-tile-art {
	position: absolute; inset: 0; width: 100%; height: 100%;
	object-fit: cover; opacity: .34;
	transition: opacity .25s ease, transform .35s cubic-bezier(.2,.7,.3,1);
}
.hero-tile:hover .hero-tile-art { opacity: .5; transform: scale(1.06); }

/* A scrim behind the label so it stays legible over any artwork. */
.hero-tile::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(to top, rgba(9, 5, 10, .92) 0%, rgba(9, 5, 10, .55) 52%, rgba(9, 5, 10, .18) 100%);
}
.hero-tile-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hero-tile-label {
	font-weight: 700; font-size: 0.95rem; font-stretch: 104%; line-height: 1.15;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hero-tile-meta { font-size: 0.72rem; color: var(--mute); }

.tile-lucky { border-color: var(--line-hi); }
.tile-lucky .hero-tile-label { color: var(--accent-hi); }



/* The tall tile is one column wide, so its label needs to wrap rather than
   truncate - "Finished gam..." helps nobody. */
/* The tall tile is one narrow column, so its label wraps instead of
   truncating - "Finished gam..." helps nobody. */
.tile-b .hero-tile-label { white-space: normal; font-size: 0.88rem; }
/* The biggest cell can carry a bigger label; it is the main destination. */
.tile-c .hero-tile-label { font-size: 1.14rem; }

/* The placeholder also stands in for artwork that failed to load, so it has
   to look deliberate rather than broken wherever it appears. */
.hero-tile .card-ph, .spotlight-art .card-ph, .game-cover .card-ph {
	position: absolute; inset: 0; font-size: 2rem;
}
.spotlight-art, .game-cover { position: relative; }
.game-cover .card-ph { position: static; aspect-ratio: 5 / 4; }
