.join-story-reel {
  --bg: #fff;
  --ink: #0b3a6f;
  --wrap: min(1100px, calc(100% - 64px));
  --gap: clamp(16px, 2vw, 26px);
  --radius: 18px;

  background: var(--bg);
  padding: clamp(34px, 5vw, 72px) 0;
  position: relative;
}

.jsr-wrap {
  width: var(--wrap);
  margin: 0 auto;
}

.jsr-title {
  margin: 0 0 clamp(18px, 3vw, 34px) 0;
  text-align: center;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--ink);
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1.1;
}

.jsr-reel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  justify-items: center;
}

.jsr-reel.is-swiper {
  display: block;
  position: relative;
}

.jsr-viewport {
  overflow: hidden;
}

.jsr-track {
  display: flex;
  gap: var(--gap);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.jsr-track .jsr-card {
  flex: 0 0 calc(33.333% - (var(--gap) * 2 / 3));
  max-width: none;
}

.jsr-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, opacity 0.15s, transform 0.15s;
  color: #1a1a1a;
}

.jsr-nav:hover {
  background: #f1f5f9;
}

.jsr-nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.jsr-prev {
  left: 12px;
}

.jsr-next {
  right: 12px;
}

.jsr-nav svg {
  width: 18px;
  height: 18px;
}

.jsr-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 22px;
}

.jsr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.jsr-dot.is-active {
  background: var(--ink);
  transform: scale(1.25);
}

.jsr-card {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.12);
  background: #000;
  transition: transform 0.18s ease;
}

.jsr-card__hit {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: block;
  position: relative;
  border-radius: inherit;
  overflow: hidden;
}

.jsr-card__hit:focus-visible,
.jsr-sound:focus-visible,
.jsr-modal__close:focus-visible,
.jsr-modal__sound:focus-visible,
.jsr-nav:focus-visible,
.jsr-dot:focus-visible {
  outline: 2px solid rgba(11, 58, 111, 0.55);
  outline-offset: 3px;
}

.jsr-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 50%;
}

.jsr-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.jsr-play::before {
  content: "";
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.jsr-play::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-left: 14px solid rgba(20, 23, 26, 0.9);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  transform: translateX(2px);
}

.jsr-sound,
.jsr-modal__sound {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(18, 24, 38, 0.62);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s ease, transform 0.2s ease;
}

.jsr-sound:hover,
.jsr-modal__sound:hover {
  background: rgba(18, 24, 38, 0.78);
  transform: translateY(-1px);
}

.jsr-sound svg,
.jsr-modal__sound svg {
  width: 18px;
  height: 18px;
}

.jsr-sound__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.jsr-sound__icon--unmuted {
  display: none;
}

.jsr-sound.is-active .jsr-sound__icon--muted,
.jsr-modal__sound.is-active .jsr-sound__icon--muted {
  display: none;
}

.jsr-sound.is-active .jsr-sound__icon--unmuted,
.jsr-modal__sound.is-active .jsr-sound__icon--unmuted {
  display: inline-flex;
}

@media (hover: hover) {
  .jsr-card:hover {
    transform: translateY(-2px);
  }
}

.jsr-join-mount {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .join-story-reel {
    --wrap: min(100%, calc(100% - 32px));
  }

  .jsr-reel:not(.is-swiper) {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 12px;
  }

  .jsr-reel:not(.is-swiper) .jsr-card {
    flex: 0 0 78%;
    max-width: none;
    scroll-snap-align: center;
  }

  .jsr-reel:not(.is-swiper)::-webkit-scrollbar {
    display: none;
  }

  .jsr-reel.is-swiper .jsr-track .jsr-card {
    flex: 0 0 100%;
  }

  .jsr-nav {
    width: 40px;
    height: 40px;
  }

  .jsr-prev {
    left: 8px;
  }

  .jsr-next {
    right: 8px;
  }

  .jsr-sound,
  .jsr-modal__sound {
    right: 10px;
    bottom: 10px;
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 980px) and (min-width: 641px) {
  .jsr-reel:not(.is-swiper) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .jsr-reel:not(.is-swiper) .jsr-card {
    max-width: 360px;
  }

  .jsr-reel.is-swiper .jsr-track .jsr-card {
    flex: 0 0 calc(50% - var(--gap) / 2);
  }
}

.jsr-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 2.4vw, 28px);
}

.jsr-modal.is-open {
  display: flex;
}

.jsr-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 22, 0.52);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.jsr-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(430px, calc(100vw - 32px));
  height: min(calc(100dvh - 32px), 760px);
  max-height: calc(100dvh - 32px);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(6, 12, 24, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: stretch;
}

.jsr-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

.jsr-modal__media {
  width: 100%;
  height: 100%;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jsr-modal__video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

body.jsr-lock {
  overflow: hidden;
  overscroll-behavior: contain;
}

@media (max-width: 640px) {
  .jsr-modal {
    padding: 8px;
    align-items: stretch;
  }

  .jsr-modal__dialog {
    width: 100%;
    height: min(calc(100dvh - 16px), 100%);
    max-height: calc(100dvh - 16px);
    border-radius: 20px;
  }

  .jsr-modal__close {
    top: 10px;
    right: 10px;
  }

  .jsr-modal__sound {
    right: 10px;
    bottom: 10px;
  }
}
