/*
 * ludufre.com/quiver: the QUIVER page. Same family as /ports/: static, game art only, scaled by whole
 * numbers with image-rendering: pixelated. Colours are the game's own (read from the ROM's CGRAM in the
 * screenshots); the pixel font is unscii-8, the face the game draws its text with (fonts/unscii-8.woff2:
 * 8 px per em, so 16/24/32px land on whole pixels). Long text uses the site's Space Grotesk.
 */

@font-face {
  font-family: 'Unscii 8';
  src: url('fonts/unscii-8.woff2?v=1') format('woff2');
  font-display: block;
}

:root {
  --k: 3; /* sprite scale */
  --night-0: #101031; /* menu box fill */
  --night-1: #18184a; /* sky */
  --night-2: #292163;
  --night-3: #42317b; /* horizon */
  --brick: #292952;
  --stone-hi: #d6d6ff;
  --stone: #9c9cde; /* frame, outer line */
  --stone-mid: #6b6ba5; /* frame, inner line */
  --stone-lo: #424273;
  --gold: #ffce31; /* logo, selected item */
  --gold-lo: #b5841c;
  --moon: #e7deb5;
  --red: #c42a2a;
  --grass: #5ab54a;
  --text: #ecebff;
  --text-1: #c4c3ee;
  --px: 'Unscii 8', ui-monospace, monospace;
  --body: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --topbar: 44px;
  --menu: 48px;
  --gutter: 16px;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar) + var(--menu) + 12px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--night-0);
}

body {
  margin: 0;
  background: var(--night-0);
  color: var(--text);
  font: 400 17px/1.65 var(--body);
  overflow-x: hidden;
}

img,
video {
  max-width: 100%;
  display: block;
}

