/*
 * OldGameCodex — main stylesheet (B1: brand, design system and definitive frontend; ADR 059).
 *
 * One file on purpose (ADR 049, kept by ADR 059): one request, no build step, no framework.
 * Tokens first; every component reads them. Mobile-first: base rules are the small-screen layout,
 * media queries add columns.
 *
 * Sections:
 *   1. Fonts
 *   2. Design tokens
 *   3. Base
 *   4. Accessibility helpers
 *   5. Layout
 *   6. Header, branding, navigation and search
 *   7. Footer
 *   8. Buttons, eyebrow, chips, tiles, empty state, pagination, breadcrumbs
 *   9. Page headers (catalogue, search) and generic fallback content
 *  10. Game grid, game card and game cover
 *  11. Home
 *  12. Game page
 *  13. 404
 *  14. Documents: About and legal pages
 *  15. Contact form (Block 26b)
 *  16. Reserved slots (empty by default)
 *  17. Motion preferences
 *
 * Breakpoints (rem, so they follow the user's font size; media queries cannot read custom
 * properties, so they are written literally): 26rem (full-size logo), 40rem (grids, game page),
 * 64rem (header layout, hero and game page columns). The 64rem header breakpoint is duplicated in
 * assets/js/navigation.js.
 */

/* 1. Fonts ------------------------------------------------------------------------------------ */

