html:has(.tmn-event-popup[open]) {
    overflow: hidden;
    scrollbar-gutter: stable;
}

.tmn-event-popup {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 76px 20px 64px;
    border: 0;
    background: transparent;
    overflow: hidden;
    color: #fff;
}

.tmn-event-popup[open] {
    display: grid;
    place-items: center;
}

.tmn-event-popup::backdrop {
    background: radial-gradient(ellipse at 75% 15%, rgb(224 216 245 / 9%), transparent 65%), rgb(15 12 22 / 38%);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: tmn-event-backdrop-in 300ms ease both;
}

.tmn-event-popup[data-closing]::backdrop {
    animation: tmn-event-backdrop-out 400ms ease both;
}

.tmn-event-popup__panel {
    position: relative;
    width: min(420px, calc((100vw - 40px) * .75), calc((100svh - 112px) * var(--tmn-event-ratio, .79975124) * .75), calc((100svh - 140px) * var(--tmn-event-ratio, .79975124)));
}

.tmn-event-popup__panel > img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: calc(100svh - 112px);
    object-fit: contain;
    border-radius: 0;
    box-shadow: 0 18px 60px rgb(0 0 0 / 20%);
}

.tmn-event-popup__controls {
    position: absolute;
    right: 0;
    bottom: calc(100% + 26px);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tmn-event-popup__close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 24%);
    border-radius: 50%;
    background: rgb(255 255 255 / 10%);
    color: inherit;
    cursor: pointer;
    transition: background 180ms ease;
}

.tmn-event-popup__close:hover { background: rgb(255 255 255 / 19%); }
.tmn-event-popup__close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

@keyframes tmn-event-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes tmn-event-backdrop-out { from { opacity: 1; } to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .tmn-event-popup::backdrop,
    .tmn-event-popup[data-closing]::backdrop { animation: none; }
    .tmn-event-popup__close { transition: none; }
}

.tmn-event-popup__progress {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    right: 0;
    display: flex;
    gap: 5px;
}
.tmn-event-popup__progress > span { flex: 1; height: 3px; overflow: hidden; border-radius: 3px; background: rgb(255 255 255 / 25%); }
.tmn-event-popup__progress i { display: block; height: 100%; background: rgb(255 255 255 / 90%); transform: scaleX(0); transform-origin: left; }
.tmn-event-popup__arrow {
    position: absolute;
    top: calc(50% - 22px);
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 18%);
    border-radius: 50%;
    color: #fff;
    background: rgb(255 255 255 / 8%);
    cursor: pointer;
}
.tmn-event-popup__arrow--previous { right: calc(100% + 6px); }
.tmn-event-popup__arrow--next { left: calc(100% + 6px); }
.tmn-event-popup__arrow:disabled { opacity: .3; cursor: default; }
.tmn-event-popup__arrow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tmn-brand-stories { display: flex; align-items: center; gap: 15px; flex: 0 0 auto; grid-column: 1; grid-row: 1; width: fit-content; max-width: 100%; }
.tmn-brand-stories .tmn-brand { flex: 0 1 auto; min-width: 0; }
.tmn-brand-stories .tmn-brand img { max-width: 100%; }
.tmn-event-story {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    border: 0;
    border-radius: 50%;
    padding: 3px;
    background: transparent;
    cursor: pointer;
}
.tmn-event-story::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: conic-gradient(#ff408c, #ab41da 27%, #ff823d 57%, #ffe07a 75%, #ff408c); animation: tmn-event-story-ring 7s linear infinite; }
.tmn-event-story img { position: relative; display: block; width: 34px; height: 34px; border: 2px solid #fff; border-radius: 50%; object-fit: cover; }
.tmn-event-story:focus-visible { outline: 2px solid var(--tmn-purple); outline-offset: 3px; }
.tmn-event-popup [hidden], .tmn-event-story[hidden] { display: none; }
@keyframes tmn-event-story-ring { to { transform: rotate(360deg); } }
@media (max-width: 470px) {
    .tmn-header-inner:has(.tmn-brand-stories) { column-gap: 4px; }
    .tmn-brand-stories { gap: 13px; }
}
@media (prefers-reduced-motion: reduce) {
    .tmn-event-story::before { animation: none; }
}

.tmn-story-thumbs { position: absolute; top: calc(100% + 8px); width: 100%; display: flex; justify-content: safe center; overflow-x: auto; }
.tmn-story-thumbs button { flex: none; display: grid; place-items: center; width: 44px; height: 48px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.tmn-story-thumbs img { width: 36px; height: 45px; border-radius: 5px; object-fit: cover; opacity: .65; }
.tmn-story-thumbs [aria-pressed="true"] img { opacity: 1; outline: 1px solid white; }
.tmn-story-tip { display: none; }
@media (hover: hover) and (pointer: fine) {
    .tmn-story-tip {
        display: block; position: absolute; top: calc(100% + 8px); left: 50%;
        padding: 6px 11px; border: 1px solid #ffffff40; border-radius: 14px;
        background: linear-gradient(#ffffff18, transparent), #241e2bd9;
        backdrop-filter: blur(7px); box-shadow: 0 3px 10px #15101922;
        color: #fff; font-size: 12px; pointer-events: none; opacity: 0;
        transform: translate(-50%, 4px); transition: opacity .2s, transform .2s;
    }
    .tmn-event-story:is(:hover, :focus-visible) .tmn-story-tip { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) { .tmn-story-tip { transition: none; } }

.tmn-event-story::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    box-shadow: 0 0 7px #e95a9180; opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
    .tmn-event-story::after { animation: tmn-ring-glow 8s ease-in-out infinite; }
}
@keyframes tmn-ring-glow { 0%, 65%, 100% { opacity: 0; } 82% { opacity: .8; } }