.px,
.spr {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

a {
  color: var(--gold);
  text-underline-offset: 3px;
}
a:hover {
  color: #fff;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

b,
strong {
  font-weight: 600;
  color: #fff;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: fixed;
  left: 8px;
  top: -60px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--gold);
  color: var(--night-0);
  font: 16px/1 var(--px);
  text-decoration: none;
}
.skip:focus {
  top: 8px;
}

.small {
  font-size: 15px;
  color: var(--text-1);
}
.mono {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 15px;
  overflow-wrap: anywhere;
}

/* in-game text, quoted exactly as on screen */
code.ui {
  font: 16px/1 var(--px);
  color: #fff;
  background: rgba(156, 156, 222, 0.16);
  padding: 2px 4px;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: none;
}
code:not(.ui) {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: #fff;
}

/* the menu frame of the game: light outer line, mid inner line, dark fill */
.panel,
.frame {
  background: var(--night-0);
  border: 2px solid var(--stone);
  box-shadow:
    inset 0 0 0 2px var(--stone-mid),
    0 0 0 2px var(--night-0),
    0 10px 0 rgba(0, 0, 0, 0.35);
}
.panel {
  padding: 22px 24px;
}
.panel > :first-child {
  margin-top: 0;
}
.panel > :last-child {
  margin-bottom: 0;
}

/* ── sprites: single images (.sp, sized from --w/--h) and strips (.spr, steps()) ── */
.sp {
  display: inline-block;
  width: calc(var(--w) * var(--k) * 1px);
  height: calc(var(--h) * var(--k) * 1px);
  max-width: none;
  vertical-align: middle;
}
.spr {
  display: inline-block;
  flex: none;
  width: calc(var(--fw) * var(--k));
  height: calc(var(--fh) * var(--k));
  background-repeat: no-repeat;
  background-size: calc(var(--fw) * var(--n) * var(--k)) 100%;
  animation: sprite var(--dur, 0.6s) steps(var(--n)) infinite;
  vertical-align: middle;
}
@keyframes sprite {
  to {
    background-position-x: calc(var(--fw) * var(--n) * var(--k) * -1);
  }
}
.spr--still {
  animation: none;
}
.flip {
  transform: scaleX(-1);
}
.spr--archer { --fw: 15px; --fh: 16px; --n: 2; --dur: 0.32s; }
.spr--p1 { background-image: url('img/archer-p1.png?v=1'); }
.spr--p2 { background-image: url('img/archer-p2.png?v=1'); }
.spr--p3 { background-image: url('img/archer-p3.png?v=1'); }
.spr--p4 { background-image: url('img/archer-p4.png?v=1'); }
.spr--bat { --fw: 16px; --fh: 14px; --n: 2; --dur: 0.36s; background-image: url('img/bat.png?v=1'); }
.spr--skeleton { --fw: 11px; --fh: 15px; --n: 2; --dur: 0.6s; background-image: url('img/skeleton.png?v=1'); }
.spr--slime { --fw: 15px; --fh: 13px; --n: 2; --dur: 1.2s; background-image: url('img/slime.png?v=1'); }
.spr--portal { --fw: 16px; --fh: 14px; --n: 4; --dur: 0.5s; background-image: url('img/portal.png?v=1'); }
.spr--chest { --fw: 14px; --fh: 16px; --n: 3; --dur: 2.4s; background-image: url('img/chest.png?v=1'); }
.spr--explosion { --fw: 32px; --fh: 32px; --n: 4; --dur: 0.8s; background-image: url('img/explosion.png?v=1'); }
.spr--wings { --fw: 16px; --fh: 9px; --n: 2; --dur: 0.4s; --k: 2; background-image: url('img/wings.png?v=1'); }

/* ── top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: calc(var(--topbar) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(16, 16, 49, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--stone-mid);
  font: 16px/1 var(--px);
}
.topbar__home {
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.topbar__home:hover {
  color: var(--gold);
}
.topbar__title {
  color: var(--gold);
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 #000;
}
.lang {
  display: flex;
  gap: 4px;
}
.lang button {
  font: 16px/1 var(--px);
  padding: 6px 8px;
  min-width: 40px;
  min-height: 32px;
  cursor: pointer;
  color: var(--text);
  background: var(--night-0);
  border: 2px solid var(--stone-mid);
}
.lang button[aria-pressed='true'] {
  background: var(--gold);
  color: var(--night-0);
  border-color: var(--gold);
}

/* ═══════════════════════════════ HERO: the title screen ═══════════════════════════════ */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* the title screen's sky: flat bands, darkest at the top */
  background: linear-gradient(
    to bottom,
    var(--night-0) 0,
    var(--night-0) 18%,
    var(--night-1) 18%,
    var(--night-1) 56%,
    var(--night-2) 56%,
    var(--night-2) 78%,
    var(--night-3) 78%
  );
}
.hero__sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.stars {
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 3px;
  box-shadow:
    42vw 21vh 0 #fff, 7vw 11vh 0 #c8c8ff, 13vw 48vh 0 #c8c8ff, 65vw 29vh 0 #fff, 56vw 55vh 0 #fff, 12vw 56vh 0 #fff,
    73vw 17vh 0 #c8c8ff, 81vw 9vh 0 #c8c8ff, 51vw 8vh 0 #c8c8ff, 6vw 19vh 0 #fff, 19vw 17vh 0 #c8c8ff, 72vw 25vh 0 #fff,
    74vw 26vh 0 #fff, 71vw 10vh 0 #c8c8ff, 80vw 28vh 0 #fff, 69vw 56vh 0 #c8c8ff, 60vw 60vh 0 #fff, 32vw 25vh 0 #c8c8ff,
    32vw 12vh 0 #c8c8ff, 68vw 65vh 0 #c8c8ff, 94vw 59vh 0 #fff, 10vw 17vh 0 #c8c8ff, 22vw 45vh 0 #fff, 63vw 55vh 0 #fff,
    86vw 11vh 0 #c8c8ff, 74vw 42vh 0 #fff, 45vw 65vh 0 #c8c8ff, 59vw 10vh 0 #c8c8ff, 35vw 62vh 0 #c8c8ff, 9vw 9vh 0 #c8c8ff,
    40vw 59vh 0 #fff, 50vw 46vh 0 #fff, 60vw 47vh 0 #fff, 15vw 65vh 0 #fff;
}
.stars--b {
  box-shadow:
    99vw 38vh 0 #fff, 17vw 33vh 0 #fff, 51vw 52vh 0 #fff, 64vw 12vh 0 #fff, 22vw 59vh 0 #fff, 52vw 37vh 0 #fff, 18vw 57vh 0 #fff,
    71vw 37vh 0 #fff, 91vw 55vh 0 #fff, 46vw 50vh 0 #fff, 30vw 21vh 0 #fff, 11vw 24vh 0 #fff, 20vw 31vh 0 #fff, 85vw 31vh 0 #fff,
    2vw 64vh 0 #fff, 76vw 25vh 0 #fff;
  animation: twinkle 2.4s steps(2) infinite;
}
@keyframes twinkle {
  50% {
    opacity: 0.15;
  }
}
.hero__moon {
  position: absolute;
  right: 7%;
  top: calc(var(--topbar) + 28px);
  width: calc(41px * var(--k));
  height: calc(41px * var(--k));
}
.hero__banner {
  position: absolute;
  top: calc(var(--topbar) + 8px);
  width: calc(10px * var(--k));
  height: calc(18px * var(--k));
  transform-origin: top center;
  animation: flap 3s ease-in-out infinite;
}
.hero__banner--l {
  left: 3%;
}
.hero__banner--r {
  right: 3%;
  animation-delay: -1.5s;
}
@keyframes flap {
  50% {
    transform: skewX(-4deg);
  }
}

