/* ============================================================
   Moban 8-10-22 — main.css
   Violet #5E35B1 + Mint #26A69A · nền #F3F0FA · bo góc 12px
   ============================================================ */

/* ---- Overflow & image guards ---- */
html, body {
    overflow-x: hidden;
}
img {
    max-width: 100%;
    height: auto;
}

/* ---- Variables ---- */
:root {
    --c-primary: #5E35B1;
    --c-primary-dark: #4527A0;
    --c-mint: #26A69A;
    --c-mint-dark: #00897B;
    --c-bg: #F3F0FA;
    --c-ink: #2A2438;
    --c-muted: #6E6685;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(94, 53, 177, 0.12);
    --shadow-hover: 0 14px 34px rgba(94, 53, 177, 0.2);
}

body {
    margin: 0;
    background: var(--c-bg);
    color: var(--c-ink);
    font-family: Roboto, 'Segoe UI', Tahoma, sans-serif;
    font-size: 15px;
    line-height: 1.7;
}
a { text-decoration: none; color: var(--c-primary); transition: color .2s ease; }
a:hover { color: var(--c-mint); }
.container { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 9px 20px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.4;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark)); color: #fff; box-shadow: 0 6px 16px rgba(94,53,177,.3); }
.btn-primary:hover { color: #fff; box-shadow: 0 10px 22px rgba(94,53,177,.4); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-login { color: var(--c-primary); border: 1.5px solid var(--c-primary); background: transparent; }
.btn-login:hover { background: rgba(94,53,177,.08); color: var(--c-primary); }
.btn-register { background: linear-gradient(135deg, var(--c-mint), var(--c-mint-dark)); color: #fff; box-shadow: 0 6px 16px rgba(38,166,154,.3); }
.btn-register:hover { color: #fff; }
.btn-view-all { margin-top: 18px; background: var(--c-bg); color: var(--c-primary); border: 1.5px dashed var(--c-primary); width: 100%; text-align: center; }
.btn-view-all:hover { background: var(--c-primary); color: #fff; }

/* ---- Header + mega menu ---- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: linear-gradient(135deg, var(--c-primary-dark), var(--c-primary) 60%, #7E57C2);
    box-shadow: 0 4px 18px rgba(69,39,160,.35);
}
.header-inner { display: flex; align-items: center; gap: 24px; padding: 12px 0; }
.site-logo img { max-height: 46px; width: auto; }
.main-nav { flex: 1; min-width: 0; }
.nav-menu { list-style: none; display: flex; margin: 0; padding: 0; gap: 4px; }
.nav-menu > li { position: relative; }
.nav-menu > li > a {
    display: block;
    padding: 10px 14px;
    color: #EDE7F6;
    font-weight: 500;
    border-radius: var(--radius);
    white-space: nowrap;
    transition: background .2s ease, color .2s ease;
}
.nav-menu > li > a:hover { background: rgba(255,255,255,.14); color: #fff; }
.mega-caret { font-size: 11px; opacity: .8; }
.header-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* Mega panel (4 cột) */
.mega-panel {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, 12px);
    width: 760px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.has-mega:hover .mega-panel, .has-mega.mega-open .mega-panel {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}
.mega-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mega-grid > .mega-col { min-width: 0; }
.mega-cat {
    display: block;
    font-weight: 700;
    color: var(--c-primary);
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--c-bg);
}
.mega-game { display: block; margin-bottom: 12px; border-radius: 10px; overflow: hidden; background: var(--c-bg); }
.mega-game img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.mega-game span { display: block; padding: 6px 10px 2px; font-size: 13px; font-weight: 500; color: var(--c-ink); }
.mega-cta { display: block; padding: 0 10px 8px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--c-mint); }
.mega-game:hover { box-shadow: 0 6px 14px rgba(94,53,177,.18); }
.mega-game:hover span { color: var(--c-primary); }

/* ---- Thanh tiến trình đọc ---- */
.reading-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.2); }
.reading-progress-bar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--c-mint), #7CF5E9); transition: width .1s linear; }

