/* Stripchat-style member join popup on homepage — above fixed header (99999) */

/* Scroll-lock: keep the page frozen behind ANY auth overlay (join OR login).
   iOS Safari ignores inline position:fixed alone, so pin overflow here too and
   cover the generic sl-overlay-locked class (used across the join<->login switch). */
html.sl-overlay-locked,
body.sl-overlay-locked {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  touch-action: none;
}
body.sl-overlay-locked {
  width: 100% !important;
}

#popupOverlay.popup-overlay {
  background: rgba(4, 6, 12, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2147482900 !important;
}

#popupWindow.popup-window {
  z-index: 2147482901 !important;
  position: fixed;
  top: 50%;
  left: 50%;
  display: none;
  align-items: stretch;
  justify-content: center;
  width: min(960px, calc(100vw - 24px));
  max-width: 960px;
  height: auto;
  min-height: 0;
  max-height: min(calc(100vh - 48px), 680px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: #0a0e1a;
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 48px rgba(255, 0, 85, 0.08);
  transform: translate(-50%, -50%);
  text-align: left;
}

body.sl-join-popup-open .sl-front-shell,
body.sl-join-popup-open .sl-streamlumi-nav-chips,
body.sl-join-popup-open .sl-front-tabs-ad-row,
body.sl-join-popup-open .sl-front-ad-carousel-lane--mobile {
  z-index: auto !important;
}

body.sl-join-popup-open #popupOverlay.popup-overlay {
  z-index: 2147483200 !important;
}

body.sl-join-popup-open #popupWindow.popup-window {
  z-index: 2147483201 !important;
}

body.sl-join-popup-open #loginOverlay,
body.sl-join-popup-open #loginModal,
body.sl-join-popup-open #broadcasterOverlay,
body.sl-join-popup-open #broadcasterModal {
  display: none !important;
}

#popupWindow.popup-window::before,
#popupWindow.popup-window::after {
  display: none !important;
  content: none !important;
}

#popupWindow .popup-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  margin: 0;
  padding: 0;
  z-index: 3;
  pointer-events: none;
}

#popupWindow .close-popup {
  pointer-events: auto;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 24px;
  line-height: 1;
  z-index: 120;
  cursor: pointer;
}

#popupWindow .twoSidesPop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 0;
  margin: 0;
  padding: 0;
  max-width: none;
  min-height: min(680px, calc(100vh - 48px));
}

/* Bubble FX inside join + login panels */
.sl-auth-modal-panel {
  position: relative;
  overflow: hidden;
}

.sl-auth-modal-bubbles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.sl-auth-modal-bubbles canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.sl-auth-modal-panel-inner {
  position: relative;
  z-index: 1;
}

#popupWindow #leftSide {
  padding: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(145deg, rgba(10, 14, 26, 0.98), rgba(8, 10, 18, 0.98));
  overflow: hidden;
}

#popupWindow #leftSide .sl-auth-modal-panel-inner {
  padding: 36px 34px 28px;
  max-height: min(680px, calc(100vh - 48px));
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#popupWindow #leftSide .sl-auth-modal-panel-inner::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

#loginModal.sl-auth-modal-panel {
  padding: 0 !important;
}

#loginModal .sl-auth-modal-panel-inner {
  position: relative;
  padding: 30px 32px 26px;
}

/* Auth switch links (Join <-> Login) need a real tap target so mobile users
   don't miss the tiny text and accidentally hit the overlay (which closes the
   flow). Make them full-width, >=44px, and visually a secondary button. */
#alreadyMember,
#loginModal .sl-auth-footer-cta,
#popupWindow .sl-auth-footer-cta {
  margin-top: 14px;
  font-size: 13px;
  text-align: center;
}
#alreadyMember a[data-sl-switch-login],
.sl-auth-footer-cta a[data-sl-switch-join],
.sl-auth-footer-cta a[data-sl-switch-login] {
  display: inline-block;
  min-height: 44px;
  line-height: 24px;
  padding: 10px 18px;
  margin-top: 4px;
  font-weight: 700;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.12);
  touch-action: manipulation;
}

