@import url("/css/fable.css?v=1");
@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
/* A cartoon jungle: leaf green, banana yellow, and a sticker outline on
   everything you can press. */
:root {
  --leaf: #0e3b2b;
  --banana: #ffd93b;
  --ink: #17251c;
  --cream: #fff6d8;
  --f-bg: var(--leaf);
  --f-ink: var(--cream);
  --f-soft: rgba(255, 246, 216, 0.8);
  --f-line: rgba(255, 246, 216, 0.25);
  --f-surface: #14513a;
  --f-accent: var(--banana);
  --f-on-accent: var(--ink);
  --f-warn: #ffb3a6;
  --f-display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --f-body: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
}
body {
  overflow: hidden;
  overscroll-behavior: none;
  font-weight: 500;
}
.game {
  position: fixed;
  inset: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}
.bar {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  z-index: 3;
  transition: opacity 0.2s;
}
.game:not([data-state="menu"]):not([data-state="over"]) .bar {
  opacity: 0;
  pointer-events: none;
}
.home {
  color: var(--cream);
  font-weight: 700;
  text-decoration: none;
}
.crumb {
  padding-left: 14px;
  border-left: 2px solid var(--f-line);
  color: var(--f-soft);
  font-size: 15px;
  text-decoration: none;
}
.bar nav {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.chip {
  background: var(--f-surface);
  border: 2px solid var(--ink);
  font-weight: 600;
}

.menu {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 80px);
  overflow: auto;
  z-index: 2;
  text-align: center;
}
#title {
  margin: 0;
  font: 700 clamp(48px, 13vmin, 92px) / 0.86 var(--f-display);
  color: var(--banana);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink);
}
#title span {
  display: block;
}
#title span:first-child {
  rotate: -4deg;
}
#title span:nth-child(2) {
  rotate: 2deg;
  color: var(--cream);
}
#title em {
  display: inline-block;
  margin-top: 18px;
  padding: 2px 16px 4px;
  border: 3px solid var(--ink);
  border-radius: 99px;
  background: #ff7a59;
  color: var(--ink);
  font: 700 22px/1.2 var(--f-display);
  -webkit-text-stroke: 0;
  text-shadow: none;
  rotate: -3deg;
}
.lede {
  margin: 18px auto 0;
  max-width: 34ch;
  font-size: 19px;
  line-height: 1.35;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
#begin {
  margin: 18px auto 0;
  max-width: 360px;
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: var(--f-surface);
  box-shadow: 0 6px 0 var(--ink);
  text-align: left;
}
.field-label {
  display: block;
  margin: 0 2px 6px;
  font-size: 15px;
}
#player {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  font-weight: 600;
  user-select: text;
  -webkit-user-select: text;
}
.primary {
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 5px 0 var(--ink);
  font: 700 21px var(--f-display);
}
.primary:active {
  translate: 0 3px;
  box-shadow: 0 2px 0 var(--ink);
}
#begin .primary {
  width: 100%;
  margin-top: 6px;
}
.ghost {
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  font-weight: 600;
}
.keys {
  margin: 14px 0 0;
  font-size: 15px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.touch {
  display: none;
}
.linklike {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hud {
  position: absolute;
  inset: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) auto max(12px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: minmax(150px, 280px) 1fr auto;
  gap: 12px;
  align-items: start;
  pointer-events: none;
  z-index: 2;
}
.hud .chip {
  pointer-events: auto;
}
.vitals {
  display: grid;
  gap: 6px;
}
.meter {
  position: relative;
  height: 24px;
  border: 3px solid var(--ink);
  border-radius: 99px;
  background: rgba(10, 40, 28, 0.7);
  overflow: hidden;
}
.meter.xp {
  height: 18px;
}
.meter i {
  position: absolute;
  inset: 0;
  transform-origin: left;
  transform: scaleX(1);
  background: #ff6b5e;
  transition: transform 0.15s;
}
.meter.xp i {
  background: #35d0ba;
  transform: scaleX(0);
}
.meter span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  line-height: 1;
}
.counts {
  justify-self: end;
  text-align: right;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
  font-variant-numeric: tabular-nums;
}
.counts strong {
  display: block;
  font: 700 clamp(24px, 4.4vmin, 36px) / 1 var(--f-display);
  color: var(--banana);
}
.counts span {
  display: inline-block;
  margin-left: 10px;
  font-size: 15px;
}
.banner {
  position: absolute;
  left: 50%;
  top: 20%;
  translate: -50% 0;
  width: min(94vw, 640px);
  text-align: center;
  font: 700 clamp(30px, 7vmin, 60px) / 1 var(--f-display);
  color: var(--banana);
  -webkit-text-stroke: 2.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--ink);
  opacity: 0;
  scale: 0.8;
  transition: opacity 0.2s, scale 0.25s cubic-bezier(0.2, 1.6, 0.4, 1);
  pointer-events: none;
  z-index: 2;
}
.banner.show {
  opacity: 1;
  scale: 1;
}
.banner small {
  display: block;
  margin-top: 6px;
  font-size: 0.4em;
  color: var(--cream);
  -webkit-text-stroke: 0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}
