.movie-cards-container {
    content-visibility: auto;
    contain-intrinsic-size: auto 520px;
}

.new_movie-card {
    float: none;
    flex: 0 0 auto;
    margin: 4px;
    width: min(180px, calc(50vw - 14px));
    height: auto;
    min-height: 256px;
    aspect-ratio: 45 / 64;
    overflow: hidden;
    border-radius: 10px;
    background: #12151c;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.new_movie-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.new_movie-card > .new_movie-card_poster,
.new_movie-card > div:nth-child(1) {
    position: relative;
    height: 100%;
}
.new_movie-card_rating {
    display: inline-block;
    width: auto;
    height: 18px;
    color: #fff;
    line-height: 1.7em;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    padding: 0px 8px;
}
.new_movie-card_view {
    position: absolute;
    z-index: 4;
    width: auto;
    height: auto;
    min-height: 18px;
    left: 0;
    top: 0;
    color: #fff;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    line-height: 1.5;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    padding: 3px 8px;
    margin: 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}
.new_movie-card_vq {
    position: absolute;
    width: auto;
    height:18px;
    right: 0;
    top: 0;
    color: #fff;
    background: #e82022;
    line-height: 1.7em;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    padding: 0px 8px;
    margin: 4px;
    border-radius: 4px;
}
.new_movie-card_rating_red {
    border-color:crimson;
}
.new_movie-card_rating_green {
    border-color:#29b474;
}
.new_movie-card_rating_yellow {
    border-color:#f9ab00;
}
.new_movie-card_play {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    opacity: 0;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    align-content: center;
    width: 100%;
    height: 100%;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.new_movie-card_play a {
    pointer-events: auto;
}
.new_movie-card_play_outer-circle {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    width: 70px;
    height: 70px;
    color: crimson;
    border-radius: 50%;
    transition: background-color 0.5s ease;
}
.new_movie-card_play_outer-circle:hover {
    background: crimson;
}
.new_movie-card_play_inner-circle {
    margin: 7px;
    background: #fff;
    width: 56px;
    height: 56px;
    color: crimson;
    text-align: center;
    border-radius: 50%;
    line-height: 4em;
    display: flex;
    justify-content: center;
    align-items: center;
}
.new_movie-card_poster:hover .new_movie-card_play {
    opacity: 1;
}
.new_movie-card_poster:hover img {
    filter: brightness(70%);
}
.new_movie-card img {
    transition: 0.5s filter ease, 0.5s -webkit-filter ease;
}
.new_movie-card_content {
    width: 100%;
    height: 64px;
    background: #1e1d22;
}
.new_movie-card_content_a {
    width: 100%;
    height: 22px;
    background: #393c43;
    text-align: center;
    color: #c1ccde !important;
    line-height: 2.0em;
}
.new_movie-card_poster {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border-radius: inherit;
    background: #0e1118;
}

.new_movie-card_poster-img,
.new_movie-card_poster > img {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    object-fit: cover;
    object-position: center top;
    display: block;
    border-radius: inherit;
    transform: none;
}

/* cache/HTML เก่าที่ยังใช้ class position-absolute ของ Bootstrap */
.new_movie-card_poster > img.position-absolute {
    inset: 0;
    width: 100%;
    height: 100%;
}

.new_movie-card_movie-name-bg {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 50%;
    max-height: 140px;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.55) 45%,
        rgba(0, 0, 0, 0.92) 100%
    );
    pointer-events: none;
    z-index: 1;
}