/* Space Grotesk, variable (300–700), Latin subset, SIL OFL 1.1 (see assets/fonts/space-grotesk/OFL.txt). */
@font-face {
	font-family: "Space Grotesk";
	font-style: normal;
	font-weight: 300 700;
	font-display: swap;
	src: url("../fonts/space-grotesk/space-grotesk-latin-wght-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/*
 * Metric-adjusted fallback shown while the display font loads, so the swap barely moves text.
 * Values computed from the font tables: average advance width vs Arial and vertical metrics.
 */
@font-face {
	font-family: "Space Grotesk Fallback";
	src: local("Arial"), local("Liberation Sans"), local("Helvetica");
	size-adjust: 111%;
	ascent-override: 88%;
	descent-override: 26%;
	line-gap-override: 0%;
}

/* 2. Design tokens ---------------------------------------------------------------------------- */

:root {
	color-scheme: dark;

	/*
	 * Brand palette (raw values). Components use the semantic tokens below, never these directly.
	 */
	--palette-navy-950: #080c19;
	--palette-navy-900: #0b1020;
	--palette-navy-850: #131832;
	--palette-navy-800: #1a1f3a;
	--palette-navy-750: #222849;
	--palette-navy-700: #2a3158;
	--palette-navy-600: #3a4372;
	--palette-purple-500: #7c3aed;
	--palette-purple-600: #6d28d9;
	--palette-purple-300: #a78bfa;
	--palette-cyan-400: #22d3ee;
	--palette-cyan-300: #67e8f9;
	--palette-amber-500: #f59e0b;
	--palette-amber-400: #fbbf24;
	--palette-red-500: #ef4444;
	--palette-red-400: #f87171;
	--palette-green-500: #10b981;
	--palette-white: #fff;
	--palette-slate-50: #f8fafc;
	--palette-slate-200: #e2e8f0;
	--palette-slate-400: #94a3b8;

	/* Surfaces. Dark-first and never pure black: navy layers give depth; covers bring the colour. */
	--color-bg: var(--palette-navy-900);
	--color-bg-deep: var(--palette-navy-950);
	--color-surface: var(--palette-navy-850);
	--color-surface-raised: var(--palette-navy-800);
	--color-surface-hover: var(--palette-navy-750);

	/* Borders. --color-border-strong meets 3:1 against the surfaces (form fields, WCAG 1.4.11). */
	--color-border: var(--palette-navy-700);
	--color-border-subtle: #1f2547;
	--color-border-strong: var(--palette-slate-400);

	/* Text. Contrast on --color-bg: strong 18.9, text 15.4, muted 7.4; on --color-surface-raised: 15.9, 13.0, 6.2. */
	--color-text-strong: var(--palette-slate-50);
	--color-text: var(--palette-slate-200);
	--color-text-muted: var(--palette-slate-400);

	/* Brand violet: brand fills and primary actions only (white on it: 5.7). Not a text colour. */
	--color-brand: var(--palette-purple-500);
	--color-brand-hover: var(--palette-purple-600);

	/* Violet as text, when needed (7.0 on --color-bg). */
	--color-brand-text: var(--palette-purple-300);

	/* Secondary brand cyan: links, focus and interaction (10.5 on --color-bg). */
	--color-brand-secondary: var(--palette-cyan-400);
	--color-link: var(--palette-cyan-400);
	--color-link-hover: var(--palette-cyan-300);

	/* Amber: the CODEX highlight. Scarce: small accents and labels (9.3 on --color-bg). */
	--color-accent: var(--palette-amber-500);
	--color-accent-text: var(--palette-amber-400);

	/* States. Danger as a fill/border; as text use the lighter tone (6.9 on --color-bg). */
	--color-danger: var(--palette-red-500);
	--color-danger-text: var(--palette-red-400);
	--color-success: var(--palette-green-500);

	/* Fonts. Display (self-hosted Space Grotesk) for headings only; system UI for everything to read. */
	--font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-display: "Space Grotesk", "Space Grotesk Fallback", system-ui, sans-serif;
	--font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;

	/* Type scale. */
	--text-2xs: 0.75rem;
	--text-xs: 0.8125rem;
	--text-sm: 0.875rem;
	--text-base: 1rem;
	--text-md: 1.125rem;
	--text-lg: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
	--text-xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
	--text-2xl: clamp(1.875rem, 1.5rem + 1.75vw, 2.75rem);
	--text-3xl: clamp(2.25rem, 1.6rem + 3vw, 3.75rem);

	--leading-tight: 1.15;
	--leading-snug: 1.35;
	--leading-body: 1.6;

	--tracking-label: 0.12em;

	/* Widths. */
	--width-shell: 80rem;
	--width-prose: 42rem;
	--width-narrow: 34rem;
	--gutter: clamp(1rem, 4vw, 2.5rem);

	/* Spacing scale (4px base). */
	--space-1: 0.25rem;
	--space-2: 0.5rem;
	--space-3: 0.75rem;
	--space-4: 1rem;
	--space-5: 1.5rem;
	--space-6: 2rem;
	--space-7: 3rem;
	--space-8: 4rem;
	--space-9: 6rem;

	/* Shape. Slightly squared radii: modern, with a nod to pixel geometry. */
	--radius-sm: 0.25rem;
	--radius: 0.5rem;
	--radius-lg: 0.75rem;
	--radius-pill: 999px;
	--border-width: 1px;
	--border: var(--border-width) solid var(--color-border);

	/* Pixel motif: the size of the small square accents (section titles, eyebrows, tiles). */
	--pixel: 0.375rem;

	/* Elevation. Soft shadows, no glow. */
	--shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
	--shadow-raised: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 28px rgb(0 0 0 / 35%);

	/* Focus. */
	--focus-ring: 2px solid var(--color-link);
	--focus-offset: 2px;

	/* Motion. Cheap properties only (colour, opacity, transform); see section 17. */
	--duration-fast: 120ms;
	--duration: 180ms;
	--ease: cubic-bezier(0.2, 0, 0, 1);

	/* Sizing. */
	--header-height: 4rem;
	--tap-target: 2.75rem;
	--icon-size: 1.25rem;
	--logo-height: 1.3333rem; /* 2px wordmark pixels: crisp on small screens. */
}

@media (width >= 26rem) {
	:root {
		--logo-height: 2rem; /* 3px wordmark pixels. */
	}
}

/* 3. Base ------------------------------------------------------------------------------------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	margin: 0;
	background-color: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--text-base);
	line-height: var(--leading-body);
	overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin-block: 0 var(--space-4);
	color: var(--color-text-strong);
	font-family: var(--font-display);
	font-weight: 700;
	line-height: var(--leading-tight);
	letter-spacing: -0.015em;
	text-wrap: balance;
}

h1 {
	font-size: var(--text-2xl);
}

h2 {
	font-size: var(--text-xl);
}

h3 {
	font-size: var(--text-lg);
}

h4,
h5,
h6 {
	font-size: var(--text-md);
}

p,
ul,
ol,
dl,
blockquote,
figure,
pre,
table {
	margin-block: 0 var(--space-4);
}

a {
	color: var(--color-link);
	text-decoration-thickness: from-font;
	text-underline-offset: 0.2em;
	transition: color var(--duration) var(--ease);
}

a:hover {
	color: var(--color-link-hover);
}

:focus-visible {
	outline: var(--focus-ring);
	outline-offset: var(--focus-offset);
}

img,
svg,
video,
iframe {
	max-width: 100%;
}

img,
video {
	height: auto;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

::selection {
	background-color: var(--color-brand);
	color: var(--palette-white);
}

.icon {
	display: block;
	flex: none;
	width: var(--icon-size);
	height: var(--icon-size);
}

/* 4. Accessibility helpers -------------------------------------------------------------------- */

.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;
	word-wrap: normal !important;
}

.skip-link:focus {
	top: var(--space-2);
	left: var(--space-2);
	z-index: 100;
	width: auto;
	height: auto;
	padding: var(--space-3) var(--space-4);
	margin: 0;
	clip: auto;
	border-radius: var(--radius);
	background-color: var(--color-text-strong);
	color: var(--color-bg);
	font-weight: 600;
	text-decoration: none;
}

/* 5. Layout ----------------------------------------------------------------------------------- */

.container {
	width: 100%;
	max-width: calc(var(--width-shell) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.site-main {
	flex: 1 0 auto;
	padding-block: var(--space-6) var(--space-8);
}

.site-main:focus {
	outline: none;
}

/* Anchored sections stop below the sticky header. */
[id] {
	scroll-margin-block-start: calc(var(--header-height) + var(--space-4));
}

/* 6. Header, branding, navigation and search -------------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	border-block-end: var(--border);
	background-color: var(--color-bg);
}

/* The admin bar is fixed from 600px (32px tall, 46px below 783px); below 600px it scrolls away. */
@media (width >= 600px) {
	.admin-bar .site-header {
		top: 46px;
	}
}

@media (width >= 783px) {
	.admin-bar .site-header {
		top: 32px;
	}
}

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	column-gap: var(--space-1);
	min-height: var(--header-height);
}

.site-branding {
	margin: 0;
	margin-inline-end: auto;
	line-height: 1;
}

.site-branding__link {
	display: inline-flex;
	align-items: center;
	min-height: var(--header-height);
	padding-inline-end: var(--space-2);
	border-radius: var(--radius-sm);
}

/* The logo box is fixed by its height and the SVG aspect ratio: no layout shift. */
.brand-logo {
	display: block;
	width: auto;
	height: var(--logo-height);
	aspect-ratio: 253 / 32;
}

.site-header__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--tap-target);
	height: var(--tap-target);
	padding: 0;
	border: var(--border-width) solid transparent;
	border-radius: var(--radius);
	background: none;
	color: var(--color-text);
	cursor: pointer;
	transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.site-header__toggle:hover,
.site-header__toggle[aria-expanded="true"] {
	border-color: var(--color-border);
	background-color: var(--color-surface-raised);
	color: var(--color-text-strong);
}

.site-header__toggle .icon--close,
.site-header__toggle[aria-expanded="true"] .icon--menu,
.site-header__toggle[aria-expanded="true"] .icon--search {
	display: none;
}

.site-header__toggle[aria-expanded="true"] .icon--close {
	display: block;
}

/* Without JavaScript the panels are always visible, so the toggles would do nothing. */
.no-js .site-header__toggle {
	display: none;
}

.site-nav__list {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav__link {
	position: relative;
	display: flex;
	align-items: center;
	min-height: var(--tap-target);
	padding-inline: var(--space-3);
	border-radius: var(--radius);
	color: var(--color-text);
	font-weight: 600;
	text-decoration: none;
	transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

.site-nav__link:hover {
	background-color: var(--color-surface-raised);
	color: var(--color-text-strong);
}

.site-nav__link[aria-current="page"] {
	color: var(--color-text-strong);
}

.site-nav__link[aria-current="page"]::before {
	position: absolute;
	inset-block: var(--space-3);
	inset-inline-start: 0;
	width: 3px;
	background-color: var(--color-accent);
	content: "";
}

.search-form {
	display: flex;
	align-items: stretch;
	border: var(--border-width) solid var(--color-border-strong);
	border-radius: var(--radius);
	background-color: var(--color-bg-deep);
	transition: border-color var(--duration) var(--ease);
}

.search-form:hover,
.search-form:focus-within {
	border-color: var(--color-link);
}

.search-form__field {
	flex: 1 1 auto;
	min-width: 0;
	min-height: var(--tap-target);
	padding: 0 var(--space-3);
	border: 0;
	border-radius: var(--radius);
	background: none;
	color: var(--color-text-strong);
	font-size: var(--text-base); /* 16px or more: no zoom on focus in iOS. */
}

.search-form__field::placeholder {
	color: var(--color-text-muted);
	opacity: 1;
}

.search-form__field:focus-visible {
	outline: none;
}

.search-form__field::-webkit-search-cancel-button {
	filter: grayscale(1);
}

.search-form__submit {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: var(--tap-target);
	padding: 0;
	border: 0;
	border-radius: var(--radius);
	background: none;
	color: var(--color-text-muted);
	cursor: pointer;
	transition: color var(--duration) var(--ease);
}

.search-form__submit:hover {
	color: var(--color-link-hover);
}

.search-form__submit:focus-visible {
	outline-offset: -3px;
}

/* Narrow layout: navigation and search are full-width panels below the header bar. */
@media (width < 64rem) {
	.site-nav,
	.site-search {
		flex: 1 0 100%;
	}

	.site-nav {
		padding-block: var(--space-1) var(--space-3);
		border-block-start: var(--border-width) solid var(--color-border-subtle);
	}

	.site-nav__link {
		min-height: 3rem;
		font-size: var(--text-md);
	}

	.site-search {
		padding-block: var(--space-3) var(--space-4);
		border-block-start: var(--border-width) solid var(--color-border-subtle);
	}

	/* With JavaScript the panels start collapsed and open from their toggle (no body scroll lock). */
	.js .site-nav:not(.is-open),
	.js .site-search:not(.is-open) {
		display: none;
	}
}

/* Wide layout: one row with branding, navigation and search; no toggles. */
@media (width >= 64rem) {
	.site-header__inner {
		flex-wrap: nowrap;
		column-gap: var(--space-6);
		height: var(--header-height);
	}

	.site-branding {
		margin-inline-end: 0;
	}

	.site-header__toggle {
		display: none;
	}

	.site-nav__list {
		flex-direction: row;
		gap: var(--space-1);
	}

	.site-nav__link {
		min-height: 2.5rem;
		font-size: var(--text-sm);
		letter-spacing: 0.01em;
	}

	.site-nav__link[aria-current="page"]::before {
		inset-block: auto 0;
		inset-inline: var(--space-3);
		width: auto;
		height: 3px;
	}

	.site-search {
		flex: 0 1 18rem;
		margin-inline-start: auto;
	}

	.site-search .search-form__field {
		min-height: 2.5rem;
		font-size: var(--text-sm);
	}
}

/* 7. Footer ----------------------------------------------------------------------------------- */

.site-footer {
	padding-block: var(--space-7) var(--space-6);
	border-block-start: var(--border);
	background-color: var(--color-bg-deep);
	color: var(--color-text-muted);
	font-size: var(--text-sm);
}

.site-footer__inner {
	display: grid;
	gap: var(--space-6);
}

.site-footer__name {
	margin-block-end: var(--space-3);
	line-height: 1;
}

.site-footer__logo {
	display: inline-flex;
	align-items: center;
	min-height: var(--tap-target);
	border-radius: var(--radius-sm);
}

.site-footer__logo .brand-logo {
	height: 1.3333rem;
}

.site-footer__tagline {
	margin-block-end: var(--space-2);
	color: var(--color-accent-text);
	font-family: var(--font-mono);
	font-size: var(--text-2xs);
	font-weight: 600;
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
}

.site-footer__text {
	max-width: 22rem;
	margin: 0;
}

/* Link groups: two columns on small screens (Legal spans both), three side by side from 40rem. */
.site-footer__groups {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-5) var(--space-6);
}

.site-footer__group--legal {
	grid-column: 1 / -1;
}

.site-footer__heading {
	margin: 0 0 var(--space-2);
	color: var(--color-text-strong);
	font-family: var(--font-mono);
	font-size: var(--text-2xs);
	font-weight: 600;
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
}

.site-footer__list {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer__group--legal .site-footer__list {
	flex-flow: row wrap;
	column-gap: var(--space-5);
}

.site-footer__list a {
	display: inline-flex;
	align-items: center;
	min-height: 2.25rem;
	color: var(--color-text);
	text-decoration: none;
}

.site-footer__group--legal .site-footer__list a {
	color: var(--color-text-muted);
}

.site-footer__list a:hover {
	color: var(--color-link-hover);
	text-decoration: underline;
}

/* Data-source attribution (L1): one quiet line above the copyright, only when enabled. */
.site-footer__attribution {
	max-width: none;
	font-size: var(--text-xs);
}

.site-footer__copyright {
	margin: 0;
	padding-block-start: var(--space-4);
	border-block-start: var(--border);
	font-size: var(--text-xs);
}

@media (width >= 40rem) {
	.site-footer__groups {
		grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 2fr);
	}

	.site-footer__group--legal {
		grid-column: auto;
	}
}

@media (width >= 64rem) {
	.site-footer__inner {
		grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
		align-items: start;
	}

	.site-footer__attribution,
	.site-footer__copyright {
		grid-column: 1 / -1;
	}
}

/* 8. Buttons, eyebrow, chips, tiles, empty state, pagination, breadcrumbs --------------------- */

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	min-height: var(--tap-target);
	padding: 0 var(--space-5);
	border: var(--border-width) solid transparent;
	border-radius: var(--radius);
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--duration) var(--ease), border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

.button .icon {
	width: 1.125rem;
	height: 1.125rem;
}

.button--primary {
	background-color: var(--color-brand);
	color: var(--palette-white);
}

.button--primary:hover {
	background-color: var(--color-brand-hover);
	color: var(--palette-white);
}

.button--secondary {
	border-color: var(--color-border-strong);
	background-color: transparent;
	color: var(--color-text-strong);
}

.button--secondary:hover {
	border-color: var(--color-link);
	background-color: var(--color-surface-raised);
	color: var(--color-text-strong);
}

/* Eyebrow: small monospace label with a pixel square; the retro accent of headers. */
.eyebrow {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	margin: 0 0 var(--space-3);
	color: var(--color-brand-text);
	font-family: var(--font-mono);
	font-size: var(--text-2xs);
	font-weight: 600;
	letter-spacing: var(--tracking-label);
	line-height: 1.3;
	text-transform: uppercase;
}

.eyebrow::before {
	flex: none;
	width: var(--pixel);
	height: var(--pixel);
	background-color: var(--color-accent);
	content: "";
}

/* Chips: compact linked terms. Neutral by default; cyan only on interaction. */
.chip-list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.chip {
	display: inline-flex;
	align-items: center;
	min-height: 2.25rem;
	padding: 0 var(--space-3);
	border: var(--border);
	border-radius: var(--radius);
	background-color: var(--color-surface);
	color: var(--color-text);
	font-size: var(--text-sm);
	line-height: 1.2;
	text-decoration: none;
	transition: border-color var(--duration) var(--ease), color var(--duration) var(--ease), background-color var(--duration) var(--ease);
}

a.chip:hover {
	border-color: var(--color-link);
	background-color: var(--color-surface-raised);
	color: var(--color-text-strong);
}

.chip--static {
	color: var(--color-text-muted);
}

.chip-list--large .chip {
	min-height: var(--tap-target);
	padding-inline: var(--space-4);
	font-size: var(--text-base);
}

.chip-list--years .chip {
	min-width: 3.75rem;
	justify-content: center;
	font-family: var(--font-mono);
	font-variant-numeric: tabular-nums;
}

/* Tiles: larger link cards for platforms and "Explore more" destinations. */
.tile-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr));
	gap: var(--space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.tile {
	display: flex;
	align-items: center;
	gap: var(--space-2) var(--space-3);
	height: 100%;
	min-height: 3.25rem;
	padding: var(--space-2) var(--space-3);
	border: var(--border);
	border-radius: var(--radius);
	background-color: var(--color-surface);
	color: var(--color-text-strong);
	font-weight: 600;
	line-height: var(--leading-snug);
	text-decoration: none;
	transition: border-color var(--duration) var(--ease), background-color var(--duration) var(--ease);
}

.tile::before {
	flex: none;
	width: var(--pixel);
	height: var(--pixel);
	background-color: var(--color-brand-secondary);
	content: "";
}

.tile__label {
	flex: 1 1 auto;
	min-width: 0;
	hyphens: auto;
}

/* Two tiles per row on phones: smaller text, no arrow, proper hyphenation instead of mid-word breaks. */
@media (width < 40rem) {
	.tile {
		font-size: var(--text-sm);
	}

	.tile .icon {
		display: none;
	}
}

.tile .icon {
	width: 1.125rem;
	height: 1.125rem;
	color: var(--color-text-muted);
	transition: color var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.tile:hover {
	border-color: var(--color-link);
	background-color: var(--color-surface-raised);
	color: var(--color-text-strong);
}

.tile:hover .icon {
	color: var(--color-link);
	transform: translateX(2px);
}

.empty-state {
	max-width: var(--width-prose);
	padding: var(--space-6);
	border: var(--border);
	border-radius: var(--radius-lg);
	background-color: var(--color-surface);
}

.empty-state__title {
	margin-block-end: var(--space-2);
	font-size: var(--text-lg);
}

.empty-state__text {
	color: var(--color-text);
}

.empty-state__search {
	max-width: 28rem;
	margin-block: var(--space-4) 0;
}

.empty-state__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	margin: var(--space-5) 0 0;
}

.pagination {
	margin-block-start: var(--space-7);
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--tap-target);
	min-height: var(--tap-target);
	padding: 0 var(--space-3);
	border: var(--border);
	border-radius: var(--radius);
	background-color: var(--color-surface);
	color: var(--color-text);
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	font-variant-numeric: tabular-nums;
	text-decoration: none;
	transition: border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

.pagination a.page-numbers:hover {
	border-color: var(--color-link);
	color: var(--color-text-strong);
}

.pagination .page-numbers.current {
	border-color: var(--color-brand);
	background-color: var(--color-brand);
	color: var(--palette-white);
}

.pagination .page-numbers.dots {
	border-color: transparent;
	background: none;
}

.breadcrumbs {
	margin-block-end: var(--space-4);
	font-size: var(--text-xs);
}

.breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.breadcrumbs__item {
	display: inline-flex;
	align-items: center;
	min-width: 0;
	color: var(--color-text-muted);
}

.breadcrumbs__item + .breadcrumbs__item::before {
	margin-inline: var(--space-2);
	color: var(--color-border-strong);
	font-family: var(--font-mono);
	content: "/" / "";
}

.breadcrumbs a {
	display: inline-flex;
	align-items: center;
	min-height: 1.75rem;
	color: var(--color-text);
	text-decoration: none;
}

.breadcrumbs a:hover {
	color: var(--color-link-hover);
	text-decoration: underline;
}

.breadcrumbs [aria-current="page"] {
	max-width: 100%;
	overflow: hidden;
	color: var(--color-text-muted);
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* 9. Page headers (catalogue, search) and generic fallback content ---------------------------- */

.page-header {
	max-width: var(--width-prose);
	margin-block-end: var(--space-6);
}

.page-header__title {
	margin-block-end: var(--space-2);
}

.page-header__description {
	color: var(--color-text);
}

.page-header__description > :last-child {
	margin-block-end: 0;
}

.page-header__meta {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	margin: 0;
	color: var(--color-text-muted);
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	font-variant-numeric: tabular-nums;
}

.page-header__title + .page-header__description,
.page-header__title + .page-header__meta {
	margin-block-start: var(--space-2);
}

.page-header__description + .page-header__meta {
	margin-block-start: var(--space-1);
}

.page-header__meta + .page-header__description {
	margin-block-start: var(--space-3);
}

/* Catalogue header: a full-width band with a quiet pixel-grid texture. */
.page-header--catalog {
	position: relative;
	max-width: none;
	padding: var(--space-5) var(--space-5) var(--space-5);
	overflow: hidden;
	border: var(--border);
	border-radius: var(--radius-lg);
	background-color: var(--color-surface);
	background-image:
		linear-gradient(rgb(255 255 255 / 2.5%) 1px, transparent 1px),
		linear-gradient(90deg, rgb(255 255 255 / 2.5%) 1px, transparent 1px),
		radial-gradient(ellipse at 100% 0%, rgb(124 58 237 / 22%), transparent 60%);
	background-size: 8px 8px, 8px 8px, 100% 100%;
}

.page-header--catalog > * {
	max-width: var(--width-prose);
}

@media (width >= 40rem) {
	.page-header--catalog {
		padding: var(--space-6) var(--space-6);
	}
}

.entry,
.entry-list {
	max-width: var(--width-prose);
}

.entry__title {
	margin-block-end: var(--space-5);
}

.entry__content > :last-child {
	margin-block-end: 0;
}

.entry__content blockquote {
	margin-inline: 0;
	padding-inline-start: var(--space-4);
	border-inline-start: 3px solid var(--color-brand);
	color: var(--color-text-strong);
}

.entry__content code,
.entry__content pre {
	border-radius: var(--radius-sm);
	background-color: var(--color-surface-raised);
	font-family: var(--font-mono);
	font-size: 0.9em;
}

.entry__content code {
	padding: 0.1em 0.3em;
}

.entry__content pre {
	padding: var(--space-4);
	overflow-x: auto;
}

.entry__content pre code {
	padding: 0;
	background: none;
}

.entry__content figcaption,
.entry__content .wp-caption-text {
	margin-block-start: var(--space-2);
	color: var(--color-text-muted);
	font-size: var(--text-sm);
}

.entry__content .aligncenter {
	display: block;
	margin-inline: auto;
}

.entry__content .alignleft {
	float: left;
	margin: 0 var(--space-4) var(--space-4) 0;
}

.entry__content .alignright {
	float: right;
	margin: 0 0 var(--space-4) var(--space-4);
}

.entry__pages {
	margin-block-start: var(--space-5);
}

.entry-list {
	display: grid;
	gap: var(--space-6);
}

.entry-summary__title {
	margin-block-end: var(--space-2);
	font-size: var(--text-lg);
}

.entry-summary__title a {
	color: var(--color-text-strong);
	text-decoration: none;
}

.entry-summary__title a:hover {
	color: var(--color-link-hover);
	text-decoration: underline;
}

.entry-summary__excerpt > :last-child {
	margin-block-end: 0;
}

.search-others {
	margin-block-start: var(--space-7);
}

/* 10. Game grid, game card and game cover ----------------------------------------------------- */

/*
 * Section header: title with a pixel square, optional "View all" link. Sections are the major
 * blocks of the Home and the 404.
 */
.section {
	margin-block-start: var(--space-8);
}

.section__header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-2) var(--space-4);
	margin-block-end: var(--space-5);
}