.dash {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(26px, env(safe-area-inset-bottom));
  width: 96px;
  height: 96px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: conic-gradient(var(--banana) var(--ready, 360deg), rgba(255, 217, 59, 0.25) 0);
  color: var(--ink);
  font: 700 18px var(--f-display);
  box-shadow: 0 5px 0 var(--ink);
  touch-action: none;
  z-index: 3;
}
.stick {
  position: absolute;
  width: 110px;
  height: 110px;
  margin: -55px 0 0 -55px;
  border: 3px solid rgba(255, 246, 216, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}
.stick i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px;
  border-radius: 50%;
  background: rgba(255, 246, 216, 0.75);
}

.card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(620px, calc(100vw - 20px));
  max-height: calc(100dvh - 20px);
  overflow: auto;
  padding: 22px;
  border: 4px solid var(--ink);
  border-radius: 26px;
  background: var(--f-surface);
  box-shadow: 0 8px 0 var(--ink);
  z-index: 4;
  animation: plop 0.3s cubic-bezier(0.2, 1.5, 0.4, 1);
}
@keyframes plop {
  from {
    scale: 0.85;
    opacity: 0;
  }
}
.card h2 {
  margin: 0;
  font: 700 28px/1.1 var(--f-display);
  text-align: center;
}
.choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.choice {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 14px 12px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--cream);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 5px 0 var(--ink);
  transition: translate 0.1s;
}
.choice:hover,
.choice:focus-visible {
  translate: 0 -3px;
  background: #fff;
}
.choice b {
  font: 700 19px/1.1 var(--f-display);
}
.choice span {
  font-size: 15px;
  line-height: 1.3;
}
.choice small {
  font-size: 13px;
  font-weight: 600;
  color: #8a5a00;
}
.choice kbd {
  justify-self: start;
  border-color: rgba(0, 0, 0, 0.3);
  color: var(--ink);
}
.build {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.build li {
  padding: 3px 12px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 15px;
}
.kicker {
  margin: 0;
  text-align: center;
  color: var(--f-soft);
}
#over-title strong {
  display: block;
  font-size: clamp(54px, 15vmin, 92px);
  line-height: 1;
  color: var(--banana);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--ink);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0 0;
}
.stats div {
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  text-align: center;
}
.stats dt {
  font-size: 13px;
  color: var(--f-soft);
}
.stats dd {
  margin: 2px 0 0;
  font: 700 21px var(--f-display);
}
.status {
  text-align: center;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.actions .primary {
  flex: 1 0 100%;
}
.actions .ghost {
  flex: 1;
  min-height: 48px;
}
.credit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(10px, env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--f-soft);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
  z-index: 2;
}
.game:not([data-state="menu"]) .credit {
  display: none;
}
dialog {
  border: 4px solid var(--ink);
  background: #14513a;
}
.help h3 {
  margin: 14px 0 2px;
  font: 700 18px var(--f-display);
  color: var(--banana);
}
.help h3:first-child {
  margin-top: 0;
}
.help p {
  margin: 0;
  color: var(--f-soft);
}
.settings {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px solid var(--f-line);
}
.settings input {
  accent-color: var(--banana);
}
@media (pointer: coarse) {
  .desk {
    display: none;
  }
  .touch {
    display: inline;
  }
}
@media (max-width: 640px) {
  .crumb,
  #btn-help {
    display: none;
  }
  .choices {
    grid-template-columns: 1fr;
  }
  .choice kbd {
    display: none;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .hud {
    grid-template-columns: minmax(120px, 1fr) auto auto;
  }
  .counts span {
    display: block;
    margin: 0;
  }
  #kills {
    display: none;
  }
}
