.fireflies-page {
  background: #000;
}

.fireflies-main {
  overflow: hidden;
}

.firefly-field {
  position: relative;
  isolation: isolate;
  min-height: calc(100dvh - 88px);
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 24%, rgba(126, 255, 92, 0.08), transparent 26%),
    radial-gradient(circle at 78% 62%, rgba(34, 240, 208, 0.07), transparent 30%),
    linear-gradient(180deg, #020503 0%, #000 78%);
}

.firefly-field::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.12) 0 1px, transparent 1.5px),
    radial-gradient(circle at 64% 28%, rgba(255, 255, 255, 0.09) 0 1px, transparent 1.5px),
    radial-gradient(circle at 86% 76%, rgba(255, 255, 255, 0.08) 0 1px, transparent 1.5px);
  background-size: 210px 180px, 260px 230px, 310px 270px;
  content: "";
  opacity: 0.45;
}

.fireflies-heading {
  position: relative;
  z-index: 2;
  width: min(100% - 48px, 680px);
  margin-inline: auto;
  padding-top: clamp(48px, 8vh, 92px);
  text-align: center;
  pointer-events: none;
}

.fireflies-heading h1 {
  margin: 8px 0 12px;
  color: #f9fafb;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.fireflies-heading p:last-child {
  margin: 0;
  color: #8b948e;
  line-height: 1.6;
}

.fireflies-counter {
  position: absolute;
  z-index: 4;
  top: 24px;
  left: 24px;
  display: grid;
  min-width: 116px;
  padding: 14px 18px;
  border-radius: 20px;
  background: rgba(8, 13, 9, 0.72);
  pointer-events: none;
}

.fireflies-counter span {
  color: #7a847d;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.fireflies-counter strong {
  color: #b9ff8f;
  font-size: 2rem;
  line-height: 1.05;
  text-shadow: 0 0 22px rgba(160, 255, 99, 0.42);
}

.firefly-layer {
  position: absolute;
  z-index: 3;
  inset: 0;
  overflow: hidden;
}

.firefly {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  will-change: transform;
  touch-action: manipulation;
}

.firefly-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--firefly-size);
  height: var(--firefly-size);
  border-radius: 50%;
  background: #c8ff79;
  box-shadow:
    0 0 5px #e2ffb8,
    0 0 14px rgba(176, 255, 91, 0.95),
    0 0 32px rgba(116, 255, 72, 0.58);
  transform: translate(-50%, -50%);
  animation: firefly-pulse var(--pulse-duration) ease-in-out var(--pulse-delay) infinite alternate;
  pointer-events: none;
}

.firefly-core::after {
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(197, 255, 121, 0.28), transparent 68%);
  content: "";
}

.firefly:hover .firefly-core,
.firefly:focus-visible .firefly-core {
  background: #e5ffb7;
  box-shadow:
    0 0 7px #fff,
    0 0 20px rgba(190, 255, 104, 1),
    0 0 42px rgba(116, 255, 72, 0.8);
}

.firefly:focus-visible {
  border-radius: 50%;
  outline: 1px solid rgba(193, 255, 127, 0.72);
  outline-offset: -7px;
}

.firefly.is-pending {
  opacity: 0.72;
  pointer-events: none;
}

.firefly.is-dimming {
  pointer-events: none;
}

.firefly.is-dimming .firefly-core {
  animation: firefly-extinguish 700ms ease-in forwards;
}

.firefly.is-catching {
  pointer-events: none;
}

.firefly.is-catching .firefly-core {
  animation: firefly-catch 280ms ease-out forwards;
}

.fireflies-status {
  position: absolute;
  z-index: 4;
  right: 24px;
  bottom: 22px;
  margin: 0;
  color: #778079;
  font-size: 0.86rem;
  pointer-events: none;
}

.fireflies-status.is-reward {
  color: #b9ff8f;
  text-shadow: 0 0 16px rgba(160, 255, 99, 0.32);
}

@keyframes firefly-pulse {
  from {
    opacity: 0.62;
    scale: 0.78;
  }

  to {
    opacity: 1;
    scale: 1.16;
  }
}

@keyframes firefly-extinguish {
  0% { opacity: 1; scale: 1; }
  45% { opacity: 0.24; scale: 0.72; }
  62% { opacity: 0.65; scale: 0.86; }
  100% { opacity: 0; scale: 0.2; }
}

@keyframes firefly-catch {
  0% { opacity: 1; scale: 1; }
  45% { opacity: 1; scale: 2.4; }
  100% { opacity: 0; scale: 0.2; }
}

@media (max-width: 640px) {
  .firefly-field {
    min-height: calc(100dvh - 78px);
  }

  .fireflies-heading {
    width: min(100% - 36px, 680px);
    padding-top: 112px;
  }

  .fireflies-counter {
    top: 18px;
    left: 18px;
  }

  .fireflies-status {
    right: 18px;
    bottom: 18px;
    left: 18px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .firefly-core {
    animation-duration: 2.4s;
  }
}