.section__title {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	margin: 0;
	font-size: var(--text-xl);
}

.section__title::before {
	flex: none;
	width: var(--pixel);
	height: var(--pixel);
	background-color: var(--color-accent);
	box-shadow: calc(var(--pixel) * -1) calc(var(--pixel) * -1) 0 0 rgb(245 158 11 / 35%);
	content: "";
}

.section__link {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	min-height: var(--tap-target);
	font-weight: 600;
	text-decoration: none;
}

.section__link:hover {
	text-decoration: underline;
}

.section__link .icon {
	width: 1.125rem;
	height: 1.125rem;
}

.section__empty {
	color: var(--color-text-muted);
}

/*
 * Game grid: 2 columns on small screens (two choices per row on a phone), then as many 10.5rem
 * columns as fit (6 in the 80rem shell). Consecutive groups (catalogue slot breaks) are spaced like
 * rows, so an empty slot leaves no trace.
 */
.game-grid {
	--grid-gap: var(--space-3);

	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--grid-gap);
}

.game-grid + .game-grid {
	margin-block-start: var(--grid-gap);
}

@media (width >= 40rem) {
	.game-grid {
		--grid-gap: var(--space-5);

		grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
	}
}

/*
 * Game card: one link (the title, stretched over the card), so the card has one accessible name
 * and nothing interactive is nested. Hover lifts the card slightly (transform only).
 */
