

.reels-scroller {
  display: grid;
  grid-auto-columns: clamp(12rem, min(18vw, 28vh), 16rem);
  grid-auto-flow: column;
  gap: 18px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 4px 2px 18px;
  scroll-padding-inline: 2px;
  scroll-snap-type: inline mandatory;
  scrollbar-color: var(--accent) rgba(5, 5, 5, 0.08);
}

.reels-scroller::-webkit-scrollbar {
  height: 10px;
}

.reels-scroller::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.08);
}

.reels-scroller::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  background-clip: padding-box;
}

.reels-card {
  position: relative;
  display: block;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #090909;
  box-shadow: 0 18px 46px rgba(129, 48, 0, 0.18);
  color: #ffffff;
  scroll-snap-align: start;
  text-align: left;
}

.reels-card::after {
  position: absolute;
  inset: 46% 0 0;
  z-index: 2;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.74) 62%, rgba(0, 0, 0, 0.92));
  content: "";
}

.reels-card__thumb,
.reels-card video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
}

.reels-card__thumb {
  z-index: 1;
  transition: opacity 180ms ease, transform 220ms ease;
}

.reels-card video {
  z-index: 0;
  opacity: 1;
  transition: filter 180ms ease, transform 220ms ease;
}

.reels-card.has-thumb.is-previewing .reels-card__thumb {
  opacity: 0;
}

.reels-card.has-thumb.is-restoring .reels-card__thumb {
  transition-duration: 0ms, 220ms;
}

.reels-card:hover video,
.reels-card:focus-visible video {
  filter: saturate(1.08);
  transform: scale(1.045);
}

.reels-card:hover .reels-card__thumb,
.reels-card:focus-visible .reels-card__thumb {
  transform: scale(1.045);
}

.reels-card strong {
  position: absolute;
  z-index: 3;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: -webkit-box;
  overflow: hidden;
  font-size: 1.08rem;
  font-weight: 950;
  line-height: 1.12;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.reels-card__play {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 56px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px);
  transform: translate(-50%, -50%);
}

.reels-card__play::before {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 15px solid #ffffff;
  transform: translate(-36%, -50%);
  content: "";
}

body.reels-open {
  overflow: hidden;
}

.reels-lightbox {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.5vw, 28px);
}

.reels-lightbox[hidden] {
  display: none !important;
}

.reels-lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(3, 3, 5, 0.82);
  backdrop-filter: blur(14px);
}

.reels-player {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  height: min(92vh, 746px);
  overflow: hidden;
  border-radius: 18px;
  background: #050505;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.56);
}

.reels-player::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.58), transparent 24%, transparent 56%, rgba(0, 0, 0, 0.76)),
    linear-gradient(90deg, transparent calc(100% - 92px), rgba(0, 0, 0, 0.18));
  content: "";
}

.reels-player > video {
  display: block;
  width: 100%;
  height: 100%;
  background: #050505;
  object-fit: cover;
}

.reels-progress {
  position: absolute;
  z-index: 4;
  left: 14px;
  right: 14px;
  top: 13px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
}

.reels-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #ffffff;
}

.reels-close {
  position: absolute;
  z-index: 5;
  right: 12px;
  top: 28px;
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.32);
  color: #ffffff;
}

.reels-close::before,
.reels-close::after {
  position: absolute;
  width: 21px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.reels-close::before {
  transform: rotate(45deg);
}

.reels-close::after {
  transform: rotate(-45deg);
}

.reels-meta {
  position: absolute;
  z-index: 4;
  left: 18px;
  right: 70px;
  bottom: 96px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
}

.reels-meta img {
  width: 42px;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  object-fit: cover;
}

.reels-meta strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 1.25rem;
  font-weight: 950;
  line-height: 1.1;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.reels-actions {
  position: absolute;
  z-index: 5;
  left: 18px;
  right: 18px;
  bottom: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.reels-control {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.44);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 950;
  backdrop-filter: blur(12px);
}

.reels-control:hover,
.reels-control:focus-visible,
.reels-close:hover,
.reels-close:focus-visible {
  outline: 0;
  background: rgba(255, 121, 0, 0.92);
}

@media (max-width: 620px) {
  .reels-scroller {
    grid-auto-columns: clamp(146px, 62vw, 230px);
  }

  .reels-lightbox {
    padding: 8px;
  }

  .reels-player {
    width: min(100%, 390px);
    height: min(92vh, 694px);
    border-radius: 14px;
  }
}
