@media screen and (max-width: 640px) {
    .box-player {
        position: relative;
        z-index: 10;
        clear: both;
        height: 60vh;
    }

    #player {
        position: relative;
        height: 100%;
    }
}

.pagination {
    display: block;
    width: 100%;
    text-align: center;
}

.pagination ul {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding-left: 0;
    margin: 20px auto;
}

.pagination ul li {
    margin: 0;
}

.main-menu .menu-item > a::after {
    content: none;
}

.list-films.film-new .item .name {
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-films.film-new .item .name-title {
    width: 100%;
}

/* Owl already sizes each slot; the card must fill that slot at every breakpoint. */
.list-films #film_related .owl-item .item,
.list-films #film_hot .owl-item .item {
    float: none;
    width: calc(100% - 8px);
    height: auto;
    margin: 0 4px;
}

.list-films #film_related .item .img-film,
.list-films #film_hot .item .img-film {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.list-films #film_related .item .text a,
.list-films #film_hot .item .text a {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.home-genre-more {
    clear: both;
    margin: 12px 0 0;
    text-align: center;
}

.home-genre-more-link {
    display: inline-block;
    padding: 7px 14px;
    border: 1px solid #4c4c4c;
    border-radius: 4px;
    background: #252b35;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.home-genre-more-link:hover,
.home-genre-more-link:focus {
    border-color: #da966e;
    color: #da966e;
}

/* SexPlus retains the Fanxxx layout with landscape movie media. */
.list-films.film-new .item {
    height: auto !important;
}
.list-films .item > a {
    display: block;
    position: relative;
}
.list-films .item .img-film,
.list-films.film-hot .item .img-film,
.list-films #film_hot .item .img-film,
.list-films #film_related .item .img-film {
    display: block;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.list-film .film-item-ver img.avatar {
    width: 96px;
    height: 54px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
#page-info .poster > a > img {
    width: 100% !important;
    height: auto;
    max-height: none;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Player fixes retain the original controls and a 16:9 video surface. */
.box-player { height: auto !important; }
#player.embed-responsive { position: relative; width: 100%; height: auto !important; padding: 0; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
#player iframe, #player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
#player .player-error { position: absolute; bottom: 45px; width: 100%; padding: 8px; background: #222; color: #fff; }
.div-control { overflow: auto; padding: 5px 0; }
.video-btn, .streaming-server { font-size: 14px; min-height: 34px; }
.tip-change-server { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; }
body.lights-off::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 98; }
body.lights-off #box-player, body.lights-off .div-control, body.lights-off .tip-change-server { position: relative; z-index: 99; }
/* Carousels follow the actual landscape card height. */
#film_hot, #film_related { height: auto !important; }


/* SexPlus: a restrained teal identity on the original Fanxxx layout. */
:root { --site-accent: #39cbb6; --site-accent-soft: #87e7dd; --site-header: #122c35; --site-card: #102129; }
#header, .main-menu, .main-menu.fix-nav { background: var(--site-header); }
#footer { background: #10242c; border-top: 1px solid #26454e; }
.main-menu .menu-item.active > a, .main-menu .menu-item > a:hover { color: var(--site-accent-soft); border-bottom-color: var(--site-accent); }
.title-box, .title-box a, .right-content .caption, .right-content .caption span { color: var(--site-accent-soft); }
.title-box .tab.active { border-color: var(--site-accent); }
.breadcrumb a { color: var(--site-accent-soft) !important; }
.list-films .item { border: 1px solid #29434b; border-radius: 6px; background: var(--site-card); }
.list-films.film-new .item .name { position: static; height: 46px !important; opacity: 1; padding: 5px 7px; background: var(--site-card) !important; }
.list-films.film-new .item .name-title { font-size: 14px; line-height: 18px; }
.list-films .item > a { overflow: hidden; }
.list-films .item .icon-play { background: #139c90 !important; }
.list-films.film-hot .item .text { background: rgba(8,26,33,.9); font-size: 14px; }
.list-film .film-item-ver img.avatar { border-color: #3b6975; border-radius: 4px; }
.list-film .number-rank, span.label1 { background: #137e79; border-color: #137e79; }
.list-episode a.current { background: #138f86; color: #fff; }
.pagination ul li a.current { border-color: var(--site-accent); color: var(--site-accent-soft); }
.home-genre-more-link { background: #15343d; border-color: #2a5965; font-size: 14px; }
.home-genre-more-link:hover, .home-genre-more-link:focus { color: var(--site-accent-soft); border-color: var(--site-accent); }
#page-info .poster { overflow: hidden; border-radius: 6px; }
#page-info .poster .btn-danger { background: #148d83; border-color: #148d83; font-size: 14px; }
.poster .play-button { top: 38%; }
#keyword { border-radius: 5px; border: 1px solid #36616c; padding-left: 10px; }
#result .rowsearch:hover { background: #163a43; }
#footer a:hover { color: var(--site-accent-soft); }
@media (max-width: 979px) { #mform_search { background: #122c35; border-color: #36616c; } }
