/* ==========================================================================
   Moban 8-10-42 — main.css
   Phong cách: chỉ mục dữ liệu (data-index) — than xanh #2B2D42 + đỏ #EF233C
   ========================================================================== */

html, body { overflow-x: hidden; }

img { max-width: 100%; height: auto; }

:root {
    --c-primary: #2B2D42;
    --c-primary-deep: #1B1B2E;
    --c-accent: #EF233C;
    --c-accent-dark: #C8102E;
    --c-light: #EDF2F4;
    --c-paper: #F7F9FA;
    --c-ink: #1B1B2E;
    --c-mute: #6C7186;
    --c-line: #D9DFE6;
    --sb-w: 262px;
    --sb-w-min: 76px;
    --progress-h: 4px;
    --font-display: 'Archivo Black', 'Be Vietnam Pro', Arial, sans-serif;
    --font-body: 'Be Vietnam Pro', 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--c-ink);
    background:
        repeating-linear-gradient(135deg, rgba(43,45,66,0.028) 0 2px, transparent 2px 14px),
        var(--c-light);
}

a { color: var(--c-primary); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--c-accent); }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.25; letter-spacing: .01em; margin: 0 0 .6em; }

/* ---------- Thanh tiến trình cuộn trang ---------- */
#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: var(--progress-h);
    background: rgba(27,27,46,.14);
    z-index: 210;
    pointer-events: none;
}
#scroll-progress-bar {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--c-accent), #FF5A6E);
    box-shadow: 0 0 8px rgba(239,35,60,.65);
    transition: width .08s linear;
}

/* ---------- Thanh bên (sidebar) ---------- */
.site-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sb-w);
    background: linear-gradient(180deg, var(--c-primary) 0%, var(--c-primary-deep) 100%);
    color: var(--c-light);
    display: flex;
    flex-direction: column;
    padding: 22px 18px 18px;
    z-index: 200;
    transition: width .28s ease;
    box-shadow: 6px 0 24px rgba(27,27,46,.18);
}

.sidebar-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
    min-width: 0;
}
.site-logo { display: inline-flex; align-items: center; min-width: 0; flex: 1; }
.site-logo img { max-height: 52px; width: auto; }
.logo-word {
    font-family: var(--font-display);
    font-size: 20px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
}
.logo-word b { color: var(--c-accent); font-weight: 400; }

.sidebar-toggle {
    flex: 0 0 auto;
    width: 34px; height: 34px;
    border: 1px solid rgba(237,242,244,.3);
    background: rgba(237,242,244,.08);
    color: var(--c-light);
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, transform .28s ease;
}
.sidebar-toggle:hover { background: rgba(239,35,60,.35); }
.sidebar-toggle svg { width: 18px; height: 18px; }
body.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.sidebar-nav { flex: 1 1 auto; min-width: 0; }
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.sidebar-nav li { margin-bottom: 4px; }
.sidebar-nav a,
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    color: #C9CFE0;
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    border-left: 3px solid transparent;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.sidebar-nav .nav-icon { flex: 0 0 20px; width: 20px; height: 20px; opacity: .9; }
.sidebar-nav a:hover,
.sidebar-nav .current-menu-item > a {
    background: rgba(239,35,60,.16);
    color: #fff;
    border-left-color: var(--c-accent);
}

