/* Law of the Abyss wiki. Dark holographic look from the game's hub (hx.css): glass panels, cyan + gold, Barlow SC. */
@font-face { font-family: 'Barlow SC'; font-weight: 400; font-display: swap; src: url('/assets/fonts/barlow-400.woff2') format('woff2'); }
@font-face { font-family: 'Barlow SC'; font-weight: 500; font-display: swap; src: url('/assets/fonts/barlow-500.woff2') format('woff2'); }
@font-face { font-family: 'Barlow SC'; font-weight: 600; font-display: swap; src: url('/assets/fonts/barlow-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow SC'; font-weight: 700; font-display: swap; src: url('/assets/fonts/barlow-700.woff2') format('woff2'); }
@font-face { font-family: 'Lota Chart'; font-weight: 400; font-display: swap; src: url('/assets/fonts/michroma-400.woff2') format('woff2'); }

:root {
  --bg: #05070f;
  --bg-2: #0a1020;
  --glass: rgba(12, 20, 38, 0.72);
  --glass-hi: rgba(20, 32, 56, 0.78);
  --line: rgba(170, 205, 255, 0.14);
  --line-2: rgba(170, 205, 255, 0.26);
  --text: #e8eef7;
  --text-2: #b4c2d6;
  --muted: #8da0bb;
  --cyan: #5fd0ff;
  --cyan-soft: rgba(95, 208, 255, 0.14);
  --cyan-line: rgba(95, 208, 255, 0.42);
  --violet: #b987ff;
  --gold: #f2c14e;
  --warn: #f59e0b;
  --font: 'Barlow SC', 'Segoe UI', system-ui, sans-serif;
  --display: 'Lota Chart', 'Barlow SC', sans-serif;
  --radius: 10px;
  --gutter: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 500 17px/1.55 var(--font);
  background: var(--bg);
  background-image: radial-gradient(1100px 600px at 8% -10%, rgba(154, 18, 230, 0.16), transparent 60%),
    radial-gradient(900px 600px at 105% 20%, rgba(95, 208, 255, 0.09), transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #9fe3ff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #000; padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 1.1rem + 2vw, 2.3rem); letter-spacing: 0.02em; }
h2 { font-size: 1.45rem; font-weight: 700; letter-spacing: 0.01em; }
h3 { font-size: 1.12rem; font-weight: 700; }
.kicker { margin: 0 0 6px; color: var(--gold); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em; }
.lede { font-size: 1.12rem; color: var(--text-2); margin: 0 0 1.2em; max-width: 72ch; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 50; background: rgba(5, 7, 15, 0.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 8px var(--gutter); display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; flex: none; }
.brand img { height: 40px; width: auto; display: block; }
.brand-tag { font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.2em; color: var(--gold); border: 1px solid rgba(242, 193, 78, 0.45); padding: 2px 6px; border-radius: 4px; }
.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search input, .hero-search input, .flt-text {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 12px;
}
.search input:focus, .hero-search input:focus, .flt-text:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.search-pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #0b1324; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6); max-height: 70vh; overflow: auto; padding: 4px; }
.sr-item { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.sr-item[aria-selected="true"], .sr-item:hover { background: var(--cyan-soft); color: var(--text); }
.sr-item img, .sr-item .ph { width: 36px; height: 36px; flex: none; border-radius: 6px; object-fit: contain; background: rgba(255, 255, 255, 0.04); }
.sr-t { display: block; font-weight: 600; line-height: 1.2; }
.sr-k { display: block; font-size: 0.82rem; color: var(--muted); }
.sr-all { display: block; padding: 8px; text-align: center; font-size: 0.9rem; }
.mainnav { display: flex; gap: 4px; align-items: center; }
.mainnav a { color: var(--text-2); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 600; }
.mainnav a:hover, .mainnav a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.mainnav a.play { color: #0b0b10; background: var(--gold); margin-left: 6px; }
.mainnav a.play:hover { background: #ffd56e; }
.menu-btn { display: none; background: none; border: 1px solid var(--line-2); color: var(--text); border-radius: 8px; padding: 6px; cursor: pointer; }

/* ---------- layout ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 18px var(--gutter) 48px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 14px; font-size: 0.9rem; color: var(--muted); }
.crumbs li + li::before { content: '›'; margin-right: 4px; color: var(--muted); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--cyan); }
.page-h { margin-bottom: 18px; }

/* glass panel with corner ticks */
.panel, .infobox, .recipe-box, .totals, .goal, .notice, .toc, .filters, .data-block .tbl {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
}

/* ---------- entity pages ---------- */
.ent-h { margin-bottom: 14px; }
.ent-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.ent-grid > .infobox { grid-column: 2; grid-row: 1; position: sticky; top: 78px; }
.ent-grid > .ent-main { grid-column: 1; grid-row: 1; min-width: 0; }
.infobox { padding: 14px; position: relative; }
.infobox::before, .infobox::after { content: ''; position: absolute; width: 14px; height: 14px; border: 2px solid var(--cyan-line); }
.infobox::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-radius: var(--radius) 0 0 0; }
.infobox::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-radius: 0 0 var(--radius) 0; }
.ib-img { display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, rgba(95, 208, 255, 0.12), transparent 70%); border-radius: 8px; padding: 8px; margin-bottom: 10px; }
.ib-img .th { width: 192px; height: 192px; object-fit: contain; }
.ib-img.big .th { width: 288px; height: 288px; max-width: 100%; }
.ib-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.facts { margin: 0; display: grid; gap: 0; }
.facts > div { display: grid; grid-template-columns: minmax(110px, 42%) 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: 0.92rem; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts.compact > div { padding: 5px 0; }
.sec { margin: 26px 0; }
.sec > h2 { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.sec > .facts > div, .recipe-box .facts > div { grid-template-columns: minmax(120px, 30%) 1fr; }
.sec > .facts { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px; }
.note { border-left: 3px solid var(--gold); padding: 6px 12px; background: rgba(242, 193, 78, 0.06); border-radius: 0 8px 8px 0; color: var(--text-2); }
.see { margin-top: 26px; padding-top: 12px; border-top: 1px dashed var(--line-2); color: var(--muted); }
.lore { font-style: italic; color: var(--text-2); max-width: 72ch; }

/* thumbnails & placeholders */
.th { display: inline-block; flex: none; object-fit: contain; border-radius: 6px; }
.ph { display: inline-grid; place-items: center; background: linear-gradient(135deg, rgba(185, 135, 255, 0.22), rgba(95, 208, 255, 0.16)); color: var(--text); font-family: var(--display); font-size: 0.75rem; border: 1px solid var(--line-2); }
.ib-img .ph { font-size: 2.2rem; }
.ph.lic svg { width: 58%; height: 58%; fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
details.more > summary { cursor: pointer; color: var(--cyan); font-weight: 600; margin: 4px 0 8px; }

/* badges */
.badge { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); background: rgba(255, 255, 255, 0.04); white-space: nowrap; }
.badge.rar, .badge.fac { color: var(--c); border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); }
.badge.tier { color: var(--cyan); border-color: var(--cyan-line); background: var(--cyan-soft); }
.badge.warn { color: var(--warn); border-color: rgba(245, 158, 11, 0.5); }
.badge.dim { color: var(--muted); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); color: var(--text); text-decoration: none; font-weight: 600; max-width: 100%; }
.chip:hover { border-color: var(--cyan-line); background: var(--cyan-soft); color: var(--text); }
.chip .th { width: 28px; height: 28px; }
.chip .ph { font-size: 0.6rem; }
.chip .q { color: var(--gold); font-variant-numeric: tabular-nums; }
.chip .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chip .cn { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.chip:not(:has(.th)) { padding-left: 10px; }

/* recipe flow */
.flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; }
.flow-in { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1 1 260px; min-width: 0; }
.flow .plus { color: var(--muted); }
.flow .arrow { font-size: 1.6rem; color: var(--gold); line-height: 1; }
.flow-out .chip { border-color: rgba(242, 193, 78, 0.5); background: rgba(242, 193, 78, 0.08); }
.recipe-box { padding: 12px 14px; margin-bottom: 12px; }
.rb-h { margin: 0 0 4px; font-weight: 700; }
.rb-more { margin: 8px 0 0; font-size: 0.95rem; }

/* used-in lists */
.used { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.ui-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--text); text-decoration: none; min-width: 0; }
.ui-row:hover { border-color: var(--cyan-line); background: var(--cyan-soft); color: var(--text); }
.ui-row .th { width: 32px; height: 32px; }
.ui-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ui-q { color: var(--muted); font-size: 0.88rem; white-space: nowrap; }
.grp { margin-bottom: 16px; }
.grp h3 { margin-bottom: 8px; }
.bul { padding-left: 1.2em; }
.bul li { margin: 4px 0; }

/* stats (commanders) */
.stats { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.stats li { display: grid; grid-template-columns: 110px 1fr; gap: 2px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--glass); }
.st-v { grid-row: span 2; font-family: var(--display); color: var(--gold); font-size: 1.05rem; align-self: center; }
.st-n { font-weight: 700; }
.st-d { color: var(--text-2); font-size: 0.95rem; }

/* tables */
.tbl { overflow-x: auto; margin: 10px 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); }
/* scroll shadows: a cyan glow on the side where the table continues (covers move with the content) */
.tbl, .data-block .tbl {
  background:
    linear-gradient(90deg, #0b1324 30%, rgba(11, 19, 36, 0)) left center / 40px 100% no-repeat local,
    linear-gradient(270deg, #0b1324 30%, rgba(11, 19, 36, 0)) right center / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(95, 208, 255, 0.45), rgba(95, 208, 255, 0)) left center / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(95, 208, 255, 0.45), rgba(95, 208, 255, 0)) right center / 14px 100% no-repeat scroll,
    #0b1324;
}
.tbl table { border-collapse: collapse; width: 100%; font-size: 0.97rem; }
.tbl th, .tbl td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl thead th { color: var(--muted); font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; background: rgba(255, 255, 255, 0.03); white-space: nowrap; }
.tbl tbody th { font-weight: 600; }
.tbl tr:last-child > * { border-bottom: 0; }

/* craft tree */
.tree-tools { display: flex; gap: 8px; margin: 8px 0; }
.tree-tools button, .btn, .hero-search button { font: inherit; font-weight: 700; color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 12px; cursor: pointer; text-decoration: none; display: inline-block; }
.tree-tools button:hover, .btn:hover { border-color: var(--cyan-line); background: var(--cyan-soft); color: var(--text); }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 14px; padding-left: 14px; border-left: 1px dashed var(--line-2); }
.tree li { margin: 5px 0; }
.tree summary { cursor: pointer; list-style: none; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; }
.tree summary::before { content: '▸'; color: var(--cyan); width: 12px; flex: none; transition: transform .15s; }
.tree details[open] > summary::before { transform: rotate(90deg); }
.tree li:not(:has(> details)) { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; padding-left: 20px; }
.tree li.tt { padding-left: 0; }
.tree li.tt > ul { flex-basis: 100%; }
.tc { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); color: var(--text); text-decoration: none; font-weight: 600; max-width: 100%; }
.tc:hover { border-color: var(--cyan-line); background: var(--cyan-soft); color: var(--text); }
.tc img, .tc .tph { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; flex: none; }
.tc .tph { display: inline-grid; place-items: center; background: linear-gradient(135deg, rgba(185, 135, 255, 0.22), rgba(95, 208, 255, 0.16)); font-size: 0.7rem; font-family: var(--display); }
.tc b { color: var(--gold); font-variant-numeric: tabular-nums; font-weight: 600; }
.tree i { font-style: normal; color: var(--muted); font-size: 0.9rem; }
.tree .tr > .tc { border-color: rgba(52, 211, 153, 0.45); }
.tree .ts > .tc { border-color: rgba(185, 135, 255, 0.55); }
.tree .tt > .tc { border-color: rgba(242, 193, 78, 0.55); }
.totals { padding: 14px; margin-top: 16px; }
.totals h3 { margin-bottom: 4px; }
.tot-l { margin: 12px 0 6px; font-weight: 700; color: var(--text-2); }

/* ---------- index pages ---------- */
.filters { padding: 12px 14px; margin-bottom: 16px; display: grid; gap: 10px; }
.flt-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.flt-l { color: var(--muted); font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-right: 4px; min-width: 90px; }
.flt-b { font: inherit; font-size: 0.92rem; font-weight: 600; color: var(--text-2); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 11px; cursor: pointer; }
.flt-b[aria-pressed="true"] { color: #06101c; background: var(--cyan); border-color: var(--cyan); }
.flt-count { margin: 0; color: var(--muted); font-size: 0.9rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.cards.big { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--glass); color: var(--text); text-decoration: none; min-width: 0; transition: border-color .15s, background .15s, transform .15s; }
.card:hover { border-color: var(--cyan-line); background: var(--glass-hi); color: var(--text); transform: translateY(-1px); }
.card .th { width: 72px; height: 72px; }
.cards.big .card .th { width: 88px; height: 88px; }
.card-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.card-n { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.card-s { color: var(--muted); font-size: 0.9rem; line-height: 1.3; }
.card-b { display: flex; flex-wrap: wrap; gap: 4px; }
.card[hidden] { display: none; }
.flt-empty { color: var(--muted); }

.enc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.enc-card { display: grid; grid-template-columns: 56px 1fr auto; gap: 4px 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); color: var(--text); text-decoration: none; }
.enc-card:hover { border-color: var(--cyan-line); background: var(--glass-hi); color: var(--text); }
.enc-card .th { grid-row: span 2; width: 56px; height: 56px; }
.enc-t { font-weight: 700; font-size: 1.15rem; }
.enc-c { font-family: var(--display); color: var(--gold); font-size: 0.95rem; }
.enc-d { grid-column: 2 / -1; color: var(--muted); font-size: 0.92rem; line-height: 1.35; }

/* ---------- articles ---------- */
.article-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; align-items: start; }
.side { position: sticky; top: 78px; font-size: 0.95rem; }
.side-h { color: var(--gold); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; margin: 0 0 8px; }
.side ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.side a { display: block; padding: 5px 12px; color: var(--text-2); text-decoration: none; margin-left: -1px; border-left: 2px solid transparent; }
.side a:hover { color: var(--text); }
.side a[aria-current="page"] { color: var(--cyan); border-left-color: var(--cyan); }
.article { min-width: 0; max-width: 820px; }
.toc { padding: 10px 16px; margin-bottom: 20px; font-size: 0.95rem; }
.toc p { margin: 0 0 4px; font-weight: 700; color: var(--muted); text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.12em; }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc ul.plain { margin: 0; padding-left: 0; list-style: none; }
.all-arts { display: none; margin-top: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); }
.all-arts summary { cursor: pointer; font-weight: 700; color: var(--cyan); }
.all-arts ol { margin: 8px 0 0; padding-left: 1.4em; }
.all-arts li { margin: 4px 0; }
.all-arts a[aria-current="page"] { color: var(--text); font-weight: 700; text-decoration: none; }
.prose > :is(p, ul, ol, blockquote, h2, h3) { max-width: 75ch; }
.prose h2 { margin-top: 1.6em; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.prose h3 { margin-top: 1.3em; }
.prose li { margin: 4px 0; }
.prose blockquote { margin: 1em 0; border-left: 3px solid var(--gold); padding: 6px 14px; background: rgba(242, 193, 78, 0.06); border-radius: 0 8px 8px 0; color: var(--text-2); }
.prose blockquote p { margin: 0.3em 0; }
.prose code { background: rgba(255, 255, 255, 0.07); padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }
.prose img { border-radius: 8px; }
.notice { padding: 12px 14px; margin-bottom: 18px; border-color: rgba(242, 193, 78, 0.45); }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; }
.pn a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); text-decoration: none; color: var(--text); font-weight: 700; }
.pn a:hover { border-color: var(--cyan-line); }
.pn span { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
.pn-next { text-align: right; }
.art-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-width: 860px; }
.art-list a { display: grid; grid-template-columns: 44px 1fr auto; gap: 2px 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); color: var(--text); text-decoration: none; }
.art-list a:hover { border-color: var(--cyan-line); background: var(--glass-hi); }
.al-n { grid-row: span 2; font-family: var(--display); color: var(--gold); }
.al-t { font-weight: 700; font-size: 1.1rem; }
.al-d { grid-column: 2; color: var(--muted); font-size: 0.95rem; }
.art-list .badge { grid-row: 1; grid-column: 3; }

