@keyframes shimmer {
  0% {
    background-position: -420px 0;
  }
  100% {
    background-position: 420px 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  animation: section-in 420ms ease both;
}

@keyframes section-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.skeleton {
  animation: shimmer 1.25s linear infinite;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.74), transparent),
    #e8eef6;
  background-size: 420px 100%;
  border-radius: 8px;
}

.skeleton.block {
  height: 38px;
}

.skeleton.metric {
  height: 86px;
}

.skeleton.news {
  height: 300px;
}

.loading-overlay {
  align-items: center;
  backdrop-filter: blur(4px);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 10px;
  bottom: 0;
  color: var(--muted);
  display: flex;
  gap: 12px;
  justify-content: center;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 5;
}

.spinner {
  animation: spin 760ms linear infinite;
  border: 2px solid rgba(22, 119, 210, 0.18);
  border-radius: 50%;
  border-top-color: var(--blue);
  height: 22px;
  width: 22px;
}

.toast-host {
  bottom: 20px;
  display: grid;
  gap: 8px;
  position: fixed;
  right: 20px;
  z-index: 50;
}

.toast {
  animation: toast-in 200ms ease both;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  max-width: 360px;
  padding: 11px 13px;
}

.toast.success {
  border-color: rgba(47, 212, 122, 0.44);
}

.toast.error {
  border-color: rgba(239, 89, 101, 0.5);
}

.fade-update {
  opacity: 0.45;
  transition: opacity 180ms ease;
}

@keyframes market-grid-drift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 96px 0, 0 96px;
  }
}

@keyframes market-scan {
  0%,
  22% {
    opacity: 0;
    transform: translateX(-85%);
  }
  42% {
    opacity: 1;
  }
  76%,
  100% {
    opacity: 0;
    transform: translateX(85%);
  }
}

@keyframes brand-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.14) inset,
      0 0 22px rgba(54, 229, 141, 0.22);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.2) inset,
      0 0 36px rgba(114, 198, 255, 0.3);
  }
}

@keyframes shine-sweep {
  0%,
  38% {
    left: -80%;
  }
  64%,
  100% {
    left: 120%;
  }
}

@keyframes candle-flow {
  from {
    background-position: 0 0, 0 0, 0 0, 0 0;
  }
  to {
    background-position: 360px 0, 320px 0, 280px 0, 70px 0;
  }
}

@keyframes card-pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bar-fill {
  from {
    transform: scaleX(0);
    transform-origin: left;
  }
  to {
    transform: scaleX(1);
    transform-origin: left;
  }
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 0.65;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

@keyframes refresh-tap {
  0% {
    transform: translateY(0) scale(1);
  }
  42% {
    transform: translateY(-1px) scale(0.96);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes news-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
