/* ============================================================================
   Fashion Jam Trailer — content-warning gated, beat-driven sprite spectacle
   Lives above the lede on /fashion. Pairs with js/fashion-trailer.js.
============================================================================ */

.fashion-trailer-section {
    margin: 0 auto 18px;
    max-width: 880px;
    padding: 0 12px;
}

.fashion-trailer {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: #08000c;
    box-shadow:
        0 0 0 1px rgba(255, 105, 247, 0.35),
        0 18px 40px -18px rgba(180, 0, 220, 0.55);
    isolation: isolate;
    user-select: none;
    cursor: pointer;
}
.fashion-trailer.is-playing { cursor: default; }

.fashion-trailer.is-fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100svh;
    max-width: none;
    aspect-ratio: auto;
    border-radius: 0;
    z-index: 1000;
    box-shadow: none;
}

.fashion-trailer.is-fullscreen:not(.is-mobile) {
    width: min(100vw, calc(100svh * 16 / 9));
    height: min(100svh, calc(100vw * 9 / 16));
    max-width: 100vw;
    max-height: 100svh;
    aspect-ratio: 16 / 9;
    margin: auto;
}

.fashion-trailer canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: radial-gradient(ellipse at 50% 60%, #2a0040 0%, #08000c 70%);
    transform: translate3d(0, 0, 0);
    transition: filter 120ms linear;
}

/* ── Content-warning gate ─────────────────────────────────────────────────── */
.ft-gate {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #000;
    color: #fff;
    text-align: center;
    padding: 24px;
    transition: opacity 380ms ease, visibility 380ms;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.ft-gate__warning {
    font-size: clamp(18px, 3.4vw, 28px);
    line-height: 1.35;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-shadow: 0 0 24px rgba(255, 64, 200, 0.65);
}
.ft-gate__warning b { color: #ff5cd2; font-weight: 700; }
.ft-gate__mark {
    width: clamp(42px, 7vw, 66px);
    height: auto;
    display: block;
    filter:
        hue-rotate(280deg)
        saturate(220%)
        brightness(1.2)
        drop-shadow(0 0 14px rgba(255, 75, 220, 0.9))
        drop-shadow(0 0 26px rgba(142, 82, 255, 0.75));
}
.ft-gate__btn {
    appearance: none;
    background: linear-gradient(135deg, #ff2bb1, #8a1cff);
    color: #fff;
    border: none;
    min-width: 220px;
    min-height: 48px;
    padding: 14px 32px;
    font: 700 16px/1 system-ui, sans-serif;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 0 0 2px #fff inset, 0 8px 22px -6px rgba(255, 50, 200, 0.7);
    transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}
.ft-gate__btn:hover { transform: translateY(-2px) scale(1.02); }
.ft-gate__btn:active { transform: translateY(0) scale(0.98); }
.ft-gate__btn.is-loading {
    background: transparent;
    box-shadow: none;
    color: #ffd3f8;
    text-shadow:
        0 0 10px rgba(255, 95, 215, 0.9),
        0 0 22px rgba(162, 84, 255, 0.7);
    cursor: default;
    opacity: 0.92;
}
.ft-gate.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* ── Loading hint while metadata/sprites load ─────────────────────────────── */
.ft-loading {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: none !important;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #ff8eea;
    font: 600 14px/1 system-ui, sans-serif;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
}
.ft-loading.is-visible { display: none !important; }

/* ── Credit card (bottom-left) ────────────────────────────────────────────── */
.ft-credit {
    position: absolute;
    left: 10px;
    bottom: 18px;
    z-index: 4;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    background: rgba(8, 0, 18, 0.72);
    border: 1px solid rgba(255, 120, 230, 0.45);
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    backdrop-filter: blur(6px);
    font: 500 12px/1.25 system-ui, sans-serif;
    transition: transform 160ms ease, background 160ms ease;
    max-width: 260px;
}
.ft-credit.is-visible { display: inline-flex; }
.ft-credit:hover { transform: translateY(-1px); background: rgba(28, 0, 50, 0.88); }
.ft-credit__img {
    width: 32px; height: 32px;
    border-radius: 6px;
    object-fit: cover;
    background: #220033;
    flex: 0 0 auto;
}
.ft-credit__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ft-credit__title {
    font-weight: 700;
    color: #ffd1f5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.ft-credit__artist {
    color: #b39adb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.ft-credit__brand {
    color: #ff8eea;
    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* ── Volume button (top-right) ───────────────────────────────────────────── */
.ft-volume {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 5;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 130, 235, 0.52);
    border-radius: 8px;
    background: rgba(6, 0, 15, 0.66);
    cursor: pointer;
    padding: 0;
    transition: transform 140ms ease, background 140ms ease;
}
.ft-volume:hover { transform: translateY(-1px); background: rgba(30, 0, 55, 0.88); }
.ft-volume__icon {
    width: 18px;
    height: 18px;
    display: block;
    filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 90, 220, 0.6));
}

.ft-fullscreen {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 130, 235, 0.52);
    border-radius: 8px;
    background: rgba(6, 0, 15, 0.66);
    cursor: pointer;
    padding: 0;
    transition: transform 140ms ease, background 140ms ease;
}
.ft-fullscreen:hover { transform: translateY(-1px); background: rgba(30, 0, 55, 0.88); }
.ft-fullscreen[hidden] { display: none !important; }
.ft-fullscreen__icon {
    width: 18px;
    height: 18px;
    display: block;
    filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 90, 220, 0.6));
}

