/* =====================================================================
   Game Resource Hub — "Level editor" design system
   Light sky canvas + white panels with chunky ink borders and hard
   pixel shadows. Pixel display font for headings, a highly readable
   body font for everything you actually read.
   ===================================================================== */

@font-face { font-family: "Pixelify Sans"; src: url("../fonts/pixelify-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url("../fonts/pixelify-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --font-pixel: "Pixelify Sans", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --canvas: #d6eaf7;      /* page: pale sky with a tile grid */
  --grid: #c6e0f2;
  --hero-sky: #bfe0f6;
  --paper: #ffffff;       /* panels */
  --paper-2: #f1f7fc;
  --ink: #1c2333;         /* borders, shadows, text */
  --text: #1c2333;
  --muted: #47526a;
  --orange: #f2711c;      /* Gamedoora orange — primary actions */
  --orange-hover: #ff8a3d;
  --link: #a8440a;
  --night: #1c2742;       /* dark bands and footer */
  --night-text: #eef2fa;
  --night-muted: #b9c4da;

  --b: 3px;               /* border width */
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --wrap: 1140px;
  --gutter: 20px;

  /* badge colours: background / text */
  --free-bg: #d8f2d6;  --free-fg: #1c5c22;
  --plans-bg: #dbe8ff; --plans-fg: #1f4a8a;
  --paid-bg: #ffe2cc;  --paid-fg: #8a3a0b;
  --oss-bg: #ebe2ff;   --oss-fg: #4b2e9e;
  --easy-bg: #fff0b8;  --easy-fg: #644900;
  --jam-bg: #ffdbe7;   --jam-fg: #87204a;

  /* category tints */
  --sky-bg: #cde6fb;    --sky-fg: #164a7a;
  --grass-bg: #d4f0cf;  --grass-fg: #23602a;
  --sun-bg: #ffe9a8;    --sun-fg: #644900;
  --berry-bg: #ffd7e6;  --berry-fg: #87204a;
  --clay-bg: #ffdcc7;   --clay-fg: #8a3a0b;
  --violet-bg: #e6dcff; --violet-fg: #4b2e9e;

  color-scheme: light;
}

/* Dark theme: night sky. Follows the system unless the visitor picks one. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --canvas: #141d33; --grid: #18233d; --hero-sky: #1b2a4a; --paper: #1f2b47; --paper-2: #243252; --ink: #070b16; --text: #eef2fa; --muted: #b6c0d4; --link: #ffa266; --night: #0e1528; --free-bg: #1d4a26; --free-fg: #c9f0c4; --plans-bg: #1d3560; --plans-fg: #cfe0ff; --paid-bg: #5a2c10; --paid-fg: #ffd9bf; --oss-bg: #36265f; --oss-fg: #e2d6ff; --easy-bg: #4d3d05; --easy-fg: #ffe9a0; --jam-bg: #5a1a35; --jam-fg: #ffd2e2; --sky-bg: #1e4466; --sky-fg: #d6ebff; --grass-bg: #224a26; --grass-fg: #d3f2cd; --sun-bg: #5a4708; --sun-fg: #ffeeb0; --berry-bg: #5a1d38; --berry-fg: #ffd6e5; --clay-bg: #5c2e14; --clay-fg: #ffdcc7; --violet-bg: #3a2a66; --violet-fg: #e6dcff; color-scheme: dark; }
}
:root[data-theme="dark"] .hero::before, :root[data-theme="dark"] .hero::after { opacity: .16; }
:root[data-theme="dark"] .hero__scene { --pk-blue: #8fb8ff; --pk-orange: #ff9a55; --pk-green: #8ee08a; --pk-brown: #f2c46b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero::before, :root:not([data-theme="light"]) .hero::after { opacity: .16; }
  :root:not([data-theme="light"]) .hero__scene { --pk-blue: #8fb8ff; --pk-orange: #ff9a55; --pk-green: #8ee08a; --pk-brown: #f2c46b; }
}
:root[data-theme="dark"] { --canvas: #141d33; --grid: #18233d; --hero-sky: #1b2a4a; --paper: #1f2b47; --paper-2: #243252; --ink: #070b16; --text: #eef2fa; --muted: #b6c0d4; --link: #ffa266; --night: #0e1528; --free-bg: #1d4a26; --free-fg: #c9f0c4; --plans-bg: #1d3560; --plans-fg: #cfe0ff; --paid-bg: #5a2c10; --paid-fg: #ffd9bf; --oss-bg: #36265f; --oss-fg: #e2d6ff; --easy-bg: #4d3d05; --easy-fg: #ffe9a0; --jam-bg: #5a1a35; --jam-fg: #ffd2e2; --sky-bg: #1e4466; --sky-fg: #d6ebff; --grass-bg: #224a26; --grass-fg: #d3f2cd; --sun-bg: #5a4708; --sun-fg: #ffeeb0; --berry-bg: #5a1d38; --berry-fg: #ffd6e5; --clay-bg: #5c2e14; --clay-fg: #ffdcc7; --violet-bg: #3a2a66; --violet-fg: #e6dcff; color-scheme: dark; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--canvas);
  background-image:
    linear-gradient(90deg, var(--grid) 2px, transparent 2px),
    linear-gradient(var(--grid) 2px, transparent 2px);
  background-size: 32px 32px;
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font-body);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { text-decoration-thickness: 3px; }
h1, h2, h3 { font-family: var(--font-pixel); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(2rem, 4.4vw, 3.15rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
code { font-size: .92em; background: var(--paper-2); padding: .1em .35em; border: 1px solid var(--grid); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--paper); color: var(--text); border: var(--b) solid var(--ink); padding: 8px 14px; }
.skip:focus { top: 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.px { width: 24px; height: 24px; flex: none; }
.show-sm { display: none; }
[hidden] { display: none !important; }

/* ---------- buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font: 700 1.05rem/1.1 var(--font-pixel);
  color: var(--ink); background: var(--orange);
  border: var(--b) solid var(--ink); box-shadow: var(--shadow);
  padding: .7em 1.15em; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--orange-hover); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:focus-visible { outline-color: var(--ink); }
.btn--small { font-size: .95rem; padding: .5em .85em; box-shadow: var(--shadow-sm); }
.btn--ghost { background: var(--paper); color: var(--text); }
.btn--ghost:hover { background: var(--paper-2); }
.btn--light { background: #fff; color: #1c2333; }
.btn--light:hover { background: #ffe9d6; }
.btn--block { display: flex; width: 100%; }
.textlink { font-weight: 700; color: var(--link); }

/* ---------- header ---------- */
.site-header { background: var(--paper); border-bottom: var(--b) solid var(--ink); }
.bar { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 700 1.25rem/1 var(--font-pixel); white-space: nowrap; }
.brand img { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--text); text-decoration: none; font-weight: 700; white-space: nowrap; padding: 8px 10px; border-bottom: 3px solid transparent; }
.nav a:hover { border-bottom-color: var(--grid); }
.nav a[aria-current="page"] { border-bottom-color: var(--orange); }
.bar__actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle { width: 42px; height: 42px; display: grid; place-items: center; background: var(--paper); color: var(--text); border: var(--b) solid var(--ink); box-shadow: var(--shadow-sm); cursor: pointer; padding: 0; }
.theme-toggle:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.theme-toggle .px { width: 20px; height: 20px; }
.theme-toggle__light { display: none; }
:root[data-theme="dark"] .theme-toggle__light { display: block; }
:root[data-theme="dark"] .theme-toggle__dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__light { display: block; }
  :root:not([data-theme="light"]) .theme-toggle__dark { display: none; }
}

