/* Thu Vien Vo Lam - giao dien cong khai.
   Bo mau: nen #F7F8FA · be mat #FFF · do chu dao #DD3333 · chu #202124 · chu phu #6B7280 · vien #E5E7EB · vang #B8860B.
   Khung 1160px; mobile: luoi 1 cot, chi so 2 cot, nut toi thieu 44px, khong tran ngang. */

:root {
    --vl-bg: #F7F8FA;
    --vl-surface: #FFFFFF;
    --vl-primary: #DD3333;
    --vl-primary-dark: #B42323;
    --vl-primary-soft: #FDECEC;
    --vl-text: #202124;
    --vl-muted: #6B7280;
    --vl-border: #E5E7EB;
    --vl-gold: #B8860B;
    --vl-gold-soft: #FBF3DC;
    --vl-green: #1F7A3E;
    --vl-green-soft: #E8F5EC;
    --vl-radius: 12px;
    --vl-radius-sm: 8px;
    --vl-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .06);
    --vl-focus: 0 0 0 3px rgba(221, 51, 51, .35);
    /* ngu hanh */
    --he-kim: #9A7B12;   --he-kim-bg: #FBF3DC;
    --he-moc: #1F7A3E;   --he-moc-bg: #E8F5EC;
    --he-thuy: #1D5FB4;  --he-thuy-bg: #E6F0FB;
    --he-hoa: #C2321F;   --he-hoa-bg: #FDECEC;
    --he-tho: #8A5A2B;   --he-tho-bg: #F5ECE2;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--vl-bg);
    color: var(--vl-text);
    font-family: Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

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

a { color: var(--vl-primary-dark); text-decoration: none; }
a:hover { color: var(--vl-primary); }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
    outline: none;
    box-shadow: var(--vl-focus);
    border-radius: 6px;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* ---------- dau trang ---------- */
.site-header { background: var(--vl-surface); border-bottom: 1px solid var(--vl-border); position: sticky; top: 0; z-index: 50; }
.site-header-in { max-width: 1160px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 24px; }
.site-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--vl-text); }
.site-logo:hover { color: var(--vl-text); }
.site-logo-mark {
    width: 42px; height: 42px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--vl-primary); color: #fff; font-size: 22px; font-weight: 700;
    box-shadow: inset 0 0 0 3px #F5C2C2;
}
.site-logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.site-logo-text b { font-size: 18px; color: var(--vl-primary-dark); letter-spacing: .02em; }
.site-logo-text small { font-size: 12px; color: var(--vl-muted); }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
    font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .02em;
    color: var(--vl-primary); border-radius: var(--vl-radius-sm);
}
.site-nav a:hover { background: var(--vl-primary-soft); color: var(--vl-primary-dark); }
.site-nav a.is-active { color: var(--vl-primary-dark); box-shadow: inset 0 -3px 0 var(--vl-primary); border-radius: 0; }
.site-nav-toggle { display: none; margin-left: auto; min-width: 44px; min-height: 44px; border: 1px solid var(--vl-border); background: var(--vl-surface); border-radius: var(--vl-radius-sm); font-size: 20px; cursor: pointer; }

.site-footer { max-width: 1160px; margin: 0 auto; padding: 24px 16px 40px; text-align: center; font-size: 13px; color: var(--vl-muted); border-top: 1px solid var(--vl-border); }
.site-footer p { margin: 4px 0; }
.site-footer-muted { font-size: 12px; }