/* ---- Nav toggle ---- */
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 10px; }
.nav-toggle-icon, .nav-toggle-icon::before, .nav-toggle-icon::after {
    display: block; width: 24px; height: 2px; background: #fff; border-radius: 2px; position: relative; transition: transform .25s ease;
}
.nav-toggle-icon::before, .nav-toggle-icon::after { content: ""; position: absolute; left: 0; }
.nav-toggle-icon::before { top: -7px; }
.nav-toggle-icon::after { top: 7px; }
body.nav-open .nav-toggle-icon { background: transparent; }
body.nav-open .nav-toggle-icon::before { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle-icon::after { transform: translateY(-7px) rotate(-45deg); }

/* ---- Bố cục lưới chữ T (grid-areas) — chỉ khai báo tại đây ---- */
.dash-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px 280px;
    grid-template-areas:
        "hero  hero  hero"
        "stats stats stats"
        "main  rank  flash";
    gap: 22px;
    padding: 26px 0 40px;
}
.dash-hero  { grid-area: hero; min-width: 0; }
.dash-stats { grid-area: stats; min-width: 0; }
.dash-main  { grid-area: main; min-width: 0; }
.dash-rank  { grid-area: rank; min-width: 0; }
.dash-flash { grid-area: flash; min-width: 0; }

