/* Cinder: palette from the in-game menu and HUD, everything on a 4px grid */
:root {
  --bg: #0f1d22;
  --bg-deep: #0a1418;
  --panel: #15262c;
  --panel-2: #1a2e35;
  --line: #2a4149;
  --text: #efe6d2;
  --muted: #9fb0ad;
  --gold: #e3bb6e;
  --gold-deep: #a9813a;
  --jade: #7fd6c2;
  --ember: #ef8a7e;
  --hue: var(--gold);
  --p: 4px; /* one "pixel" */
  --head: "Press Start 2P", ui-monospace, monospace;
  --body: "Pixelify Sans", ui-monospace, system-ui, sans-serif;
  --label: "Silkscreen", ui-monospace, monospace;
  --sword: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath fill='%230a1418' d='M0 0h4v1h1v1h1v1h1v1h1v1h1v1h1v1h1V6h2v2h-1v1h1v1h1v1h1v2h-1v1h-2v-1h-1v-1h-1v-1H9v1H7v-2h1V8H7V7H6V6H5V5H4V4H3V3H2V2H1V1H0z'/%3E%3Cpath fill='%23efe6d2' d='M1 1h3v1h1v1h1v1h1v1h1v1h1v1h-1v1h-1V7H6V6H5V5H4V4H3V3H2V2H1z'/%3E%3Cpath fill='%23e3bb6e' d='M11 7h1v1h-1v1h1v1h-1v1h-1v-1H9V9h1V8h1z'/%3E%3Cpath fill='%237a5233' d='M11 10h1v1h1v1h1v1h-1v-1h-1v-1h-1z'/%3E%3C/svg%3E") 1 1, auto;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-deep) 4px, transparent 4px),
    linear-gradient(90deg, var(--bg-deep) 4px, transparent 4px),
    linear-gradient(90deg, transparent 32px, var(--bg-deep) 32px, var(--bg-deep) 36px, transparent 36px);
  background-size: 64px 32px, 64px 64px, 64px 64px;
  background-position: 0 0, 0 0, 0 32px;
  color: var(--text);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.5;
  overflow-x: hidden;
  cursor: var(--sword);
  -webkit-font-smoothing: none;
  font-variant-ligatures: none; /* Pixelify Sans's fi ligature reads like an A */
}
a, button, [role="tab"], .shot { cursor: var(--sword); }

#embers {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none;
  image-rendering: pixelated;
}
main, .nav, .footer { position: relative; z-index: 1; }

