/* =====================================================
   ליכודלינק — STORIES (tray + fullscreen viewer + composer)
   ===================================================== */

/* ── home tray ── */
.stories-row { display: flex; gap: 14px; padding: 4px 2px 2px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.stories-row::-webkit-scrollbar { display: none; }
.stories-row.empty { display: none; }
.story-ring { display: flex; flex-direction: column; align-items: center; gap: 5px; background: none; border: 0; padding: 0; cursor: pointer; flex: none; }
.sr-disc { width: 64px; height: 64px; border-radius: 50%; padding: 3px; display: grid; place-items: center; background: linear-gradient(45deg, #2E74F0, #0B47C4 55%, #E8B53A); }
.sr-disc.has-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #fff; border: 2px solid var(--bg); }
.story-ring.add .sr-disc { background: var(--fill); border: 2px dashed var(--line-2); }
/* per-story faces: image stories show their OWN photo; text stories show their OWN
   gradient + a glyph drawn from their OWN text (first emoji / first letter) — never
   the repeated profile photo, so a row of rings actually looks different ring-to-ring */
.sr-face { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--bg); overflow: hidden; }
.sr-face-glyph { font-size: 24px; line-height: 1; color: #fff; font-weight: 800; text-shadow: 0 1px 4px rgba(0,0,0,.25); }
.sr-plus { font-size: 30px; font-weight: 300; line-height: 1; color: var(--navy-600); }
.sr-lbl { font-size: .72rem; color: var(--mist); font-weight: 600; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── fullscreen viewer ── */
.story-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(6, 10, 20, .93); display: grid; place-items: center; animation: story-fade .18s ease; }
@keyframes story-fade { from { opacity: 0; } to { opacity: 1; } }
.story-shell { position: relative; width: min(430px, 100vw); height: min(92vh, 800px); background: #000; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }

.story-bars { position: absolute; top: 10px; inset-inline: 12px; display: flex; gap: 5px; z-index: 6; }
.sbar { flex: 1; height: 3px; background: rgba(255, 255, 255, .32); border-radius: 3px; overflow: hidden; }
.sbar-fill { display: block; height: 100%; width: 0; background: #fff; }
.sbar-fill.done { width: 100%; }

.story-head { position: absolute; top: 22px; inset-inline: 14px; display: flex; align-items: center; justify-content: space-between; z-index: 6; color: #fff; }
.story-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.story-av img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #fff; border: 1.5px solid rgba(255, 255, 255, .6); }
.story-name { font-weight: 700; font-size: .92rem; display: inline-flex; align-items: center; gap: 4px; }
.story-badge { display: inline-flex; color: #4D9DFF; }
.story-badge svg { width: 14px; height: 14px; }
.story-time { font-size: .76rem; opacity: .82; }
.story-x, .story-del { background: none; border: 0; color: #fff; cursor: pointer; padding: 5px; display: inline-flex; opacity: .92; }
.story-x svg, .story-del svg { width: 20px; height: 20px; }
.story-del svg { width: 18px; height: 18px; }

.story-stage { position: absolute; inset: 0; display: grid; place-items: center; }
.story-media { width: 100%; height: 100%; object-fit: contain; }
.story-stage.text { padding: 46px 30px; }
.story-textwrap { max-width: 100%; }
.story-text { color: #fff; font-size: 1.7rem; font-weight: 800; line-height: 1.35; text-align: center; white-space: pre-wrap; word-break: break-word; text-shadow: 0 2px 12px rgba(0, 0, 0, .25); }
.story-cap { position: absolute; bottom: 28px; inset-inline: 18px; z-index: 6; color: #fff; text-align: center; font-size: .96rem; line-height: 1.5; text-shadow: 0 1px 8px rgba(0, 0, 0, .7); }

/* Instagram-style text written ON the image */
.story-overtext { position: absolute; inset-inline: 22px; display: flex; justify-content: center; z-index: 5; pointer-events: none; }
.story-overtext.pos-top { top: 84px; }
.story-overtext.pos-mid { top: 50%; transform: translateY(-50%); }
.story-overtext.pos-bottom { bottom: 92px; }
.story-overtext span { background: rgba(0, 0, 0, .34); color: #fff; font-weight: 800; font-size: 1.55rem; line-height: 1.45; text-align: center; padding: 6px 14px; border-radius: 12px; box-decoration-break: clone; -webkit-box-decoration-break: clone; text-shadow: 0 2px 12px rgba(0, 0, 0, .45); word-break: break-word; }

.story-zone { position: absolute; top: 62px; bottom: 0; width: 35%; background: transparent; border: 0; cursor: pointer; z-index: 5; -webkit-tap-highlight-color: transparent; }
.story-zone.prev { inset-inline-start: 0; }
.story-zone.next { inset-inline-end: 0; width: 65%; }

@media (max-width: 480px) {
  .story-shell { width: 100vw; height: 100vh; border-radius: 0; }
}

/* ── admin composer ── */
.stc-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.stc-tab { flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-elev); font-weight: 700; cursor: pointer; color: var(--mist); }
.stc-tab.active { background: var(--navy-600); color: #fff; border-color: var(--navy-600); }
.stc-prev { height: 160px; border-radius: 16px; display: grid; place-items: center; padding: 18px; margin-bottom: 12px; color: #fff; text-align: center; font-weight: 800; font-size: 1.2rem; line-height: 1.35; overflow: hidden; word-break: break-word; }
.stc-bgs { display: flex; gap: 10px; margin-top: 12px; justify-content: center; }
.stc-bg { width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.stc-bg.sel { border-color: var(--navy-600); box-shadow: var(--glow-blue); }
.stc-file-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border: 1px dashed var(--line-2); border-radius: 12px; cursor: pointer; color: var(--mist); font-weight: 700; }
.stc-file-btn svg { width: 18px; height: 18px; }
.stc-img-prev img { width: 100%; border-radius: 12px; margin-top: 12px; max-height: 300px; object-fit: cover; }
.stc-note { text-align: center; color: var(--faint); font-size: .82rem; margin-top: 12px; }

/* image story editor — live "text on image" preview */
.stc-img-stage { position: relative; height: 280px; border-radius: 16px; margin-top: 12px; background: var(--glass-hover) center/cover no-repeat; border: 1px dashed var(--line-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.stc-img-stage.has-img { border-style: solid; }
.stc-img-ph { color: var(--faint); font-weight: 700; }
.stc-img-stage.has-img .stc-img-ph { display: none; }
.stc-over { position: absolute; inset-inline: 14px; display: flex; justify-content: center; pointer-events: none; }
.stc-over.pos-top { top: 14px; }
.stc-over.pos-mid { top: 50%; transform: translateY(-50%); }
.stc-over.pos-bottom { bottom: 14px; }
.stc-over span { background: rgba(0, 0, 0, .42); color: #fff; font-weight: 800; font-size: 1.15rem; line-height: 1.4; padding: 5px 12px; border-radius: 10px; text-align: center; box-decoration-break: clone; -webkit-box-decoration-break: clone; word-break: break-word; }
.stc-pos { display: flex; gap: 8px; margin-top: 10px; }
.stc-posb { flex: 1; padding: 8px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-elev); font-weight: 700; color: var(--mist); cursor: pointer; font-size: 13px; }
.stc-posb.on { background: var(--navy-600); color: #fff; border-color: var(--navy-600); }
