@keyframes poster-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.game-poster[data-fallback],
.trending-poster[data-fallback],
.media-poster[data-fallback],
.timeline-card-poster[data-fallback] {
    position: relative;
    background-color: #131c28;
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.045) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    background-repeat: no-repeat;
    animation: poster-shimmer 1.8s ease-in-out infinite;
    overflow: hidden;
}

.game-poster[data-fallback]::after,
.trending-poster[data-fallback]::after,
.media-poster[data-fallback]::after,
.timeline-card-poster[data-fallback]::after {
    content: attr(data-fallback);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
    padding: 10px 8px 14px;
    color: rgba(255, 255, 255, 0.62);
    font-weight: 700;
    font-size: 0.82rem;
    line-height: 1.3;
    word-break: break-word;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    letter-spacing: 0.2px;
}

.game-poster[data-fallback-icon]::before,
.trending-poster[data-fallback-icon]::before,
.media-poster[data-fallback-icon]::before,
.timeline-card-poster[data-fallback-icon]::before {
    content: attr(data-fallback-icon);
    position: absolute;
    inset: 0 0 auto 0;
    top: 22%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
    filter: grayscale(0.5);
}

.game-poster[data-fallback] img,
.trending-poster[data-fallback] img,
.media-poster[data-fallback] img,
.timeline-card-poster[data-fallback] img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    font-size: 0;
    color: transparent;
}

.game-poster.img-ok[data-fallback],
.trending-poster.img-ok[data-fallback],
.media-poster.img-ok[data-fallback],
.timeline-card-poster.img-ok[data-fallback],
.game-poster.no-cover[data-fallback],
.media-poster.no-cover[data-fallback],
.timeline-card-poster.no-cover[data-fallback] {
    animation: none;
    background-image: none;
}

html.no-animations .game-poster[data-fallback],
html.no-animations .trending-poster[data-fallback],
html.no-animations .media-poster[data-fallback],
html.no-animations .timeline-card-poster[data-fallback] {
    animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .game-poster[data-fallback],
    .trending-poster[data-fallback],
    .media-poster[data-fallback],
    .timeline-card-poster[data-fallback] {
        animation: none;
    }
}
