.story-strip {
  margin: 0 0 4px;
  min-width: 0;
}

.story-strip__scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.story-strip__scroll::-webkit-scrollbar {
  display: none;
}

.story-item {
  flex: 0 0 auto;
  width: 72px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text, #fff);
  cursor: pointer;
  scroll-snap-align: start;
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.story-item__ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #9c59ff 0%, #27cf62 45%, #ff6b9d 100%);
  display: grid;
  place-items: center;
  transition: transform .18s ease, box-shadow .18s ease;
}

.story-item.is-viewed .story-item__ring {
  background: rgba(255, 255, 255, .22);
}

.story-item:hover .story-item__ring,
.story-item:focus-visible .story-item__ring {
  transform: scale(1.04);
  box-shadow: 0 10px 24px rgba(140, 82, 255, .28);
}

.story-item:focus-visible {
  outline: 2px solid rgba(157, 92, 255, .65);
  outline-offset: 4px;
  border-radius: 12px;
}

.story-item__thumb {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(20, 16, 63, .95);
  display: grid;
  place-items: center;
  font-size: 26px;
  line-height: 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .22), transparent 55%),
    linear-gradient(145deg, rgba(72, 44, 168, .95), rgba(34, 22, 92, .98));
}

.story-item__thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-item.has-thumb-image .story-item__thumb {
  font-size: 0;
}

.story-item__thumb--bonus { background-color: #5b33bf; background-image: radial-gradient(circle at 30% 20%, rgba(255,255,255,.24), transparent 55%), linear-gradient(145deg, #7a45ff, #3d2499); }
.story-item__thumb--live { background-color: #0f6b3a; background-image: radial-gradient(circle at 30% 20%, rgba(255,255,255,.24), transparent 55%), linear-gradient(145deg, #27cf62, #12803f); }
.story-item__thumb--casino { background-color: #6b2fd4; background-image: radial-gradient(circle at 30% 20%, rgba(255,255,255,.24), transparent 55%), linear-gradient(145deg, #a855ff, #5b21b6); }
.story-item__thumb--vip { background-color: #8a6200; background-image: radial-gradient(circle at 30% 20%, rgba(255,255,255,.24), transparent 55%), linear-gradient(145deg, #f5c542, #b8860b); }
.story-item__thumb--sport { background-color: #1a4f9c; background-image: radial-gradient(circle at 30% 20%, rgba(255,255,255,.24), transparent 55%), linear-gradient(145deg, #3b82f6, #1e40af); }
.story-item__thumb--promo { background-color: #9f1239; background-image: radial-gradient(circle at 30% 20%, rgba(255,255,255,.24), transparent 55%), linear-gradient(145deg, #fb7185, #be123c); }

.story-item__label {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: #ddd6f7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}

.story-viewer.is-open {
  display: flex;
}

.story-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 5, 24, .88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.story-viewer__frame {
  position: relative;
  width: min(100%, 420px);
  height: min(86vh, 760px);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
  background: #120c36;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.story-viewer__progress {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  gap: 4px;
}

.story-viewer__bar {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .28);
  overflow: hidden;
}

.story-viewer__bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: inherit;
  transition: width linear;
}

.story-viewer__bar.is-done .story-viewer__bar-fill {
  width: 100%;
}

.story-viewer__bar.is-active .story-viewer__bar-fill {
  width: 100%;
}

.story-viewer__head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 28px 14px 10px;
}

.story-viewer__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.story-viewer__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  border: 2px solid rgba(255, 255, 255, .25);
  flex-shrink: 0;
  overflow: hidden;
}

.story-viewer__avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-viewer__title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-viewer__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.story-viewer__close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
}

.story-viewer__slides {
  position: relative;
  min-height: 0;
}

.story-viewer__slide {
  position: absolute;
  inset: 0;
  padding: 8px 18px 18px;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  background:
    radial-gradient(circle at 80% 10%, rgba(157, 92, 255, .35), transparent 40%),
    linear-gradient(180deg, rgba(18, 12, 54, .15) 0%, rgba(18, 12, 54, .92) 72%);
  background-size: cover;
  background-position: center;
}

.story-viewer__slide.has-image {
  justify-content: flex-end;
}

.story-viewer__slide-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.story-viewer__slide.is-active {
  display: flex;
}

.story-viewer__slide h3 {
  margin: 0;
  font-size: clamp(22px, 5vw, 28px);
  line-height: 1.25;
}

.story-viewer__slide p {
  margin: 0;
  color: #ddd6f7;
  font-size: 15px;
  line-height: 1.55;
  max-width: 34ch;
}

.story-viewer__cta {
  align-self: flex-start;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b52ff, #9d5cff);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.story-viewer__nav {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 38% 62%;
}

.story-viewer__tap {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.story-viewer__foot,
.story-viewer__counter {
  display: none !important;
}

@media (max-width: 899px) {
  .story-strip { margin-bottom: 2px; }
  .story-strip__scroll { gap: 12px; padding-bottom: 8px; }
  .story-item { width: 64px; }
  .story-item__ring { width: 62px; height: 62px; }
  .story-item__thumb { font-size: 22px; }
  .story-item__label { font-size: 10px; }
}

@media (min-width: 900px) {
  .story-strip__scroll { gap: 18px; padding-bottom: 12px; }
  .story-item { width: 78px; }
  .story-item__ring { width: 74px; height: 74px; }
}

.story-strip.hidden { display: none; }
