:root {
  --ink: #0b0906;
  --paper: #fff6d8;
  --sun: #ffe14a;
  --blue: #3b7cff;
  --pink: #ff4d8a;
  --red: #ff2a2a;
  --cream: #fff7e0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: "ZCOOL KuaiLe", "Microsoft YaHei", Impact, sans-serif;
  cursor: crosshair;
  user-select: none;
}

#scene,
canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.scanlines,
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 8;
}

.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.16) 0 2px,
    transparent 2px 5px
  );
  mix-blend-mode: multiply;
}

.noise {
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#hud {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 10;
}

.ticker {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 2rem;
  overflow: hidden;
  background: var(--sun);
  color: #111;
  font-size: 14px;
  letter-spacing: 0.12em;
  white-space: nowrap;
  border-bottom: 4px solid #111;
}

.ticker span {
  display: inline-block;
  padding: 8px 0;
  animation: marquee 22s linear infinite;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

.stamp {
  position: absolute;
  top: 58px;
  right: 18px;
  border: 4px solid var(--red);
  color: var(--red);
  padding: 8px 10px;
  rotate: 14deg;
  font-size: 18px;
  line-height: 1.1;
  text-transform: uppercase;
  background: rgba(11, 9, 6, 0.45);
  box-shadow: 6px 6px 0 #111;
}

.year {
  position: absolute;
  left: -12px;
  top: 38%;
  font-family: Bungee, Impact, sans-serif;
  font-size: clamp(64px, 14vw, 180px);
  color: rgba(255, 225, 74, 0.18);
  rotate: -90deg;
  transform-origin: left center;
  letter-spacing: -0.06em;
  pointer-events: none;
}

.name {
  position: absolute;
  left: 22px;
  bottom: 72px;
  font-size: clamp(42px, 9vw, 112px);
  line-height: 0.82;
  letter-spacing: -0.04em;
  text-shadow: 6px 6px 0 #111, -3px 0 0 var(--blue);
  max-width: 70vw;
}

.sub {
  position: absolute;
  left: 26px;
  bottom: 38px;
  color: var(--sun);
  font-size: 15px;
  letter-spacing: 0.16em;
}

.stats {
  position: absolute;
  top: 52px;
  left: 16px;
  display: grid;
  gap: 4px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  background: #111;
  color: var(--sun);
  padding: 10px 12px;
  border: 3px solid var(--blue);
}

.stats b {
  color: var(--paper);
  font-weight: 700;
}

.hint {
  position: absolute;
  right: 16px;
  bottom: 18px;
  font-size: 13px;
  color: var(--cream);
  opacity: 0.85;
}

#mute {
  pointer-events: auto;
  position: absolute;
  right: 16px;
  bottom: 46px;
  border: 3px solid #111;
  background: var(--pink);
  color: #111;
  font: inherit;
  font-size: 14px;
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: 4px 4px 0 #111;
}

#mute:active {
  translate: 2px 2px;
  box-shadow: 2px 2px 0 #111;
}

#toasts {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 12;
}

.toast {
  position: absolute;
  padding: 8px 14px;
  background: var(--sun);
  color: #111;
  border: 3px solid #111;
  font-size: 18px;
  rotate: -8deg;
  animation: pop 1.8s ease-out forwards;
  box-shadow: 5px 5px 0 var(--blue);
}

@keyframes pop {
  0% {
    transform: scale(0.2) translateY(20px);
    opacity: 0;
  }
  18% {
    transform: scale(1.12) translateY(0);
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(-80px);
    opacity: 0;
  }
}

#flies {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 11;
  overflow: hidden;
}

.fly-photo {
  position: absolute;
  width: min(42vw, 280px);
  border: 6px solid var(--sun);
  box-shadow: 10px 10px 0 #111;
  animation: fly 2.6s ease-out forwards;
}

.fly-photo.alt {
  border-color: var(--blue);
  box-shadow: 10px 10px 0 var(--pink);
}

.fly-cake {
  position: absolute;
  font-size: 54px;
  animation: cake-drop 2.2s ease-in forwards;
  filter: drop-shadow(3px 3px 0 #111);
}

@keyframes fly {
  0% {
    transform: scale(0.15) rotate(-25deg);
    opacity: 0;
  }
  16% {
    opacity: 1;
    transform: scale(1.08) rotate(8deg);
  }
  100% {
    transform: translate(18vw, -12vh) scale(0.7) rotate(22deg);
    opacity: 0;
  }
}

@keyframes cake-drop {
  0% {
    transform: translateY(-10vh) rotate(-20deg) scale(0.4);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(50deg) scale(1.1);
    opacity: 0.2;
  }
}

#gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  background:
    repeating-linear-gradient(
      -18deg,
      var(--sun) 0 18px,
      #111 18px 36px
    );
  display: grid;
  place-content: center;
  text-align: center;
  gap: 10px;
  padding: 24px;
}

#gate h2 {
  font-size: clamp(56px, 16vw, 140px);
  line-height: 0.8;
  color: #111;
  text-shadow: 8px 8px 0 var(--blue);
}

.gate-kicker {
  font-family: Bungee, Impact, sans-serif;
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--red);
  background: #111;
  display: inline-block;
  justify-self: center;
  padding: 6px 10px;
}

.gate-title {
  font-size: clamp(22px, 5vw, 40px);
  color: var(--sun);
  background: #111;
  display: inline-block;
  justify-self: center;
  padding: 6px 14px;
  border: 4px solid #111;
  box-shadow: 6px 6px 0 var(--blue);
}

.gate-note {
  color: #1a1a1a;
  font-size: 16px;
  line-height: 1.5;
  background: var(--paper);
  border: 4px solid #111;
  padding: 12px 16px;
  rotate: -2deg;
}

#start {
  margin-top: 8px;
  border: 4px solid #111;
  background: var(--pink);
  color: #111;
  font: inherit;
  font-size: 22px;
  padding: 12px 22px;
  cursor: pointer;
  box-shadow: 8px 8px 0 #111;
}

#start:hover {
  background: var(--blue);
  color: #fff;
}

#gate.gone {
  animation: gate-out 0.55s steps(6) forwards;
}

@keyframes gate-out {
  to {
    opacity: 0;
    filter: contrast(4) hue-rotate(80deg);
    visibility: hidden;
  }
}

@media (max-width: 720px) {
  .name {
    bottom: 96px;
  }
  .stats {
    font-size: 10px;
  }
  .stamp {
    font-size: 14px;
    top: 50px;
  }
}