/* ── Trailer voting panel (left of volume; mirrors runway footer buttons) ─── */
.ft-vote-panel {
    position: absolute;
    right: 64px;
    bottom: 10px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}
.ft-vote-panel.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.ft-vote-panel .runway-rating-btn {
    background: rgba(6, 0, 15, 0.66);
    border: 1px solid rgba(255, 130, 235, 0.52);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    padding: 0;
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.ft-vote-panel .runway-rating-btn svg {
    width: 18px;
    height: 18px;
    fill: rgba(240, 128, 204, 0.86);
    display: block;
    transition: fill 0.15s;
}
.ft-vote-panel .runway-rating-btn svg * { fill: inherit; }
.ft-vote-panel .runway-rating-btn:hover {
    background: rgba(30, 0, 55, 0.88);
    border-color: rgba(255, 130, 235, 0.8);
}
.ft-vote-panel .runway-rating-btn:hover svg { fill: rgba(255, 170, 235, 1); }
.ft-vote-panel .runway-rating-btn:active { transform: scale(0.92); }
.ft-vote-panel .runway-rating-btn.voted {
    background: rgba(212, 68, 160, 0.26);
    border-color: rgba(212, 68, 160, 0.9);
}
.ft-vote-panel .runway-rating-btn.voted svg { fill: #f080cc; }

/* ── Playback redline ─────────────────────────────────────────────────────── */
.ft-progress {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 3;
    height: 3px;
    background: rgba(0, 0, 0, 0.4);
    overflow: hidden;
}
.ft-progress__bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff2bb1, #ff60d8 60%, #ff2bb1);
    box-shadow: 0 0 8px rgba(255, 60, 190, 0.9);
    transition: width 80ms linear;
}

/* ── Live walker handle plate (bottom-center) ────────────────────────────── */
.ft-nameplate {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 4;
    opacity: 0;
    pointer-events: none;
    padding: 8px 14px 9px;
    border-radius: 0;
    border: 1px solid rgba(255, 120, 230, 0.52);
    background: rgba(0, 0, 0, 0.72);
    min-width: 240px;
    text-align: center;
    transition: opacity 220ms ease;
}
.ft-nameplate.is-visible { opacity: 1; }
.ft-nameplate__display {
    display: block;
    color: #ffd4ff;
    font: 800 14px/1.05 system-ui, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    letter-spacing: 0.06em;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(72vw, 420px);
    text-shadow:
        0 0 7px rgba(255, 110, 230, 0.9),
        0 0 16px rgba(170, 90, 255, 0.75);
    animation: ft-nameplate-pulse 980ms ease-in-out infinite alternate;
}
.ft-nameplate__handle {
    display: block;
    margin-top: 4px;
    color: #dcb8ff;
    font: 700 12px/1 system-ui, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    letter-spacing: 0.09em;
    text-transform: lowercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(72vw, 420px);
}

@keyframes ft-nameplate-pulse {
    from {
        color: #ffc4f8;
        text-shadow:
            0 0 6px rgba(255, 120, 235, 0.9),
            0 0 12px rgba(180, 90, 255, 0.7);
    }
    to {
        color: #e8b8ff;
        text-shadow:
            0 0 10px rgba(255, 80, 210, 1),
            0 0 20px rgba(138, 76, 255, 0.95);
    }
}

/* ── End card ─────────────────────────────────────────────────────────────── */
.ft-endcard {
    position: absolute;
    inset: 0;
    z-index: 7;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: #000;
    color: #fff;
    opacity: 0;
    transition: opacity 600ms ease;
    text-align: center;
    padding: 24px;
}
.ft-endcard.is-visible { display: flex; opacity: 1; }
.ft-endcard__mark {
    width: clamp(24px, 5vw, 34px);
    height: auto;
    display: block;
    filter:
        hue-rotate(280deg)
        saturate(210%)
        brightness(1.18)
        drop-shadow(0 0 10px rgba(255, 75, 220, 0.75));
}
.ft-endcard__brand {
    color: #fff;
    font: 700 12px/1 system-ui, sans-serif;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    opacity: 0.9;
}
.ft-endcard__title {
    font: 700 clamp(20px, 4vw, 36px) / 1.1 system-ui, sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ff60d8, #c084fc, #ff60d8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 30px rgba(255, 90, 200, 0.4);
}
.ft-endcard__sub {
    color: #d8b4fe;
    font: 500 14px/1.4 system-ui, sans-serif;
    letter-spacing: 0.06em;
    max-width: 480px;
}
.ft-endcard__row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.ft-endcard__btn {
    appearance: none;
    border: none;
    padding: 12px 26px;
    font: 700 14px/1 system-ui, sans-serif;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 140ms ease, box-shadow 140ms ease;
}
.ft-endcard__btn--replay {
    background: transparent;
    color: #ff8eea;
    box-shadow: 0 0 0 2px #ff8eea inset;
}
.ft-endcard__btn--runway {
    background: linear-gradient(135deg, #ff2bb1, #8a1cff);
    color: #fff !important;
    box-shadow: 0 8px 22px -6px rgba(255, 50, 200, 0.7);
}
.ft-endcard__btn--runway:link,
.ft-endcard__btn--runway:visited {
    color: #fff !important;
}
.ft-endcard__row--close {
    margin-top: 18px;
}
.ft-endcard__btn--close {
    min-width: 164px;
    background: transparent;
    color: #d0d0d0;
    border: 1px solid rgba(170, 170, 170, 0.85);
    border-radius: 0;
    box-shadow: none;
    letter-spacing: 0.14em;
}
.ft-endcard__btn--close:hover {
    background: rgba(130, 130, 130, 0.22);
    border-color: rgba(206, 206, 206, 0.95);
    color: #f0f0f0;
}
.ft-endcard__btn:hover { transform: translateY(-2px) scale(1.03); }
.ft-endcard__or {
    color: #888;
    font: 500 12px/1 system-ui, sans-serif;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    align-self: center;
}

.fashion-trailer.is-fullscreen .ft-credit { left: calc(10px + env(safe-area-inset-left)); }
.fashion-trailer.is-fullscreen .ft-vote-panel { right: calc(64px + env(safe-area-inset-right)); bottom: calc(10px + env(safe-area-inset-bottom)); }
.fashion-trailer.is-fullscreen .ft-volume { right: calc(10px + env(safe-area-inset-right)); bottom: calc(10px + env(safe-area-inset-bottom)); }
.fashion-trailer.is-fullscreen .ft-fullscreen { top: calc(10px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); }
.fashion-trailer.is-fullscreen .ft-nameplate {
    bottom: calc(72px + env(safe-area-inset-bottom));
    max-width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 20px);
}

/* ── Desktop fullscreen: scale overlay elements with --ft-ui-scale ────────── */
.fashion-trailer.is-fullscreen:not(.is-mobile) {
    --s: var(--ft-ui-scale, 1);
}

/* Credit card */
.fashion-trailer.is-fullscreen:not(.is-mobile) .ft-credit {
    left: calc(10px * var(--s) + env(safe-area-inset-left));
    bottom: calc(18px * var(--s));
    gap: calc(8px * var(--s));
    padding: calc(6px * var(--s)) calc(10px * var(--s)) calc(6px * var(--s)) calc(6px * var(--s));
    border-radius: calc(10px * var(--s));
    font-size: calc(12px * var(--s));
    max-width: calc(260px * var(--s));
}
.fashion-trailer.is-fullscreen:not(.is-mobile) .ft-credit__img {
    width: calc(32px * var(--s));
    height: calc(32px * var(--s));
    border-radius: calc(6px * var(--s));
}
.fashion-trailer.is-fullscreen:not(.is-mobile) .ft-credit__title,
.fashion-trailer.is-fullscreen:not(.is-mobile) .ft-credit__artist {
    max-width: calc(200px * var(--s));
}

/* Volume + fullscreen buttons */
.fashion-trailer.is-fullscreen:not(.is-mobile) .ft-volume,
.fashion-trailer.is-fullscreen:not(.is-mobile) .ft-fullscreen {
    width: calc(36px * var(--s));
    height: calc(36px * var(--s));
    border-radius: calc(8px * var(--s));
}
.fashion-trailer.is-fullscreen:not(.is-mobile) .ft-volume { right: calc(10px * var(--s) + env(safe-area-inset-right)); bottom: calc(10px * var(--s) + env(safe-area-inset-bottom)); }
.fashion-trailer.is-fullscreen:not(.is-mobile) .ft-fullscreen { top: calc(10px * var(--s) + env(safe-area-inset-top)); right: calc(10px * var(--s) + env(safe-area-inset-right)); }
.fashion-trailer.is-fullscreen:not(.is-mobile) .ft-volume__icon,
.fashion-trailer.is-fullscreen:not(.is-mobile) .ft-fullscreen__icon {
    width: calc(18px * var(--s));
    height: calc(18px * var(--s));
}

/* Vote panel */
.fashion-trailer.is-fullscreen:not(.is-mobile) .ft-vote-panel {
    right: calc(64px * var(--s) + env(safe-area-inset-right));
    bottom: calc(10px * var(--s) + env(safe-area-inset-bottom));
    gap: calc(6px * var(--s));
}
.fashion-trailer.is-fullscreen:not(.is-mobile) .ft-vote-panel .runway-rating-btn {
    width: calc(36px * var(--s));
    height: calc(36px * var(--s));
    border-radius: calc(8px * var(--s));
}
.fashion-trailer.is-fullscreen:not(.is-mobile) .ft-vote-panel .runway-rating-btn svg {
    width: calc(18px * var(--s));
    height: calc(18px * var(--s));
}

/* Nameplate */
.fashion-trailer.is-fullscreen:not(.is-mobile) .ft-nameplate {
    bottom: calc(18px * var(--s) + env(safe-area-inset-bottom));
    padding: calc(8px * var(--s)) calc(14px * var(--s)) calc(9px * var(--s));
    min-width: calc(240px * var(--s));
}
.fashion-trailer.is-fullscreen:not(.is-mobile) .ft-nameplate__display {
    font-size: calc(14px * var(--s));
    max-width: min(72vw, calc(420px * var(--s)));
}
.fashion-trailer.is-fullscreen:not(.is-mobile) .ft-nameplate__handle {
    font-size: calc(12px * var(--s));
    margin-top: calc(4px * var(--s));
    max-width: min(72vw, calc(420px * var(--s)));
}

@media (max-width: 760px) {
    .fashion-trailer-section {
        max-width: none;
        padding: 0 8px;
    }

    .fashion-trailer {
        width: 100%;
        margin-left: 0;
        border-radius: 12px;
        box-shadow:
            0 0 0 1px rgba(255, 105, 247, 0.3),
            0 12px 26px -14px rgba(180, 0, 220, 0.5);
    }

    .ft-credit {
        left: 8px;
        bottom: 8px;
        max-width: min(58vw, 198px);
        padding: 5px 8px 5px 5px;
    }

    .ft-credit__img {
        width: 28px;
        height: 28px;
    }

    .ft-credit__title,
    .ft-credit__artist {
        max-width: min(44vw, 156px);
    }

    .ft-vote-panel {
        right: 52px;
        bottom: 8px;
        gap: 4px;
    }

    .ft-vote-panel .runway-rating-btn,
    .ft-volume,
    .ft-fullscreen {
        width: 32px;
        height: 32px;
        border-radius: 7px;
    }

    .ft-vote-panel .runway-rating-btn svg,
    .ft-volume__icon,
    .ft-fullscreen__icon {
        width: 16px;
        height: 16px;
    }

    .ft-fullscreen {
        top: 8px;
        right: 8px;
    }

    .ft-volume {
        right: 8px;
        bottom: 8px;
    }

    .ft-nameplate {
        bottom: 58px;
        left: 50%;
        transform: translateX(-50%);
        padding: 6px 10px 7px;
        min-width: min(170px, calc(100vw - 28px));
        max-width: calc(100vw - 24px);
    }

    .ft-nameplate__display {
        font-size: 12px;
        max-width: calc(100vw - 48px);
    }

    .ft-nameplate__handle {
        font-size: 10px;
        max-width: calc(100vw - 48px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .fashion-trailer canvas { transition: none; }
    .ft-endcard__btn:hover { transform: none; }
}
