/* Generect Stories — bubble list */
.gr-stories {
    position: relative;
    width: 100%;
}
.gr-stories__list {
    box-sizing: border-box;
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    margin: 0;
    padding: .5rem;
    list-style: none;
    scrollbar-width: none;
}
.gr-stories__list::-webkit-scrollbar { display: none; }

.gr-stories__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35em;
    min-width: 70px;
}
.gr-stories__bubble {
    width: 70px;
    height: 70px;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #d8613c; /* matches accent-3 on generect.com */
    background: #0f1318;
    padding: 3px;
    overflow: hidden;
    position: relative;
    transition: transform .15s ease;
    -webkit-user-select: none;
    user-select: none;
}
.gr-stories__bubble:hover { transform: scale(1.05); }
.gr-stories__bubble:focus-visible {
    outline: 2px solid #0f1318;
    outline-offset: 3px;
}
/* Media wrapper holds the still poster + the looping video preview, stacked.
   Both fill the same circular box so the video covers the poster exactly. */
.gr-stories__media {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}
.gr-stories__media img,
.gr-stories__media video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    display: block;
}
.gr-stories__thumb { z-index: 0; }
/* Looping muted preview sits on top of the still poster — the same "live
   thumbnail" the CoolStory widget shows on generect.com. It's visible from the
   start (its own poster = the same thumbnail), so there's no flash and no
   dependence on a JS "playing" event to reveal it. */
.gr-stories__preview {
    z-index: 1;
    pointer-events: none;
}
.gr-stories__label {
    max-width: 80px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* Player modal — fully transparent overlay so the page underneath stays visible.
   Only the stage + a narrow blurred halo are rendered. */
.gr-player {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    background: transparent;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    animation: gr-fade-in .2s ease;
}
.gr-player[open] { display: flex; }

@keyframes gr-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Wrap = sized exactly like the stage; backdrop bleeds out 20px around it. */
.gr-player__wrap {
    position: relative;
    height: min(90vh, 100%);
    aspect-ratio: 9 / 16;
    max-width: 100vw;
}

/* Backdrop video — blurred copy of the current scene that bleeds outside the
   stage and feathers smoothly into the page background.
   No border-radius + no overflow:hidden = no hard rectangle edge.
   Soft alpha mask + heavy blur fade the halo to transparent at the perimeter. */
.gr-player__backdrop {
    position: absolute;
    inset: -32px;
    overflow: hidden;
    border-radius: 56px;   /* pronounced rounded corners on the halo */
    z-index: 0;
    pointer-events: none;
    /* Smooth multi-stop feather toward the outermost edge so the rounded
       rectangle of the halo dissolves into the page bg without a hard line. */
    -webkit-mask-image: radial-gradient(ellipse 110% 110% at 50% 50%,
        #000 0%,
        #000 45%,
        rgba(0,0,0,.9) 65%,
        rgba(0,0,0,.6) 80%,
        rgba(0,0,0,.25) 92%,
        rgba(0,0,0,0) 100%);
            mask-image: radial-gradient(ellipse 110% 110% at 50% 50%,
        #000 0%,
        #000 45%,
        rgba(0,0,0,.9) 65%,
        rgba(0,0,0,.6) 80%,
        rgba(0,0,0,.25) 92%,
        rgba(0,0,0,0) 100%);
}
.gr-player__backdrop-video,
.gr-player__backdrop-img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 125%;
    height: 125%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    filter: blur(24px) saturate(170%);
    opacity: 1;
    will-change: transform;
}

.gr-player__stage {
    position: relative;
    height: 100%;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #0f1318;
    z-index: 1;
    box-shadow: 0 12px 60px rgba(0, 0, 0, .35);
}

.gr-player__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
}

.gr-player__topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 4;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,0));
    pointer-events: none;
}
.gr-player__topbar > * { pointer-events: auto; }

.gr-player__progress {
    display: flex;
    align-items: center;
    gap: 4px;
}
.gr-player__progress-item {
    flex: 1 1 0;
    height: 2px;
    background: rgba(255,255,255,.4);
    border-radius: 2px;
    overflow: hidden;
}
.gr-player__progress-item-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: #fff;
    transition: width .1s linear;
}

.gr-player__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.gr-player__title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    padding-right: 8px;
}
.gr-player__buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}
.gr-player__btn {
    background: none;
    border: 0;
    padding: 6px;
    margin: 0;
    cursor: pointer;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    border-radius: 999px;
}
.gr-player__btn:hover { background: rgba(255,255,255,.12); }
.gr-player__btn svg { width: 22px; height: 22px; fill: currentColor; }

/* Tap zones — invisible click areas, no focus highlight */
.gr-player__tap {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 35%;
    z-index: 3;
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    outline: 0 !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}
.gr-player__tap::-moz-focus-inner { border: 0; }
.gr-player__tap:focus,
.gr-player__tap:focus-visible,
.gr-player__tap:active { outline: 0; box-shadow: none; }
.gr-player__tap--prev { left: 0; }
.gr-player__tap--next { right: 0; }

/* CTA */
.gr-player__cta {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    justify-content: center;
    pointer-events: none;
}
.gr-player__cta-btn {
    pointer-events: auto;
    max-width: 24ch;
    padding: 10px 18px;
    background: #fff;
    color: #0f1318;
    border-radius: 16px;
    text-decoration: none;
    font-family: inherit;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

/* Mobile: full screen */
@media (max-width: 500px) {
    .gr-player__stage {
        height: 100vh;
        aspect-ratio: auto;
        width: 100vw;
        border-radius: 0;
    }
}

/* Side-by-side nav arrows on wide screens (Instagram-like).
   Solid white disc with shadow — readable against any page background. */
.gr-player__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    background: #fff;
    color: #0f1318;
    border: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
    transition: background .15s ease, transform .15s ease;
}
.gr-player__nav:hover {
    background: #f4f4f4;
    transform: translateY(-50%) scale(1.05);
}
.gr-player__nav svg { width: 20px; height: 20px; fill: currentColor; }
.gr-player__nav--prev { left: max(16px, calc(50vw - min(45vh, 50vw) - 56px)); }
.gr-player__nav--next { right: max(16px, calc(50vw - min(45vh, 50vw) - 56px)); }
@media (min-width: 768px) {
    .gr-player__nav { display: inline-flex; }
}
