:root {
  --sn-reels-bg: #050507;
  --sn-reels-panel: rgba(18, 17, 21, .72);
  --sn-reels-border: rgba(255, 255, 255, .16);
  --sn-reels-text: #fff;
  --sn-reels-muted: rgba(255, 255, 255, .72);
  --sn-reels-accent: #e43d7f;
  --sn-reels-accent-bright: #ff5d9d;
  --sn-accent: #e43d7f;
  --sn-accent-bright: #f4649f;
  --sn-accent-deep: #b62560;
}

html:has(body.shenudes-reels-page) {
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  background: var(--sn-reels-bg) !important;
  overscroll-behavior: none;
}

body.shenudes-reels-page,
body.shenudes-reels-page.admin-bar {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: var(--sn-reels-bg) !important;
  color: var(--sn-reels-text) !important;
  font-family: Inter, Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.shenudes-reels-page #wpadminbar {
  display: none !important;
}

html:has(body.shenudes-reels-page) {
  margin-top: 0 !important;
}

body.shenudes-reels-page * {
  box-sizing: border-box;
}

body.shenudes-reels-page button,
body.shenudes-reels-page a {
  -webkit-tap-highlight-color: transparent;
}

.sn-reels-app {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(228, 61, 127, .09), transparent 34%),
    #050507;
}

.sn-reels-feed {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  touch-action: pan-y;
}

.sn-reels-feed::-webkit-scrollbar {
  display: none;
}

.sn-reel {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #050507;
}

.sn-reel__ambient {
  position: absolute;
  inset: -8%;
  z-index: -2;
  background-position: center;
  background-size: cover;
  filter: blur(42px) saturate(.82) brightness(.36);
  opacity: .78;
  transform: scale(1.08);
}

.sn-reel__ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 6, .32);
}

.sn-reel__media-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.sn-reel__media {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100vw !important;
  max-height: 100dvh !important;
  object-fit: contain !important;
  object-position: center !important;
  background: transparent;
  user-select: none;
  -webkit-user-drag: none;
}

/* Desktop uses the media's real aspect ratio instead of forcing every file
   into a 100% x 100% video box. The JS writes the exact fitted dimensions
   after metadata loads, so portrait MP4s never overflow the viewport. */
@media (min-width: 701px) {
  .sn-reel__media {
    width: var(--sn-reels-media-width, 100%) !important;
    height: var(--sn-reels-media-height, 100%) !important;
    flex: 0 0 auto;
  }
}

.sn-reel__media--video {
  cursor: pointer;
}

.sn-reel__shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .56) 0%, transparent 18%, transparent 60%, rgba(0, 0, 0, .82) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, .12), transparent 24%, transparent 76%, rgba(0, 0, 0, .12));
}

.sn-reel__info {
  position: absolute;
  z-index: 4;
  left: max(22px, env(safe-area-inset-left));
  right: 108px;
  bottom: max(27px, calc(env(safe-area-inset-bottom) + 18px));
  display: grid;
  gap: 7px;
  pointer-events: none;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .92);
}

.sn-reel__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, .76);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.sn-reel__eyebrow i {
  color: var(--sn-reels-accent-bright);
}

