/* =============================================================================
   NGỌA LONG H5 · TÀNG KINH CÁC — wiki.css  (23/11/2026)
   Ngôn ngữ thiết kế lấy từ khối "Võ Tướng" trang chủ (web/index.html: .generals,
   .gen-tabs, .gen-scrollpanel, .gen-medallion, .orn-*): nền than xanh, khung
   viền vàng mảnh + viền trong đôi + hột kim cương ở góc, huy chương tròn viền
   vàng, nút lọc dạng pill vàng, tiêu đề serif trang trí + đường kẻ vàng ❖,
   tiêu đề khối màu son có ô vuông nhỏ, số liệu lớn kèm nhãn chữ hoa nhỏ.

   Hệ thiết kế dùng lại được — xem mục "DESIGN SYSTEM" ở cuối báo cáo/plan:
     tokens  : --bg --ink --body --muted --gold --gold-text --gold-grad --gold-ink
               --red --note --line --panel-grad --panel-edge --plate-grad --ring ...
     layout  : .wrap .orn-head .wk-section .split
     khung   : .panel/.glass/.orn-frame (khung đôi + kim cương), .frame-lite
     tiêu đề : .orn-h .orn-rule .orn-pav .eyebrow .block-h .note .group-head
     điều khiển: .chip(.pills/.chips) .sel .wk-search .wk-reset .icon-btn
     dữ liệu : .medal .camp-badge .picks .facts .stat-bar .kv .wk-table .eff .tag .pill .qc
   Chữ: Philosopher (serif, đủ glyph tiếng Việt) + Be Vietnam Pro (sans) — cả hai
   tự host; KHÔNG để serif rơi về Georgia (tách dấu tiếng Việt).
   ============================================================================= */

@import url("/assets/fonts/be-vietnam-pro/be-vietnam-pro.css");

@font-face {
  font-family: "Philosopher";
  src: url("/assets/fonts/Philosopher-Regular.ttf") format("truetype");
  font-display: swap;
}

/* ---------------------------------------------------------------- tokens */
:root {
  --serif: "Philosopher", "Be Vietnam Pro", "Segoe UI", sans-serif;
  --sans: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius: 6px;
  --radius-pill: 999px;

  --step-0: 0.875rem;
  --step-1: 1rem;
  --step-2: 1.15rem;
  --step-3: 1.375rem;
  --step-4: 1.75rem;
  --step-5: 2.25rem;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 56px;

  --head-h: 60px;          /* JS đo lại chiều cao header thật */
  --maxw: 1280px;
  --tap: 40px;             /* vùng chạm tối thiểu trên mobile */

  --ease: cubic-bezier(.22, .68, .28, 1);
  --dur: .22s;
}

