/* One film-card presentation for home, discovery, series, credits and libraries. */
body .filmatch-movie-cell { min-width: 0; container-type: inline-size; container-name: film-card; }
body .movie-card-grid, body #mypageContent.movie-card-grid, body.person-page #personMovies.movie-card-grid, body.discovery-page .search-result-movies .search-results-grid.movie-card-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
    margin: 20px 0; align-items: stretch;
}
body .movie-card-grid > .filmatch-movie-cell,
body .public-film > .filmatch-movie-cell { width: 100%; max-width: none; padding: 0; }
body .movie-card-scroller {
    display: flex; flex-wrap: nowrap; align-items: stretch; gap: 20px;
    min-width: 0; max-width: 100%; overflow-x: auto; padding: 4px 0 14px;
    overscroll-behavior-inline: contain; scroll-snap-type: x proximity;
    scrollbar-width: thin;
}
body .movie-card-scroller:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 3px; }
body .movie-card-scroller > .filmatch-movie-cell { flex: 0 0 300px; width: 300px; max-width: none; padding: 0; scroll-snap-align: start; }
body .filmatch-movie-card.movie-card {
    display: block; position: relative; width: 100%; min-width: 0; max-width: none;
    min-height: 440px; height: 100%; margin: 0; isolation: isolate; overflow: hidden;
    border: 1px solid #ffffff20; border-radius: 18px; background: #111821; box-shadow: none;
}
body .filmatch-movie-card::before { position: absolute; z-index: -1; inset: -15%; background: var(--home-art, none) center / cover no-repeat; filter: blur(45px) saturate(1.25); opacity: .55; content: ""; pointer-events: none; }
body .filmatch-movie-card .movie-card-link { display: block; position: relative; height: 100%; min-height: inherit; color: #fff; text-decoration: none; }
body .filmatch-movie-card .movie-card-poster { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border: 0; border-radius: inherit; background: transparent; box-shadow: none; transform: none; }
body .filmatch-movie-card .movie-card-poster::after { position: absolute; inset: 0; background: linear-gradient(180deg, #060b1100 35%, #060b1166 55%, #060b11f5 83%), linear-gradient(90deg, #060b1166, transparent 75%); content: ""; pointer-events: none; }
body .filmatch-movie-card .movie-card-poster img { width: 100%; height: 100%; object-fit: cover; object-position: center 32%; opacity: .92; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
body .filmatch-movie-card .movie-card-poster img[hidden] { display: none; }
body .filmatch-movie-card .movie-poster-empty { width: 100%; height: 100%; background: #17212b; }
body .filmatch-movie-card .movie-card-copy { position: absolute; z-index: 2; right: 34px; bottom: 100px; left: 34px; padding: 0; }
body .filmatch-movie-card .movie-card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; min-height: 0; margin: 0; overflow: hidden; color: #f8faf9; font-size: clamp(22px, 2.1vw, 30px); font-weight: 780; line-height: 1.3; letter-spacing: -.055em; text-shadow: 0 2px 20px #0007; overflow-wrap: anywhere; }
body .filmatch-movie-card .movie-card-year { color: #d0d8de; margin-top: 14px; font-size: 12px; letter-spacing: .14em; }
body .filmatch-movie-card .movie-card-rating { z-index: 2; left: 26px; top: 26px; bottom: auto; padding: 7px 10px; font-size: 13px; background: #090f18c9; }
body .filmatch-movie-card .movie-card-stamp { z-index: 2; top: 26px; right: 26px; }
body .filmatch-movie-card .movie-card-actions { display: flex; position: absolute; z-index: 3; right: 34px; bottom: 30px; left: 34px; gap: 10px; }
body .filmatch-movie-card .movie-action { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 8px 4px; border: 1px solid #ffffff35; border-radius: 6px; background: #ffffff0d; color: #f2f5f7; backdrop-filter: blur(14px); font-size: 13px; }
body .movie-card-actions .movie-action-label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body .movie-card-actions :is(.bi, .watched-icon) { flex-shrink: 0; }
body .filmatch-movie-card .movie-action:hover, body .filmatch-movie-card .movie-action.btn-active { color: var(--app-accent); border-color: #d7f56b70; background: #d7f56b18; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { body .filmatch-movie-card .movie-card-link:hover .movie-card-poster img { transform: scale(1.035); } }
@media (max-width: 1000px) { body .movie-card-grid, body #mypageContent.movie-card-grid, body.person-page #personMovies.movie-card-grid, body.discovery-page .search-result-movies .search-results-grid.movie-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } }
@container film-card (max-width: 260px) {
    body .filmatch-movie-card.movie-card { min-height: 350px; }
    body .filmatch-movie-card .movie-card-title { font-size: 18px; line-height: 1.4; }
    body .filmatch-movie-card .movie-card-copy { left: 12px; right: 12px; bottom: 88px; }
    body .filmatch-movie-card .movie-card-actions { left: 8px; right: 8px; bottom: 12px; gap: 6px; }
    body .filmatch-movie-card .movie-action { min-height: 44px; gap: 3px; padding: 5px 2px; font-size: 11px; }
    body .filmatch-movie-card .movie-card-rating { top: 8px; left: 8px; padding: 4px 6px; font-size: 10px; }
    body .filmatch-movie-card .movie-card-stamp { top: 38px; right: 8px; font-size: 8px; }
    body .filmatch-movie-card .movie-card-year { margin-top: 8px; font-size: 10px; }
    body .filmatch-movie-card .movie-card-recommendation-reason { font-size: 11px; }
}
@media (max-width: 680px) {
    body .movie-card-grid, body #mypageContent.movie-card-grid, body.person-page #personMovies.movie-card-grid, body.discovery-page .search-result-movies .search-results-grid.movie-card-grid { gap: 12px; }
    body .movie-card-scroller { gap: 12px; }
    body .movie-card-scroller > .filmatch-movie-cell { flex: 0 0 clamp(128px, calc((100vw - 52px) / 2), 220px); width: auto; }
}
@media (prefers-reduced-motion: reduce) { body .filmatch-movie-card .movie-card-poster img { transition: none; } }
body .movie-strip > .filmatch-movie-card { flex: 0 0 300px; width: 300px; }
body .movie-card-grid .ranking-grid-item { width: 100%; max-width: none; height: 100%; }
body .filmatch-movie-card .movie-action-label { display: inline; }
body .home-release-grid > .filmatch-movie-cell > .filmatch-movie-card { height: auto; }
body .home-release-date { margin: 10px 0 0; color: var(--app-muted); font-size: 12px; }
@media (max-width: 680px) { body .movie-strip > .filmatch-movie-card { flex-basis: clamp(128px, calc((100vw - 52px) / 2), 220px); width: clamp(128px, calc((100vw - 52px) / 2), 220px); min-height: 350px; } }
body .movie-card-state-status { grid-column: 1 / -1; flex-basis: 100%; margin-top: 12px; color: var(--app-muted); font-size: 13px; }

/* The library is a compact record shelf. Preserve the existing poster overlays
   and controls; discovery and home keep their larger cinematic cards. */
body.library-page #mypageContent.movie-card-grid.library-shelf {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}
body .library-shelf-card.filmatch-movie-card.movie-card {
    min-height: 260px;
    aspect-ratio: 2 / 3.5;
    border-radius: 10px;
}
body .library-shelf-card .movie-card-copy { left: 10px; right: 10px; bottom: 62px; }
body .library-shelf-card .movie-card-title { font-size: 15px; line-height: 1.4; -webkit-line-clamp: 2; letter-spacing: -.02em; }
body .library-shelf-card .movie-card-year { margin-top: 3px; font-size: 10px; }
body .library-shelf-card .movie-card-actions { left: 6px; right: 6px; bottom: 6px; gap: 4px; }
body .library-shelf-card .movie-action { min-height: 44px; padding: 6px 2px; font-size: 14px; }
body .library-shelf-card .movie-card-actions .movie-action-label { display: none; }
body .library-shelf-card .movie-card-actions .watchlist-action.btn-active .bi { display: inline-block; }
body .has-personal-rating .movie-card-stamp { display: none; }
body .has-personal-rating .movie-card-personal-rating {
    display: flex; flex-direction: column; gap: 3px;
    position: absolute; z-index: 2; top: 10px; left: 10px; right: 10px;
    width: fit-content; max-width: calc(100% - 20px); padding: 6px 8px;
    border-radius: 6px; color: var(--app-accent); background: #090f18e8;
    line-height: 1.4;
}
body .movie-card-personal-label { font-size: 10px; color: #d1dcc6; }
body .movie-card-personal-rating strong { font-size: 16px; }
body .has-personal-rating .movie-card-rating { top: 76px; left: 12px; padding: 0; color: #bdc7d1; background: #090f18b8; font-size: 10px; font-weight: 400; }
body .has-personal-rating .movie-card-rating small { font-size: inherit; }
@media (min-width: 1100px) {
    body.library-page #mypageContent.movie-card-grid.library-shelf { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    body.library-page #mypageContent.movie-card-grid.library-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    body .library-shelf-card.filmatch-movie-card.movie-card { min-height: 200px; border-radius: 6px; }
    body .library-shelf-card .movie-card-copy { left: 5px; right: 5px; bottom: 55px; }
    body .library-shelf-card .movie-card-title { font-size: 13px; }
    body .library-shelf-card .movie-card-year { font-size: 9px; }
    body .library-shelf-card .movie-card-actions { left: 3px; right: 3px; bottom: 4px; gap: 3px; }
    body .library-shelf-card .movie-action { font-size: 12px; border-radius: 4px; }
    body .library-shelf-card.has-personal-rating .movie-card-personal-rating { top: 5px; left: 4px; right: 4px; max-width: calc(100% - 8px); padding: 4px; gap: 2px; }
    body .library-shelf-card .movie-card-personal-label { font-size: 8px; }
    body .library-shelf-card .movie-card-personal-rating strong { font-size: 11px; }
    body .library-shelf-card.has-personal-rating .movie-card-rating { top: 55px; left: 5px; padding: 1px; font-size: 8px; }
}
