/* Reels v2: isolated responsive layout and native scroll-snap navigation. */

body.sngine-reels-v2 {
  overflow: hidden;
  background: #0b0b0c;
}

body.sngine-reels-v2 .sg-offcanvas-sidebar,
body.sngine-reels-v2 .footer,
body.sngine-reels-v2 .mini-footer,
body.sngine-reels-v2 .footer-bottom-bar,
body.sngine-reels-v2 .chat-sidebar,
body.sngine-reels-v2 .chat-widget {
  display: none !important;
}

body.sngine-reels-v2 .sg-offcanvas,
body.sngine-reels-v2 .sg-offcanvas-mainbar {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
}

body.sngine-reels-v2 .sg-offcanvas-mainbar {
  padding: 0 !important;
}

body.sngine-reels-v2 .reels-wrapper {
  position: relative !important;
  inset: auto !important;
  width: min(100%, 980px);
  height: calc(100dvh - 90px);
  min-height: 560px;
  margin: 0 auto;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  touch-action: pan-y;
  border-radius: 16px;
  background: #000;
  z-index: 1;
}

body.sngine-reels-v2 .reels-wrapper::-webkit-scrollbar {
  display: none;
}

body.sngine-reels-v2 .reel-container,
body.sngine-reels-v2 .reel-container.hidden,
body.sngine-reels-v2 .reel-container:not(.hidden) {
  position: relative !important;
  inset: auto !important;
  display: flex !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: none !important;
  transition: none !important;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
}

body.sngine-reels-v2 .reel-container > .position-relative,
body.sngine-reels-v2 .reel-video-wrapper {
  width: 100%;
  height: 100%;
  min-height: 0;
}

body.sngine-reels-v2 .reel-video-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

body.sngine-reels-v2 .reel-video-wrapper .reel-video-container {
  position: relative;
  width: min(460px, calc(100% - 120px));
  max-width: 460px;
  height: 100%;
  margin: 0 auto;
  overflow: visible;
  background: #000;
}

body.sngine-reels-v2 .reel-video-container .plyr,
body.sngine-reels-v2 .reel-video-container .plyr--video,
body.sngine-reels-v2 .reel-video-container .plyr__video-wrapper,
body.sngine-reels-v2 .reel-video-container .plyr__poster {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

body.sngine-reels-v2 .reel-video-container .plyr__poster {
  display: none !important;
  opacity: 0 !important;
}

body.sngine-reels-v2 .reel-video-container video,
body.sngine-reels-v2 .reel-video-container .plyr__video-wrapper video {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center;
  background: #000;
}

body.sngine-reels-v2 .reel-video-wrapper .reel-video-container .plyr__controls {
  top: 10px;
  right: 10px;
  bottom: auto;
  left: auto;
  width: auto;
  z-index: 12;
  background: transparent;
}

body.sngine-reels-v2 .reel-video-wrapper .reel-video-container .video-caption-overlay {
  top: auto;
  bottom: 0;
  height: 42%;
  z-index: 8;
  pointer-events: none;
}

body.sngine-reels-v2 .reel-video-wrapper .reel-video-container .video-caption {
  right: 82px;
  bottom: 20px;
  z-index: 9;
  padding: 16px 12px;
  background: transparent;
}

body.sngine-reels-v2 .reel-video-wrapper .reel-video-container .video-controlls {
  right: -78px;
  bottom: 22px;
  z-index: 14;
}

body.sngine-reels-v2 .reel-actions .action-btn,
body.sngine-reels-v2 .reel-actions .action-btn * {
  touch-action: manipulation;
}

body.sngine-reels-v2 .reel-actions .action-btn {
  background: rgba(30, 30, 30, 0.82);
  backdrop-filter: blur(4px);
}

body.sngine-reels-v2 .reel-container.comments-shown .reel-video-wrapper {
  width: calc(100% - 420px);
}

body.sngine-reels-v2 .reel-comments-wrapper {
  z-index: 20;
}

body.sngine-reels-v2 .reel-container.reel-has-error .reel-video-container::before {
  content: "Video could not be loaded. Tap to retry.";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 30;
  width: min(80%, 300px);
  padding: 12px 16px;
  transform: translate(-50%, -50%);
  border-radius: 10px;
  color: #fff;
  text-align: center;
  background: rgba(0, 0, 0, 0.78);
  pointer-events: none;
}

body.sngine-reels-v2 .reel-container.reel-awaiting-play .reel-video-container::before {
  content: "Tap to play with sound";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 30;
  width: min(80%, 280px);
  padding: 12px 16px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  color: #fff;
  text-align: center;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.62);
  pointer-events: none;
}