.hero__wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: calc(var(--topbar) + 64px) var(--gutter) calc(16px * var(--k) + 88px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.hero__title {
  margin: 0 0 20px;
  --lk: 4;
}
.hero__logo {
  width: calc(110px * var(--lk));
  height: calc(27px * var(--lk));
  max-width: none;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.35));
}
.hero__tag {
  margin: 0 0 10px;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  line-height: 1.25;
  color: #fff;
}
.hero__meta {
  margin: 0 0 18px;
  font: 16px/1.5 var(--px);
  color: var(--gold);
  text-shadow: 2px 2px 0 #000;
  text-transform: uppercase;
}
.hero__lead {
  margin: 0 0 26px;
  color: var(--text-1);
  max-width: 34em;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* the download button: a gold menu plate */
.btn-dl {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  max-width: 100%;
  color: var(--night-0);
  background: var(--gold);
  text-decoration: none;
  border: 2px solid #fff3b0;
  box-shadow:
    inset -3px -3px 0 var(--gold-lo),
    0 0 0 2px var(--night-0),
    0 6px 0 2px #000;
  transition: transform 0.12s;
}
.btn-dl img {
  width: calc(14px * 3);
  height: auto;
  flex: none;
}
.btn-dl strong {
  display: block;
  color: var(--night-0);
  font: 400 16px/1.2 var(--px);
  text-transform: uppercase;
}
.btn-dl small {
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.btn-dl:hover {
  color: var(--night-0);
  transform: translateY(-2px);
}
.btn-dl:active {
  transform: translateY(2px);
}
/* the PRESS START box */
.btn-start {
  display: inline-block;
  padding: 14px 18px;
  font: 16px/1 var(--px);
  color: #fff;
  text-decoration: none;
  background: var(--night-0);
  border: 2px solid var(--stone);
  box-shadow:
    inset 0 0 0 2px var(--stone-mid),
    0 0 0 2px var(--night-0);
}
.btn-start:hover {
  color: var(--gold);
}

.hero__screen {
  margin: 0;
}
.frame {
  padding: 8px;
}
.frame video,
.frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 7;
  background: #000;
}
.hero__cap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 14px;
  font-size: 15px;
  color: var(--text-1);
}
.btn-sound {
  font: 16px/1 var(--px);
  padding: 9px 12px;
  min-height: 40px;
  cursor: pointer;
  color: #fff;
  background: var(--night-0);
  border: 2px solid var(--stone);
  box-shadow: inset 0 0 0 2px var(--stone-mid);
}
.btn-sound:hover,
.btn-sound[aria-pressed='true'] {
  color: var(--night-0);
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: none;
}