/* ------- DARK (mặc định): nền than xanh, khung vàng — khớp .generals ------- */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101411;
  --bg-2: #161c17;
  --band-tint:
    radial-gradient(60% 40% at 18% 0%, rgba(84, 104, 73, .30), transparent 70%),
    radial-gradient(50% 40% at 92% 6%, rgba(215, 184, 120, .07), transparent 70%);
  --ink: #f2ebdc;
  --body: #c3c7bb;
  --muted: #a5a99e;
  --faint: #8d9384;
  --gold: #d7b878;
  --gold-text: #e3c88f;
  --gold-deep: #795f35;
  --gold-grad: linear-gradient(120deg, #ecd3a0, #bd9554);
  --gold-solid: #d4b47c;           /* màu nền đặc thay gradient (đo tương phản) */
  --gold-ink: #2a1d08;             /* chữ trên nền vàng: luôn đậm, cả 2 theme */
  --red: #e08568;
  --red-glow: rgba(224, 133, 104, .28);
  --note: #d9b36a;
  --quote: #e6c988;
  --line: rgba(215, 184, 120, .28);
  --line-soft: rgba(215, 184, 120, .14);
  --panel: #151a16;
  --panel-grad: linear-gradient(180deg, #171d18, #131813);
  --panel-edge: rgba(215, 184, 120, .38);
  --panel-inset: rgba(215, 184, 120, .06);
  --frame-halo: #101411;
  --plate: #1b221c;
  --plate-grad: radial-gradient(circle at 50% 26%, #1f2721, #171d17 68%, #131812);
  --plate-outer: rgba(215, 184, 120, .14);
  --ring: rgba(215, 184, 120, .5);
  --ring-dash: rgba(215, 184, 120, .4);
  --plate-inset: rgba(0, 0, 0, .35);
  --chip-bg: rgba(215, 184, 120, .07);
  --chip-grad: radial-gradient(circle at 50% 28%, #232b24, #161b16);
  --field: #0e120f;
  --row-hover: rgba(215, 184, 120, .08);
  --h-grad: linear-gradient(180deg, #f0d9a4 8%, #d7b878 42%, #f7e9c4 56%, #b98f4a 92%);
  --text-shadow: 0 2px 1.5px rgba(0, 0, 0, .45);
  --head-bg: rgba(13, 17, 14, .94);
  --shadow: 0 22px 46px rgba(0, 0, 0, .32);
  --shadow-sm: 0 9px 18px rgba(0, 0, 0, .22);
  --scrim: rgba(6, 9, 7, .62);
  --ok: #5fc796;
  --bad: #f08a80;
  --q1: #a9b2bc; --q2: #6ab8f5; --q3: #5cd0a2; --q4: #ecebb0; --q5: #f48a85;
  --q6: #bda4fb; --q7: #f5ab66; --q8: #ecd08f;
  --qc-mix: #ffffff; --qc-amt: 28%;
  --diamond: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23ecd39c'/%3E%3Cstop offset='1' stop-color='%23a87c28'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M8 1.2 14.8 8 8 14.8 1.2 8Z' fill='url(%23g)' stroke='%23101411' stroke-width='1.6'/%3E%3C/svg%3E");
}

/* ------- LIGHT: nền ngà sạch, khung vàng sẫm — khớp .generals light -------- */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f8f6ef;
  --bg-2: #ffffff;
  --band-tint:
    radial-gradient(52% 40% at 10% 0%, rgba(243, 176, 94, .10), transparent 62%),
    radial-gradient(48% 42% at 94% 4%, rgba(169, 126, 47, .07), transparent 60%);
  --ink: #262014;
  --body: #4f493a;
  --muted: #6b6453;
  --faint: #756e5e;
  --gold: #a97e2f;
  --gold-text: #7d5a17;
  --gold-deep: #c09a4e;
  --gold-grad: linear-gradient(120deg, #f0d6a0, #c99a4a);
  --gold-solid: #ddb876;
  --gold-ink: #2a1d08;
  --red: #a63d2a;
  --red-glow: rgba(166, 61, 42, .22);
  --note: #8a5a16;
  --quote: #8a5a16;
  --line: rgba(169, 126, 47, .40);
  --line-soft: rgba(169, 126, 47, .20);
  --panel: #fffdf7;
  --panel-grad: linear-gradient(180deg, #ffffff, #fffcf3);
  --panel-edge: rgba(169, 126, 47, .45);
  --panel-inset: rgba(212, 172, 92, .10);
  --frame-halo: #ffffff;
  --plate: #f8efd6;
  --plate-grad: radial-gradient(circle at 50% 26%, #fffbef, #f6ebcd 68%, #ecd9ac);
  --plate-outer: rgba(255, 255, 255, .95);
  --ring: #d8b874;
  --ring-dash: rgba(158, 108, 28, .5);
  --plate-inset: rgba(178, 128, 40, .14);
  --chip-bg: rgba(169, 126, 47, .07);
  --chip-grad: radial-gradient(circle at 50% 28%, #fffdf2, #f3e9cf);
  --field: #ffffff;
  --row-hover: rgba(169, 126, 47, .08);
  --h-grad: linear-gradient(180deg, #8a5a16 8%, #c99a3e 42%, #b98a2e 56%, #7a5410 92%);
  --text-shadow: 0 2px 1.5px rgba(92, 62, 12, .22);
  --head-bg: rgba(255, 253, 247, .95);
  --shadow: 0 18px 40px rgba(60, 44, 14, .12);
  --shadow-sm: 0 8px 16px rgba(60, 44, 14, .10);
  --scrim: rgba(38, 32, 20, .45);
  --ok: #1f7a4d;
  --bad: #b42318;
  --q1: #5f6670; --q2: #136aa8; --q3: #11734d; --q4: #6f6a12; --q5: #b42d27;
  --q6: #7442d6; --q7: #b44f08; --q8: #8f600a;
  --qc-mix: #000000; --qc-amt: 55%;
  --diamond: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23ecd39c'/%3E%3Cstop offset='1' stop-color='%23a87c28'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M8 1.2 14.8 8 8 14.8 1.2 8Z' fill='url(%23g)' stroke='%23ffffff' stroke-width='1.6'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head-h) + 16px);
  /* KHÔNG đặt overflow-x trên html: html + body cùng hidden biến body thành
     vùng cuộn riêng → toolbar position:sticky mất tác dụng */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--band-tint), var(--bg);
  background-attachment: fixed;
  color: var(--body);
  font: 400 15px/1.65 var(--sans);
  overflow-x: hidden;
  transition: background-color .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold-text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; color: var(--ink); }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.wrap { width: min(var(--maxw), 100% - 32px); margin-inline: auto; }
@media (min-width: 900px) { .wrap { width: min(var(--maxw), 100% - 64px); } }

/* ============================================================ KHUNG (FRAME)
   .panel / .glass / .orn-frame : khung đôi viền vàng + 4 hột kim cương góc
   .frame-lite                  : khung đôi không kim cương (ô nhỏ, hàng)      */
.glass, .orn-frame, .frame-lite, .panel, .wk-toolbar, .wk-finder, .detail-portrait, .wk-card-link, .sheet-card, .wk-stat-board {
  position: relative;
  background-color: var(--panel);
  background-image: var(--panel-grad);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm), inset 0 0 28px var(--panel-inset);
}
.glass::before, .orn-frame::before, .frame-lite::before, .panel::before, .wk-toolbar::before, .wk-finder::before,
.detail-portrait::before, .wk-card-link::before, .sheet-card::before, .wk-stat-board::before {
  content: ""; position: absolute; inset: 4px; pointer-events: none;
  border: 1px solid var(--line-soft); border-radius: 2px;
}
/* khung lớn: viền 2px + kim cương góc */
.panel, .orn-frame, .wk-toolbar, .wk-finder, .detail-portrait, .wk-card-link, .sheet-card, .wk-stat-board {
  border-width: 2px;
  box-shadow: var(--shadow), inset 0 0 34px var(--panel-inset);
}
.panel::before, .orn-frame::before, .wk-toolbar::before, .wk-finder::before,
.detail-portrait::before, .wk-card-link::before, .sheet-card::before, .wk-stat-board::before {
  inset: 5px; border-color: var(--line);
}
.panel::after, .orn-frame::after, .wk-toolbar::after, .wk-finder::after,
.detail-portrait::after, .wk-card-link::after, .wk-stat-board::after {
  content: ""; position: absolute; inset: -8px; pointer-events: none; z-index: 2;
  background:
    var(--diamond) left top / 14px 14px no-repeat,
    var(--diamond) right top / 14px 14px no-repeat,
    var(--diamond) left bottom / 14px 14px no-repeat,
    var(--diamond) right bottom / 14px 14px no-repeat;
  transition: filter var(--dur) var(--ease);
}
.panel:hover::after, .wk-card-link:hover::after { filter: drop-shadow(0 0 4px rgba(236, 211, 156, .75)); }

/* ============================================================ HEADER */
.wk-head {
  position: sticky; top: 0; z-index: 60;
  background: var(--head-bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.wk-head::after {
  /* chỉ vàng mảnh dưới header, đậm ở giữa */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .7;
}
.wk-head-in { display: flex; align-items: center; gap: var(--sp-3); min-height: 56px; }
.wk-brand {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--serif); font-size: 1.2rem; letter-spacing: .03em; color: var(--ink);
  white-space: nowrap; min-height: var(--tap);
}
.wk-brand b {
  font-weight: 400; background: var(--h-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wk-brand img { width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--ring); }
.wk-head-spacer { flex: 1; }
.wk-head-links { display: none; gap: 4px; }
@media (min-width: 1000px) { .wk-head-links { display: flex; } }
.wk-head-links a {
  padding: 7px 13px; border-radius: var(--radius-pill);
  color: var(--body); font-size: 13.5px; font-weight: 500; white-space: nowrap;
  border: 1px solid transparent;
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.wk-head-links a:hover { border-color: var(--line); color: var(--gold-text); }
.wk-head-links a[aria-current="page"] {
  background: var(--gold-grad); background-color: var(--gold-solid); color: var(--gold-ink); font-weight: 600;
}
.icon-btn {
  width: var(--tap); height: var(--tap); flex: 0 0 auto;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  background: var(--chip-grad); background-color: var(--plate);
  border: 1px solid var(--line);
  color: var(--gold-text);
  transition: transform var(--dur) var(--ease), border-color var(--dur);
}
.icon-btn:hover { border-color: var(--gold); transform: translateY(-2px); }
.icon-btn svg { width: 18px; height: 18px; }
[data-theme="dark"] .i-sun, :root:not([data-theme]) .i-sun { display: none; }
[data-theme="light"] .i-moon { display: none; }
.wk-menu-btn { display: inline-grid; }
@media (min-width: 1000px) { .wk-menu-btn { display: none; } }
.wk-mobile-nav {
  display: grid; gap: 2px; padding: var(--sp-3); margin: var(--sp-2) auto var(--sp-3);
}
.wk-mobile-nav a { padding: 11px 14px; border-radius: var(--radius-sm); color: var(--body); min-height: 44px; position: relative; z-index: 3; }
.wk-mobile-nav a:hover, .wk-mobile-nav a[aria-current="page"] { background: var(--row-hover); color: var(--gold-text); }

/* thanh nhảy nhanh giữa các quyển — luôn hiện dưới header (mobile + tablet) */
.wk-jump {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 0 16px 9px; margin: 0 auto;
  -webkit-overflow-scrolling: touch;
}
.wk-jump::-webkit-scrollbar { display: none; }
@media (min-width: 1000px) { .wk-jump { display: none; } }
.wk-jump a {
  flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 36px;
  padding: 0 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--chip-bg);
  font-size: 13px; font-weight: 500; color: var(--body); white-space: nowrap;
}
.wk-jump a[aria-current="page"] {
  background: var(--gold-grad); background-color: var(--gold-solid); color: var(--gold-ink);
  border-color: transparent; font-weight: 600;
}

/* ============================================================ TIÊU ĐỀ TRANG TRÍ */
.eyebrow {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--red); font-weight: 600;
}
.crumb, .wk-crumb {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: var(--sp-4) 0 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
.crumb a, .wk-crumb a { color: var(--gold-text); }
.crumb a:hover, .wk-crumb a:hover { text-decoration: underline; text-underline-offset: 3px; }

.orn-head {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--sp-5) 0 var(--sp-5);
}
@media (min-width: 900px) { .orn-head { padding: var(--sp-7) 0 var(--sp-6); } }
.orn-pav { width: 78px; height: 30px; color: var(--gold); margin-bottom: 6px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .18)); }
.orn-h, .page-title, .wk-hero h1 {
  margin: 8px 0 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 6.4vw, 3.25rem); line-height: 1.18; letter-spacing: .04em;
  background: var(--h-grad); background-color: transparent;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(var(--text-shadow));
  padding: 0 .06em .06em;  /* chừa chỗ cho dấu tiếng Việt khi clip gradient */
}
.orn-rule {
  display: flex; align-items: center; gap: 14px; width: min(460px, 86%);
  margin: 12px auto 0; color: var(--gold); font-size: 11px; line-height: 1;
}
.orn-rule i { flex: 1; height: 1px; opacity: .85; }
.orn-rule i:first-child { background: linear-gradient(90deg, transparent, currentColor); }
.orn-rule i:last-child { background: linear-gradient(90deg, currentColor, transparent); }
.orn-rule span { font-family: "Segoe UI Symbol", "Segoe UI", sans-serif; color: var(--gold-text); }
.page-sub, .wk-lead {
  margin: 14px auto 0; max-width: 64ch; color: var(--body); font-size: var(--step-0); line-height: 1.7;
}
.page-sub b, .wk-lead b { color: var(--gold-text); font-weight: 600; }

/* tiêu đề khối màu son + ô vuông nhỏ (= .gen-block-h trang chủ) */
.block-h, .panel > h3, .group-head h3, .sheet-body .panel h3 {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 9px;
  font-family: var(--serif); font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.3;
  color: var(--red); font-weight: 700; letter-spacing: .01em;
}
.block-h::before, .panel > h3::before, .group-head h3::before {
  content: ""; flex: 0 0 auto; width: 11px; height: 11px;
  border: 2px solid var(--red); border-radius: 2px; transform: rotate(45deg) scale(.86);
}
.block-h .sep { color: var(--red); opacity: .55; font-weight: 400; }
.note, .hint, .panel > h3 .hint {
  font-family: var(--sans); font-style: italic; font-weight: 400;
  font-size: 12.5px; color: var(--note); letter-spacing: 0;
}
.quote { font-family: var(--serif); font-style: italic; font-size: 16.5px; color: var(--quote); }

/* ============================================================ HUB HERO + TÌM */
.wk-hero { padding: var(--sp-4) 0 var(--sp-3); text-align: center; }
.wk-hero h1 em { font-style: normal; }
.wk-finder {
  margin: var(--sp-6) auto 0; padding: var(--sp-4); max-width: 820px; text-align: left;
}
@media (min-width: 700px) { .wk-finder { padding: var(--sp-5) var(--sp-6); } }
.wk-search {
  position: relative; z-index: 3;
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px 4px 4px 16px; min-height: 48px;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.wk-search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px var(--red-glow); }
.wk-search svg { width: 18px; height: 18px; color: var(--gold-text); flex: 0 0 auto; }
.wk-search input {
  flex: 1; min-width: 0; width: 100%; border: 0; background: none; padding: 9px 0;
  font-size: 16px; color: var(--ink); outline: none; text-overflow: ellipsis;
}
.wk-search input::placeholder { color: var(--faint); }
.wk-search input::-webkit-search-cancel-button { filter: grayscale(1); opacity: .7; }
.wk-search .go, .btn-gold {
  flex: 0 0 auto; min-height: var(--tap); padding: 0 20px;
  border-radius: var(--radius-pill);
  background: var(--gold-grad); background-color: var(--gold-solid); color: var(--gold-ink);
  font-size: 13.5px; font-weight: 700; letter-spacing: .06em;
  box-shadow: 0 4px 0 var(--gold-deep), 0 8px 18px rgba(0, 0, 0, .2);
  transition: transform var(--dur), box-shadow var(--dur);
}
.wk-search .go:hover, .btn-gold:hover { transform: translateY(-1px); color: var(--gold-ink); }
.wk-search .go:active, .btn-gold:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-deep); }
.wk-suggest {
  position: relative; z-index: 3;
  margin-top: var(--sp-2); display: grid; gap: 2px;
  max-height: 46vh; overflow: auto; overscroll-behavior: contain;
}
.wk-suggest a {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 9px 12px; border-radius: var(--radius-sm); color: var(--ink);
  border-bottom: 1px dashed var(--line-soft);
}
.wk-suggest a:hover, .wk-suggest a[aria-selected="true"] { background: var(--row-hover); color: var(--gold-text); }
.wk-suggest .k {
  font-size: 11px; color: var(--red); margin-left: auto; white-space: nowrap;
  letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
}
.wk-suggest .ttl { font-size: var(--step-0); color: var(--muted); padding: 6px 10px 2px; }

