:root {
  color-scheme: dark;
  background: #050008;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #050008;
}

body {
  min-height: 100dvh;
  font-family: Arial, Helvetica, sans-serif;
}

#field {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: block;
  background: #050008;
}

.strobe {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(90deg, rgba(255, 0, 213, 0.64), rgba(0, 255, 234, 0.52), rgba(255, 255, 0, 0.58));
  mix-blend-mode: screen;
  opacity: 0;
  animation: strobeBlink 0.16s steps(1, end) infinite;
}

.ticker {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  gap: 26px;
  width: 100%;
  overflow: hidden;
  padding: 9px 0;
  color: #ffffff;
  text-decoration: none;
  text-transform: uppercase;
  font-size: clamp(13px, 2.4vw, 22px);
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 0 10px rgba(255, 0, 213, 0.95),
    0 0 18px rgba(0, 255, 234, 0.9),
    2px 2px 0 rgba(0, 0, 0, 0.82);
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(2px);
}

.ticker span {
  flex: 0 0 max-content;
  animation: tickerRun 12s linear infinite;
}

main {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  isolation: isolate;
  z-index: 4;
}

main::before,
main::after {
  position: absolute;
  inset: 50%;
  width: min(92vmin, 850px);
  aspect-ratio: 1;
  content: "";
  border-radius: 50%;
  translate: -50% -50%;
  z-index: -1;
}

main::before {
  background:
    conic-gradient(from var(--spin, 0deg), #ff1b6b, #45caff, #f8ff00, #39ff14, #ad00ff, #ff1b6b);
  filter: blur(34px) saturate(180%);
  opacity: 0.72;
  mix-blend-mode: screen;
  animation: spinRing 7s linear infinite;
}

main::after {
  width: min(72vmin, 640px);
  background: radial-gradient(circle, rgba(255,255,255,0.42), rgba(255,255,255,0.03) 36%, transparent 66%);
  filter: blur(18px);
  opacity: 0.56;
  animation: pulseHalo 2.8s ease-in-out infinite;
}

.bird {
  width: clamp(260px, 54vmin, 680px);
  height: auto;
  image-rendering: auto;
  filter:
    drop-shadow(0 0 18px rgba(255, 255, 255, 0.65))
    drop-shadow(0 0 46px rgba(44, 255, 145, 0.58))
    drop-shadow(0 0 88px rgba(255, 0, 213, 0.44));
  transform-origin: 52% 48%;
  animation: birdFloat 4.8s ease-in-out infinite, birdHue 9s linear infinite;
}

.sound-toggle {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  top: calc(max(48px, env(safe-area-inset-top)) + 18px);
  z-index: 8;
  min-width: 66px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 4px;
  color: #050008;
  background: #ffffff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.82),
    0 0 32px rgba(255, 0, 213, 0.68);
  cursor: pointer;
}

.contract {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 7;
  width: min(calc(100vw - 20px), 980px);
  padding: 12px 14px;
  color: #ffffff;
  background: rgba(5, 0, 8, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 6px;
  box-shadow:
    0 0 22px rgba(0, 255, 234, 0.56),
    0 0 36px rgba(255, 0, 213, 0.44);
  translate: -50% 0;
  font-size: clamp(12px, 2.5vw, 20px);
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-align: center;
  text-shadow: 0 0 12px rgba(57, 255, 20, 0.82);
}

@keyframes strobeBlink {
  0%,
  37%,
  100% {
    opacity: 0;
  }
  38%,
  63% {
    opacity: 0.9;
  }
  64%,
  76% {
    opacity: 0.16;
  }
}

@keyframes tickerRun {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(calc(-100% - 26px), 0, 0);
  }
}

@keyframes spinRing {
  from {
    rotate: 0deg;
    scale: 0.98;
  }
  to {
    rotate: 360deg;
    scale: 1.02;
  }
}

@keyframes pulseHalo {
  0%,
  100% {
    scale: 0.9;
    opacity: 0.4;
  }
  50% {
    scale: 1.18;
    opacity: 0.76;
  }
}

@keyframes birdFloat {
  0%,
  100% {
    transform: translate3d(0, -1.2vmin, 0) rotate(-1.2deg) scale(1);
  }
  50% {
    transform: translate3d(0, 1.2vmin, 0) rotate(1.4deg) scale(1.018);
  }
}

@keyframes birdHue {
  from {
    filter:
      drop-shadow(0 0 18px rgba(255, 255, 255, 0.65))
      drop-shadow(0 0 46px rgba(44, 255, 145, 0.58))
      drop-shadow(0 0 88px rgba(255, 0, 213, 0.44))
      hue-rotate(0deg);
  }
  to {
    filter:
      drop-shadow(0 0 18px rgba(255, 255, 255, 0.65))
      drop-shadow(0 0 46px rgba(44, 255, 145, 0.58))
      drop-shadow(0 0 88px rgba(255, 0, 213, 0.44))
      hue-rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .strobe,
  .ticker span,
  main::before,
  main::after,
  .bird {
    animation-duration: 18s;
  }

  .strobe {
    opacity: 0.12;
  }
}