/* the floor of the title screen, with the four archers walking across and wrapping around */
.hero__ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(16px * var(--k));
  background: url('img/floor.png?v=1') repeat-x 0 0 / calc(16px * var(--k)) calc(16px * var(--k));
  image-rendering: pixelated;
}
.walker {
  position: absolute;
  left: 0;
  bottom: calc(15px * var(--k));
  animation: walk var(--t) linear infinite;
  animation-delay: var(--d);
}
@keyframes walk {
  from {
    transform: translateX(calc(-15px * var(--k)));
  }
  to {
    transform: translateX(100vw);
  }
}
.flyer {
  position: absolute;
  left: 0;
  bottom: calc(23px * var(--k));
  animation: fly 7s linear infinite 1.5s;
  opacity: 0;
}
.flyer img {
  width: calc(8px * var(--k));
  height: calc(3px * var(--k));
}
@keyframes fly {
  0% {
    transform: translateX(-30px);
    opacity: 1;
  }
  30% {
    transform: translateX(100vw);
    opacity: 1;
  }
  30.01%,
  100% {
    opacity: 0;
  }
}

/* ═══════════════════════ SECTION MENU ═══════════════════════ */
.menu {
  position: sticky;
  top: var(--topbar);
  z-index: 40;
  height: var(--menu);
  background: var(--night-0);
  border-top: 2px solid var(--stone);
  border-bottom: 2px solid var(--stone);
  box-shadow: inset 0 -2px 0 var(--stone-mid), 0 6px 0 rgba(0, 0, 0, 0.3);
}
.menu ul {
  display: flex;
  gap: 4px;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  list-style: none;
  overflow-x: auto;
  justify-content: safe center;
  scrollbar-width: none;
  align-items: center;
}
.menu ul::-webkit-scrollbar {
  display: none;
}
.menu li {
  flex: none;
}
.menu a {
  position: relative;
  display: block;
  padding: 10px 8px;
  font: 16px/1 var(--px);
  color: var(--stone);
  text-decoration: none;
  white-space: nowrap;
  transition: padding-left 0.2s;
}
.menu a:hover {
  color: #fff;
}
.menu a.is-active {
  color: var(--gold);
  padding-left: 44px;
  text-shadow: 2px 2px 0 #000;
}
.menu a.is-active::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  width: 32px;
  height: 20px;
  margin-top: -10px;
  background: url('img/icon-cursor.png?v=1') 0 0 / 100% 100%;
  image-rendering: pixelated;
  animation: nudge 0.6s steps(2) infinite;
}
@keyframes nudge {
  50% {
    transform: translateX(4px);
  }
}

/* ═══════════════════════ SECTIONS ═══════════════════════ */
.sec {
  position: relative;
  padding: 72px var(--gutter) 80px;
}
.sec--sky {
  /* the night sky with a few stars, drawn as 2 px squares */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='192' height='192' shape-rendering='crispEdges' fill='%23fff'%3E%3Crect x='66' y='72' width='2' height='2' fill-opacity='.35'/%3E%3Crect x='36' y='106' width='2' height='2' fill-opacity='.8'/%3E%3Crect x='94' y='156' width='2' height='2' fill-opacity='.8'/%3E%3Crect x='80' y='32' width='2' height='2' fill-opacity='.8'/%3E%3Crect x='130' y='158' width='2' height='2' fill-opacity='.8'/%3E%3Crect x='172' y='188' width='2' height='2' fill-opacity='.35'/%3E%3Crect x='116' y='174' width='2' height='2' fill-opacity='.8'/%3E%3C/svg%3E"),
    linear-gradient(to bottom, var(--night-1), var(--night-1) 70%, var(--night-2));
}
.sec--keep {
  /* the inner wall of CASTLE KEEP, one brick tile scaled 3x */
  background: var(--brick) url('img/brick.png?v=1') repeat 0 0 / calc(16px * 3) calc(16px * 3);
  image-rendering: pixelated;
}
.sec--keep > .wrap {
  image-rendering: auto;
}
.ground {
  height: 48px;
  background: url('img/floor.png?v=1') repeat-x 0 0 / 48px 48px;
  image-rendering: pixelated;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
}