.game-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	border: var(--border);
	border-radius: var(--radius-lg);
	background-color: var(--color-surface);
	transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), background-color var(--duration) var(--ease);
}

.game-card:hover {
	border-color: var(--color-link);
	background-color: var(--color-surface-raised);
	box-shadow: var(--shadow-raised);
	transform: translateY(-2px);
}

.game-card:focus-within {
	border-color: var(--color-link);
}

.game-card .game-cover {
	border: 0;
	border-block-end: var(--border);
	border-radius: 0;
}

.game-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: var(--space-1);
	min-width: 0;
	padding: var(--space-3) var(--space-3) var(--space-4);
}

.game-card__title {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	font-family: var(--font-body);
	font-size: var(--text-sm);
	font-weight: 650;
	line-height: var(--leading-snug);
	letter-spacing: 0;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	text-wrap: pretty;
}

@media (width >= 40rem) {
	.game-card__title {
		font-size: var(--text-base);
	}
}

.game-card__link {
	color: var(--color-text-strong);
	text-decoration: none;
}

.game-card__link::after {
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: var(--radius-lg);
	content: "";
}

.game-card:hover .game-card__link {
	color: var(--color-text-strong);
	text-decoration: underline;
	text-decoration-color: var(--color-link);
}

.game-card__link:focus-visible {
	outline: none;
}