/* ============================================================ SỐ LIỆU (.facts) */
.wk-stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0; margin: var(--sp-6) auto 0; max-width: 980px;
  border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line);
}
@media (min-width: 640px) { .wk-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.wk-stat, .facts > span {
  display: grid; gap: 2px; justify-items: center; text-align: center;
  padding: var(--sp-3) var(--sp-2);
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 500;
}
.wk-stat { background: none; border: 0; box-shadow: none; animation: wkRise .5s var(--ease) both; }
.wk-stat:nth-child(2) { animation-delay: .04s; } .wk-stat:nth-child(3) { animation-delay: .08s; }
.wk-stat:nth-child(4) { animation-delay: .12s; } .wk-stat:nth-child(5) { animation-delay: .16s; }
.wk-stat:nth-child(6) { animation-delay: .2s; }  .wk-stat:nth-child(7) { animation-delay: .24s; }
.wk-stat:nth-child(8) { animation-delay: .28s; }
.wk-stat::before { display: none; }
.wk-stat b, .facts b {
  display: block; font: 400 clamp(22px, 3vw, 28px)/1.15 var(--serif);
  color: var(--red); letter-spacing: 0; font-variant-numeric: tabular-nums; text-transform: none;
}
.wk-stat span { color: var(--muted); }
.facts {
  display: flex; flex-wrap: wrap; gap: 4px 22px; justify-content: center;
  margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px dashed var(--line);
}
.facts > span { padding: 4px 2px; }

/* ============================================================ SECTION + CARD */
.wk-section { padding: var(--sp-7) 0 var(--sp-5); }
.wk-section-head {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  margin-bottom: var(--sp-6);
}
.wk-section-head h2 {
  font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: .05em; line-height: 1.2;
  background: var(--h-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(var(--text-shadow)); padding-bottom: .06em;
}
.wk-section-head p { color: var(--muted); font-size: var(--step-0); margin-top: 10px; }

.wk-cards { display: grid; gap: var(--sp-6) var(--sp-5); grid-template-columns: 1fr; padding: 8px; }
@media (min-width: 600px) { .wk-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .wk-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.wk-card-link {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: var(--sp-4); row-gap: 4px;
  align-items: start; padding: var(--sp-5) var(--sp-5) var(--sp-4);
  color: var(--body);
  transition: transform .28s var(--ease), border-color .28s, box-shadow .28s;
  animation: wkRise .55s var(--ease) both;
}
.wk-card-link:nth-child(2) { animation-delay: .06s; } .wk-card-link:nth-child(3) { animation-delay: .12s; }
.wk-card-link:nth-child(4) { animation-delay: .18s; } .wk-card-link:nth-child(5) { animation-delay: .24s; }
.wk-card-link:nth-child(6) { animation-delay: .3s; }  .wk-card-link:nth-child(7) { animation-delay: .36s; }
.wk-card-link:hover { transform: translateY(-4px); border-color: var(--gold); color: var(--body); }
.wk-card-link .ic {
  grid-row: 1 / span 3; position: relative;
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--plate-grad); background-color: var(--plate); color: var(--gold-text);
  border: 2px solid var(--ring);
  box-shadow: 0 0 0 4px var(--plate-outer), 0 0 0 5px var(--ring), inset 0 0 18px var(--plate-inset);
  transition: transform .4s var(--ease);
}
.wk-card-link .ic::before {
  content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 1px dashed var(--ring-dash);
}
.wk-card-link:hover .ic { transform: rotate(-8deg) scale(1.05); }
.wk-card-link .ic svg { width: 26px; height: 26px; }
.wk-card-link h3 { font-size: var(--step-3); line-height: 1.25; color: var(--ink); position: relative; z-index: 3; }
.wk-card-link p { color: var(--body); font-size: 13.5px; line-height: 1.6; }
.wk-card-link .n {
  margin-top: 4px; font-variant-numeric: tabular-nums; font-size: 11px; color: var(--red);
  font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}
.wk-card-link .arrow {
  position: absolute; top: var(--sp-4); right: var(--sp-5); color: var(--gold-text);
  transition: transform var(--dur);
}
.wk-card-link:hover .arrow { transform: translateX(4px); }

/* ============================================================ TOOLBAR LỌC */
.wk-toolbar {
  position: sticky; top: calc(var(--head-h) + 10px); z-index: 40;
  padding: var(--sp-3) var(--sp-4);
  display: grid; gap: var(--sp-3);
  margin: 0 0 var(--sp-5);
  transition: padding var(--dur), box-shadow var(--dur);
}
.wk-toolbar > * { position: relative; z-index: 3; min-width: 0; }
.wk-toolbar.is-stuck { padding-block: var(--sp-2); gap: var(--sp-2); box-shadow: 0 18px 36px rgba(0, 0, 0, .35), inset 0 0 34px var(--panel-inset); }
.wk-toolbar-row { display: flex; gap: var(--sp-2); align-items: center; min-width: 0; }
.wk-toolbar .wk-search { flex: 1; min-width: 0; min-height: 44px; padding: 2px 4px 2px 14px; }
.wk-toolbar .wk-search input { padding: 8px 0; }
.wk-toolbar .wk-search .go { min-height: 36px; padding: 0 14px; font-size: 13px; }

/* nút xóa lọc 1 chạm (wiki.js chèn vào khi có bộ lọc đang bật) */
.wk-reset {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--tap); padding: 0 14px;
  border-radius: var(--radius-pill); border: 1px solid var(--red);
  color: var(--red); background: var(--chip-bg);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background var(--dur), color var(--dur);
  animation: wkPop .25s var(--ease);
}
.wk-reset b {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: var(--radius-pill); background: var(--red); color: var(--bg); font-size: 11px;
}
.wk-reset:hover { background: var(--red); color: var(--bg); }
.wk-ftoggle { display: none !important; }
.wk-ftoggle svg { flex: 0 0 auto; }
@media (max-width: 600px) {
  .wk-toolbar.is-stuck .wk-ftoggle { display: inline-flex !important; }
  .wk-toolbar.is-collapsed > :not(:first-child) { display: none; }
}
.wk-reset:hover b { background: var(--bg); color: var(--red); }

/* ============================================================ PILL LỌC (.chip) = .gen-tabs */
.chips, .pills {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; padding: 3px 2px 4px;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 90%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 90%, transparent 100%);
}
.chips:empty { display: none; }
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 760px) {
  .chips, .pills { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; }
}
.chip {
  flex: 0 0 auto; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap);
  padding: 0 16px; border-radius: var(--radius-pill);
  background: var(--chip-bg); border: 1px solid var(--line);
  color: var(--body); font-size: 13px; font-weight: 600; letter-spacing: .04em; line-height: 1.1;
  transition: background var(--dur), color var(--dur), border-color var(--dur), box-shadow var(--dur), transform var(--dur);
}
@media (min-width: 760px) { .chip { min-height: 36px; } }
.chip:hover { border-color: var(--gold); color: var(--gold-text); transform: translateY(-2px); }
.chip[aria-pressed="true"],
[data-theme="dark"] .chip[aria-pressed="true"],
[data-theme="light"] .chip[aria-pressed="true"] {
  background: var(--gold-grad); background-color: var(--gold-solid);
  color: var(--gold-ink); border-color: transparent;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .25); text-shadow: none;
}
.chip:disabled { opacity: .45; cursor: default; transform: none; }
.chip .n {
  display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px;
  border-radius: var(--radius-pill); background: var(--row-hover);
  font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0;
}
.chip[aria-pressed="true"] .n { background: rgba(42, 29, 8, .14); color: var(--gold-ink); }
.chip.q1::before, .chip.q2::before, .chip.q3::before, .chip.q4::before, .chip.q5::before,
.chip.q6::before, .chip.q7::before, .chip.q8::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: 0 0 auto;
  box-shadow: 0 0 0 2px var(--line-soft);
}
.chip.q1::before { background: var(--q1); } .chip.q2::before { background: var(--q2); }
.chip.q3::before { background: var(--q3); } .chip.q4::before { background: var(--q4); }
.chip.q5::before { background: var(--q5); } .chip.q6::before { background: var(--q6); }
.chip.q7::before { background: var(--q7); } .chip.q8::before { background: var(--q8); }