.new_movie-card_movie-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 0 10px 10px;
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    box-sizing: border-box;
    pointer-events: none;
    max-height: 5.2em;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.new_movie-card_title {
    padding-left: 6px;
    padding-top: 6px;
    font-weight: bold;
    font-size: 12px;
    transition: 0.4s;
    transition-property: color, background-color, border-color, opacity;
    color:#fff;
    text-decoration: none;
    width: 100%;
    max-width: 100%;
    height: auto;
    overflow:hidden;
    display:block;
    box-sizing: border-box;
}
.new_movie-card_title:hover {
    color:crimson;
    text-decoration: none;
}
.new_movie-card_genres {
    margin-left: 5px;
    font-size: 12px;
    transition: 0.4s;
    transition-property: color, background-color, border-color, opacity;
    color:#fff;
}
.new_movie-card_genres:hover {
    color:#fff;
    text-decoration: none;
}
/* ป้ายคุณภาพมุมขวาบน (HTML ใหม่ + cache เก่าที่ยังเป็น ribbon) */
.movie-card-quality-badge,
.movie-card-ribbon {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    z-index: 12;
    width: auto;
    height: auto;
    overflow: visible;
    pointer-events: none;
}

.movie-card-quality-badge,
.movie-card-ribbon-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    padding: 0.22rem 0.5rem;
    border-radius: 6px;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.movie-card-ribbon-inner {
    position: static;
    width: auto;
    height: auto;
    transform: none;
    left: auto;
    top: auto;
    margin: 0;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.movie-card-quality-badge--fullhd,
.movie-card-ribbon-fullhd {
    background: linear-gradient(135deg, #1a4fd8 0%, #2b8cff 55%, #67e8ff 100%);
}

.movie-card-quality-badge--hd,
.movie-card-ribbon-hd {
    background: linear-gradient(135deg, #b81212 0%, #e82022 55%, #ff6b4a 100%);
}

.movie-card-quality-badge--4k,
.movie-card-ribbon-4k {
    background: linear-gradient(135deg, #7a12a8 0%, #c026d3 50%, #f0abfc 100%);
}

.movie-card-quality-badge--zoom,
.movie-card-ribbon-zoom {
    background: linear-gradient(135deg, #0a6b20 0%, #16a34a 55%, #4ade80 100%);
}

.movie-card-ribbon-normal {
    display: none;
}

.new_movie-card--watched {
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.35),
        0 0 0 2px rgba(100, 200, 130, 0.45);
}

.new_movie-card--watched:hover {
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.45),
        0 0 0 2px rgba(120, 220, 150, 0.55);
}

.new_movie-card--watched .new_movie-card_poster-img,
.new_movie-card--watched .new_movie-card_poster > img {
    filter: saturate(0.9) brightness(0.97);
}

.new_movie-card--watched .new_movie-card_movie-name-bg {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(10, 40, 24, 0.5) 45%,
        rgba(12, 52, 30, 0.94) 100%
    );
}

.new_movie-card--watched .new_movie-card_movie-name {
    color: #d8f5df;
}

.new_movie-card_rating--watched {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    max-width: calc(100% - 8px);
    height: auto;
    min-height: 18px;
    line-height: 1.35;
}

.movie-card-watched-badge {
    display: inline-block;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(20, 120, 70, 0.92);
    border: 1px solid rgba(170, 245, 195, 0.55);
    color: #ecfdf3;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.35;
    pointer-events: none;
    white-space: nowrap;
}

.member-card-episode-alert {
    position: absolute;
    top: 0.45rem;
    left: 0.45rem;
    z-index: 11;
    max-width: calc(100% - 4.5rem);
    padding: 0.26rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-card-episode-alert--new {
    background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
}

.member-card-episode-alert--unwatched {
    background: linear-gradient(135deg, #2b8cff 0%, #1d6fd4 100%);
}

/* Smart TV / เบราว์เซอร์เก่า: ไม่มี aspect-ratio → การ์ดสูง 0 มองไม่เห็น */
@supports not (aspect-ratio: 1) {
    .new_movie-card {
        height: 256px;
        min-height: 256px;
    }
}

/* ทีวี / รีโมท: ปิด content-visibility (ถ้ามีใน cache CSS เก่า) และบังคับความสูง */
@media (hover: none), (pointer: coarse) {
    .new_movie-card {
        content-visibility: visible;
        contain-intrinsic-size: unset;
        min-height: 256px;
    }
}

@supports not (width: min(1px, 2px)) {
    .new_movie-card {
        width: 180px;
    }
}