.game-card__link:focus-visible::after {
	outline: 3px solid var(--color-link);
	outline-offset: 2px;
}

.game-card__meta {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: var(--color-text-muted);
	font-family: var(--font-mono);
	font-size: var(--text-2xs);
	line-height: var(--leading-snug);
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

/*
 * Game cover: 3:4 box reserved on every surface. Branded placeholder until the licensed cover
 * pipeline exists: one of five fixed tones (chosen from the game ID in PHP), a faint 8px pixel
 * grid, the codex mark and the title set like box art. A real cover is an <img> in the same box.
 */
.game-cover {
	--cover-top: #2d1f66;
	--cover-bottom: #121630;

	position: relative;
	display: block;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	container-type: inline-size;
	border: var(--border);
	border-radius: var(--radius-lg);
	background-color: var(--cover-bottom);
	background-image:
		linear-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px),
		linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px),
		linear-gradient(160deg, var(--cover-top) 0%, var(--cover-bottom) 78%);
	background-size: 8px 8px, 8px 8px, 100% 100%;
}

.game-cover--tone-1 {
	--cover-top: #0e3b4f;
	--cover-bottom: #0f1630;
}

.game-cover--tone-2 {
	--cover-top: #4a2c0e;
	--cover-bottom: #161227;
}