/* ---------- hero: the one loud moment ---------- */
.hero { position: relative; background: var(--hero-sky); border-bottom: var(--b) solid var(--ink); overflow: hidden; }
.hero::before, .hero::after { content: ""; position: absolute; background: url("../img/cloud.svg") no-repeat center / contain; pointer-events: none; }
.hero::before { width: 168px; height: 70px; right: 34%; top: 22px; }
.hero::after { width: 112px; height: 47px; right: 5%; top: 92px; }
.hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .9fr); gap: 32px; align-items: end; padding-top: 72px; }
.hero__copy { padding-bottom: 56px; }
.hero h1 { max-width: 22ch; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 60ch; }
.hero .lede { color: var(--text); }

.search { display: flex; align-items: center; gap: 10px; background: var(--paper); border: var(--b) solid var(--ink); box-shadow: var(--shadow); padding: 6px 6px 6px 14px; max-width: 620px; }
.search__icon { color: var(--muted); width: 22px; height: 22px; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: 400 1.15rem/1.4 var(--font-body); padding: 10px 4px; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--orange); outline-offset: 3px; }
.search input::placeholder { color: var(--muted); opacity: .85; }
.search .btn { box-shadow: none; }
.search .btn:active { transform: none; }
.try { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 22px; font-size: .98rem; }
.try span { color: var(--text); font-weight: 700; }
.try a { color: var(--text); background: color-mix(in srgb, var(--paper) 70%, transparent); border: 2px solid var(--ink); padding: 3px 10px; text-decoration: none; }
.try a:hover { background: var(--paper); }

