/* Bách khoa (wiki): the site's ink and jade (assets/css/site.css) for long pages, tables and the side index. */
:root {
  --kim: #e3c06b;
  --hoa: #f08a5d;
  --thuy: #7fb8f0;
  --tho: #c9a27a;
  --moc: #8fd18a;
  --phong: #5fe0b0;
  --mac: #b4a7e8;   /* hệ Mặc (Bút, 02/12): mực ánh tím, đọc được trên nền tối */
  --row: #101217;
  --row-2: #0d0f13;
}

body.wiki { background: var(--ink); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.wiki-top { border-bottom: 1px solid #1d2229; background: linear-gradient(180deg, #0f1311, var(--ink)); }
.wiki-top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding-top: 40px; padding-bottom: 22px; }
.crumbs { font-size: 13px; color: var(--muted); letter-spacing: 0.04em; }
.crumbs a { color: #9fd9bd; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.wiki-top h1 { flex: 1 1 100%; margin: 0; font-family: var(--serif); font-size: 38px; color: var(--title); line-height: 1.2; }
.wiki-top .lead { flex: 1 1 100%; margin: 0; max-width: 780px; color: var(--text-2); font-size: 16px; line-height: 1.65; }

/* search */
.wsearch { position: relative; flex: 1 1 360px; max-width: 560px; }
/* 24/11: the search follows the page: its own bar, sticky under the site header (--wiki-hdr, --wiki-bar measured by wiki.js) */
.wsearch-bar { position: sticky; top: var(--wiki-hdr, 69px); z-index: 19; background: rgba(10, 11, 14, 0.94); border-bottom: 1px solid #1d2229;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.wsearch-bar .wrap { padding-top: 10px; padding-bottom: 10px; }
/* the logo hangs 26px under the site header on a computer (site.css .brand): the search starts right of it
   (up to 1024 px the logo row scrolls away and only the row of pages stays, site.css .nav-quick) */
@media (min-width: 1025px) { .wsearch-bar.stuck .wsearch { margin-left: 268px; } }
.wsearch input { width: 100%; min-height: 44px; padding: 0 14px 0 40px; background: #0a0b0e; border: 1px solid #3a3f48; border-radius: 4px;
  color: #ece7d8; font: inherit; font-size: 15px; }
.wsearch input:focus { outline: 2px solid var(--jade); outline-offset: 1px; border-color: var(--jade); }
.wsearch svg { position: absolute; left: 12px; top: 13px; color: #7f8a83; pointer-events: none; }
.wsearch .results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); max-height: 420px; overflow-y: auto;
  background: #0e1014; border: 1px solid var(--jade-dark); border-radius: 4px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); }
.wsearch .results a { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 7px 12px; color: var(--text); text-decoration: none; border-bottom: 1px solid #1b1f26; }
.wsearch .results a:last-child { border-bottom: 0; }
.wsearch .results a.on, .wsearch .results a:hover { background: #14231d; }
.wsearch .results b { font-weight: 600; color: var(--title); }
/* 05/12: the icon (item, skill) or the monster's picture, the name and the line under it, the kind at the right end */
.wsearch .results .ico { width: 22px; height: 22px; }
.wsearch .results .t { flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.wsearch .results .k { flex: none; max-width: 34%; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--jade-light); text-align: right; }
.wsearch .results .s { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsearch .results .none { padding: 12px; color: var(--muted); font-size: 14px; }
.big-search { max-width: 680px; flex-basis: 100%; }
.big-search input { min-height: 54px; font-size: 17px; }
.big-search svg { top: 18px; }

/* layout: side index and the article */
.wiki-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; padding-top: 32px; padding-bottom: 80px; }
.wiki-side { position: sticky; top: calc(43px + var(--wiki-hdr, 69px) + var(--wiki-bar, 66px)); align-self: start; max-height: calc(100vh - 59px - var(--wiki-hdr, 69px) - var(--wiki-bar, 66px)); overflow-y: auto; font-size: 14px; padding-right: 6px; }
.wiki-side h2 { margin: 0 0 8px; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: #7f8a83; font-weight: 600; }
.wiki-side ul { list-style: none; margin: 0 0 22px; padding: 0; }
.wiki-side li a { display: block; padding: 6px 10px; color: #c2cbc5; text-decoration: none; border-left: 2px solid #232831; }
.wiki-side li a:hover { color: #fff; border-left-color: var(--jade); background: #101614; }
.wiki-side li a[aria-current="page"] { color: var(--jade-light); border-left-color: var(--jade); background: #0f1c17; font-weight: 600; }
.wiki-side .toc a { padding: 4px 10px; font-size: 13px; color: #9aa59e; }
.wiki-side .toc .lv3 a { padding-left: 22px; font-size: 12.5px; }
.wiki-side .toc a.here { color: var(--gold); border-left-color: var(--gold); }
.side-toggle { display: none; }

.wiki-main { min-width: 0; font-size: 16px; line-height: 1.7; color: #d9dcd5; }
.wiki-main > section { margin-bottom: 48px; }
.wiki-main h2 { margin: 0 0 16px; padding-top: 6px; font-family: var(--serif); font-size: 28px; color: var(--title); line-height: 1.25;
  border-bottom: 1px solid #22272f; padding-bottom: 10px; }
.wiki-main h3 { margin: 30px 0 12px; font-size: 20px; color: var(--title); font-weight: 600; }
.wiki-main h4 { margin: 22px 0 8px; font-size: 16px; color: var(--gold); font-weight: 600; }
.wiki-main p { margin: 0 0 14px; }
.wiki-main ul, .wiki-main ol { margin: 0 0 16px; padding-left: 22px; }
.wiki-main li { margin: 4px 0; }
.wiki-main strong { color: #f3eedf; }
.wiki-main a { color: #7fd3ac; }
.wiki-main code { font-size: 14px; background: #161a20; border: 1px solid #262b33; border-radius: 3px; padding: 1px 6px; color: #e9e4d4; }
[id] { scroll-margin-top: calc(112px + var(--wiki-bar, 66px)); }
.flash { animation: flash 1.8s ease-out; }
@keyframes flash { 0% { background: rgba(227, 192, 107, 0.28); } 100% { background: transparent; } }

kbd { display: inline-block; min-width: 26px; padding: 1px 7px; margin: 0 1px; font: 600 13px/1.6 var(--sans); text-align: center; color: #f1ecdd;
  background: #1b1f26; border: 1px solid #3a404a; border-bottom-width: 3px; border-radius: 4px; }

/* callouts and spoilers */
.note { margin: 0 0 18px; padding: 14px 16px; border-left: 3px solid var(--jade); background: #0f1714; border-radius: 0 4px 4px 0; font-size: 15px; }
.note.warn { border-left-color: var(--seal); background: #1a1110; }
.note.gold { border-left-color: var(--gold); background: #17140c; }
.note > :last-child { margin-bottom: 0; }
.note b:first-child { color: var(--title); }
details.spoiler { margin: 0 0 16px; border: 1px dashed #4a3a2a; border-radius: 4px; background: #120f0c; }
details.spoiler > summary { cursor: pointer; padding: 10px 14px; color: #e0b98a; font-size: 14px; list-style: none; user-select: none; }
details.spoiler > summary::-webkit-details-marker { display: none; }
details.spoiler > summary::before { content: '▸'; display: inline-block; width: 16px; transition: transform 160ms; }
details.spoiler[open] > summary::before { transform: rotate(90deg); }
details.spoiler > .in { padding: 0 16px 14px; font-size: 15px; }
details.more { margin: 8px 0 14px; }
details.more > summary { cursor: pointer; color: #9fd9bd; font-size: 14px; }

/* tables */
.tbl { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 6px; -webkit-overflow-scrolling: touch; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.tbl th { position: sticky; top: 0; text-align: left; font-weight: 600; color: #cfd6d0; background: #151920; padding: 9px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid #1c2027; vertical-align: top; }
.tbl tr:nth-child(even) td { background: var(--row-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.c, .tbl th.c { text-align: center; }
.tbl td.nw, .tbl .nw { white-space: nowrap; }
.tbl .dim { color: var(--muted); }
.tbl .desc { min-width: 260px; color: #c9cec8; }
.tbl tr.hl td { background: #14231d !important; }
.tbl caption { caption-side: bottom; text-align: left; padding: 8px 12px; font-size: 13px; color: var(--muted); }
.tbl caption.top { caption-side: top; font-size: 15px; color: var(--text); line-height: 1.55; border-bottom: 1px solid var(--line-2); background: #11141a; }
.sub { font-size: 12.5px; }

/* icons, links to things, tags */
.ico { width: 32px; height: 32px; image-rendering: pixelated; vertical-align: middle; flex: none; }
.ico.sm { width: 22px; height: 22px; }
.ico.lg { width: 48px; height: 48px; }
.it { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; vertical-align: middle; }
.it .ico { width: 22px; height: 22px; }
.it:hover span { text-decoration: underline; }
.it .x { color: var(--muted); font-size: 13px; }
.sprite { image-rendering: pixelated; object-fit: contain; }
.mon { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; }
.mon img { width: 28px; height: 28px; image-rendering: pixelated; object-fit: contain; }
.tag { display: inline-block; font-size: 12px; line-height: 1.5; padding: 1px 8px; border: 1px solid #343a44; border-radius: 3px; color: #cfd6d0; background: #12151a; white-space: nowrap; }
.tag.jade { border-color: var(--jade-dark); color: var(--jade-light); background: #0f1c17; }
.tag.gold { border-color: #6b5a2c; color: var(--gold); background: #17140c; }
.tag.red { border-color: #6a2a24; color: #f3b3aa; background: #1d1110; }
.el { font-weight: 600; }
.el-kim { color: var(--kim); } .el-hoa { color: var(--hoa); } .el-thuy { color: var(--thuy); } .el-tho { color: var(--tho); } .el-moc { color: var(--moc); } .el-phong { color: var(--phong); } .el-mac { color: var(--mac); }
.bd-kim { border-top-color: var(--kim) !important; } .bd-hoa { border-top-color: var(--hoa) !important; } .bd-thuy { border-top-color: var(--thuy) !important; }
.bd-tho { border-top-color: var(--tho) !important; } .bd-moc { border-top-color: var(--moc) !important; }
.bd-phong { border-top-color: var(--phong) !important; } .bd-mac { border-top-color: var(--mac) !important; }
/* ba hệ Ma (02/12, docs/specs/ma_3_phai.md): đỏ máu, lục lam quỷ hỏa, tím độc (Rules/MaPhaiText) */
.el-huyet { color: #e0534f; } .el-am { color: #7ccbe0; } .el-co { color: #b987f2; } .bd-phong { border-top-color: #5fe0b0 !important; }
.bd-huyet { border-top-color: #e0534f !important; } .bd-am { border-top-color: #7ccbe0 !important; } .bd-co { border-top-color: #b987f2 !important; }
.tag.ma { border-color: #5c2a3a; color: #f0a8b8; background: #1c1016; }
.q0 { color: #c9c4ba; } .q1 { color: #7fc7ff; } .q2 { color: #e8c547; } .q3 { color: #e08cff; }

/* cards */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 0 0 20px; }
.wcard { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wcard.top { border-top-width: 3px; }
.wcard h3, .wcard h4 { margin: 0; }
.wcard p { margin: 0; font-size: 14.5px; color: var(--text-2); line-height: 1.6; }
.wcard .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
a.wcard { text-decoration: none; color: inherit; }
a.wcard:hover { border-color: var(--jade); }
a.wcard .glyph { width: 40px; height: 40px; }
.statline { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: #b9c1bb; }
.statline b { color: var(--title); font-weight: 600; font-variant-numeric: tabular-nums; }

/* a big entry (map, boss, quest) */
.entry { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; margin: 0 0 22px; overflow: hidden; }
.entry > header { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid #1f242c; background: #11141a; }
.entry > header h3 { margin: 0; font-family: var(--serif); font-size: 22px; }
.entry > header .sub { font-size: 13.5px; color: var(--muted); }
.entry > header .tags { margin: 0; margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.entry .body { padding: 16px 18px; }
.entry .body > :last-child { margin-bottom: 0; }
.entry .split { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 22px; }
.entry dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0 0 14px; font-size: 14.5px; }
.entry dt { color: var(--muted); }
.entry dd { margin: 0; }
.boss-art { width: 96px; height: 96px; image-rendering: pixelated; object-fit: contain; background: #0b0d10; border: 1px solid #23272e; border-radius: 4px; flex: none; }

/* minimap with marks */
.minimap { position: relative; border: 1px solid #2a2f37; border-radius: 4px; overflow: hidden; background: #0b0d10; }
.minimap img { display: block; width: 100%; height: auto; }
.minimap .mk { position: absolute; transform: translate(-50%, -50%); }
.minimap .area { position: absolute; border: 2px solid rgba(214, 58, 48, 0.9); background: rgba(196, 71, 61, 0.22); border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55); }
.minimap .area:hover { background: rgba(196, 71, 61, 0.45); }
.mrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 3px 0; }
.minimap .dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid #000; }
.minimap .herb { width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); }
.minimap .tele { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #7fe0ff; background: rgba(40, 160, 220, 0.35); }
.minimap .npc { background: #ffe38a; }
.minimap .boss { width: 16px; height: 16px; background: #c4473d; border: 2px solid #ffd9d3; border-radius: 3px; }
.minimap .door { width: 10px; height: 10px; background: #9be3c2; border: 1px solid #0b0c0f; transform: translate(-50%, -50%) rotate(45deg); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; border-radius: 50%; }

/* filters over a long list */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.filters button { min-height: 36px; padding: 0 14px; background: #12151a; border: 1px solid #343a44; border-radius: 18px; color: #cfd6d0; font: inherit; font-size: 14px; cursor: pointer; }
.filters button:hover { border-color: var(--jade); }
.filters button[aria-pressed="true"] { background: #0f1c17; border-color: var(--jade); color: var(--jade-light); font-weight: 600; }
.filters input, .filters select { min-height: 36px; padding: 0 12px; background: #0a0b0e; border: 1px solid #3a3f48; border-radius: 4px; color: #ece7d8; font: inherit; font-size: 14px; max-width: 100%; }
.filters input { flex: 1 1 200px; max-width: 320px; }
.count { font-size: 13px; color: var(--muted); }

/* the realm ladder */
.ladder { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 20px; }
.ladder div { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }
.ladder small { display: block; font-size: 11px; color: #7f8a83; letter-spacing: 0.14em; }
.ladder b { font-family: var(--serif); font-size: 19px; }
.ladder span { display: block; font-size: 12.5px; color: var(--muted); }
.ladder .locked { opacity: 0.55; }

.steps { counter-reset: s; list-style: none; padding: 0 !important; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 0 40px; margin: 0 0 14px !important; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: #0f1c17;
  border: 1px solid var(--jade-dark); color: var(--jade-light); font-size: 14px; font-weight: 600; text-align: center; line-height: 26px; }

.loading { color: var(--muted); font-size: 14px; padding: 12px 0; }
.wiki-foot-note { font-size: 13px; color: var(--muted); border-top: 1px solid #1d2229; padding-top: 18px; }

@media (max-width: 980px) {
  .tbl table { font-size: 15px; }
  .wiki-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 16px; }
  .wiki-side { position: static; max-height: none; overflow: visible; padding: 0; margin-bottom: 22px; }
  .side-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 14px; background: #11141a;
    border: 1px solid var(--line-2); border-radius: 4px; color: var(--text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
  .wiki-side .side-in { display: none; padding: 14px 4px 0; }
  .wiki-side.open .side-in { display: block; }
  .entry .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  /* 28/11: the site header's logo row scrolls away, its row of pages (45 px) stays above the search bar (site.css .nav-quick) */
  [id] { scroll-margin-top: calc(12px + var(--wiki-bar, 66px)); }
  .wiki-top .wrap { padding-top: 24px; }
  .wiki-top h1 { font-size: 28px; }
  .wiki-main h2 { font-size: 23px; }
  .entry > header .tags { margin-left: 0; }
  .entry dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .entry dt { margin-top: 6px; }
  .wrap { padding: 0 16px; }

  /* chủ game 05/12 "trên mobile chữ rất khó đọc": body text 16 px, nothing under 13 px, taps of 40 px and more */
  .wiki-main { font-size: 16px; line-height: 1.65; }
  .wiki-main h3 { font-size: 19px; }
  .wiki-main code { font-size: 15px; }
  .crumbs { font-size: 14px; }
  .note, details.spoiler > .in { font-size: 16px; }
  details.spoiler > summary, details.more > summary { font-size: 15.5px; padding-top: 10px; padding-bottom: 10px; }
  .wcard p { font-size: 15.5px; }
  .statline { font-size: 15px; }
  .entry dl { font-size: 16px; }
  .entry > header .sub { font-size: 14.5px; }
  .tag { font-size: 13px; }
  .sub, .tbl caption, .legend, .count, .wiki-foot-note { font-size: 14px; }
  .ladder span { font-size: 14px; }
  .ladder small { font-size: 12px; }
  .wsearch-bar .wrap { padding-top: 8px; padding-bottom: 8px; }
  .wsearch input, .filters input, .filters select { font-size: 16px; }   /* under 16 px an iPhone zooms the page in on a tap */
  .wsearch .results { max-height: 60vh; }
  .wsearch .results .s { font-size: 13.5px; }
  .wsearch .results .k { font-size: 11.5px; }
  .filters button { min-height: 40px; font-size: 15px; }
  .filters input, .filters select { min-height: 40px; }
  .wiki-side li a { padding: 10px 12px; font-size: 15px; }
  .wiki-side .toc a, .wiki-side .toc .lv3 a { padding-top: 8px; padding-bottom: 8px; font-size: 14.5px; }
  .it .ico { width: 24px; height: 24px; }
  .mon img { width: 32px; height: 32px; }
}

/* a phone: every table but a grid (Truyền Tống Trận) shows each row as a card, the column's name (data-l, wiki.js) over
   each value; numbers two to a line. Before 05/12 the rows scrolled sideways and the right-hand columns were cut off. */
@media (max-width: 640px) {
  .tbl:not(.grid) { border: 0; border-radius: 0; overflow: visible; }
  .tbl:not(.grid) table { display: flex; flex-direction: column; font-size: 16px; line-height: 1.5; }
  .tbl:not(.grid) thead { display: none; }
  .tbl:not(.grid) tbody { display: block; order: 1; }
  .tbl:not(.grid) caption { display: block; order: 2; padding: 2px 2px 0; }
  .tbl:not(.grid) caption.top { order: 0; margin: 0 0 8px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 6px; font-size: 15.5px; }
  .tbl:not(.grid) tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; margin: 0 0 10px; padding: 8px 14px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
  .tbl:not(.grid) tr.hl { border-color: var(--jade-dark); }
  .tbl:not(.grid) td, .tbl:not(.grid) tr:nth-child(even) td, .tbl:not(.grid) tr.hl td { display: block; grid-column: 1 / -1; min-width: 0; padding: 5px 0;
    border: 0; background: none !important; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  .tbl:not(.grid) td.n { grid-column: auto; }
  .tbl:not(.grid) td[data-l]::before { content: attr(data-l); display: block; margin-bottom: 1px; font-size: 13px; line-height: 1.4; font-weight: 600;
    letter-spacing: 0.02em; color: #a3ada6; }
  .tbl:not(.grid) td:first-child:not(.n) { padding: 4px 0 8px; margin-bottom: 2px; border-bottom: 1px solid #1f242c; font-size: 17px; }
  .tbl:not(.grid) td:first-child:not(.n)::before { display: none; }
  .tbl:not(.grid) .desc { min-width: 0; }
  .tbl:not(.grid) .nw, .tbl:not(.grid) .it, .tbl:not(.grid) .mon { white-space: normal; }
  .tbl.grid table { font-size: 15px; }
}

/* a phone on its side (812 × 375): the search bar does not stay pinned, so more than a third of the screen is left for the page */
@media (max-height: 500px) and (max-width: 1024px) {
  .wsearch-bar { position: static; }
  [id] { scroll-margin-top: calc(12px + var(--wiki-hdr, 45px)); }
}