.sel {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto;
  min-height: var(--tap); max-width: 100%;
  background: var(--field) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b98f4a' stroke-width='2.6'><path d='m6 9 6 6 6-6'/></svg>") no-repeat right 12px center;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 0 34px 0 16px; font-size: 13px; font-weight: 600; color: var(--body);
  cursor: pointer;
}
.sel:hover { border-color: var(--gold); }
.sel option { background: var(--bg-2); color: var(--ink); }

.wk-count {
  color: var(--muted); font-size: 12.5px; margin: 0 0 var(--sp-3);
  letter-spacing: .08em; text-transform: uppercase; font-weight: 500;
}
.wk-count b { color: var(--red); font: 400 18px var(--serif); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.wk-empty {
  padding: var(--sp-7) var(--sp-4); text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--chip-bg);
}

/* ============================================================ LƯỚI Ô */
.grid {
  display: grid; gap: var(--sp-3);
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  align-items: stretch;
}
@media (min-width: 480px) { .grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); } }
@media (min-width: 760px) { .grid { gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid.compact { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--sp-2); }

/* ô thẻ: khung đôi gọn (không kim cương) */
.cell {
  display: grid; gap: var(--sp-2); padding: 10px;
  text-align: left; align-content: start;
  grid-template-rows: auto auto auto; grid-template-columns: minmax(0, 1fr); min-width: 0;
  color: var(--body);
  transition: transform var(--dur) var(--ease), border-color var(--dur), box-shadow var(--dur);
}
.cell > * { position: relative; z-index: 1; }
.cell.glass { box-shadow: var(--shadow-sm); }
.cell.glass::before { inset: 3px; }
.grid > .cell, .hero-grid > .cell, .rows > .row { animation: wkRise .42s var(--ease) both; }
.grid > .cell:nth-child(2), .hero-grid > .cell:nth-child(2) { animation-delay: .02s; }
.grid > .cell:nth-child(3), .hero-grid > .cell:nth-child(3) { animation-delay: .04s; }
.grid > .cell:nth-child(4), .hero-grid > .cell:nth-child(4) { animation-delay: .06s; }
.grid > .cell:nth-child(5), .hero-grid > .cell:nth-child(5) { animation-delay: .08s; }
.grid > .cell:nth-child(6), .hero-grid > .cell:nth-child(6) { animation-delay: .1s; }
.grid > .cell:nth-child(7), .hero-grid > .cell:nth-child(7) { animation-delay: .12s; }
.grid > .cell:nth-child(8), .hero-grid > .cell:nth-child(8) { animation-delay: .14s; }
.grid > .cell:nth-child(n+9), .hero-grid > .cell:nth-child(n+9) { animation-delay: .16s; }
button.cell:hover, a.cell:hover {
  transform: translateY(-3px); border-color: var(--gold);
  box-shadow: 0 14px 26px rgba(0, 0, 0, .25), 0 0 0 1px var(--line);
}
.thumb.xs { width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; }
.thumb.xs .ini { font-size: 12px; }
.cell .thumb {
  position: relative; aspect-ratio: 1;
  display: grid; place-items: center; overflow: hidden;
  border-radius: var(--radius-xs);
  background: var(--chip-grad); background-color: var(--plate);
  border: 1px solid var(--line-soft);
}
.cell .thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform .35s var(--ease); }
button.cell:hover .thumb img { transform: scale(1.06); }
.thumb .ini, .cell .thumb .ini { font-family: var(--serif); font-size: 24px; color: var(--gold-text); }
.cell .nm {
  font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
  min-height: calc(2 * 1.35em);
}
@media (max-width: 480px) { .cell .nm { font-size: 12.5px; } }
.cell .mta { font-size: 11.5px; color: var(--muted); display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.cell .qs {
  position: absolute; left: 4px; top: 4px; z-index: 1;
  font-size: 10px; padding: 2px 6px; border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, .6); color: #fff;
}
.cell .qbar, .qbar { position: absolute; inset: auto 0 0 0; height: 3px; z-index: 2; }
.tag, .cell .tag {
  display: inline-flex; align-items: center;
  font-size: 11px; padding: 1px 8px; border-radius: var(--radius-pill);
  background: var(--chip-bg); border: 1px solid var(--line-soft); color: var(--muted);
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}