#popupWindow #rightSide.sl-join-popup-showcase {
  position: relative;
  padding: 0;
  border-left: 0;
  background-color: #120810;
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  align-content: stretch;
  min-height: 100%;
  overflow: hidden;
}

#popupWindow #rightSide.sl-join-popup-showcase.sl-auth-modal-panel {
  display: block;
  overflow: hidden;
}

#popupWindow .sl-join-showcase-panel-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  min-height: 100%;
  height: 100%;
}

#popupWindow .sl-join-showcase-bubbles {
  z-index: 0;
  border-radius: 0;
}

#popupWindow .sl-join-showcase-bubbles canvas {
  opacity: 0.92;
}

#popupWindow .sl-join-showcase-media {
  position: relative;
  z-index: 2;
  inset: auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px 6px;
  background: transparent;
}

#popupWindow .sl-join-showcase-video-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-height: 100%;
}

#popupWindow .sl-join-showcase-video {
  display: block;
  width: auto;
  max-width: min(100%, 320px);
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  border-radius: 12px;
  filter: drop-shadow(0 20px 42px rgba(255, 0, 85, 0.22));
  background: transparent;
}

#popupWindow .sl-join-showcase-video-glow {
  position: absolute;
  inset: 8% 10% 12%;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 42%, rgba(255, 0, 85, 0.18), transparent 68%);
  pointer-events: none;
  z-index: 0;
}

#popupWindow .sl-join-showcase-video-wrap video {
  position: relative;
  z-index: 1;
}

#popupWindow .sl-join-showcase-img {
  display: block;
  width: auto;
  max-width: min(100%, 300px);
  height: auto;
  max-height: 100%;
  object-fit: contain !important;
  object-position: center center !important;
  filter: drop-shadow(0 18px 36px rgba(255, 0, 85, 0.18));
}

#popupWindow .sl-join-showcase-overlay {
  display: none;
}

#popupWindow #rightSide.sl-join-popup-showcase.sl-auth-modal-panel {
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 0, 85, 0.16), transparent 54%),
    radial-gradient(circle at 82% 72%, rgba(56, 189, 248, 0.08), transparent 46%),
    linear-gradient(180deg, #1a0a14 0%, #120810 100%);
}

#popupWindow .sl-join-showcase-bottom {
  position: relative;
  z-index: 2;
  margin-top: 0;
  padding: 10px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, rgba(18, 8, 16, 0.55) 0%, rgba(8, 4, 10, 0.92) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#popupWindow .sl-join-showcase-benefits {
  padding: 0;
  margin: 0;
}

#popupWindow .sl-join-showcase-benefits .benefit-item {
  margin-bottom: 0 !important;
  gap: 8px !important;
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.42);
  border-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 12px;
  line-height: 1.3;
  border-radius: 8px;
}

#popupWindow .sl-join-showcase-benefits .benefit-item i {
  width: 14px;
  font-size: 12px;
  color: #f8fafc;
  flex-shrink: 0;
}

#popupWindow .sl-join-showcase-benefits .benefit-item span {
  letter-spacing: 0;
}

#popupWindow .sl-join-model-cta {
  margin: 0;
  padding: 0;
  text-align: center;
  background: none;
}

#popupWindow .sl-join-model-cta a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

#popupWindow .sl-join-model-cta a:hover {
  color: #f8fafc;
}

#popupWindow .benefit-item strong {
  color: #f8fafc;
  font-weight: 700;
}

#popupWindow #alreadyMember a {
  color: #7dd3fc;
  font-weight: 700;
  text-decoration: none;
}

#popupWindow .popupHeaderText {
  margin: 0 0 20px;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fafc !important;
  text-align: left;
}

#popupWindow .popupInputLabel {
  display: block;
  margin: 0 0 7px;
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

#popupWindow .popup-input {
  width: 100%;
  min-height: 46px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(17, 24, 39, 0.95);
  color: #f8fafc;
  font-size: 15px;
  box-sizing: border-box;
}

