/* RYDCAST loader — canonical wave animation (splash + compact header) */

.rydcast-loader {
  --size: 280px;

  width: min(var(--size), calc(100vw - 64px));
  aspect-ratio: 1 / 1;
  border-radius: 20.7%;
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: visible;
  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(37, 229, 219, 0.09) 0%,
      rgba(37, 229, 219, 0.035) 32%,
      transparent 58%
    ),
    linear-gradient(180deg, #0d2029 0%, #02080d 100%);
  box-shadow:
    0 0 0 1px rgba(37, 229, 219, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 28px 86px rgba(0, 0, 0, 0.68),
    0 0 78px rgba(37, 229, 219, 0.11);
}

.rydcast-loader::before {
  content: "";
  position: absolute;
  inset: -19%;
  border-radius: 27%;
  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(37, 229, 219, 0.24) 0%,
      rgba(37, 229, 219, 0.09) 38%,
      transparent 67%
    );
  filter: blur(34px);
  opacity: 0.5;
  z-index: -1;
  pointer-events: none;
}

.rydcast-loader--compact {
  --size: 42px;
  flex-shrink: 0;
  width: var(--size);
  height: var(--size);
  border-radius: 22%;
  box-shadow:
    0 0 0 1px rgba(37, 229, 219, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 8px 22px rgba(0, 0, 0, 0.34),
    0 0 18px rgba(37, 229, 219, 0.14);
}

.rydcast-loader--compact::before {
  inset: -14%;
  filter: blur(12px);
  opacity: 0.42;
}

.rydcast-loader--inline {
  --size: 72px;
  width: var(--size);
  height: var(--size);
  margin: 0 auto;
}

.rydcast-wave {
  width: 75%;
  height: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6.67%;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.rydcast-loader--compact .rydcast-wave {
  width: 72%;
  height: 48%;
  gap: 5.5%;
}

.rydcast-wave span {
  width: 8.57%;
  height: var(--bar-height, 50%);
  border-radius: 999px;
  background: linear-gradient(180deg, #35f3ea 0%, #08beb8 100%);
  box-shadow:
    0 0 12px rgba(37, 229, 219, 0.9),
    0 0 28px rgba(37, 229, 219, 0.46),
    0 0 56px rgba(37, 229, 219, 0.22);
  transform-origin: center;
  animation: rydcastPulse 1.35s ease-in-out infinite;
}

.rydcast-loader--compact .rydcast-wave span {
  box-shadow:
    0 0 6px rgba(37, 229, 219, 0.82),
    0 0 12px rgba(37, 229, 219, 0.36);
}

.rydcast-wave span:nth-child(1) {
  --bar-height: 30%;
  animation-delay: -0.6s;
}

.rydcast-wave span:nth-child(2) {
  --bar-height: 50%;
  animation-delay: -0.45s;
}

.rydcast-wave span:nth-child(3) {
  --bar-height: 71.5%;
  animation-delay: -0.3s;
}

.rydcast-wave span:nth-child(4) {
  --bar-height: 100%;
  animation-delay: -0.15s;
}

.rydcast-wave span:nth-child(5) {
  --bar-height: 71.5%;
  animation-delay: -0.3s;
}

.rydcast-wave span:nth-child(6) {
  --bar-height: 50%;
  animation-delay: -0.45s;
}

.rydcast-wave span:nth-child(7) {
  --bar-height: 30%;
  animation-delay: -0.6s;
}

@keyframes rydcastPulse {
  0% {
    transform: scaleY(0.66);
    opacity: 0.66;
  }

  25% {
    transform: scaleY(1.08);
    opacity: 1;
  }

  50% {
    transform: scaleY(0.82);
    opacity: 0.78;
  }

  75% {
    transform: scaleY(1.15);
    opacity: 1;
  }

  100% {
    transform: scaleY(0.66);
    opacity: 0.66;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rydcast-wave span {
    animation: none;
    opacity: 0.92;
    transform: scaleY(0.88);
  }
}
