/* ═══════════════════════════════════════════
   MikaLendingBot LATAM — bright animated theme
   ═══════════════════════════════════════════ */
:root {
  --bg: #050510;
  --bg2: #0c0620;
  --neon-pink: #ff2d95;
  --neon-orange: #ff8a00;
  --neon-gold: #ffd60a;
  --neon-lime: #39ff14;
  --neon-cyan: #00f5ff;
  --neon-violet: #b14eff;
  --neon-magenta: #ff00e5;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.14);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: #fff;
  overflow-x: hidden;
}

/* Animated mesh background */
.latam-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(255, 45, 149, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 45% at 90% 10%, rgba(0, 245, 255, 0.22), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(255, 138, 0, 0.18), transparent 50%),
    radial-gradient(ellipse 50% 30% at 10% 70%, rgba(177, 78, 255, 0.2), transparent 50%),
    linear-gradient(180deg, #050510 0%, #0c0620 50%, #050510 100%);
  animation: meshShift 12s ease-in-out infinite alternate;
}

@keyframes meshShift {
  0% { filter: hue-rotate(0deg) saturate(1.1); }
  100% { filter: hue-rotate(25deg) saturate(1.35); }
}

.latam-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black, transparent);
  pointer-events: none;
  animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Floating orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  animation: floatOrb 8s ease-in-out infinite;
}
.orb-pink { background: rgba(255, 45, 149, 0.45); }
.orb-cyan { background: rgba(0, 245, 255, 0.35); }
.orb-gold { background: rgba(255, 214, 10, 0.3); }
.orb-violet { background: rgba(177, 78, 255, 0.4); }

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.1); }
  66% { transform: translate(-15px, 15px) scale(0.95); }
}

/* Glass */
.glass {
  background: rgba(12, 6, 32, 0.65);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
}
.glass-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 45, 149, 0.05), 0 20px 50px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s, border-color 0.35s;
}
.glass-card:hover {
  border-color: rgba(0, 245, 255, 0.35);
  box-shadow: 0 0 40px rgba(255, 45, 149, 0.15), 0 25px 60px rgba(0, 0, 0, 0.4);
}

/* Neon CTA */
.btn-primary {
  position: relative;
  background: linear-gradient(105deg, #ff2d95 0%, #ff8a00 40%, #ffd60a 70%, #39ff14 100%);
  background-size: 200% 200%;
  color: #0a0a12 !important;
  font-weight: 800;
  border: none;
  box-shadow:
    0 0 30px rgba(255, 45, 149, 0.5),
    0 0 60px rgba(255, 138, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  animation: btnGlow 3s ease-in-out infinite, gradientMove 4s linear infinite;
  transition: transform 0.2s, filter 0.2s;
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.1);
}
.btn-primary:active { transform: scale(0.98); }

@keyframes btnGlow {
  0%, 100% { box-shadow: 0 0 25px rgba(255, 45, 149, 0.45), 0 0 50px rgba(0, 245, 255, 0.2); }
  50% { box-shadow: 0 0 40px rgba(255, 214, 10, 0.55), 0 0 70px rgba(57, 255, 20, 0.25); }
}
@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.25s;
}
.btn-ghost:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.25);
  background: rgba(0, 245, 255, 0.08);
}

/* Text gradients */
.text-neon {
  background: linear-gradient(105deg, #ff2d95, #ffd60a, #00f5ff, #39ff14);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientMove 5s linear infinite;
}
.text-gold {
  background: linear-gradient(90deg, #ffd60a, #ff8a00, #ffd60a);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientMove 3s linear infinite;
}

/* Nav */
.nav-active {
  color: #fff !important;
  background: linear-gradient(135deg, rgba(255, 45, 149, 0.25), rgba(0, 245, 255, 0.15)) !important;
  box-shadow: 0 0 20px rgba(255, 45, 149, 0.2);
}

/* Offer bar */
.offer-bar {
  background: linear-gradient(90deg, #ff2d95, #ff8a00, #ffd60a, #39ff14, #00f5ff, #ff2d95);
  background-size: 300% 100%;
  animation: gradientMove 6s linear infinite;
  color: #0a0a12;
  font-weight: 700;
}

/* Pool cards */
.pool-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.pool-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, #ff2d95, transparent 40%, #00f5ff);
  opacity: 0;
  z-index: -1;
  border-radius: inherit;
  transition: opacity 0.35s;
  animation: spinBorder 4s linear infinite;
}
.pool-card:hover {
  transform: translateY(-8px) scale(1.02);
}
.pool-card:hover::before { opacity: 0.7; }

@keyframes spinBorder {
  to { filter: hue-rotate(360deg); }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Pulse badge */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-lime);
  box-shadow: 0 0 12px var(--neon-lime);
  animation: pulseDot 1.5s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

/* Floating coins decoration */
.float-coin {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0.35;
  animation: coinFloat 6s ease-in-out infinite;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(255, 214, 10, 0.6));
}
@keyframes coinFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-24px) rotate(15deg); }
}

/* Marquee */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Shimmer */
.shimmer {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  background-size: 200% 100%;
  animation: shimmer 2.2s infinite;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Stat number pop */
.stat-pop {
  animation: statPop 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes statPop {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* Sticky CTA mobile */
.sticky-cta {
  background: linear-gradient(180deg, transparent, rgba(5, 5, 16, 0.95) 30%);
  backdrop-filter: blur(16px);
}

/* Particles canvas */
#particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
}

/* Bounce attention */
.bounce-soft {
  animation: bounceSoft 2.5s ease-in-out infinite;
}
@keyframes bounceSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Flag chips */
.flag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  animation: flagIn 0.5s ease both;
}
@keyframes flagIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* Step cards glow */
.step-card {
  position: relative;
}
.step-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 45, 149, 0.2), transparent 60%);
  transition: opacity 0.3s;
  pointer-events: none;
}
.step-card:hover::after { opacity: 1; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0a0a14; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff2d95, #00f5ff);
  border-radius: 8px;
}

/* ─── Mobile polish ───────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  .sticky-cta {
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* Touch targets min 44px */
@media (max-width: 768px) {
  .btn-primary,
  .btn-ghost,
  a.btn-primary,
  button.btn-primary {
    min-height: 48px;
  }
  /* Prevent horizontal overflow */
  html, body {
    max-width: 100vw;
    overflow-x: hidden;
  }
  /* Modal full-ish width on small phones */
  #stake-modal .max-w-md {
    max-width: calc(100vw - 1.5rem);
  }
  /* Ticker don't break layout */
  .marquee-track {
    font-size: 12px;
  }
  /* Hero type scale */
  h1 {
    word-break: break-word;
  }
  /* Nav logo text not overflow */
  nav .font-extrabold,
  nav .font-bold {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Live activity feed */
.live-panel {
  max-height: 420px;
  overflow: hidden;
  position: relative;
}
.live-panel::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 48px;
  background: linear-gradient(transparent, rgba(5, 5, 16, 0.95));
  pointer-events: none;
  z-index: 2;
}
#live-feed {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}
.live-row-in {
  animation: liveSlideIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes liveSlideIn {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.98);
    background: rgba(57, 255, 20, 0.12);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .latam-bg,
  .orb,
  .float-coin,
  .btn-primary,
  .marquee-track,
  .shimmer,
  .bounce-soft,
  .text-neon,
  .text-gold {
    animation: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  #particles { display: none; }
}