body.sngine-reels-v2 .reel-doubletap-feedback {
  position: absolute;
  inset: 0;
  z-index: 13;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

body.sngine-reels-v2 .reel-doubletap-feedback i,
body.sngine-reels-v2 .reel-doubletap-feedback img {
  line-height: 1;
  animation: reel-like-burst 780ms cubic-bezier(0.2, 0.9, 0.22, 1) forwards;
}

body.sngine-reels-v2 .reel-doubletap-feedback i {
  color: #fff;
  font-size: clamp(76px, 18vw, 116px);
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.45);
}

body.sngine-reels-v2 .reel-doubletap-feedback img {
  width: clamp(86px, 20vw, 132px);
  height: clamp(86px, 20vw, 132px);
  object-fit: contain;
  border-radius: 28%;
  filter: drop-shadow(0 8px 26px rgba(0, 0, 0, 0.48));
}

@keyframes reel-like-burst {
  0% {
    opacity: 0;
    transform: scale(0.25) rotate(-12deg);
  }
  22% {
    opacity: 1;
    transform: scale(1.08) rotate(5deg);
  }
  58% {
    opacity: 0.95;
    transform: scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: scale(1.75) rotate(0deg);
  }
}

@media (max-width: 767.98px) {
  body.sngine-reels-v2 {
    padding-top: 0 !important;
    margin: 0 !important;
    background: #000 !important;
  }

  body.sngine-reels-v2 .main-header {
    display: none !important;
  }

  body.sngine-reels-v2 .main-wrapper,
  body.sngine-reels-v2 .sg-offcanvas,
  body.sngine-reels-v2 .container,
  body.sngine-reels-v2 .container-fluid,
  body.sngine-reels-v2 .row,
  body.sngine-reels-v2 .sg-offcanvas-mainbar {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.sngine-reels-v2 .reels-wrapper {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    border-radius: 0;
    z-index: 1000;
  }

  body.sngine-reels-v2 .reel-container,
  body.sngine-reels-v2 .reel-container.hidden,
  body.sngine-reels-v2 .reel-container:not(.hidden) {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
  }

  body.sngine-reels-v2 .reel-video-wrapper .reel-video-container {
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
  }

  body.sngine-reels-v2 .reel-video-container .plyr,
  body.sngine-reels-v2 .reel-video-container .plyr--video,
  body.sngine-reels-v2 .reel-video-container .plyr__video-wrapper,
  body.sngine-reels-v2 .reel-video-container .plyr__poster {
    border-radius: 0;
  }

  body.sngine-reels-v2 .reel-video-container video,
  body.sngine-reels-v2 .reel-video-container .plyr__video-wrapper video {
    object-fit: cover !important;
  }

  body.sngine-reels-v2 .reel-prev-btn,
  body.sngine-reels-v2 .reel-next-btn {
    display: none !important;
  }

  body.sngine-reels-v2 .reel-video-wrapper .reel-video-container .video-caption {
    right: 84px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    padding: 12px;
  }

  body.sngine-reels-v2 .reel-video-wrapper .reel-video-container .video-controlls {
    right: 12px;
    bottom: calc(18px + env(safe-area-inset-bottom));
  }

  body.sngine-reels-v2 .reel-container.comments-shown .reel-video-wrapper {
    width: 0;
  }

  body.sngine-reels-v2 .reel-comments-wrapper {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
  }
}

@media (min-width: 768px) and (max-height: 700px) {
  body.sngine-reels-v2 .reels-wrapper {
    height: calc(100dvh - 76px);
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.sngine-reels-v2 .reels-wrapper {
    scroll-behavior: auto;
  }
}