/* ============================================================ HÀNG (list) */
.rows { display: grid; gap: 6px; }
.row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: var(--sp-3);
  align-items: center; padding: 8px 14px 8px 10px; min-height: 60px;
  text-align: left; width: 100%; color: var(--body);
  transition: border-color var(--dur), background-color var(--dur), transform var(--dur);
}
.row.glass { box-shadow: none; }
.row.glass::before { inset: 3px; border-color: transparent; }
.row > * { position: relative; z-index: 1; }
.row:hover { border-color: var(--gold); background-color: var(--panel); transform: translateX(3px); }
.row .thumb {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--chip-grad); background-color: var(--plate); border: 1.5px solid var(--ring);
}
.row .thumb img { width: 100%; height: 100%; object-fit: contain; }
.row .t { font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 12px; color: var(--muted); }
.row .r { font-size: 12px; color: var(--gold-text); font-variant-numeric: tabular-nums; text-align: right; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================ HUY CHƯƠNG (.medal) */
.medal {
  position: relative; flex: 0 0 auto;
  width: var(--medal, 96px); aspect-ratio: 1; border-radius: 50%;
  background: var(--plate-grad); background-color: var(--plate);
  border: 2px solid var(--ring);
  box-shadow: 0 0 0 5px var(--plate-outer), 0 0 0 6px var(--ring), 0 14px 26px rgba(0, 0, 0, .25), inset 0 0 30px var(--plate-inset);
}
.medal::before {
  content: ""; position: absolute; inset: 6px; border-radius: 50%; z-index: 3; pointer-events: none;
  border: 1px dashed var(--ring-dash);
}
.medal .crop, .medal > img {
  position: absolute; inset: 9px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
}
.medal .crop img, .medal > img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.medal.sm { --medal: 56px; } .medal.md { --medal: 120px; } .medal.lg { --medal: min(240px, 60vw); }
.medal.icon .crop img { object-fit: contain; padding: 12%; }

/* huy hiệu phe (= .camp-chip trang chủ) */
.camp-badge {
  position: absolute; right: -4px; bottom: -2px; z-index: 4;
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  font-size: 10.5px; font-weight: 800; letter-spacing: .02em; line-height: 1; color: #fff7e0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  background-color: #8f3b23;
  background-image: linear-gradient(180deg, #c0392b, #7a4515);
  border: 2px solid var(--ring);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .3), inset 0 0 0 2px rgba(90, 50, 8, .28);
}
.camp-badge.c1 { background-color: #22427a; background-image: linear-gradient(180deg, #3463ad, #1b325c); }
.camp-badge.c2 { background-color: #255e30; background-image: linear-gradient(180deg, #3b8a47, #1c4a25); }
.camp-badge.c3 { background-color: #8e2a1c; background-image: linear-gradient(180deg, #c0392b, #73200f); }
.camp-badge.c4 { background-color: #5e4512; background-image: linear-gradient(180deg, #8f6b1d, #4d380c); }
.medal.lg .camp-badge { width: 56px; height: 56px; font-size: 14px; right: 0; bottom: 10px; }

/* hàng ảnh tròn nhỏ (= .general-picks) */
.picks { display: flex; gap: 10px; flex-wrap: wrap; }
.picks > a, .picks > button, .pick {
  width: 52px; height: 52px; padding: 0; border-radius: 50%; overflow: hidden; position: relative; flex: 0 0 auto;
  border: 2px solid var(--line); background: var(--chip-grad); background-color: var(--plate);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur), border-color var(--dur), box-shadow var(--dur);
}
.picks img, .pick img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.picks > a:hover, .picks > button:hover, .pick:hover { transform: translateY(-4px); border-color: var(--gold); }
.picks [aria-pressed="true"], .picks [aria-current] { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow), var(--shadow-sm); }

/* ============================================================ VÕ TƯỚNG: lưới huy chương */
.hero-grid {
  display: grid; gap: var(--sp-5) var(--sp-3);
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  padding-top: 6px;
}
@media (min-width: 760px) { .hero-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: var(--sp-6) var(--sp-4); } }
.hero-cell, .hero-cell.glass {
  background: none; border: 0; box-shadow: none; padding: 4px 2px;
  display: grid; justify-items: center; gap: 10px; text-align: center;
}
.hero-cell.glass::before { display: none; }
.hero-cell .medal { --medal: min(96px, 100%); width: min(96px, calc(100% - 14px)); }
.hero-cell .medal .crop { inset: 7px; }
.hero-cell .medal::before { inset: 4px; }
.hero-cell .medal { box-shadow: 0 0 0 4px var(--plate-outer), 0 0 0 5px var(--ring), 0 10px 20px rgba(0, 0, 0, .25), inset 0 0 20px var(--plate-inset); }
.hero-cell .medal .crop img { transition: transform .45s var(--ease); }
.hero-cell:hover { transform: translateY(-4px); }
.hero-cell:hover .medal { border-color: var(--gold); box-shadow: 0 0 0 4px var(--plate-outer), 0 0 0 5px var(--red), 0 0 0 9px var(--red-glow), 0 14px 26px rgba(0, 0, 0, .3); }
.hero-cell:hover .medal .crop img { transform: scale(1.08); }
.hero-cell .camp-badge { width: 34px; height: 34px; font-size: 9px; letter-spacing: 0; right: -7px; bottom: -5px; }
.hero-cell .nm { font-family: var(--serif); font-size: 15px; font-weight: 400; text-align: center; min-height: 0; color: var(--ink); -webkit-line-clamp: 2; }
.hero-cell .badge { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-top: -6px; }
.hero-cell .badge.qc { font-weight: 700; }
.hero-cell .qbar { display: none; }

/* ============================================================ CHI TIẾT (sheet) */
.detail-wrap { display: grid; gap: var(--sp-5); padding: 8px; }
@media (min-width: 960px) { .detail-wrap { grid-template-columns: 320px minmax(0, 1fr); align-items: start; } }
.detail-portrait {
  padding: var(--sp-6) var(--sp-4) var(--sp-5);
  display: grid; gap: var(--sp-3); justify-items: center; text-align: center;
}
.detail-portrait > * { position: relative; z-index: 3; }
.detail-portrait .frame {
  position: relative; width: min(200px, 56vw); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; overflow: visible; margin: 8px 0 4px;
  background: var(--plate-grad); background-color: var(--plate);
  border: 2px solid var(--ring);
  box-shadow: 0 0 0 6px var(--plate-outer), 0 0 0 7px var(--ring), 0 22px 40px rgba(0, 0, 0, .28), inset 0 0 40px var(--plate-inset);
}
.detail-portrait .frame::before {
  content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 1px dashed var(--ring-dash); pointer-events: none; z-index: 2;
}
.detail-portrait .frame img {
  width: 70%; height: 70%; object-fit: contain;
  animation: wkBob 7s ease-in-out infinite;
}
.detail-portrait .frame.portrait img {
  position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px);
  border-radius: 50%; object-fit: cover; object-position: 50% 25%;
}
.detail-portrait .frame .ini { font-family: var(--serif); color: var(--gold-text); }
.detail-portrait .frame .camp-badge { width: 50px; height: 50px; font-size: 13px; right: -6px; bottom: 6px; }
.detail-portrait h2 {
  font-size: clamp(1.8rem, 5vw, 2.4rem); line-height: 1.2; letter-spacing: .02em;
  background: var(--h-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(var(--text-shadow)); padding: 0 .05em .08em;
}
.detail-portrait h2.qc { background: none; color: var(--qc-safe); filter: none; }
.detail-portrait .flags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.detail-portrait .facts { width: 100%; margin-top: 2px; }
.detail-body { display: grid; gap: var(--sp-5); min-width: 0; }
.panel { padding: var(--sp-5) var(--sp-5) var(--sp-4); }
@media (max-width: 480px) { .panel { padding: var(--sp-4); } }
.panel > * { position: relative; z-index: 3; }
.panel > h3 { margin-bottom: var(--sp-3); }

/* bậc phẩm chất */
.tiers { display: flex; gap: 8px; flex-wrap: wrap; }
.tier-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap);
  padding: 0 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--chip-bg);
  font-size: 13px; font-weight: 600; color: var(--body);
  transition: transform var(--dur), border-color var(--dur);
}
.tier-chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.tier-chip:hover { transform: translateY(-2px); border-color: var(--gold); }
.tier-chip.q1::before { background: var(--q1); } .tier-chip.q2::before { background: var(--q2); }
.tier-chip.q3::before { background: var(--q3); } .tier-chip.q4::before { background: var(--q4); }
.tier-chip.q5::before { background: var(--q5); } .tier-chip.q6::before { background: var(--q6); }
.tier-chip.q7::before { background: var(--q7); } .tier-chip.q8::before { background: var(--q8); }
.tier-chip[aria-pressed="true"] {
  background: var(--gold-grad); background-color: var(--gold-solid); color: var(--gold-ink);
  border-color: transparent; box-shadow: 0 6px 14px rgba(0, 0, 0, .22);
}

