/* =========================================================================
   Vexlip Reels — pionowy kanał editów
   ========================================================================= */
.page-reels { background: #000; overflow: hidden; }
.page-reels::before { display: none; }
.reels-app {
  --top: var(--nav-h);
  position: fixed;
  inset: var(--top) 0 0 0;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) 90px;
  background: radial-gradient(ellipse at 50% 0%, #10121C, #000 70%);
}
.embed .reels-app { --top: 0px; }

/* ---------- lewa kolumna ---------- */
.reels-side { display: flex; flex-direction: column; gap: 22px; padding: 26px 22px; border-right: 1px solid rgba(255, 255, 255, .06); }
.reels-logo { display: flex; align-items: center; gap: 10px; font: 800 1.7rem var(--font-display); letter-spacing: -.03em; }
.reels-logo .icon { width: 30px; height: 30px; color: #B88CFF; }
.reels-tabs { display: flex; flex-direction: column; gap: 4px; }
.reels-tabs button { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 0; border-radius: 12px; background: transparent; color: var(--dim); font: 600 1rem var(--font); cursor: pointer; text-align: left; transition: background .2s, color .2s; }
.reels-tabs button .icon { width: 19px; height: 19px; }
.reels-tabs button:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.reels-tabs button[aria-selected="true"] { background: linear-gradient(135deg, rgba(0, 200, 255, .12), rgba(155, 61, 255, .16)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.reels-tabs button[aria-selected="true"] .icon { color: #FF8A4D; }
.reels-keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .82rem; color: var(--muted); }
.reels-keys kbd { margin-right: 4px; }
.reels-upload { margin-top: auto; align-self: flex-start; }

/* ---------- kanał ---------- */
.reels-feed {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  outline: none;
}
.reels-feed::-webkit-scrollbar { display: none; }
.reel {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}
.reel-bg { position: absolute; inset: -60px; z-index: -1; background: var(--tile) center / cover no-repeat; filter: blur(60px) saturate(1.3) brightness(.38); transform: scale(1.1); opacity: 0; transition: opacity .6s; }
.reel.is-active .reel-bg { opacity: 1; }
.reel-frame { display: flex; align-items: flex-end; gap: 16px; height: calc(100% - 36px); }
.reel-stage {
  position: relative;
  height: 100%;
  aspect-ratio: 9 / 16;
  max-width: calc(100vw - 32px);
  border-radius: 18px;
  overflow: hidden;
  background: #050507;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 40px 90px -30px rgba(0, 0, 0, .9);
  container-type: inline-size;
  transform: scale(.94);
  opacity: .5;
  transition: transform .5s var(--ease), opacity .5s;
}
.reel.is-active .reel-stage { transform: none; opacity: 1; }
.reel-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.reel-tap { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.reel-paused { position: absolute; left: 50%; top: 50%; z-index: 3; display: grid; place-items: center; width: 78px; height: 78px; border-radius: 50%; background: rgba(0, 0, 0, .45); backdrop-filter: blur(6px); transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); }
.reel-paused .icon { width: 34px; height: 34px; margin-left: 5px; }
.reel.is-paused .reel-paused { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.reel.is-error .reel-stage::after { content: "Nie można odtworzyć tego edita"; position: absolute; inset: auto 0 50% 0; text-align: center; color: var(--muted); font-size: .9rem; z-index: 1; }

/* informacje na dole */
.reel-info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 60px 16px 20px; background: linear-gradient(to top, rgba(0, 0, 0, .82), transparent); pointer-events: none; }
.reel-info a { pointer-events: auto; }
.reel-author { display: flex; align-items: center; gap: 10px; }
.reel-author .avatar { width: 36px; height: 36px; font-size: .8rem; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.reel-author b { font-size: 1rem; }
.reel-author-link { display: inline-flex; align-items: center; gap: 10px; min-width: 0; pointer-events: auto; color: #fff; }
.reel-author-link:hover b { text-decoration: underline; text-underline-offset: 3px; }
.reel-author-link .pro-badge { margin-left: -4px; }
.reel-kind { padding: 2px 8px; border-radius: 6px; font: 700 .66rem var(--mono); letter-spacing: .08em; background: rgba(255, 255, 255, .14); }
.reel-kind.is-edit { background: var(--grad); }
.reel-title { margin-top: 10px; font-size: .98rem; line-height: 1.4; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.reel-game { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; background: rgba(255, 255, 255, .12); backdrop-filter: blur(8px); font-size: .8rem; font-weight: 600; color: #fff; }
.reel-game .cover { width: 22px; height: 22px; aspect-ratio: auto; border-radius: 50%; }
.reel-game:hover { background: rgba(255, 255, 255, .2); }
.reel-sound { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .8rem; color: rgba(255, 255, 255, .8); overflow: hidden; white-space: nowrap; }
.reel-sound .icon { width: 14px; height: 14px; flex: none; }
.reel-sound .mq { flex: 1; min-width: 0; overflow: hidden; }
.reel-sound .mq span { display: inline-block; }
.reel.is-playing .reel-sound .mq span { animation: marquee 8s linear infinite; }
@keyframes marquee { from { transform: translateX(30%); } to { transform: translateX(-100%); } }

.reel-progress { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; height: 3px; background: rgba(255, 255, 255, .15); }
.reel-progress i { display: block; height: 100%; background: var(--grad); transform-origin: left; transform: scaleX(0); }

/* akcje po prawej */
.reel-actions { display: flex; flex-direction: column; gap: 14px; padding-bottom: 10px; }
.reel-act { display: flex; flex-direction: column; align-items: center; gap: 5px; border: 0; background: none; padding: 0; color: #fff; font: 600 .74rem var(--font); cursor: pointer; }
.reel-act.is-static { cursor: default; }
.reel-act-ic { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 255, 255, .1); backdrop-filter: blur(10px); transition: background .2s, transform .2s var(--ease); }
.reel-act-ic .icon { width: 23px; height: 23px; }
.reel-act:not(.is-static):hover .reel-act-ic { background: rgba(255, 255, 255, .2); transform: scale(1.06); }
.reel-like.is-liked .reel-act-ic { background: rgba(255, 77, 106, .2); color: #FF4D6A; }
.reel-like.is-liked .reel-act-ic svg { fill: currentColor; }
.reel-like.pop .reel-act-ic { animation: heartPop .45s var(--ease); }
.reel-mute.is-on .reel-act-ic { background: rgba(0, 200, 255, .2); color: #7FDBFF; }

/* serduszka po podwójnym kliknięciu */
.reel-burst { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.reel-burst i { position: absolute; width: 96px; height: 96px; margin: -48px 0 0 -48px; background: linear-gradient(135deg, #FF4D6A, #FF7AD0); clip-path: path("M48 86 10 48A21 21 0 0 1 48 18a21 21 0 0 1 38 30Z"); animation: burst .85s var(--ease) forwards; filter: drop-shadow(0 6px 20px rgba(255, 77, 106, .7)); }
@keyframes burst { 0% { transform: scale(.2) rotate(var(--rot)); opacity: 0; } 20% { transform: scale(1.15) rotate(var(--rot)); opacity: 1; } 45% { transform: scale(.95) rotate(var(--rot)); } 100% { transform: translateY(-120px) scale(1.3) rotate(var(--rot)); opacity: 0; } }

/* strzałki */
.reels-arrows { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; }
.reels-arrow { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .06); color: #fff; cursor: pointer; transition: background .2s; }
.reels-arrow:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.reels-arrow:disabled { opacity: .3; cursor: default; }
.reels-arrow .icon { width: 22px; height: 22px; transform: rotate(90deg); }

/* ---------- mniejsze ekrany ---------- */
@media (max-width: 1100px) {
  .reels-app { grid-template-columns: minmax(0, 1fr) 70px; }
  /* z lewej kolumny zostają tylko zakładki — jako pływający przełącznik nad kanałem */
  .reels-side { position: absolute; top: 12px; left: 0; right: 70px; z-index: 7; display: flex; flex-direction: row; align-items: flex-start; justify-content: center; padding: 0; border: 0; pointer-events: none; }
  .reels-side > :not(.reels-tabs) { display: none; }
  .reels-tabs { flex-direction: row; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, .45); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); pointer-events: auto; }
  .reels-tabs button { min-height: 40px; padding: 8px 16px; border-radius: 999px; font-size: .92rem; }
  .reels-tabs button .icon { width: 17px; height: 17px; }
}
@media (max-width: 760px) {
  /* telefon: kanał na cały ekran, pasek strony leży półprzezroczyście nad filmem */
  .reels-app { --top: 0px; grid-template-columns: 1fr; }
  .page-reels .site-nav { background: linear-gradient(to bottom, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0)); }
  .page-reels .site-nav::before { opacity: 0; }
  .nav-open .page-reels .site-nav::before { opacity: 1; }
  .reels-side { top: calc(var(--nav-h) + 2px); right: 0; }
  .reels-arrows { display: none; }
  .reel-bg { display: none; } /* rozmyte tło i tak jest zasłonięte przez film */
  .reel-frame { position: relative; height: 100%; width: 100%; }
  .reel-stage { width: 100%; height: 100%; max-width: none; aspect-ratio: auto; border-radius: 0; transform: none; opacity: 1; box-shadow: none; }
  .reel.is-portrait .reel-video { object-fit: cover; }
  .reel-actions { position: absolute; right: 8px; bottom: calc(118px + env(safe-area-inset-bottom, 0px)); z-index: 6; gap: 12px; }
  .reel-act { min-width: 52px; text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
  .reel-info { padding: 60px 84px calc(18px + env(safe-area-inset-bottom, 0px)) 16px; }
  /* bez backdrop-filter nad odtwarzanym filmem (rozmycie liczone przy każdej klatce wideo) */
  .reel-act-ic, .reel-game, .reel-paused { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .reel-act-ic { background: rgba(22, 24, 32, .62); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
  .reel-game { background: rgba(22, 24, 32, .62); min-height: 36px; }
  .reel-paused { background: rgba(0, 0, 0, .55); }
  .reels-empty { padding-top: calc(var(--nav-h) + 60px); }
}
.reels-empty { height: 100%; display: grid; place-items: center; padding: 24px; }
.reels-empty .state-block { max-width: 520px; }
