/* Рилс2 — отдельный блок и плеер (не legacy reel-viewer). */

.feed-chrome .reels2-block {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0 max(clamp(14px, 4vw, 36px), var(--safe-right)) 12px max(clamp(14px, 4vw, 36px), var(--safe-left));
  isolation: isolate;
}

.feed-chrome .reels2-block::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.reels2-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.reels2-title {
  font-size: 13px;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.reels2-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.reels2-rail::-webkit-scrollbar {
  display: none;
}

.reels2-add {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px dashed rgba(17, 17, 17, 0.22);
  border-radius: 14px;
  background: var(--soft);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.reels2-add:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.reels2-add__plus {
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}

.reels2-tile {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #111;
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.reels2-tile:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.reels2-tile__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.reels2-tile__badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

/* Плеер: медиа от физического верхнего края, без отступа. */
.reels2-player {
  position: fixed;
  z-index: 96;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  color: #fff;
  overflow: hidden;
  touch-action: none;
}

.reels2-player[hidden] {
  display: none !important;
}

.reels2-player.is-open {
  display: block;
}

.reels2-player__stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
}

.reels2-player__media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  object-fit: cover;
  object-position: center center;
  background: #000;
  display: block;
}

.reels2-player__close {
  position: absolute;
  top: max(10px, env(safe-area-inset-top, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  z-index: 4;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.reels2-player__tap {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 34%;
}

.reels2-player__tap--prev {
  left: 0;
}

.reels2-player__tap--next {
  right: 0;
}

.reels2-player__meta {
  position: absolute;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  left: max(12px, env(safe-area-inset-left, 0px));
  z-index: 4;
  display: grid;
  gap: 4px;
  pointer-events: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}

.reels2-player__meta strong {
  font-size: 15px;
  font-weight: 760;
}

.reels2-player__meta span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
}

body.reels2-player-open {
  overflow: hidden;
  touch-action: none;
  color-scheme: dark;
}

body.reels2-player-open::before {
  display: none;
}

@supports (-webkit-touch-callout: none) {
  .reels2-player__stage {
    min-height: -webkit-fill-available;
  }
}
