@font-face { font-family: "Press Start 2P"; src: url("/fonts/press-start-2p.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/fonts/lato-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/fonts/lato-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/fonts/lato-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/fonts/lato-900-normal.woff2") format("woff2"); font-weight: 900; font-display: swap; }
[hidden] { display: none !important; }
:root {
  --red: #a82019;
  --red-dark: #7d1711;
  --cream: #F1ece1;
  --paper: #f8f4ec;
  --ink: #2b1a17;
  --muted: #6b5a55;
  --pix: "Press Start 2P", monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--cream);
  color: var(--ink);
  font: 17px/1.6 "Lato", system-ui, sans-serif;
}
a { color: var(--red); font-weight: 700; }
img { max-width: 100%; display: block; }
main { max-width: 1040px; margin: 0 auto; padding: 0 16px 40px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px; background: var(--cream); border-bottom: 3px solid var(--red);
}
.brand img { height: 40px; width: auto; }
.top nav { display: flex; align-items: center; gap: 16px; font-weight: 700; font-size: 15px; }
.top nav a { text-decoration: none; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-block; cursor: pointer; text-decoration: none;
  font: 12px/1 var(--pix); letter-spacing: .02em;
  background: var(--red); color: var(--cream);
  border: 3px solid var(--red); padding: 12px 16px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .06s, box-shadow .06s;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.ghost { background: var(--cream); color: var(--red); }
.btn.ghost:hover { background: #fff; }
.btn.small { padding: 8px 10px; font-size: 10px; box-shadow: 3px 3px 0 var(--ink); }
input {
  font: 16px "Lato", sans-serif; padding: 11px 12px; min-width: 0;
  border: 3px solid var(--red); background: #fffdf8; color: var(--ink);
}
input:focus { outline: 3px solid var(--ink); outline-offset: 0; }
.msg { min-height: 1.2em; margin: 6px 0 0; font-weight: 700; color: var(--red); font-size: 15px; }
.fine { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

/* ---------- intro ---------- */
.intro { text-align: center; padding: 34px 0 14px; }
.kicker { font: 10px var(--pix); color: var(--red); letter-spacing: .1em; text-transform: uppercase; margin: 0 0 14px; }
h1 { font: clamp(24px, 5.2vw, 46px)/1.25 var(--pix); color: var(--red); margin: 0; text-shadow: 4px 4px 0 rgba(43, 26, 23, .15); }
.tag { font: 12px var(--pix); margin: 16px 0 10px; }
.mission { max-width: 620px; margin: 0 auto; font-size: 18px; }

/* ---------- game ---------- */
.play { margin-top: 10px; }
.screen { position: relative; border: 4px solid var(--red); background: var(--cream); box-shadow: 8px 8px 0 var(--ink); }
#game { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; touch-action: none; cursor: pointer; image-rendering: pixelated; }
.over { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: auto; background: rgba(43, 26, 23, .45); }
.over[hidden] { display: none; }
.over-card { background: var(--cream); border: 3px solid var(--red); box-shadow: 6px 6px 0 var(--ink); padding: 14px 18px; text-align: center; max-width: 560px; width: 100%; }
.doom { font: clamp(16px, 4vw, 30px)/1.1 var(--pix); color: var(--red); margin: 0; letter-spacing: .03em; }
.couch { font: 10px var(--pix); margin: 8px 0 6px; }
.result { margin: 0 0 10px; }
.over-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.mini { margin-top: 12px; border-top: 2px dashed var(--red); padding-top: 10px; }
.mini-head { font-weight: 900; margin: 0 0 6px; }
.mini .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mini .row input { flex: 1 1 140px; }
#sub-and-sign { margin-top: 8px; }
.pad { display: none; gap: 14px; margin-top: 18px; }
.padbtn { flex: 1; font-size: 14px; padding: 18px 10px; touch-action: none; user-select: none; -webkit-user-select: none; }
@media (hover: none) and (pointer: coarse) { .pad { display: flex; } }
.controls { display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: center; margin: 18px 0 8px; font-size: 15px; color: var(--muted); }
kbd { font: 10px var(--pix); border: 2px solid var(--red); color: var(--red); padding: 2px 5px; background: #fffdf8; }
.contest-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; background: var(--red); color: var(--cream); padding: 12px 16px; margin-top: 16px; font-size: 15px; }
.contest-strip a { color: #fff; }
.pill { font: 9px var(--pix); background: var(--cream); color: var(--red); padding: 6px 8px; }
.dot { opacity: .6; }

/* ---------- paradise ---------- */
.paradise { text-align: center; max-width: 720px; margin: 46px auto 0; }
.star { display: inline-block; font: 14px var(--pix); background: var(--red); color: var(--cream); padding: 10px 14px; margin: 0 0 10px; }

/* ---------- sections ---------- */
.level, .board { margin-top: 64px; }
.lvl { font: 10px var(--pix); color: var(--red); letter-spacing: .1em; text-transform: uppercase; margin: 0 0 8px; }
h2 { font: clamp(18px, 3.2vw, 28px)/1.3 var(--pix); color: var(--ink); margin: 0 0 8px; }
h2 .lvl { display: inline; margin-right: 8px; }
h3 { font-size: 21px; font-weight: 900; margin: 0 0 6px; }
.sub { color: var(--muted); margin: 0 0 22px; }

/* leaderboard */
.board table { width: 100%; border-collapse: collapse; background: #fffdf8; border: 3px solid var(--red); }
.board th { font: 9px var(--pix); text-align: left; background: var(--red); color: var(--cream); padding: 10px; }
.board td { padding: 9px 10px; border-top: 2px solid var(--cream); }
.board td:first-child { font: 11px var(--pix); color: var(--red); width: 44px; }
.board td:nth-child(3) { font: 11px var(--pix); }
.board tr.you td { background: #fbe6dd; }
.muted { color: var(--muted); text-align: center; }

/* enemies */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.enemy { background: #fffdf8; border: 3px solid var(--red); padding: 16px; box-shadow: 6px 6px 0 rgba(43, 26, 23, .18); }
.enemy img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; margin-bottom: 12px; border: 2px solid var(--red); }
.enemy p { margin: 0 0 10px; font-size: 16px; }
.enemy h3 small { font-weight: 400; font-size: 15px; color: var(--muted); }
.meter { font: 9px var(--pix); color: var(--red); }
.meter span { font-family: "Lato", sans-serif; font-size: 15px; letter-spacing: 1px; }
.caption { font-style: italic; color: var(--muted); }
.sprite-tile { aspect-ratio: 4 / 3; border: 2px solid var(--red); margin-bottom: 12px; background: var(--cream); display: flex; align-items: center; justify-content: center; }
.sprite-tile canvas { image-rendering: pixelated; max-width: 70%; max-height: 82%; width: auto; height: auto; }
.cards.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .cards.four { grid-template-columns: repeat(2, 1fr); } }
.sprite-tile.small { aspect-ratio: auto; border: 0; margin: 0; background: none; height: 64px; }
.sprite-tile.small canvas { max-width: 100%; max-height: 60px; width: auto; height: auto; }
.footnote { display: flex; gap: 20px; align-items: center; margin-top: 24px; border: 3px dashed var(--red); padding: 16px; }
.footnote p { margin: 0; }
.sprite-row { display: flex; gap: 14px; align-items: flex-end; flex-shrink: 0; max-width: 100%; }
.sprite-row .sprite-tile.small { min-width: 0; flex: 0 1 auto; }

/* hero */
.hero-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 28px; align-items: start; }
.hero-main { margin: 0; }
.hero-main img { border: 4px solid var(--red); box-shadow: 8px 8px 0 var(--ink); width: 100%; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 14px; font-style: italic; }
.stat-card { background: #fffdf8; border: 4px solid var(--red); padding: 20px; box-shadow: 8px 8px 0 var(--ink); }
.avatar { width: 96px; height: 96px; object-fit: cover; border-radius: 50%; border: 3px solid var(--red); float: right; margin: 0 0 8px 12px; }
.aka { margin: 0 0 14px; color: var(--muted); }
dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; clear: both; }
dt { font: 9px/2 var(--pix); color: var(--red); white-space: nowrap; }
dd { margin: 0; }
.bar { color: var(--red); letter-spacing: 2px; }
.story { display: grid; grid-template-columns: 300px 1fr; gap: 28px; margin-top: 44px; align-items: start; }
.story figure { margin: 0; }
.story img { border: 4px solid var(--red); aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }
.dna { display: flex; gap: 22px; align-items: center; margin-top: 36px; background: var(--red); color: var(--cream); padding: 18px; }
.dna img { width: 130px; height: 130px; object-fit: cover; border-radius: 50%; border: 4px solid var(--cream); flex-shrink: 0; }
.dna .lvl { color: var(--cream); opacity: .8; }
.dna p { margin: 0; }

.story-photos { display: grid; gap: 18px; }
.story-photos figure { margin: 0; }
.story .nose img { aspect-ratio: 1 / 1; border-radius: 50%; border: 5px solid var(--red); box-shadow: 8px 8px 0 var(--ink); object-fit: cover; }
.story .nose figcaption { text-align: center; font: 9px/1.6 var(--pix); color: var(--red); font-style: normal; }
.dna-note { margin-top: 22px; border: 3px dashed var(--red); padding: 14px 16px; background: #fffdf8; }
.dna-note .lvl { margin: 0 0 4px; }
.dna-note h4 { font: 14px/1.4 var(--pix); color: var(--red); margin: 0 0 8px; }
.dna-note p:last-child { margin: 0; }
/* meet the hero (reworked) */
.hero-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px; align-items: start; }
.hero-photo { margin: 0; }
.hero-photo img { width: 100%; aspect-ratio: 4 / 5; max-height: 460px; object-fit: cover; object-position: center 35%; border: 4px solid var(--red); box-shadow: 8px 8px 0 var(--ink); }
.story-head { font: 11px var(--pix); color: var(--red); text-transform: uppercase; letter-spacing: .1em; margin: 48px 0 14px; }
.story-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.story-steps li { counter-increment: step; background: #fffdf8; border-top: 5px solid var(--red); padding: 14px 14px 16px; }
.story-steps li::before { content: counter(step); display: inline-block; font: 11px var(--pix); background: var(--red); color: var(--cream); padding: 6px 8px; margin-bottom: 10px; }
.story-steps h4 { font-size: 17px; font-weight: 900; margin: 0 0 4px; }
.story-steps p { margin: 0; font-size: 15px; }
.dna-strip { display: flex; gap: 22px; align-items: center; margin-top: 28px; background: #fffdf8; border: 3px dashed var(--red); padding: 16px 20px; }
.dna-strip img { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; border: 4px solid var(--red); flex-shrink: 0; }
.dna-strip .lvl { margin: 0 0 4px; }
.dna-strip h4 { font: 14px/1.4 var(--pix); color: var(--red); margin: 0 0 6px; }
.dna-strip p:last-child { margin: 0; }
@media (max-width: 820px) { .hero-top { grid-template-columns: 1fr; } .hero-photo img { max-height: 400px; } .story-steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .story-steps { grid-template-columns: 1fr; } .dna-strip { flex-direction: column; text-align: center; } }
.dna-strip .adopt-line { margin-top: 8px; color: var(--red); }
/* equip */
.gear { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: start; }
.gear-card { background: #fffdf8; border: 4px solid var(--red); padding: 22px; box-shadow: 8px 8px 0 var(--ink); }
.gear-logo { width: 150px; margin-bottom: 8px; }
.gear-type { font: 9px var(--pix); color: var(--red); margin: 0 0 4px; }
.subscribe { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.subscribe input { flex: 1 1 200px; }
.subscribe .msg { flex-basis: 100%; }
.community ul { list-style: none; padding: 0; margin: 12px 0 0; }
.community li { padding: 10px 0 10px 26px; border-bottom: 2px dashed rgba(168, 32, 25, .35); position: relative; }
.community li::before { content: ""; position: absolute; left: 4px; top: 18px; width: 10px; height: 10px; background: var(--red); }

/* cheats */
.codes { counter-reset: c; list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; }
.codes li { counter-increment: c; padding-left: 48px; position: relative; }
.codes li::before { content: counter(c, decimal-leading-zero); position: absolute; left: 0; top: 2px; font: 11px var(--pix); background: var(--red); color: var(--cream); padding: 6px 5px; }

.county-label { font: 10px var(--pix); color: var(--red); letter-spacing: .1em; text-transform: uppercase; margin: 34px 0 14px; }
/* rescue & sponsor */
.sponsor.under-game { margin-top: 24px; }
.rescue, .sponsor { border: 4px solid var(--red); padding: 22px; background: #fffdf8; }
.rescue-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; }

/* rules */
details { border-top: 3px solid var(--red); padding-top: 12px; }
summary { font: 11px var(--pix); color: var(--red); cursor: pointer; padding: 6px 0; }
.rules-body p { font-size: 15px; margin: 10px 0; }

footer { text-align: center; padding: 40px 16px 50px; border-top: 3px solid var(--red); margin-top: 40px; }
.foot-logo { width: 110px; margin: 0 auto 10px; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .cards, .cards.four, .hero-grid, .gear, .codes { grid-template-columns: 1fr; }
  .story { grid-template-columns: 1fr; }
  .story figure { max-width: 320px; }
  .footnote { flex-direction: column; align-items: flex-start; }
  .top nav a:not(.btn) { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .screen { box-shadow: 5px 5px 0 var(--ink); }
  .over-card { padding: 14px 12px; }
  .dna { flex-direction: column; text-align: center; }
}