.sidebar-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: #8B90A8;
    margin: 22px 12px 8px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--c-accent);
    color: #fff;
    font-family: var(--font-display);
    font-size: 14px;
    letter-spacing: .04em;
    padding: 13px 14px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(239,35,60,.4);
    transition: transform .2s ease, background .2s ease;
    white-space: nowrap;
}
.sidebar-download:hover { background: var(--c-accent-dark); color: #fff; transform: translateY(-2px); }
.sidebar-download svg { width: 18px; height: 18px; flex: 0 0 auto; }

.sidebar-foot {
    margin-top: 16px;
    font-size: 12px;
    color: #8B90A8;
    text-align: center;
    line-height: 1.5;
    overflow: hidden;
    white-space: nowrap;
}

/* Thu gọn sidebar thành dải icon */
body.sidebar-collapsed .site-sidebar { width: var(--sb-w-min); padding-left: 12px; padding-right: 12px; }
body.sidebar-collapsed .logo-word,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-section-label,
body.sidebar-collapsed .sidebar-foot { display: none; }
body.sidebar-collapsed .sidebar-nav a,
body.sidebar-collapsed .sidebar-nav .nav-link { justify-content: center; padding: 11px 0; gap: 0; border-left-width: 0; }
body.sidebar-collapsed .sidebar-download { padding: 13px 0; justify-content: center; font-size: 0; gap: 0; }
body.sidebar-collapsed .site-sidebar { align-items: center; }

/* ---------- Vùng nội dung chính ---------- */
.site-main {
    margin-left: var(--sb-w);
    padding: 34px 38px 60px;
    min-width: 0;
    transition: margin-left .28s ease;
}
body.sidebar-collapsed .site-main { margin-left: var(--sb-w-min); }

.shell { max-width: 1180px; margin: 0 auto; min-width: 0; }

/* Thanh tiêu đề trang kiểu chỉ mục */
.page-heading {
    background: var(--c-primary);
    color: #fff;
    border-radius: 16px;
    padding: 30px 34px;
    margin-bottom: 34px;
    position: relative;
    overflow: hidden;
    min-width: 0;
}
.page-heading::after {
    content: "";
    position: absolute;
    right: -40px; top: -60px;
    width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(239,35,60,.5), transparent 65%);
    pointer-events: none;
}
.page-heading .eyebrow {
    display: inline-block;
    font-size: 12px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--c-accent);
    background: rgba(239,35,60,.12);
    border: 1px solid rgba(239,35,60,.5);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
    font-weight: 700;
}
.page-heading h1, .page-heading .heading-title { font-size: 30px; color: #fff; margin: 0 0 6px; }
.page-heading p { color: #C9CFE0; margin: 0; max-width: 640px; }

.section-title {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 24px;
    margin: 44px 0 20px;
    color: var(--c-primary);
}
.section-title .tick {
    width: 10px; height: 28px;
    background: var(--c-accent);
    border-radius: 2px;
    transform: skewX(-14deg);
    flex: 0 0 auto;
}
.section-title small {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--c-mute);
    margin-left: auto;
    letter-spacing: .02em;
}

/* ---------- Dải slide nổi bật ---------- */
.slide-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 8px;
}
.slide-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    min-width: 0;
    border: 1px solid var(--c-line);
    background: var(--c-primary);
    box-shadow: 0 10px 26px rgba(27,27,46,.12);
}
.slide-card.tall { grid-column: span 2; grid-row: span 2; }
.slide-card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.slide-card:hover img { transform: scale(1.06); }
.slide-card .slide-tag {
    position: absolute;
    left: 12px; bottom: 12px;
    background: var(--c-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 5px 12px;
    border-radius: 999px;
    text-transform: uppercase;
}

/* ---------- Dải poster ---------- */
.poster-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.poster-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    min-width: 0;
    border: 1px solid var(--c-line);
}
.poster-card img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .5s ease; }
.poster-card:hover img { transform: scale(1.05); }
.poster-card .poster-caption {
    position: absolute;
    inset: auto 0 0 0;
    background: linear-gradient(180deg, transparent, rgba(27,27,46,.92));
    color: #fff;
    padding: 26px 14px 12px;
    font-weight: 700;
    font-size: 14px;
    min-width: 0;
}