.hero__scene { position: relative; height: 340px; --pk-blue: #2a62b8; --pk-orange: #c2410c; --pk-green: #2f7a35; --pk-brown: #8a5a10; }
.hero__builder { position: absolute; bottom: 0; left: 34%; width: 112px; height: 150px; }
.pickup { position: absolute; width: 64px; height: 64px; display: grid; place-items: center; background: var(--paper); border: var(--b) solid var(--ink); box-shadow: var(--shadow); animation: bob 2.4s steps(2, jump-none) infinite; }
.pickup .px { width: 36px; height: 36px; }
.pickup--1 { left: 4%; top: 120px; color: var(--pk-blue); }
.pickup--2 { left: 30%; top: 30px; color: var(--pk-orange); animation-delay: .6s; }
.pickup--3 { left: 58%; top: 96px; color: var(--pk-green); animation-delay: 1.2s; }
.pickup--4 { right: 6%; bottom: 0; color: var(--pk-brown); animation: none; width: 72px; height: 72px; }
.pickup--4 .px { width: 42px; height: 42px; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.ground { height: 48px; background: url("../img/ground.svg") repeat-x 0 0 / 48px 48px; image-rendering: pixelated; }
@media (prefers-reduced-motion: reduce) { .pickup { animation: none; } }

/* ---------- sections ---------- */
.section { padding-top: 72px; }
.section--tight { padding-top: 8px; }
.section__head { margin-bottom: 24px; }
.section__head p { color: var(--muted); max-width: 64ch; margin: 0; }
.section__head--row { display: flex; justify-content: space-between; align-items: end; gap: 16px 32px; flex-wrap: wrap; }
.page-head { padding-top: 48px; padding-bottom: 28px; }
.page-head h1 { margin-bottom: .35em; }
.page-head__row { display: flex; gap: 22px; align-items: flex-start; }
.meta { color: var(--muted); font-weight: 700; }
.crumbs { font-size: .95rem; margin-bottom: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.aside-note { margin-top: 28px; color: var(--muted); }
.panel { background: var(--paper); border: var(--b) solid var(--ink); box-shadow: var(--shadow); padding: 24px; }
.panel h2 { font-size: 1.4rem; }
.panel--plain { box-shadow: none; background: var(--paper-2); }

/* ---------- "Start here" levels (a real sequence, so numbered) ---------- */
.levels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; counter-reset: none; }
.level { background: var(--paper); border: var(--b) solid var(--ink); box-shadow: var(--shadow); padding: 22px 22px 20px; display: flex; flex-direction: column; }
.level p { color: var(--muted); }
.level__chip { align-self: flex-start; display: inline-block; font: 700 .95rem/1 var(--font-pixel); background: var(--grass-bg); color: var(--grass-fg); border: 2px solid var(--ink); padding: 5px 9px 6px; margin-bottom: 14px; }
.picks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.picks a { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--text); padding: 8px; border: 2px solid transparent; background: var(--paper-2); }
.picks a:hover { border-color: var(--ink); }
.picks strong { display: block; line-height: 1.25; }
.picks small { display: block; color: var(--muted); font-size: .92rem; line-height: 1.35; }
.level .textlink { margin-top: auto; }

/* ---------- categories ---------- */
.cat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.cat { display: flex; align-items: center; gap: 14px; height: 100%; padding: 14px 16px; background: var(--paper); border: var(--b) solid var(--ink); box-shadow: var(--shadow-sm); color: var(--text); text-decoration: none; }
.cat:hover { border-color: var(--orange); }
.cat__icon { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border: 2px solid var(--ink); }
.cat__icon .px { width: 30px; height: 30px; }
.cat__icon--lg { width: 76px; height: 76px; border-width: var(--b); box-shadow: var(--shadow-sm); }
.cat__icon--lg .px { width: 44px; height: 44px; }
.cat__icon--sm { width: 36px; height: 36px; }
.cat__icon--sm .px { width: 20px; height: 20px; }
.cat__body { flex: 1; min-width: 0; }
.cat__body strong { display: block; font: 700 1.12rem/1.2 var(--font-pixel); }
.cat__body span { display: block; color: var(--muted); font-size: .95rem; line-height: 1.4; }
.cat__count { font: 700 .95rem/1 var(--font-pixel); min-width: 34px; text-align: center; padding: 6px 4px; background: var(--paper-2); border: 2px solid var(--ink); }

.tint-sky    { background: var(--sky-bg);    color: var(--sky-fg); }
.tint-grass  { background: var(--grass-bg);  color: var(--grass-fg); }
.tint-sun    { background: var(--sun-bg);    color: var(--sun-fg); }
.tint-berry  { background: var(--berry-bg);  color: var(--berry-fg); }
.tint-clay   { background: var(--clay-bg);   color: var(--clay-fg); }
.tint-violet { background: var(--violet-bg); color: var(--violet-fg); }

/* ---------- dark band + loadout (inventory) ---------- */
.band { margin-top: 80px; padding: 56px 0 48px; border-block: var(--b) solid var(--ink); }
.band--night { background: var(--night); color: var(--night-text); }
.band--night .section__head p, .band__more { color: var(--night-muted); }
.band__more { margin: 24px 0 0; }
.band__more a { color: #ffb27d; font-weight: 700; margin-left: 10px; }
.loadout { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 136px), 1fr)); gap: 14px; }
.slot { display: flex; flex-direction: column; gap: 8px; }
.slot__kind { display: flex; align-items: center; gap: 6px; font: 700 .95rem/1.1 var(--font-pixel); color: inherit; }
.slot__icon { width: 18px; height: 18px; color: var(--orange); }
.slot__item { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 16px 10px 14px; background: var(--paper); color: var(--text); border: var(--b) solid var(--ink); box-shadow: var(--shadow-sm); text-decoration: none; flex: 1; }
.slot__item:hover { border-color: var(--orange); }
.slot__name { font-weight: 700; line-height: 1.25; }
.slot__note { font-size: .95rem; color: var(--muted); margin: 0; }
.band--night .slot__note { color: var(--night-muted); }
.loadout--notes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 22px 18px; }
.loadout--notes .slot__item { flex: none; flex-direction: row; text-align: left; justify-content: flex-start; padding: 12px; }