/* thanh chỉ số */
.stats3 { display: grid; gap: var(--sp-3); }
.stat-bar { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; }
@media (max-width: 420px) { .stat-bar { grid-template-columns: 96px minmax(0, 1fr); } .stat-bar b { grid-column: 1 / -1; text-align: right; margin-top: -6px; } }
.stat-bar .lb { font-size: 11px; letter-spacing: .08em; white-space: nowrap; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat-bar .track { height: 8px; border-radius: var(--radius-pill); background: var(--row-hover); border: 1px solid var(--line-soft); overflow: hidden; }
.stat-bar .fill { display: block; height: 100%; border-radius: inherit; background: var(--gold-grad); transform-origin: left; animation: wkGrow .7s var(--ease) both; }
.stat-bar b { font: 400 19px var(--serif); color: var(--red); font-variant-numeric: tabular-nums; }
.stat-bar b em { font: 400 11.5px var(--sans); font-style: normal; color: var(--muted); margin-left: 6px; }

/* mô tả + bảng khóa-giá trị */
.desc { color: var(--body); font-size: 14px; line-height: 1.78; white-space: pre-line; }
.desc b, .desc strong { color: var(--gold-text); font-weight: 600; }
.desc a { color: var(--gold-text); text-decoration: underline; text-underline-offset: 3px; }
.kv { display: grid; gap: 0; }
.kv div {
  display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: var(--sp-3);
  font-size: 13.5px; padding: 8px 2px; border-bottom: 1px dashed var(--line);
}
.kv div:last-child { border-bottom: 0; }
@media (max-width: 420px) { .kv div { grid-template-columns: 100px minmax(0, 1fr); } }
.kv dt { color: var(--muted); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; padding-top: 2px; }
.kv dd { color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv dd a { color: var(--gold-text); text-decoration: underline; text-underline-offset: 3px; }
.detail-portrait .kv { text-align: left; }

/* nhãn nhỏ */
.pill {
  display: inline-flex; align-items: center; gap: 5px; min-height: 26px;
  padding: 2px 11px; border-radius: var(--radius-pill);
  background: var(--gold-grad); background-color: var(--gold-solid); color: var(--gold-ink);
  font-size: 12px; font-weight: 700; letter-spacing: .03em;
}
a.pill:hover { color: var(--gold-ink); filter: brightness(1.06); }
.pill.line { background: var(--chip-bg); border: 1px solid var(--line); color: var(--body); font-weight: 600; }
.eff {
  display: inline-flex; gap: 6px; align-items: baseline; flex-wrap: wrap;
  padding: 5px 11px; border-radius: var(--radius-sm);
  background: var(--chip-bg); border: 1px solid var(--line-soft);
  font-size: 13px; color: var(--body); font-variant-numeric: tabular-nums;
}
.eff b { color: var(--red); font-weight: 700; }

/* màu phẩm chất an toàn tương phản: style="--qc:#hex" + class="qc" */
.qc { --qc-safe: color-mix(in oklab, var(--qc, currentColor), var(--qc-mix) var(--qc-amt)); color: var(--qc-safe) !important; }

/* bảng (= .xw-table trang chủ) */
.wk-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.wk-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.wk-table th {
  padding: 11px 14px; text-align: left; white-space: nowrap;
  background: var(--chip-bg); color: var(--gold-text);
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.wk-table td { padding: 10px 14px; border-bottom: 1px dashed var(--line); color: var(--body); vertical-align: top; }
.wk-table tbody tr:last-child td { border-bottom: 0; }
.wk-table tbody tr:hover td { background: var(--row-hover); }
.wk-table .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.wk-table .name { color: var(--ink); font-weight: 600; }

/* bố cục 2 cột như .general-stage */
.split { display: grid; gap: var(--sp-6); align-items: center; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr); gap: var(--sp-9); } }

/* ============================================================ SHEET (modal) */
.sheet {
  position: fixed; inset: 0; z-index: 80;
  display: grid; align-items: end;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: wkFade .18s var(--ease);
}
@media (min-width: 800px) { .sheet { align-items: center; justify-items: center; } }
.sheet-card {
  width: 100%; max-height: min(90dvh, 880px);
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  animation: wkSheet .3s var(--ease);
}
.sheet-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background:
    var(--diamond) 1px 1px / 12px 12px no-repeat,
    var(--diamond) calc(100% - 1px) 1px / 12px 12px no-repeat;
}
@media (min-width: 800px) {
  .sheet-card { width: min(980px, calc(100% - 48px)); border-radius: var(--radius-sm); max-height: min(88dvh, 900px); }
  .sheet-card::after {
    background:
      var(--diamond) 1px 1px / 12px 12px no-repeat, var(--diamond) calc(100% - 1px) 1px / 12px 12px no-repeat,
      var(--diamond) 1px calc(100% - 1px) / 12px 12px no-repeat, var(--diamond) calc(100% - 1px) calc(100% - 1px) / 12px 12px no-repeat;
  }
}
.sheet-head {
  position: relative; z-index: 3;
  display: flex; gap: var(--sp-3); align-items: center;
  padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--line);
  background: var(--chip-bg);
}
.sheet-head h3 {
  flex: 1; min-width: 0; font-size: var(--step-3); color: var(--red); font-weight: 700;
  display: flex; align-items: center; gap: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sheet-head h3::before { content: ""; flex: 0 0 auto; width: 11px; height: 11px; border: 2px solid var(--red); border-radius: 2px; transform: rotate(45deg) scale(.86); }
.sheet-body { position: relative; z-index: 3; overflow: auto; overscroll-behavior: contain; padding: var(--sp-5) var(--sp-4); -webkit-overflow-scrolling: touch; }
@media (min-width: 800px) { .sheet-body { padding: var(--sp-6); } }

/* ============================================================ PAGER / MORE */
.more { display: grid; place-items: center; padding: var(--sp-6) 0; }
.more button {
  min-height: 44px; padding: 0 26px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--chip-bg);
  color: var(--gold-text); font-size: 13.5px; font-weight: 600; letter-spacing: .06em;
  transition: transform var(--dur), border-color var(--dur);
}
.more button:hover { border-color: var(--gold); transform: translateY(-2px); }
#pager .wk-count { margin: 0; }
.sentinel { height: 1px; }