/* ---------- khung thu vien ---------- */
.vl-library { max-width: 1160px; margin: 0 auto; padding: 16px 16px 48px; }
.vl-library h1, .vl-library h2, .vl-library h3 { color: var(--vl-text); font-weight: 700; line-height: 1.25; margin: 0; }
.nbvl-h1 { font-size: 26px; display: flex; align-items: center; gap: 8px; }
.nbvl-h2 { font-size: 18px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nbvl-h2-center { justify-content: center; margin: 28px 0 14px; font-size: 20px; }
.nbvl-h3 { font-size: 14px; margin: 0; color: var(--vl-muted); font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.nbvl-muted { color: var(--vl-muted); font-weight: 400; font-size: 13px; margin: 4px 0 0; }
.nbvl-note { color: var(--vl-muted); font-size: 13px; margin: 10px 0 0; }
.nbvl-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.nbvl-count {
    display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px;
    background: var(--vl-bg); border: 1px solid var(--vl-border); color: var(--vl-muted);
    font-size: 12px; font-weight: 600; text-align: center;
}
.nbvl-more-link { margin: 16px 0 0; font-size: 14px; font-weight: 600; }
.nbvl-pixel { image-rendering: pixelated; image-rendering: crisp-edges; }

/* thanh tim kiem */
.nbvl-topbar {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 10px 0 14px; margin-bottom: 4px; border-bottom: 1px solid var(--vl-border);
}
.nbvl-home { font-weight: 700; font-size: 15px; white-space: nowrap; }
.nbvl-search { position: relative; flex: 1 1 360px; }
.nbvl-search-box {
    display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 16px;
    background: var(--vl-surface); border: 1px solid var(--vl-border); border-radius: 999px; box-shadow: var(--vl-shadow);
}
.nbvl-search-box input {
    flex: 1; min-width: 0; min-height: 40px; border: 0; background: transparent; font: inherit; color: var(--vl-text);
}
.nbvl-search-box input:focus { outline: none; box-shadow: none; }
.nbvl-suggest {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
    background: var(--vl-surface); border: 1px solid var(--vl-border); border-radius: var(--vl-radius); box-shadow: 0 8px 24px rgba(16, 24, 40, .12);
    padding: 6px; max-height: 420px; overflow: auto;
}
.nbvl-suggest a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--vl-radius-sm); color: var(--vl-text); }
.nbvl-suggest a:hover, .nbvl-suggest a.is-active { background: var(--vl-primary-soft); }
.nbvl-suggest img { width: 28px; height: 28px; border-radius: 6px; image-rendering: pixelated; object-fit: cover; }
.nbvl-suggest b { display: block; font-size: 14px; }
.nbvl-suggest small { color: var(--vl-muted); font-size: 12px; }
.nbvl-suggest-empty { padding: 10px; color: var(--vl-muted); font-size: 13px; }

