/* ================================
   MJ MEGA SCATTER - FINAL CSS
   SYNC DENGAN injector + gimik.js
================================ */

/* === Bullhorn Neon === */
.bullhorn-bar-mj-mega-scatter {
  background: linear-gradient(90deg, #020617, #0f172a);
  color: #e5e7eb;
  display: flex;
  align-items: center;
  padding: 10px 15px;
  font-weight: bold;
  letter-spacing: 1px;
  box-shadow:
    0 0 12px rgba(79, 209, 197, 0.35),
    inset 0 0 20px rgba(139, 92, 246, 0.25);
  overflow: hidden;
  position: relative;
}

.bullhorn-icon-mj-mega-scatter,
.bullhorn-arrow-mj-mega-scatter {
  font-size: 1.4em;
  margin: 0 10px;
  animation: pulse-mj-mega-scatter 2s infinite;
}

@keyframes pulse-mj-mega-scatter {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

.bullhorn-marquee-mj-mega-scatter {
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
}

.bullhorn-text-mj-mega-scatter span {
  display: inline-block;
  animation: marquee-mj-mega-scatter 15s linear infinite;
}

@keyframes marquee-mj-mega-scatter {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}

/* === Title === */
.game-row-title-mj-mega-scatter {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 25px 0 10px;
  gap: 15px;
}

.game-row-title-mj-mega-scatter h2 {
  font-size: 28px;
  color: #e5e7eb;
  text-shadow: 0 0 8px rgba(79, 209, 197, 0.4);
  letter-spacing: 2px;
}

.game-row-title-mj-mega-scatter span {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, #4fd1c5, transparent);
}

/* === Grid Game Cards === */
.game-row-mj-mega-scatter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  padding: 0 15px 25px;
}

/* === Game Card === */
.game-card-mj-mega-scatter {
  position: relative;
  background: rgba(15, 18, 32, 0.95);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 22px rgba(79, 209, 197, 0.25);
  transition: all 0.3s ease;
  z-index: 0;
}

.game-card-mj-mega-scatter::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 2px;
  background: linear-gradient(130deg, #4fd1c5, #8b5cf6, #4fd1c5);
  background-size: 400% 400%;
  animation: borderGlow-mj-mega-scatter 6s linear infinite;
  z-index: -1;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

@keyframes borderGlow-mj-mega-scatter {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.game-card-mj-mega-scatter:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 0 28px rgba(79, 209, 197, 0.45);
}

.game-card-mj-mega-scatter:hover::before {
  animation-duration: 3s;
}

.game-card-mj-mega-scatter img {
  width: 100%;
  display: block;
}

.game-card-mj-mega-scatter p {
  padding: 10px;
  font-weight: 700;
  font-size: 15px;
  color: #e5e7eb;
  text-align: center;
  text-shadow: 0 0 4px rgba(79, 209, 197, 0.35);
  background: linear-gradient(
    90deg,
    rgba(79, 209, 197, 0.04),
    rgba(139, 92, 246, 0.04)
  );
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* === Popup Iframe === */
.iframe-popup-mj-mega-scatter {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 18, 0.96);
  backdrop-filter: blur(10px);
  z-index: 9999;
  flex-direction: column;
  animation: fadeIn-mj-mega-scatter 0.4s ease;
}

@keyframes fadeIn-mj-mega-scatter {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* === Header Sinkron dengan gimik.js === */
.iframe-header-mj-mega-scatter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: linear-gradient(90deg, #020617, #0f172a);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
  border-bottom: 2px solid rgba(255, 255, 255, 0.13);
  position: relative;
  z-index: 10001;
  overflow: visible;
}

.winrate-badge-mj-mega-scatter {
  background: rgba(0, 0, 0, 0.6);
  color: #4fd1c5;
  padding: 6px 12px;
  border-radius: 10px;
  font-weight: bold;
  text-shadow: 0 0 6px rgba(79, 209, 197, 0.6);
  animation: glow-mj-mega-scatter 1.8s infinite;
}

@keyframes glow-mj-mega-scatter {
  0%, 100% { box-shadow: 0 0 10px rgba(79, 209, 197, 0.5); }
  50% { box-shadow: 0 0 22px rgba(139, 92, 246, 0.6); }
}

.close-iframe-mj-mega-scatter {
  background: #1f2937;
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
  transition: all 0.2s;
  flex-shrink: 0;
  position: relative;
  z-index: 10003;
}

.close-iframe-mj-mega-scatter:hover {
  background: #374151;
  box-shadow: 0 0 18px rgba(79, 209, 197, 0.4);
}

#iframe-container-mj-mega-scatter {
  flex: 1;
  position: relative;
  min-height: 0;
}

#game-iframe-mj-mega-scatter {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* === Loading & Error Overlay === */
.overlay-mj-mega-scatter {
  position: absolute;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  z-index: 10;
  font-size: 18px;
  padding: 20px;
}

.loading-mj-mega-scatter {
  background: rgba(0, 0, 20, 0.9);
  color: #4fd1c5;
  text-shadow: 0 0 8px rgba(79, 209, 197, 0.6);
  animation: neonPulse-mj-mega-scatter 1.5s infinite;
}

.error-mj-mega-scatter {
  background: rgba(20, 0, 20, 0.95);
  color: #f87171;
  text-shadow: 0 0 6px rgba(248, 113, 113, 0.7);
}

#iframe-reload-btn-mj-mega-scatter {
  margin-top: 15px;
  padding: 10px 18px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(90deg, #4fd1c5, #8b5cf6);
  color: #000;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 0 14px rgba(79, 209, 197, 0.5);
}

#iframe-reload-btn-mj-mega-scatter:hover {
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.6);
}

