/* Pocket Mayhem Studios — shared styles.
   Components (see README): wrap, section, eyebrow, btn, badge, game-hero, facts, grid-2/3/4,
   feature, steps, chips, split, gallery, faq, callout, game-card, cta-band.
   Each game page sets its own --accent through body[data-page]. */

:root {
	--bg: #0B1222;
	--bg-2: #0E1730;
	--surface: #131E39;
	--surface-2: #1A2848;
	--line: rgba(255, 255, 255, .09);
	--text: #F4EFE6;
	--muted: #A3B0CC;
	--gold: #FFC531;
	--gold-2: #FF9F1C;
	--green: #3DD68C;
	--accent: var(--gold);
	--accent-2: var(--gold-2);
	--accent-ink: #1A1200;
	--radius: 20px;
	--radius-sm: 12px;
	--shadow: 0 18px 50px -20px rgba(0, 0, 0, .7);
	--display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
	--body: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
	--wrap: 1160px;
}

body[data-page="oops"]  { --accent: #FFB21E; --accent-2: #FF7A1A; --hero-tint: #1B3A8F; }
body[data-page="racer"] { --accent: #FF5A2B; --accent-2: #FFC531; --hero-tint: #3A1A0C; --accent-ink: #fff; }
body[data-page="guess"] { --accent: #4CC9F0; --accent-2: #FF5FB7; --hero-tint: #14222B; --accent-ink: #06202B; }

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--body);
	font-size: 1.0625rem;
	line-height: 1.65;
	overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--text); }
strong { color: var(--text); font-weight: 800; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, .display {
	font-family: var(--display);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: .01em;
	margin: 0 0 .5em;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }

.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--gold); color: #000; padding: 8px 14px; border-radius: 8px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.center .lead, .center.lead { margin-left: auto; margin-right: auto; }
.muted { color: var(--muted); }
.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); max-width: 62ch; }

.eyebrow {
	display: inline-block;
	font-family: var(--body);
	font-weight: 800;
	font-size: .8rem;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 10px;
}

/* ---------- top bar */
.topbar {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(11, 18, 34, .78);
	backdrop-filter: blur(14px) saturate(140%);
	-webkit-backdrop-filter: blur(14px) saturate(140%);
	border-bottom: 1px solid transparent;
	transition: border-color .2s, background .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); background: rgba(11, 18, 34, .92); }
.topbar-in { max-width: var(--wrap); margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--display); font-size: 1.2rem; white-space: nowrap; }
.brand img { width: 40px; height: 40px; }
.brand em { font-style: normal; color: var(--gold); }
.brand:hover { color: var(--text); }

.menu { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.menu > a {
	color: var(--muted);
	text-decoration: none;
	font-weight: 700;
	font-size: .95rem;
	padding: 8px 12px;
	border-radius: 999px;
	transition: color .15s, background .15s;
}
.menu > a:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.menu > a[aria-current="page"] { color: var(--accent); background: rgba(255, 255, 255, .06); }

.langs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; margin-left: 8px; }
.langs a { color: var(--muted); text-decoration: none; font-weight: 800; font-size: .75rem; padding: 3px 9px; border-radius: 999px; }
.langs a:hover { color: var(--text); }
.langs a[aria-current] { background: var(--gold); color: #1A1200; }

.menu-btn { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: none; cursor: pointer; position: relative; }
.menu-btn > span:first-child, .menu-btn > span:first-child::before, .menu-btn > span:first-child::after {
	position: absolute; left: 12px; width: 18px; height: 2px; background: var(--text); border-radius: 2px; content: ""; transition: transform .2s, opacity .2s;
}
.menu-btn > span:first-child { top: 21px; }
.menu-btn > span:first-child::before { left: 0; top: -6px; }
.menu-btn > span:first-child::after { left: 0; top: 6px; }
.menu-btn[aria-expanded="true"] > span:first-child { background: transparent; }
.menu-btn[aria-expanded="true"] > span:first-child::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] > span:first-child::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
	.menu-btn { display: block; }
	.menu {
		position: absolute; left: 0; right: 0; top: 100%;
		flex-direction: column; align-items: stretch; gap: 2px;
		background: rgba(11, 18, 34, .98); border-bottom: 1px solid var(--line);
		padding: 10px 16px 18px; display: none;
	}
	.menu.open { display: flex; }
	.menu > a { padding: 12px 14px; font-size: 1.05rem; }
	.menu .langs { align-self: flex-start; margin: 10px 0 0 8px; }
	.brand span { font-size: 1.05rem; }
}

/* ---------- buttons & badges */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	font: 800 1rem/1 var(--body);
	padding: 15px 24px; min-height: 50px;
	border-radius: 999px; border: 2px solid transparent;
	text-decoration: none; cursor: pointer;
	transition: transform .15s, box-shadow .15s, background .15s, color .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: var(--accent-ink); box-shadow: 0 10px 28px -10px var(--accent); }
