/* Hướng dẫn (huong-dan/): the site's ink and jade (assets/css/site.css) for picture-led guides; kbd, .note, .ico and .tag
   come from wiki/wiki.css. Images under huong-dan/img are made by Tools/guide (capture.py, build_images.py). */
:root {
  --g-move: #3f9e78;
  --g-fight: #d0574a;
  --g-win: #e3c06b;
  --g-misc: #6f9fd8;
  --g-card: #12151b;
  --g-card-2: #0e1015;
}

body.guide { background: var(--ink); }
.guide main { display: block; }
.guide .px, .guide img.icon { image-rendering: pixelated; }

/* hero: the words on the left, the game on the right */
.g-hero { position: relative; overflow: hidden; border-bottom: 1px solid #1d2229; background: radial-gradient(1200px 500px at 85% 20%, #11201a 0%, transparent 60%), linear-gradient(180deg, #0f1311, var(--ink)); }
.g-hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: center; padding-top: 56px; padding-bottom: 48px; }
.g-hero h1 { margin: 10px 0 14px; font-family: var(--serif); font-size: 46px; line-height: 1.15; color: var(--title); }
.g-hero .lead { margin: 0 0 22px; font-size: 17px; line-height: 1.7; color: var(--text-2); max-width: 560px; }
.g-hero .crumbs { font-size: 13px; color: var(--muted); }
.g-hero .crumbs a { color: #9fd9bd; text-decoration: none; }
.g-hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.g-seal { display: inline-block; background: #b23a31; color: #fbe9e4; font-family: var(--serif); font-weight: 700; font-size: 14px; letter-spacing: 0.18em;
  padding: 6px 10px; border: 2px solid #7d221c; box-shadow: inset 0 0 0 1px #e0857b; text-transform: uppercase; }

/* the quick index under the hero */
.g-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.g-chips a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; font-size: 14px; color: #d6dcd6; text-decoration: none;
  background: rgba(11, 12, 15, 0.7); border: 1px solid #2f353e; border-radius: 4px; }
.g-chips a:hover { border-color: var(--jade); color: #fff; background: #0f1c17; }
.g-chips img { width: 24px; height: 24px; image-rendering: pixelated; }

/* a screenshot in the game's frame; a click opens it big (guide.js) */
.gshot { margin: 0; position: relative; }
.gshot .frame { position: relative; display: block; padding: 6px; background: #0a0b0e; border: 2px solid var(--line-2); border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 3px var(--jade-dark), 0 18px 40px rgba(0, 0, 0, 0.55);
  /* hug the picture (its width comes from the img's sizes), never wider than the column */
  box-sizing: border-box; width: fit-content; max-width: 100%; }
.gshot img { display: block; width: 100%; height: auto; border-radius: 2px; }
.gshot button.zoom { all: unset; display: block; cursor: zoom-in; position: relative; }
.gshot button.zoom:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.gshot figcaption { padding: 0; border: 0; margin-top: 10px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.gshot figcaption b { color: var(--text); font-weight: 600; }
.g-hero .gshot .frame { transform: rotate(0.4deg); }

/* sections */
.g-body { padding: 24px 0 80px; }
.g-sec { padding: 56px 0 8px; border-top: 1px solid #171b21; }
.g-sec:first-child { border-top: 0; }
.g-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.g-num { flex: none; display: grid; place-items: center; width: 48px; height: 48px; margin-top: 2px; background: #b23a31; color: #fbe9e4; font-family: var(--serif);
  font-weight: 700; font-size: 22px; border: 2px solid #7d221c; box-shadow: inset 0 0 0 1px #e0857b; }
.g-head h2 { margin: 0; font-family: var(--serif); font-size: 32px; line-height: 1.2; color: var(--title); }
.g-head p { margin: 6px 0 0; color: var(--text-2); font-size: 16px; line-height: 1.6; max-width: 820px; }
.g-sec h3 { margin: 34px 0 14px; font-size: 21px; color: var(--title); font-weight: 600; }
.g-text { font-size: 16px; line-height: 1.75; color: #d9dcd5; max-width: 860px; }
.g-text p { margin: 0 0 14px; }
.g-text strong, .g-sec strong { color: #f3eedf; }

/* three steps side by side */
.steps3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps3 > li { counter-increment: s; background: var(--g-card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.steps3 .gshot .frame { border-radius: 0; border-width: 0 0 2px; box-shadow: none; padding: 0; width: auto; }
.steps3 .in { padding: 16px 18px 18px; }
.steps3 h3 { margin: 0 0 8px; font-size: 18px; display: flex; gap: 10px; align-items: baseline; }
.steps3 h3::before { content: counter(s); flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; font-size: 14px; color: #06110c;
  background: var(--jade); border-radius: 50%; font-family: var(--sans); font-weight: 700; }
.steps3 p { margin: 0 0 8px; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.steps3 p:last-child { margin-bottom: 0; }

/* the keyboard */
.kb-wrap { background: linear-gradient(180deg, #11141a, #0c0e12); border: 1px solid var(--line); border-radius: 8px; padding: 22px; margin-bottom: 18px; }
.kb-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 16px; padding: 0; list-style: none; font-size: 13.5px; color: var(--text-2); }
.kb-legend li { display: inline-flex; align-items: center; gap: 8px; }
.kb-legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.kb { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 5px; max-width: 980px; margin: 0 auto; user-select: none; }
.kb .k { all: unset; box-sizing: border-box; grid-column: span 2; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; padding: 4px 2px 6px; background: #1a1d24; color: #6c737c; border: 1px solid #2b3039; border-bottom-width: 4px; border-radius: 6px;
  font: 600 14px/1 var(--sans); text-align: center; }
.kb .k small { font-size: 9.5px; font-weight: 500; letter-spacing: 0.02em; line-height: 1.1; color: inherit; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.kb .k img { width: 22px; height: 22px; image-rendering: pixelated; }
.kb .w3 { grid-column: span 3; } .kb .w4 { grid-column: span 4; } .kb .w5 { grid-column: span 5; } .kb .w14 { grid-column: span 14; }
.kb .gap1 { grid-column: span 1; } .kb .gap2 { grid-column: span 2; }
.kb .k[data-g] { cursor: pointer; color: #f1ecdd; }
.kb .k[data-g="move"] { background: #11241c; border-color: #2c6b52; }
.kb .k[data-g="fight"] { background: #2a1513; border-color: #84362e; }
.kb .k[data-g="win"] { background: #241d0e; border-color: #7d6631; }
.kb .k[data-g="misc"] { background: #121c2a; border-color: #3b5a85; }
.kb .k[data-g]:hover, .kb .k[data-g]:focus-visible, .kb .k.on { transform: translateY(2px); border-bottom-width: 2px; filter: brightness(1.25); outline: none; }
.kb .k.on { box-shadow: 0 0 0 2px var(--gold); }
.kb-tip { min-height: 64px; max-width: 980px; margin: 16px auto 0; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px dashed #343a44; border-radius: 6px;
  color: var(--text-2); font-size: 15px; line-height: 1.55; }
.kb-tip img { width: 40px; height: 40px; image-rendering: pixelated; flex: none; }
.kb-tip b { color: var(--title); }
.kb-tip kbd { flex: none; }
.legend-move { background: var(--g-move); } .legend-fight { background: var(--g-fight); } .legend-win { background: var(--g-win); } .legend-misc { background: var(--g-misc); }

/* the key groups as cards */
.keys4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.kcard { background: var(--g-card); border: 1px solid var(--line); border-top: 3px solid var(--g-move); border-radius: 6px; padding: 16px 18px 8px; }
.kcard.fight { border-top-color: var(--g-fight); } .kcard.win { border-top-color: var(--g-win); } .kcard.misc { border-top-color: var(--g-misc); }
.kcard h3 { margin: 0 0 10px; font-size: 17px; letter-spacing: 0.02em; }
.krow { display: grid; grid-template-columns: 136px 34px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid #1c2027; font-size: 14.5px; line-height: 1.5; color: #cdd2cc; }
.krow:first-of-type { border-top: 0; }
.krow .kk { display: flex; flex-wrap: wrap; gap: 3px; }
.krow .kk kbd { margin: 0; }
.krow img { width: 32px; height: 32px; image-rendering: pixelated; }
.krow .noimg { width: 32px; height: 32px; }
.krow b { color: var(--title); font-weight: 600; }
.krow.hl { background: rgba(227, 192, 107, 0.08); box-shadow: -18px 0 0 rgba(227, 192, 107, 0.08), 18px 0 0 rgba(227, 192, 107, 0.08); }
.mouse { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: #f1ecdd; background: #1b1f26; border: 1px solid #3a404a;
  border-bottom-width: 3px; border-radius: 10px 10px 12px 12px; padding: 2px 8px; white-space: nowrap; }

/* a screenshot with numbered pins and their legend */
.pinned { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.pinned.narrow { grid-template-columns: minmax(0, 560px) minmax(0, 1fr); }
.pinmap { position: relative; }
.pinned .pinmap { position: sticky; top: 96px; }
.pin { position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); color: #1a1405; font: 700 12px/1 var(--sans); border: 2px solid #1a1405; box-shadow: 0 0 0 2px var(--gold), 0 4px 10px rgba(0, 0, 0, 0.6);
  cursor: pointer; z-index: 2; transition: transform 120ms; }
.pin:hover, .pin.on { transform: translate(-50%, -50%) scale(1.25); background: #fff3c8; }
.pin.on::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid var(--gold); animation: ping 1.2s ease-out infinite; }
@keyframes ping { from { opacity: 1; transform: scale(0.7); } to { opacity: 0; transform: scale(1.5); } }
.pins { margin: 0; padding: 0; list-style: none; counter-reset: p; display: flex; flex-direction: column; gap: 4px; }
.pins li { counter-increment: p; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 10px 12px; border-radius: 6px; cursor: default;
  font-size: 14.5px; line-height: 1.55; color: #cdd2cc; border: 1px solid transparent; }
.pins li::before { content: counter(p); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #1a1405; font-weight: 700; font-size: 13px; }
.pins li.on, .pins li:hover { background: #17140c; border-color: #6b5a2c; }
.pins li b { color: var(--title); }
.pins li .icons { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pins li .icons img { width: 28px; height: 28px; image-rendering: pixelated; }

/* the menu icon row as the HUD draws it */
.menu-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; padding: 0; list-style: none; }
.menu-row li { flex: 1 1 120px; max-width: 170px; }
.menu-row a, .menu-row div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px 12px; background: var(--g-card); border: 1px solid var(--line);
  border-radius: 6px; text-decoration: none; color: var(--text); text-align: center; height: 100%; }
.menu-row a:hover { border-color: var(--gold); background: #17140c; }
.menu-row img { width: 48px; height: 48px; image-rendering: pixelated; }
.menu-row b { font-size: 14.5px; color: var(--title); }
.menu-row span { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* a gallery of windows */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.gallery .gshot .frame { height: 420px; width: auto; }
.gallery .gshot button.zoom { height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; }
.gallery .gshot img { width: auto; height: auto; max-width: 100%; max-height: 100%; }
.gallery .gshot figcaption { display: flex; gap: 10px; align-items: flex-start; }
.gallery .gshot figcaption img { width: 32px; height: 32px; image-rendering: pixelated; flex: none; margin-top: -4px; }

/* the first hour: a path of steps, a picture beside each */
.path { position: relative; margin: 0; padding: 0; list-style: none; counter-reset: st; }
.path::before { content: ''; position: absolute; left: 23px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(180deg, var(--jade), #6b5a2c 60%, var(--seal)); opacity: 0.6; }
.path > li { counter-increment: st; position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1.05fr); gap: 22px; padding: 18px 0 26px; }
.path > li::before { content: counter(st); position: relative; z-index: 1; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #0f1c17;
  border: 2px solid var(--jade); color: var(--jade-light); font: 700 19px/1 var(--serif); }
.path h3 { margin: 6px 0 10px; font-size: 21px; }
.path .txt { font-size: 15.5px; line-height: 1.7; color: #d2d6d0; }
.path .txt p { margin: 0 0 10px; }
.path .txt ul { margin: 0 0 10px; padding-left: 20px; }
.path .txt li { margin: 3px 0; }
.chips-ico { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.chips-ico span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; background: #11151b; border: 1px solid #2b3039; border-radius: 4px; font-size: 13.5px; color: #e4e0d2; }
.chips-ico img { width: 28px; height: 28px; image-rendering: pixelated; }
.g-realms { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; padding: 0; list-style: none; }
.g-realms li { font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 3px; background: #11151b; border: 1px solid currentColor; }
.g-realms li.closed { opacity: 0.45; border-style: dashed; }

/* features to know: cards with an in-game icon */
.feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.feat { display: flex; flex-direction: column; gap: 10px; background: var(--g-card); border: 1px solid var(--line); border-radius: 6px; padding: 18px; }
.feat header { display: flex; align-items: center; gap: 12px; }
.feat header img { width: 48px; height: 48px; image-rendering: pixelated; flex: none; background: #0b0d10; border: 1px solid #23272e; border-radius: 6px; padding: 4px; box-sizing: content-box; }
.feat h3 { margin: 0; font-size: 17px; line-height: 1.3; }
.feat h3 small { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.feat p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.feat ul { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.feat li { margin: 2px 0; }
.feat .more { margin-top: auto; padding-top: 4px; font-size: 13.5px; }
.feat .more a { text-decoration: none; }
.feat .more a:hover { text-decoration: underline; }
.feat.wide { grid-column: span 2; }
.feat .mini { margin-top: 4px; }
.feat .mini img { width: 100%; border-radius: 4px; border: 1px solid #23272e; }

/* phone */
.phone { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: center; }

/* tips */
.tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.tips li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: #0f1714; border-left: 3px solid var(--jade); border-radius: 0 6px 6px 0; font-size: 14.5px; line-height: 1.6; color: #cfd6cf; }
.tips li img { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.tips li b { color: var(--title); }

/* read on */
.next { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.next a { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--g-card); border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--text); }
.next a:hover { border-color: var(--jade); background: #0f1c17; }
.next img { width: 36px; height: 36px; image-rendering: pixelated; flex: none; }
.next b { display: block; color: var(--title); font-size: 15px; }
.next span { font-size: 12.5px; color: var(--muted); }

/* the big picture */
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(5, 6, 8, 0.92); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 90px); width: auto; height: auto; border: 2px solid var(--line-2); border-radius: 4px; image-rendering: auto; }
.lightbox p { margin: 12px 0 0; color: var(--text-2); font-size: 14px; text-align: center; }

/* a road of steps left to right (Lên Trúc Cơ) */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: f; }
.flow li { counter-increment: f; position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px 14px 14px; background: var(--g-card);
  border: 1px solid var(--line); border-top: 3px solid var(--jade); border-radius: 6px; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.flow li::before { content: counter(f); position: absolute; top: -14px; left: 12px; display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--jade); color: #06110c; font: 700 13px/1 var(--sans); }
.flow li b { color: var(--title); font-size: 15px; }
.flow li img { width: 36px; height: 36px; image-rendering: pixelated; }
.flow li:last-child { border-top-color: var(--gold); }
.flow li:last-child::before { background: var(--gold); }

/* the chance as a sum of chips */
.formula { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 0 0 16px; }
.formula .term { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 120px; padding: 10px 12px; background: var(--g-card);
  border: 1px solid var(--line); border-radius: 6px; font-size: 13px; color: var(--text-2); }
.formula .term b { font-size: 20px; color: var(--title); font-variant-numeric: tabular-nums; }
.formula .term.total { border-color: var(--gold); background: #17140c; }
.formula .term.total b { color: var(--gold); }
.formula .op { display: grid; place-items: center; font: 700 22px/1 var(--sans); color: var(--muted); padding: 0 2px; }

/* the boss materials */
.mats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 0 0 18px; }
.mat { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 12px 14px; background: var(--g-card);
  border: 1px solid var(--line); border-radius: 6px; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.mat img { grid-row: span 2; width: 44px; height: 44px; image-rendering: pixelated; background: #0b0d10; border: 1px solid #23272e; border-radius: 6px; padding: 4px; box-sizing: border-box; }
.mat b { color: var(--title); font-size: 15px; }
.mat .where { grid-column: 1 / -1; padding-top: 6px; border-top: 1px dashed #2b3039; }
.mat .tag { margin-right: 4px; }

/* two roads side by side */
.vs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 0 16px; }
.vs > div { padding: 16px 18px; background: var(--g-card); border: 1px solid var(--line); border-radius: 6px; border-top: 3px solid var(--jade); }
.vs > div.worse { border-top-color: var(--seal); }
.vs h4 { margin: 0 0 8px; font-size: 16px; color: var(--title); }
.vs ul { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.vs .big { display: block; margin: 4px 0 10px; font: 700 26px/1.2 var(--serif); color: var(--gold); }
.vs .worse .big { color: #f3b3aa; }

/* a picture beside words */
.side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: 26px; align-items: start; margin: 0 0 18px; }
.side.flip { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); }
.side .g-text { max-width: none; }
.g-text ul { margin: 0 0 14px; padding-left: 22px; }
.g-text li { margin: 4px 0; }
.g-sec .tbl { margin-top: 4px; }
.g-sec .tbl td b { color: var(--title); }
.g-sec .tbl td img.ic { width: 24px; height: 24px; image-rendering: pixelated; vertical-align: middle; }   /* a row's icon (Ma Vực, Ba phái Ma) */
.g-sec .tbl img.ico { margin-right: 6px; }

/* the damage pipeline: one box per factor, × between them */
.pipe { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.pipe li { flex: 1 1 140px; display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 10px; background: var(--g-card); border: 1px solid var(--line);
  border-top: 3px solid var(--gold); border-radius: 6px; font-size: 13px; line-height: 1.45; color: var(--text-2); position: relative; }
.pipe li b { font-size: 14.5px; color: var(--title); }
.pipe li img { width: 28px; height: 28px; image-rendering: pixelated; }
.pipe li .k { font: 700 13px/1 var(--sans); color: var(--gold); }
.pipe li.minus { border-top-color: var(--seal); }
.pipe li.minus .k { color: #f3b3aa; }
.pipe li.end { border-top-color: var(--jade); }
.pipe li.end .k { color: var(--jade-light); }

/* bars that compare two choices */
.bars { display: grid; gap: 8px; margin: 0 0 16px; max-width: 760px; }
.bars .row { display: grid; grid-template-columns: 210px minmax(0, 1fr) 64px; gap: 12px; align-items: center; font-size: 14px; color: var(--text-2); }
.bars .track { height: 18px; background: #0b0d10; border: 1px solid #23272e; border-radius: 3px; overflow: hidden; }
.bars .fill { height: 100%; background: linear-gradient(90deg, var(--jade-dark), var(--jade)); }
.bars .fill.gold { background: linear-gradient(90deg, #7d6631, var(--gold)); }
.bars .fill.red { background: linear-gradient(90deg, #7d221c, var(--seal)); }
.bars .v { font-weight: 700; color: var(--title); font-variant-numeric: tabular-nums; text-align: right; }

/* a checklist that reads in order */
.check { margin: 0; padding: 0; list-style: none; counter-reset: c; display: grid; gap: 8px; }
.check li { counter-increment: c; display: grid; grid-template-columns: 34px 32px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 14px;
  background: var(--g-card); border: 1px solid var(--line); border-radius: 6px; font-size: 14.5px; line-height: 1.55; color: var(--text-2); }
.check li::before { content: counter(c); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #0f1c17;
  border: 2px solid var(--jade); color: var(--jade-light); font: 700 14px/1 var(--sans); }
.check li img { width: 32px; height: 32px; image-rendering: pixelated; }
.check li b { color: var(--title); }

/* the guide hub */
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.hub a.big { display: grid; grid-template-rows: auto 1fr; background: var(--g-card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; text-decoration: none; color: var(--text); }
.hub a.big:hover { border-color: var(--gold); }
.hub a.big img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-bottom: 1px solid var(--line); }
.hub a.big .in { display: block; padding: 16px 18px 18px; }
.hub a.big .tag { margin-bottom: 8px; }
.hub a.big h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 22px; color: var(--title); }
.hub a.big p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.hub .soon { display: grid; place-items: center; min-height: 160px; border: 1px dashed #343a44; border-radius: 8px; color: var(--muted); font-size: 14px; text-align: center; padding: 18px; }

/* Luyện đan: đan văn in the game's colours, its ladder, the lò calculator */
.dv0 { color: #c9ccc6; } .dv1 { color: #7fd38a; } .dv2 { color: #6fb5ff; } .dv3 { color: #b98cff; } .dv4 { color: var(--gold); }
.dv-ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.dv-ladder li { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--g-card); border: 1px solid var(--line); border-top: 3px solid currentColor;
  border-radius: 6px; font-size: 13px; line-height: 1.5; }
.dv-ladder li b { font-size: 16px; }
.dv-ladder li .k { font: 700 22px/1.1 var(--serif); color: var(--title); }
.dv-ladder li span { color: var(--text-2); }
.calc { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 24px; padding: 20px; margin: 0 0 18px; background: var(--g-card);
  border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: 8px; }
.calc label { display: block; margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }
.calc select { display: block; width: 100%; margin-top: 6px; padding: 8px 10px; background: #0b0d10; color: var(--text); border: 1px solid #343a44; border-radius: 4px;
  font: 500 15px/1.3 var(--sans); }
.calc select:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.calc .pick { display: flex; align-items: center; gap: 12px; padding-top: 4px; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.calc .pick img { width: 48px; height: 48px; image-rendering: pixelated; flex: none; background: #0b0d10; border: 1px solid #23272e; border-radius: 6px; padding: 4px; box-sizing: content-box; }
.calc .out { display: grid; gap: 14px; align-content: start; }
.calc .stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.calc .stat { padding: 10px 12px; background: #0b0d10; border: 1px solid #23272e; border-radius: 6px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.calc .stat b { display: block; font-size: 19px; color: var(--title); font-variant-numeric: tabular-nums; }
.calc .stat.hi b { color: var(--gold); }
.calc .bars { margin: 0; max-width: none; }
.calc .bars .row { grid-template-columns: 96px minmax(0, 1fr) 64px; }
.calc .msg { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.calc .msg.warn { color: #f3b3aa; }
.bars .fill.dv0 { background: #6c727a; } .bars .fill.dv1 { background: #3f8f52; } .bars .fill.dv2 { background: #3d78b8; }
.bars .fill.dv3 { background: #7b57b8; } .bars .fill.dv4 { background: linear-gradient(90deg, #7d6631, var(--gold)); }

/* Lên Kim Đan: a drawn diagram (the kiếp's circles) in the guide's card */
.diagram { margin: 0 0 18px; padding: 14px 16px 12px; background: var(--g-card); border: 1px solid var(--line); border-radius: 8px; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram svg text { font-family: var(--sans); fill: #d9dcd5; }
.diagram figcaption { margin-top: 8px; padding: 0; border: 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.diagram figcaption b { color: var(--text); }

@media (max-width: 1080px) {
  .g-hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .calc { grid-template-columns: minmax(0, 1fr); }
  .dv-ladder { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pinned, .pinned.narrow, .phone, .side, .side.flip { grid-template-columns: minmax(0, 1fr); }
  .pinned .pinmap { position: static; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .path > li { grid-template-columns: 48px minmax(0, 1fr); }
  .path > li .gshot { grid-column: 2; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .g-hero h1 { font-size: 34px; }
  .g-hero .wrap { padding-top: 36px; gap: 26px; }
  .g-head h2 { font-size: 25px; }
  .g-num { width: 40px; height: 40px; font-size: 18px; }
  .steps3, .keys4, .gallery, .vs { grid-template-columns: minmax(0, 1fr); }
  .formula .term { min-width: 0; flex: 1 1 40%; }
  .bars .row { grid-template-columns: 110px minmax(0, 1fr) 52px; gap: 8px; font-size: 13px; }
  .check li { grid-template-columns: 30px minmax(0, 1fr); }
  .check li img { display: none; }
  .formula .op { display: none; }
  .gallery .gshot .frame { height: auto; max-height: 520px; }
  .feat.wide { grid-column: auto; }
  .kb-wrap { padding: 12px 8px; }
  .kb { gap: 3px; }
  .kb .k { min-height: 38px; font-size: 11px; border-radius: 4px; border-bottom-width: 3px; padding: 2px 0 4px; }
  .kb .k small, .kb .k img { display: none; }
  .krow { grid-template-columns: 104px 30px minmax(0, 1fr); gap: 10px; }
  .krow .kk kbd { min-width: 20px; padding: 1px 5px; }
  .path::before { left: 17px; }
  .path > li { grid-template-columns: 36px minmax(0, 1fr); gap: 14px; }
  .path > li::before { width: 36px; height: 36px; font-size: 15px; }
  .pin { width: 18px; height: 18px; font-size: 10px; border-width: 1px; }
  .dv-ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc { padding: 14px; }
  .calc .bars .row { grid-template-columns: 78px minmax(0, 1fr) 52px; }
}
