

.reels-history .reel {
  border: 5px solid #236b68;
}

.reels-history .reel-link {
  background: #237d78;
}
.reels-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.reels-carousel {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  column-gap: 12px;
  width: 100%;
  max-width: 100%;
}

/* Центральная область со строкой рилсов */
.reels-history-row {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-auto-flow: column;

  /* Показываем 5 полностью помещающихся рилсов */
 grid-auto-columns: calc((100% - 64px) / 5);

  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 12px;
  box-sizing: border-box;

  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.reels-history-row::-webkit-scrollbar {
  display: none;
}

/* Каждый рилс полностью помещается в свою колонку */
.reels-history-row .reel-card {
  min-width: 0;
  width: 100%;
  scroll-snap-align: start;
}

/* Стрелки находятся за пределами рилсов */
.reels-arrow {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;
  padding: 0;

  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #237d78;

  font-size: 27px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;

  transition:
    background 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.reels-arrow:hover {
  background: #185c59;
  transform: scale(1.08);
}

.reels-arrow:active {
  transform: scale(0.95);
}

.reels-arrow:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

/* Чтобы видео не вылезало за пределы карточки */
.reels-history-row .reel {
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 18px;
}

.reels-history-row video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Планшет: 2 полностью видимых рилса */
@media (max-width: 800px) {
  .reels-carousel {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    column-gap: 8px;
  }

  .reels-history-row {
    grid-auto-columns: calc((100% - 16px) / 2);
    gap: 16px;
  }

  .reels-arrow {
    width: 38px;
    height: 38px;
    font-size: 23px;
  }
}

/* Телефон: 1 полностью видимый рилс */
@media (max-width: 520px) {
  .reels-carousel {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    column-gap: 5px;
  }

  .reels-history-row {
    grid-auto-columns: 100%;
    gap: 12px;
  }

  .reels-arrow {
    width: 34px;
    height: 34px;
    font-size: 20px; 
  }
}