.h2 {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 28px;
  font: 400 32px/1.2 var(--px);
  color: var(--gold);
  text-shadow: 4px 4px 0 #000;
  -webkit-font-smoothing: none;
}
.h2 .ico {
  --k: 3;
  flex: none;
}
.h3 {
  margin: 0 0 12px;
  font: 400 16px/1.5 var(--px);
  color: var(--gold);
  text-shadow: 2px 2px 0 #000;
  -webkit-font-smoothing: none;
}
.h3--rule {
  margin: 44px 0 18px;
  font-size: 24px;
  color: #fff;
}
.h3 code.ui {
  background: none;
  padding: 0;
  color: var(--gold);
}
.h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font: 400 16px/1.4 var(--px);
  color: #fff;
  -webkit-font-smoothing: none;
}
.lead {
  margin: 0 0 28px;
  font-size: 19px;
  max-width: 52em;
  color: var(--text);
}
p {
  margin: 0 0 12px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 28px;
}

/* ── the game ── */
.rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.rule__art {
  display: flex;
  align-items: center;
  gap: 10px;
  height: calc(32px * 3);
  margin-bottom: 12px;
}
.rule__art--wrap {
  overflow: hidden;
  position: relative;
}
.rule__art--wrap .spr {
  animation:
    sprite var(--dur) steps(var(--n)) infinite,
    wrapwalk 4s linear infinite;
}
@keyframes wrapwalk {
  from {
    transform: translateX(-60px);
  }
  to {
    transform: translateX(360px);
  }
}
.archers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.archers li {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  font-size: 15px;
  color: var(--text-1);
}
.archers .spr {
  --k: 4;
}
.archers b {
  font: 400 16px/1 var(--px);
  color: var(--gold);
}
.facts {
  display: grid;
  gap: 0;
  margin: 36px 0 0;
}
.facts div {
  display: grid;
  grid-template-columns: 10em minmax(0, 1fr);
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(156, 156, 222, 0.25);
}
.facts div:last-child {
  border-bottom: 0;
}
.facts dt {
  font: 16px/1.6 var(--px);
  color: var(--stone);
}
.facts dd {
  margin: 0;
}