.game-cover--tone-3 {
	--cover-top: #1e2a6b;
	--cover-bottom: #10142c;
}

.game-cover--tone-4 {
	--cover-top: #0d3f37;
	--cover-bottom: #0e1a2a;
}

.game-cover__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 9cqi 9cqi 10cqi;
}

/* A quiet frame and a pixel corner: box-art cues without noise. */
.game-cover__placeholder::before {
	position: absolute;
	inset: 5cqi;
	border: 1px solid rgb(255 255 255 / 7%);
	border-radius: var(--radius-sm);
	content: "";
}

.game-cover__placeholder::after {
	position: absolute;
	inset-block-end: 5cqi;
	inset-inline-end: 5cqi;
	width: 6cqi;
	height: 6cqi;
	background-color: var(--color-accent);
	opacity: 0.55;
	content: "";
}

.game-cover__mark {
	position: relative;
	width: 22cqi;
	height: auto;
	opacity: 0.9;
}

.game-cover__title {
	position: relative;
	display: -webkit-box;
	overflow: hidden;
	color: rgb(248 250 252 / 92%);
	font-family: var(--font-display);
	font-size: 1rem;
	font-size: clamp(0.8125rem, 11cqi, 2.25rem);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.02em;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
	line-clamp: 4;
	overflow-wrap: anywhere;
	text-wrap: balance;
}

/* An approved local cover (M1): fills the same box; the placeholder is not rendered. */
.game-cover--image {
	background: var(--cover-bottom);
}

.game-cover > img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* 11. Home ------------------------------------------------------------------------------------ */

.home .site-main {
	padding-block-start: 0;
}

.home-hero {
	border-block-end: var(--border);
	background-color: var(--color-bg);
	background-image: radial-gradient(ellipse at 0% 0%, rgb(124 58 237 / 18%), transparent 55%);
}

.home-hero__inner {
	display: grid;
	gap: var(--space-5);
	padding-block: var(--space-6);
}

.home-hero__content {
	min-width: 0;
}

.home-hero__title {
	margin-block-end: var(--space-4);
	font-size: var(--text-3xl);
	letter-spacing: -0.025em;
}

.home-hero__text {
	max-width: 34rem;
	margin-block-end: var(--space-5);
	color: var(--color-text);
	font-size: var(--text-md);
}

.home-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	margin: 0;
}

.home-hero__stats {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2) var(--space-5);
	margin: var(--space-5) 0 0;
	padding: 0;
	color: var(--color-text-muted);
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	font-variant-numeric: tabular-nums;
	list-style: none;
}

.home-hero__stats li {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
}

.home-hero__stats li::before {
	width: var(--pixel);
	height: var(--pixel);
	background-color: var(--color-brand-secondary);
	content: "";
}

/*
 * The landscape keeps its box (aspect ratio) before and after the SVG renders: no layout shift.
 * On small screens it is a slim band, so the first game cards stay close to the fold.
 */
.home-hero__art {
	position: relative;
	aspect-ratio: 5 / 2;
	overflow: hidden;
	border: var(--border);
	border-radius: var(--radius-lg);
	background-color: var(--color-bg-deep);
}

.home-hero__landscape {
	display: block;
	width: 100%;
	height: 100%;
}

@media (width >= 40rem) {
	.home-hero__inner {
		padding-block: var(--space-7);
	}

	.home-hero__art {
		aspect-ratio: 3 / 1;
	}
}

@media (width >= 64rem) {
	.home-hero__inner {
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
		align-items: center;
		gap: var(--space-8);
		padding-block: var(--space-8);
	}

	.home-hero__art {
		aspect-ratio: 8 / 5;
	}
}

.home .section:first-child {
	margin-block-start: var(--space-7);
}

.decade-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
	gap: var(--space-4);
	align-items: start;
	margin: 0;
	padding: 0;
	list-style: none;
}

.decade {
	padding: var(--space-5);
	border: var(--border);
	border-radius: var(--radius-lg);
	background-color: var(--color-surface);
}

.decade__title {
	margin-block-end: var(--space-1);
	color: var(--color-accent-text);
	font-size: var(--text-xl);
	font-variant-numeric: tabular-nums;
}

.decade__meta {
	margin-block-end: var(--space-4);
	color: var(--color-text-muted);
	font-family: var(--font-mono);
	font-size: var(--text-2xs);
	letter-spacing: 0.04em;
}

/* 12. Game page ------------------------------------------------------------------------------- */

.game-hero {
	display: grid;
	gap: var(--space-5);
	margin-block-end: var(--space-7);
}

.game-hero__cover {
	width: min(100%, 8.5rem);
}

.game-hero__body {
	min-width: 0;
}

.game-hero__title {
	margin-block-end: var(--space-3);
	font-size: var(--text-2xl);
}

.game-hero__lede {
	max-width: var(--width-prose);
	margin-block-end: var(--space-5);
	color: var(--color-text);
	font-size: var(--text-md);
}