/* ---------- home ---------- */
.home .wrap { padding-top: 0; }
.hero { position: relative; margin: 0 calc(-1 * var(--gutter)); padding: 56px var(--gutter) 44px; background: linear-gradient(180deg, rgba(5, 7, 15, 0.35), rgba(5, 7, 15, 0.92) 85%), url('/assets/img/hero.webp') center 35% / cover no-repeat; border-bottom: 1px solid var(--line); }
.hero-in { max-width: 820px; margin: 0 auto; text-align: center; }
.hero-logo { width: 245px; height: auto; margin-bottom: 12px; }
.hero h1 { font-size: clamp(1.35rem, 1rem + 2.4vw, 2.4rem); }
.hero h1 span { color: var(--gold); display: block; }
.hero .lede { margin-left: auto; margin-right: auto; }
.hero-search { display: flex; gap: 8px; max-width: 620px; margin: 0 auto 18px; }
.hero-search input { font-size: 1.08rem; padding: 12px 14px; }
.hero-search button { background: var(--cyan); color: #06101c; border-color: var(--cyan); }
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #0b0b10; }
.btn.primary:hover { background: #ffd56e; color: #0b0b10; }
.home-sec { margin: 40px 0; }
.home-sec.intro { max-width: 860px; margin-left: auto; margin-right: auto; font-size: 1.08rem; }
.goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
@media (min-width: 961px) { .goals { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.goal { padding: 16px; position: relative; }
.goal-i svg { width: 34px; height: 34px; fill: none; stroke: var(--cyan); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.goal h3 { margin: 6px 0; font-size: 1.25rem; }
.goal p { color: var(--text-2); margin: 0 0 10px; font-size: 0.98rem; }
.goal ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.goal li a { font-weight: 600; }
.goal li a::before { content: '→ '; color: var(--gold); }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.guide-card { display: grid; grid-template-columns: 38px 1fr; align-content: start; gap: 2px 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); color: var(--text); text-decoration: none; }
.guide-card:hover { border-color: var(--cyan-line); background: var(--glass-hi); color: var(--text); }
.gc-n { grid-row: span 2; font-family: var(--display); color: var(--gold); }
.gc-t { font-weight: 700; }
.gc-d { color: var(--muted); font-size: 0.9rem; line-height: 1.35; }
.fac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.faction-card { display: flex; gap: 14px; padding: 12px; border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); border-radius: var(--radius); background: linear-gradient(135deg, color-mix(in srgb, var(--c) 10%, transparent), var(--glass)); }
.faction-card img { width: 64px; height: auto; max-height: 150px; object-fit: cover; object-position: top; border-radius: 6px; flex: none; }
.faction-card h3 { color: var(--c); margin: 2px 0 6px; }
.faction-card p { margin: 2px 0; color: var(--text-2); font-size: 0.95rem; }

/* search page */
.search-results { display: grid; gap: 6px; max-width: 860px; }
.hero-search.left { margin: 0 0 18px; }
.search-page .top .search { display: none; }
.search-page .mainnav { margin-left: auto; }
.sr-k { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-results .sr-item { border: 1px solid var(--line); background: var(--glass); }
.search-results .sr-item img, .search-results .sr-item .ph { width: 48px; height: 48px; }

/* footer */
.foot { border-top: 1px solid var(--line); background: rgba(5, 7, 15, 0.8); }
.foot-in { max-width: 1240px; margin: 0 auto; padding: 28px var(--gutter); }
.foot-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; }
.foot-enc { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; align-content: start; }
.foot-enc strong { grid-column: 1 / -1; }
.foot-cols div { display: flex; flex-direction: column; gap: 4px; }
.foot-cols strong { color: var(--gold); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 4px; }
.foot-cols a { color: var(--text-2); text-decoration: none; }
.foot-cols a:hover { color: var(--cyan); }
.foot-note { color: var(--muted); font-size: 0.9rem; margin: 20px 0 0; }

/* ---------- article diagrams, tip boxes, zone labels ---------- */
.prose blockquote > p:first-child > strong:first-child { color: var(--gold); }
.prose .diagram { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; margin: 1.2em 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); }
.diagram .dg-step { flex: 1 1 110px; min-width: 0; padding: 9px 11px; border: 1px solid var(--cyan-line); border-radius: 8px; background: var(--cyan-soft); }
.diagram .dg-step b { display: block; color: var(--cyan); font-size: 0.98rem; line-height: 1.25; }
.diagram .dg-step b a { color: inherit; }
.diagram .dg-step span { display: block; margin-top: 3px; font-size: 0.86rem; line-height: 1.35; color: var(--text-2); }
.diagram .dg-step.dg-end { border-color: rgba(242, 193, 78, 0.55); background: rgba(242, 193, 78, 0.08); }
.diagram .dg-step.dg-end b { color: var(--gold); }
.diagram .dg-arrow { align-self: center; color: var(--gold); font-weight: 700; font-size: 1.15rem; }
.diagram .dg-pair { display: flex; align-items: stretch; gap: 6px; flex: 1 1 130px; min-width: 0; }
.diagram .dg-pair > .dg-step { flex: 1 1 auto; }
.zone { white-space: nowrap; font-weight: 700; }
.zone::before { content: ''; display: inline-block; width: 0.7em; height: 0.7em; margin-right: 0.4em; border-radius: 50%; vertical-align: -0.02em; background: var(--zc); box-shadow: 0 0 6px var(--zc); }
.zone.zg { --zc: #34d399; } .zone.zy { --zc: #fbbf24; } .zone.zr { --zc: #ef4444; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .ent-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .ent-grid > .infobox { grid-column: 1; grid-row: 1; position: relative; top: 0; }
  .ent-grid > .ent-main { grid-row: 2; }
  .ib-img.big .th { width: 220px; height: 220px; }
  .article-grid { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .all-arts { display: block; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  html { scroll-padding-top: 12px; }
  .top { position: static; }
  .top-in { flex-wrap: wrap; gap: 8px 10px; }
  .brand img { height: 34px; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
  .menu-btn { display: inline-flex; margin-left: auto; }
  .mainnav { display: none; order: 4; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: 6px; }
  .mainnav.open { display: flex; }
  .mainnav a.play { margin: 4px 0 0; text-align: center; }
  .cards, .cards.big { grid-template-columns: minmax(0, 1fr); }
  .card .th, .cards.big .card .th { width: 60px; height: 60px; }
  .facts > div { grid-template-columns: minmax(96px, 40%) 1fr; }
  .flt-l { min-width: 0; flex-basis: 100%; }
  .stats li { grid-template-columns: 1fr; }
  .st-v { grid-row: auto; }
  .hero { padding: 34px var(--gutter) 30px; }
  .hero-logo { width: 190px; }
  .hero-search { flex-direction: column; }
  .foot-cols { grid-template-columns: 1fr; }
  .foot-enc { grid-template-columns: 1fr 1fr; }
  .pn { grid-template-columns: 1fr; }
  .used { grid-template-columns: minmax(0, 1fr); }
  .tree ul { margin-left: 6px; padding-left: 10px; }
  .enc-grid, .guide-grid, .goals, .fac-grid { grid-template-columns: minmax(0, 1fr); }
  .prose .diagram { flex-direction: column; }
  .diagram .dg-step { flex-basis: auto; }
  .diagram .dg-arrow { transform: rotate(90deg); line-height: 1; }
  .diagram .dg-pair { flex-direction: column; align-items: stretch; flex: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
