.game-media { min-width: 0; }
.trailer-trigger {
    position: relative;
    display: block;
    cursor: pointer;
}

.trailer-badge {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1px solid var(--yellow);
    border-radius: 999px;
    background: rgba(8, 12, 20, .92);
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 24px #0008;
}

.trailer-badge span { color: var(--yellow); }
.trailer-trigger:hover .trailer-badge { background: #172b48; }
.gameplay-image-viewer { position: relative; padding: 0; overflow: hidden; border: 1px solid #34516b; border-radius: 12px; background: #000; color: var(--white); cursor: zoom-in; }
.gameplay-image-viewer img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
/* Hide stale markup from an already-running server until it reloads the compiled Razor view. */
.gameplay-image-hint, .gameplay-return-video { display: none !important; }
.gameplay-gallery { margin-top: 20px; }
.gameplay-gallery > .eyebrow { margin-bottom: 10px; font-size: .65rem; }
.gameplay-thumbnails { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.gameplay-thumbnail { position: relative; min-width: 0; padding: 0; overflow: hidden; border: 1px solid #34516b; border-radius: 6px; background: #0b1420; cursor: pointer; opacity: .7; transition: opacity .2s, border-color .2s, transform .2s; }
.gameplay-thumbnail img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gameplay-video-icon { position: absolute; top: 50%; left: 50%; display: grid; width: 34px; height: 34px; place-items: center; padding-left: 2px; transform: translate(-50%, -50%); border: 1px solid #ffffffa0; border-radius: 50%; background: #080e18d9; color: var(--yellow); font-size: .8rem; }
.gameplay-thumbnail:hover { transform: translateY(-2px); opacity: 1; border-color: #8db9dc; }
.gameplay-thumbnail.is-active, .gameplay-thumbnail[aria-pressed="true"] { opacity: 1; border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow); }
.gameplay-image-dialog { position: relative; width: min(1400px, calc(100vw - 36px)); max-width: none; max-height: calc(100dvh - 36px); margin: auto; padding: 14px; overflow: visible; border: 1px solid #52627b; border-radius: 12px; background: #080e18; box-shadow: 0 24px 100px #000b; }
.gameplay-image-dialog[open] { display: grid; place-items: center; }
.gameplay-image-dialog::backdrop { background: #000e; }
.gameplay-image-dialog > img { display: block; max-width: 100%; max-height: calc(100dvh - 64px); object-fit: contain; }
.gameplay-image-dialog .trailer-close { z-index: 1; top: 10px; right: 10px; transform: none; background: #101a29eF; }
.trailer-trigger:focus-visible,
.gameplay-image-viewer:focus-visible,
.gameplay-thumbnail:focus-visible,
.trailer-dialog button:focus-visible,
.gameplay-image-dialog button:focus-visible,
.trailer-dialog a:focus-visible {
    outline: 3px solid #73b5ff;
    outline-offset: 5px;
}

html.trailer-open { overflow: hidden; }

.trailer-dialog {
    width: min(1100px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: hidden;
    color: #f5f5f5;
    background: #0c111b;
    border: 1px solid #376ca2;
    border-radius: 16px;
    box-shadow: 0 24px 100px #000b;
}

.trailer-dialog::backdrop { background: rgba(0, 0, 0, .86); }
.trailer-heading {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 68px;
    padding: 12px 68px 12px 20px;
}
.trailer-heading h2 { margin: 0; font-size: 1.15rem; color: var(--yellow); }
.trailer-heading h2 span { color: #c4cbd6; font-weight: 400; }
.trailer-close {
    position: absolute;
    top: 50%;
    right: 12px;
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    transform: translateY(-50%);
    border: 1px solid #52627b;
    border-radius: 50%;
    background: #172235;
    color: white;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}
.trailer-close::before,
.trailer-close::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    content: "";
}
.trailer-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.trailer-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.trailer-dialog video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: calc(100dvh - 120px);
    object-fit: contain;
    background: #000;
}
@media (max-width: 600px) {
    .gameplay-gallery { margin-top: 16px; }
    .gameplay-thumbnails { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x mandatory; }
    .gameplay-thumbnail { flex: 0 0 28%; min-width: 88px; scroll-snap-align: start; }
    .gameplay-image-dialog { width: calc(100vw - 20px); padding: 8px; }
    .trailer-heading { min-height: 62px; padding: 10px 58px 10px 12px; }
    .trailer-heading h2 span { display: block; font-size: .9rem; }
    .trailer-close { right: 8px; width: 40px; height: 40px; }
}
