/* Reels + Stories */

body.st-lock, body.rl-on { overflow: hidden; }

/* ---------- Stories bar (top of the Forum) ---------- */
.st-bar {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; margin: 0 0 12px;
  scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.st-bar::-webkit-scrollbar { display: none; }
.st-circle {
  flex: none; position: relative; display: grid; justify-items: center; gap: 6px; width: 74px;
  border: 0; background: none; padding: 0; cursor: pointer; color: var(--ink); scroll-snap-align: start;
}
.st-ring {
  display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%; padding: 3px;
  background: var(--line);
}
.st-circle.unseen .st-ring { background: conic-gradient(from 210deg, var(--c), color-mix(in srgb, var(--c) 55%, #fff), var(--c)); }
.st-circle[data-b="left"] { --c: var(--left); } .st-circle[data-b="center"] { --c: var(--center); } .st-circle[data-b="right"] { --c: var(--right); }
.st-circle.seen .st-ring { background: color-mix(in srgb, var(--c) 30%, var(--line)); }
.st-ring .avatar { width: 58px; height: 58px; border: 3px solid var(--bg); font-size: 18px; }
.st-glyph {
  position: absolute; top: 46px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font: 800 12px/1 var(--mono); font-style: normal; color: #fff; background: var(--c, var(--center));
  border: 2px solid var(--bg);
}
.st-glyph[data-b="left"] { background: var(--left); } .st-glyph[data-b="center"] { background: var(--center); } .st-glyph[data-b="right"] { background: var(--right); }
.st-circle.official .st-name { font-weight: 800; }
.st-name { font-size: 12px; max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.st-circle.unseen .st-name { color: var(--ink); font-weight: 700; }
.st-add .st-ring { background: var(--surface-2); }
.st-plus {
  position: absolute; top: 44px; right: 4px; width: 24px; height: 24px; border-radius: 50%; font-style: normal;
  display: grid; place-items: center; font: 800 18px/1 var(--body); color: #fff; background: var(--accent-ink, #2f6bff);
  background: var(--center); border: 2px solid var(--bg);
}
.st-addmore {
  flex: none; align-self: start; margin-top: 18px; width: 36px; height: 36px; border-radius: 50%; border: 1px dashed var(--line);
  background: var(--surface); font: 700 20px/1 var(--body); cursor: pointer; color: var(--ink-2);
}
.st-circle:focus-visible .st-ring { outline: 3px solid var(--c, var(--center)); outline-offset: 2px; }
.st-skel { display: flex; gap: 12px; } .st-skel i { width: 66px; height: 66px; border-radius: 50%; background: var(--surface-2); }

/* ---------- Story viewer ---------- */
.st-viewer { position: fixed; inset: 0; z-index: 80; background: #000; display: grid; place-items: center; color: #fff; }
.st-viewer[hidden] { display: none; }
.st-frame {
  position: relative; width: 100%; height: 100%; max-width: 480px; max-height: 100dvh; overflow: hidden; background: #0b0b0d;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
@media (min-width: 700px) { .st-frame { height: min(92dvh, 860px); border-radius: 16px; aspect-ratio: 9 / 16; width: auto; } }
.st-bars { position: absolute; z-index: 3; top: calc(8px + env(safe-area-inset-top)); left: 8px; right: 8px; display: flex; gap: 4px; }
.st-bars span { flex: 1; height: 3px; border-radius: 3px; background: rgb(255 255 255 / .35); overflow: hidden; }
.st-bars i { display: block; height: 100%; width: 0; background: #fff; }
.st-head {
  position: absolute; z-index: 3; top: calc(18px + env(safe-area-inset-top)); left: 8px; right: 8px;
  display: flex; align-items: center; gap: 8px; text-shadow: 0 1px 3px rgb(0 0 0 / .6);
}
.st-who { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; color: #fff; text-decoration: none; font-size: 14px; }
.st-who .avatar { flex: none; }
.st-who-txt { display: grid; min-width: 0; line-height: 1.2; }
.st-who-line { display: flex; align-items: center; gap: 4px; min-width: 0; }
.st-who-line b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 3em; }
.st-time { color: rgb(255 255 255 / .75); font-size: 12px; white-space: nowrap; }
.st-head .badge { flex: none; }
.st-head-btns { margin-left: auto; display: flex; gap: 2px; flex: none; }
.st-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 20px; cursor: pointer; display: grid; place-items: center; }
.st-btn:hover, .st-btn:focus-visible { background: rgb(255 255 255 / .15); }
.st-stage { position: absolute; inset: 0; display: grid; place-items: center; }
.st-media { width: 100%; height: 100%; object-fit: contain; background: #000; }
.st-media.fill { object-fit: cover; }
.st-text { position: absolute; inset: 0; display: grid; place-items: center; padding: 72px 28px 120px; text-align: center; }
.st-text p { margin: 0; font: 800 clamp(24px, 7vw, 34px)/1.2 var(--display); color: #fff; overflow-wrap: anywhere; }
.st-text a { color: inherit; }
.bg-dusk { background: linear-gradient(160deg, #2b1d4f, #8a2d63 60%, #d4524a); }
.bg-ink { background: linear-gradient(160deg, #0d0e13, #2b2d39); }
.bg-sunrise { background: linear-gradient(160deg, #ff8a4c, #ffcf6e); } .bg-sunrise p { color: #1d1306; }
.bg-ocean { background: linear-gradient(160deg, #0b3f73, #1f8fb8); }
.bg-paper { background: #f4f1e8; } .bg-paper p { color: #15151a; }
.st-caption {
  position: absolute; left: 0; right: 0; bottom: 92px; margin: 0; padding: 10px 16px; font-size: 15px; line-height: 1.4;
  background: linear-gradient(transparent, rgb(0 0 0 / .65)); text-shadow: 0 1px 2px rgb(0 0 0 / .6);
}
.st-caption a { color: #fff; }
.st-sticker {
  position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 150px; display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px;
  background: rgb(255 255 255 / .94); color: #15151a; text-decoration: none; box-shadow: 0 6px 20px rgb(0 0 0 / .35);
}
.st-sticker b { font: 700 15px/1.25 var(--display); }
.st-sticker small { color: #5b5b66; font-size: 12px; }
.st-sticker .badge { justify-self: start; }
.st-zones { position: absolute; inset: 70px 0 90px; z-index: 1; display: flex; pointer-events: none; }
.st-zone { flex: 1; } .st-zone.next { flex: 2; }
.st-foot {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; padding: 12px 12px calc(14px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; background: linear-gradient(transparent, rgb(0 0 0 / .55));
}
.st-react { display: flex; gap: 8px; margin: 0 auto; }
.st-react button {
  min-width: 64px; height: 48px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .35); background: rgb(0 0 0 / .35); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font: 800 18px/1 var(--mono);
}
.st-react .n { font-size: 13px; }
.st-react .n:empty { display: none; }
.st-react button[aria-pressed="true"][data-b="left"] { background: var(--left); border-color: var(--left); }
.st-react button[aria-pressed="true"][data-b="center"] { background: var(--center); border-color: var(--center); }
.st-react button[aria-pressed="true"][data-b="right"] { background: var(--right); border-color: var(--right); }
.st-react button.pop { animation: tagpop .45s cubic-bezier(.2, 1.6, .4, 1); }
.st-viewed { height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .35); background: rgb(0 0 0 / .35); color: #fff; font-weight: 700; cursor: pointer; }
.st-rx-sum { display: flex; gap: 10px; font: 700 13px var(--mono); }
.st-rx-sum [data-b="left"] { color: #8fb0ff; } .st-rx-sum [data-b="center"] { color: #c7b0f5; } .st-rx-sum [data-b="right"] { color: #ff9a9c; }
.st-del { margin-left: auto; }
.st-viewer.paused .st-head, .st-viewer.paused .st-foot { opacity: .5; }
.st-sheet { position: absolute; z-index: 5; inset: auto 0 0 0; max-height: 70%; overflow: auto; background: var(--bg); color: var(--ink); border-radius: 18px 18px 0 0; }
.st-sheet-in { padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
.st-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.st-sheet .st-btn { color: var(--ink); }
.st-viewers { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.st-viewers a { display: block; padding: 10px 4px; text-decoration: none; border-bottom: 1px solid var(--line); }

/* ---------- Creator sheet (stories + reels) ---------- */
.st-create-wrap { position: fixed; inset: 0; z-index: 85; background: rgb(0 0 0 / .55); display: grid; place-items: end center; }
.st-create-wrap[hidden] { display: none; }
@media (min-width: 700px) { .st-create-wrap { place-items: center; } }
.st-create {
  width: min(760px, 100%); max-height: 94dvh; overflow: auto; background: var(--bg); color: var(--ink);
  border-radius: 20px 20px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
}
@media (min-width: 700px) { .st-create { border-radius: 20px; } }
.cr-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cr-head b { font: 800 20px var(--display); }
.cr-head .st-btn { margin-left: auto; color: var(--ink); }
.cr-kinds { margin-bottom: 12px; }
.cr-body { display: grid; gap: 14px; }
@media (min-width: 700px) { .cr-body { grid-template-columns: 240px minmax(0, 1fr); align-items: start; } }
.cr-preview {
  position: relative; aspect-ratio: 9 / 16; max-height: 46dvh; width: auto; margin: 0 auto; border-radius: 14px; overflow: hidden; background: #0b0b0d;
  display: grid; place-items: center;
}
@media (min-width: 700px) { .cr-preview { max-height: none; width: 100%; } }
.cr-preview img, .cr-preview video { width: 100%; height: 100%; object-fit: cover; }
.cr-preview .st-text { padding: 20px 16px; }
.cr-preview .st-text p { font-size: 22px; }
.cr-drop { display: grid; justify-items: center; gap: 4px; color: #e9e8e4; text-align: center; padding: 20px; }
.cr-drop span { font-size: 28px; }
.cr-fields { display: grid; gap: 12px; min-width: 0; }
.cr-label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.cr-label textarea, .cr-label input[type="search"] {
  width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); font-size: 16px; font-weight: 400;
}
.cr-pick { justify-content: center; min-height: 48px; }
.rc-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cr-bgs { display: flex; gap: 10px; flex-wrap: wrap; }
.cr-bg { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.cr-bg[aria-checked="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }
.cr-sticker-results { display: grid; gap: 4px; }
.cr-sticker-opt { display: flex; gap: 8px; align-items: center; text-align: left; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; font-size: 14px; }
.cr-sticker-on { display: grid; gap: 6px; }
.cr-sticker-on .st-sticker { position: static; box-shadow: none; border: 1px solid var(--line); }

/* ---------- Reels ---------- */
.rl-wrap { position: fixed; left: 0; right: 0; top: 101px; bottom: 60px; z-index: 6; background: #000; color: #fff; }
.rl-top {
  position: absolute; z-index: 4; top: 0; left: 0; right: 0; display: flex; align-items: center; padding: 8px 12px;
  background: linear-gradient(rgb(0 0 0 / .55), transparent); pointer-events: none;
}
.rl-title { font: 800 20px var(--display); }
.rl-top-btns { margin-left: auto; display: flex; gap: 6px; pointer-events: auto; }
.rl-topbtn { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .35); background: rgb(0 0 0 / .4); color: #fff; font-weight: 700; cursor: pointer; }
.rl-feed { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; outline: none; }
.rl-feed::-webkit-scrollbar { display: none; }
.rl-loading { height: 100%; display: grid; place-items: center; color: rgb(255 255 255 / .7); font-family: var(--mono); }
.rl-item { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; justify-content: center; align-items: stretch; }
.rl-stage { position: relative; flex: 1; max-width: 100%; height: 100%; background: #000; overflow: hidden; }
.rl-video { width: 100%; height: 100%; display: block; background: #000; }
.rl-video.fill { object-fit: cover; }
.rl-video.fit { object-fit: contain; }
.rl-yt { position: absolute; inset: 0; border: 0; padding: 0; background: #000; cursor: pointer; display: grid; place-items: center; }
.rl-yt img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.rl-play { position: absolute; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / .55); font-size: 30px; color: #fff; }
.rl-ytframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rl-sound {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px; background: rgb(0 0 0 / .5); opacity: 0; pointer-events: none;
}
.rl-sound.show { animation: rlflash .9s ease-out; }
@keyframes rlflash { 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.rl-info {
  position: absolute; z-index: 2; left: 0; right: 76px; bottom: 0; padding: 40px 14px 16px; color: #fff;
  background: linear-gradient(transparent, rgb(0 0 0 / .7)); text-shadow: 0 1px 2px rgb(0 0 0 / .6);
}
.rl-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; }
.rl-who a { color: #fff; text-decoration: none; }
.rl-cap { margin: 6px 0 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.rl-cap.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rl-cap a { color: #fff; font-weight: 700; }
.rl-more { color: #fff; font-size: 14px; }
.rl-sticker { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; padding: 6px 10px; border-radius: 10px; background: rgb(255 255 255 / .92); color: #15151a; text-decoration: none; font-size: 13px; font-weight: 700; max-width: 100%; }
.rl-rail {
  position: absolute; z-index: 3; right: 6px; bottom: 16px; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.rl-av .avatar { width: 48px; height: 48px; border: 2px solid #fff; }
.rl-rail .tagbar { flex-direction: column; background: rgb(0 0 0 / .4); padding: 4px; gap: 4px; border-radius: 999px; }
.rl-rail .tagbar button { min-width: 48px; min-height: 48px; padding: 0; flex-direction: column; gap: 2px; color: #fff; }
.rl-rail .tagbar .sym { font-size: 20px; }
.rl-rail .tagbar .cnt { font-size: 11px; }
.rl-rail .tagbar button:hover { background: rgb(255 255 255 / .15); color: #fff; }
.rl-act {
  width: 52px; min-height: 52px; border: 0; background: none; color: #fff; text-decoration: none; cursor: pointer;
  display: grid; justify-items: center; gap: 2px; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px rgb(0 0 0 / .6);
}
.rl-act .ico { font-size: 24px; line-height: 1; }
.rl-empty, .rl-end { align-items: center; justify-content: center; }
.rl-empty-in { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 24px; max-width: 360px; }
.rl-empty-in h2 { font-size: 26px; }
.rl-empty-in p { margin: 0; color: rgb(255 255 255 / .75); }
.rl-empty-ico { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; background: rgb(255 255 255 / .1); }
.rl-empty-in .btn:not(.primary) { color: #fff; background: transparent; border-color: rgb(255 255 255 / .4); }

/* Desktop: centered 9:16 player with the rail beside it */
@media (min-width: 860px) {
  .rl-wrap { background: var(--bg); color: var(--ink); }
  .rl-top { justify-content: center; background: none; }
  .rl-title { color: var(--ink); position: absolute; left: 24px; }
  .rl-topbtn { color: var(--ink); background: var(--surface); border-color: var(--line); }
  .rl-item { padding: 12px 0; gap: 14px; }
  .rl-stage { flex: none; aspect-ratio: 9 / 16; height: 100%; border-radius: 16px; }
  .rl-rail { position: static; align-self: flex-end; color: var(--ink); }
  .rl-rail .rl-act { color: var(--ink); text-shadow: none; }
  .rl-rail .tagbar { background: var(--surface-2); }
  .rl-rail .tagbar button { color: var(--ink-2); }
  .rl-rail .tagbar button:hover { color: var(--ink); background: var(--surface); }
  .rl-info { right: 0; }
  .rl-empty-in p { color: var(--ink-2); }
  .rl-empty-ico { background: var(--surface-2); }
  .rl-empty-in .btn:not(.primary) { color: var(--ink); border-color: var(--line); }
  .rl-loading { color: var(--ink-2); }
}

@media (prefers-reduced-motion: reduce) {
  .rl-feed { scroll-behavior: auto; }
  .rl-sound.show { animation: none; opacity: 0; }
}