/* ---- Hero ---- */
.dash-hero {
    border-radius: var(--radius);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.hero-overlay {
    padding: 56px 44px;
    background: linear-gradient(100deg, rgba(42,18,86,.92) 30%, rgba(94,53,177,.55) 70%, rgba(38,166,154,.35));
}
.hero-kicker {
    display: inline-block;
    background: rgba(38,166,154,.9);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
}
.hero-title { margin: 0 0 12px; color: #fff; font-size: 34px; line-height: 1.25; max-width: 640px; }
.hero-desc { margin: 0 0 24px; color: #E3DAF5; max-width: 540px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-hero-primary { background: linear-gradient(135deg, var(--c-mint), var(--c-mint-dark)); color: #fff; box-shadow: 0 8px 20px rgba(38,166,154,.4); }
.btn-hero-primary:hover { color: #fff; }
.btn-hero-ghost { border: 1.5px solid rgba(255,255,255,.7); color: #fff; background: transparent; }
.btn-hero-ghost:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ---- Biểu ngữ thống kê gradient ---- */
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.dash-stats > .stat-card { min-width: 0; }
.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px;
    border-radius: var(--radius);
    color: #fff;
    box-shadow: var(--shadow);
    transition: transform .25s ease, box-shadow .25s ease;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.stat-violet { background: linear-gradient(135deg, #7E57C2, var(--c-primary-dark)); }
.stat-mint { background: linear-gradient(135deg, #4DB6AC, var(--c-mint-dark)); }
.stat-mix { background: linear-gradient(135deg, var(--c-primary), var(--c-mint)); }
.stat-dark { background: linear-gradient(135deg, #4527A0, #26145F); }
.stat-icon { font-size: 30px; }
.stat-body { min-width: 0; }
.stat-number { display: block; font-size: 26px; font-weight: 900; line-height: 1.1; }
.stat-label { font-size: 13px; opacity: .85; }

/* ---- Panel / thẻ trắng nổi ---- */
.panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 22px;
}
.panel:last-child { margin-bottom: 0; }
.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-size: 19px;
    font-weight: 900;
    color: var(--c-ink);
}
.panel-bar { width: 5px; height: 22px; border-radius: 3px; background: linear-gradient(180deg, var(--c-primary), var(--c-mint)); flex-shrink: 0; }

/* ---- Grid thẻ game ---- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card-grid > .card-item { min-width: 0; }
.card-item {
    background: #fff;
    border: 1px solid #EDE7F6;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
.card-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.card-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.card-img-link { display: block; }
.card-body { padding: 14px; }
.card-title { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.card-title a { color: var(--c-ink); }
.card-title a:hover { color: var(--c-primary); }
.card-rating { color: #F9A825; font-size: 13px; margin-bottom: 10px; }
.card-excerpt { font-size: 13px; color: var(--c-muted); margin: 0 0 10px; }
.card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.card-more { font-weight: 700; }

/* ---- Danh sách bài viết ---- */
.article-list-item { border-bottom: 1px dashed #E5DDF3; padding: 14px 0; }
.article-list-item:last-child { border-bottom: 0; }
.article-list-link { display: flex; gap: 14px; align-items: flex-start; }
.article-list-thumb { width: 110px; flex-shrink: 0; border-radius: 10px; overflow: hidden; }
.article-list-thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.article-list-content { min-width: 0; }
.article-list-title { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--c-ink); line-height: 1.4; }
.article-list-link:hover .article-list-title { color: var(--c-primary); }
.article-list-excerpt { margin: 0 0 6px; font-size: 13px; color: var(--c-muted); }
.article-list-date { font-size: 12px; color: #9C93B5; }

/* ---- Xếp hạng ---- */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #EDE7F6; }
.rank-item:last-child { border-bottom: 0; }
.rank-pos {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: var(--c-bg);
    color: var(--c-muted);
    font-weight: 900;
    font-size: 13px;
    flex-shrink: 0;
}
.rank-item.top:nth-child(1) .rank-pos { background: linear-gradient(135deg, #FFD54F, #FF8F00); color: #fff; }
.rank-item.top:nth-child(2) .rank-pos { background: linear-gradient(135deg, #CFD8DC, #78909C); color: #fff; }
.rank-item.top:nth-child(3) .rank-pos { background: linear-gradient(135deg, #FFAB91, #D84315); color: #fff; }
.rank-thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.rank-info { min-width: 0; flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rank-info a { font-size: 13px; font-weight: 500; color: var(--c-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-info a:hover { color: var(--c-primary); }
.rank-score { font-weight: 900; color: var(--c-mint); font-size: 14px; }

/* ---- Tin nhanh ---- */
.flash-list { list-style: none; margin: 0; padding: 0; }
.flash-item { position: relative; padding: 10px 0 10px 16px; border-bottom: 1px dashed #EDE7F6; font-size: 13px; }
.flash-item:last-child { border-bottom: 0; }
.flash-dot {
    position: absolute; left: 0; top: 16px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--c-mint);
    box-shadow: 0 0 0 4px rgba(38,166,154,.15);
}
.flash-item a { color: var(--c-ink); display: block; line-height: 1.45; }
.flash-item a:hover { color: var(--c-primary); }
.flash-item time { display: block; font-size: 11px; color: #9C93B5; margin-top: 2px; }
.flash-cta { text-align: center; background: linear-gradient(160deg, #fff, var(--c-bg)); }
.flash-cta h3 { margin: 0 0 6px; font-size: 16px; }
.flash-cta p { margin: 0 0 14px; font-size: 13px; color: var(--c-muted); }

/* ---- Bố cục trang con (2 cột) ---- */
.page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-areas: "pmain pside";
    gap: 22px;
    padding: 26px 0 40px;
}
.page-main { grid-area: pmain; min-width: 0; }
.page-side { grid-area: pside; min-width: 0; }

/* ---- Archive hero ---- */
.archive-hero {
    margin-top: 26px;
    padding: 30px 34px;
    border-radius: var(--radius);
    background: linear-gradient(120deg, var(--c-primary-dark), var(--c-primary) 55%, var(--c-mint));
    color: #fff;
    box-shadow: var(--shadow);
}
.archive-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; opacity: .8; }
.archive-title { margin: 6px 0 4px; font-size: 28px; }
.archive-title::before { display: none; }
.archive-desc { opacity: .9; font-size: 14px; }
.archive-grid { grid-template-columns: repeat(2, 1fr); }

/* ---- Sidebar ---- */
.sidebar-search { display: flex; gap: 8px; }
.search-input { flex: 1; min-width: 0; border: 1.5px solid #E5DDF3; border-radius: var(--radius); padding: 8px 12px; font-size: 14px; outline: none; }
.search-input:focus { border-color: var(--c-primary); }
.search-btn { border: 0; background: var(--c-primary); color: #fff; border-radius: var(--radius); padding: 8px 14px; cursor: pointer; }
.search-btn:hover { background: var(--c-primary-dark); }
.sidebar-cat-list, .sidebar-popular-list { list-style: none; margin: 0; padding: 0; }
.sidebar-cat-list li, .sidebar-popular-list li { border-bottom: 1px dashed #EDE7F6; }
.sidebar-cat-list li:last-child, .sidebar-popular-list li:last-child { border-bottom: 0; }
.sidebar-cat-list a, .sidebar-popular-list a { display: block; padding: 9px 0; color: var(--c-ink); font-size: 14px; }
.sidebar-cat-list a:hover, .sidebar-popular-list a:hover { color: var(--c-primary); padding-left: 6px; }
.side-download { text-align: center; background: linear-gradient(160deg, var(--c-primary), var(--c-primary-dark)); color: #fff; }
.side-download h3 { margin: 0 0 6px; }
.side-download p { margin: 0 0 14px; font-size: 13px; opacity: .85; }
.side-download .btn { background: linear-gradient(135deg, var(--c-mint), var(--c-mint-dark)); color: #fff; }

/* ---- Single ---- */
.single-header { margin-bottom: 18px; }
.single-cats a { display: inline-block; background: var(--c-bg); color: var(--c-primary); font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; margin-right: 6px; }
.single-title { margin: 12px 0 10px; font-size: 28px; line-height: 1.3; }
.single-meta { display: flex; gap: 18px; font-size: 13px; color: var(--c-muted); }
.single-thumb { margin-bottom: 20px; border-radius: var(--radius); overflow: hidden; }
.single-content { font-size: 16px; }
.single-content img { border-radius: var(--radius); }
.single-download {
    margin-top: 26px;
    padding: 22px;
    border-radius: var(--radius);
    background: linear-gradient(120deg, rgba(94,53,177,.08), rgba(38,166,154,.1));
    border: 1.5px dashed var(--c-primary);
    text-align: center;
}
.single-download h3 { margin: 0 0 6px; }
.single-download p { margin: 0 0 14px; color: var(--c-muted); }
.single-tags { margin-top: 18px; font-size: 13px; }
.single-tags a { background: var(--c-bg); padding: 3px 10px; border-radius: 999px; margin-right: 6px; }
.single-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0; }
.single-nav > .single-nav-item { min-width: 0; }
.single-nav-item { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; font-size: 14px; }
.single-nav-item:last-child { text-align: right; }
.single-nav-label { display: block; font-size: 12px; color: var(--c-muted); margin-bottom: 4px; }
.single-nav-item a { font-weight: 700; color: var(--c-ink); }
.single-nav-item a:hover { color: var(--c-primary); }
.pagination-bar { margin-top: 22px; text-align: center; }
.pagination-bar .nav-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pagination-bar .page-numbers { display: inline-block; min-width: 38px; padding: 8px 12px; background: #fff; border-radius: 10px; box-shadow: var(--shadow); font-weight: 700; }
.pagination-bar .page-numbers.current { background: var(--c-primary); color: #fff; }

/* ---- Scroll reveal ---- */
.scroll-reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .6s ease; }
.scroll-reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---- Footer ---- */
.site-footer { background: linear-gradient(160deg, #2A1758, #1D0F40); color: #CFC6E4; padding: 44px 0 26px; }
.footer-widgets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-bottom: 30px; }
.footer-widgets > .footer-widget { min-width: 0; }
.footer-widget .widget-title { color: #fff; font-size: 16px; margin: 0 0 14px; }
.footer-widget a { color: #CFC6E4; }
.footer-widget a:hover { color: #7CF5E9; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 24px; text-align: center; }
.disclaimer-text { font-size: 13px; line-height: 1.8; color: #B7ABD6; max-width: 760px; margin: 16px auto 0; }