/* ---------- resource cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr)); gap: 20px; }
.card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--paper); border: var(--b) solid var(--ink); box-shadow: var(--shadow); }
.card[hidden] { display: none; }
.card:hover { border-color: var(--orange); }
.card:focus-within { outline: 3px solid var(--orange); outline-offset: 3px; }
.card__top { display: flex; gap: 12px; align-items: center; }
.card__title { min-width: 0; }
.card__name { font-size: 1.18rem; margin: 0; }
.card__link { color: var(--text); text-decoration: none; }
.card__link::after { content: ""; position: absolute; inset: 0; }
.card__link:focus-visible { outline: none; }
.card__cat { margin: 2px 0 0; font-size: .9rem; color: var(--muted); }
.card__tagline { margin: 0; color: var(--text); line-height: 1.45; }
.card .badges { margin-top: auto; }

.logo { flex: none; display: grid; place-items: center; border: 2px solid var(--ink); font: 700 1.35rem/1 var(--font-pixel); }
.logo--sm { width: 34px; height: 34px; font-size: 1.05rem; }
.logo--md { width: 46px; height: 46px; }
.logo--lg { width: 84px; height: 84px; font-size: 2.4rem; border-width: var(--b); box-shadow: var(--shadow-sm); }
.logo--img { background: #fff; padding: 4px; }
.logo--img img { width: 100%; height: 100%; object-fit: contain; }

.badges { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: .85rem; font-weight: 700; line-height: 1.2; padding: 4px 8px; border: 2px solid currentColor; }
.badge--free  { background: var(--free-bg);  color: var(--free-fg); }
.badge--plans { background: var(--plans-bg); color: var(--plans-fg); }
.badge--paid  { background: var(--paid-bg);  color: var(--paid-fg); }
.badge--oss   { background: var(--oss-bg);   color: var(--oss-fg); }
.badge--easy  { background: var(--easy-bg);  color: var(--easy-fg); }
.badge--jam   { background: var(--jam-bg);   color: var(--jam-fg); }

/* ---------- explore ---------- */
.explore { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px 32px; align-items: start; padding-bottom: 8px; }
.explore__search { grid-column: 1 / -1; }
.search--wide { max-width: none; }
.filters { display: grid; gap: 20px; position: sticky; top: 16px; }
.filters__panel { background: var(--paper); border: var(--b) solid var(--ink); box-shadow: var(--shadow); padding: 4px 18px 18px; }
.filters__summary { font: 700 1.25rem/1 var(--font-pixel); padding: 14px 0 6px; cursor: pointer; list-style: none; }
.filters__summary::-webkit-details-marker { display: none; }
.filters__summary::after { content: "+"; float: right; font-size: 1.4rem; line-height: .8; }
.filters__panel[open] .filters__summary::after { content: "–"; }
.filter { border: 0; margin: 0; padding: 14px 0 0; min-width: 0; }
.filter + .filter { box-shadow: inset 0 2px 0 var(--grid); margin-top: 12px; }
legend.filter__label { float: left; width: 100%; }
legend.filter__label + * { clear: both; }
.filter__label { display: block; font-weight: 700; margin-bottom: 6px; padding: 0; }
.filter select { width: 100%; font: inherit; color: var(--text); background: var(--paper); border: 2px solid var(--ink); padding: 8px; }
.check { display: flex; align-items: center; gap: 10px; padding: 3px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); margin: 0; }
.filter--actions { display: flex; align-items: center; gap: 16px; }
.glossary { background: var(--paper-2); border: 2px solid var(--ink); padding: 12px 16px; font-size: .97rem; }
.glossary summary { font-weight: 700; cursor: pointer; }
.glossary dl { margin: 12px 0 0; }
.glossary dt { font-weight: 700; margin-top: 10px; }
.glossary dd { margin: 0; color: var(--muted); }
.results__count { font-weight: 700; margin: 0 0 16px; }
.empty { display: flex; gap: 20px; align-items: center; background: var(--paper); border: var(--b) dashed var(--ink); padding: 22px; margin-top: 8px; }
.empty[hidden] { display: none; }
.empty__npc { width: 72px; height: 72px; flex: none; color: var(--orange); }
.empty__title { font: 700 1.25rem/1.2 var(--font-pixel); margin-bottom: .3em; }