/* ── how to play ── */
.steps {
  margin: 0 0 14px;
  padding-left: 1.4em;
}
.steps li {
  margin-bottom: 10px;
}
.steps li::marker {
  font-family: var(--px);
  color: var(--gold);
}
.pad {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}
.pad th {
  width: 1%;
  white-space: nowrap;
  text-align: left;
  font-weight: normal;
  padding-right: 16px;
  vertical-align: middle;
}
.pad td {
  vertical-align: middle;
}
.key {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 4px;
  border-radius: 50%;
  font: 16px/1 var(--px);
  color: #fff;
  box-shadow:
    inset -2px -3px 0 rgba(0, 0, 0, 0.35),
    0 2px 0 #000;
  -webkit-font-smoothing: none;
}
/* the Super Famicom face buttons */
.key--a { background: #d02028; }
.key--b { background: #e8c020; color: #000; }
.key--x { background: #2848d0; }
.key--y { background: #20a050; }
.key--dpad { background: #33334f; border-radius: 6px; font-family: var(--body); font-weight: 700; }
.key--wide { background: #55557a; border-radius: 16px; min-width: 72px; }
.key--sh { background: #9c9cbe; border-radius: 12px 12px 4px 4px; min-width: 40px; color: #000; }

.moves {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.move p {
  margin: 0;
  font-size: 16px;
}
.move--wide {
  grid-column: 1 / -1;
}
.move--shot {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.move--shot img {
  width: 100%;
  height: auto;
}
.move .sp {
  --k: 3;
}
.wrapicon {
  font: 700 24px/1 var(--body);
  color: var(--gold);
}
.hud-shot {
  width: 100%;
  max-width: 512px;
  height: auto;
  margin-top: 14px;
}
.tips {
  margin: 0;
  padding-left: 1.2em;
}
.tips li {
  margin-bottom: 9px;
}
.tips li::marker {
  content: '▸ ';
  font-family: var(--px);
  color: var(--gold);
}

/* ── power-ups ── */
.chest-intro {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  margin-bottom: 28px;
}
.chest-intro .lead {
  margin: 0;
}
.chest-anim .spr {
  --k: 6;
}
.powers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.power {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.power__icon {
  --k: 4;
  justify-self: center;
  margin-top: 4px;
}
.power .h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.power .h3 .sp {
  --k: 3;
}
.power p {
  margin: 0;
  font-size: 16px;
}
.shots {
  display: grid;
  gap: 16px;
}
.shots--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.shots--1 {
  grid-template-columns: minmax(0, 1fr);
}
.shots figure {
  margin: 0;
}
.shots img,
.gallery img,
.arena img,
.menu-step img,
.about-shot {
  width: 100%;
  height: auto;
  border: 2px solid var(--stone-mid);
  background: #000;
}
.shots figcaption,
.clip figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-1);
  text-align: center;
}

/* ── monsters ── */
.portal-intro {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}
.portal-intro .spr {
  --k: 5;
}
.portal-intro p {
  margin: 0;
}
.mobs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mob__art {
  display: grid;
  place-items: end center;
  height: calc(16px * 5 + 12px);
  margin-bottom: 14px;
  background: linear-gradient(to bottom, transparent calc(100% - 6px), var(--stone-mid) calc(100% - 6px));
}
.mob__art .spr {
  --k: 5;
  margin-bottom: 6px;
}
.mob p {
  margin: 0;
  font-size: 16px;
}

/* ── arenas ── */
.arenas {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.arena {
  background: var(--night-0);
  border: 2px solid var(--stone);
  box-shadow:
    inset 0 0 0 2px var(--stone-mid),
    0 10px 0 rgba(0, 0, 0, 0.35);
  padding: 8px;
}
.arena img {
  border: 0;
}
.arena__txt {
  padding: 14px 10px 8px;
}
.arena__txt p {
  font-size: 16px;
  margin: 0 0 8px;
}
.arena .h3 {
  margin-bottom: 6px;
}
.ui-line {
  font: 16px/1.4 var(--px) !important;
  color: #fff;
  -webkit-font-smoothing: none;
}
.chip {
  display: inline-block;
  padding: 3px 8px;
  font: 16px/1.2 var(--px);
  color: var(--night-0);
  background: var(--moon);
}
.arena--random {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.arena__q {
  display: grid;
  place-items: center;
  aspect-ratio: 8 / 7;
  font: 96px/1 var(--px);
  color: var(--gold);
  text-shadow: 8px 8px 0 #000;
  background:
    repeating-linear-gradient(45deg, rgba(156, 156, 222, 0.08) 0 12px, transparent 12px 24px),
    var(--night-1);
  border: 2px solid var(--stone-mid);
}

/* ── menus ── */
.clip {
  margin: 0;
}
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 0;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
.flow li {
  display: flex;
  align-items: center;
}
.flow li + li::before {
  content: '→';
  margin: 0 12px;
  font: 700 20px/1 var(--body);
  color: var(--gold);
}
.flow code.ui {
  padding: 8px 10px;
  background: var(--night-0);
  border: 2px solid var(--stone);
}
.menus {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.menu-step {
  margin: 0;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 6px;
  align-items: start;
}
.menu-step img {
  border: 0;
}
.menu-step figcaption {
  padding: 4px 8px 4px 10px;
  font-size: 15px;
}
.menu-step .h4 {
  color: var(--gold);
}
.mini {
  border-collapse: collapse;
  font-size: 15px;
}
.mini th {
  text-align: left;
  font-weight: normal;
  padding: 0 10px 8px 0;
  vertical-align: top;
  white-space: nowrap;
}
.mini td {
  padding: 0 0 8px;
}
.menu-rules {
  margin-top: 28px;
}
.fx {
  width: 100%;
  margin: 16px 0;
  border-collapse: collapse;
  font-size: 15px;
}
.fx th,
.fx td {
  padding: 8px 8px;
  border-bottom: 1px dashed rgba(156, 156, 222, 0.3);
  text-align: center;
  vertical-align: middle;
}
.fx thead th {
  font-weight: 500;
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.3;
}
.fx th[scope='row'],
.fx thead th:first-child {
  text-align: left;
  white-space: nowrap;
}
.fx .y {
  color: var(--grass);
  font: 16px/1 var(--px);
}
.fx .n {
  color: var(--stone-mid);
}
.note {
  padding: 12px 14px;
  border-left: 4px solid var(--gold);
  background: rgba(255, 206, 49, 0.07);
  font-size: 16px;
}
.about-shot {
  max-width: 384px;
  margin-bottom: 14px;
}
.cols {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
}
.cols div {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}
.cols dd {
  margin: 0;
  font-size: 16px;
}

/* ── multitap ── */
.tap {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  justify-content: center;
  padding: 28px 20px;
  font: 16px/1 var(--px);
  -webkit-font-smoothing: none;
}
.tap__console,
.tap__box {
  padding: 14px 16px;
  background: #2c2c4c;
  border: 2px solid var(--stone);
  border-radius: 6px;
}
.tap__label {
  display: block;
  margin-bottom: 12px;
  color: var(--stone-hi);
}
.tap__sw {
  display: block;
  margin-top: 8px;
  color: var(--stone-mid);
}
.tap__sw b {
  color: var(--gold);
  font-weight: normal;
}
.tap__ports {
  display: flex;
  gap: 14px;
}
.tap__port {
  display: grid;
  justify-items: center;
  gap: 8px;
}
.tap__n {
  color: var(--stone);
}
.tap__cable {
  display: block;
  width: 36px;
  height: 28px;
  border: 2px dashed var(--gold);
  border-radius: 4px;
}
.tap__slots {
  display: flex;
  gap: 8px;
}
.tap__p {
  display: grid;
  place-items: center;
  width: 44px;
  height: 28px;
  color: #000;
  border-radius: 4px;
}
.tap__p.p1 { background: #4fb04a; }
.tap__p.p2 { background: #3c64d8; color: #fff; }
.tap__p.p3 { background: #c43a32; color: #fff; }
.tap__p.p4 { background: var(--gold); }
.tap__p--off {
  background: transparent;
  color: var(--stone-mid);
  border: 2px dashed var(--stone-mid);
}
.tap__console {
  position: relative;
}
.tap__box {
  position: relative;
  margin-left: 48px;
}
.tap__box::before {
  content: '';
  position: absolute;
  left: -50px;
  top: 50%;
  width: 48px;
  border-top: 4px solid var(--gold);
}

/* ── screens ── */
.gallery-clips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  margin-bottom: 26px;
  align-items: start;
}
.gallery-clips .frame img {
  border: 0;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.gallery img {
  transition: transform 0.2s;
}
.gallery img:hover {
  transform: scale(1.04);
  position: relative;
  z-index: 2;
}

/* ── tested on ── */
.checks {
  margin: 0;
  padding: 0;
  list-style: none;
}
.checks li {
  position: relative;
  padding-left: 34px;
  margin-bottom: 12px;
}
.checks li::before {
  position: absolute;
  left: 0;
  top: 2px;
  font: 16px/1.4 var(--px);
}
.checks .ok::before {
  content: '✓';
  color: var(--grass);
}
.checks .todo::before {
  content: '…';
  color: var(--gold);
}

/* ── download ── */
.dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}
.btn-dl--big {
  padding: 18px 24px;
}
.btn-dl--big img {
  width: calc(14px * 4);
}
.btn-dl--big strong {
  font-size: 24px;
}
.facts--dl {
  margin: 0;
}
.facts--dl div {
  grid-template-columns: 8em minmax(0, 1fr);
}
.code {
  margin: 8px 0 12px;
  padding: 12px 14px;
  overflow-x: auto;
  background: #000;
  border: 2px solid var(--stone-mid);
  font: 14px/1.5 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color: #d6ffd0;
}

/* ── credits ── */
.credits {
  margin: 0;
  padding-left: 46px;
  list-style: none;
}
.credits li {
  margin-bottom: 12px;
}
.credits li::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 9px;
  margin: 0 12px 0 -36px;
  vertical-align: middle;
  background: url('img/arrow.png?v=1') 0 0 / 100% 100%;
  image-rendering: pixelated;
}
.dev {
  display: block;
  margin-top: 4px;
  font: 16px/1.5 var(--px);
  color: var(--text);
}
.finale {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 18px;
  margin-top: 48px;
}
.finale .spr {
  --k: 4;
}
.finale__logo {
  width: calc(110px * 3);
  height: calc(27px * 3);
  max-width: none;
  margin: 0 10px 8px;
}

/* ── footer ── */
.site-foot {
  padding: 28px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  text-align: center;
  background: var(--night-0);
  border-top: 2px solid var(--stone-mid);
  font-size: 15px;
}
.site-foot p {
  margin: 0 0 6px;
}
.site-foot a {
  color: var(--text);
}
.site-foot a:hover {
  color: var(--gold);
}

/* ═══════════════════════ RESPONSIVE ═══════════════════════ */
@media (max-width: 1100px) {
  .arenas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .menus {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero__title {
    --lk: 3;
  }
}

@media (max-width: 900px) {
  :root {
    --k: 2;
  }
  .hero {
    min-height: 0;
  }
  .hero__wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding-top: calc(var(--topbar) + 48px);
  }
  .hero__moon {
    right: 4%;
  }
  .split,
  .rules,
  .moves,
  .mobs,
  .gallery-clips,
  .dl {
    grid-template-columns: minmax(0, 1fr);
  }
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .archers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 24px;
  }
  .h2 {
    font-size: 24px;
    text-shadow: 3px 3px 0 #000;
    gap: 14px;
  }
  .h2 .ico {
    --k: 2;
  }
  .sec {
    padding: 56px var(--gutter) 64px;
  }
  .rule__art {
    height: calc(32px * 2);
  }
  .tap__box {
    margin-left: 0;
    margin-top: 40px;
  }
  .tap__box::before {
    left: 50%;
    top: -42px;
    width: 0;
    height: 40px;
    border-top: 0;
    border-left: 4px solid var(--gold);
  }
  .tap {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .topbar__title {
    display: none;
  }
  .lang button {
    min-width: 36px;
    padding: 6px;
  }
  .arenas,
  .menus,
  .shots--2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .move--shot,
  .menu-step,
  .chest-intro,
  .portal-intro {
    grid-template-columns: minmax(0, 1fr);
  }
  .chest-anim,
  .portal-intro .spr {
    justify-self: center;
  }
  .chest-anim .spr {
    --k: 5;
  }
  .lead {
    font-size: 17px;
  }
  .panel {
    padding: 18px 16px;
  }
  .facts div,
  .facts--dl div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .power {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
  }
  .power__icon {
    --k: 3;
  }
  .finale {
    gap: 8px;
  }
  .finale .spr {
    --k: 2;
  }
  .finale__logo {
    width: calc(110px * 2);
    height: calc(27px * 2);
    margin: 0 4px 4px;
  }
  .btn-dl--big strong {
    font-size: 16px;
  }
  .fx thead th {
    font-size: 12px;
  }
  .fx th,
  .fx td {
    padding: 8px 4px;
  }
  .tap__p {
    width: 40px;
  }
}

@media (max-width: 380px) {
  .hero__title {
    --lk: 2;
  }
  .finale__logo {
    display: none;
  }
}

/* ── motion off ─────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .walker:nth-child(1) { transform: translateX(10vw); }
  .walker:nth-child(2) { transform: translateX(34vw); }
  .walker:nth-child(3) { transform: translateX(60vw); }
  .walker:nth-child(4) { transform: translateX(82vw); }
  .flyer {
    display: none;
  }
}
