/* ============================================================
   snifffr Stories — rail, tiles, player, upload sheet.
   SQUARE tiles (rounded corners) deliberately contrast with the
   ROUND featured-seller circles elsewhere on /activity/.
   Ring: pink→purple gradient = unseen, grey = watched.
   ============================================================ */

/* ── Rail ── */
.snifffr-stories {
    background: #fff;
    border: 1px solid rgba(66, 62, 89, 0.08);
    border-radius: 14px;
    padding: 14px 16px 12px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(51, 46, 77, 0.05);
}
.snifffr-stories-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}
.snifffr-stories-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #423E59;
}
.snifffr-stories-sub {
    font-size: 11.5px;
    color: rgba(66, 62, 89, 0.55);
}
.snifffr-stories-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 3px 2px 6px;
}
.snifffr-stories-row::-webkit-scrollbar { display: none; }

/* ── Tile (square, FB-style) ── */
.snifffr-story-tile {
    position: relative;
    flex: 0 0 auto;
    width: 104px;
    height: 104px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    background: #423E59;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}
@media (min-width: 992px) {
    .snifffr-story-tile { width: 118px; height: 118px; }
}

/* Gradient ring — drawn as an inset border overlay so the square
   poster stays full-bleed. Unseen = brand gradient, seen = grey. */
.snifffr-story-ring {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    padding: 3px;
    background: linear-gradient(45deg, #e65c95, #8a5fbf, #6b5fa6);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    z-index: 3;
}
.snifffr-story-tile.is-seen .snifffr-story-ring {
    background: rgba(66, 62, 89, 0.22);
}

.snifffr-story-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.snifffr-story-mini-avatar {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
    z-index: 2;
}
.snifffr-story-tile-shade {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 46px;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.62) 100%);
    z-index: 1;
}
.snifffr-story-tile-name {
    position: absolute;
    left: 8px; right: 8px; bottom: 7px;
    font-size: 11.5px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.snifffr-story-tile.is-mine .snifffr-story-tile-name { bottom: 19px; }
.snifffr-story-tile-meta {
    position: absolute;
    left: 8px; right: 8px; bottom: 6px;
    font-size: 9.5px;
    color: rgba(255,255,255,0.85);
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Create-story tile */
.snifffr-story-tile--add {
    background: #f6f3fb;
    border: 2px dashed rgba(230, 92, 149, 0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.snifffr-story-tile--add .snifffr-story-tile-name {
    position: static;
    color: #423E59;
    text-shadow: none;
    text-align: center;
}
.snifffr-story-add-plus {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e65c95;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    line-height: 32px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(230, 92, 149, 0.35);
}

/* ── Profile button ── */
a.snifffr-story-profile-btn,
a.snifffr-story-profile-btn:hover { text-decoration: none; }
.snifffr-story-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    margin: 6px 0;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(45deg, #e65c95, #8a5fbf);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(230, 92, 149, 0.28);
    -webkit-tap-highlight-color: transparent;
}
.snifffr-story-profile-btn.is-cooldown {
    background: #ECEAF2;
    color: #6b6685;
    box-shadow: none;
    cursor: default;
}

/* Mobile own-profile: full-width story button, directly below the status
   row. Wrapper is only emitted when the button renders (see template).
   Lightened (soft pink tint, pink text/icon) so it stays a clear, branded
   CTA without out-shouting the solid-pink "Edit profile" primary below it. */
.snifffr-mp-story-row { margin: 4px 0 10px; }
.snifffr-mp-story-row .snifffr-story-profile-btn {
    display: flex;
    width: 100%;
    justify-content: center;
    margin: 0;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 14px;
    background: #FFF1F7;
    color: #E65C95;
    border: 1.5px solid #FAD6E6;
    box-shadow: none;
}
.snifffr-mp-story-row .snifffr-story-profile-btn i { color: #E65C95; }
.snifffr-mp-story-row .snifffr-story-profile-btn.is-cooldown {
    background: #F4F2F8;
    color: #6b6685;
    border-color: rgba(66, 62, 89, 0.10);
}
.snifffr-mp-story-row .snifffr-story-profile-btn.is-cooldown i { color: #9a96ad; }

/* Active-story ring on profile avatars — wrap target gets this class */
.snifffr-has-story-ring {
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, #e65c95, #8a5fbf, #6b5fa6);
    display: inline-block;
}

/* Profile-header avatar with a live story: gradient ring drawn as an
   ::after overlay (masked donut) floating just outside the photo —
   no layout shift, works on both the mobile and desktop avatar
   containers (both are position:relative already for the online dot).
   No story → class absent → plain avatar. */
.snifffr-avatar--story { cursor: pointer; }
.snifffr-avatar--story::after {
    content: '';
    position: absolute;
    inset: 0;            /* sit ON the photo edge, not floating outside it */
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, #e65c95, #8a5fbf, #6b5fa6);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    z-index: 3;
}

/* ── Player ── */
.snifffr-story-player {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.snifffr-story-player-scrim {
    position: absolute;
    inset: 0;
    background: rgba(10, 8, 18, 0.92);
}
.snifffr-story-player-stage {
    position: relative;
    width: min(540px, 100vw - 24px);
    aspect-ratio: 1 / 1;
    max-height: calc(100vh - 120px);
    background: #000;
    border-radius: 18px;
    overflow: hidden;
}
.snifffr-story-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    touch-action: manipulation;
}
/* Fallback notice when the clip can't be decoded on this device. */
.snifffr-story-unplayable {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
    background: #1a1726;
    color: rgba(255, 255, 255, 0.92);
}
.snifffr-story-unplayable[hidden] { display: none; }
.snifffr-story-unplayable i { font-size: 34px; color: rgba(255, 255, 255, 0.6); }
.snifffr-story-unplayable p { margin: 0; font-size: 14px; line-height: 1.45; max-width: 16em; }

.snifffr-story-progress {
    position: absolute;
    top: 10px; left: 12px; right: 12px;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    z-index: 4;
}
.snifffr-story-progress-bar {
    display: block;
    height: 100%;
    width: 0%;
    background: #fff;
    border-radius: 3px;
}
.snifffr-story-player-head {
    position: absolute;
    top: 20px; left: 12px; right: 12px;
    display: flex;
    align-items: center;
    gap: 9px;
    z-index: 4;
}
.snifffr-story-player-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
}
.snifffr-story-player-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.snifffr-story-player-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.snifffr-story-player-time {
    font-size: 11px;
    color: rgba(255,255,255,0.75);
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.snifffr-story-mute,
.snifffr-story-x {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.snifffr-story-x { font-size: 22px; line-height: 1; }
.snifffr-story-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.snifffr-story-nav--prev { left: 10px; }
.snifffr-story-nav--next { right: 10px; }
.snifffr-story-player-foot {
    position: absolute;
    left: 12px; right: 12px; bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 4;
}
.snifffr-story-visit {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 999px;
    background: #e65c95;
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(230, 92, 149, 0.4);
}
.snifffr-story-views {
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.snifffr-story-delete {
    margin-left: auto;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(0,0,0,0.5);
    color: #ff9aa8;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* ── Upload sheet ── */
.snifffr-story-sheet {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
@media (min-width: 992px) {
    .snifffr-story-sheet { align-items: center; }
}
.snifffr-story-sheet-scrim {
    position: absolute;
    inset: 0;
    background: rgba(20, 16, 33, 0.6);
}
.snifffr-story-sheet-card {
    position: relative;
    width: min(440px, 100vw);
    background: #fff;
    border-radius: 18px 18px 0 0;
    padding: 20px 20px 26px;
    max-height: 86vh;
    overflow-y: auto;
}
@media (min-width: 992px) {
    .snifffr-story-sheet-card { border-radius: 18px; }
}
.snifffr-story-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.snifffr-story-sheet-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #423E59;
}
.snifffr-story-sheet-head .snifffr-story-x {
    background: #ECEAF2;
    color: #423E59;
}
.snifffr-story-sheet-hint {
    margin: 0 0 16px;
    font-size: 12.5px;
    line-height: 1.45;
    color: rgba(66, 62, 89, 0.6);
}
.snifffr-story-pick {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 34px 16px;
    border: 2px dashed rgba(230, 92, 149, 0.45);
    border-radius: 14px;
    background: #fdf4f8;
    cursor: pointer;
}
.snifffr-story-pick-icon {
    font-size: 30px;
    color: #e65c95;
}
.snifffr-story-pick-label {
    font-size: 14px;
    font-weight: 700;
    color: #e65c95;
}
.snifffr-story-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
}
.snifffr-story-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.snifffr-story-feedback {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    background: #e7f8ee;
    color: #1a7f37;
}
.snifffr-story-feedback.is-error {
    background: #fdecea;
    color: #b32d2e;
}
.snifffr-story-progress-upload {
    margin-top: 12px;
    height: 6px;
    border-radius: 6px;
    background: #ECEAF2;
    overflow: hidden;
}
.snifffr-story-progress-upload span {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(45deg, #e65c95, #8a5fbf);
    transition: width 0.2s ease;
}
.snifffr-story-share {
    width: 100%;
    margin-top: 14px;
    padding: 13px;
    border: 0;
    border-radius: 999px;
    background: #e65c95;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(230, 92, 149, 0.3);
}
.snifffr-story-share:disabled {
    background: #f3c2d8;
    box-shadow: none;
    cursor: default;
}