/* duong dan */
.nbvl-crumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0 14px; padding: 0; font-size: 13px; color: var(--vl-muted); }
.nbvl-crumb li + li::before { content: "›"; margin-right: 4px; color: #9CA3AF; }
.nbvl-crumb a { color: var(--vl-muted); }
.nbvl-crumb a:hover { color: var(--vl-primary); }
.nbvl-crumb [aria-current] { color: var(--vl-text); font-weight: 700; }

/* nut / the / chip */
.nbvl-btn {
    background: var(--vl-primary); color: #fff !important; border: 1px solid var(--vl-primary); border-radius: 999px;
    padding: 0 20px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px; text-transform: uppercase; cursor: pointer; line-height: 1.2; font-family: inherit;
    transition: background .15s, border-color .15s;
}
.nbvl-search-box .nbvl-btn { min-height: 38px; padding: 0 18px; font-size: 14px; }
.nbvl-btn:hover { background: var(--vl-primary-dark); border-color: var(--vl-primary-dark); }
.nbvl-btn-outline { background: var(--vl-surface); color: var(--vl-primary-dark) !important; border-color: var(--vl-border); }
.nbvl-btn-outline:hover { background: var(--vl-primary-soft); border-color: var(--vl-primary); }

.nbvl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nbvl-tag {
    display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px;
    background: var(--vl-bg); border: 1px solid var(--vl-border); font-size: 13px; color: var(--vl-text); line-height: 1.3;
}
.nbvl-tag-type { background: var(--vl-primary-soft); border-color: #F5C2C2; color: var(--vl-primary-dark); font-weight: 700; }
.nbvl-tag-lv { background: var(--vl-gold-soft); border-color: #EAD9A3; color: #7A5A0B; font-weight: 700; }
.nbvl-tag-full { background: var(--vl-green-soft); border-color: #BFE3CB; color: var(--vl-green); }
.nbvl-badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.nbvl-badge-verified { background: var(--vl-gold-soft); color: var(--vl-gold); }

.nbvl-chips-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.nbvl-chips-center { justify-content: center; }
.nbvl-chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px;
    background: var(--vl-surface); border: 1px solid var(--vl-border); color: var(--vl-text); font-size: 14px; white-space: nowrap;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04); transition: border-color .15s, color .15s, background .15s;
}
a.nbvl-chip:hover { border-color: var(--vl-primary); color: var(--vl-primary-dark); background: var(--vl-primary-soft); }
.nbvl-chip small { color: var(--vl-muted); font-size: 12px; }
.nbvl-chip img { border-radius: 4px; }

/* ngu hanh */
.nbvl-he { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.nbvl-tag.nbvl-he { font-size: 13px; padding: 4px 11px; }
.nbvl-he-kim { color: var(--he-kim); background: var(--he-kim-bg); border-color: #EAD9A3; }
.nbvl-he-moc { color: var(--he-moc); background: var(--he-moc-bg); border-color: #BFE3CB; }
.nbvl-he-thuy { color: var(--he-thuy); background: var(--he-thuy-bg); border-color: #BFD5F2; }
.nbvl-he-hoa { color: var(--he-hoa); background: var(--he-hoa-bg); border-color: #F5C2C2; }
.nbvl-he-tho { color: var(--he-tho); background: var(--he-tho-bg); border-color: #E3CDB5; }
.nbvl-he-txt-kim { color: var(--he-kim); } .nbvl-he-txt-moc { color: var(--he-moc); } .nbvl-he-txt-thuy { color: var(--he-thuy); }
.nbvl-he-txt-hoa { color: var(--he-hoa); } .nbvl-he-txt-tho { color: var(--he-tho); }
.nbvl-chip.nbvl-he-chip { font-weight: 700; }

/* khung noi dung */
.nbvl-panel, .nbvl-detail {
    background: var(--vl-surface); border: 1px solid var(--vl-border); border-radius: var(--vl-radius);
    box-shadow: var(--vl-shadow); padding: 20px;
}
.nbvl-panel-head { margin-bottom: 16px; }

/* bo loc */
.nbvl-filters { background: var(--vl-bg); border-radius: var(--vl-radius); padding: 16px; margin-bottom: 18px; }
.nbvl-filter-row { display: grid; grid-template-columns: 2fr 1fr 1.3fr 1fr 1fr; gap: 10px; align-items: end; }
.nbvl-filter { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--vl-muted); font-weight: 500; }
.nbvl-filter input, .nbvl-filter select {
    width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--vl-border); border-radius: var(--vl-radius-sm);
    background: var(--vl-surface); font: inherit; font-size: 14px; color: var(--vl-text);
}
.nbvl-filter select { cursor: pointer; }
.nbvl-filter-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* luoi the ky nang */
.nbvl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nbvl-card {
    display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 12px;
    background: var(--vl-surface); border: 1px solid var(--vl-border); border-radius: var(--vl-radius-sm); color: var(--vl-text);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.nbvl-card:hover { border-color: #F5C2C2; box-shadow: var(--vl-shadow); color: var(--vl-text); }
.nbvl-card:hover .nbvl-card-name { color: var(--vl-primary-dark); }
.nbvl-card-img {
    flex: 0 0 36px; width: 36px; height: 36px; border-radius: 6px; overflow: hidden;
    background: #1F2937; display: inline-flex; align-items: center; justify-content: center;
}
.nbvl-card-img img { width: 36px; height: 36px; display: block; }
.nbvl-card-ph { color: #9CA3AF; font-size: 18px; }
.nbvl-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nbvl-card-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nbvl-card-sub { font-size: 12px; color: var(--vl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nbvl-card-arrow { color: #9CA3AF; font-size: 14px; }

.nbvl-empty { background: var(--vl-surface); border: 1px dashed var(--vl-border); border-radius: var(--vl-radius); padding: 22px 20px; text-align: center; margin: 8px 0; }
.nbvl-empty b { font-size: 16px; }
.nbvl-empty p { margin: 6px 0 0; color: var(--vl-muted); font-size: 14px; }
.nbvl-empty code { background: var(--vl-bg); padding: 1px 6px; border-radius: 4px; font-size: 13px; }

/* phan trang */
.nbvl-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 20px; }
.nbvl-page {
    min-width: 40px; min-height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--vl-border); border-radius: var(--vl-radius-sm); background: var(--vl-surface); color: var(--vl-text); font-size: 14px; font-weight: 500;
}
a.nbvl-page:hover { border-color: var(--vl-primary); color: var(--vl-primary-dark); background: var(--vl-primary-soft); }
.nbvl-page.is-current { background: var(--vl-primary); border-color: var(--vl-primary); color: #fff; font-weight: 700; }
.nbvl-page.is-disabled { color: #C0C4CC; }
.nbvl-page.is-gap { border-color: transparent; background: transparent; min-width: 24px; padding: 0; }

/* ---------- trang chi tiet ---------- */
.nbvl-dhead { display: flex; gap: 18px; align-items: flex-start; padding-bottom: 18px; border-bottom: 1px solid var(--vl-border); }
.nbvl-dimg-wrap {
    margin: 0; width: 96px; padding: 8px 8px 6px; border: 1px solid var(--vl-border); border-radius: var(--vl-radius);
    background: var(--vl-bg); text-align: center;
}
.nbvl-dimg-icon { width: 72px; height: 72px; display: block; margin: 0 auto; border-radius: 6px; background: #1F2937; }
.nbvl-dimg-ph { width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; margin: 0 auto; font-size: 30px; color: #9CA3AF; background: #1F2937; border-radius: 6px; }
.nbvl-imgsrc { font-size: 11px; color: var(--vl-muted); margin-top: 4px; }
.nbvl-dhead-body { flex: 1; min-width: 0; }
.nbvl-dname { font-size: 26px; }
.nbvl-lead { margin: 12px 0 0; font-size: 15px; color: #374151; }

.nbvl-sec { padding: 20px 0 0; margin-top: 20px; border-top: 1px solid var(--vl-border); }
.nbvl-dhead + .nbvl-sec { border-top: 0; margin-top: 0; }

.nbvl-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.nbvl-stat { background: var(--vl-bg); border-radius: var(--vl-radius-sm); padding: 10px 12px; min-width: 0; }
.nbvl-stat small { display: block; font-size: 11px; color: var(--vl-muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 500; }
.nbvl-stat b { display: block; font-size: 15px; margin-top: 2px; overflow-wrap: anywhere; }

/* bang */
.nbvl-table-wrap { border: 1px solid var(--vl-border); border-radius: var(--vl-radius-sm); overflow: hidden; }
.nbvl-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nbvl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.nbvl-table th, .nbvl-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--vl-border); vertical-align: top; }
.nbvl-table thead th { background: var(--vl-bg); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--vl-muted); font-weight: 700; }
.nbvl-table tbody tr:last-child > * { border-bottom: 0; }
.nbvl-table tbody tr:nth-child(even) { background: #FCFCFD; }
.nbvl-table-levels td:last-child { text-align: center; color: #374151; }
.nbvl-table-levels thead th:last-child { text-align: center; }
.nbvl-table-grid th, .nbvl-table-grid td { white-space: nowrap; text-align: center; }
.nbvl-table-grid thead th { white-space: normal; min-width: 110px; vertical-align: bottom; }
.nbvl-table-grid .nbvl-sticky { position: sticky; left: 0; background: var(--vl-surface); min-width: 56px; z-index: 1; box-shadow: 1px 0 0 var(--vl-border); }
.nbvl-table-grid thead .nbvl-sticky { background: var(--vl-bg); }
.nbvl-table-grid tr.is-over > * { color: #9CA3AF; }
.nbvl-table-kv th { width: 220px; font-weight: 500; color: var(--vl-muted); font-size: 13px; }
.nbvl-table-kv td { overflow-wrap: anywhere; }

/* xem theo cap */
.nbvl-levelview { margin-top: 18px; padding: 14px 16px; background: var(--vl-bg); border-radius: var(--vl-radius); }
.nbvl-levelview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nbvl-levelpick { display: flex; align-items: center; gap: 8px; flex: 1 1 280px; justify-content: flex-end; }
.nbvl-levelpick label { flex: 1; max-width: 320px; display: flex; }
.nbvl-levelpick input[type=range] { width: 100%; accent-color: var(--vl-primary); min-height: 32px; }
.nbvl-step {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--vl-border); background: var(--vl-surface);
    font-size: 18px; font-weight: 700; color: var(--vl-primary-dark); cursor: pointer; line-height: 1;
}
.nbvl-step:hover { border-color: var(--vl-primary); background: var(--vl-primary-soft); }
.nbvl-levelout { min-width: 72px; text-align: center; font-weight: 700; color: var(--vl-primary-dark); background: var(--vl-surface); border: 1px solid #F5C2C2; border-radius: 999px; padding: 4px 10px; }
.nbvl-levellist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.nbvl-levellist li {
    background: var(--vl-surface); border: 1px solid var(--vl-border); border-radius: var(--vl-radius-sm); padding: 8px 12px; font-size: 14px;
}
.nbvl-levellist b { color: var(--vl-primary-dark); }
.nbvl-c-orange { color: #C2410C; }
.nbvl-c-water { color: #1D5FB4; }
.nbvl-c-green { color: var(--vl-green); }
.nbvl-c-yellow, .nbvl-c-gold { color: var(--vl-gold); }
.nbvl-c-red { color: var(--vl-primary-dark); }

.nbvl-details { margin-top: 16px; }
.nbvl-details > summary {
    cursor: pointer; font-weight: 700; font-size: 14px; color: var(--vl-primary-dark); min-height: 44px; display: flex; align-items: center; gap: 8px;
    list-style: none;
}
.nbvl-details > summary::-webkit-details-marker { display: none; }
.nbvl-details > summary::before { content: "▸"; transition: transform .15s; }
.nbvl-details[open] > summary::before { transform: rotate(90deg); }
.nbvl-sec > .nbvl-details:first-child { margin-top: 0; }

/* hieu ung */
.nbvl-fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.nbvl-fx { margin: 0; border: 1px solid var(--vl-border); border-radius: var(--vl-radius-sm); overflow: hidden; background: var(--vl-surface); }
.nbvl-fx-stage {
    height: 180px; display: flex; align-items: center; justify-content: center; padding: 8px;
    background: radial-gradient(circle at 50% 60%, #2B3446 0%, #111827 70%);
}
.nbvl-fx-stage img { max-height: 164px; width: auto; object-fit: contain; }
.nbvl-fx figcaption { padding: 8px 10px; font-size: 13px; font-weight: 500; display: flex; justify-content: space-between; gap: 8px; }
.nbvl-fx figcaption small { color: var(--vl-muted); font-weight: 400; }
.nbvl-fx figcaption > span { display: flex; flex-direction: column; min-width: 0; }
.nbvl-fx figcaption > small { white-space: nowrap; }
.nbvl-fx-src { font-size: 12px; }

/* ---------- npc ---------- */
.nbvl-card-img.nbvl-card-npc { background: var(--vl-bg); border: 1px solid var(--vl-border); }
.nbvl-card-img.nbvl-card-npc img { width: auto; height: 34px; max-width: 34px; object-fit: contain; }
/* Khung anh NPC: cung mot kich thuoc cho moi NPC, khong co gian theo anh. */
.nbvl-dimg-wrap.nbvl-dimg-npc { width: 136px; flex: 0 0 136px; }
.nbvl-npc-frame {
    width: 120px; height: 150px; margin: 0 auto; border-radius: 6px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: var(--vl-surface);
}
.nbvl-npc-frame .nbvl-dimg { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 0; background: none; }
.nbvl-npc-frame .nbvl-dimg-ph { width: 100%; height: 100%; background: var(--vl-surface); color: var(--vl-muted); border-radius: 0; font-size: 40px; }
.nbvl-empty-line { color: var(--vl-muted); font-size: 14px; margin: 0; padding: 12px 14px; background: var(--vl-bg); border-radius: var(--vl-radius-sm); }
.nbvl-h2-gap { margin-top: 24px; }

/* ---------- ban do ---------- */
.nbvl-card-img.nbvl-card-mapimg { flex: 0 0 64px; width: 64px; height: 42px; background: #2A2219; }
.nbvl-card-img.nbvl-card-mapimg img { width: 64px; height: 42px; object-fit: cover; }

.nbvl-mapview { border: 1px solid var(--vl-border); border-radius: var(--vl-radius); overflow: hidden; background: var(--vl-surface); }
.nbvl-mapview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 10px; border-bottom: 1px solid var(--vl-border); background: var(--vl-bg); }
.nbvl-seg { display: inline-flex; }
.nbvl-seg button {
    min-height: 38px; padding: 0 12px; border: 1px solid var(--vl-border); background: var(--vl-surface);
    font: inherit; font-size: 14px; font-weight: 500; color: var(--vl-text); cursor: pointer;
}
.nbvl-seg button:first-child { border-radius: 999px 0 0 999px; }
.nbvl-seg button:last-child { border-radius: 0 999px 999px 0; border-left: 0; }
.nbvl-seg button.is-on { background: var(--vl-primary); border-color: var(--vl-primary); color: #fff; font-weight: 700; }
.nbvl-seg button:disabled { color: #C0C4CC; cursor: not-allowed; }
.nbvl-mapview-layers { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.nbvl-mapview-layers label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; user-select: none; }
.nbvl-mapview-layers input { accent-color: var(--vl-primary); width: 16px; height: 16px; }
.nbvl-mapview-goto { display: inline-flex; gap: 6px; margin-left: auto; }
.nbvl-mapview-goto input {
    width: 170px; min-height: 38px; padding: 0 12px; border: 1px solid var(--vl-border); border-radius: 999px;
    font: inherit; font-size: 14px; background: var(--vl-surface); color: var(--vl-text);
}
.nbvl-mapview-goto .nbvl-btn { min-height: 38px; padding: 0 14px; font-size: 13px; }
.nbvl-mapview-icon {
    width: 38px; height: 38px; border: 1px solid var(--vl-border); border-radius: 50%; background: var(--vl-surface);
    font-size: 16px; cursor: pointer; color: var(--vl-primary-dark);
}
.nbvl-mapview-icon:hover, .nbvl-seg button:not(.is-on):not(:disabled):hover { background: var(--vl-primary-soft); border-color: var(--vl-primary); }
.nbvl-mapview-stage { position: relative; height: min(68vh, 620px); background: #15110C; }
.nbvl-mapview-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.nbvl-mapview-stage canvas.is-drag { cursor: grabbing; }
.nbvl-mapview-tip {
    position: absolute; pointer-events: none; z-index: 2; padding: 5px 9px; border-radius: var(--vl-radius-sm);
    background: rgba(20, 14, 9, .92); color: #FFF3E0; font-size: 13px; white-space: pre; max-width: 260px;
}
.nbvl-mapview-path {
    position: absolute; right: 10px; bottom: 10px; z-index: 2; max-width: min(420px, calc(100% - 20px));
    padding: 8px 12px; border-radius: var(--vl-radius-sm); background: var(--vl-surface); border: 1px solid var(--vl-border);
    box-shadow: var(--vl-shadow); font-size: 13px;
}
.nbvl-mapview-status {
    padding: 7px 12px; font-size: 13px; color: var(--vl-muted); border-top: 1px solid var(--vl-border);
    font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nbvl-mapview-legend { list-style: none; margin: 0; padding: 0 12px 10px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--vl-muted); }
.nbvl-mapview-legend li { display: inline-flex; align-items: center; gap: 6px; }
.nbvl-mapview-legend i { width: 11px; height: 11px; display: inline-block; border-radius: 2px; }
.nbvl-mapview-legend .is-block { background: rgba(230, 40, 30, .75); }
.nbvl-mapview-legend .is-jump { background: rgba(40, 120, 255, .7); }
.nbvl-mapview-legend .is-trap { background: #F59E0B; border: 1px solid #111; transform: rotate(45deg) scale(.85); }
.nbvl-mapview-legend .is-npc { background: #7FD36B; border-radius: 50%; border: 1px solid #111; }

.nbvl-linkbtn {
    border: 0; background: none; padding: 2px 0; font: inherit; font-size: 13px; font-weight: 600;
    color: var(--vl-primary-dark); cursor: pointer; white-space: nowrap;
}
.nbvl-linkbtn:hover { color: var(--vl-primary); text-decoration: underline; }
.nbvl-coords { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.nbvl-coords .nbvl-linkbtn { font-family: inherit; font-weight: 500; }
.nbvl-npc-inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.nbvl-npc-inline img { width: auto; height: 28px; max-width: 32px; object-fit: contain; }

/* ---------- mon phai ---------- */
.nbvl-faction-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.nbvl-faction {
    display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--vl-border);
    border-radius: var(--vl-radius); background: var(--vl-surface); color: var(--vl-text); transition: border-color .15s, box-shadow .15s;
}
.nbvl-faction:hover { border-color: #F5C2C2; box-shadow: var(--vl-shadow); color: var(--vl-text); }
.nbvl-faction-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nbvl-faction-head b { font-size: 16px; }
.nbvl-faction-icons { display: flex; gap: 6px; min-height: 36px; }
.nbvl-faction-icons img { width: 36px; height: 36px; border-radius: 6px; background: #1F2937; }
.nbvl-faction .nbvl-muted { margin: 0; }
.nbvl-dhead-faction { padding-bottom: 14px; }
.nbvl-jump { border-top: 0; margin-top: 0; }

/* ---------- trang chu thu vien ---------- */
.nbvl-hero { text-align: center; padding: 28px 16px 8px; }
.nbvl-hero-title { font-size: 30px; color: var(--vl-primary-dark) !important; }
.nbvl-hero-sub { max-width: 640px; margin: 10px auto 0; color: var(--vl-muted); }
.nbvl-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.nbvl-cat {
    position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px; min-height: 120px;
    background: var(--vl-surface); border: 1px solid var(--vl-border); border-radius: var(--vl-radius); color: var(--vl-text);
    box-shadow: var(--vl-shadow); transition: border-color .15s, transform .15s;
}
a.nbvl-cat:hover { border-color: var(--vl-primary); color: var(--vl-text); transform: translateY(-1px); }
.nbvl-cat-ico { font-size: 26px; line-height: 1; }
.nbvl-cat b { font-size: 16px; margin-top: 6px; }
.nbvl-cat small { color: var(--vl-muted); font-size: 13px; }
.nbvl-cat .nbvl-count, .nbvl-cat .nbvl-badge { position: absolute; top: 14px; right: 14px; }
.nbvl-cat.is-soon { opacity: .6; box-shadow: none; cursor: default; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
    .nbvl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nbvl-filter-row { grid-template-columns: 1fr 1fr; }
    .nbvl-filter-q { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    body { font-size: 14px; }
    .site-header-in { gap: 12px; flex-wrap: wrap; }
    .site-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .site-nav { display: none; width: 100%; flex-direction: column; margin: 0; }
    .site-nav.is-open { display: flex; }
    .site-nav a.is-active { box-shadow: inset 3px 0 0 var(--vl-primary); }
    .nbvl-topbar { gap: 10px; }
    .nbvl-home { font-size: 14px; }
    .nbvl-grid { grid-template-columns: minmax(0, 1fr); }
    .nbvl-panel, .nbvl-detail { padding: 14px; }
    .nbvl-h1, .nbvl-dname { font-size: 22px; }
    .nbvl-dhead { gap: 12px; }
    .nbvl-dimg-wrap { width: 76px; padding: 6px; }
    .nbvl-dimg-icon, .nbvl-dimg-ph { width: 56px; height: 56px; }
    .nbvl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nbvl-dimg-wrap.nbvl-dimg-npc { width: 108px; flex-basis: 108px; padding: 6px; }
    .nbvl-npc-frame { width: 96px; height: 120px; }
    .nbvl-table th, .nbvl-table td { padding: 8px; }
    .nbvl-table-levels td:last-child { text-align: left; }
    .nbvl-table-kv th { width: 40%; }
    .nbvl-levelpick { justify-content: flex-start; }
    .nbvl-fx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nbvl-fx-stage { height: 140px; }
    .nbvl-fx-stage img { max-height: 124px; }
    .nbvl-mapview-goto { margin-left: 0; flex: 1; }
    .nbvl-mapview-goto input { flex: 1; width: auto; min-width: 0; }
    .nbvl-mapview-stage { height: 62vh; }
}
