/* =====================================================================
   LoveMelons — efeitos especiais
   ===================================================================== */

/* ---------- Bolhas de suco subindo no fundo ---------- */
.lm-fx-bubbles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.lm-fx-bubble {
  position: absolute;
  bottom: -3rem;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.55), transparent 34%),
    radial-gradient(circle at 50% 55%, var(--c), transparent 72%);
  box-shadow: 0 0 1.2rem var(--c);
  opacity: 0;
  animation: lm-fx-rise var(--d) linear var(--delay) infinite;
}

.lm-fx-bubble--emoji {
  width: auto;
  height: auto;
  background: none;
  box-shadow: none;
  font-size: var(--s);
  line-height: 1;
  filter: blur(0.4px) saturate(0.9);
}

@keyframes lm-fx-rise {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg); }
  10% { opacity: var(--o); }
  50% { transform: translate3d(var(--sway), -55vh, 0) rotate(120deg); }
  85% { opacity: var(--o); }
  100% { opacity: 0; transform: translate3d(0, -112vh, 0) rotate(240deg); }
}

/* ---------- Barra de progresso da rolagem ---------- */
.lm-fx-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 3px;
  background: var(--j-juice);
  box-shadow: 0 0 12px rgba(255, 45, 98, 0.8);
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
  pointer-events: none;
}

body.lm-home-image .lm-fx-progress {
  background: var(--j-juice-green);
  box-shadow: 0 0 12px rgba(120, 220, 110, 0.7);
}

/* ---------- Cards: entrada, 3D e brilho que segue o mouse ---------- */
.lm-fx-pending {
  opacity: 0;
}

.lm-fx-in {
  animation: lm-fx-pop 0.7s cubic-bezier(0.22, 1.2, 0.36, 1) both;
  animation-delay: var(--fx-delay, 0ms);
}

@keyframes lm-fx-pop {
  0% { opacity: 0; transform: translateY(26px) scale(0.94); filter: blur(6px); }
  100% { opacity: 1; transform: none; filter: none; }
}

@media (hover: hover) {
  .lm-card.lm-fx-tilting > .lm-card__shell,
  .home-image-card.lm-fx-tilting {
    transform:
      perspective(900px)
      rotateX(var(--rx, 0deg))
      rotateY(var(--ry, 0deg))
      translateY(-5px)
      scale(1.02) !important;
    transition: transform 0.08s linear, box-shadow 0.25s ease, border-color 0.25s ease !important;
  }
}

.lm-fx-glare {
  position: absolute;
  inset: 0;
  z-index: 13;
  border-radius: inherit;
  background: radial-gradient(
    18rem circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 210, 190, 0.28),
    rgba(255, 45, 98, 0.08) 40%,
    transparent 65%
  );
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.lm-fx-tilting .lm-fx-glare {
  opacity: 1;
}

/* ---------- Explosão de frutas no clique ---------- */
.lm-fx-burst {
  position: fixed;
  z-index: 400;
  left: 0;
  top: 0;
  font-size: var(--fs, 1.3rem);
  line-height: 1;
  pointer-events: none;
  will-change: transform, opacity;
  animation: lm-fx-burst 0.9s cubic-bezier(0.15, 0.7, 0.3, 1) forwards;
}

@keyframes lm-fx-burst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.3) rotate(0deg); }
  60% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1) rotate(var(--rot));
  }
}

.lm-fx-ring {
  position: fixed;
  z-index: 399;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid rgba(255, 156, 122, 0.9);
  border-radius: 50%;
  pointer-events: none;
  animation: lm-fx-ring 0.6s ease-out forwards;
}

@keyframes lm-fx-ring {
  to { opacity: 0; transform: scale(9); border-width: 1px; }
}

/* ---------- GERAR: halo pulsante + borda girando ---------- */
.lm-dock__fab {
  isolation: isolate;
}

