@font-face {
  font-family: Bangers;
  src: url('./fonts/bangers.ttf') format('truetype');
  font-display: swap;
}
:root {
  --paper: #fff;
  --ink: #08090b;
  --red: #e3262f;
  --spin: #7fd0f0;
  --label: 800 11px/1 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --numeral: italic 900 1em/1 system-ui, -apple-system, 'Segoe UI', Roboto, 'Arial Black', sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #101d3a;
  color: var(--ink);
  font:
    400 18px/1.2 Bangers,
    Impact,
    sans-serif;
  letter-spacing: 0.04em;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
[hidden] {
  display: none !important;
}

.hud {
  position: absolute;
  inset: 0;
}
.gauge {
  position: absolute;
  left: max(12px, env(safe-area-inset-left));
  top: max(4px, env(safe-area-inset-top));
  width: min(36vw, 62vh, 470px);
}
.gauge svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.pass.shade * {
  fill: var(--ink);
  stroke: var(--ink);
  stroke-width: 17;
}
.pass * {
  stroke-linejoin: miter;
  stroke-miterlimit: 3;
}
.pass.white * {
  fill: var(--paper);
  stroke: var(--paper);
  stroke-width: 17;
}
.pass.ink * {
  fill: var(--ink);
  stroke: var(--ink);
  stroke-width: 9;
}
.gauge .empty polygon {
  fill: #30343c;
}
.gauge .cells.full polygon {
  fill: var(--spin);
}
.gauge .steps.full polygon {
  fill: var(--paper);
}
.gauge .cells.gain polygon {
  fill: var(--paper);
}
.gauge .cells.gain {
  opacity: 0;
}
.gauge .cells.gain.on {
  animation: gain 0.3s steps(3) both;
}
.gauge.starving .cells.full polygon {
  fill: var(--red);
}
.gauge.starving .cells.gain polygon {
  fill: var(--paper);
}
.gauge .chain {
  fill: var(--paper);
  font: var(--numeral);
  font-size: 22px;
  text-anchor: middle;
}
.gauge.bleeding .chain {
  animation: stored 0.3s steps(2) infinite;
}
.gauge.stored .steps.full .bolt,
.gauge.unleashed .steps.full .bolt {
  fill: url(#gauge-deep);
}
.gauge.stored .pass.white .bolt {
  fill: #f07fd0;
  stroke: #f07fd0;
}
.gauge.stored .steps.full .bolt {
  animation: bolt-in 0.22s steps(3) both;
}
@keyframes bolt-in {
  0% {
    transform: scale(1.7);
    transform-origin: 140px 12px;
  }
  100% {
    transform: none;
    transform-origin: 140px 12px;
  }
}
@keyframes stored {
  50% {
    opacity: 0.3;
  }
}
.gauge .funnel {
  fill: #8a919e;
}
.gauge .growth {
  fill: var(--paper);
}
.gauge .level {
  fill: var(--ink);
}
.gauge .pips rect {
  fill: var(--ink);
  opacity: 0.55;
}
.gauge .wind {
  fill: none;
  stroke: var(--ink);
  stroke-width: 7;
}
.gauge.full .growth {
  animation: ready 0.5s steps(2) infinite;
}
@keyframes ready {
  0% {
    fill: var(--paper);
  }
  100% {
    fill: #8a919e;
  }
}
.gauge .number {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 8;
  paint-order: stroke fill;
  font:
    400 72px Bangers,
    Impact,
    sans-serif;
  text-anchor: middle;
  transform-box: fill-box;
  transform-origin: center;
}
.gauge.slam .number {
  animation: slam 0.3s cubic-bezier(0.2, 1.8, 0.4, 1);
}
.gauge.charged .headfx {
  animation: slam 0.26s cubic-bezier(0.2, 1.8, 0.4, 1);
  transform-box: fill-box;
  transform-origin: center;
}
.arcs polygon {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 6;
  stroke-linejoin: miter;
  stroke-miterlimit: 6;
  paint-order: stroke;
}
.arcs .cast {
  fill: var(--ink);
}
@keyframes gain {
  0% {
    opacity: 1;
  }
  66% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes slam {
  0% {
    scale: 1.5;
  }
  100% {
    scale: 1;
  }
}
@keyframes pulse {
  0% {
    filter: none;
  }
  100% {
    filter: brightness(1.4);
  }
}

.score {
  --blade: polygon(9% 0, 100% 0, 100% 100%, 0 100%, 6% 57%, 2.5% 52%);
  position: absolute;
  right: -8px;
  top: max(18px, env(safe-area-inset-top));
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px calc(22px + env(safe-area-inset-right)) 8px 44px;
  color: var(--paper);
  isolation: isolate;
  rotate: -3deg;
  transform-origin: 100% 0;
  filter: drop-shadow(-3px 4px 0 var(--ink));
}
.score::before,
.score::after {
  content: '';
  position: absolute;
  clip-path: var(--blade);
}
.score::before {
  inset: -4px -4px -4px -6px;
  z-index: -2;
  background: var(--paper);
}
.score::after {
  inset: 0;
  z-index: -1;
  background: var(--ink);
}
.score > b {
  font: var(--numeral);
  font-size: clamp(26px, min(4.4vw, 8vh), 50px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.score > i {
  font: var(--numeral);
  font-size: clamp(15px, 2vw, 22px);
  color: #9aa0ab;
}
.score.tick > b {
  animation: tick 0.16s cubic-bezier(0.2, 1.8, 0.4, 1);
  transform-origin: 100% 100%;
}
.score.record,
.score.unit {
  animation: slam 0.4s cubic-bezier(0.2, 1.8, 0.4, 1);
}
@keyframes tick {
  0% {
    scale: 1.12;
  }
  100% {
    scale: 1;
  }
}
.best {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px 3px 13px;
  background: var(--paper);
  color: var(--ink);
  font: var(--numeral);
  font-size: 14px;
  clip-path: polygon(9% 0, 100% 0, 100% 100%, 0 100%);
}
.best i {
  font-size: 0.8em;
}
.best .pennant {
  width: 10px;
  height: 12px;
  fill: currentColor;
}
.best.beaten {
  background: var(--ink);
  color: var(--paper);
  box-shadow: inset 0 0 0 2px var(--paper);
}
.score .best {
  position: absolute;
  right: calc(16px + env(safe-area-inset-right));
  top: calc(100% + 4px);
}

.brink {
  position: fixed;
  inset: 0;
  pointer-events: none;
  will-change: opacity;
  opacity: calc(var(--a, 0) * 0.8);
  background: radial-gradient(ellipse at 50% 46%, transparent 58%, var(--ink) 125%);
  -webkit-mask: radial-gradient(circle, #000 1.9px, transparent 2.2px) 0 0 / 7px 7px;
  mask: radial-gradient(circle, #000 1.9px, transparent 2.2px) 0 0 / 7px 7px;
}
.brink.beat {
  background: radial-gradient(ellipse at 50% 46%, transparent 54%, var(--red) 92%, var(--ink) 130%);
  animation: beat 0.46s ease-out infinite;
}
@keyframes beat {
  0% {
    opacity: calc(var(--a, 0) * 1);
  }
  30% {
    opacity: calc(var(--a, 0) * 0.7);
  }
  100% {
    opacity: calc(var(--a, 0) * 0.8);
  }
}

.flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--paper);
  opacity: 0;
}
.flash.on {
  animation: flash 0.13s steps(1, end) both;
}
@keyframes flash {
  0% {
    opacity: 0.92;
  }
  45% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.goal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  filter: drop-shadow(3px 4px 0 var(--ink));
}
.goal::before {
  content: '';
  position: absolute;
  left: -22px;
  top: -22px;
  width: 50px;
  height: 44px;
  background: var(--spin);
  clip-path: polygon(0 12%, 100% 50%, 4% 100%, 22% 52%);
  animation: nudge 0.5s steps(2) infinite;
}
@keyframes nudge {
  0% {
    translate: 0 0;
  }
  100% {
    translate: 6px 0;
  }
}

.menu {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
  color: var(--paper);
  --heavy: italic 900 1em/1 system-ui, -apple-system, 'Segoe UI', Roboto, 'Arial Black', sans-serif;
}
.poster {
  position: absolute;
  inset: 0 -45vw;
  background: var(--ink);
  transform: skewX(-16deg);
  box-shadow:
    -14px 0 0 var(--paper),
    -34px 0 0 var(--spin),
    14px 0 0 var(--paper),
    34px 0 0 var(--spin);
}
.field {
  position: absolute;
  display: block;
  inset: 0 45vw;
  transform: skewX(16deg);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 1.6px, transparent 1.9px) 0 0 / 12px 12px;
}
.title .field {
  background: none;
}
.title .field::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1.8px, transparent 2.1px) 0 0 / 11px 11px;
  -webkit-mask: radial-gradient(ellipse 46% 46% at 50% 44%, #000 0, transparent 100%);
  mask: radial-gradient(ellipse 46% 46% at 50% 44%, #000 0, transparent 100%);
}
.backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.menu.in .poster {
  animation: wipe-in 0.34s cubic-bezier(0.3, 0, 0.2, 1) both;
}
.menu.in > :not(.poster) {
  animation: slam-in 0.3s cubic-bezier(0.2, 1.3, 0.4, 1) 0.2s both;
}
@keyframes wipe-in {
  0% {
    translate: -200vw 0;
  }
  100% {
    translate: 0 0;
  }
}
@keyframes slam-in {
  0% {
    opacity: 0;
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.logo {
  position: absolute;
  left: 50%;
  top: 45%;
  translate: -50% -50%;
  width: min(62vw, 104vh, 860px);
}
.logo svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.logo .solid {
  fill-rule: nonzero;
}
.logo .paper,
.logo .accent {
  fill-rule: evenodd;
}
.logo .paper {
  fill: var(--paper);
}
.logo .accent {
  fill: var(--spin);
}
.logo .cut {
  fill: var(--ink);
}
.logo .pass.white * {
  stroke-width: 24;
}
.logo .pass.ink * {
  stroke-width: 11;
}
.logo .pass.shade * {
  stroke-width: 24;
  fill: #000;
  stroke: #000;
}
@keyframes blink {
  0% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  71% {
    opacity: 0.3;
  }
  100% {
    opacity: 0.3;
  }
}

.chip {
  min-width: 74px;
  padding: 5px 9px 6px;
  background: var(--ink);
  color: var(--paper);
  font: var(--label);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-align: center;
  transform: skewX(-10deg);
}
.panel.dark .chip {
  background: var(--paper);
  color: var(--ink);
}
.new {
  padding: 4px 12px 5px 16px;
  background: var(--spin);
  color: var(--ink);
  font-size: 20px;
  clip-path: polygon(14% 0, 100% 0, 100% 100%, 14% 100%, 0 50%);
}
.measure {
  display: flex;
  gap: 6px;
  margin: 10px 0 0 46px;
}
.measure i {
  width: 30px;
  height: 22px;
  background: #30343c;
  transform: skewX(-18deg);
}
.measure i.on {
  background: var(--paper);
}
.seed {
  position: absolute;
  right: 14px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  font: var(--numeral);
  font-size: 17px;
  letter-spacing: 0.08em;
  color: var(--paper);
  user-select: text;
}

@media (max-aspect-ratio: 1/1) {
  .gauge {
    left: 1vw;
    width: 56vw;
    max-width: 300px;
  }
  .score {
    top: max(12px, env(safe-area-inset-top));
    padding: 3px calc(16px + env(safe-area-inset-right)) 5px 34px;
  }
  .score > b {
    font-size: 24px;
  }
  .score > i {
    font-size: 13px;
  }
  .score .best {
    font-size: 13px;
  }
}
#stick {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
#stick svg {
  position: absolute;
  translate: -50% -50%;
  overflow: visible;
  filter: drop-shadow(4px 5px 0 rgba(8, 9, 11, 0.55));
}
#stick polygon {
  stroke-linejoin: miter;
}
#stick .plate {
  fill: rgba(8, 9, 11, 0.34);
  stroke: var(--paper);
  stroke-width: 4;
}
#stick .ink {
  fill: var(--ink);
  stroke: var(--ink);
  stroke-width: 9;
}
#stick .face {
  fill: var(--paper);
}
@media (prefers-reduced-motion: reduce) {
  .gauge .headfx,
  .gauge .beamfx,
  .gauge .growth,
  .brink.beat,
  .prompt,
  .goal::before {
    animation: none !important;
  }
}
.shards {
  position: fixed;
  z-index: 20;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.title .poster,
.paused .poster {
  inset: 27% 0 auto;
  height: 27%;
  transform: none;
  box-shadow:
    0 -8px 0 var(--paper),
    0 8px 0 var(--paper);
  clip-path: polygon(0 9%, 62% 0, 64% 6%, 100% 2%, 100% 93%, 41% 100%, 39% 94%, 0 98%);
}
.title .field,
.paused .field {
  display: none;
}
.menu.title.in .poster,
.menu.paused.in .poster {
  animation: band-in 0.16s steps(3) both;
}
.menu.title.out .poster {
  animation: band-out 0.2s steps(3) both;
}
@keyframes band-in {
  0% {
    scale: 1 0;
  }
  100% {
    scale: 1 1;
  }
}
@keyframes band-out {
  0% {
    scale: 1 1;
  }
  100% {
    scale: 1 0;
  }
}

.action {
  position: relative;
  display: block;
  margin: 0 auto;
  padding: 15px 78px 18px 46px;
  border: 0;
  outline: 0;
  background: none;
  color: var(--paper);
  font: var(--heavy);
  font-size: 38px;
  letter-spacing: 0.02em;
  isolation: isolate;
  cursor: pointer;
  --cut: polygon(0 0, 86% 0, 100% 50%, 86% 100%, 0 100%, 5% 50%);
  filter: drop-shadow(5px 6px 0 rgba(8, 9, 11, 0.55));
}
.action::before,
.action::after {
  content: '';
  position: absolute;
  clip-path: var(--cut);
}
.action::before {
  inset: -6px -9px;
  z-index: -2;
  background: var(--paper);
}
.action::after {
  inset: 0;
  z-index: -1;
  background: linear-gradient(112deg, var(--ink) 0 79%, var(--spin) 79% 100%);
}
.action:active {
  translate: 2px 3px;
  filter: none;
}
.menu.in .action {
  animation: cut-in 0.18s steps(3) 0.3s both;
}
@keyframes cut-in {
  0% {
    opacity: 0;
    translate: -40px 0;
  }
  100% {
    opacity: 1;
    translate: 0 0;
  }
}
.title .action {
  position: absolute;
  left: 50%;
  bottom: 11vh;
  translate: -50% 0;
}
.title .action:active {
  translate: calc(-50% + 2px) 3px;
}
.menu.title.in .action {
  animation: none;
}
.title .logo {
  top: 40%;
  width: min(64vw, 96vh, 820px);
  transition:
    top 0.4s steps(5),
    left 0.4s steps(5),
    width 0.4s steps(5),
    translate 0.4s steps(5);
}
.title.watching .logo {
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  width: min(34vw, 40vh, 300px);
  translate: 0 0;
}
.title .poster {
  transition: scale 0.2s steps(3);
}
.title.watching .poster {
  scale: 1 0;
}
@media (max-aspect-ratio: 1/1) {
  .title .logo {
    width: 98vw;
  }
}
.sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 520px;
  translate: -50% -50%;
  display: grid;
  gap: 22px;
  font: var(--heavy);
}
.results {
  background: rgba(207, 216, 211, 0.6);
}
.results .poster {
  display: none;
}
.plate {
  position: relative;
  display: grid;
  grid-template-columns: 150px 1fr;
  column-gap: 18px;
  padding: 40px 36px 26px 40px;
  color: var(--paper);
  isolation: isolate;
  filter: drop-shadow(9px 10px 0 rgba(8, 9, 11, 0.3));
}
.plate::before,
.plate::after {
  content: '';
  position: absolute;
  clip-path: polygon(3.5% 0, 100% 0, 100% 90%, 95.5% 100%, 0 100%, 2.6% 60%, 0 55%, 4% 49%);
}
.plate::before {
  inset: -7px -8px;
  z-index: -2;
  background: var(--paper);
}
.plate::after {
  inset: 0;
  z-index: -1;
  background: var(--ink);
}
.ending {
  position: absolute;
  left: 34px;
  top: -19px;
  padding: 7px 16px 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 0 0 5px var(--ink);
  font-size: 20px;
  letter-spacing: 0.1em;
  transform: skewX(-10deg) rotate(-2deg);
}
.ending.record {
  background: var(--spin);
}
.code {
  position: absolute;
  right: 34px;
  top: 16px;
  font-size: 17px;
  letter-spacing: 0.08em;
  color: #8b919c;
  user-select: text;
}
.reached {
  grid-row: 1 / 3;
  align-self: center;
  rotate: -6deg;
}
.reached svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.reached .rim {
  fill: none;
  stroke: var(--paper);
  stroke-width: 13;
  stroke-linejoin: miter;
}
.reached .body {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 4;
}
.reached.record .body {
  fill: var(--spin);
}
.reached text {
  fill: var(--ink);
  font: var(--numeral);
  font-size: 58px;
  text-anchor: middle;
}
.cracked {
  position: relative;
  align-self: end;
  margin-top: 10px;
}
.cracked b {
  display: block;
  font-size: 104px;
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.cracked b i {
  margin-left: 8px;
  font-size: 0.34em;
  letter-spacing: 0;
  color: #c9ced6;
}
.cracked .above {
  clip-path: polygon(-10% -10%, 110% -10%, 110% 30%, -10% 68%);
  translate: 5px -3px;
}
.cracked .below {
  position: absolute;
  inset: 0;
  clip-path: polygon(-10% 68%, 110% 30%, 110% 110%, -10% 110%);
  translate: -4px 3px;
}
.depth {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-self: start;
  margin-top: 12px;
}
.world {
  display: flex;
  align-items: center;
  gap: 4px;
}
.world i {
  width: 17px;
  height: 13px;
  background: #2b2f38;
  transform: skewX(-18deg);
}
.world i.on {
  background: var(--paper);
}
.world u {
  width: 11px;
  height: 11px;
  margin-left: 3px;
  background: var(--spin);
  rotate: 45deg;
}
.foot,
.state {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.foot {
  grid-column: 1 / 3;
  margin: 22px -36px 0 -40px;
  padding: 15px 36px 0 52px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.16);
}
.figure {
  display: grid;
  gap: 4px;
  color: var(--paper);
}
.figure span {
  font: var(--label);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: #9aa0ab;
}
.figure b {
  font-size: 30px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.figure.record b {
  color: var(--spin);
}
.sheet .brand {
  position: static;
  translate: none;
  width: 270px;
  margin: 0 0 30px 4px;
  justify-self: start;
  filter: drop-shadow(5px 6px 0 rgba(8, 9, 11, 0.3));
}
.results .action {
  justify-self: end;
  margin-right: 6px;
}
.paused {
  background: rgba(8, 9, 11, 0.6);
}
.paused .poster {
  display: none;
}
.pause {
  position: absolute;
  inset: 0;
  margin: auto;
  height: fit-content;
  width: min(84vw, 440px);
  display: grid;
  gap: 20px;
  padding: 30px 30px 34px;
  font: var(--heavy);
  isolation: isolate;
}
.pause::before,
.pause::after {
  content: '';
  position: absolute;
  clip-path: polygon(0 0, 90% 0, 100% 12%, 100% 100%, 8% 100%, 0 90%);
}
.pause::before {
  inset: -7px -9px;
  z-index: -2;
  background: var(--paper);
}
.pause::after {
  inset: 0;
  z-index: -1;
  background: var(--ink);
}
.pause h2 {
  margin: 0;
  font: inherit;
  font-size: 50px;
  letter-spacing: -0.02em;
  color: var(--paper);
}
.bars {
  position: absolute;
  right: 38px;
  top: 34px;
  width: 34px;
  height: 40px;
  background: linear-gradient(90deg, var(--spin) 0 36%, transparent 36% 64%, var(--spin) 64% 100%);
  transform: skewX(-14deg);
}
.state {
  padding: 0;
  background: none;
  box-shadow: none;
  clip-path: none;
  grid-template-columns: auto auto auto;
  justify-content: space-between;
}
.state .figure b {
  font-size: 24px;
}
.pause .action {
  margin: 4px 0 0;
  padding: 12px 64px 14px 36px;
  font-size: 32px;
  justify-self: start;
}
.menu.paused.in .pause {
  animation: cut-in 0.12s steps(2) both;
}
.menu.paused.in .action {
  animation: none;
}
.seed {
  display: none;
}
.menu.results.in > *,
.menu.results.in .action,
.menu.title.in .poster {
  animation: none;
}
.title .poster {
  filter: drop-shadow(0 7px 0 var(--paper)) drop-shadow(0 -7px 0 var(--paper)) drop-shadow(0 9px 0 var(--spin));
  box-shadow: none;
}
.title .action::after {
  animation: facet 1.1s steps(2) infinite;
}
@keyframes facet {
  50% {
    filter: brightness(1.35);
  }
}
.logo .wind {
  fill: none;
  stroke: var(--ink);
  stroke-width: 6;
}
.logo .crack {
  fill: var(--ink);
  stroke: var(--paper);
  stroke-width: 3.5;
  stroke-linejoin: miter;
}
.logo .body {
  fill: var(--paper);
}
.logo .eye {
  fill: url(#logo-deep);
}
.logo .eye.dots {
  fill: url(#logo-dots);
  mask: url(#logo-blend);
}
.logo .eye.rim {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linejoin: miter;
}