.btn-primary:hover { color: var(--accent-ink); box-shadow: 0 14px 34px -10px var(--accent); }
.btn-ghost { border-color: rgba(255, 255, 255, .22); color: var(--text); background: rgba(255, 255, 255, .04); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.center .btn-row, .btn-row.center { justify-content: center; }

/* A store button that is not live yet: <span class="store-btn is-soon">… */
.store-btn {
	display: inline-flex; align-items: center; gap: 12px;
	background: #000; color: #fff; text-decoration: none;
	border: 1px solid rgba(255, 255, 255, .28); border-radius: 14px;
	padding: 9px 18px 9px 14px; min-height: 54px;
}
.store-btn svg { width: 26px; height: 26px; flex: none; }
.store-btn small { display: block; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; opacity: .75; line-height: 1.2; }
.store-btn b { display: block; font-size: 1.15rem; line-height: 1.15; font-weight: 800; }
.store-btn.is-soon { opacity: .75; cursor: default; }

.badge {
	display: inline-flex; align-items: center; gap: 7px;
	font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
	padding: 6px 12px; border-radius: 999px;
	background: rgba(255, 255, 255, .08); color: var(--muted);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.live { background: rgba(61, 214, 140, .14); color: var(--green); }
.badge.live::before { animation: pulse 1.8s infinite; }
.badge.dev { background: rgba(255, 138, 31, .15); color: #FFA24A; }
.badge.proto { background: rgba(76, 201, 240, .14); color: #6FD6F7; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(61, 214, 140, .6); } 50% { box-shadow: 0 0 0 6px rgba(61, 214, 140, 0); } }

/* ---------- sections */
.section { padding: clamp(56px, 9vw, 104px) 0; position: relative; }
.section-alt { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: clamp(28px, 4vw, 48px); }
.section-head.center .lead { margin: 0 auto; }

.grid-2, .grid-3, .grid-4 { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }

/* Card with an icon: <article class="feature"><span class="feature-ico" aria-hidden="true">🧠</span><h3>…</h3><p>…</p></article> */
.feature {
	background: linear-gradient(180deg, var(--surface), rgba(19, 30, 57, .6));
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 26px;
	transition: transform .2s, border-color .2s;
}
.feature:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, .18); }
.feature h3 { margin-bottom: .35em; }
.feature p { color: var(--muted); margin: 0; }
.feature-ico {
	display: grid; place-items: center;
	width: 52px; height: 52px; margin-bottom: 16px;
	font-size: 1.6rem; border-radius: 16px;
	background: rgba(255, 255, 255, .06);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.feature.accent { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface)); }

/* Numbered steps: <ol class="steps"><li><h3>…</h3><p>…</p></li></ol> */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.steps li { counter-increment: step; position: relative; padding: 26px 26px 26px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.steps li::before {
	content: counter(step);
	display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px;
	font-family: var(--display); font-size: 1.4rem; color: var(--accent-ink);
	background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-radius: 14px;
}
.steps h3 { margin-bottom: .3em; }
.steps p { color: var(--muted); margin: 0; }

/* Tag cloud: <ul class="chips"><li>History</li>…</ul> */
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li { padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: .95rem; }
.center .chips { justify-content: center; }

/* Image + text: <div class="split [reverse]"><div class="split-media">img</div><div>text</div></div> */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.split.reverse > :first-child { order: 2; }
.split-media img { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); width: 100%; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split.reverse > :first-child { order: 0; } }

.checks { list-style: none; padding: 0; margin: 0 0 1em; }
.checks li { position: relative; padding-left: 32px; margin-bottom: 10px; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; display: grid; place-items: center; font-size: .8rem; font-weight: 900; color: var(--accent-ink); background: var(--accent); border-radius: 50%; }

/* ---------- game hero
   <section class="game-hero" style="--hero-img:url(…)"> <div class="wrap game-hero-in"> <div class="game-hero-text">…</div> <div class="game-hero-art">…</div> </div> </section> */
.game-hero { position: relative; overflow: hidden; padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); isolation: isolate; }
.game-hero::before {
	content: ""; position: absolute; inset: -40px; z-index: -2;
	background-image: var(--hero-img); background-size: cover; background-position: center;
	filter: blur(28px) saturate(130%); opacity: .45; transform: scale(1.1);
}
.game-hero::after {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background:
		radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--hero-tint, #1B2A4D) 70%, transparent), transparent 60%),
		linear-gradient(180deg, rgba(11, 18, 34, .35) 0%, rgba(11, 18, 34, .75) 70%, var(--bg) 100%);
}
.game-hero-in { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.game-hero-text .game-icon { width: 88px; height: 88px; border-radius: 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.game-hero h1 { margin-bottom: .25em; }
.game-hero .lead { color: #D6DDEC; }
.game-hero-art img { width: 100%; border-radius: var(--radius); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9); }
.game-hero .badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
@media (max-width: 860px) { .game-hero-in { grid-template-columns: 1fr; } .game-hero-art { order: -1; } }

/* Key facts: <dl class="facts"><div><dt>Genre</dt><dd>Quiz</dd></div>…</dl> */
.facts {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 1px; margin: 0; overflow: hidden;
	background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
}
.facts > div { background: var(--surface); padding: 18px 20px; }
.facts dt { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.facts dd { margin: 0; font-weight: 800; }
.facts-band { margin-top: -8px; position: relative; z-index: 2; }

/* ---------- gallery
   <div class="gallery portrait|landscape"><a href="big.jpg" data-lightbox><img …></a>…</div>
   <figure> children are allowed too (with figcaption). */
.gallery { display: grid; grid-auto-flow: column; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 20px 22px; margin: 0 -20px; scrollbar-width: thin; scrollbar-color: var(--surface-2) transparent; }
.gallery.portrait { grid-auto-columns: minmax(200px, 250px); }
.gallery.landscape { grid-auto-columns: minmax(280px, min(80vw, 640px)); }
.gallery > a, .gallery > figure { scroll-snap-align: start; margin: 0; }
.gallery img { border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .2s; width: 100%; }
.gallery a:hover img { transform: translateY(-4px); }
.gallery figcaption { color: var(--muted); font-size: .9rem; padding-top: 10px; }
.gallery-note { color: var(--muted); font-size: .9rem; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(4, 8, 18, .92); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: min(94vw, 1400px); max-height: 86vh; width: auto; border-radius: 14px; }
.lightbox button { position: fixed; background: rgba(255, 255, 255, .1); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, .2); }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 16px; top: 50%; }
.lightbox .lb-next { right: 16px; top: 50%; }

/* ---------- FAQ: <div class="faq"><details><summary>Q</summary><div><p>A</p></div></details></div> */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 56px 18px 22px; font-weight: 800; font-size: 1.05rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--accent); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details > div { padding: 0 22px 18px; color: var(--muted); }
.faq details > div p:last-child { margin: 0; }

