/**
 * Homepage Stories strip + full-screen viewer (Tier-1 #2). Premium dark theme.
 */

.sl-home-stories {
  margin: 4px 0 14px;
  padding: 0 4px;
}

.sl-hs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 4px 8px;
}

.sl-hs-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #eaf0fb;
  letter-spacing: 0.01em;
}

.sl-hs-head h2 i {
  color: #c084fc;
  margin-right: 6px;
}

.sl-hs-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 4px 10px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.sl-hs-rail::-webkit-scrollbar { display: none; }

.sl-hs-bubble {
  flex: 0 0 auto;
  width: 72px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: center;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.sl-hs-ring {
  display: block;
  width: 66px;
  height: 66px;
  margin: 0 auto;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #7c3aed, #db2777, #facc15);
  transition: transform 0.18s ease;
}

.sl-hs-bubble:hover .sl-hs-ring,
.sl-hs-bubble:focus-visible .sl-hs-ring {
  transform: scale(1.05);
}

.sl-hs-bubble:focus-visible { outline: none; }

.sl-hs-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #141a2b;
  border: 2px solid #0b0f18;
}

.sl-hs-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sl-hs-initial {
  font-size: 22px;
  font-weight: 900;
  color: #c4b5fd;
}

.sl-hs-livedot {
  position: absolute;
  top: 2px;
  right: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #0b0f18;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  animation: sl-hs-pulse 1.6s infinite;
}

@keyframes sl-hs-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.sl-hs-name {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #c7d3ea;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Viewed bubbles fade the ring (client-side flag) */
.sl-hs-bubble.sl-hs-seen .sl-hs-ring {
  background: #33405e;
}

@media (max-width: 600px) {
  .sl-home-stories { margin: 2px 0 10px; }
  .sl-hs-bubble { width: 64px; }
  .sl-hs-ring { width: 58px; height: 58px; }
  .sl-hs-head h2 { font-size: 15px; }
}

/* ---------------- Full-screen viewer ---------------- */
#slHsViewer {
  position: fixed;
  inset: 0;
  z-index: 100050;
  background: rgba(3, 5, 10, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
}

#slHsViewer.sl-hs-open { display: flex; }

#slHsViewer .sl-hs-stage {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05070c;
  overflow: hidden;
}

@media (min-width: 620px) {
  #slHsViewer .sl-hs-stage {
    height: 88vh;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  }
}

#slHsViewer .sl-hs-media {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #05070c;
}

#slHsViewer .sl-hs-textcard {
  color: #fff;
  font-size: 18px;
  line-height: 1.5;
  padding: 32px;
  text-align: center;
  max-width: 360px;
}

#slHsViewer .sl-hs-lock {
  color: #fff;
  text-align: center;
  padding: 40px 28px;
}

#slHsViewer .sl-hs-lock i { font-size: 34px; color: #fbbf24; margin-bottom: 12px; }
#slHsViewer .sl-hs-lock h4 { margin: 0 0 6px; font-size: 17px; font-weight: 800; }
#slHsViewer .sl-hs-lock p { margin: 0 0 16px; color: #c7d3ea; font-size: 13px; }
#slHsViewer .sl-hs-lock a {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  color: #fff; text-decoration: none; font-weight: 800; font-size: 13px;
  padding: 11px 22px; border-radius: 999px;
}

/* Progress bars */
#slHsViewer .sl-hs-progress {
  position: absolute;
  top: 10px; left: 10px; right: 10px;
  display: flex; gap: 5px; z-index: 6;
}
#slHsViewer .sl-hs-pbar {
  flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.28); overflow: hidden;
}
#slHsViewer .sl-hs-pbar > i {
  display: block; height: 100%; width: 0; background: #fff; border-radius: 3px;
}
#slHsViewer .sl-hs-pbar.sl-done > i { width: 100%; }
#slHsViewer .sl-hs-pbar.sl-active > i { animation: sl-hs-fill linear forwards; }

@keyframes sl-hs-fill { from { width: 0; } to { width: 100%; } }

/* Header (avatar + name + close) */
#slHsViewer .sl-hs-vhead {
  position: absolute; top: 22px; left: 12px; right: 12px;
  display: flex; align-items: center; gap: 10px; z-index: 6; color: #fff;
}
#slHsViewer .sl-hs-vhead .av {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 15px;
}
#slHsViewer .sl-hs-vhead .nm { font-weight: 800; font-size: 14px; text-shadow: 0 1px 4px rgba(0,0,0,.6); flex: 1; min-width: 0; }
#slHsViewer .sl-hs-vhead .nm a { color: #fff; text-decoration: none; }
#slHsViewer .sl-hs-close {
  background: rgba(0, 0, 0, 0.45); color: #fff; border: 0;
  width: 38px; height: 38px; border-radius: 50%; font-size: 20px; cursor: pointer; flex: 0 0 auto;
}

/* Tap zones */
#slHsViewer .sl-hs-nav {
  position: absolute; top: 0; bottom: 0; width: 34%; z-index: 4; cursor: pointer; background: transparent; border: 0;
}
#slHsViewer .sl-hs-prev { left: 0; }
#slHsViewer .sl-hs-next { right: 0; }

#slHsViewer .sl-hs-cap {
  position: absolute; bottom: 22px; left: 16px; right: 16px; z-index: 6;
  color: #fff; font-size: 14px; text-shadow: 0 1px 5px rgba(0,0,0,.7);
}

@media (prefers-reduced-motion: reduce) {
  #slHsViewer .sl-hs-pbar.sl-active > i { animation: none; width: 100%; }
  .sl-hs-livedot { animation: none; }
}