.game-hero__rail {
	min-width: 0;
}

@media (width >= 40rem) {
	.game-hero {
		grid-template-columns: 12rem minmax(0, 1fr);
		gap: var(--space-6);
		align-items: start;
	}

	.game-hero__cover {
		width: auto;
	}

	.game-hero__rail {
		grid-column: 1 / -1;
	}
}

@media (width >= 64rem) {
	.game-hero {
		grid-template-columns: 16rem minmax(0, 1fr);
		gap: var(--space-7);
	}

	.game-hero--rail {
		grid-template-columns: 16rem minmax(0, 1fr) 20rem;
	}

	.game-hero__rail {
		grid-column: auto;
		position: sticky;
		top: calc(var(--header-height) + var(--space-4));
	}
}

/* Essential facts: label / value rows, compact, not a table. */
.facts {
	display: grid;
	gap: var(--space-3);
	max-width: var(--width-prose);
	margin: 0;
	padding-block-start: var(--space-4);
	border-block-start: var(--border);
}

.facts__row {
	display: grid;
	grid-template-columns: 6.5rem minmax(0, 1fr);
	gap: var(--space-3);
	align-items: baseline;
}

.facts dt,
.details dt,
.spec-list dt {
	color: var(--color-text-muted);
	font-family: var(--font-mono);
	font-size: var(--text-2xs);
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.facts dd {
	margin: 0;
	color: var(--color-text-strong);
}

.facts__row--genres {
	align-items: start;
}

.facts__row--genres dt {
	padding-block-start: 0.6rem;
}

/*
 * Term links in the facts and the details: light text with a quiet cyan underline, so a page with
 * many links stays calm; full cyan on hover.
 */
.facts dd a,
.details dd a {
	color: var(--color-text-strong);
	text-decoration-color: rgb(34 211 238 / 55%);
}

.facts dd a:hover,
.details dd a:hover {
	color: var(--color-link-hover);
	text-decoration-color: currentcolor;
}

.game-body {
	display: grid;
	gap: var(--space-7);
}

.game-section {
	min-width: 0;
}

.game-section--prose {
	max-width: var(--width-prose);
}

.game-section__title {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	margin-block-end: var(--space-4);
	font-size: var(--text-lg);
}

.game-section__title::before {
	flex: none;
	width: var(--pixel);
	height: var(--pixel);
	background-color: var(--color-accent);
	content: "";
}

/* Game details: a grid of labelled cells on the full content width. */
.details {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr));
	gap: var(--space-2);
	margin: 0;
}

@media (width >= 40rem) {
	.details {
		grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
	}
}

.details__row {
	padding: var(--space-3) var(--space-4);
	border: var(--border);
	border-radius: var(--radius);
	background-color: var(--color-surface);
}

.details dt {
	margin-block-end: var(--space-1);
}

.details dd {
	margin: 0;
}

.table-scroll {
	overflow-x: auto;
}

.spec-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: var(--text-sm);
	overflow-wrap: anywhere;
}

.spec-table th,
.spec-table td {
	padding: var(--space-2) var(--space-3) var(--space-2) 0;
	border-block-end: var(--border);
	text-align: start;
	vertical-align: top;
}

.spec-table thead th {
	color: var(--color-text-muted);
	font-weight: 600;
}

.spec-table tbody th {
	color: var(--color-text-muted);
	font-weight: 500;
}

.spec-list {
	display: grid;
	margin: 0;
	font-size: var(--text-sm);
}

.spec-list__row {
	display: grid;
	grid-template-columns: 9rem minmax(0, 1fr);
	gap: var(--space-3);
	padding-block: var(--space-2);
	border-block-end: var(--border);
}

.spec-list dd {
	margin: 0;
}

.tile-list--explore {
	grid-template-columns: minmax(0, 1fr);
}

@media (width >= 40rem) {
	.tile-list {
		grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
	}

	.tile-list--explore {
		grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	}
}

/* 13. 404 ------------------------------------------------------------------------------------- */

.not-found {
	max-width: var(--width-narrow);
	padding-block: var(--space-6) var(--space-4);
}

.not-found__label {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	margin-block-end: var(--space-4);
	padding: var(--space-1) var(--space-3);
	border: var(--border-width) solid var(--color-accent);
	border-radius: var(--radius-sm);
	color: var(--color-accent-text);
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	font-weight: 700;
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
}

.not-found__title {
	margin-block-end: var(--space-3);
}

.not-found__text {
	color: var(--color-text);
}

.not-found__search {
	margin-block: var(--space-5);
}

.not-found__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	margin: 0;
}

/* 14. Documents: About and legal pages (Block 26a) -------------------------------------------- */

.document {
	max-width: var(--width-prose);
	margin-inline: auto;
}

.document__header {
	margin-block-end: var(--space-6);
	padding-block-end: var(--space-5);
	border-block-end: var(--border);
}

.document__title {
	margin-block-end: var(--space-3);
}

.document__lede,
.entry__content .document-intro {
	color: var(--color-text);
	font-size: var(--text-md);
	line-height: var(--leading-snug);
}

.entry__content .document-meta {
	color: var(--color-text-muted);
	font-family: var(--font-mono);
	font-size: var(--text-xs);
}

.entry__content h2 {
	margin-block-start: var(--space-7);
	font-size: var(--text-lg);
}

.entry__content h3 {
	margin-block-start: var(--space-5);
	font-size: var(--text-md);
}

.entry__content ul,
.entry__content ol {
	padding-inline-start: var(--space-5);
}

.entry__content li + li {
	margin-block-start: var(--space-2);
}

.entry__content ul > li::marker {
	color: var(--color-accent);
}

.entry__content ol > li::marker {
	color: var(--color-text-muted);
	font-family: var(--font-mono);
}

.entry__content .callout {
	margin-block: var(--space-5);
	padding: var(--space-4) var(--space-5);
	border: var(--border);
	border-inline-start: 3px solid var(--color-link);
	border-radius: var(--radius);
	background-color: var(--color-surface);
}

.entry__content .callout > :last-child {
	margin-block-end: 0;
}

.entry__content .table-scroll {
	margin-block: 0 var(--space-5);
}

