/* ── Trailer popup ── */
.trailer-modal {
    position: fixed;
    inset: 0;
    z-index: 10100;
    display: grid;
    place-items: center;
    padding: 24px;
    visibility: hidden;
    pointer-events: none;
}

.trailer-modal.is-open {
    visibility: visible;
    pointer-events: auto;
}

.trailer-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 40%, rgba(47, 143, 255, 0.18), transparent 60%),
        rgba(2, 6, 16, 0.86);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.trailer-modal.is-open .trailer-backdrop {
    opacity: 1;
}

.trailer-dialog {
    position: relative;
    width: min(1100px, 100%);
    opacity: 0;
    transform: translateY(28px) scale(0.94);
    transition:
        opacity 0.4s ease,
        transform 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.15);
}

.trailer-modal.is-open .trailer-dialog {
    opacity: 1;
    transform: none;
}

.trailer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.trailer-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.trailer-title-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(180deg, #1f7bff, #1159d6);
    box-shadow: 0 0 22px rgba(31, 123, 255, 0.55);
    color: #ffffff;
}

.trailer-title-icon svg {
    width: 16px;
    height: 16px;
    margin-left: 2px;
}

.trailer-title-text span {
    display: block;
    color: #4fb3ff;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.trailer-title-text strong {
    display: block;
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.trailer-close {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(90, 160, 255, 0.3);
    background: rgba(8, 16, 32, 0.8);
    color: #dbe7f7;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.trailer-close svg {
    width: 18px;
    height: 18px;
}

.trailer-close:hover,
.trailer-close:focus-visible {
    transform: rotate(90deg);
    border-color: rgba(255, 106, 31, 0.7);
    background: rgba(255, 106, 31, 0.14);
    color: #ffffff;
    outline: none;
}

.trailer-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    background: #000000;
    border: 1px solid rgba(90, 160, 255, 0.28);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(31, 123, 255, 0.25);
}

.trailer-frame::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 2;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(120deg, rgba(79, 179, 255, 0.9), transparent 35%, transparent 65%, rgba(255, 106, 31, 0.8));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.trailer-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.trailer-frame.is-loaded iframe {
    opacity: 1;
}

.trailer-loader {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    color: #8d9bb3;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: opacity 0.3s ease;
}

.trailer-frame.is-loaded .trailer-loader {
    opacity: 0;
}

.trailer-loader i {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 3px solid rgba(79, 179, 255, 0.18);
    border-top-color: #4fb3ff;
    animation: trailerSpin 0.9s linear infinite;
}

.trailer-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    color: #6f7f98;
    font-size: 0.74rem;
}

.trailer-foot a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #b9c6da;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.trailer-foot a:hover {
    color: #ffffff;
}

.trailer-foot svg {
    width: 16px;
    height: 16px;
    color: #ff3d3d;
}

.trailer-foot kbd {
    padding: 1px 6px;
    border-radius: 5px;
    border: 1px solid rgba(90, 160, 255, 0.25);
    background: rgba(8, 16, 32, 0.8);
    color: #b9c6da;
    font-family: inherit;
    font-size: 0.68rem;
}

html.trailer-lock,
html.trailer-lock body {
    overflow: hidden;
}

@keyframes trailerSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .trailer-modal {
        padding: 14px;
    }

    .trailer-title-text strong {
        font-size: 0.95rem;
    }

    .trailer-frame {
        border-radius: 12px;
    }

    .trailer-foot-hint {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .trailer-backdrop,
    .trailer-dialog,
    .trailer-frame iframe,
    .trailer-close {
        transition: none;
    }

    .trailer-loader i {
        animation-duration: 2s;
    }
}
