/* Экспериментальная лента в стиле Reels: полноэкранные вертикальные видео */

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #000;
  overscroll-behavior: none;
}

body.feed-page {
  font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

/* ---------- прокручиваемая лента ---------- */

.feed {
  height: 100vh;
  height: 100dvh;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.feed::-webkit-scrollbar { display: none; }

/* на десктопе — колонка как в веб-версии инстаграма */
@media (min-width: 700px) {
  .feed {
    max-width: 460px;
    margin: 0 auto;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }
}

.reel {
  position: relative;
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.reel__poster {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(18px) brightness(0.35);
  transform: scale(1.1);
  transition: opacity 0.4s ease;
}

.reel.is-active .reel__poster { opacity: 0; }

.reel__frame {
  position: relative;
  height: 100%;
  aspect-ratio: 9 / 16;
  background: #000;
  flex: none;
}

.reel__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- интерфейс поверх видео ---------- */

.reel__ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.reel__ui a,
.reel__ui button {
  pointer-events: auto;
}

/* верхняя панель */

.reel__top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 16px 22px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.reel__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  transition: background 0.2s ease;
}

.reel__back:hover { background: rgba(255, 255, 255, 0.22); }

.reel__back svg { width: 18px; height: 18px; }

.reel__label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.reel__counter {
  margin-left: auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* правая колонка кнопок */

.reel__rail {
  position: absolute;
  right: 10px;
  bottom: max(96px, calc(env(safe-area-inset-bottom) + 96px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.rail__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 46px;
  border: 0;
  padding: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.rail__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease, background 0.2s ease;
}

.rail__icon svg { width: 24px; height: 24px; fill: #fff; }

.rail__btn:active .rail__icon { transform: scale(0.9); }

.rail__btn:hover .rail__icon { background: rgba(0, 0, 0, 0.5); }

.rail__btn.is-liked .rail__icon svg { fill: #ff2d55; }

.rail__count {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
}

/* нижний текст */

.reel__bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 110px 84px max(28px, calc(env(safe-area-inset-bottom) + 20px)) 16px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0) 100%);
}

.reel__author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.reel__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #1c1c1e url('assets/Group_16.png') center / 80% no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex: none;
}

.reel__caption {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 4px;
}

.reel__meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.02em;
}

/* ---------- подсказка и сердце ---------- */

.feed-hint {
  position: fixed;
  left: 50%;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 24px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  z-index: 10;
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.feed-hint.is-hidden { opacity: 0; }

.feed-hint svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  animation: hint-bounce 1.6s ease-in-out infinite;
}

@keyframes hint-bounce {
  0%, 100% { transform: translateY(-2px); }
  50% { transform: translateY(3px); }
}

.burst {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 90px;
  height: 90px;
  margin: -45px 0 0 -45px;
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}

.burst svg { width: 100%; height: 100%; fill: #fff; }

.burst.is-on {
  animation: burst 0.9s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

@keyframes burst {
  0% { opacity: 0; transform: scale(0.3); }
  25% { opacity: 1; transform: scale(1.1); }
  55% { opacity: 1; transform: scale(0.98); }
  100% { opacity: 0; transform: scale(1.15); }
}

/* ---------- прогресс-полоса ---------- */

.feed-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 20;
}

.feed-progress__bar {
  height: 100%;
  width: 0;
  background: #fff;
  transition: width 0.2s ease;
}

@media (min-width: 700px) {
  .feed-progress {
    max-width: 460px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* кнопка «включить звук» */
.sound-hint {
  position: fixed;
  top: max(64px, calc(env(safe-area-inset-top) + 56px));
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  z-index: 15;
  opacity: 1;
  transition: opacity 0.4s ease, transform 0.2s ease;
}

.sound-hint svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.sound-hint:hover { background: rgba(0, 0, 0, 0.72); }
.sound-hint:active { transform: translateX(-50%) scale(0.97); }

.sound-hint.is-hidden {
  opacity: 0;
  pointer-events: none;
}

@media (min-width: 700px) {
  .sound-hint { top: 64px; }
}