/* ============================================================ NHÓM + CHẶNG */
.group-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin: var(--sp-7) 0 var(--sp-3);
  padding-bottom: 8px; border-bottom: 1px dashed var(--line);
}
#list > .group-head:first-child { margin-top: var(--sp-2); }
.group-head .n { font-size: 11px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-variant-numeric: tabular-nums; font-weight: 600; }
.qdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.stage-list { display: grid; gap: var(--sp-2); }
.stage {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: var(--sp-3);
  padding: var(--sp-3); border-radius: var(--radius-sm);
  background: var(--chip-bg); border: 1px dashed var(--line); align-items: start;
}
.stage + .stage { margin-top: 0; }
.stage .no {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font: 400 16px var(--serif);
  background: var(--plate-grad); background-color: var(--plate); color: var(--red);
  border: 1.5px solid var(--ring); box-shadow: 0 0 0 3px var(--plate-outer), 0 0 0 4px var(--line);
}
.stage .ttl { font-weight: 600; font-size: 14px; color: var(--ink); }
.stage .costs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px; border-radius: var(--radius-pill);
  background: var(--chip-bg); border: 1px solid var(--line); font-size: 12px;
}
.cost img { width: 26px; height: 26px; border-radius: 50%; object-fit: contain; }
.cost b { font-variant-numeric: tabular-nums; color: var(--red); }

/* ============================================================ FOOTER */
.wk-foot {
  position: relative; margin-top: var(--sp-9); padding: var(--sp-7) 0 var(--sp-8);
  border-top: 1px solid var(--line); background: var(--chip-bg);
}
.wk-foot::before {
  content: ""; position: absolute; left: 50%; top: -7px; width: 13px; height: 13px; transform: translateX(-50%);
  background: var(--diamond) center / contain no-repeat;
}
.wk-foot-in { display: grid; gap: var(--sp-4); justify-items: center; text-align: center; }
.wk-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; }
.wk-foot nav a {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 12px;
  color: var(--body); font-size: 13.5px; border-radius: var(--radius-pill);
}
.wk-foot nav a:hover { color: var(--gold-text); background: var(--row-hover); }
.wk-foot p { color: var(--muted); font-size: 12.5px; max-width: 70ch; }

/* ============================================================ TRẠNG THÁI */
.sk { display: grid; gap: var(--sp-2); }
.sk-row { height: 64px; border-radius: var(--radius-sm); background: var(--row-hover); animation: wkPulse 1.4s ease-in-out infinite; }
.ini-note { color: var(--muted); font-size: 11.5px; }

/* ============================================================ CHUYỂN ĐỘNG */
@keyframes wkFade { from { opacity: 0; } }
@keyframes wkRise { from { opacity: 0; transform: translateY(10px); } }
@keyframes wkSheet { from { opacity: 0; transform: translateY(22px) scale(.99); } }
@keyframes wkPop { from { opacity: 0; transform: scale(.9); } }
@keyframes wkGrow { from { transform: scaleX(0); } }
@keyframes wkBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes wkPulse { 50% { opacity: .55; } }
.orn-head > * { animation: wkRise .6s var(--ease) both; }
.orn-head > :nth-child(2) { animation-delay: .05s; }
.orn-head > :nth-child(3) { animation-delay: .1s; }
.orn-head > :nth-child(4) { animation-delay: .15s; }
.orn-head > :nth-child(5) { animation-delay: .2s; }

/* ============================================================ MOBILE */
@media (max-width: 600px) {
  .wk-head-in { min-height: 52px; gap: 8px; }
  .wk-brand { font-size: 1.08rem; }
  .wk-toolbar { padding: var(--sp-2) var(--sp-3); gap: var(--sp-2); }
  .wk-toolbar .wk-search { min-height: 44px; }
  .wk-toolbar-row { flex-wrap: wrap; }
  .wk-toolbar-row > .wk-search { flex: 1 1 170px; }
  .wk-toolbar-row > .chips { flex: 1 1 100% !important; }
  .wk-toolbar-row > .sel { flex: 1 1 auto; }
  .wk-toolbar-row > .wk-reset { flex: 1 1 auto; justify-content: center; }
  .wk-card-link { grid-template-columns: 54px minmax(0, 1fr); padding: var(--sp-4); }
  .wk-card-link .ic { width: 54px; height: 54px; }
  .wk-cards { gap: var(--sp-5); }
}

/* =============================================================================
   STAGE 2 (23/11/2026) — hồ sơ tướng (.gd-*), hiệu ứng ↔ kỹ năng (.bf-*, .kn-*,
   .gp-*), nguồn nhận vật phẩm (.vp-*). Chỉ CSS riêng trang; mọi khung/tiêu đề
   dùng lại .panel .block-h .stage .cost .wk-table .pick .medal ở trên.
   ============================================================================= */
