/* hype.css — the countdown and the hold-to-hype button. */

/* ---- countdown ----------------------------------------------------------------- */
.countdown {
  background: linear-gradient(180deg, var(--night) 0%, var(--plum) 100%);
  padding-top: 40px;
}

.countdown__ball {
  width: 118px;
  margin: 0 auto 8px;
  transform-origin: 50% 0;
  animation: ball-swing 4s var(--ease-in-out) infinite;
}

@keyframes ball-swing {
  0%,
  100% {
    transform: rotate(4deg);
  }
  50% {
    transform: rotate(-4deg);
  }
}

.countdown__title {
  font-size: 13px;
}

.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.cd {
  padding: 14px 0 10px;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  background: var(--lime);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--rani);
  overflow: hidden;
}

.cd__num {
  display: block;
  font: 700 clamp(30px, 9.5vw, 42px) / 1 var(--font-mono);
  letter-spacing: -0.04em;
}

.cd__num.is-tick {
  animation: tick 380ms var(--ease-out);
}

@keyframes tick {
  from {
    transform: translateY(-60%);
    opacity: 0;
  }
}

.cd__unit {
  display: block;
  margin-top: 6px;
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.countdown__done {
  margin: 16px 0 0;
  font-weight: 800;
  font-size: 22px;
  color: var(--lime);
}

/* ---- hype ---------------------------------------------------------------------- */
.hype {
  background: var(--plum);
  padding-bottom: 90px;
}

.hype.is-shaking {
  animation: shake 360ms linear;
}

@keyframes shake {
  20% {
    transform: translate(-5px, 2px);
  }
  40% {
    transform: translate(5px, -2px);
  }
  60% {
    transform: translate(-3px, -1px);
  }
  80% {
    transform: translate(3px, 1px);
  }
}

.hype__rig {
  display: grid;
  place-items: center;
  margin-top: 34px;
}

.hype__btn {
  --p: 0;
  position: relative;
  width: 196px;
  height: 196px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* the charge ring: a conic sweep driven by --p (0..1) */
.hype__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--lime) calc(var(--p) * 360deg), rgba(255, 244, 230, 0.14) 0);
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%);
  mask: radial-gradient(circle, transparent 60%, #000 61%);
}

.hype__core {
  position: absolute;
  inset: 22px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--rani);
  box-shadow: 0 7px 0 var(--ink);
  transform: scale(calc(1 + var(--p) * 0.12));
  transition: box-shadow var(--dur-fast) ease;
}

.hype__btn.is-holding .hype__core {
  box-shadow: 0 2px 0 var(--ink);
  animation: jitter 90ms linear infinite;
  animation-play-state: var(--jit, paused);
}

@keyframes jitter {
  50% {
    translate: 1.5px -1px;
  }
}

.hype__label {
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--cream);
  font-variation-settings: "wdth" 80;
}

.hype__result {
  min-height: 1.4em;
  margin: 26px 0 0;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--lime);
}

.hype__result.is-new {
  animation: stat-in 600ms var(--ease-spring);
}

.hype__fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
