@font-face {
  font-family: Arcade;
  src: url('./assets/press-start-2p.ttf') format('truetype');
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #141b20;
  --panel: #202a2e;
  --line: #3c494b;
  --cream: #fff1d5;
  --ink: #f2eee1;
  --muted: #b5bdb4;
  --amber: #ffcc68;
  --amber-deep: #b47a32;
  --mint: #9be3bb;
  --pixel: Arcade, monospace;
  --sans: system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 75% 0%, #66532e45, transparent 48rem),
    radial-gradient(ellipse at 15% 25%, #31515064, transparent 45rem),
    var(--bg);
  color: var(--ink);
  font: 1rem/1.45 var(--sans);
}
button,
a {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
}
button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid #fff4bf;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.wrap {
  width: min(100% - 64px, 1120px);
  margin: auto;
}
.site-header {
  background: #151e23;
  border-bottom: 1px solid #3a4647;
}
.nav-wrap,
nav,
.brand,
.tool,
.launch,
.arena-nav,
.hud,
.hud > span,
.controls,
.moves,
.actions,
.keyboard-hints,
.keyboard-hints span,
.action-key,
.dialog-links {
  display: flex;
  align-items: center;
}
.nav-wrap {
  min-height: 62px;
  justify-content: space-between;
}
.brand {
  gap: 12px;
  color: var(--cream);
  font: 12px/1.4 var(--pixel);
  letter-spacing: -0.06em;
  text-transform: uppercase;
}
.brand em,
.cover h1 em {
  font-style: normal;
  color: var(--amber);
}
.brand-mark {
  display: block;
  width: 26px;
  height: 25px;
  background: linear-gradient(#ffda82 0 25%, #edac54 25% 65%, #9fcaa7 65%);
  clip-path: polygon(
    0 83%,
    18% 83%,
    18% 65%,
    38% 65%,
    38% 47%,
    57% 47%,
    57% 0,
    91% 0,
    91% 10%,
    100% 10%,
    100% 29%,
    67% 29%,
    67% 66%,
    48% 66%,
    48% 83%,
    30% 83%,
    30% 100%,
    0 100%
  );
}
nav {
  gap: 8px;
}
.sibling,
.text-btn {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: #64716c;
  text-underline-offset: 3px;
}
.sibling {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9rem;
  margin-right: 10px;
}
.sibling:hover,
.text-btn:hover {
  color: var(--cream);
}
.tool,
.touch-key,
.ability-key {
  border: 1px solid #455255;
  border-radius: 7px;
  background: #253035;
  box-shadow: inset 0 1px #ffffff12;
}
.tool {
  justify-content: center;
  gap: 7px;
  padding: 7px 11px;
  font-size: 0.87rem;
  font-weight: 650;
  min-width: 44px;
  min-height: 44px;
  white-space: nowrap;
}
.tool:hover,
.touch-key:hover,
.ability-key:hover {
  background: #344145;
}
.tool b {
  border: 1px solid #9aa89d;
  border-radius: 50%;
  font-size: 11px;
  line-height: 14px;
  width: 16px;
  height: 16px;
}
.sound {
  width: 37px;
  padding: 6px;
}
.sound svg {
  width: 19px;
  height: 19px;
}
.sound .on,
.sound[aria-pressed='true'] .off {
  display: none;
}
.sound[aria-pressed='true'] .on {
  display: block;
}
main {
  padding: 22px 0 38px;
}
.cover {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(244px, 25vw, 316px);
  border: 1px solid #687268;
  border-bottom-color: #786a49;
  border-radius: 14px;
  background: #23302b;
  overflow: hidden;
  box-shadow: 0 12px 32px #070e153d;
}
.cover:before,
.cover:after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
.cover:before {
  left: auto;
  width: auto;
  height: 100%;
  aspect-ratio: 5/2;
  background: url('./assets/jump-cover.webp') center/100% 100% no-repeat;
  image-rendering: auto;
  mask-image: linear-gradient(90deg, transparent, #000 29%);
}
.cover:after {
  background: linear-gradient(90deg, #172922 0%, #172922ed 17%, #172922c9 30%, transparent 61%);
}
.cover-copy {
  padding: 21px 3.6% 24px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
.cover h1 {
  color: var(--cream);
  font: 400 clamp(36px, 4.65vw, 57px)/1.18 var(--pixel);
  letter-spacing: -0.065em;
  text-transform: uppercase;
  text-shadow: 0 0.075em #222b2b;
}
.cover h1 span,
.cover h1 em {
  display: block;
}
.cover-copy p {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 0 20px;
  font-weight: 650;
  color: #f4ebd6;
  text-shadow: 0 1px 2px #162322;
}
.flag {
  display: inline-block;
  flex: none;
  width: 17px;
  height: 17px;
  background: var(--mint);
  clip-path: polygon(
    6% 0,
    24% 0,
    24% 6%,
    76% 6%,
    76% 17%,
    100% 17%,
    100% 53%,
    75% 53%,
    75% 44%,
    24% 44%,
    24% 93%,
    40% 93%,
    40% 100%,
    0 100%,
    0 93%,
    6% 93%
  );
}
.launch,
.jump-key {
  background: #ffcd70;
  border: 2px solid #ffe09c;
  border-bottom-color: #cc8f44;
  border-radius: 2px;
  box-shadow:
    0 3px #9a6535,
    0 5px #121c1e;
  color: #302315;
}
.launch {
  border-radius: 7px;
  justify-content: center;
  gap: 13px;
  min-height: 45px;
  padding: 9px 18px;
  font: 750 1.04rem/1.45 var(--sans);
  letter-spacing: .005em;
}
.launch:hover,
.jump-key:hover {
  background: #ffdb8e;
}
.launch:active,
.jump-key[data-held] {
  transform: translateY(2px);
  box-shadow: 0 1px #9a6535;
}
.play-icon {
  width: 12px;
  height: 12px;
  background: currentColor;
  clip-path: polygon(
    0 0,
    25% 0,
    25% 13%,
    48% 13%,
    48% 26%,
    70% 26%,
    70% 39%,
    93% 39%,
    93% 61%,
    70% 61%,
    70% 74%,
    48% 74%,
    48% 87%,
    25% 87%,
    25% 100%,
    0 100%
  );
}
.choices {
  padding: 0;
  border: 0;
  margin: 24px 0 0;
  min-width: 0;
}
.choices legend,
h2 {
  color: var(--cream);
  font: 750 1.35rem/1.3 var(--sans);
  letter-spacing: -0.025em;
}
.choices legend {
  padding: 0;
  margin-bottom: 11px;
}
.heroes,
.levels {
  display: grid;
  gap: 12px;
}
.heroes {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (min-width: 601px) and (max-width: 820px) {
  .heroes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .hero-card { grid-column: span 2; }
  .hero-card:nth-last-child(2) { grid-column: 2 / span 2; }
}
.hero-card,
.level-card {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 18px #080f142b;
  color: var(--ink);
  cursor: pointer;
}
.hero-card:hover,
.level-card:hover {
  border-color: #91a391;
}
.hero-card:has(input:checked),
.level-card:has(input:checked) {
  border-color: var(--amber);
  box-shadow:
    inset 0 -2px var(--amber),
    0 2px #0b1316;
}
.hero-card:has(input:focus-visible),
.level-card:has(input:focus-visible) {
  outline: 2px solid white;
  outline-offset: 2px;
}
.choices input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  clip-path: inset(50%);
  overflow: hidden;
}
.hero-picture {
  display: block;
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #304448;
  box-shadow: inset 0 1px #ffffff58;
}
.portrait {
  display: block;
  background-image: url('./assets/hero-portraits.webp');
  background-size: 200% 200%;
  image-rendering: auto;
}
.portrait[data-hero='pasha'] {
  background-image: url('./assets/pasha-portrait.webp');
  background-size: 100% 100%;
}
.hero-picture .portrait {
  position: absolute;
  inset: 0;
}
.hero-card:has(input:checked) .hero-picture:after {
  content: '✓';
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-content: center;
  width: 18px;
  height: 18px;
  color: #272213;
  background: var(--amber);
  box-shadow: 0 0 0 1px #382d23;
  font: 900 15px/1 var(--sans);
}
.hero-caption {
  display: grid;
  gap: 4px;
  min-height: 67px;
  padding: 10px 12px 11px;
  background: linear-gradient(110deg, #2b3638, #202b2e);
}
.hero-caption strong {
  font: 750 1.18rem/1.3 var(--sans);
  letter-spacing: -0.015em;
}
.hero-caption small {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #c2c9bd;
  font-size: 0.86rem;
}
.power {
  width: 12px;
  height: 12px;
  display: inline-block;
  flex: none;
  background: var(--hero-color);
}
.power-kirill {
  clip-path: polygon(43% 0, 94% 0, 65% 38%, 92% 38%, 22% 100%, 40% 56%, 8% 56%);
}
.power-maxim {
  clip-path: polygon(
    75% 0,
    100% 0,
    100% 25%,
    52% 75%,
    65% 89%,
    53% 100%,
    32% 81%,
    12% 100%,
    0 89%,
    19% 68%,
    0 52%,
    13% 36%,
    26% 50%
  );
}
.power-mom {
  clip-path: polygon(
    25% 10%,
    38% 10%,
    38% 0,
    65% 0,
    65% 10%,
    78% 10%,
    78% 22%,
    90% 22%,
    90% 95%,
    69% 80%,
    52% 95%,
    31% 80%,
    9% 95%,
    9% 23%,
    25% 23%
  );
}
.power-dad {
  clip-path: polygon(0 9%, 100% 9%, 100% 69%, 52% 69%, 22% 94%, 22% 69%, 0 69%);
}
.power-pasha {
  clip-path: polygon(25% 14%,100% 0,100% 75%,86% 88%,63% 88%,63% 68%,82% 58%,82% 27%,44% 34%,44% 88%,30% 100%,5% 100%,0 88%,6% 74%,25% 66%);
}
.levels {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.level-card .panorama {
  display: block;
  height: 50px;
  background-color: #314148;
  background-repeat: no-repeat;
  image-rendering: auto;
}
.level-name {
  display: flex;
  align-items: center;
  padding: 7px 8px;
  min-height: 44px;
  line-height: 1.22;
  font-size: 0.86rem;
  font-weight: 650;
}
.level-card:has(input:checked) .level-name {
  color: var(--amber);
}
#arena {
  width: min(100%, 1040px);
  margin: auto;
}
body[data-screen='game'] .sibling {
  display: none;
}
.arena-nav {
  justify-content: space-between;
  gap: 7px;
  margin-bottom: 12px;
}
.arena-nav h2 {
  text-align: center;
  font-size: clamp(12px, 1.5vw, 17px);
}
.pause-icon {
  width: 10px;
  height: 12px;
  border-inline: 3px solid currentColor;
}
.game-frame {
  border: 2px solid #637367;
  background: #142128;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 10px 28px #080f134d;
}
.hud {
  gap: 16px;
  padding: 7px 12px;
  min-height: 41px;
  color: #e6e9db;
  font-size: 0.9rem;
}
.hud > span {
  gap: 6px;
}
.hud-portrait {
  width: 40px;
  aspect-ratio: 4/3;
  border: 1px solid #788673;
}
.hud-hero {
  color: var(--amber);
  margin-right: auto;
}
.hud img {
  image-rendering: auto;
}
.heart {
  width: 16px;
  height: 14px;
  background: #ff8a7e;
  clip-path: polygon(
    0 18%,
    15% 18%,
    15% 0,
    38% 0,
    38% 14%,
    60% 14%,
    60% 0,
    83% 0,
    83% 18%,
    100% 18%,
    100% 48%,
    85% 48%,
    85% 65%,
    70% 65%,
    70% 79%,
    56% 79%,
    56% 95%,
    43% 95%,
    43% 80%,
    28% 80%,
    28% 66%,
    14% 66%,
    14% 49%,
    0 49%
  );
}
.checkpoint {
  color: var(--muted);
}
.checkpoint.active {
  color: var(--mint);
}
.route {
  height: 3px;
  background: #293632;
}
.route div {
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: #b7e5a0;
}
#board {
  width: 100%;
  height: auto;
  display: block;
  background: #1c3538;
  image-rendering: auto;
  touch-action: none;
  outline-offset: 2px;
}
.controls {
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  user-select: none;
  -webkit-user-select: none;
}
.moves,
.actions,
.keyboard-hints,
.keyboard-hints span,
.action-key {
  gap: 7px;
}
.keyboard-hints {
  gap: 20px;
  color: var(--muted);
  font-size: 0.88rem;
}
kbd {
  display: inline-block;
  background: #313d40;
  border: 1px solid #566363;
  border-bottom-width: 2px;
  color: #eeeede;
  font: 600 0.8rem/1.35 var(--sans);
  padding: 1px 5px;
  border-radius: 2px;
}
.action-key,
.touch-key {
  min-height: 47px;
  touch-action: none;
  -webkit-touch-callout: none;
  font-weight: 700;
}
.action-key {
  justify-content: center;
  border-radius: 2px;
  padding: 7px 13px;
}
.jump-key {
  min-width: 82px;
}
.ability-key {
  color: #dcead9;
}
.ability-key[aria-disabled='true'] {
  color: #9ba79e;
}
.ability-key.playing-solo {
  background: #284c46;
  color: #b9fce4;
  border-color: #7cccb8;
}
#cooldown:not(:empty) {
  font-variant-numeric: tabular-nums;
  font-size: 0.8em;
  color: #c3d8c5;
}
.touch-key {
  width: 52px;
  padding: 0;
  color: #e3e9d9;
}
.touch-key[data-held],
.ability-key[data-held] {
  background: #536153;
  box-shadow: inset 0 2px #29332f;
}
.touch-pad {
  display: none;
}
dialog {
  width: min(416px, calc(100% - 32px));
  max-height: 85svh;
  border: 2px solid #82937b;
  border-top-color: #e6c681;
  padding: 24px;
  background: #233035;
  color: var(--ink);
  box-shadow: 0 5px #10191d;
}
dialog::backdrop {
  background: #091116cd;
}
dialog h2 {
  font-size: 17px;
  margin: 0 0 13px;
}
dialog h3 {
  font: 700 1rem/1.3 var(--sans);
  margin: 15px 0 4px;
  color: var(--cream);
}
dialog p {
  font-size: 0.94rem;
  color: #d2dbcf;
  line-height: 1.5;
}
dialog p + p {
  margin-top: 6px;
}
.dialog-main {
  min-width: 100%;
  margin-top: 19px;
}
.dialog-links {
  justify-content: center;
  gap: 22px;
  margin-top: 13px;
}
.text-btn {
  background: transparent;
  border: 0;
  padding: 5px;
}
@media (min-width: 801px) and (min-height: 490px) {
  #arena {
    max-width: calc((100svh - 258px) * 480 / 216);
    min-width: min(100%, 520px);
  }
}
@media (max-width: 900px) {
  .levels {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: #647462 #202a2d;
    padding-bottom: 5px;
  }
  .level-card {
    flex: 0 0 128px;
    scroll-snap-align: center;
  }
  .wrap {
    width: calc(100% - 36px);
  }
}
@media (pointer: coarse), (max-width: 760px) {
  .touch-pad {
    display: flex;
  }
  .keyboard-hints,
  .ability-key kbd {
    display: none;
  }
  .controls {
    flex-wrap: wrap;
  }
}
@media (max-width: 600px) {
  .wrap {
    width: calc(100% - 26px);
  }
  .nav-wrap {
    min-height: 49px;
  }
  .brand {
    gap: 6px;
    font-size: 9px;
  }
  .brand-mark {
    width: 21px;
    height: 20px;
  }
  nav {
    gap: 5px;
  }
  .sibling {
    margin: 0 2px 0 0;
    font-size: 0.77rem;
  }
  .tool {
    font-size: 0.79rem;
    min-width: 44px;
    min-height: 44px;
    padding: 4px 7px;
    gap: 4px;
  }
  .sound {
    width: 31px;
  }
  .tool b {
    display: none;
  }
  main {
    padding: 13px 0 20px;
  }
  body[data-screen='lobby'] main {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }
  .cover {
    min-height: clamp(132px, 41vw, 196px);
  }
  .cover-copy {
    padding: 15px 12px;
  }
  .cover h1 {
    font-size: clamp(23px, 6.35vw, 36px);
  }
  .cover-copy p {
    margin: 10px 0 0;
    font-size: 0.83rem;
    gap: 5px;
  }
  .cover:before {
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    mask-image: none;
    background-size: cover;
    background-position: 50% center;
  }
  .cover:after {
    background: linear-gradient(90deg, #142921eb, #172922a8 35%, transparent 78%);
  }
  #play {
    position: fixed;
    z-index: 5;
    left: 13px;
    right: 13px;
    bottom: max(14px, env(safe-area-inset-bottom));
    width: calc(100% - 26px);
    min-height: 47px;
    box-shadow:
      0 3px #986737,
      0 5px #162022,
      0 0 0 5px #151c20d6;
  }
  .cover {
    isolation: auto;
  }
  .cover:before,
  .cover:after {
    z-index: 0;
  }
  .cover-copy h1,
  .cover-copy p {
    position: relative;
    z-index: 1;
  }
  .choices {
    margin-top: 18px;
  }
  .choices legend {
    font-size: 1.16rem;
    margin-bottom: 8px;
  }
  .heroes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .hero-card:last-child:nth-child(odd) {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
  }
  .hero-caption {
    padding: 7px 8px 8px;
    min-height: 51px;
    gap: 2px;
  }
  .hero-caption strong {
    font-size: 1.04rem;
  }
  .hero-caption small {
    font-size: 0.78rem;
  }
  .level-card {
    flex-basis: 115px;
  }
  .level-card .panorama {
    height: 44px;
  }
  .level-name {
    font-size: 0.79rem;
    min-height: 39px;
  }
  .arena-nav {
    margin-bottom: 7px;
  }
  .arena-nav h2 {
    font-size: .92rem;
  }
  .hud {
    font-size: 0.76rem;
    min-height: 34px;
    gap: 9px;
    padding: 5px 7px;
  }
  .hud > span {
    gap: 3px;
  }
  .hud-portrait {
    width: 31px;
  }
  .hud img {
    width: 17px;
    height: 17px;
  }
  .hud .flag {
    width: 13px;
    height: 13px;
  }
  .controls {
    gap: 5px;
  }
  .touch-key {
    width: clamp(37px, 10vw, 48px);
  }
  .action-key {
    font-size: 0.84rem;
    padding: 6px 8px;
  }
  .jump-key {
    min-width: 63px;
  }
  .moves,
  .actions,
  .action-key {
    gap: 4px;
  }
  dialog {
    padding: 18px;
  }
}
@media (max-height: 540px) and (orientation: landscape) {
  body[data-screen='game'] .site-header {
    display: none;
  }
  body[data-screen='game'] main {
    padding: 4px 0 8px;
  }
  #arena {
    max-width: min(100%, calc((100svh - 132px) * 480 / 216));
  }
  .arena-nav {
    margin-bottom: 4px;
  }
  .arena-nav .tool {
    min-height: 26px;
    padding: 2px 7px;
  }
  .hud {
    min-height: 25px;
    padding: 1px 7px;
  }
  .hud-portrait {
    width: 29px;
  }
  .controls {
    margin-top: 5px;
  }
  .touch-key,
  .action-key {
    min-height: 41px;
  }
}

/* Comfortable touch targets for small fingers. */
details > summary { min-height: 44px; box-sizing: border-box; padding-block: 12px; cursor: pointer; }
