/* ViewGems — BioStudio public stories
   Story ring around the BioStudio profile photo + guest story viewer.
   Only public, unexpired Sngine stories are ever shown here.
   The native Sngine story viewer requires login, so BioStudio has its
   own lightweight guest viewer (bio-stories.js). */

/* Ring — Instagram-style gradient around the avatar wrapper.
   The wrapper in bio.php is .vg-story-ring only when active public
   stories exist; otherwise the photo keeps its plain white border. */
.vg-story-ring {
  padding: 3px;
  border-radius: 9999px;
  background: conic-gradient(from 210deg, #f59e0b, #f43f5e, #d946ef, #8b5cf6, #f59e0b);
  cursor: pointer;
}
.vg-story-ring:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.vg-story-ring.vg-story-seen {
  background: rgba(156, 163, 175, 0.55);
  cursor: pointer;
}

/* Viewer overlay */
.vg-story-viewer {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.94);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.vg-story-viewer.vg-open { display: flex; }
.vg-story-card {
  position: relative; width: min(420px, 100%); aspect-ratio: 9 / 16;
  max-height: 88vh; border-radius: 20px; overflow: hidden;
  background: #000; color: #fff;
}
/* Full-screen on phones: the card fills the viewport, no rounded corners. */
@media (max-width: 600px) {
  .vg-story-viewer { padding: 0; }
  .vg-story-card {
    width: 100%; height: 100dvh; max-height: none;
    aspect-ratio: auto; border-radius: 0;
  }
}
.vg-story-media {
  position: absolute; inset: 0; width: 100%; height: 100%;
  /* contain, not cover: the whole image/video is always visible —
     a wide banner, a square or a vertical photo is never cropped. */
  object-fit: contain; background: #000;
}
.vg-story-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 32px; text-align: center;
  font-size: clamp(20px, 5vw, 28px); font-weight: 700; line-height: 1.35;
  white-space: pre-wrap; word-break: break-word; overflow-y: auto;
}
.vg-story-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  padding: 12px 14px; background: linear-gradient(to bottom, rgba(0,0,0,.65), transparent);
}
.vg-story-progress { display: flex; gap: 6px; margin-bottom: 10px; }
.vg-story-progress span { flex: 1; height: 3px; border-radius: 99px; background: rgba(255,255,255,.35); overflow: hidden; }
.vg-story-progress span i { display: block; height: 100%; width: 0; background: #fff; }
.vg-story-progress span.vg-done i { width: 100%; }
.vg-story-meta { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.vg-story-meta img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.vg-story-meta b { display: block; line-height: 1.2; }
.vg-story-meta small { color: rgba(255,255,255,.75); }
.vg-story-close {
  margin-left: auto; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.18); color: #fff; font-size: 18px; line-height: 1;
  border: 0; cursor: pointer;
}
.vg-story-tap { position: absolute; top: 0; bottom: 0; z-index: 4; border: 0; background: transparent; padding: 0; cursor: pointer; }
.vg-story-tap-left { left: 0; width: 30%; }
.vg-story-tap-right { right: 0; width: 70%; }
.vg-story-mute {
  position: absolute; bottom: 14px; right: 14px; z-index: 6;
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(0,0,0,.55); color: #fff; font-size: 17px;
}
/* Tappable layer pills (link / mention) — above the tap zones. */
.vg-story-pill {
  position: absolute; z-index: 7; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 6px; max-width: 86%;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.95); color: #0369a1;
  font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.vg-story-pill span:last-child { overflow: hidden; text-overflow: ellipsis; }
.vg-story-mention { color: #0f172a; }
.vg-story-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.8); font-size: 14px; padding: 24px; text-align: center;
}