:root, [data-theme="dark"] { --bf-good: #5fbf7a; --bf-bad: #e0685a; --bf-ctl: #b48cf0; --bf-other: #d8b25a; }
[data-theme="light"] { --bf-good: #2f8a49; --bf-bad: #b8392b; --bf-ctl: #7445b8; --bf-other: #9a7414; }

/* chip hiệu ứng (link sang /wiki/ky-nang/#buff-<id>) */
.bf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bf-chip {
  --bf: var(--bf-other);
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; max-width: 100%;
  padding: 2px 11px 2px 9px; border-radius: var(--radius-pill);
  border: 1px solid color-mix(in oklab, var(--bf), transparent 55%);
  background: color-mix(in oklab, var(--bf), transparent 88%);
  color: var(--ink); font-size: 12.5px; font-weight: 600; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: transform var(--dur), border-color var(--dur);
}
.bf-chip i { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); background: var(--bf); }
.bf-chip.good { --bf: var(--bf-good); } .bf-chip.bad { --bf: var(--bf-bad); }
.bf-chip.ctl { --bf: var(--bf-ctl); } .bf-chip.other { --bf: var(--bf-other); }
a.bf-chip:hover { transform: translateY(-2px); border-color: var(--bf); color: var(--ink); }
.bf-chip.static { cursor: default; }

/* ---- hồ sơ tướng (trang /wiki/vo-tuong/?g=<key>) ---- */
.gd { margin-top: var(--sp-2); }
.gd-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: var(--sp-4); }
.wk-back {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 16px;
  border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--chip-bg);
  color: var(--gold-text); font-weight: 600; font-size: 13.5px;
}
.wk-back:hover { border-color: var(--gold); color: var(--gold-text); }
.gd-wrap { padding: 0; }
@media (min-width: 960px) { .gd-wrap { grid-template-columns: 340px minmax(0, 1fr); } .gd-side { position: sticky; top: calc(var(--head-h) + 12px); } }
.gd-side .medal.lg { margin: 10px 0 6px; }
.gd-side .medal.lg .crop img { object-position: 50% 22%; }
.gd-kv { width: 100%; }
.gd-kv + .gd-kv { border-top: 1px dashed var(--line); }
.gd-bio { text-align: left; font-size: 13px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; }
.gd-chain { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 4px; }
.gd-node { display: grid; justify-items: center; gap: 6px; padding: 4px 2px; min-width: 64px; background: none; border: 0; }
.gd-pick.pick { width: 56px; height: 56px; border-color: var(--qc, var(--line)); border-width: 2px; }
.gd-node:hover .gd-pick { transform: translateY(-3px); }
.gd-node[aria-pressed="true"] .gd-pick { box-shadow: 0 0 0 3px var(--plate-outer), 0 0 0 5px var(--qc, var(--gold)), var(--shadow-sm); }
.gd-node[aria-pressed="true"] .gd-qn { text-decoration: underline; text-underline-offset: 4px; }
.gd-qn { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--body); white-space: nowrap; }
.gd-arrow { align-self: center; margin-top: -18px; color: var(--gold-text); font: 400 20px var(--serif); }
@media (max-width: 600px) { .gd-arrow { display: none; } .gd-node { min-width: 58px; } .gd-pick.pick { width: 48px; height: 48px; } }
.gd-skill { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-3); }
.thumb.gd-skic, .thumb.gd-rkic {
  width: 56px; height: 56px; border-radius: var(--radius-sm); overflow: hidden; display: grid; place-items: center;
  background: var(--chip-grad); background-color: var(--plate); border: 1.5px solid var(--ring);
}
.thumb.gd-rkic { width: 44px; height: 44px; border-radius: 50%; }
.thumb.gd-skic img, .thumb.gd-rkic img { width: 100%; height: 100%; object-fit: contain; }
.gd-skname { font: 400 var(--step-3) var(--serif); color: var(--ink); margin-bottom: 4px; }
.gd-skhead .flags { display: flex; flex-wrap: wrap; gap: 6px; }
.gd-sub { display: grid; gap: 8px; margin-top: var(--sp-3); }
.gd-lb { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.gd-up { margin-top: var(--sp-3); border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--chip-bg); }
.gd-up > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 13.5px; color: var(--gold-text); list-style-position: inside; }
.gd-lv { list-style: none; margin: 0; padding: 0 14px 10px; display: grid; gap: 0; }
.gd-lv li { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 13px; color: var(--body); }
.gd-lvno { font: 400 15px var(--serif); color: var(--red); font-variant-numeric: tabular-nums; }
.gd-fold { padding-top: var(--sp-4); }
.gd-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; position: relative; z-index: 3; }
.gd-fold > summary::-webkit-details-marker { display: none; }
.gd-fold > summary .block-h { flex: 1; margin: 0; }
.gd-caret { width: 10px; height: 10px; border-right: 2px solid var(--gold-text); border-bottom: 2px solid var(--gold-text); transform: rotate(45deg); transition: transform var(--dur); margin: -4px 6px 0 0; }
.gd-fold[open] > summary .gd-caret { transform: rotate(225deg); margin-top: 4px; }
.gd-fold-in { position: relative; z-index: 3; margin-top: var(--sp-3); }
.gd-cost { padding: 4px 11px; }
.stage.on { border-style: solid; border-color: var(--gold); background: var(--row-hover); }
.gd-wname { font: 400 var(--step-2) var(--serif); color: var(--ink); margin-bottom: 6px; }
.gd-ranks { margin-top: var(--sp-3); }
.stage.gd-rk { grid-template-columns: 44px minmax(0, 1fr); }
.stage .ttl .hint { font-weight: 500; }

/* ---- kỹ năng / hiệu ứng ---- */
.kn-row { cursor: pointer; align-items: start; }
.kn-row:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.kn-d { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; line-height: 1.5; }
.kn-chips { margin-top: 6px; }
.kn-row .r { white-space: normal; text-align: right; line-height: 1.5; }
@media (max-width: 480px) { .kn-row { grid-template-columns: 40px minmax(0, 1fr); } .kn-row .r { grid-column: 2; text-align: left; } .kn-row .thumb { width: 40px; height: 40px; } }
.kn-mini { min-height: 52px; color: var(--body); }
.kn-mini .kn-d { -webkit-line-clamp: 1; }
.gp-list { display: flex; flex-wrap: wrap; gap: 12px 10px; }
.gp { display: grid; justify-items: center; gap: 5px; width: 70px; color: var(--body); text-align: center; }
.gp .pick { width: 54px; height: 54px; display: grid; place-items: center; }
.gp .pick .ini { font-family: var(--serif); color: var(--gold-text); font-size: 20px; }
.gp:hover .pick { transform: translateY(-3px); border-color: var(--gold); }
.gp-n { font-size: 12px; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }

/* ---- vật phẩm: nguồn nhận ---- */
.vp-src { font-size: 10.5px; padding: 1px 7px; border-radius: var(--radius-pill); border: 1px solid color-mix(in oklab, var(--bf-good), transparent 50%); color: var(--bf-good); font-weight: 700; }
.vp-grp + .vp-grp { margin-top: var(--sp-5); }
.vp-grp-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.vp-grp-h .block-h { font-size: var(--step-1); }
.vp-table td { font-size: 13px; }
.vp-table .num { white-space: nowrap; }
.vp-na { color: var(--muted); font-style: italic; }
.vp-needs { display: flex; flex-wrap: wrap; gap: 6px; }
.vp-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 3px; min-height: 30px;
  border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--chip-bg);
  color: var(--ink); font-size: 12.5px; font-weight: 600;
}
.vp-link:hover { border-color: var(--gold); color: var(--ink); }
.vp-link .thumb.xs { overflow: hidden; display: grid; place-items: center; background: var(--plate); width: 24px; height: 24px; }
.vp-link .thumb.xs img { width: 100%; height: 100%; object-fit: contain; }
.vp-more { margin-top: 8px; }
.vp-panel h3 .hint:empty { display: none; }
