/* ============================================================
   Reels feature — stories bar + full-screen viewer + upload modal
   Reuses --bg/--elev/--muted/--text/--accent/--danger/--radius
   already defined in live-modern.css so it matches the rest of
   the (YouTube-dark-theme-adjacent) site instead of introducing
   a second palette.
   ============================================================ */

:root{
  /* Story-ring gradient — same three-stop idea Instagram/TikTok use so an
     "unseen" ring reads instantly, without borrowing their exact hues. */
  --lz-ring: conic-gradient(from 220deg, #ff5f7e, #ff9a44, #a06bff, #3ea6ff, #ff5f7e);
  --lz-ring-seen: #3a3a3a;
}

/* ── Stories bar ─────────────────────────────────────────────── */
.lz-stories{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:12px 4px 14px;
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
.lz-stories::-webkit-scrollbar{ display:none; }

.lz-story{
  flex:0 0 auto;
  width:66px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  cursor:pointer;
  background:none;
  border:0;
  padding:0;
  font:inherit;
  color:var(--text,#e6e6e6);
}
.lz-story-ring{
  width:60px; height:60px;
  border-radius:50%;
  padding:2.5px;
  background:var(--lz-ring-seen);
  display:flex; align-items:center; justify-content:center;
  transition:transform .12s ease;
}
.lz-story.unseen .lz-story-ring{ background:var(--lz-ring); }
.lz-story:active .lz-story-ring{ transform:scale(.94); }
.lz-story-ring img{
  width:100%; height:100%;
  border-radius:50%;
  object-fit:cover;
  display:block;
  background:var(--elev,#171717);
  border:2px solid var(--bg,#0f0f0f);
}
.lz-story-label{
  font-size:11px;
  max-width:66px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color:var(--muted,#a1a1a1);
}
.lz-story.mine .lz-story-ring{ background:var(--lz-ring-seen); position:relative; }
.lz-story.mine .lz-story-plus{
  position:absolute;
  right:-2px; bottom:-2px;
  width:20px; height:20px;
  border-radius:50%;
  background:var(--accent,#3ea6ff);
  color:#06131f;
  display:flex; align-items:center; justify-content:center;
  font-size:14px; font-weight:800;
  border:2px solid var(--bg,#0f0f0f);
}
.lz-story-ring{ position:relative; }

.lz-stories-skeleton .lz-story-ring{ background:var(--elev,#171717); animation:lzPulse 1.2s ease-in-out infinite; }
@keyframes lzPulse{ 0%,100%{opacity:.5} 50%{opacity:1} }

/* Guest teaser — shown instead of the real rail when logged out */
.lz-story-ring-locked{
  background:rgba(255,255,255,.06);
  border:1.5px dashed rgba(255,255,255,.22);
}
.lz-story-lock{ font-size:20px; opacity:.7; }
.lz-story-locked .lz-story-label{ color:var(--text,#e6e6e6); font-weight:600; }

/* ── Full-screen viewer ──────────────────────────────────────── */
.lz-reel-viewer{
  position:fixed; inset:0;
  z-index:2147483000;
  background:#000;
  display:none;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
.lz-reel-viewer.open{ display:flex; }

.lz-reel-track{
  position:relative;
  width:100%; height:100%;
  max-width:480px;
  margin:0 auto;
  overflow:hidden;
}
@media (min-width:769px){
  .lz-reel-track{ max-width:420px; height:min(860px, 92vh); border-radius:18px; overflow:hidden; box-shadow:0 20px 60px rgba(0,0,0,.6); }
}

.lz-reel-slide{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  background:#000;
  transform:translateY(100%);
  transition:transform .28s cubic-bezier(.2,.7,.3,1);
}
.lz-reel-slide.active{ transform:translateY(0); }
.lz-reel-slide.prev{ transform:translateY(-100%); }

.lz-reel-slide video,
.lz-reel-slide img.lz-reel-media{
  width:100%; height:100%;
  object-fit:cover;
  background:#000;
}

.lz-reel-gradient-top,
.lz-reel-gradient-bottom{
  position:absolute; left:0; right:0;
  pointer-events:none;
}
.lz-reel-gradient-top{ top:0; height:120px; background:linear-gradient(#000a, transparent); }
.lz-reel-gradient-bottom{ bottom:0; height:220px; background:linear-gradient(transparent, #000c 70%); }

.lz-reel-close{
  position:absolute; top:14px; left:14px; z-index:5;
  width:34px; height:34px; border-radius:50%;
  background:rgba(0,0,0,.4); color:#fff; border:0;
  font-size:16px; display:flex; align-items:center; justify-content:center;
}

.lz-reel-sponsored{
  position:absolute; top:16px; left:56px; z-index:5;
  font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  color:#fff; background:rgba(255,255,255,.14); padding:3px 9px; border-radius:999px;
}

.lz-reel-meta{
  position:absolute; left:14px; right:76px; bottom:20px; z-index:4;
  color:#fff;
}
.lz-reel-meta .handle{ font-weight:700; font-size:14px; display:flex; align-items:center; gap:6px; }
.lz-reel-meta .caption{ font-size:13px; opacity:.9; margin-top:4px; max-height:3.6em; overflow:hidden; }
.lz-reel-meta .cta{
  margin-top:10px; display:inline-flex; align-items:center; gap:6px;
  background:#fff; color:#0f0f0f; font-weight:700; font-size:12.5px;
  padding:7px 14px; border-radius:999px;
}

.lz-reel-actions{
  position:absolute; right:10px; bottom:24px; z-index:4;
  display:flex; flex-direction:column; align-items:center; gap:18px;
}
.lz-reel-action{
  display:flex; flex-direction:column; align-items:center; gap:4px;
  background:none; border:0; color:#fff; font-size:26px;
  filter:drop-shadow(0 1px 3px rgba(0,0,0,.5));
}
.lz-reel-action .n{ font-size:11px; font-weight:600; color:#fff; }
.lz-reel-action.liked{ color:#ff4f6d; }
.lz-reel-action:active{ transform:scale(.9); }

.lz-reel-progress{
  position:absolute; top:8px; left:14px; right:14px; z-index:5;
  display:flex; gap:4px;
}
.lz-reel-progress i{
  flex:1; height:2.5px; border-radius:2px; background:rgba(255,255,255,.3); overflow:hidden; display:block;
}
.lz-reel-progress i b{ display:block; height:100%; width:0%; background:#fff; }
.lz-reel-progress i.done b{ width:100%; }

.lz-reel-tapzones{ position:absolute; inset:0; display:flex; z-index:3; }
.lz-reel-tapzones .lz-tap-prev,
.lz-reel-tapzones .lz-tap-next{ flex:1; }

.lz-reel-play-overlay{
  position:absolute; inset:0; z-index:3;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.lz-reel-play-icon{
  width:64px; height:64px; border-radius:50%;
  background:rgba(0,0,0,.45); backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px);
  display:flex; align-items:center; justify-content:center;
  font-size:26px; color:#fff;
  opacity:0; transform:scale(.8);
  transition:opacity .18s ease, transform .18s ease;
  pointer-events:none;
}
.lz-reel-play-icon.show{ opacity:1; transform:scale(1); }

.lz-reel-mute-btn{
  position:absolute; top:14px; right:14px; z-index:5;
  width:34px; height:34px; border-radius:50%;
  background:rgba(0,0,0,.4); color:#fff; border:0;
  font-size:15px; display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}

/* ── Upload flow: action sheet → camera → edit ──────────────────
   Mobile: full-width bottom sheet, app-like slide-up.
   Desktop (≥769px): centered floating modal. */
.lz-reel-upload{
  position:fixed; inset:0; z-index:2147483100;
  background:rgba(0,0,0,.7);
  display:none; align-items:flex-end; justify-content:center;
  backdrop-filter:blur(2px);
}
.lz-reel-upload.open{ display:flex; }
.lz-reel-upload-sheet{
  position:relative;
  width:100%; max-width:460px;
  max-height:92vh;
  background:var(--elev,#171717);
  border-radius:20px 20px 0 0;
  color:var(--text,#e6e6e6);
  overflow:hidden;
  animation:lzSheetUp .26s cubic-bezier(.2,.7,.3,1);
  padding-bottom:env(safe-area-inset-bottom,0);
}
@keyframes lzSheetUp{ from{ transform:translateY(24px); opacity:0; } to{ transform:translateY(0); opacity:1; } }
@media (min-width:769px){
  .lz-reel-upload{ align-items:center; }
  .lz-reel-upload-sheet{ border-radius:18px; max-height:88vh; box-shadow:0 25px 80px rgba(0,0,0,.55); }
}

.lz-reel-step{ display:none; padding:18px 20px 20px; }
.lz-reel-step.active{ display:block; }

/* Chooser */
.lz-reel-sheet-handle{ width:36px; height:4px; border-radius:2px; background:rgba(255,255,255,.2); margin:0 auto 14px; }
@media (min-width:769px){ .lz-reel-sheet-handle{ display:none; } }
.lz-reel-step-choose h3{ margin:0 0 4px; font-size:17px; }
.lz-reel-step-choose p.sub{ margin:0 0 18px; font-size:12.5px; color:var(--muted,#a1a1a1); }
.lz-reel-choice{
  width:100%; display:flex; align-items:center; gap:14px;
  background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.08);
  border-radius:14px; padding:14px; margin-bottom:10px; cursor:pointer;
  color:var(--text,#e6e6e6); text-align:left; font:inherit;
  transition:background .15s ease, transform .1s ease;
}
.lz-reel-choice:active{ transform:scale(.98); background:rgba(255,255,255,.08); }
.lz-reel-choice-icon{
  flex:0 0 auto; width:42px; height:42px; border-radius:50%;
  background:var(--accent,#3ea6ff); color:#06131f;
  display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:800;
}
.lz-reel-choice-icon-rec{ background:#ff4f6d; position:relative; }
.lz-reel-choice-icon-rec::after{ content:''; width:14px; height:14px; border-radius:50%; background:#fff; }
.lz-reel-choice-text{ display:flex; flex-direction:column; gap:2px; }
.lz-reel-choice-text b{ font-size:14px; }
.lz-reel-choice-text small{ font-size:12px; color:var(--muted,#a1a1a1); }
.lz-reel-sheet-cancel{ width:100%; padding:11px 0; margin-top:6px; border-radius:999px; border:0; font-weight:700; font-size:13px; background:rgba(255,255,255,.08); color:var(--text,#e6e6e6); cursor:pointer; }

/* Camera step */
.lz-reel-step-camera{ padding:0; position:relative; background:#000; height:min(78vh,640px); }
@media (min-width:769px){ .lz-reel-step-camera{ height:min(72vh,600px); } }
.lz-reel-camera-preview{ width:100%; height:100%; object-fit:cover; display:block; background:#000; transform:scaleX(-1); }
.lz-reel-camera-topbar{
  position:absolute; top:0; left:0; right:0; z-index:2;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 14px 0;
}
.lz-reel-cam-back, .lz-reel-cam-flip{
  width:36px; height:36px; border-radius:50%; border:0; cursor:pointer;
  background:rgba(0,0,0,.45); color:#fff; font-size:18px;
  display:flex; align-items:center; justify-content:center;
}
.lz-reel-camera-timer{
  background:rgba(0,0,0,.45); color:#fff; font-size:13px; font-weight:700;
  padding:5px 12px; border-radius:999px; font-variant-numeric:tabular-nums;
}
.lz-reel-camera-controls{
  position:absolute; left:0; right:0; bottom:22px; z-index:2;
  display:flex; align-items:center; justify-content:center;
}
.lz-reel-cam-record{
  width:70px; height:70px; border-radius:50%;
  background:transparent; border:4px solid #fff; cursor:pointer;
  position:relative;
}
.lz-reel-cam-record::after{
  content:''; position:absolute; inset:6px; border-radius:50%;
  background:#ff4f6d; transition:border-radius .15s ease, inset .15s ease;
}
.lz-reel-cam-record.recording::after{ border-radius:6px; inset:20px; }

/* Edit step */
.lz-reel-step-edit{ display:none; padding:0; }
.lz-reel-step-edit.active{ display:flex; flex-direction:column; max-height:92vh; }
.lz-reel-edit-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px; border-bottom:1px solid rgba(255,255,255,.06);
}
.lz-reel-edit-header h3{ margin:0; font-size:15px; }
.lz-reel-edit-back{
  width:32px; height:32px; border-radius:50%; border:0; cursor:pointer;
  background:rgba(255,255,255,.08); color:var(--text,#e6e6e6); font-size:18px;
  display:flex; align-items:center; justify-content:center;
}
.lz-reel-edit-spacer{ width:32px; }
.lz-reel-edit-body{ overflow-y:auto; padding:16px; display:flex; gap:16px; flex-wrap:wrap; }
.lz-reel-edit-preview{
  flex:0 0 auto; width:120px; height:214px; border-radius:12px; overflow:hidden; background:#000;
}
.lz-reel-edit-video{ width:100%; height:100%; object-fit:cover; }
.lz-reel-edit-fields{ flex:1 1 180px; min-width:180px; display:flex; flex-direction:column; }
.lz-reel-edit-label{ font-size:12px; color:var(--muted,#a1a1a1); margin-bottom:6px; }
.lz-reel-cover-scrub{ width:100%; accent-color:var(--accent,#3ea6ff); margin-bottom:14px; }

.lz-reel-visibility-toggle{ display:flex; gap:8px; margin-bottom:14px; }
.lz-reel-vis-btn{
  flex:1; padding:9px 6px; border-radius:999px; border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04); color:var(--muted,#a1a1a1); font-size:12.5px; font-weight:700;
  cursor:pointer; transition:background .15s ease, color .15s ease, border-color .15s ease;
}
.lz-reel-vis-btn.active{ background:var(--accent,#3ea6ff); color:#06131f; border-color:var(--accent,#3ea6ff); }

.lz-reel-sub-badge{
  position:absolute; top:16px; left:14px; z-index:5;
  font-size:11px; font-weight:700; letter-spacing:.02em;
  color:#06131f; background:var(--accent,#3ea6ff); padding:3px 10px; border-radius:999px;
}
@media (min-width:769px){
  .lz-reel-edit-preview{ width:160px; height:284px; }
}

.lz-reel-caption{
  width:100%; background:rgba(255,255,255,.05);
  border:0; border-radius:10px; color:var(--text,#e6e6e6);
  padding:10px 12px; font-size:13px; resize:vertical; min-height:70px; flex:1;
}
.lz-reel-progressbar{ height:4px; background:rgba(255,255,255,.1); margin:0 16px; overflow:hidden; display:none; border-radius:2px; }
.lz-reel-progressbar.show{ display:block; }
.lz-reel-progressbar b{ display:block; height:100%; width:0%; background:var(--accent,#3ea6ff); transition:width .2s; }
.lz-reel-upload-actions{ display:flex; gap:10px; padding:14px 16px; padding-bottom:calc(14px + env(safe-area-inset-bottom,0)); }
.lz-reel-upload-actions button{
  flex:1; padding:11px 0; border-radius:999px; font-weight:700; font-size:13px; border:0; cursor:pointer;
}
.lz-reel-btn-cancel{ background:rgba(255,255,255,.08); color:var(--text,#e6e6e6); }
.lz-reel-btn-submit{ background:var(--accent,#3ea6ff); color:#06131f; }
.lz-reel-btn-submit:disabled{ opacity:.5; cursor:default; }

/* ── Mobile tightening ───────────────────────────────────────── */
@media (max-width:480px){
  .lz-story{ width:60px; }
  .lz-story-ring{ width:54px; height:54px; }
  .lz-reel-actions{ right:8px; gap:16px; }
  .lz-reel-action{ font-size:23px; }
}