#popupWindow .popup-input:focus {
  outline: none;
  border-color: rgba(255, 51, 102, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 0, 85, 0.14);
}

#popupWindow #termsText {
  width: 100%;
  margin: 16px 0 0;
  font-size: 11px;
  line-height: 1.55;
  color: #64748b !important;
  text-align: left;
}

#popupWindow .sl-username-generate-wrap {
  margin-bottom: 16px;
}

#popupWindow .sl-username-generate-wrap .popup-input {
  margin-bottom: 0;
}

#popupWindow .register-button {
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #db2777) !important;
  color: #fff !important;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.40);
  transition: filter .2s ease, transform .2s ease, box-shadow .2s ease;
}

#popupWindow .register-button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 16px 38px rgba(124, 58, 237, 0.48);
}

#popupWindow #alreadyMember {
  margin: 14px 0 0;
  font-size: 13px;
  color: #94a3b8;
  text-align: center;
}

#popupWindow #alreadyMember a {
  color: #7dd3fc;
  font-weight: 700;
  text-decoration: none;
}

#popupWindow .benefits-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
}

#popupWindow .benefit-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0 !important;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
}

#popupWindow .benefit-item i {
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

@media (max-width: 820px) {
  body.sl-join-popup-open,
  body.sl-overlay-locked {
    overflow: hidden;
    overscroll-behavior: none;
  }

  #popupWindow.popup-window {
    top: max(10px, env(safe-area-inset-top, 10px)) !important;
    bottom: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: min(calc(100vw - 16px), 520px) !important;
    max-width: none !important;
    max-height: calc(100dvh - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    background: #0a0e1a !important;
  }

  body.sl-join-popup-open #popupWindow.popup-window {
    display: flex !important;
  }

  #popupWindow .popup-header {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 120;
    flex-shrink: 0;
    pointer-events: none;
  }

  #popupWindow .close-popup {
    position: relative;
    z-index: 121;
    pointer-events: auto;
  }

  #popupWindow .twoSidesPop {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    grid-template-columns: 1fr;
  }

  /* Legacy header CSS hides #rightSide below 1399px — restore showcase video on mobile */
  #popupWindow #rightSide.sl-join-popup-showcase {
    display: block !important;
    order: -1;
    min-height: 180px;
    max-height: 240px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  #popupWindow .sl-join-showcase-panel-inner {
    grid-template-rows: minmax(140px, 1fr) auto;
    min-height: 180px;
  }

  #popupWindow .sl-join-showcase-media {
    min-height: 140px;
    max-height: 180px;
  }

  #popupWindow .sl-join-showcase-bottom {
    display: none;
  }

  #popupWindow #leftSide {
    flex: 0 0 auto;
    display: block;
    border-right: 0;
    border-bottom: 0;
  }

  #popupWindow #leftSide .sl-auth-modal-panel-inner {
    max-height: none;
    overflow: visible;
    padding: 20px 18px calc(22px + env(safe-area-inset-bottom, 0px));
  }

  #popupWindow .popupHeaderText {
    font-size: 22px;
    margin-bottom: 16px;
  }

  #popupWindow .popup-input,
  #popupWindow .register-button,
  #popupWindow .sl-social-auth-btn {
    font-size: 16px;
  }
}

@media (max-width: 820px) {
  #loginModal.sl-auth-modal-panel {
    top: max(10px, env(safe-area-inset-top, 10px)) !important;
    bottom: auto !important;
    margin: 0 !important;
    transform: translateX(-50%) !important;
    left: 50% !important;
    width: min(calc(100vw - 20px), 450px) !important;
    max-height: calc(100dvh - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
    height: auto !important;
    overflow: hidden !important;
    padding: 0 !important;
    box-sizing: border-box;
  }

  #loginModal .sl-auth-modal-panel-inner {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 44px 22px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #loginModal .closeLogin {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sl-auth-modal-bubbles canvas {
    display: none;
  }
}
