/* =========================================================
   NOVA88 — JOIN NOW button + effects
   Sits on top of the poster, in the space below "RM2,880".
   ========================================================= */

/* Poster wrapper: the button is positioned relative to this */
.lp-poster {
  line-height: 0;
}
/* !important so older rules in style.css / bootstrap can't stretch the images */
.lp-poster #bg {
  display: block;
  width: 100% !important;
  max-width: 750px !important;
  height: auto !important;
  max-height: none !important;
  object-fit: contain;
}
.join-btn img {
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  object-fit: contain;
}

/* ---------- Position ----------
   bottom / width are % of the poster, so it scales on every screen.
   Nudge "bottom" up or down to move the button. */
.join-btn {
  position: absolute;
  left: 50%;
  bottom: 1.5%;
  width: 80%;
  z-index: 2;
  display: block;
  line-height: 0;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transform: translateX(-50%);
  opacity: 0;
  animation: jb-enter 0.8s cubic-bezier(.2, .9, .3, 1.35) 0.4s forwards;
}

@keyframes jb-enter {
  from { opacity: 0; transform: translateX(-50%) translateY(40px) scale(0.8); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* Heartbeat pulse: two quick beats, then rest */
.join-btn__body {
  position: relative;
  display: block;
  animation: jb-beat 1.8s ease-in-out 1.3s infinite;
  transition: transform 0.2s ease;
}
@keyframes jb-beat {
  0%, 40%, 100% { transform: scale(1); }
  10%           { transform: scale(1.07); }
  20%           { transform: scale(0.99); }
  30%           { transform: scale(1.05); }
}

/* Breathing gold glow */
.join-btn img {
  display: block;
  width: 100%;
  height: auto;
  animation: jb-glow 1.8s ease-in-out 1.3s infinite;
  transition: filter 0.2s ease;
}
@keyframes jb-glow {
  0%, 40%, 100% { filter: drop-shadow(0 0 4px  rgba(255, 190, 60, 0.35)); }
  15%           { filter: drop-shadow(0 0 18px rgba(255, 190, 60, 0.95)); }
}

/* Shine + ripple layers: clipped to the button's own shape
   (mask = the button PNG, clip-path trims off its soft top glow) */
.join-btn__shine,
.join-btn__ripples {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: url("../assets/Join-RED.png") center / 100% 100% no-repeat;
          mask: url("../assets/Join-RED.png") center / 100% 100% no-repeat;
  clip-path: inset(20% 0 24% 0);
}

/* Light sweep */
.join-btn__shine::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -50%;
  width: 30%;
  background: linear-gradient(105deg,
    transparent 0%,
    rgba(255, 255, 255, 0) 25%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0) 75%,
    transparent 100%);
  transform: skewX(-20deg);
  animation: jb-sweep 2.8s ease-in-out 1.6s infinite;
}
@keyframes jb-sweep {
  0%        { left: -50%; }
  40%, 100% { left: 130%; }
}

/* Twinkling sparkles on the gold frame */
.join-btn__spark {
  position: absolute;
  width: 7%;
  aspect-ratio: 1;
  pointer-events: none;
  background: radial-gradient(circle, #fff 0%, rgba(255, 230, 150, 0.9) 18%, rgba(255, 200, 80, 0) 60%);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  transform: scale(0);
  animation: jb-twinkle 2.4s ease-in-out infinite;
}
.join-btn__spark--1 { left: 6%;  top: 26%; animation-delay: 1.8s; }
.join-btn__spark--2 { right: 8%; top: 62%; animation-delay: 2.6s; }
.join-btn__spark--3 { left: 46%; top: 16%; animation-delay: 3.4s; }
@keyframes jb-twinkle {
  0%, 60%, 100% { transform: scale(0) rotate(0deg); }
  75%           { transform: scale(1) rotate(45deg); }
  90%           { transform: scale(0.2) rotate(90deg); }
}

/* Tap ripple */
.join-btn__ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transform: translate(-50%, -50%) scale(0);
  animation: jb-ripple 0.6s ease-out forwards;
}
@keyframes jb-ripple {
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Hover (desktop) / press (mobile) */
@media (hover: hover) {
  .join-btn:hover .join-btn__body { animation: none; transform: translateY(-4px) scale(1.06); }
  .join-btn:hover img {
    animation: none;
    filter: brightness(1.12) drop-shadow(0 0 24px rgba(255, 190, 60, 1));
  }
  .join-btn:hover .join-btn__shine::before { animation-duration: 1.1s; }
}
.join-btn:active .join-btn__body { animation: none; transform: scale(0.94); transition-duration: 0.08s; }
.join-btn:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

/* Respect users who turn off motion */
@media (prefers-reduced-motion: reduce) {
  .join-btn { animation: none; opacity: 1; }
  .join-btn__body, .join-btn img, .join-btn__shine::before, .join-btn__spark { animation: none; }
}