/* ---------- Bảng dữ liệu game ---------- */
.table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--c-line);
    background: #fff;
    box-shadow: 0 12px 30px rgba(27,27,46,.08);
    min-width: 0;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    min-width: 640px;
}
.data-table caption {
    caption-side: top;
    text-align: left;
    padding: 14px 18px;
    font-weight: 700;
    color: var(--c-mute);
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--c-line);
}
.data-table th {
    background: var(--c-primary);
    color: #fff;
    text-align: left;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 14px 18px;
    white-space: nowrap;
}
.data-table td { padding: 13px 18px; border-bottom: 1px solid var(--c-line); vertical-align: middle; min-width: 0; }
.data-table tbody tr:nth-child(even) { background: var(--c-paper); }
.data-table tbody tr:hover { background: #FDE8EB; }
.game-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.game-cell img {
    width: 52px; height: 52px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--c-line);
    flex: 0 0 auto;
}
.game-cell .game-name { font-weight: 700; white-space: nowrap; }
.rating { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--c-primary); white-space: nowrap; }
.rating .stars { color: var(--c-accent); letter-spacing: 2px; font-size: 13px; }
.genre-chip {
    display: inline-block;
    background: rgba(43,45,66,.08);
    color: var(--c-primary);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
}
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--c-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 999px;
    white-space: nowrap;
    transition: background .2s ease, transform .2s ease;
}
.btn-download:hover { background: var(--c-accent-dark); color: #fff; transform: translateY(-1px); }

/* ---------- Chỉ mục tin tức ---------- */
.news-index { list-style: none; margin: 0; padding: 0; }
.news-index li {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--c-line);
    border-left: 4px solid var(--c-primary);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 14px;
    min-width: 0;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.news-index li:hover {
    border-left-color: var(--c-accent);
    box-shadow: 0 10px 24px rgba(27,27,46,.1);
    transform: translateX(3px);
}
.news-index .news-thumb { border-radius: 10px; overflow: hidden; min-width: 0; }
.news-index .news-thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.news-index .news-body { min-width: 0; }
.news-index .news-meta {
    font-size: 12px;
    color: var(--c-mute);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    margin-bottom: 4px;
}
.news-index .news-meta .news-cat { color: var(--c-accent); }
.news-index h3 { font-size: 17px; margin: 0 0 4px; font-family: var(--font-body); font-weight: 800; }
.news-index h3 a { color: var(--c-ink); }
.news-index h3 a:hover { color: var(--c-accent); }
.news-index .news-excerpt { color: var(--c-mute); font-size: 14px; margin: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.news-index .news-go {
    font-size: 13px;
    font-weight: 700;
    color: var(--c-accent);
    white-space: nowrap;
}

/* ---------- Thống kê nhanh ---------- */
.stat-band {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 34px 0 0;
}
.stat-box {
    background: var(--c-primary);
    color: #fff;
    border-radius: 12px;
    padding: 20px 22px;
    min-width: 0;
    position: relative;
    overflow: hidden;
}
.stat-box::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--c-accent);
}
.stat-box .stat-num { font-family: var(--font-display); font-size: 28px; color: #fff; }
.stat-box .stat-label { font-size: 13px; color: #C9CFE0; }

/* ---------- Nội dung bài viết / trang ---------- */
.entry-content, .entry-summary { min-width: 0; }
.entry-content img { border-radius: 10px; }
.entry-content table { border-collapse: collapse; width: 100%; }
.entry-content th, .entry-content td { border: 1px solid var(--c-line); padding: 10px 14px; }
.entry-content blockquote {
    border-left: 4px solid var(--c-accent);
    background: var(--c-paper);
    margin: 24px 0;
    padding: 16px 22px;
    border-radius: 0 10px 10px 0;
    font-style: italic;
}
.post-meta { color: var(--c-mute); font-size: 13px; margin-bottom: 18px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.post-meta a { color: var(--c-accent); font-weight: 700; }
.post-thumb { margin-bottom: 22px; border-radius: 14px; overflow: hidden; min-width: 0; }
.post-thumb img { display: block; width: 100%; }

.article-card {
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: 16px;
    padding: 30px 34px;
    box-shadow: 0 12px 30px rgba(27,27,46,.07);
    min-width: 0;
}

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 30px;
}
.post-nav a {
    display: block;
    background: var(--c-paper);
    border: 1px solid var(--c-line);
    border-radius: 10px;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 14px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-nav a:hover { border-color: var(--c-accent); }

/* ---------- Phân trang ---------- */
.pagination { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 26px; }
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px; height: 40px;
    padding: 0 12px;
    border: 1px solid var(--c-line);
    border-radius: 10px;
    background: #fff;
    font-weight: 700;
    font-size: 14px;
}
.pagination .page-numbers.current { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.pagination .page-numbers:hover { border-color: var(--c-accent); color: var(--c-accent); }
.pagination .page-numbers.current:hover { color: #fff; }

/* ---------- Footer ---------- */
.site-footer {
    margin-left: var(--sb-w);
    background: var(--c-primary-deep);
    color: #C9CFE0;
    padding: 46px 38px 0;
    transition: margin-left .28s ease;
    min-width: 0;
}
body.sidebar-collapsed .site-footer { margin-left: var(--sb-w-min); }

.footer-grid {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 30px;
    min-width: 0;
}
.footer-grid .widget { min-width: 0; }
.footer-grid h3.widget-title, .footer-grid h3 {
    font-size: 15px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin: 0 0 14px;
    position: relative;
    padding-bottom: 8px;
}
.footer-grid h3::after { content: ""; position: absolute; left: 0; bottom: 0; width: 34px; height: 3px; background: var(--c-accent); border-radius: 2px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid ul li { margin-bottom: 8px; }
.footer-grid a { color: #C9CFE0; }
.footer-grid a:hover { color: #fff; }
.footer-grid p { font-size: 14px; }

.dmca-wrap { margin: 30px auto 0; max-width: 1180px; }

.warning-box {
    max-width: 1180px;
    margin: 26px auto 0;
    background: rgba(239,35,60,.12);
    border: 1px solid rgba(239,35,60,.55);
    color: #FFD7DC;
    font-size: 14px;
    line-height: 1.7;
    padding: 18px 22px;
    border-radius: 12px;
}

.footer-bottom {
    max-width: 1180px;
    margin: 26px auto 0;
    border-top: 1px solid rgba(237,242,244,.12);
    padding: 18px 0 24px;
    font-size: 13px;
    color: #8B90A8;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- Lớp phủ + chế độ ngăn kéo trên mobile ---------- */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(27,27,46,.6);
    z-index: 190;
    opacity: 0;
    transition: opacity .25s ease;
}
body.sidebar-open .sidebar-backdrop { display: block; opacity: 1; }

/* Nút mở sidebar riêng cho mobile */
.mobile-topbar { display: none; }

/* Tiện ích phụ */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-primary);
    color: var(--c-accent);
    font-family: var(--font-display);
    font-size: 26px;
    aspect-ratio: 16 / 9;
}

/* Hiệu ứng hiện dần khi cuộn tới (do main.js kích hoạt, chỉ khi JS chạy) */
body.has-anim .news-index li, body.has-anim .poster-card, body.has-anim .stat-box, body.has-anim .slide-card {
    opacity: 0;
    transform: translateY(16px);
}
.news-index li, .poster-card, .stat-box, .slide-card {
    transition: opacity .55s ease, transform .55s ease, box-shadow .2s ease, border-color .2s ease;
}
.news-index li.da-hien, .poster-card.da-hien, .stat-box.da-hien, .slide-card.da-hien {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    body.has-anim .news-index li, body.has-anim .poster-card, body.has-anim .stat-box, body.has-anim .slide-card {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