img { max-width: 100%; height: auto; display: block; }
canvas { image-rendering: pixelated; }
a { color: var(--gold); text-underline-offset: 4px; text-decoration-thickness: 2px; }
::selection { background: var(--gold); color: #1b1408; }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 4px; }

code { font-family: var(--label); font-size: .82em; background: var(--bg-deep); padding: 0 .35em; box-shadow: 0 0 0 2px var(--line); }
kbd {
  display: inline-block;
  font-family: var(--label);
  font-size: .7em;
  line-height: 1.6;
  color: var(--text);
  background: var(--panel-2);
  padding: 0 .5em;
  margin: 0 .2em;
  white-space: nowrap;
  box-shadow: 0 -2px 0 var(--line), 0 4px 0 var(--bg-deep), 2px 0 0 var(--line), -2px 0 0 var(--line), inset 0 -2px 0 var(--line);
  vertical-align: .1em;
}
.gold { color: var(--gold); }
.jade { color: var(--jade); }
.ember { color: var(--ember); }

.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--gold); color: #1b1408; padding: 8px 12px; font-family: var(--label); }
.skip:focus { left: 8px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* ---------- the pixel box: a 4px border with notched corners ---------- */
.px-box {
  --edge: var(--line);
  background: var(--panel);
  box-shadow:
    0 calc(var(--p) * -1) 0 0 var(--edge),
    0 var(--p) 0 0 var(--edge),
    calc(var(--p) * -1) 0 0 0 var(--edge),
    var(--p) 0 0 0 var(--edge),
    inset 0 calc(var(--p) * -1) 0 0 rgba(0, 0, 0, .28),
    inset var(--p) var(--p) 0 0 rgba(255, 255, 255, .03);
  margin: var(--p);
}

/* ---------- buttons ---------- */
.px-btn {
  --edge: var(--gold-deep);
  --fill: var(--gold);
  --ink: #1b1408;
  position: relative;
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--head); font-size: 12px; text-transform: uppercase; text-decoration: none; line-height: 1;
  color: var(--ink); background: var(--fill);
  padding: 16px 20px 20px;
  margin: var(--p);
  box-shadow:
    0 -4px 0 0 var(--edge), 0 4px 0 0 var(--edge), -4px 0 0 0 var(--edge), 4px 0 0 0 var(--edge),
    inset 0 -6px 0 0 rgba(0, 0, 0, .25), inset 4px 4px 0 0 rgba(255, 255, 255, .25);
  overflow: hidden;
  transition: transform .1s steps(2);
}
.px-btn svg { width: 16px; height: 16px; fill: currentColor; }
.px-btn::after { /* a stepped shine that sweeps across on hover */
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 16px;
  background: rgba(255, 255, 255, .35); transform: skewX(-20deg); opacity: 0;
}
.px-btn:hover { transform: translateY(-4px); }
.px-btn:hover::after { opacity: 1; animation: shine .5s steps(6) forwards; }
.px-btn:active { transform: translateY(2px); box-shadow: 0 -4px 0 0 var(--edge), 0 4px 0 0 var(--edge), -4px 0 0 0 var(--edge), 4px 0 0 0 var(--edge), inset 0 4px 0 0 rgba(0, 0, 0, .25); padding: 20px 20px 16px; }
@keyframes shine { to { left: 130%; } }
.btn-dark { --edge: var(--line); --fill: var(--panel-2); --ink: var(--text); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px 16px; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: var(--bg-deep); box-shadow: 0 4px 0 var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-family: var(--head); font-size: 14px; text-decoration: none; display: inline-flex; gap: 8px; }
.brand-cinder { color: var(--gold); }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a:not(.px-btn) {
  position: relative; color: var(--muted); text-decoration: none;
  font-family: var(--label); font-size: 14px; text-transform: uppercase; padding: 4px 0 4px 14px;
}
.nav-links a:not(.px-btn)::before { content: "\25B6"; position: absolute; left: 0; font-size: 9px; top: 9px; color: var(--gold); opacity: 0; }
.nav-links a:not(.px-btn):hover, .nav-links a.here { color: var(--text); }
.nav-links a:not(.px-btn):hover::before, .nav-links a.here::before { opacity: 1; animation: nudge .5s steps(2) infinite; }
@keyframes nudge { 50% { transform: translateX(2px); } }
.nav-links .nav-cta { font-size: 10px; padding: 10px 12px 14px; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 4px; background: var(--text); margin: 4px 0; }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-deep); box-shadow: 0 4px 0 var(--line);
    display: none;
  }
  .nav-links.open { display: flex; animation: drop .2s steps(4); }
  .nav-links a:not(.px-btn) { padding: 14px 16px 14px 32px; border-top: 4px solid var(--panel); }
  .nav-links a:not(.px-btn)::before { left: 14px; top: 20px; }
  .nav-links .nav-cta { margin: 16px; justify-content: center; }
}
@keyframes drop { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }

/* ---------- shared ---------- */
.eyebrow {
  font-family: var(--label); color: var(--gold); text-transform: uppercase;
  font-size: 14px; margin: 0 0 16px; display: flex; align-items: center; gap: 24px;
}
.rule { display: inline-block; width: 40px; height: 4px; background: var(--gold); box-shadow: 8px 0 0 var(--bg), 12px 0 0 var(--gold); }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
h2 { font-family: var(--head); font-size: clamp(20px, 3.4vw, 34px); line-height: 1.35; text-transform: uppercase; text-shadow: 4px 4px 0 var(--bg-deep); }
h3 { font-family: var(--head); font-size: 14px; line-height: 1.5; text-transform: uppercase; }
h4 { font-family: var(--body); font-weight: 700; font-size: 21px; line-height: 1.2; }
.section { padding: 96px 0; }
.section.alt { background: rgba(10, 20, 24, .78); box-shadow: 0 -4px 0 var(--line), 0 4px 0 var(--line); }
.sec-head { margin-bottom: 44px; max-width: 780px; }
.lede { color: var(--muted); font-size: 20px; margin: 20px 0 0; }
.note { color: var(--muted); font-size: 17px; margin: 32px 0 0; }

.frame { position: relative; margin: var(--p); padding: 0; border: 0; background: var(--bg-deep); display: block; }
.frame img { image-rendering: pixelated; width: 100%; }