.lm-dock__fab::after {
  content: "";
  position: absolute;
  inset: -6px;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(from var(--fx-angle, 0deg), #ff9c7a, #ffe27a, #a6de55, #ff2d62, #ff9c7a);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: lm-fx-spin 4s linear infinite;
}

@property --fx-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes lm-fx-spin {
  to { --fx-angle: 360deg; }
}

.lm-dock__fab-halo {
  position: absolute;
  inset: -6px;
  z-index: -2;
  border: 3px solid rgba(255, 90, 120, 0.75);
  border-radius: 50%;
  animation: lm-fx-halo 2.4s ease-out infinite;
  pointer-events: none;
}

.lm-dock__fab-halo + .lm-dock__fab-halo {
  animation-delay: 1.2s;
}

body.lm-home-image .lm-dock__fab-halo {
  border-color: rgba(140, 230, 120, 0.7);
}

@keyframes lm-fx-halo {
  0% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.6); border-width: 1px; }
}

/* ---------- Brilho que passa nos botões suculentos ---------- */
.lm-signup-button,
.login-modal-submit,
.lm-ticket__stub {
  position: relative;
  overflow: hidden;
}

.lm-signup-button::after,
.login-modal-submit::after,
.lm-ticket__stub::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  animation: lm-fx-sheen 3.6s ease-in-out infinite;
  pointer-events: none;
}

.login-modal-submit::after { animation-delay: 0.6s; }
.lm-ticket__stub::before { animation-delay: 1.8s; }

@keyframes lm-fx-sheen {
  0%, 55% { left: -60%; }
  85%, 100% { left: 130%; }
}

/* ---------- Faixa rolante antes do rodapé ---------- */
.lm-marquee {
  position: relative;
  margin: 1rem 0 0;
  padding: 0.85rem 0;
  overflow: hidden;
  border-top: 1px solid var(--j-line);
  border-bottom: 1px solid var(--j-line);
  background:
    linear-gradient(90deg, rgba(255, 45, 98, 0.12), rgba(255, 156, 122, 0.08), rgba(166, 222, 85, 0.08), rgba(255, 45, 98, 0.12));
  transform: rotate(-1.2deg) scale(1.02);
  -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.lm-marquee__track {
  display: flex;
  width: max-content;
  animation: lm-fx-marquee 38s linear infinite reverse;
}

.lm-marquee:hover .lm-marquee__track {
  animation-play-state: paused;
}

.lm-marquee__group {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.lm-marquee__item {
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
  padding: 0 1.1rem;
  color: var(--j-cream);
  font-family: var(--j-display);
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  white-space: nowrap;
}

.lm-marquee__item:nth-child(even) {
  -webkit-text-stroke: 1px rgba(255, 196, 170, 0.7);
  color: transparent;
}

.lm-marquee__fruit {
  font-size: 1.2em;
  -webkit-text-stroke: 0;
  animation: lm-fx-wobble 2.4s ease-in-out infinite;
}

@keyframes lm-fx-marquee {
  to { transform: translateX(-50%); }
}

@keyframes lm-fx-wobble {
  0%, 100% { rotate: -10deg; }
  50% { rotate: 10deg; }
}

/* ---------- Logo com fruta que balança ---------- */
.home-brand-home-link:hover .site-brand-logo img,
.home-brand-home-link:hover .site-brand-logo svg {
  animation: lm-fx-jelly 0.7s ease;
}

@keyframes lm-fx-jelly {
  0%, 100% { transform: scale(1, 1); }
  25% { transform: scale(1.2, 0.85); }
  50% { transform: scale(0.9, 1.12); }
  75% { transform: scale(1.06, 0.96); }
}

@media (prefers-reduced-motion: reduce) {
  .lm-fx-bubbles,
  .lm-fx-burst,
  .lm-fx-ring,
  .lm-dock__fab-halo {
    display: none !important;
  }

  .lm-fx-pending {
    opacity: 1;
  }

  .lm-fx-in,
  .lm-marquee__track,
  .lm-dock__fab::after,
  .lm-signup-button::after,
  .login-modal-submit::after,
    .lm-ticket__stub::before {
    animation: none !important;
  }
}
