/* Phantom Shapes Wiki. Colors come from the game logo (white, sky blue, red outline)
   and the mall wing accents (teal hub, orange West, sky East, lemon North). */
@font-face { font-family: "PS Pixel"; src: url("/assets/fonts/PressStart2P-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Ark Pixel"; src: url("/assets/fonts/ArkPixel12-Latin-PS.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #14121c; --bg-2: #1b1826; --panel: #221e33; --panel-2: #2b2640; --line: #403a5e;
  --text: #ece8f4; --muted: #bdb6d3; --link: #8fdcff; --link-visited: #c8b6ff;
  --sky: #3fc6f4; --sky-deep: #1c8de0; --red: #e8323b; --ink: #0d0b14;
  --teal: #3fa9a4; --orange: #e69f00; --east: #56b4e9; --lemon: #f0e442;
  --worker: #f0e442; --phantom: #c39bff;
  --shadow: #07060b; --focus: #f0e442;
  /* Same fonts as the game: Ark Pixel for text, Press Start 2P for titles.
     The "Aa" button switches to a plain font for easier reading (html[data-font="plain"]). */
  --plain: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --body: "Ark Pixel", var(--plain);
  --fs: 1.25rem; --lh: 1.6;
  --pixel: "PS Pixel", "Courier New", monospace;
  --pixel-2: "Ark Pixel", var(--plain);
  --bold: 0.07em 0 0 currentColor;
  color-scheme: dark;
}
:root[data-font="plain"] { --body: var(--plain); --pixel-2: var(--plain); --fs: 1.125rem; --lh: 1.65; --bold: none; }
:root[data-theme="light"] {
  --bg: #f4f1ea; --bg-2: #ebe6db; --panel: #ffffff; --panel-2: #f7f4ee; --line: #c9c1b3;
  --text: #1b1726; --muted: #4a4458; --link: #0b5fa8; --link-visited: #5b3a9e;
  --sky-deep: #0a6fb8; --ink: #ffffff; --worker: #8a6d00; --phantom: #6a3fc0;
  --shadow: #b9b0a0; --focus: #0b5fa8;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f1ea; --bg-2: #ebe6db; --panel: #ffffff; --panel-2: #f7f4ee; --line: #c9c1b3;
    --text: #1b1726; --muted: #4a4458; --link: #0b5fa8; --link-visited: #5b3a9e;
    --sky-deep: #0a6fb8; --ink: #ffffff; --worker: #8a6d00; --phantom: #6a3fc0;
    --shadow: #b9b0a0; --focus: #0b5fa8;
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--fs)/var(--lh) var(--body); font-synthesis: none; }
/* Pixel fonts have no bold: a 1-pixel side shadow makes a crisp bold instead of a smeared one. */
strong, b, th, .tile-name, .callout-title, .btn, .sidenav a[aria-current="page"], summary, kbd, .r-title, .ladder strong { font-weight: 400; text-shadow: var(--bold); }
:root[data-font="plain"] strong, :root[data-font="plain"] b, :root[data-font="plain"] th, :root[data-font="plain"] .tile-name,
:root[data-font="plain"] .callout-title, :root[data-font="plain"] .btn, :root[data-font="plain"] summary, :root[data-font="plain"] .ladder strong { font-weight: 700; }
input, button { font-family: inherit; }
img { max-width: 100%; height: auto; }
.pixel-img, .icon, .logo-img { image-rendering: pixelated; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.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: 1rem; top: -4rem; z-index: 50; background: var(--focus); color: #000; padding: 0.6rem 1rem; font-weight: 700; }
.skip:focus { top: 1rem; }
.small { font-size: 0.95rem; color: var(--muted); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 1rem; background: var(--bg-2); border-bottom: 3px solid var(--line); }
.brand { display: flex; align-items: center; gap: 0.4rem; text-decoration: none; color: var(--text); flex: none; }
.brand img { width: 139px; height: auto; image-rendering: pixelated; }
.brand-word { font: 0.8rem/1 var(--pixel); color: var(--sky); padding-top: 0.6rem; }
.search { position: relative; flex: 1; max-width: 32rem; margin-left: auto; }
.search input { width: 100%; min-height: 44px; padding: 0.55rem 0.8rem; font: inherit; font-size: 1rem; color: var(--text); background: var(--panel); border: 2px solid var(--line); border-radius: 0; }
.search input::placeholder { color: var(--muted); }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 0; list-style: none; background: var(--panel); border: 2px solid var(--line); box-shadow: 4px 4px 0 var(--shadow); max-height: 70vh; overflow: auto; }
.search-results li a { display: block; padding: 0.6rem 0.8rem; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.search-results li a:hover, .search-results li a[aria-selected="true"] { background: var(--panel-2); }
.search-results .r-title { display: block; font-weight: 700; color: var(--link); }
.search-results .r-snip { display: block; font-size: 0.9rem; color: var(--muted); }
.search-results .r-none { padding: 0.6rem 0.8rem; color: var(--muted); }
.search-results.search-page { position: static; max-height: none; box-shadow: 4px 4px 0 var(--shadow); }
.menu-btn { flex: none; min-width: 44px; min-height: 44px; background: var(--panel); color: var(--text); border: 2px solid var(--line); font-size: 1.2rem; cursor: pointer; }
.menu-btn { display: none; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 20px; height: 3px; background: currentColor; margin: 0 auto; position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -7px; } .menu-icon::after { top: 7px; }

/* ---------- blocky buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0.65rem 1.2rem; font-weight: 800; font-size: 1.05rem; text-decoration: none; color: #0d0b14; background: var(--sky); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--shadow); clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px)); }
.btn:visited { color: #0d0b14; }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translate(2px, 2px); }
.btn-steam { background: var(--lemon); }
.btn-ghost { background: var(--panel-2); color: var(--text); }
.btn-ghost:visited { color: var(--text); }
.topbar-steam { flex: none; font-size: 0.95rem; min-height: 44px; padding: 0.4rem 0.9rem; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); max-width: 92rem; margin: 0 auto; }
.sidenav { position: sticky; top: 4.6rem; align-self: start; max-height: calc(100vh - 4.6rem); overflow: auto; padding: 1.25rem 1rem 2rem; border-right: 2px solid var(--line); }
.sidenav .nav-group { margin: 1.1rem 0 0.35rem; font: 0.65rem/1.4 var(--pixel); letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; }
.sidenav .nav-group:first-child { margin-top: 0; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav a { display: flex; align-items: center; gap: 0.55rem; padding: 0.3rem 0.6rem; color: var(--text); text-decoration: none; border-left: 4px solid transparent; font-size: 1rem; }
.sidenav a img { flex: none; width: 32px; height: 32px; image-rendering: pixelated; } /* 16x16 art at exactly 2x */
.sidenav a:hover { background: var(--panel); }
.sidenav a:hover img { transform: translateY(-2px); }
.sidenav a[aria-current="page"] { border-left-color: var(--sky); background: var(--panel); font-weight: 700; }
main { padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 4rem; min-width: 0; }
main:focus { outline: none; }
.page { position: relative; max-width: 52rem; }
.page:has(> .home), .page:has(> .wide) { max-width: none; }

.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.3rem; list-style: none; margin: 0 0 1rem; padding: 0; font-size: 0.95rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 0.3rem; }
.crumbs a { color: var(--muted); }

/* ---------- type ---------- */
h1, h2, h3 { line-height: 1.3; text-wrap: balance; }
h1 { font: 1.6rem/1.45 var(--pixel); margin: 0 0 1rem; color: var(--text); text-shadow: 3px 3px 0 var(--shadow); }
h2 { font: 1.5rem/1.3 var(--pixel-2); margin: 2.5rem 0 0.75rem; padding-bottom: 0.3rem; border-bottom: 3px solid var(--line); }
h3 { font-size: 1.2rem; margin: 1.75rem 0 0.5rem; }
p, ul, ol, dl { margin: 0 0 1.1rem; }
.page p, .page li { max-width: 68ch; }
.lead { font-size: 1.25rem; color: var(--text); }
kbd { display: inline-block; min-width: 1.8em; padding: 0.05em 0.4em; font: 700 0.9em/1.4 var(--body); text-align: center; color: var(--text); background: var(--panel-2); border: 2px solid var(--line); border-bottom-width: 4px; }
.tag { display: inline-block; padding: 0.05rem 0.45rem; font-size: 0.85rem; font-weight: 700; border: 2px solid currentColor; vertical-align: middle; }
.tag-worker { color: var(--worker); } .tag-phantom { color: var(--phantom); }
hr { border: 0; border-top: 3px dashed var(--line); margin: 2.5rem 0; }

/* ---------- panels, callouts ---------- */
.panel { background: var(--panel); border: 2px solid var(--line); box-shadow: 4px 4px 0 var(--shadow); padding: 1rem 1.25rem; margin: 0 0 1.25rem; }
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.callout { border-left: 6px solid var(--sky); background: var(--panel); padding: 0.85rem 1.1rem; margin: 0 0 1.25rem; }
.callout p:last-child { margin-bottom: 0; }
.callout-tip { border-left-color: var(--teal); }
.callout-warn { border-left-color: var(--orange); }
.callout-title { display: block; font-weight: 800; margin-bottom: 0.2rem; }

/* ---------- infobox (tool, map, character) ---------- */
.infobox { float: right; width: 18rem; margin: 0 0 1.25rem 1.5rem; background: var(--panel); border: 2px solid var(--line); box-shadow: 4px 4px 0 var(--shadow); }
.infobox-title { margin: 0; padding: 0.6rem 0.8rem; font: 0.8rem/1.5 var(--pixel); background: var(--panel-2); border-bottom: 2px solid var(--line); text-align: center; }
.infobox-img { display: block; margin: 0 auto; padding: 0.75rem; }
.infobox table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
.infobox th, .infobox td { text-align: left; vertical-align: top; padding: 0.4rem 0.8rem; border-top: 1px solid var(--line); }
.infobox th { width: 42%; color: var(--muted); font-weight: 600; }
.clear { clear: both; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; border: 2px solid var(--line); background: var(--panel); }
table.data { width: 100%; border-collapse: collapse; font-size: 1rem; }
table.data caption { text-align: left; padding: 0.6rem 0.8rem; font-weight: 800; background: var(--panel-2); border-bottom: 2px solid var(--line); }
table.data th, table.data td { padding: 0.55rem 0.8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.data thead th { background: var(--panel-2); font-size: 0.95rem; }
table.data tbody tr:nth-child(even) { background: var(--bg-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data img.icon { vertical-align: middle; margin-right: 0.5rem; }

/* ---------- tool cards ---------- */
.tool { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 0 1rem; padding: 1.1rem 1.2rem; margin: 0 0 1.25rem; background: var(--panel); border: 2px solid var(--line); box-shadow: 4px 4px 0 var(--shadow); }
/* Tool icons are 32 px pixel art: show at exact 2x so every pixel stays square. */
.tool > :not(img) { grid-column: 2; }
.tool .stats { margin: 0.4rem 0 0.75rem; padding: 0.6rem 0 0; border-top: 1px dashed var(--line); }
.tool > :last-child { margin-bottom: 0; }
.tool > img { grid-column: 1; grid-row: 1 / span 2; align-self: start; box-sizing: content-box; width: 64px; height: 64px; background: var(--bg-2); border: 2px solid var(--line); padding: 4px; image-rendering: pixelated; }
.tool h3 { margin: 0 0 0.25rem; font-size: 1.3rem; }
.tool p { margin: 0 0 0.6rem; }
.tool .stats { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin: 0; padding: 0; list-style: none; font-size: 0.98rem; color: var(--muted); }
.tool .stats strong { color: var(--text); }
.tool-worker { border-left: 6px solid var(--worker); }
.tool-phantom { border-left: 6px solid var(--phantom); }

/* ---------- tiles (category grid) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 1rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.tile a { display: flex; align-items: center; gap: 0.9rem; height: 100%; padding: 0.9rem 1rem; color: var(--text); text-decoration: none; background: var(--panel); border: 2px solid var(--line); box-shadow: 4px 4px 0 var(--shadow); }
.tile a:hover { border-color: var(--sky); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--shadow); }
.tile img { flex: none; width: 64px; height: 64px; image-rendering: pixelated; }
.tile-name { display: block; font-weight: 800; font-size: 1.1rem; }
.tile-desc { display: block; font-size: 0.95rem; color: var(--muted); line-height: 1.4; }

/* ---------- map cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1.25rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.card { background: var(--panel); border: 2px solid var(--line); box-shadow: 4px 4px 0 var(--shadow); }
.card a { color: var(--text); text-decoration: none; display: block; height: 100%; }
.card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 2px solid var(--line); }
.card-body { display: block; padding: 0.8rem 1rem 1rem; }
.card-title { display: block; font: 0.75rem/1.6 var(--pixel); margin-bottom: 0.35rem; }
.card-desc { display: block; font-size: 0.98rem; color: var(--muted); line-height: 1.45; }
.card a:hover .card-title { color: var(--sky); }
.wing-hub { border-top: 6px solid var(--teal); } .wing-west { border-top: 6px solid var(--orange); }
.wing-east { border-top: 6px solid var(--east); } .wing-north { border-top: 6px solid var(--lemon); }

/* ---------- figures ---------- */
figure { margin: 0 0 1.5rem; }
figure img { display: block; border: 2px solid var(--line); }
figcaption { font-size: 0.95rem; color: var(--muted); margin-top: 0.4rem; }

/* ---------- spoilers ---------- */
details.spoiler { margin: 0 0 0.9rem; background: var(--panel); border: 2px dashed var(--line); }
details.spoiler > summary { cursor: pointer; padding: 0.7rem 1rem; font-weight: 700; list-style-position: inside; }
details.spoiler > summary:hover { background: var(--panel-2); }
details.spoiler[open] > summary { border-bottom: 2px dashed var(--line); }
details.spoiler .spoiler-body { padding: 0.8rem 1rem; }
details.spoiler .spoiler-body p:last-child { margin-bottom: 0; }
.note-paper { background: #efe6cf; color: #2a2318; padding: 1rem 1.2rem; border: 2px solid #b9a77c; box-shadow: 3px 3px 0 var(--shadow); font-family: Georgia, "Times New Roman", serif; }

/* ---------- home ---------- */
.hero { position: relative; margin: -1.5rem calc(-1 * clamp(1rem, 3vw, 2.5rem)) 2rem; padding: clamp(2rem, 6vw, 4.5rem) clamp(1rem, 4vw, 3rem); text-align: center; background: linear-gradient(180deg, rgba(10, 8, 18, 0.35), rgba(10, 8, 18, 0.88)), url("/assets/img/maps/mall-atrium.jpg") center / cover no-repeat; border-bottom: 4px solid var(--line); color: #f2eefa; }
.hero h1 { margin: 0; }
.hero .logo-img { width: min(556px, 92%); height: auto; filter: drop-shadow(6px 6px 0 #07060b); }
.hero-tagline { max-width: 40rem; margin: 1.25rem auto 1.5rem; font-size: 1.3rem; line-height: 1.5; color: #f2eefa; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.facts-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.75rem; margin: 1.75rem 0 0; padding: 0; list-style: none; font-weight: 700; color: #f2eefa; }
.facts-strip li::before { content: "\25A0"; color: var(--sky); margin-right: 0.45rem; }
.ladder { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 0 0 2rem; padding: 0; list-style: none; counter-reset: step; }
.ladder li { counter-increment: step; }
.ladder a { display: block; height: 100%; padding: 1rem 1.1rem; color: var(--text); text-decoration: none; background: var(--panel); border: 2px solid var(--line); box-shadow: 4px 4px 0 var(--shadow); }
.ladder a::before { content: counter(step); display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; margin-bottom: 0.6rem; font: 0.9rem/1 var(--pixel); color: #0d0b14; background: var(--sky); }
.ladder a:hover { border-color: var(--sky); }
.ladder strong { display: block; font-size: 1.15rem; }
.ladder span { display: block; color: var(--muted); font-size: 1rem; line-height: 1.45; }
.featured { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 1.25rem; align-items: center; }
.featured img { width: 96px; height: 96px; }
.featured h3 { margin-top: 0; }
.home h2 { font: 1.05rem/1.5 var(--pixel); border-bottom: 0; margin-top: 2.5rem; }

/* ---------- footer ---------- */
.footer { border-top: 3px solid var(--line); background: var(--bg-2); padding: 1.5rem 1rem 2rem; text-align: center; }
.footer p { margin: 0 0 0.5rem; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 62rem) {
  .topbar-steam { display: none; }
}
@media (max-width: 48rem) {
  .menu-btn { display: block; }
  .topbar { flex-wrap: wrap; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidenav { position: static; max-height: none; display: none; border-right: 0; border-bottom: 2px solid var(--line); }
  .sidenav.open { display: block; }
  .infobox { float: none; width: 100%; margin: 0 0 1.25rem; }
  h1 { font-size: 1.25rem; }
  .tool { grid-template-columns: 44px minmax(0, 1fr); gap: 0 0.75rem; padding: 0.9rem; }
  .tool > img { width: 32px; height: 32px; }
  .tile img { width: 32px; height: 32px; }
  .featured { grid-template-columns: 64px minmax(0, 1fr); }
  .featured img { width: 64px; height: 64px; }
}

@media (prefers-reduced-motion: no-preference) {
  .tile a, .btn { transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.08s ease; }
}
@media print {
  .topbar, .sidenav, .footer, .crumbs, .cursed-shape { display: none; }
  .layout { display: block; }
}

/* ---------- pixel icon buttons (easy-read font, light/dark) ---------- */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; padding: 0; background: var(--panel); color: var(--text); border: 2px solid var(--line); box-shadow: 3px 3px 0 var(--shadow); cursor: pointer; }
.icon-btn:hover { color: var(--sky); border-color: var(--sky); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
.icon-btn svg { width: 24px; height: 24px; }
.font-btn[aria-pressed="true"] { background: var(--sky); color: #0d0b14; border-color: var(--ink); }
.theme-btn .i-moon { color: var(--lemon); }
.theme-btn .i-sun { display: none; color: #f08a24; }
:root[data-theme="light"] .theme-btn .i-moon { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-btn .i-moon { display: none; }
  :root:not([data-theme="dark"]) .theme-btn .i-sun { display: block; }
}

/* ---------- blog ---------- */
.byline { margin: -0.4rem 0 1.4rem; color: var(--muted); font-size: 1rem; }
.post-list { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 0.9rem; }
.post-item a { display: grid; gap: 0.3rem; padding: 1rem 1.2rem; background: var(--panel); border: 2px solid var(--line); box-shadow: 4px 4px 0 var(--shadow); color: var(--text); text-decoration: none; }
.post-item a:hover { border-color: var(--sky); }
.post-title { font: 0.85rem/1.5 var(--pixel); color: var(--sky); }
.post-item time { font-size: 0.95rem; color: var(--muted); }
.post-desc { font-size: 1rem; }
.about-game { margin: 2rem 0; }

/* ---------- Steam logo inside links and buttons ---------- */
.steam-icon { width: 1.25em; height: 1.25em; flex: none; margin-right: 0.5em; vertical-align: -0.25em; }
.steam-link { display: inline-flex; align-items: center; }

/* ---------- page transitions (Chrome, Edge, Safari 18+; others just load normally) ---------- */
@view-transition { navigation: auto; }
.topbar { view-transition-name: topbar; }
.sidenav { view-transition-name: sidenav; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vt-out 0.18s steps(3) both; }
  ::view-transition-new(root) { animation: vt-in 0.28s steps(4) both; }
}
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }

/* ---------- scroll reveals (site.js adds .reveal only when motion is OK) ---------- */
.reveal { opacity: 0; transform: translateY(18px) scale(0.98); }
.reveal.in { animation: pixel-pop 0.36s steps(5) forwards; animation-delay: var(--d, 0s); }
@keyframes pixel-pop {
  0% { opacity: 0; transform: translateY(18px) scale(0.98); }
  70% { opacity: 1; transform: translateY(-3px) scale(1.01); }
  100% { opacity: 1; transform: none; }
}

/* ---------- hidden cursed shape (one per page) ---------- */
.cursed-shape { position: absolute; z-index: 5; width: 40px; height: 40px; padding: 4px; border: 0; background: none; cursor: pointer; opacity: 0.8; }
.cursed-shape img { display: block; width: 32px; height: 32px; image-rendering: pixelated; }
.cursed-shape:hover, .cursed-shape:focus-visible { opacity: 1; }
.cursed-shape.caught { animation: shape-caught 0.5s steps(5) forwards; pointer-events: none; }
@keyframes shape-caught { 40% { transform: scale(1.6) rotate(-12deg); } 100% { transform: scale(0) rotate(30deg); opacity: 0; } }
@keyframes shape-peek { 0%, 92% { transform: none; } 94% { transform: translateX(-2px) rotate(-8deg); } 96% { transform: translateX(2px) rotate(8deg); } 98% { transform: none; } }
@media (prefers-reduced-motion: no-preference) { .cursed-shape:not(.caught) { animation: shape-peek 7s steps(1) infinite; } }
.toast { position: fixed; left: 50%; bottom: 1.5rem; z-index: 60; transform: translateX(-50%); max-width: min(30rem, calc(100% - 2rem)); padding: 0.8rem 1.1rem; color: #0d0b14; background: var(--lemon); border: 3px solid #0d0b14; box-shadow: 4px 4px 0 var(--shadow); text-align: center; }
.toast[hidden] { display: none; }

/* ---------- 404: 2D Bob, confused ---------- */
.lost { margin: 0 0 1.5rem; padding: 1.5rem 1rem 1.25rem; border: 2px solid var(--line); background: radial-gradient(ellipse at 50% 85%, #2b2640 0%, #14121c 70%); box-shadow: 4px 4px 0 var(--shadow); text-align: center; }
.lost-scene { display: flex; align-items: flex-end; justify-content: center; gap: clamp(1rem, 4vw, 3rem); }
.lost-code { margin: 0 0 1.5rem; font: clamp(3.5rem, 13vw, 8rem)/1 var(--pixel); color: var(--sky); text-shadow: 6px 6px 0 #000; }
.lost-bob { display: flex; flex-direction: column; width: clamp(120px, 22vw, 192px); }
.bob-2d { display: block; width: 100%; height: auto; transform-origin: 50% 100%; animation: bob-tilt 2.4s steps(1) infinite; }
.bob-question { display: block; width: 24%; height: auto; margin: 0 0 4px 22%; animation: bob-q 1.2s steps(2) infinite; }
@keyframes bob-tilt { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-4deg); } }
@keyframes bob-q { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.lost-say { display: inline-block; margin: 1.25rem 0 0; max-width: 26rem; padding: 0.7rem 0.9rem; text-align: left; color: #0d0b14; background: #fff8dc; border: 3px solid #0d0b14; box-shadow: 4px 4px 0 #000; }
@media (prefers-reduced-motion: reduce) { .bob-2d, .bob-question { animation: none; } }