/* ---------- callout & CTA band */
.callout { display: flex; gap: 18px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 20px 22px; }
.callout .feature-ico { margin: 0; flex: none; }
.callout p:last-child { margin: 0; }

.cta-band {
	border-radius: 28px; padding: clamp(32px, 6vw, 64px);
	background:
		radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 50%),
		linear-gradient(135deg, var(--surface-2), var(--surface));
	border: 1px solid var(--line);
	text-align: center;
}
.cta-band .lead { margin: 0 auto; }

/* ---------- game cards (home + "more from the studio") */
.game-card {
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
	text-decoration: none; color: var(--text);
	transition: transform .2s, border-color .2s, box-shadow .2s;
}
.game-card:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, .2); box-shadow: var(--shadow); color: var(--text); }
.game-card-art { aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.game-card-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.game-card:hover .game-card-art img { transform: scale(1.04); }
.game-card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.game-card-body h3 { margin: 4px 0 0; }
.game-card-body p { color: var(--muted); margin: 0; }
.game-card-body .more { margin-top: auto; padding-top: 8px; font-weight: 800; color: var(--gold); }
.game-card .badge { align-self: flex-start; }

/* ---------- footer */
.footer { border-top: 1px solid var(--line); background: #080E1B; padding: 56px 0 28px; margin-top: 40px; color: var(--muted); font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 32px; }
.footer-brand { display: flex; gap: 16px; align-items: flex-start; }
.footer-brand img { width: 56px; height: 56px; }
.footer-h { font-family: var(--body); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--text); margin-bottom: 12px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 8px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line); margin-top: 36px; padding-top: 22px; font-size: .88rem; }
.footer-bottom p { margin: 0; }
.footer .langs { margin: 0; }
.footer .langs a[aria-current] { color: #1A1200; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- language suggestion */
.lang-hint {
	position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 460px; margin-left: auto;
	display: flex; align-items: center; gap: 12px;
	background: var(--surface-2); border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px;
	padding: 12px 12px 12px 18px; box-shadow: var(--shadow); font-weight: 700; font-size: .95rem;
}
.lang-hint a { margin-left: auto; white-space: nowrap; }
.lang-hint button { background: none; border: 0; color: var(--muted); font-size: 1.3rem; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; }
.lang-hint button:hover { background: rgba(255, 255, 255, .08); color: var(--text); }

/* ---------- reveal on scroll (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- legal pages */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.5rem; margin-top: 1.8em; }
.prose h3 { font-family: var(--body); font-weight: 800; font-size: 1.1rem; margin-top: 1.6em; }
.prose p, .prose li { color: #CBD3E4; }
.prose .updated { color: var(--muted); font-size: .95rem; }
.toc { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 8px; }
