@font-face {
  font-family: Pixelify;
  src: url("PixelifySans.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --ink: #141729;
  --paper: #f9f2e2;
  --yellow: #f5d61b;
  --cyan: #54d9ec;
  --red: #ff91a2;
  --pixel: Pixelify, ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: #0d0f1a;
  min-height: 100svh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  color: var(--paper);
  font-family: var(--pixel);
  overscroll-behavior: none;
}
.viewport {
  width: min(100vw, 56.25vh, 540px);
  width: min(100vw, 56.25dvh, 540px);
  aspect-ratio: 9 / 16;
  position: relative;
  container-type: inline-size;
  isolation: isolate;
  overflow: hidden;
  background: #24213b;
}
.render, .overlay { position: absolute; }
.render { inset: 0; touch-action: none; user-select: none; -webkit-touch-callout: none; }
.render canvas { display: block; image-rendering: pixelated; touch-action: none; }
.render:focus { outline: none; }
.overlay { z-index: 2; }
.menu {
  inset: 0;
  background: linear-gradient(#191a329e, transparent 62%, #13162bdf);
}
.filters { position: absolute; }
.brand, .menu h1, .city, .play, .loading { position: absolute; margin: 0; }
.brand {
  top: 3.5%; left: 35%; width: 30%; height: 10.1%;
  object-fit: contain; filter: url(#canguro-tint);
}
.menu h1 { top: 14%; left: 8%; width: 84%; height: 30%; }
.menu h1 img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.city {
  top: 41%; inset-inline: 0; text-align: center;
  letter-spacing: .16em; font-size: 4.4cqw; font-weight: 700;
  text-shadow: 0 2px #1f2134;
}
button { font-family: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; }
.primary {
  min-height: 12cqw; color: #211b12; background: var(--yellow);
  border: 0; padding: 1.5cqw 3cqw;
  box-shadow: inset 0 3px #fff08b, 0 4px #856612, 0 0 0 2px #16152a;
  font-size: 5.6cqw; font-weight: 700;
}
.primary:hover { background: #ffe45a; }
.primary:disabled { opacity: .5; cursor: default; }
.play { bottom: 9%; left: 15%; width: 70%; }
.loading {
  bottom: 3.3%; inset-inline: 4%; text-align: center;
  font-size: 3.6cqw; text-shadow: 0 2px #15162a;
}
.hud {
  top: 3.2%; left: 4%; right: 4%;
  display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none;
}
.hud-block {
  min-width: 23cqw; background: #171a30ed; border: 1px solid #e1e9ff69;
  box-shadow: 0 3px #101322aa; padding: 1.65cqw 2.3cqw;
}
.hud span, .result dt {
  display: block; color: #d5ddf3; font-size: 3.15cqw; line-height: 1;
  letter-spacing: .045em; text-transform: uppercase;
}
.hud b { display: block; font-size: 4.9cqw; line-height: 1.02; margin-top: .8cqw; }
.points-row { border-top: 1px solid #dfedff32; margin-top: 1.25cqw; padding-top: 1.2cqw; }
.cyan { color: var(--cyan); }
progress {
  display: block; width: 100%; height: 1.3cqw; margin-top: 1cqw; appearance: none;
  border: 0; background: #515b77; accent-color: var(--cyan);
}
progress::-webkit-progress-bar { background: #515b77; }
progress::-webkit-progress-value { background: var(--cyan); }
.hint, .boot-note {
  left: 7%; right: 7%; bottom: 2.2%; padding: 1.7cqw 2cqw;
  margin: 0; background: #161a2bed; color: var(--paper);
  text-align: center; font-size: 3.75cqw; pointer-events: none;
}
.boot-note { bottom: 5%; border: 2px solid var(--cyan); box-shadow: 0 4px #10162a; }
.boot-note strong { display: block; font-size: 5.3cqw; color: var(--cyan); }
.charge {
  left: 26%; right: 26%; bottom: 9%; height: 1.9cqw; border: 1px solid #dceafe;
  background: #1d263a; pointer-events: none;
}
.charge div { height: 100%; width: 0; background: var(--cyan); }
.result {
  bottom: 10%; left: 10%; right: 10%; background: #1d2339f7;
  border: 2px solid #d5ddfa91; border-top-color: var(--red);
  box-shadow: inset 0 3px #666c8b, 0 5px #121524d9;
  padding: 4cqw 5cqw; text-align: center;
}
.result[data-outcome="won"] { top: 5%; bottom: auto; border-top-color: var(--yellow); }
.result h2 { margin: 0; font-size: 9.2cqw; line-height: 1; color: var(--red); }
.result[data-outcome="won"] h2 { color: var(--yellow); }
.result p { margin: 1.2cqw 0 0; font-size: 3.7cqw; }
.result dl {
  display: grid; grid-template-columns: 1fr 1fr; margin: 3.2cqw 0 4cqw;
  border-block: 1px solid #8c97bb73; padding: 2.2cqw 0;
}
.result dl div + div { border-left: 1px solid #8c97bb73; }
.result dd { margin: 1cqw 0 0; font-size: 6.4cqw; line-height: 1; }
.result .primary { display: block; width: 100%; }
.quiet {
  margin-top: 2.4cqw; background: transparent; border: 0; color: var(--paper);
  padding: 1cqw 3cqw; font-size: 4.1cqw; text-decoration: underline;
}
.result[data-outcome="won"] .quiet { display: none; }

.world-progress {
  --advance: 0%;
  position: absolute;
  right: 1.7%;
  top: 18.5cqw;
  height: 126cqw;
  width: 1.8cqw;
  min-width: 5px;
  transform: translateY(15cqw);
  background: #171c32ce;
  border: 1px solid #e7f3fc88;
  box-shadow: 0 0 0 1px #17192c80;
}
.world-progress-fill {
  position: absolute;
  inset: auto 0 0;
  height: var(--advance);
  background: #4dcedd;
}
.world-progress i {
  position: absolute;
  right: 0;
  width: 3.1cqw;
  height: 1px;
  background: #d9ecf2a0;
}
.world-progress-pointer {
  position: absolute;
  right: -1px;
  bottom: var(--advance);
  transform: translateY(50%);
  width: 3.3cqw;
  height: 2cqw;
  background: #f5d61b;
  box-shadow: 0 0 0 1px #161a30;
  z-index: 2;
}
.result .products-result { color: #ffca87; }