.card { position: relative; padding: 28px 24px; }
.card::before { content: ""; position: absolute; top: -4px; left: 12px; width: 48px; height: 4px; background: var(--gold); }
.cards { display: grid; gap: 24px; }
.cards.three { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }

.ticks { list-style: none; padding: 0; margin: 16px 0 0; }
.ticks li { position: relative; padding-left: 22px; margin: 8px 0; color: var(--muted); font-size: 17px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 8px; height: 8px; background: var(--gold); box-shadow: 2px 2px 0 var(--gold-deep); }
.ticks b { color: var(--text); font-weight: 600; }

/* scroll reveal: a stepped wipe, only when JS is running */
/* (opacity, not clip-path, hides it beforehand: Chrome's IntersectionObserver never sees a fully clipped element) */
.js .reveal { opacity: 0; }
.js .reveal.in { animation: wipe .45s steps(6) var(--d, 0ms) both; }
@keyframes wipe { from { opacity: 1; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(-24px); } }

/* ---------- hero ---------- */
.hero { padding: 72px 0 80px; }
.hero-grid { display: grid; gap: 56px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: 1fr 1fr; } }
.title {
  font-family: var(--head);
  font-size: clamp(44px, 13vw, 88px); line-height: 1.15;
  display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px;
  white-space: nowrap;
}
.t-cinder { color: var(--gold); text-shadow: 4px 4px 0 #8a4a2a, 8px 8px 0 var(--bg-deep); animation: smoulder 2.4s steps(1) infinite; }
@keyframes smoulder {
  0%, 100% { color: var(--gold); }
  46% { color: #f4d38f; }
  50% { color: var(--gold); }
  53% { color: #f0a86a; }
  56% { color: var(--gold); }
}
.title:hover .t-cinder { animation: glitch .3s steps(2) 2; }
@keyframes glitch {
  0% { text-shadow: -4px 0 0 var(--jade), 4px 0 0 var(--ember), 8px 8px 0 var(--line); transform: translateX(4px); }
  100% { text-shadow: 4px 0 0 var(--jade), -4px 0 0 var(--ember), 8px 8px 0 var(--line); transform: translateX(-4px); }
}
.tagline { font-size: clamp(22px, 2.6vw, 28px); margin: 0 0 20px; min-height: 2.9em; line-height: 1.45; }
.tagline::after { content: ""; display: inline-block; width: .55em; height: 1em; background: var(--gold); margin-left: 6px; vertical-align: -.12em; animation: blink 1s steps(1) infinite; }
.tagline.done::after { animation-duration: 1.2s; }
@keyframes blink { 50% { opacity: 0; } }
.pitch { color: var(--muted); max-width: 540px; margin: 0 0 32px; }
.press-start { font-family: var(--label); font-size: 13px; text-transform: uppercase; color: var(--muted); margin: 24px 0 0; }
.press-start span { color: var(--gold); animation: blink 1s steps(1) infinite; display: inline-block; }

.hero-shot { margin: var(--p); overflow: hidden; }
.hero-shot img { animation: crt .9s steps(5) .2s both; }
@keyframes crt { from { clip-path: inset(50% 0 50% 0); filter: brightness(3); } 60% { clip-path: inset(0); filter: brightness(1.6); } to { clip-path: inset(0); filter: none; } }
.scanlines { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0 2px, transparent 2px 4px); }
.lineup { display: flex; justify-content: center; gap: 12px; margin-top: 20px; }
.lineup canvas { width: 56px; height: 68px; transition: transform .1s steps(1); }

/* ---------- facts ---------- */
.facts { background: var(--bg-deep); box-shadow: 0 -4px 0 var(--line), 0 4px 0 var(--line); }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.fact { padding: 28px 20px; box-shadow: -4px 0 0 var(--panel); }
.fact p { margin: 10px 0 0; color: var(--muted); font-size: 17px; }
.fact b { color: var(--text); font-weight: 600; }
.fact-num { font-family: var(--head); font-size: 26px; color: var(--gold); line-height: 1; text-shadow: 4px 4px 0 #6b4a1d; }
.heart-msg { display: block; color: var(--ember); font-family: var(--label); font-size: 13px; min-height: 1.4em; }
.hearts { display: flex; gap: 10px; height: 26px; align-items: flex-start; }
.heart {
  /* 7 x 6 pixel heart drawn with box-shadows, 4px per pixel */
  width: 28px; height: 24px; padding: 0; border: 0; background: none; position: relative; color: var(--ember);
}
.heart::before {
  content: ""; position: absolute; left: 0; top: 0; width: 4px; height: 4px;
  box-shadow:
    4px 0, 8px 0, 16px 0, 20px 0,
    0 4px, 4px 4px, 8px 4px, 12px 4px, 16px 4px, 20px 4px, 24px 4px,
    0 8px, 4px 8px, 8px 8px, 12px 8px, 16px 8px, 20px 8px, 24px 8px,
    4px 12px, 8px 12px, 12px 12px, 16px 12px, 20px 12px,
    8px 16px, 12px 16px, 16px 16px,
    12px 20px;
}
.heart::after { content: ""; position: absolute; left: 8px; top: 4px; width: 4px; height: 4px; background: #fff; opacity: .6; }
.heart:hover { animation: thump .4s steps(2) infinite; }
@keyframes thump { 50% { transform: scale(1.15); } }
.heart.broken { color: var(--line); animation: shatter .35s steps(3); }
.heart.broken::after { display: none; }
@keyframes shatter { 0% { transform: translate(0); color: #fff; } 33% { transform: translate(-4px, -4px); } 66% { transform: translate(4px, 0); color: var(--ember); } 100% { transform: translate(0); } }
@media (max-width: 540px) { .fact { box-shadow: 0 -4px 0 var(--panel); } }

/* ---------- training ground ---------- */
.arena-wrap { position: relative; background: var(--bg-deep); --edge: var(--gold-deep); }
#arena { display: block; width: 100%; aspect-ratio: 16 / 9; outline: none; cursor: crosshair; touch-action: none; }
#arena:focus-visible { box-shadow: 0 0 0 4px var(--gold); }
.arena-start {
  position: absolute; inset: 0; width: 100%; border: 0;
  background: rgba(10, 20, 24, .55);
  color: var(--text); font-family: var(--head); font-size: clamp(11px, 1.8vw, 16px); text-transform: uppercase;
  text-shadow: 4px 4px 0 var(--bg-deep);
}
.arena-start:hover { background: rgba(10, 20, 24, .35); color: var(--gold); }
.blink { animation: blink 1s steps(1) infinite; display: inline-block; color: var(--gold); }
.arena-keys { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 20px; color: var(--muted); font-size: 17px; align-items: center; }
.arena-keys .ko { margin-left: auto; font-family: var(--label); text-transform: uppercase; color: var(--gold); }
.arena-keys .ko b { font-family: var(--head); font-weight: 400; color: var(--text); margin-left: 6px; }

/* ---------- modes ---------- */
.mode .num { font-family: var(--head); color: var(--gold); font-size: 12px; display: block; margin-bottom: 14px; }
.mode p { color: var(--muted); margin: 14px 0 0; font-size: 18px; }
.mode p b { color: var(--text); font-weight: 600; }
.card:hover { transform: translateY(-4px); }
.card { transition: transform .12s steps(2); }

/* ---------- challengers ---------- */
[data-hue="wind"] { --hue: #8fd3e8; }
[data-hue="iron"] { --hue: #e3bb6e; }
[data-hue="shadow"] { --hue: #b69cf0; }
[data-hue="cinder"] { --hue: #ef8a7e; }
[data-hue="bog"] { --hue: #8fcf7a; }

.roster { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; padding: 4px; }
.roster button {
  font: inherit; text-align: left; color: var(--text);
  background: var(--panel); border: 0;
  padding: 12px 12px 16px; display: flex; gap: 10px; align-items: center;
  box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line), inset 0 -4px 0 rgba(0,0,0,.28);
  transition: transform .1s steps(2);
}
.roster button canvas { width: 28px; height: 34px; flex: none; }
.roster button span { display: flex; flex-direction: column; min-width: 0; }
.roster button b { font-family: var(--body); font-weight: 700; font-size: 20px; line-height: 1.1; }
.roster button small { font-family: var(--label); font-size: 11px; text-transform: uppercase; color: var(--muted); }
.roster button:hover { transform: translateY(-4px); box-shadow: 0 -4px 0 0 var(--hue), 0 4px 0 0 var(--hue), -4px 0 0 0 var(--hue), 4px 0 0 0 var(--hue), inset 0 -4px 0 rgba(0,0,0,.28); }
.roster button[aria-selected="true"] { background: var(--hue); color: #1b1408; box-shadow: 0 -4px 0 0 var(--hue), 0 4px 0 0 var(--hue), -4px 0 0 0 var(--hue), 4px 0 0 0 var(--hue), inset 0 -4px 0 rgba(0,0,0,.25); }
.roster button[aria-selected="true"] small { color: rgba(27, 20, 8, .7); }
@media (max-width: 860px) { .roster { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }

.char-stage { --edge: var(--hue); display: grid; grid-template-columns: 1fr; gap: 8px; padding: 28px 24px; transition: --edge .2s; }
@media (min-width: 860px) { .char-stage { grid-template-columns: 200px 1fr; gap: 32px; padding: 32px 32px 32px 24px; } }
.pedestal { display: flex; align-items: flex-end; justify-content: center; position: relative; min-height: 180px; align-self: start; }
.pedestal::before { /* a pixel spotlight in the challenger's colour */
  content: ""; position: absolute; bottom: 8px; left: 50%; width: 136px; height: 20px; transform: translateX(-50%);
  background: var(--hue); opacity: .25;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 0 calc(100% - 4px), 0 4px, 8px 4px);
}
#char-sprite { width: 112px; height: 136px; position: relative; margin-bottom: 16px; transition: transform .1s steps(1); }
.char-panel h3 { font-size: clamp(16px, 2.2vw, 22px); color: var(--hue); margin-bottom: 28px; }
.char-panel h3 span { color: var(--muted); font-size: .62em; }
.char-panel.swap { animation: swap .3s steps(4); }
@keyframes swap { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
.abilities { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.ab { position: relative; padding-left: 56px; }
.ab .key {
  position: absolute; left: 4px; top: 4px; width: 36px; height: 36px; display: grid; place-items: center;
  font-family: var(--head); font-size: 14px; color: #1b1408; background: var(--hue);
  box-shadow: 0 -4px 0 var(--bg-deep), 0 4px 0 var(--bg-deep), -4px 0 0 var(--bg-deep), 4px 0 0 var(--bg-deep), inset 0 -4px 0 rgba(0,0,0,.25);
}
.ab:hover .key { animation: press .3s steps(2); }
@keyframes press { 50% { transform: translateY(4px); box-shadow: 0 -4px 0 var(--bg-deep), 0 4px 0 var(--bg-deep), -4px 0 0 var(--bg-deep), 4px 0 0 var(--bg-deep); } }
.ab .key.auto { background: var(--panel-2); color: var(--hue); }
.ab .cd { font-family: var(--label); font-size: 12px; text-transform: uppercase; color: var(--muted); margin: 4px 0 10px; }
.ab p { margin: 0 0 0 -56px; font-size: 17px; color: #d6dcd8; }
.ab .cd { min-height: 2.4em; }

/* ---------- arsenal ---------- */
.weapon-icon { width: 64px; height: 64px; margin-bottom: 16px; }
.weapon-icon i { display: block; width: 64px; height: 64px; background-size: 64px 64px; image-rendering: pixelated; transform-origin: 30% 70%; }
.weapon:hover .weapon-icon i { animation: swingIcon .45s steps(4); }
@keyframes swingIcon { 0% { transform: rotate(0); } 40% { transform: rotate(-35deg); } 70% { transform: rotate(25deg); } 100% { transform: rotate(0); } }
.w-sword { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath fill='%23dfe8ea' d='M13 1h2v2h-1v1h-1v1h-1v1h-1v1h-1v1H9V7h1V6h1V5h1V4h1V3h1V2h-1z'/%3E%3Cpath fill='%23e3bb6e' d='M5 8h2v1h1v1h1v2H8v-1H7v-1H6V9H5z'/%3E%3Cpath fill='%237a5233' d='M5 11h1v1H5v1H4v1H3v-1h1v-1h1z'/%3E%3Cpath fill='%23e3bb6e' d='M2 13h2v2H2z'/%3E%3C/svg%3E"); }
.w-great { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath fill='%23dfe8ea' d='M12 0h4v4h-1v1h-1v1h-1v1h-1v1h-1v1H9v1H8V9H7V8h1V7h1V6h1V5h1V4h1z'/%3E%3Cpath fill='%23ef8a7e' d='M14 1h1v2h-1v1h-1v1h-1v1h-1V5h1V4h1V3h1z'/%3E%3Cpath fill='%23e3bb6e' d='M4 8h2v1h1v1h1v1h1v2H8v-1H7v-1H6v-1H5V9H4z'/%3E%3Cpath fill='%237a5233' d='M5 11h1v1H5v1H4v1H3v-1h1v-1h1z'/%3E%3Cpath fill='%23e3bb6e' d='M1 13h3v3H1z'/%3E%3C/svg%3E"); }
.w-bow { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath fill='%23a9813a' d='M4 1h4v1h2v1h1v1h1v2h1v4h-1v2h-1v1h-1v1H8v1H4v-1h3v-1h2v-1h1v-1h1V6h-1V5H9V4H7V3H4z'/%3E%3Cpath fill='%23efe6d2' d='M4 2h1v12H4z'/%3E%3Cpath fill='%23dfe8ea' d='M2 8h9v1H2z'/%3E%3Cpath fill='%23ef8a7e' d='M11 7h1v1h1v1h-1v1h-1z'/%3E%3C/svg%3E"); }
.weapon .role { font-family: var(--label); font-size: 12px; text-transform: uppercase; color: var(--gold); margin: 8px 0 20px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 20px; padding: 0 4px; }
.stats div { background: var(--bg-deep); padding: 10px; box-shadow: 0 0 0 4px var(--line); }
.stats dt { font-family: var(--label); font-size: 11px; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 6px 0 0; font-family: var(--head); font-size: 14px; }
.grip { margin: 0; font-size: 17px; color: var(--muted); }
.grip b { color: var(--text); font-weight: 600; }

/* ---------- siege ---------- */
.stages { list-style: none; padding: 4px; margin: 0 0 32px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.stages li {
  position: relative; background: var(--panel); padding: 18px 14px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 -4px 0 var(--line), 0 4px 0 var(--line), -4px 0 0 var(--line), 4px 0 0 var(--line);
  transition: transform .1s steps(2);
}
.stages li b { font-family: var(--head); font-weight: 400; font-size: 12px; width: 32px; height: 32px; display: grid; place-items: center; background: var(--line); color: var(--text); }
.stages li span { font-family: var(--head); text-transform: uppercase; font-size: 12px; margin-top: 8px; }
.stages li small { color: var(--muted); font-size: 15px; line-height: 1.35; }
.stages li.live { transform: translateY(-6px); box-shadow: 0 -4px 0 var(--gold), 0 4px 0 var(--gold), -4px 0 0 var(--gold), 4px 0 0 var(--gold); }
.stages li.live b { background: var(--gold); color: #1b1408; }
.stages li.live::after { /* progress fills in steps while the stage is live */
  content: ""; position: absolute; left: 0; bottom: 0; height: 4px; background: var(--gold); animation: fill 1.8s steps(8) forwards;
}
@keyframes fill { from { width: 0; } to { width: 100%; } }
@media (max-width: 820px) { .stages { grid-template-columns: 1fr 1fr; } .stages li:last-child { grid-column: 1 / -1; } }

.siege-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.resources p { color: var(--muted); margin: 16px 0 0; font-size: 18px; }
.resources b { color: var(--text); font-weight: 600; }
.mats { display: flex; gap: 16px; margin-top: 20px; }
.mats i { width: 24px; height: 24px; display: block; box-shadow: inset -4px -4px 0 rgba(0,0,0,.3), inset 4px 4px 0 rgba(255,255,255,.2); animation: bob 1.2s steps(2) infinite; }
.mats i:nth-child(2) { animation-delay: .4s; }
.mats i:nth-child(3) { animation-delay: .8s; }
.m-timber { background: #9a6a3e; }
.m-iron { background: #8a9aa6; }
.m-stone { background: #6f7f7a; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.jade-edge::before { background: var(--jade); }
.ember-edge::before { background: var(--ember); }
.costs { list-style: none; padding: 0; margin: 16px 0 0; }
.costs li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 18px; background-image: linear-gradient(90deg, var(--line) 50%, transparent 50%); background-size: 8px 2px; background-repeat: repeat-x; background-position: bottom; }
.costs li:last-child { background: none; }
.costs li:hover { color: var(--gold); }
.costs em { display: flex; gap: 4px; }
.costs em i { width: 10px; height: 10px; background: var(--gold); box-shadow: inset -2px -2px 0 var(--gold-deep); }
.costs li:hover em i { animation: bob .4s steps(2) infinite; }

/* ---------- maps ---------- */
.maps { display: grid; gap: 56px; }
.map { display: grid; gap: 32px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .map { grid-template-columns: 7fr 5fr; } .map:nth-child(even) .shot { order: 2; } }
.map-copy p { color: var(--muted); margin: 16px 0 0; font-size: 18px; }

.shot { display: block; width: calc(100% - 8px); font: inherit; color: inherit; border: 0; padding: 0; overflow: hidden; position: relative; }
.shot::after { /* pixel corner brackets on hover */
  content: ""; position: absolute; inset: 8px; pointer-events: none; opacity: 0;
  background:
    linear-gradient(var(--gold), var(--gold)) top left / 20px 4px no-repeat,
    linear-gradient(var(--gold), var(--gold)) top left / 4px 20px no-repeat,
    linear-gradient(var(--gold), var(--gold)) top right / 20px 4px no-repeat,
    linear-gradient(var(--gold), var(--gold)) top right / 4px 20px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom left / 20px 4px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom left / 4px 20px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom right / 20px 4px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom right / 4px 20px no-repeat;
}
.shot:hover::after, .shot:focus-visible::after { opacity: 1; animation: brackets .5s steps(2) infinite; }
@keyframes brackets { 50% { inset: 4px; } }
.shot img { transition: filter .2s steps(2); }
.shot:hover img { filter: brightness(1.12) saturate(1.1); }

/* ---------- gallery ---------- */
.gallery { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; }
.gallery .shot img { height: 100%; object-fit: cover; }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr; } }

/* ---------- how to play ---------- */
.play-grid { display: grid; gap: 56px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .play-grid { grid-template-columns: 6fr 5fr; } }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 20px 56px; color: var(--muted); }
.steps li::before {
  content: counter(s); position: absolute; left: 4px; top: 0; width: 32px; height: 32px; display: grid; place-items: center;
  font-family: var(--head); font-size: 12px; color: #1b1408; background: var(--gold); box-shadow: inset 0 -4px 0 var(--gold-deep);
}
.steps b, .steps em { color: var(--text); font-style: normal; font-weight: 600; }
.steps em { color: var(--gold); }
.controls table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.controls th { text-align: left; font-weight: 400; padding: 10px 12px 10px 0; white-space: nowrap; width: 1%; }
.controls td { padding: 10px 0; color: var(--muted); font-size: 17px; }
.controls tr + tr th, .controls tr + tr td { background-image: linear-gradient(90deg, var(--line) 50%, transparent 50%); background-size: 8px 2px; background-repeat: repeat-x; }
.controls tr:hover td { color: var(--text); }
.controls tr:hover kbd { transform: translateY(2px); box-shadow: 0 -2px 0 var(--gold), 0 2px 0 var(--bg-deep), 2px 0 0 var(--gold), -2px 0 0 var(--gold); }

/* ---------- final ---------- */
.final { padding: 112px 0; text-align: center; background: linear-gradient(180deg, transparent, rgba(227, 187, 110, .08)); box-shadow: 0 -4px 0 var(--line); }
.final h2 { max-width: 880px; margin: 0 auto 40px; font-size: clamp(18px, 3vw, 30px); line-height: 1.6; text-transform: none; }
.final .cta-row { justify-content: center; }

.footer { background: var(--bg-deep); box-shadow: 0 -4px 0 var(--line); padding: 36px 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: space-between; align-items: center; }
.footer p { margin: 0; color: var(--muted); font-size: 16px; max-width: 640px; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(5, 10, 12, .94); display: grid; place-items: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 88vh; width: auto; image-rendering: pixelated; box-shadow: 0 0 0 4px var(--gold-deep); }
.lightbox.open img { animation: open .3s steps(5); }
@keyframes open { from { transform: scale(.2); clip-path: inset(48% 0 48% 0); } 60% { clip-path: inset(0); } to { transform: none; } }
.lb-close { position: absolute; top: 12px; right: 16px; background: none; border: 0; color: var(--text); font-family: var(--head); font-size: 28px; line-height: 1; padding: 8px; }
.lb-close:hover { color: var(--gold); }

/* ---------- reduced motion: no ambient animation ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; }
}
