@font-face {
  font-family: Pixel;
  src: url(assets/press-start.ttf) format('truetype');
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #101318;
  --panel: #191d24;
  --border: #323842;
  --ink: #edf0f2;
  --muted: #a8afba;
  --amber: #ffbc54;
  --green: #78c8a7;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
button,
a {
  color: inherit;
}
button {
  font: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #7ebdff;
  outline-offset: 4px;
}
.symbols {
  height: 0;
  width: 0;
  position: absolute;
}
svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wrap {
  width: min(1220px, 91%);
  margin: auto;
}
header {
  border-bottom: 1px solid #292e37;
  background: #13161c;
}
.mast,
.tools,
.brand,
.brand-icon,
.action,
.timer,
.status,
.eyebrow,
h2,
.dialoghead {
  display: flex;
  align-items: center;
}
.mast {
  height: 76px;
  justify-content: space-between;
}
.brand {
  gap: 8px;
  text-decoration: none;
  font-size: 19px;
  font-weight: 850;
  letter-spacing: 1px;
}
.brand .thin {
  color: #aab0bb;
  font-weight: 450;
  letter-spacing: 1.2px;
}
.brand-icon {
  color: var(--amber);
  margin-right: 3px;
}
.brand-icon svg {
  width: 37px;
  height: 29px;
  stroke: none;
}
.tools {
  gap: 10px;
}
.tools button,
#close,
#touch button,
#pause {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #1c2027;
  padding: 9px 13px;
  color: #d9dde4;
  font-size: 12px;
  font-weight: 550;
}
.tools button:hover,
#close:hover,
#touch button:active,
#pause:hover {
  background: #2c323c;
}
.tools svg {
  width: 15px;
  height: 15px;
}
#app {
  min-height: 100vh;
  background: var(--bg);
  overflow: auto;
}
main {
  padding: 32px 0;
}
.gameframe {
  border: 1px solid #3a414b;
  border-radius: 8px;
  overflow: hidden;
  background: #10141c;
  box-shadow: 0 8px 28px #0003;
}
.hud {
  height: 77px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  align-items: center;
  background: #191d24;
}
.hud > div {
  padding: 0 10%;
  border-right: 1px solid #343941;
  line-height: 1;
}
.hud > div:last-child {
  border: 0;
}
.stat-label,
.eyebrow,
.hint,
.statusbar,
kbd,
.link,
.fleet {
  font-family: var(--mono);
}
.stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 650;
  color: #b7bdc5;
  margin-bottom: 9px;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  flex-shrink: 0;
}
.green {
  background: var(--green);
}
.amber {
  background: var(--amber);
}
.red {
  background: #e38278;
}
.hud strong {
  font:
    20px Pixel,
    monospace;
  color: #f4f2e8;
}
.hud small {
  font: 13px var(--mono);
  color: #939ba9;
  margin-left: 6px;
}
.fleet svg {
  width: 32px;
  height: 22px;
  color: var(--amber);
  stroke: none;
}
.fleet #lives {
  display: flex;
  gap: 5px;
}
.spent {
  opacity: 0.17;
}
#stage {
  position: relative;
  aspect-ratio: 2.88;
  min-height: 320px;
  background: #172347 url(assets/valley.webp) center/cover;
  isolation: isolate;
  overflow: hidden;
  border-block: 1px solid #363942;
}
#screen,
#screen canvas,
#splash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#screen canvas {
  image-rendering: pixelated;
}
#splash {
  background: linear-gradient(90deg, #080c1dc9 0%, #0a10215c 42%, transparent 68%);
  display: flex;
  align-items: center;
}
#splash:after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0px, transparent 3px, #04091216 4px);
}
#hero {
  position: absolute;
  width: 39%;
  height: 69%;
  object-fit: contain;
  right: 4.5%;
  top: 10%;
  image-rendering: pixelated;
  filter: drop-shadow(1px 4px 0 #09142e88);
  animation: hover 5s ease-in-out infinite;
}
@keyframes hover {
  50% {
    transform: translate(1px, -5px) rotate(-0.7deg);
  }
}
.intro {
  z-index: 1;
  position: relative;
  padding-left: 5%;
  padding-bottom: 1%;
}
.eyebrow {
  gap: 12px;
  letter-spacing: 2px;
  font-size: 11px;
  color: #f9c56d;
  font-weight: 700;
}
.eyebrow i {
  width: 24px;
  height: 2px;
  background: #e3ab56;
}
.eyebrow b {
  opacity: 0.55;
}
h1 {
  font:
    clamp(27px, 4.4vw, 65px) / 1.25 Pixel,
    monospace;
  letter-spacing: -0.075em;
  color: #ffdb91;
  margin: 22px 0 13px;
  text-shadow:
    0 3px 0 #bb7b38,
    0 6px 0 #794827,
    3px 7px 0 #29202b;
}
.intro p {
  color: #e0e1ea;
  font-size: clamp(14px, 1.25vw, 18px);
  margin: 0 0 27px;
}
.action {
  gap: 17px;
}
#launch {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffbd55;
  color: #211b13;
  border: 1px solid #ffd17b;
  border-bottom: 3px solid #bb8337;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
  padding: 13px 18px;
}
#launch:hover {
  background: #ffce78;
}
.play {
  width: 0;
  height: 0;
  border-block: 6px solid transparent;
  border-left: 9px solid currentColor;
}
.hint {
  font-size: 11px;
  color: #c3c5d1;
}
.hint kbd {
  margin-left: 4px;
  border-color: #787789;
  color: #dedce8;
  background: #23253299;
  font-size: 10px;
}
.statusbar {
  min-height: 40px;
  padding: 6px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #191d24;
  font-size: 11px;
  letter-spacing: 0.4px;
  color: #b3bac4;
}
.status,
.timer {
  gap: 10px;
}
.status .dot {
  border-radius: 50%;
  box-shadow: 0 0 7px #8bd7a733;
}
.timer svg {
  width: 14px;
  height: 14px;
}
#pause {
  padding: 3px 7px;
  margin-right: 5px;
  font: 11px var(--mono);
}
[hidden] {
  display: none !important;
}
.notes {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.notes section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 22px 25px;
}
h2 {
  gap: 11px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.3px;
  margin: 0 0 14px;
}
h2 svg {
  color: var(--amber);
  width: 20px;
  height: 20px;
}
.brief p,
#guide p {
  color: #b0b7c1;
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}
.brief strong,
#guide strong {
  color: #e3e6e9;
  font-weight: 600;
}
.link {
  border: 0;
  background: transparent;
  color: #efbd6a;
  padding: 0;
  margin-top: 13px;
  font-size: 11px;
  letter-spacing: 0.3px;
}
.link span {
  margin-left: 6px;
}
.link:hover {
  text-decoration: underline;
}
.keys {
  display: grid;
  grid-template-columns: 1.22fr 1fr;
  column-gap: 26px;
}
.keys > div {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  font-size: 13px;
  color: #bdc2cb;
}
.keys > div:nth-child(n + 3) {
  border-top: 1px solid #30353f;
}
.keys span:has(kbd) {
  display: inline-flex;
  gap: 3px;
}
kbd {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.4px;
  text-align: center;
  min-width: 23px;
  line-height: 20px;
  padding: 0 5px;
  background: #252a32;
  color: #e0e4ec;
  border: 1px solid #454b56;
  border-bottom-width: 2px;
  border-radius: 4px;
}
#touch {
  display: none;
}
#guide {
  background: var(--panel);
  border: 1px solid #4b5360;
  border-radius: 7px;
  color: var(--ink);
  width: min(490px, 90vw);
  padding: 26px;
}
#guide::backdrop {
  background: #050910ba;
}
.dialoghead {
  justify-content: space-between;
  margin-bottom: 18px;
}
.dialoghead h2 {
  margin: 0;
}
#close {
  font-size: 20px;
  padding: 1px 9px;
}
#guide p + p {
  margin-top: 12px;
}
@media (max-width: 850px) {
  .wrap {
    width: 94%;
  }
  .notes section {
    padding: 18px;
  }
  .keys {
    column-gap: 13px;
  }
  .mast {
    height: 62px;
  }
  main {
    padding-top: 20px;
  }
  .hud > div {
    padding: 0 8%;
  }
  .keys {
    grid-template-columns: 1fr;
  }
  .keys > div:nth-child(n + 2) {
    border-top: 1px solid #30353f;
  }
}
@media (pointer: coarse), (max-width: 650px) {
  #touch {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    margin: 10px 0;
  }
  #touch > div {
    display: flex;
    gap: 4px;
  }
  #touch button {
    min-width: 40px;
    min-height: 43px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }
  #touch button:last-child[data-key='fire'] {
    color: var(--amber);
  }
}
@media (max-width: 650px) {
  .wrap {
    width: calc(100% - 24px);
  }
  .mast {
    height: 57px;
  }
  .brand {
    font-size: 15px;
    gap: 5px;
  }
  .brand-icon svg {
    width: 29px;
  }
  .tools {
    gap: 5px;
  }
  .tools button {
    padding: 8px;
  }
  .tools button span {
    display: none;
  }
  main {
    padding-top: 15px;
  }
  .hud {
    height: 65px;
  }
  .hud strong {
    font-size: 14px;
  }
  .stat-label {
    font-size: 8px;
    gap: 4px;
    letter-spacing: 0.65px;
    margin-bottom: 7px;
  }
  .hud small {
    font-size: 10px;
    margin-left: 2px;
  }
  .fleet svg {
    width: 18px;
    height: 16px;
  }
  .fleet #lives {
    gap: 1px;
  }
  #stage {
    aspect-ratio: 1.18;
    min-height: 0;
  }
  #hero {
    width: 51%;
    height: 40%;
    right: 4%;
    top: 3%;
  }
  .intro {
    padding-left: 6%;
    padding-top: 16%;
  }
  .eyebrow {
    font-size: 9px;
  }
  .intro p {
    font-size: 13px;
    margin-bottom: 19px;
  }
  h1 {
    font-size: clamp(22px, 7vw, 40px);
    margin: 15px 0 12px;
  }
  .hint {
    display: none;
  }
  #launch {
    padding: 10px 14px;
    font-size: 13px;
  }
  .notes {
    margin-top: 14px;
    grid-template-columns: 1fr;
    gap: 11px;
  }
  .keys {
    grid-template-columns: 1.3fr 1fr;
  }
  .keys > div:nth-child(2) {
    border: 0;
  }
  .statusbar {
    font-size: 10px;
    padding: 5px 10px;
  }
  .status {
    gap: 6px;
  }
  .timer {
    gap: 5px;
  }
  .notes section {
    padding: 17px;
  }
  .brief p {
    font-size: 13px;
  }
  h2 {
    font-size: 16px;
  }
  .hud > div {
    padding: 0 8%;
  }
}
@media (prefers-reduced-motion: reduce) {
  #hero {
    animation: none;
  }
}
#screen canvas {
  width: 100% !important;
  height: 100% !important;
}
.tools button[aria-pressed='false'] svg {
  opacity: 0.5;
}
#app:fullscreen {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
#app:fullscreen main {
  width: 98%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 0;
}
#app:fullscreen .mast {
  height: 48px;
}
#app:fullscreen .gameframe {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
#app:fullscreen #stage {
  flex: 1;
  aspect-ratio: auto;
  min-height: 0;
}
#app:fullscreen .notes {
  display: none;
}
#guide .credits {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.credits a { color: var(--amber); }
