:root {
  --board: #eef2ff;
  --post: #d6daf0;
  --post-line: #b7c5d9;
  --edge: #8a93ab;
  --canvas: #ffffff;
  --ink: #000000;
  --text: #15161c;
  --dim: #555b72;
  --name: #117743;
  --green: #789922;
  --subject: #0f0c5d;
  --link: #34345c;
  --hot: #d00000;
  --red: #ed1c24;
  --orange: #ff7f27;
  --yellow: #fff200;
  --grass: #22b14c;
  --sky: #00a2e8;
  --indigo: #3f48cc;
  --sans: Arial, Helvetica, sans-serif;
  --mono: Consolas, "Courier New", monospace;
  --macro: Impact, Anton, "Arial Narrow", sans-serif;
  --gutter: clamp(14px, 3.2vw, 36px);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--board);
  color: var(--text);
  font: 15px/1.55 var(--sans);
}

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

[hidden],
[data-site-hidden] {
  display: none !important;
}

::selection {
  background: var(--yellow);
  color: #000000;
}

a {
  color: var(--link);
}

a:hover {
  color: var(--hot);
}

:focus-visible {
  outline: 2px dashed var(--sky);
  outline-offset: 3px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.scrawl {
  margin: 0;
  font-family: "Comic Sans MS", "Comic Sans", cursive;
  font-weight: 400;
  line-height: 1.25;
  color: var(--ink);
}

.scrawl svg {
  display: inline-block;
  height: 1em;
  max-width: none;
  overflow: visible;
  vertical-align: baseline;
  shape-rendering: crispEdges;
}

.ink {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.05;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ink.strike {
  stroke: var(--red);
  stroke-width: 0.85;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  min-height: 42px;
  padding: 8px 16px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 700 15px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--ink);
  color: #ffffff;
}

.btn:active {
  transform: translate(1px, 1px);
}

.btn-buy {
  background: var(--yellow);
}

.btn-buy:hover {
  color: var(--yellow);
}

.btn-small {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 14px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 52px;
  padding: 8px var(--gutter);
  background: var(--board);
  border-bottom: 1px solid var(--post-line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--subject);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 30px;
  height: 30px;
}

.boards {
  margin-right: auto;
  color: #8990ab;
  font-size: 14px;
  white-space: nowrap;
}

.boards a {
  text-decoration: none;
}

main {
  padding-top: clamp(18px, 3vw, 36px);
}

main > section {
  width: min(1180px, 100% - 2 * var(--gutter));
  margin-inline: auto;
  scroll-margin-top: 72px;
}

main > section + section {
  margin-top: clamp(80px, 11vw, 136px);
}

h2.scrawl {
  margin-bottom: 14px;
  font-size: clamp(44px, 6.4vw, 84px);
}

.intro {
  max-width: 62ch;
  margin: 0 0 28px;
  font-size: 17px;
}

.sheet {
  position: relative;
  background: var(--canvas);
  border: 1px solid var(--edge);
}

.sheet::after {
  content: "";
  position: absolute;
  inset: 0 -7px -7px 0;
  pointer-events: none;
  background:
    linear-gradient(#ffffff, #ffffff) right 1px top 50% / 3px 3px no-repeat,
    linear-gradient(#555e75, #555e75) right 0 top 50% / 5px 5px no-repeat,
    linear-gradient(#ffffff, #ffffff) left 50% bottom 1px / 3px 3px no-repeat,
    linear-gradient(#555e75, #555e75) left 50% bottom 0 / 5px 5px no-repeat,
    linear-gradient(#ffffff, #ffffff) right 1px bottom 1px / 3px 3px no-repeat,
    linear-gradient(#555e75, #555e75) right 0 bottom 0 / 5px 5px no-repeat;
}

.zoo {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 1180 / 640;
  overflow: hidden;
}

.zoo canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.zoo-title {
  position: absolute;
  left: 4%;
  top: 6%;
  font-size: 8.2cqw;
  line-height: 1.22;
  white-space: nowrap;
}

.exhibit {
  position: absolute;
  width: 12%;
}

.exhibit .tag {
  display: block;
  font-size: 4cqw;
  white-space: nowrap;
}

.ex-man {
  left: 64%;
  top: 8%;
}

.ex-frog {
  left: 82%;
  top: 4%;
}

.ex-dog {
  left: 7%;
  top: 54%;
}

.ex-cat {
  left: 81%;
  top: 55%;
}

.ex-monkey {
  left: 37%;
  top: 33%;
  width: 26%;
}

.ex-monkey .tag {
  font-size: 5.4cqw;
  text-align: center;
}

.ex-monkey img {
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.cut {
  position: relative;
  aspect-ratio: 10 / 11;
  margin-top: 0.6cqw;
}

.cut svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cut rect {
  fill: none;
  stroke: #000000;
  stroke-width: 1;
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
  shape-rendering: crispEdges;
  animation: ants 0.7s steps(8) infinite;
}

.cut span {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 6%;
  color: var(--dim);
  font-size: clamp(10px, 1.05cqw, 13px);
  line-height: 1.25;
}

@keyframes ants {
  to {
    stroke-dashoffset: -8;
  }
}

.note {
  position: absolute;
  left: 21.5%;
  top: 65%;
  display: flex;
  align-items: center;
  gap: 0.8cqw;
  color: var(--red);
  rotate: -5deg;
}

.note .scrawl {
  width: 8.6cqw;
  color: inherit;
  font-size: 3.1cqw;
}

.note .arrow {
  width: 6cqw;
  height: 3cqw;
  overflow: visible;
}

.arrow .ink {
  stroke-width: 2.8;
}

.statusbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 10px;
  border-top: 1px solid var(--post-line);
  background: #f4f6fc;
  color: #3c4258;
  font: 12px/1.4 var(--mono);
}

#status[data-level="3"],
#status[data-level="4"] {
  color: var(--hot);
  font-weight: 700;
}

.gate-copy {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 24px 56px;
  align-items: start;
  margin-top: 32px;
}

.nameline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0 0 14px;
  color: #000000;
  font: 400 clamp(46px, 6.2vw, 80px) / 0.95 var(--macro);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.nameline span {
  padding: 4px 9px;
  border: 2px solid #000000;
  background: var(--yellow);
  font: 700 16px/1 var(--mono);
  letter-spacing: 0;
}

.lede {
  max-width: 58ch;
  margin: 0;
  font-size: 18px;
}

.gate-buy {
  display: grid;
  gap: 12px;
  padding-top: 6px;
}

.ca-wait {
  margin: 0;
  padding: 11px 13px;
  border: 2px dashed var(--edge);
  color: var(--dim);
  font: 13px/1.45 var(--mono);
}

.ca {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #ffffff;
  color: #000000;
  font: 13px/1.3 var(--mono);
  text-align: left;
  cursor: pointer;
}

.ca:hover {
  background: var(--yellow);
}

.ca code {
  flex: 1;
  min-width: 0;
  font: inherit;
  overflow-wrap: anywhere;
}

.ca-label {
  padding: 3px 6px;
  background: #000000;
  color: #ffffff;
  font-weight: 700;
}

.ca-act {
  font: 700 13px/1 var(--sans);
  text-decoration: underline;
}

.ca[data-copied] .ca-act {
  font-size: 0;
}

.ca[data-copied] .ca-act::after {
  content: "copied";
  font-size: 13px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.thread {
  max-width: 800px;
  padding-left: 26px;
}

.post {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 6px;
  padding: 8px 18px 12px 14px;
  border: 1px solid var(--post-line);
  border-left: 0;
  border-top: 0;
  background: var(--post);
}

.post header {
  margin-bottom: 6px;
  color: #000000;
  font-size: 13px;
}

.post .subj {
  color: var(--subject);
  font-weight: 700;
}

.post .name {
  color: var(--name);
  font-weight: 700;
}

.post .no {
  color: var(--link);
}

.post p {
  margin: 0;
  color: #000000;
}

.gt {
  display: block;
  color: var(--green);
}

.post.op {
  width: auto;
  margin: 0 0 14px -26px;
  padding: 0 0 4px;
  border: 0;
  background: none;
}

.post.op::after {
  content: "";
  display: block;
  clear: both;
}

.file {
  float: left;
  margin: 0 18px 6px 0;
}

.file img {
  width: 150px;
  height: 150px;
  border: 1px solid var(--post-line);
}

.file figcaption {
  margin-top: 3px;
  color: var(--dim);
  font-size: 12px;
}

.reply::before {
  content: ">>";
  position: absolute;
  left: -24px;
  top: 6px;
  color: var(--post-line);
  font-size: 13px;
}

.sources {
  max-width: 800px;
  margin: 18px 0 0;
  color: var(--dim);
  font-size: 13px;
}

.stage {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 640px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.stage[data-state="run"] {
  cursor: crosshair;
}

.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage-monkey {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--size, 160px);
  height: var(--size, 160px);
  pointer-events: none;
  will-change: transform;
}

.hud {
  position: absolute;
  inset: 12px 14px auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  font: 12px/1.5 var(--mono);
}

.hud-time {
  margin: 0;
  color: var(--dim);
}

.hud-time b {
  color: #000000;
  font-size: 28px;
  line-height: 1;
}

.levels {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #9aa1b8;
  text-align: right;
}

.levels li.on {
  color: #000000;
  font-weight: 700;
}

.levels li.on::before {
  content: "> ";
}

.levels li[data-level="3"].on,
.levels li[data-level="4"].on {
  color: var(--hot);
}

.bait {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  max-width: 188px;
  margin: 0;
  padding: 4px 10px 6px;
  border: 1px solid var(--post-line);
  border-left: 0;
  border-top: 0;
  background: var(--post);
  color: #000000;
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
}

.bait b {
  display: block;
  color: var(--name);
  font-size: 12px;
}

.stage-start {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--hit, 200px);
  height: var(--hit, 200px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  touch-action: none;
}

.stage-start span {
  position: absolute;
  left: 50%;
  top: calc(100% + 12px);
  translate: -50% 0;
  padding: 7px 12px;
  border: 2px solid #000000;
  background: var(--yellow);
  color: #000000;
  font: 700 14px/1 var(--sans);
  white-space: nowrap;
}

.stage-end {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.end-title {
  font-size: clamp(40px, 7vw, 92px);
}

.stage[data-state="lost"] .end-title {
  color: var(--red);
}

.end-line {
  max-width: 52ch;
  margin: 0;
  font-size: 16px;
  text-wrap: balance;
}

.end-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.best {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--dim);
  font: 12px/1.5 var(--mono);
}

.maker {
  display: grid;
  grid-template-columns: minmax(0, 540px) minmax(0, 420px);
  gap: 56px;
  align-items: start;
}

.maker-sheet canvas {
  width: 100%;
  height: auto;
}

.maker-controls {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 6px;
}

.field > span {
  font: 700 13px/1.2 var(--sans);
}

.field input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #000000;
  border-radius: 0;
  background: #ffffff;
  color: #000000;
  font: 400 20px/1.15 var(--macro);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.field input[type="range"] {
  width: 100%;
  margin: 4px 0;
  accent-color: #000000;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.presets button {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--link);
  font: 15px/1.3 var(--sans);
  cursor: pointer;
}

.presets button::before {
  content: "[";
  color: #8990ab;
}

.presets button::after {
  content: "]";
  color: #8990ab;
}

.presets button:hover {
  color: var(--hot);
}

.swatches {
  display: grid;
  grid-template-columns: repeat(7, 32px);
  gap: 1px;
  width: max-content;
  padding: 1px;
  background: #6b7389;
}

.swatch {
  position: relative;
  width: 32px;
  height: 32px;
  background: var(--fill);
  cursor: pointer;
}

.swatch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.swatch:has(input:checked) {
  z-index: 1;
  outline: 2px solid #000000;
  box-shadow: inset 0 0 0 3px #ffffff;
}

.swatch:has(input:focus-visible) {
  z-index: 2;
  outline: 2px dashed var(--sky);
  outline-offset: 3px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #000000;
}

.maker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.maker-note {
  min-height: 20px;
  margin: 0;
  color: var(--dim);
  font: 12px/1.5 var(--mono);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin: 0 0 36px;
  padding: 0;
  list-style: none;
}

.steps .num {
  display: block;
  font-size: 60px;
  line-height: 1.1;
}

.steps li:nth-child(1) .num {
  color: var(--red);
}

.steps li:nth-child(2) .num {
  color: var(--sky);
}

.steps li:nth-child(3) .num {
  color: var(--grass);
}

.steps h3 {
  margin: 10px 0 4px;
  font-size: 18px;
  line-height: 1.25;
}

.steps p {
  max-width: 34ch;
  margin: 0;
}

.buy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: center;
}

.chart {
  margin-top: 28px;
}

.chart iframe {
  display: block;
  width: 100%;
  height: 520px;
  border: 0;
}

.foot {
  margin-top: clamp(80px, 11vw, 136px);
  padding: 28px var(--gutter) 44px;
  border-top: 1px solid var(--post-line);
  color: var(--dim);
  font-size: 13px;
}

.foot p {
  width: min(1180px, 100%);
  max-width: 78ch;
  margin: 0 auto 8px;
}

.foot p,
.foot .foot-status {
  margin-left: max(0px, (100% - 1180px) / 2);
}

.foot-status {
  color: #000000;
  font: 12px/1.5 var(--mono);
}

@media (max-width: 900px) {
  .gate-copy,
  .maker {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .maker-sheet {
    max-width: 540px;
  }

  .buy-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .brand span,
  .top .btn-small,
  .coords {
    display: none;
  }

  .top {
    gap: 12px;
  }

  .zoo {
    aspect-ratio: 360 / 540;
  }

  .zoo-title {
    left: 5%;
    top: 3%;
    font-size: 12.5cqw;
  }

  .exhibit {
    width: 25%;
  }

  .exhibit .tag {
    font-size: 7cqw;
  }

  .ex-man {
    left: 7%;
    top: 26%;
  }

  .ex-frog {
    left: 67%;
    top: 25%;
  }

  .ex-dog {
    left: 3%;
    top: 72%;
    width: 20%;
  }

  .ex-cat {
    left: 77%;
    top: 72%;
    width: 20%;
  }

  .ex-dog .tag,
  .ex-cat .tag {
    font-size: 6.2cqw;
  }

  .ex-monkey {
    left: 25%;
    top: 50%;
    width: 50%;
  }

  .ex-monkey .tag {
    font-size: 10cqw;
  }

  .cut span {
    font-size: 10px;
  }

  .note {
    left: 37%;
    top: 29%;
    flex-direction: column;
    gap: 1cqw;
    rotate: 4deg;
  }

  .note .scrawl {
    width: 17cqw;
    font-size: 6cqw;
  }

  .note .arrow {
    width: 11cqw;
    height: 5.5cqw;
    rotate: 78deg;
    margin: 2.5cqw 0 0 3cqw;
  }

  .thread {
    padding-left: 0;
  }

  .post.op {
    margin-left: 0;
  }

  .reply::before {
    display: none;
  }

  .file img {
    width: 104px;
    height: 104px;
  }

  .stage {
    aspect-ratio: 4 / 5;
  }

  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .chart iframe {
    height: 440px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cut rect {
    animation: none;
  }
}
