/* ==========================================================================
   Trailer backgrounds, hover previews, card tilt (pairs with fx.js)
   ========================================================================== */

/* ----- Blurred trailer behind the hero / game-page header ----- */
.hero, .game-head { position: relative; overflow: hidden; }
.hero > .container, .game-head > .container { position: relative; z-index: 1; }

.bg-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    container-type: size;
    opacity: 0;
    transition: opacity 1.6s ease;
}
.bg-video.playing { opacity: 1; }
.bg-video iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100cqw, 177.78cqh);
    height: max(100cqh, 56.25cqw);
    transform: translate(-50%, -50%) scale(1.25);
    border: 0;
    filter: blur(18px) brightness(0.7) saturate(1.3);
}
/* fade the video into the page so text stays readable */
.bg-video::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(11, 13, 16, 0.35) 0%, rgba(11, 13, 16, 0.55) 55%, var(--bg) 100%),
        radial-gradient(70% 90% at 20% 50%, rgba(11, 13, 16, 0.55), transparent 80%);
}

/* ----- Home cards: hover to play ----- */
.card-video {
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}
.card-video.playing { opacity: 1; }
.card-video iframe {
    width: 100%;
    height: 100%;
    border: 0;
    /* oversize so YouTube's title bar and control strip are cropped off */
    transform: scale(1.38);
}
.game-art .status { z-index: 3; }

.play-hint {
    position: absolute;
    left: 14px;
    bottom: 12px;
    z-index: 2;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(11, 13, 16, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 0.3s ease;
}
.game-art:has(.card-video.playing) .play-hint { opacity: 0; }
@media (hover: none) { .play-hint { display: none; } }

/* ----- Cards: tilt + light that follows the cursor ----- */
.game-card { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 0%; }
.game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 4;
    border-radius: inherit;
    background: radial-gradient(380px circle at var(--mx) var(--my), color-mix(in srgb, var(--c) 18%, transparent), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.game-card:hover::before { opacity: 1; }

@media (hover: hover) and (pointer: fine) {
    .js-reveal .game-card.reveal.in,
    .game-card {
        transition: transform 0.18s ease-out, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.7s ease;
    }
    .js-reveal .game-card.reveal.in:hover,
    .game-card:hover {
        transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-8px);
        transition-delay: 0ms;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bg-video, .card-video { display: none; }
}