/* ---------- chips (sub-categories) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip { color: var(--text); background: var(--paper); border: 2px solid var(--ink); padding: 5px 11px; text-decoration: none; font-size: .95rem; font-weight: 700; }
.chip:hover { background: var(--paper-2); }
.chip[aria-current="page"] { background: var(--orange); color: #1c2333; }

/* ---------- resource detail ---------- */
.detail__head { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 32px; }
.detail__head h1 { margin-bottom: .2em; }
.detail__head .lede { margin-bottom: 14px; }
.detail__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.detail__main { display: grid; gap: 24px; }
.detail__main p { max-width: 68ch; }
.ticks { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 28px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .42em; width: 14px; height: 14px; background: var(--orange); border: 2px solid var(--ink); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; color: var(--muted); }
.note { background: var(--sun-bg); color: var(--sun-fg); border: var(--b) solid var(--ink); padding: 18px 20px; }
.note p { margin: 0; max-width: 68ch; }
.note__title { font: 700 1.15rem/1.2 var(--font-pixel); margin-bottom: .4em !important; }
.detail__side { position: sticky; top: 16px; }
.stats__title { font-size: 1.25rem; }
.stats dl { margin: 0 0 20px; display: grid; grid-template-columns: 1fr; }
.stats dt { font-size: .9rem; color: var(--muted); margin-top: 12px; }
.stats dt:first-child { margin-top: 0; }
.stats dd { margin: 2px 0 0; font-weight: 700; }
.stats .stats__note { font-weight: 400; font-size: .92rem; color: var(--muted); }
.stats__small { font-size: .88rem; color: var(--muted); margin: 12px 0 0; }
.report { margin: 18px 4px 0; font-size: .95rem; }

