body,
html {
    background-color: #02080f;
}
#header {
    background: #333333;
}
.main-menu {
    background: #2d2d2d;
}
.main-menu .menu-item.active > a,
.main-menu .menu-item a:hover {
    color: #c58560;
}
.title-box .tophot,
.right-content .block .caption {
    color: #da966e;
}
.main-menu .menu-item .sub-menu {
    background-color: #2d2d2d;
}
.list-films .item .icon-play,
.list-films .label-quality {
    background: #522e75;
}
.list-films .label-quality:after {
    border-left: 10px solid #522e75;
}
#film_hot .item .label,
#film_related .item .label,
.film-new .item .label {
    background: #a3765d;
    border-bottom: 2px solid #96674f;
}
.list-films.film-new .item .name {
    background: #181818;
}
.list-film li:nth-child(even) {
    background: rgb(24 24 24);
}
.title-box .tab.active,
.title-box .tab:hover {
    color: #da966e;
    border-bottom: 2px solid #907863;
}
.most-view .list-film .item .number-rank {
    background: #c58560;
}
.breadcrumbs {
    background: #181818;
}
#page-info .blockbody .title {
    color: #ff9658;
}
.btn-download-link {
}
.btn-stream-link {
}
.dinfo .film-status {
}
#page-info .latest-episode > a:hover,
.list-episode > a:hover,
.list-episode > a.current,
ul.server-backup li span.active,
ul.server-backup li span:hover {
    background: #c58560;
}

#player-video .details .name h1 a,
#player-video .details .name span {
    color: #da966e;
}
.film-note {
    border: 1px solid #e8a568;
    background: #181818;
}
#player-video .bottom-content {
    background: #181818;
}
.mp-tips {
    color: #fff;
}
#suggestions ul.autocomplete-list li span,
#suggestions ul.autocomplete-list li strong,
#suggestions ul.autocomplete-list li.last a {
    color: #da966e;
}
.most-view .list-film .item a:hover,
.list-film .film-item-ver .name a:hover {
    color: #da966e;
}
.most-view .tabs .tab:hover {
    background: #333;
}
#footer {
    color: #848484;
    background: #2d2d2d;
}
#footer .info {
    background: #353535;
}


@media (min-width: 250px) and (max-width: 979px) {
    #header .logo {
        display: block;
        text-align: center;
    }
    #header .logo img {
        width: 120px;
        height: 30px !important;
        margin-bottom: 0 !important;
    }
}

.server-episode-block {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #da843d;
}

/* Icon "Chọn Server" overlay trên player */
#box-player { position: relative; }
#choose-sever {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 50;
}
#show-list-server,
#show-list-server:hover,
#show-list-server:focus,
#show-list-server:active,
#show-list-server:visited {
    display: inline-block;
    width: 30px;
    height: 24px;
    color: #fff;
    padding: 5px 15px;
    font-size: 10px;
    background: url(../images/list-server.png) no-repeat center center;
    background-size: contain;
    cursor: pointer;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
}
.list-server {
    margin-top: 10px;
    background: rgba(0, 0, 0, .7);
    position: absolute;
    right: 0;
    min-width: 130px;
    padding: 0;
    list-style: none;
    z-index: 50;
}
.list-server li {
    cursor: pointer;
    padding: 6px 5px 6px 15px;
    color: #ccc;
    text-align: right;
    list-style: none;
    border-top: solid 1px #20201f;
    font-size: 13px;
}
.list-server li.active,
.list-server li:hover {
    color: #fff;
    font-weight: bold;
}

/* Widget Top Views dùng chung style .most-view .tabs / .list-film có sẵn của theme.
   Không cần CSS riêng. */

/* ===== Movie card grid: flexbox CHỈ áp ở desktop ≥980px =====
   Dưới 980px (tablet/mobile) giữ nguyên float layout + % width từ responsive.css. */