@keyframes neonPulse-mj-mega-scatter {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* === Floating Ball Sinkron dengan gimik.js === */
#floating-glow-ball-mj-mega-scatter {
  position: fixed;
  bottom: 80px;
  right: 30px;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: radial-gradient(circle, #4fd1c5, #8b5cf6);
  box-shadow:
    0 0 26px rgba(79, 209, 197, 0.6),
    0 0 50px rgba(139, 92, 246, 0.5);
  animation: floatPulse-mj-mega-scatter 3s ease-in-out infinite;
  cursor: grab;
  opacity: 0;
  display: none;
  transition: opacity 0.35s ease;
  z-index: 2147483000;
  touch-action: none;
  user-select: none;
  pointer-events: auto;
  overflow: visible;
}

#floating-glow-ball-mj-mega-scatter:active {
  cursor: grabbing;
}

#floating-glow-ball-mj-mega-scatter img,
#floating-glow-ball-img-mj-mega-scatter {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

@keyframes floatPulse-mj-mega-scatter {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* === Running Text Sinkron === */
.boost-running-text-mj-mega-scatter {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  margin-left: 0;
  position: relative;
  height: 30px;
  display: none;
  align-items: center;
  background: linear-gradient(
    90deg,
    rgba(15, 18, 32, 0.8),
    rgba(15, 18, 32, 0.5),
    rgba(15, 18, 32, 0.8)
  );
  border-radius: 8px;
  padding: 2px 10px;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3);
  z-index: 10002;
}

.boost-running-text-mj-mega-scatter span {
  display: inline-block;
  font-weight: bold;
  font-size: 16px;
  line-height: 1;
  animation: boostMarquee-mj-mega-scatter 12s linear infinite;
  padding-right: 50px;
}

@keyframes boostMarquee-mj-mega-scatter {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}

.boost-running-text-mj-mega-scatter.winrate-mj-mega-scatter span {
  color: #4fd1c5;
  text-shadow:
    0 0 6px rgba(79, 209, 197, 0.7),
    0 0 12px rgba(79, 209, 197, 0.5);
}

.boost-running-text-mj-mega-scatter.scatter-mj-mega-scatter span {
  color: #facc15;
  text-shadow:
    0 0 6px rgba(250, 204, 21, 0.6),
    0 0 12px rgba(250, 204, 21, 0.4);
}

.boost-running-text-mj-mega-scatter.jackpot-mj-mega-scatter span {
  color: #f472b6;
  text-shadow:
    0 0 6px rgba(244, 114, 182, 0.6),
    0 0 14px rgba(244, 114, 182, 0.5);
}

.boost-running-text-mj-mega-scatter::before {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
  pointer-events: none;
  animation: shine-mj-mega-scatter 2s linear infinite;
}

@keyframes shine-mj-mega-scatter {
  0% { left: -50%; }
  100% { left: 100%; }
}

/* === Boost Popup Tetap Ada Untuk Kompatibilitas === */
#boost-popup-mj-mega-scatter {
  position: fixed;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(10, 12, 24, 0.95);
  border: 2px solid rgba(79, 209, 197, 0.35);
  border-radius: 14px;
  padding: 15px 20px;
  width: 220px;
  box-shadow:
    0 0 20px rgba(79, 209, 197, 0.35),
    0 0 40px rgba(139, 92, 246, 0.25);
  z-index: 9999;
  transform: translate(-50%, -100%);
}

.boost-option-mj-mega-scatter {
  background-color: #020617;
  width: 100%;
  height: 60px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(79, 209, 197, 0.35);
  transition: 0.3s;
  font-size: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.boost-option-mj-mega-scatter:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.55);
}

/* === Winrate Progress === */
#winrate-progress-mj-mega-scatter {
  width: 100%;
  max-width: 420px;
  height: 22px;
  margin: 10px auto 6px;
  background: rgba(15, 23, 42, 0.75);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.06),
    0 6px 18px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: none;
  flex-shrink: 0;
}