/* ---------- misc pages ---------- */
.stack-list { display: grid; gap: 28px; }
.stack-card h2 a { color: var(--text); text-decoration: none; }
.stack-card h2 a:hover { text-decoration: underline; }
.tips { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.tips li { background: var(--paper); border: var(--b) solid var(--ink); padding: 18px 20px; }
.tips h3 { font-size: 1.12rem; }
.tips p { margin: 0; color: var(--muted); }
.group + .group { margin-top: 48px; }
.group__title { display: flex; align-items: center; gap: 12px; font-size: 1.4rem; }
.suggest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.suggest .panel--plain { grid-column: 1 / -1; }
.suggest .panel { display: flex; flex-direction: column; align-items: flex-start; }
.suggest .panel .btn { margin-top: auto; }
.prose { display: grid; gap: 24px; }
.prose .panel { max-width: 820px; }
.contribute { display: flex; justify-content: space-between; align-items: center; gap: 24px 40px; flex-wrap: wrap; background: var(--paper); border: var(--b) solid var(--ink); box-shadow: var(--shadow); padding: 28px 30px; }
.contribute h2 { margin-bottom: .3em; }
.contribute p { margin: 0; color: var(--muted); max-width: 60ch; }
.contribute__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.gameover { padding-top: 80px; padding-bottom: 40px; }
.gameover__big { font: 700 clamp(3rem, 10vw, 6rem)/1 var(--font-pixel); color: var(--orange); text-shadow: 5px 5px 0 var(--ink); margin-bottom: 24px; }
.gameover__actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- footer ---------- */
.site-footer { margin-top: 96px; background: var(--night); color: var(--night-text); border-top: var(--b) solid var(--ink); padding: 48px 0 28px; }
.site-footer a { color: var(--night-text); }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; }
.footer__title { font: 700 1.3rem/1.2 var(--font-pixel); }
.footer__about p { color: var(--night-muted); max-width: 46ch; }
.footer__head { font: 700 1.05rem/1.2 var(--font-pixel); margin-bottom: 10px; }
.footer__links { display: flex; flex-direction: column; gap: 6px; }
.made-by { display: inline-flex; align-items: center; gap: 12px; background: #fff; color: #1c2333 !important; text-decoration: none; padding: 8px 14px; border: var(--b) solid var(--ink); font-weight: 700; font-size: .9rem; }
.made-by img { width: 150px; height: auto; }
.footer__legal { margin-top: 36px; padding-top: 18px; border-top: 2px dashed rgba(255, 255, 255, .18); }
.footer__legal p { margin: 0; font-size: .9rem; color: var(--night-muted); }

/* ---------- touch screens & installed app ---------- */
@media (pointer: coarse) {
  .check { min-height: 40px; }
  .check input { width: 22px; height: 22px; }
  .chip, .try a { padding-block: 8px; }
  .footer__links a { padding-block: 6px; }
}
/* Respect the notch / home indicator when installed as an app */
.site-header { padding-top: env(safe-area-inset-top); }
.wrap { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.site-footer { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
@media (display-mode: standalone) {
  .site-header { position: sticky; top: 0; z-index: 5; }
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .levels { grid-template-columns: 1fr; }
  .detail__grid { grid-template-columns: 1fr; }
  .detail__side { position: static; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__about { grid-column: 1 / -1; }
  .hero__grid { grid-template-columns: 1fr; padding-top: 48px; }
  .hero__copy { padding-bottom: 0; }
  .hero__scene { height: 230px; max-width: 460px; width: 100%; justify-self: center; }
  .hero__builder { width: 90px; height: 120px; }
  .pickup { width: 52px; height: 52px; }
  .pickup .px { width: 28px; height: 28px; }
  .pickup--1 { top: 80px; } .pickup--2 { top: 10px; } .pickup--3 { top: 60px; }
  .hero::before { right: 8%; top: 12px; width: 120px; }
  .hero::after { display: none; }
}
@media (max-width: 860px) {
  .bar { flex-wrap: wrap; gap: 8px 16px; padding-top: 12px; }
  .bar__actions { margin-left: auto; }
  .nav { order: 3; width: 100%; margin: 0 calc(var(--gutter) * -1); padding: 0 calc(var(--gutter) - 10px); overflow-x: auto; scrollbar-width: none; }
  .explore { grid-template-columns: 1fr; }
  .filters { position: static; }
  .suggest { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  body { font-size: 1rem; }
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .nav a { padding: 10px 8px; font-size: .97rem; }
  .nav { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 28px; }
  .brand { gap: 8px; }
  .brand span { font-size: 1rem; }
  .brand img { width: 26px; height: 26px; }
  .bar { gap: 8px 10px; }
  .bar__actions { gap: 8px; }
  .theme-toggle { width: 38px; height: 38px; }
  .search { flex-wrap: wrap; padding: 6px; }
  .search__icon { display: none; }
  .search input { padding: 8px; }
  .search .btn { width: 100%; }
  .section:not(.section--tight) { padding-top: 56px; }
  .hero::before { display: none; }
  .page-head__row, .detail__head { flex-direction: column; gap: 16px; }
  .footer__grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
  .contribute { padding: 22px; }
}