/* ====== Tất cả override SIZE / LAYOUT card chỉ áp dụng ở desktop ≥980px.
   Mobile/tablet < 980px dùng nguyên responsive.css của theme. ====== */
@media (min-width: 980px) {
    .list-films > ul {
        display: flex;
        flex-wrap: wrap;
        gap: 14px 10px;          /* row-gap 14 (vừa thoáng), col-gap 10 → 4 cards/row khít 670px */
        list-style: none;
        padding: 0;
        margin: 0;
    }
    .list-films .item,
    .list-films.film-new .item,
    .list-films.film-related .item {
        float: none !important;
        margin: 0 !important;
        height: 254px !important;
        box-sizing: border-box;
    }
    /* Đồng nhất size ảnh để hàng nào cũng có chiều cao card giống nhau
       (loại trừ .film-hot vì slider có rule riêng phía dưới) */
    .list-films .item .img-film,
    .list-films.film-new .item .img-film,
    .list-films.film-related .item .img-film {
        width: 160px !important;
        height: 214px !important;
        object-fit: cover;
    }
    /* Giảm khoảng cách giữa 2 widget liên tiếp ở khu vực phim */
    .list-films,
    .list-films.film-new,
    .list-films.film-hot,
    .list-films.film-related,
    .most-view.block {
        margin-bottom: 8px !important;
    }
}

/* Nút "Tập tiếp" cạnh nút "Tắt đèn" trên trang xem phim */
#btn_next_episode {
    display: inline-block;
    text-decoration: none !important;
    cursor: pointer;
}
#btn_next_episode:hover {
    background-color: #c58560 !important;
    color: #fff !important;
}

/* Slider film_hot dùng markup giống trangchu.html — image inline style
   `height:250px;width:100%;object-fit:cover` đã fill card, text.absolute overlay
   bottom đúng vị trí. Không cần override CSS riêng. */
.list-films .item .name {
    height: 40px;
    overflow: hidden;
}
.list-films .item .name span,
.list-films .item .name span a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    line-height: 1.3;
}
/* Variant 175x222 (film-related carousel ngang) → 222 + 40 = 262 */
.list-films.film-related .item { height: 262px; }
/* Variant film-hot dùng cùng size mặc định */
.list-films.film-hot .item { height: 254px; }
/* Mobile (< 980px): bỏ height fixed, để responsive.css của theme quản lý layout
   (item width 23%/30%/46% tuỳ breakpoint, margin theo % container). */
@media (max-width: 979px) {
    .list-films .item { height: auto; min-height: 220px; }
}

/* ===== Movie card image — chiều cao CỐ ĐỊNH 214px ở mọi viewport =====
   Width auto theo card (mobile = 100% card width, desktop = 160px từ @media trên).
   Chỉ chạm `.img-film` — KHÔNG đụng `.item`, `.label`, `.label-quality`, `.name`.
   Override theme responsive.css `.list-films .item .img-film {width:100%;height:100%}`
   bằng `!important` mà giữ nguyên cấu trúc card. */
.list-films .item .img-film {
    height: 214px !important;
    object-fit: cover !important;
}

/* Mobile: bỏ margin-top 30px của .div-control để nút "Tập tiếp / Tắt đèn"
   nằm sát trình phát như desktop (responsive.css của theme đẩy xuống 30px). */
@media (max-width: 767px) {
    .div-control { margin-top: 0 !important; }
}

/* Khối thông báo cộng đồng Telegram/Discord trong trang xem phim (episode.php) —
   kéo lên gần hơn nút .div-control cho khít layout.
   Loại trừ:
     - `.tip-change-server` (hint "Bạn xem phim bị lag" cũng dùng .film-note)
     - `.ophim-site-notice` (banner thông báo tên miền ở đầu các trang)
   Override default.css:1578 `.film-note { margin: 10px 0 0 0 }`. */
.film-note:not(.tip-change-server):not(.ophim-site-notice) {
    margin-top: -25px !important;
}
