.reels-experience {
  min-height: 100dvh;
  background: #000;
}

.reels-system-state {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 38%, rgb(var(--sd-accent-rgb) / 0.16), transparent 30rem),
    #050506;
  text-align: center;
}

.reels-system-state > span {
  color: var(--sd-accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.reels-system-state > strong {
  max-width: 520px;
  font-size: clamp(24px, 5vw, 42px);
  line-height: 1.05;
}

.reels-system-state > small {
  max-width: 520px;
  color: var(--sd-muted);
  font-size: 12px;
  line-height: 1.6;
}

.reels-loading-orbit {
  width: 42px;
  height: 42px;
  margin-bottom: 8px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--sd-accent);
  border-radius: 999px;
  animation: reels-spin 0.8s linear infinite;
}

.reels-state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.reels-state-actions button,
.reels-state-actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--sd-line-strong);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

@keyframes reels-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .reels-loading-orbit {
    animation-duration: 1.6s;
  }
}

/* Reels engagement + comment sheet */
.reels-comments-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(3px);
}

.reels-comments-sheet {
  width: min(100%, 470px);
  height: min(72dvh, 720px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: #111114;
  color: #fff;
  box-shadow: 0 -20px 70px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.reels-comments-handle {
  width: 38px;
  height: 4px;
  margin: 9px auto 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.reels-comments-header {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 50px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.reels-comments-header strong {
  font-size: 13px;
}

.reels-comments-header button {
  position: absolute;
  right: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: #fff;
  cursor: pointer;
}

.reels-comments-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 14px 18px;
}

.reels-comment {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
}

.reels-comment-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(145deg, #35353c, #1c1c20);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.reels-comment-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.reels-comment-meta strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.reels-comment-meta span {
  color: rgba(255,255,255,.42);
  font-size: 9px;
}

.reels-comment p {
  margin: 4px 0 0;
  color: rgba(255,255,255,.86);
  font-size: 12px;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.reels-comments-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: rgba(255,255,255,.48);
  text-align: center;
}

.reels-comments-empty strong {
  color: rgba(255,255,255,.9);
  font-size: 13px;
}

.reels-comments-empty span {
  font-size: 10px;
}

.reels-comments-error {
  padding: 7px 14px;
  color: #ff8ba5;
  background: rgb(var(--sd-accent-rgb) / .07);
  font-size: 10px;
}

.reels-comments-composer {
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  padding: 9px 12px max(9px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(17,17,20,.98);
}

.reels-comments-composer input {
  min-width: 0;
  height: 42px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
  padding: 0 15px;
  outline: none;
  background: rgba(255,255,255,.06);
  color: #fff;
  font: inherit;
  font-size: 12px;
}

.reels-comments-composer input:focus {
  border-color: rgb(var(--sd-accent-rgb) / .55);
  box-shadow: 0 0 0 3px rgb(var(--sd-accent-rgb) / .09);
}

.reels-comments-composer button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--player-accent, #4c8dff);
  color: #fff;
  cursor: pointer;
}

.reels-comments-composer button:disabled {
  opacity: .35;
  cursor: default;
}

@media (min-width: 901px) {
  .reels-comments-backdrop {
    align-items: center;
  }

  .reels-comments-sheet {
    height: min(76dvh, 720px);
    border-bottom: 1px solid rgba(255,255,255,.09);
    border-radius: 22px;
  }
}

/* v6.10 Reels Smooth Motion Deck
   Native scroll keeps the outgoing and incoming reel physically connected to
   the gesture; scroll snap only settles after momentum finishes. */
.reels-experience.is-motion-deck {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: #000;
}

.reels-motion-deck {
  width: 100%;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scroll-padding: 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y pinch-zoom;
  background: #000;
}

.reels-motion-deck::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.reels-motion-slide {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  background: #000;
  isolation: isolate;
}

.reels-motion-slide > .premium-player-shell {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.reels-motion-placeholder {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #050506;
  background-position: center;
  background-size: cover;
  color: #fff;
}

.reels-motion-placeholder::before {
  content: "";
  position: absolute;
  inset: -5%;
  background: inherit;
  background-position: center;
  background-size: cover;
  filter: blur(16px) brightness(.7);
  transform: scale(1.06);
  opacity: .7;
}

.reels-motion-placeholder-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.24), transparent 35%, rgba(0,0,0,.78)),
    radial-gradient(circle at 50% 40%, transparent 15%, rgba(0,0,0,.2) 100%);
}

.reels-motion-placeholder-copy {
  position: absolute;
  z-index: 2;
  left: 18px;
  right: 76px;
  bottom: max(96px, calc(96px + env(safe-area-inset-bottom)));
  display: grid;
  gap: 6px;
  text-shadow: 0 2px 16px rgba(0,0,0,.58);
}

.reels-motion-placeholder-copy > span {
  color: rgba(255,255,255,.66);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.reels-motion-placeholder-copy > strong {
  max-width: 380px;
  font-size: clamp(20px, 4vw, 27px);
  line-height: 1.08;
}

.reels-motion-placeholder-copy > small,
.reels-motion-placeholder-copy > i {
  color: rgba(255,255,255,.72);
  font-size: 11px;
  font-style: normal;
}

.reels-motion-placeholder-copy > i {
  margin-top: 4px;
  color: rgba(255,255,255,.5);
}

.reels-motion-placeholder-copy > button {
  width: fit-content;
  min-height: 38px;
  margin-top: 5px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(10,10,12,.58);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  backdrop-filter: blur(14px);
}

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


/* v6.10.1 Buffered Neighbors
   The first reel is held until current + immediate neighbors have decoded
   playable media. A two-reel warm radius then keeps the next transition
   ahead of the user's finger instead of resolving media after the swipe. */
.reels-motion-deck.is-priming {
  overflow-y: hidden;
}

.reels-motion-prime-indicator {
  position: fixed;
  z-index: 45;
  left: 50%;
  bottom: max(82px, calc(82px + env(safe-area-inset-bottom)));
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  max-width: calc(100vw - 28px);
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  background: rgba(8,8,10,.68);
  color: rgba(255,255,255,.72);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
  pointer-events: none;
  backdrop-filter: blur(12px);
}

.reels-motion-prime-indicator > span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--sd-accent);
  box-shadow: 0 0 0 4px rgb(var(--sd-accent-rgb) / .13);
  animation: reels-prime-pulse .9s ease-in-out infinite alternate;
}

@keyframes reels-prime-pulse {
  from { opacity: .45; transform: scale(.88); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .reels-motion-prime-indicator > span {
    animation: none;
  }
}