.sn-reel__title {
  max-width: 760px;
  margin: 0;
  color: #fff !important;
  font-size: clamp(17px, 2vw, 25px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.sn-reel__source {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin-top: 4px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(13, 12, 15, .62);
  backdrop-filter: blur(14px);
  color: #fff !important;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none !important;
  pointer-events: auto;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.sn-reel__source:hover {
  border-color: rgba(255, 93, 157, .72);
  background: rgba(228, 61, 127, .2);
  transform: translateY(-1px);
}

.sn-reel__error {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  place-items: center;
  padding: 28px;
  background: #08080a;
  color: rgba(255, 255, 255, .72);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.sn-reel.is-media-error .sn-reel__error {
  display: grid;
}

.sn-reels-brand-wrap {
  position: fixed !important;
  z-index: 20;
  top: max(18px, calc(env(safe-area-inset-top) + 12px));
  left: max(20px, calc(env(safe-area-inset-left) + 14px));
  min-width: 0 !important;
  width: auto !important;
  filter: drop-shadow(0 3px 16px rgba(0, 0, 0, .88));
}

body.shenudes-reels-page .sn-reels-brand-wrap .sn-reels-brand {
  position: static !important;
  transform: none !important;
  justify-self: auto !important;
  color: #fff !important;
  text-decoration: none !important;
}

.sn-reel--ad .sn-reel__eyebrow {
  color: #fff;
}

.sn-reel--ad .sn-reel__eyebrow i {
  color: var(--sn-reels-accent-bright);
}

.sn-reel__source--ad {
  border-color: rgba(255, 93, 157, .52);
  background: linear-gradient(135deg, rgba(228, 61, 127, .82), rgba(145, 29, 80, .82));
}

.sn-reel__source--ad:hover {
  border-color: rgba(255, 255, 255, .72);
  background: linear-gradient(135deg, rgba(244, 74, 142, .94), rgba(172, 35, 95, .94));
}

.sn-reels-toolbar {
  position: fixed;
  z-index: 20;
  top: 50%;
  right: max(20px, calc(env(safe-area-inset-right) + 14px));
  display: grid;
  gap: 10px;
  transform: translateY(-50%);
}

.sn-reels-control {
  appearance: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--sn-reels-border);
  border-radius: 17px;
  background: var(--sn-reels-panel);
  backdrop-filter: blur(15px) saturate(1.2);
  color: #fff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .28);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease;
}

.sn-reels-control:hover {
  border-color: rgba(255, 93, 157, .62);
  background: rgba(228, 61, 127, .25);
  transform: translateY(-1px);
}

.sn-reels-control:active {
  transform: scale(.94);
}

.sn-reels-control:disabled {
  opacity: .25;
  cursor: default;
  transform: none;
}

.sn-reels-control i {
  font-size: 16px;
}

.sn-reels-control--previous,
.sn-reels-control--next {
  width: 52px;
  height: 52px;
  border-radius: 18px;
}

.sn-reels-counter {
  position: fixed;
  z-index: 20;
  top: max(23px, calc(env(safe-area-inset-top) + 17px));
  right: max(20px, calc(env(safe-area-inset-right) + 14px));
  min-width: 66px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  background: rgba(10, 9, 12, .62);
  backdrop-filter: blur(15px);
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}

.sn-reels-status {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 13px;
  padding: 28px;
  background: #050507;
  color: rgba(255, 255, 255, .76);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  transition: opacity .24s ease, visibility .24s ease;
}

.sn-reels-status.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sn-reels-status.is-error {
  color: rgba(255, 255, 255, .8);
}

.sn-reels-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, .13);
  border-top-color: var(--sn-reels-accent-bright);
  border-radius: 50%;
  animation: snReelsSpin .72s linear infinite;
}

.sn-reels-status.is-error .sn-reels-spinner {
  display: none;
}

@keyframes snReelsSpin {
  to { transform: rotate(360deg); }
}

.sn-reels-noscript {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  background: #050507;
  color: #fff;
  text-align: center;
}

@media (max-width: 700px) {
  .sn-reels-brand-wrap {
    top: max(12px, calc(env(safe-area-inset-top) + 8px));
    left: max(14px, calc(env(safe-area-inset-left) + 10px));
  }

  .sn-reels-toolbar {
    top: auto;
    right: max(12px, calc(env(safe-area-inset-right) + 8px));
    bottom: max(76px, calc(env(safe-area-inset-bottom) + 66px));
    transform: none;
  }

  .sn-reels-control {
    width: 44px;
    height: 44px;
    border-radius: 15px;
  }

  .sn-reels-control--previous,
  .sn-reels-control--next {
    width: 46px;
    height: 46px;
  }

  .sn-reels-counter {
    top: max(17px, calc(env(safe-area-inset-top) + 13px));
    right: max(13px, calc(env(safe-area-inset-right) + 9px));
  }

  .sn-reel__info {
    left: max(15px, calc(env(safe-area-inset-left) + 10px));
    right: 75px;
    bottom: max(20px, calc(env(safe-area-inset-bottom) + 15px));
  }

  .sn-reel__title {
    font-size: 16px;
    line-height: 1.2;
  }

  .sn-reel__source {
    min-height: 32px;
    padding: 0 11px;
  }
}

@media (pointer: coarse) and (max-width: 700px) {
  .sn-reels-control--previous,
  .sn-reels-control--next {
    opacity: .92;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sn-reels-feed {
    scroll-behavior: auto;
  }

  .sn-reels-spinner {
    animation-duration: 1.4s;
  }
}
