/* ============================================================
   Matrix Spins - Conversion Funnel Styles
   Dark theme: bg #0d0f14, gold #d4af37
   ============================================================ */

/* ----- Z-Index Layering -----
   Content:        1
   Sticky pill:    9000
   Low balance:    9100
   Return banner:  9200
   Win toast:      9300
   Welcome overlay:9500
   Modals:         9999+
   -------------------------------- */

/* ========== Welcome Overlay ========== */
.ms-welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 15, 20, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  animation: msFadeIn 0.35s ease forwards;
}

.ms-welcome-card {
  position: relative;
  width: 90%;
  max-width: 440px;
  padding: 2.5rem 2rem 2rem;
  border-radius: 16px;
  background: linear-gradient(165deg, #161921 0%, #0d0f14 100%);
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 0 60px rgba(212, 175, 55, 0.08), 0 20px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
  overflow: hidden;
}

.ms-welcome-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Ccircle cx='1' cy='1' r='0.6' fill='%23d4af37' opacity='0.07'/%3E%3C/svg%3E") repeat;
  pointer-events: none;
}

.ms-welcome-card h2 {
  font-size: 1.6rem;
  color: #d4af37;
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.ms-welcome-card p {
  color: #c0c4cc;
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 1.5rem;
}

.ms-btn-gold {
  display: inline-block;
  width: 100%;
  padding: 14px 24px;
  margin-bottom: 10px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #d4af37 0%, #b8962e 100%);
  color: #0d0f14;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
}

.ms-btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.35);
}

.ms-btn-outline {
  display: inline-block;
  width: 100%;
  padding: 12px 24px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 10px;
  background: transparent;
  color: #d4af37;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}

.ms-btn-outline:hover {
  background: rgba(212, 175, 55, 0.08);
  border-color: #d4af37;
}

/* Confetti canvas inside overlay */
.ms-confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.ms-welcome-card > *:not(.ms-confetti-canvas) {
  position: relative;
  z-index: 1;
}

/* ========== Low Balance Banner ========== */
.ms-low-balance {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9100;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(13, 15, 20, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(212, 175, 55, 0.25);
  transform: translateY(100%);
  animation: msSlideUp 0.4s ease forwards;
}

.ms-low-balance__text {
  color: #e0e0e0;
  font-size: 0.88rem;
  flex: 1;
}

.ms-low-balance__cta {
  flex-shrink: 0;
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #d4af37, #b8962e);
  color: #0d0f14;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.ms-low-balance__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ========== Sticky Deposit Pill ========== */
.ms-deposit-pill {
  position: fixed;
  bottom: 90px;
  right: 20px;
  z-index: 9000;
  padding: 12px 22px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #d4af37 0%, #c59b2f 50%, #d4af37 100%);
  background-size: 200% 200%;
  color: #0d0f14;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
  animation: msPulseGlow 2.5s ease-in-out infinite;
}

/* ========== Win Upsell Toast ========== */
.ms-win-toast {
  position: fixed;
  top: 80px;
  right: -400px;
  z-index: 9300;
  width: 340px;
  max-width: calc(100vw - 40px);
  padding: 18px 20px;
  border-radius: 12px;
  background: rgba(13, 15, 20, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: msSlideInRight 0.45s ease forwards;
}

.ms-win-toast__title {
  color: #d4af37;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.ms-win-toast__text {
  color: #c0c4cc;
  font-size: 0.85rem;
  margin: 0 0 12px;
  line-height: 1.45;
}

.ms-win-toast__cta {
  display: inline-block;
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #d4af37, #b8962e);
  color: #0d0f14;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.ms-win-toast__close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #888;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

/* ========== Return Visitor Banner ========== */
.ms-return-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9200;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.12) 0%, rgba(13, 15, 20, 0.95) 50%, rgba(212, 175, 55, 0.12) 100%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: msFadeIn 0.4s ease forwards;
}

.ms-return-banner__text {
  color: #e0e0e0;
  font-size: 0.88rem;
}

.ms-return-banner__text strong {
  color: #d4af37;
}

.ms-return-banner__cta {
  flex-shrink: 0;
  padding: 7px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #d4af37, #b8962e);
  color: #0d0f14;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.ms-return-banner__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ========== Spin Counter Badge (demo nudge) ========== */
.ms-spin-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9100;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(13, 15, 20, 0.9);
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateY(100%);
  animation: msSlideUp 0.4s ease forwards;
}

.ms-spin-banner__text {
  color: #c0c4cc;
  font-size: 0.88rem;
}

.ms-spin-banner__cta {
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #d4af37, #b8962e);
  color: #0d0f14;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

/* ========== Animations ========== */
@keyframes msFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes msSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@keyframes msSlideInRight {
  from { right: -400px; }
  to   { right: 20px; }
}

@keyframes msSlideOutRight {
  from { right: 20px; }
  to   { right: -400px; }
}

@keyframes msPulseGlow {
  0%, 100% { box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3); }
  50%      { box-shadow: 0 4px 30px rgba(212, 175, 55, 0.55); }
}

/* ========== Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
  .ms-welcome-overlay,
  .ms-low-balance,
  .ms-win-toast,
  .ms-return-banner,
  .ms-spin-banner {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
    right: 20px !important;
  }
  .ms-deposit-pill {
    animation: none !important;
  }
}

/* ========== Mobile ========== */
@media (max-width: 600px) {
  .ms-welcome-card {
    padding: 2rem 1.25rem 1.5rem;
    max-width: 95%;
  }
  .ms-welcome-card h2 {
    font-size: 1.3rem;
  }
  .ms-win-toast {
    width: calc(100vw - 24px);
    right: -110%;
  }
  @keyframes msSlideInRight {
    from { right: -110%; }
    to   { right: 12px; }
  }
  .ms-deposit-pill {
    bottom: 80px;
    right: 14px;
    padding: 10px 18px;
    font-size: 0.82rem;
  }
  .ms-low-balance,
  .ms-spin-banner {
    flex-wrap: wrap;
    padding: 12px 14px;
  }
  .ms-return-banner {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 8px;
  }
}