#winrate-bar-mj-mega-scatter {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 14px;
  background: linear-gradient(90deg, #0ea5a4, #22d3ee, #6366f1);
  transition: width 0.3s ease;
  overflow: hidden;
  box-shadow:
    inset 0 0 12px rgba(255, 255, 255, 0.25),
    0 0 16px rgba(99, 102, 241, 0.45);
}

#winrate-bar-mj-mega-scatter .winrate-text-mj-mega-scatter {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #f8fafc;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  z-index: 3;
}

#winrate-bar-mj-mega-scatter .rtp-stripes-mj-mega-scatter {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.25) 0px,
    rgba(255, 255, 255, 0.25) 8px,
    rgba(255, 255, 255, 0.05) 8px,
    rgba(255, 255, 255, 0.05) 16px
  );
  opacity: 0.45;
  animation: rtpMove-mj-mega-scatter 1.4s linear infinite;
  z-index: 2;
}

#winrate-bar-mj-mega-scatter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 20%,
    rgba(255, 255, 255, 0.45) 40%,
    transparent 60%
  );
  animation: rtpShine-mj-mega-scatter 3s ease-in-out infinite;
  z-index: 1;
}

@keyframes rtpMove-mj-mega-scatter {
  from { background-position: 0 0; }
  to { background-position: 40px 0; }
}

@keyframes rtpShine-mj-mega-scatter {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* === Boost Confirm Sinkron === */
#boost-confirm-mj-mega-scatter {
  position: fixed;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 18, 32, 0.95);
  border: 2px solid rgba(79, 209, 197, 0.45);
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 20px rgba(79, 209, 197, 0.5);
  opacity: 0;
  transition: all 0.5s ease;
  z-index: 2147483001;
  pointer-events: none;
  max-width: 260px;
  box-sizing: border-box;
  text-align: center;
  line-height: 1.2;
}

#boost-confirm-mj-mega-scatter.show-mj-mega-scatter {
  opacity: 1;
  pointer-events: auto;
}

/* === Boost GIF Popup === */
#boost-gif-popup-mj-mega-scatter {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 500px;
  height: 500px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: none;
  z-index: 100000;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  transition: transform 0.6s ease, opacity 0.5s ease;
}

/* === Toggle Switch === */
#boost-confirm-mj-mega-scatter .toggle-switch-mj-mega-scatter {
  display: none;
}

#boost-confirm-mj-mega-scatter.show-mj-mega-scatter.winrate-mj-mega-scatter .toggle-switch-mj-mega-scatter {
  display: block;
}

.toggle-switch-mj-mega-scatter {
  width: 44px;
  height: 24px;
  background: #ff3333;
  border-radius: 30px;
  position: relative;
  transition: background 0.9s ease;
  flex-shrink: 0;
}

.toggle-circle-mj-mega-scatter {
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.6s ease;
}

.toggle-switch-mj-mega-scatter.active-mj-mega-scatter {
  background: #00ff66;
}

.toggle-switch-mj-mega-scatter.active-mj-mega-scatter .toggle-circle-mj-mega-scatter {
  transform: translateX(20px);
}

/* === Full Frame Layer Sinkron === */
.mj-mega-scatter-frame-wrap-mj-mega-scatter {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 9998;
}

.mj-mega-scatter-full-frame-mj-mega-scatter {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
  object-position: center center;
  pointer-events: none;
  user-select: none;
  z-index: 9999;
}

/* === Mobile === */
@media (max-width: 480px) {
  #boost-confirm-mj-mega-scatter {
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    padding: 4px 10px;
    font-size: 14px;
    gap: 6px;
  }

  .toggle-switch-mj-mega-scatter {
    background: #f87171;
    width: 36px;
    height: 20px;
  }

  .toggle-circle-mj-mega-scatter {
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
  }

  .toggle-switch-mj-mega-scatter.active-mj-mega-scatter .toggle-circle-mj-mega-scatter {
    background: #4fd1c5;
    transform: translateX(16px);
  }
}

@media (max-width: 768px) {
  #floating-glow-ball-mj-mega-scatter {
    width: 58px;
    height: 58px;
    bottom: 72px;
    right: 16px;
  }

  .iframe-header-mj-mega-scatter {
    padding: 10px 12px;
    gap: 8px;
  }

  .boost-running-text-mj-mega-scatter {
    height: 28px;
    padding: 2px 8px;
  }

  .boost-running-text-mj-mega-scatter span {
    font-size: 13px;
  }

  #boost-popup-mj-mega-scatter {
    width: 180px;
    padding: 12px 15px;
    gap: 10px;
  }

  .boost-option-mj-mega-scatter {
    font-size: 14px;
    padding: 8px 0;
  }

  #winrate-progress-mj-mega-scatter {
    width: 180px;
    height: 25px;
  }

  #winrate-bar-mj-mega-scatter {
    line-height: 25px;
    font-size: 13px;
  }

  #boost-confirm-mj-mega-scatter {
    font-size: 13px;
  }
}