.entry__content table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--text-sm);
}

.entry__content .table-scroll table {
	min-width: 36rem;
	margin: 0;
}

.entry__content th,
.entry__content td {
	padding: var(--space-2) var(--space-3);
	border: var(--border);
	text-align: start;
	vertical-align: top;
}

.entry__content td code {
	overflow-wrap: anywhere;
}

.entry__content thead th {
	background-color: var(--color-surface);
	color: var(--color-text-strong);
	font-weight: 600;
}

/* 15. Contact form (Block 26b) ---------------------------------------------------------------- */

.contact-form,
.contact-status {
	margin-block-start: var(--space-7);
	padding: var(--space-5);
	border: var(--border);
	border-radius: var(--radius-lg);
	background-color: var(--color-surface);
}

@media (width >= 40rem) {
	.contact-form,
	.contact-status {
		padding: var(--space-6);
	}
}

.contact-form__title,
.contact-status__title {
	font-size: var(--text-lg);
}

.contact-form__summary {
	margin-block-end: var(--space-5);
	padding: var(--space-4) var(--space-5);
	border: 2px solid var(--color-danger);
	border-radius: var(--radius);
	background-color: var(--color-bg);
}

.contact-form__summary:focus {
	outline: var(--focus-ring);
	outline-offset: var(--focus-offset);
}

.contact-form__summary-title {
	margin-block-end: var(--space-3);
	font-size: var(--text-md);
}

.contact-form__summary-list {
	margin: 0;
	padding-inline-start: var(--space-5);
}

.contact-form__summary-list a {
	color: var(--color-danger-text);
	font-weight: 600;
}

.contact-form__form {
	display: grid;
	gap: var(--space-5);
}

.contact-form__field {
	display: grid;
	gap: var(--space-2);
}

.contact-form__label,
.contact-form__legend {
	color: var(--color-text-strong);
	font-weight: 600;
}

.contact-form__hint {
	margin: 0;
	color: var(--color-text-muted);
	font-size: var(--text-sm);
}

.contact-form__error {
	margin: 0;
	color: var(--color-danger-text);
	font-size: var(--text-sm);
	font-weight: 600;
}

.contact-form__input {
	width: 100%;
	min-height: var(--tap-target);
	padding: var(--space-2) var(--space-3);
	border: var(--border-width) solid var(--color-border-strong);
	border-radius: var(--radius);
	background-color: var(--color-bg);
	color: var(--color-text-strong);
	line-height: var(--leading-snug);
	transition: border-color var(--duration) var(--ease);
}

.contact-form__input:hover {
	border-color: var(--color-text);
}

.contact-form__textarea {
	min-height: 10rem;
	resize: vertical;
}

.contact-form__input:focus-visible,
.contact-form__radio:focus-visible {
	border-color: var(--color-link);
	outline: var(--focus-ring);
	outline-offset: var(--focus-offset);
}

.is-invalid > .contact-form__input,
.contact-form__fieldset.is-invalid {
	border-color: var(--color-danger);
	border-width: 2px;
}

.contact-form__fieldset {
	display: grid;
	gap: var(--space-2);
	min-width: 0;
	margin: 0;
	padding: var(--space-3) var(--space-4) var(--space-4);
	border: var(--border);
	border-radius: var(--radius);
}

.contact-form__legend {
	padding-inline: var(--space-2);
}

.contact-form__choices {
	display: grid;
	gap: var(--space-1);
}

@media (width >= 40rem) {
	.contact-form__choices {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: var(--space-4);
	}
}

.contact-form__choice {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	min-height: var(--tap-target);
}

.contact-form__radio {
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	margin: 0;
	accent-color: var(--color-brand);
}

.contact-form__choice label {
	flex: 1;
	padding-block: var(--space-2);
	cursor: pointer;
}

/* Anti-spam field: moved off-screen (not display:none), hidden from assistive technology. */
.contact-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.contact-form__privacy {
	margin: 0;
	color: var(--color-text-muted);
	font-size: var(--text-sm);
}

.contact-form__actions,
.contact-status__actions {
	margin: 0;
}

.contact-status {
	border-inline-start: 3px solid var(--color-success);
}

/* 16. Reserved slots (empty by default) ------------------------------------------------------- */

/*
 * Slots only exist in the markup when a future module prints into them (inc/slots.php). The
 * module reserves its own dimensions (min-height) to keep CLS low; the theme only spaces the slot
 * like the blocks around it.
 */
.slot--home-after-recent,
.slot--home-after-browse {
	margin-block-start: var(--space-8);
}

.slot--catalog-grid-break {
	margin-block: var(--space-5);
}

/* Game availability (M1; D1): printed into the `single_rail` slot only when actions exist. */
.game-actions {
	padding: var(--space-4);
	border: var(--border);
	border-radius: var(--radius-lg);
	background: var(--color-surface);
}

.game-actions__title {
	margin-block-end: var(--space-3);
	font-size: var(--text-md);
}

.game-actions__group + .game-actions__group {
	margin-block-start: var(--space-4);
}

.game-actions__heading {
	margin-block-end: var(--space-2);
	color: var(--color-text-muted);
	font-size: var(--text-sm);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.game-actions__list {
	display: grid;
	gap: var(--space-3);
	margin: 0;
	padding: 0;
	list-style: none;
}

.game-actions__item {
	display: grid;
	gap: var(--space-2);
}

.game-actions__store {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.5rem;
	align-items: baseline;
}

.game-actions__store-name {
	font-weight: 600;
}

.game-actions__link {
	width: 100%;
	justify-content: center;
	text-align: center;
}

.game-actions__context,
.game-actions__tag,
.game-actions__disclosure {
	color: var(--color-text-muted);
	font-size: var(--text-sm);
	font-weight: 400;
}

.game-actions__tag {
	padding-inline: 0.375rem;
	border: var(--border);
	border-radius: var(--radius-sm);
}

.game-actions__disclosure {
	margin-block-start: var(--space-4);
	margin-block-end: 0;
}

/* 17. Motion preferences ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

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

	.game-card:hover,
	.tile:hover .icon {
		transform: none;
	}
}
