.tizers-icon-carousel {

  & .swiper-slide {
    width: 132px;
  }

  & .swiper-wrapper {
    height: auto;
    width: fit-content;
  }
}

.tizers-icon-carousel-item--openable {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
  appearance: none;
}

.tizers-story-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  box-sizing: border-box;

  &.is-open {
    display: flex;
  }
}

.tizers-story-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 14, 20, 0.65);
  backdrop-filter: blur(14px);
}

.tizers-story-modal__shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: calc(min(400px, 88vw) + 100px);
  margin: 0 auto;
  pointer-events: none;
}

.tizers-story-modal__shell > * {
  pointer-events: auto;
}

.tizers-story-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(380px, 86vw);
  flex: 0 0 auto;
  max-height: min(92dvh, 860px);
  max-height: min(92vh, 860px);
  min-height: 0;
  margin: 0 auto;
  background: #101014;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 28px 100px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(255, 255, 255, 0.07);
}

.tizers-story-modal__progress {
  display: flex;
  gap: 5px;
  padding: 12px 14px 0;
  flex-shrink: 0;
  box-sizing: border-box;
}

.tizers-story-modal__progress[hidden] {
  display: none !important;
}

.tizers-story-modal__progress-seg {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.tizers-story-modal__progress-seg span {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
  border-radius: 2px;
  transition: width 0.2s ease;
}

.tizers-story-modal__progress-seg.is-past span,
.tizers-story-modal__progress-seg.is-active span {
  width: 100%;
}

.tizers-story-modal__top {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 12px 16px;
  flex-shrink: 0;
}

.tizers-story-modal__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;

  &.tizers-story-modal__avatar--hidden {
    display: none;
  }
}

.tizers-story-modal__title {
  flex: 1;
  margin: 0;
  min-width: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.tizers-story-modal__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: -6px -6px -6px 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  appearance: none;
  transition: background 0.15s ease;
}

.tizers-story-modal__close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.tizers-story-modal__stage {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: 9 / 16;
  max-height: min(72dvh, calc(min(380px, 86vw) * 16 / 9));
  max-height: min(72vh, calc(min(380px, 86vw) * 16 / 9));
}

.tizers-story-modal__swiper {
  height: 100%;
  width: 100%;
}

.tizers-story-modal__swiper .swiper-wrapper {
  height: 100%;
}

.tizers-story-modal__swiper .swiper-slide {
  position: relative;
  height: 100%;
  display: flex;
}

.tizers-story-modal__swiper .swiper-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  pointer-events: none;
  z-index: 0;
}

.tizers-story-modal__slide-img {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.tizers-story-modal__slide-video {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: block;
  box-sizing: border-box;
  pointer-events: auto;
}

/* Kinescope и прочие embed: заполняем слайд (в т.ч. .t-iframe с width/height 100%) */
.tizers-story-modal__slide-video iframe,
.tizers-story-modal__slide-video video {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  display: block;
  max-width: 100%;
}

.tizers-story-modal__nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(230, 231, 237, 0.5);
  color: #3d3e4c;
  cursor: pointer;
  appearance: none;
  transition: background 0.15s ease, color 0.15s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
  align-self: center;
}

.tizers-story-modal__nav:hover {
  background: rgba(244, 244, 246, 0.85);
  color: #252630;
}

.tizers-story-modal--single .tizers-story-modal__nav {
  display: none;
}

.tizers-story-modal__caption-wrap[hidden] {
  display: none !important;
}

.tizers-story-modal__caption-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  transform: translate(-50%, -50%);
  max-width: min(300px, 84%);
  padding: 22px 26px 24px;
  box-sizing: border-box;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 28, 36, 0.58);
  backdrop-filter: blur(18px) saturate(1.15);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  pointer-events: none;
  max-height: min(58vh, 320px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tizers-story-modal__caption {
  margin: 0;
  color: #fff;
  text-align: center;
  white-space: pre-line;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

@media (max-width: 520px) {
  .tizers-story-modal {
    padding: 12px 8px;
  }

  .tizers-story-modal__shell {
    gap: 6px;
    max-width: 100%;
  }

  .tizers-story-modal__panel {
    width: min(360px, calc(100vw - 88px));
    border-radius: 20px;
  }

  .tizers-story-modal__stage {
    max-height: min(68dvh, calc(min(360px, calc(100vw - 88px)) * 16 / 9));
    max-height: min(68vh, calc(min(360px, calc(100vw - 88px)) * 16 / 9));
  }

  .tizers-story-modal__nav {
    width: 36px;
    height: 36px;
  }

  .tizers-story-modal__caption-wrap {
    max-width: 88%;
    padding: 18px 20px 20px;
    max-height: min(52vh, 280px);
  }

  .tizers-story-modal__caption {
    font-size: 13px;
    line-height: 1.55;
  }
}

@media (max-width: 380px) {
  .tizers-story-modal__shell {
    gap: 4px;
  }

  .tizers-story-modal__panel {
    width: calc(100vw - 76px);
  }
}
