/* Knightfall Idle — wiki stylesheet.
   Shared by every generated page under /wiki/ (hub, category, entry, glossary).
   Theme matches Landing/index.html (navy + gold, Georgia headings).
   Generated pages never inline styles, so a restyle here restyles the whole wiki.

   Do not put layout for the landing page in here, keep the two separate. */

:root {
  --bg: #0b111e;
  --bg-2: #101a2e;
  --panel: #16223a;
  --panel-2: #1a2842;
  --line: #243a5e;
  --gold: #d9a845;
  --gold-2: #f0d080;
  --gold-dim: #a8842f;
  --text: #dfe6f3;
  --muted: #8fa0bd;
  --accent: #7fb2ff;
  --nav-h: 54px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top nav (always visible here, unlike the landing page) ─────────────── */
.wk-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 22px;
  background: rgba(11,17,30,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.wk-nav .wk-brand {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 16px;
  white-space: nowrap;
}
.wk-nav .wk-brand:hover { text-decoration: none; }
.wk-nav .wk-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.wk-nav .wk-links a { color: var(--muted); font-size: 14px; }
.wk-nav .wk-links a:hover { color: var(--gold); text-decoration: none; }
.wk-nav .wk-links a.wk-play {
  color: #101422;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  font-weight: 700;
  border-radius: 8px;
  padding: 7px 16px;
}
.wk-nav .wk-links a.wk-play:hover { color: #101422; text-decoration: none; }
.wk-nav .wk-links a.wk-here { color: var(--gold); }

/* ── Page shell ─────────────────────────────────────────────────────────── */
.wk-wrap { max-width: 1060px; margin: 0 auto; padding: 0 22px; }
.wk-main { padding: 30px 0 70px; }

.wk-crumbs { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.wk-crumbs a { color: var(--muted); }
.wk-crumbs a:hover { color: var(--gold); }
.wk-crumbs span.sep { margin: 0 7px; opacity: .55; }

.wk-cat-tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(217,168,69,.45);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 14px;
  background: rgba(11,17,30,.4);
}

h1.wk-h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 5vw, 42px);
  letter-spacing: .5px;
  color: var(--gold-2);
  line-height: 1.15;
  margin-bottom: 12px;
}
h2.wk-h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(21px, 3vw, 26px);
  color: var(--gold-2);
  line-height: 1.25;
  margin-bottom: 10px;
}
h3.wk-h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  color: var(--gold-2);
  margin-bottom: 8px;
}

p.wk-lede { color: #c3cee0; font-size: 17px; max-width: 720px; }
p.wk-sub { color: var(--muted); font-size: 15px; }

/* ── Search + filter chips ──────────────────────────────────────────────── */
.wk-search-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 26px 0 16px; }
.wk-search {
  flex: 1 1 320px;
  min-width: 240px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
}
.wk-search:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(217,168,69,.18); }
.wk-search::placeholder { color: #6d7f9c; }

.wk-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.wk-chip {
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 15px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.wk-chip:hover { border-color: rgba(217,168,69,.5); background: var(--panel-2); }
.wk-chip.on {
  border-color: var(--gold);
  color: var(--gold-2);
  background: linear-gradient(180deg, rgba(217,168,69,.16), rgba(217,168,69,.05)), var(--panel);
}
.wk-chip .wk-chip-n { color: var(--muted); margin-left: 6px; font-size: 12px; }
.wk-chip.on .wk-chip-n { color: var(--gold-dim); }

/* ── Card grids ─────────────────────────────────────────────────────────── */
.wk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.wk-grid.wk-grid-sm { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.wk-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color .15s ease, background .15s ease, transform .12s ease, box-shadow .15s ease;
}
.wk-card:hover {
  text-decoration: none;
  border-color: rgba(217,168,69,.55);
  background: var(--panel-2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.32);
}
.wk-card-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  object-fit: contain;
  image-rendering: auto;
}
.wk-card-body { display: block; min-width: 0; }
.wk-card .wk-card-cat {
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--gold-dim);
}
.wk-card .wk-card-t {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  color: var(--gold-2);
  margin: 3px 0 6px;
}
.wk-card .wk-card-s { font-size: 13.5px; color: var(--muted); }

/* ── Glossary list ──────────────────────────────────────────────────────── */
.wk-gloss {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 10px;
  align-items: start;
}
.wk-gloss-item {
  display: block;
  background: rgba(11,17,30,.5);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 11px 14px;
  transition: border-color .15s ease, background .15s ease;
}
.wk-gloss-item:hover {
  text-decoration: none;
  background: var(--panel);
  border-color: var(--gold);
  border-left-color: var(--gold);
}
.wk-gloss-t {
  display: block;
  color: var(--accent);
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 3px;
}
.wk-gloss-item:hover .wk-gloss-t { color: var(--gold-2); }
.wk-gloss-s { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }

.wk-empty { color: var(--muted); font-size: 15px; padding: 26px 0; display: none; }
.wk-empty.show { display: block; }

/* ── Article body ───────────────────────────────────────────────────────── */
.wk-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 26px 0 34px;
  padding: 0;
  list-style: none;
}
.wk-facts li {
  background: rgba(11,17,30,.55);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-dim);
  border-radius: 8px;
  padding: 10px 14px;
}
.wk-facts .wk-fact-l {
  display: block;
  font-size: 11.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}
.wk-facts .wk-fact-v { display: block; color: var(--gold-2); font-weight: 600; font-size: 15px; }

/* Contents strip, shown once an entry has enough sections (matches the in-game
   wiki's jump buttons). */
.wk-toc { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 30px; }
.wk-toc a {
  font-size: 12.5px;
  color: var(--muted);
  background: rgba(11,17,30,.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.wk-toc a:hover {
  color: var(--gold-2);
  border-color: rgba(217,168,69,.55);
  background: var(--panel);
  text-decoration: none;
}

.wk-section { margin-bottom: 30px; }
.wk-section > p { margin-bottom: 12px; color: #cfd8e8; }
.wk-section > p:last-child { margin-bottom: 0; }

ol.wk-steps, ul.wk-bullets { margin: 4px 0 12px 22px; color: #cfd8e8; }
ol.wk-steps li, ul.wk-bullets li { margin-bottom: 6px; padding-left: 3px; }
ul.wk-bullets { list-style: none; margin-left: 4px; }
ul.wk-bullets li::before { content: "\25C6"; color: var(--gold-dim); font-size: 10px; margin-right: 9px; vertical-align: 2px; }

table.wk-table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0 14px;
  font-size: 14px;
  background: rgba(11,17,30,.42);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
table.wk-table th, table.wk-table td {
  text-align: left;
  padding: 9px 13px;
  border-bottom: 1px solid rgba(36,58,94,.7);
}
table.wk-table th {
  color: var(--gold-2);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .6px;
  text-transform: uppercase;
  background: rgba(22,34,58,.9);
}
table.wk-table tr:last-child td { border-bottom: none; }
table.wk-table td:first-child { color: var(--text); }
table.wk-table td + td { color: var(--gold-2); }

dl.wk-values { margin: 4px 0 14px; }
dl.wk-values div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 13px;
  border-bottom: 1px solid rgba(36,58,94,.6);
}
dl.wk-values div:last-child { border-bottom: none; }
dl.wk-values dt { color: var(--muted); font-size: 14.5px; }
dl.wk-values dd { color: var(--gold-2); font-weight: 600; white-space: nowrap; }
dl.wk-values dd.wk-value-dash { color: #5f7190; font-weight: 400; }

.wk-callout {
  background: rgba(217,168,69,.09);
  border: 1px solid rgba(217,168,69,.38);
  border-radius: 9px;
  padding: 13px 16px;
  font-size: 14.5px;
  color: #e6dcc4;
  margin: 6px 0 14px;
}

.wk-related { display: flex; flex-wrap: wrap; gap: 9px; }
.wk-related a {
  font-size: 13.5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
}
.wk-related a:hover { border-color: var(--gold); text-decoration: none; background: var(--panel-2); }

/* ── Entry header icon ──────────────────────────────────────────────────── */
.wk-entry-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.wk-entry-icon { flex: 0 0 auto; width: 46px; height: 46px; object-fit: contain; }
.wk-entry-head-text { min-width: 0; }
.wk-entry-head-text .wk-h1 { margin-bottom: 3px; }

/* Category and group line under the title, as the game draws it: the category
   is a link in the accent colour, the separator is dim, the group is muted. */
.wk-entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  line-height: 1.3;
}
.wk-entry-meta a { color: var(--accent); }
.wk-entry-meta a:hover { color: var(--gold-2); text-decoration: none; }
.wk-meta-sep { color: #46566f; }
.wk-meta-group { color: var(--muted); }

/* ── Rarity colours (WikiTab.gd ALL_ITEMS_TIER_COLORS) ──────────────────── */
.wk-r-t1 { color: #abb8c9; }
.wk-r-t2 { color: #6bcc6b; }
.wk-r-t3 { color: #fad159; }
.wk-b-t1 { border-color: #abb8c9 !important; }
.wk-b-t2 { border-color: #6bcc6b !important; }
.wk-b-t3 { border-color: #fad159 !important; }
.wk-b-gear { border-color: #8c9eb8 !important; }

/* ── Item tiles (All Items board) ────────────────────────────────────────── */
.wk-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  margin: 6px 0 22px;
}
.wk-item-tile {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(11,17,30,.55);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 10px;
  cursor: help;
}
.wk-item-icon { flex: 0 0 auto; width: 34px; height: 34px; object-fit: contain; }
.wk-item-name { flex: 1 1 auto; font-size: 13.5px; color: #dbe3ef; overflow-wrap: anywhere; }
.wk-item-wealth { flex: 0 0 auto; color: var(--gold-2); font-weight: 600; font-size: 14px; }
.wk-item-sub { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); }

/* ── Hover tooltip (mirrors the in-game item tooltip) ────────────────────── */
.wk-tip {
  position: fixed;
  z-index: 200;
  max-width: 340px;
  background: #0d1424;
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #cfd8e8;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease;
  box-shadow: 0 14px 40px rgba(0,0,0,.6);
}
.wk-tip.show { opacity: 1; visibility: visible; }
.wk-tip span { display: block; }
.wk-tip .wk-tt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.wk-tip .wk-tt-head img { width: 28px; height: 28px; object-fit: contain; }
.wk-tip .wk-tt-name { font-size: 14px; color: var(--gold-2); font-weight: 600; }
.wk-tip .wk-tt-badge { color: inherit; }
.wk-tip .wk-tt-green { color: #6bcc6b; }
.wk-tip .wk-tt-gold { color: #fad159; }
.wk-tip .wk-tt-gray { color: #abb8c9; }
.wk-tip .wk-tt-red { color: #e06666; }
.wk-tip .wk-tt-acquire { color: var(--muted); margin-bottom: 5px; }
.wk-tip .wk-tt-info { color: #cfd8e8; }
.wk-tip .wk-tt-wealth { color: var(--gold-2); margin-top: 5px; }
.wk-tip .wk-tt-unlock { color: #8fa0bd; font-style: italic; margin-top: 5px; }

/* ── Boards (wealth grid, item uses) ────────────────────────────────────── */
.wk-board-note { color: var(--muted); font-size: 14px; }
.wk-wealth {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 8px;
  margin: 6px 0 14px;
}
.wk-wealth-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(11,17,30,.55);
  border: 1px solid rgba(217,168,69,.85);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13.5px;
  cursor: help;
}
.wk-tile-icon { flex: 0 0 auto; width: 30px; height: 30px; object-fit: contain; }
.wk-wealth-name { flex: 1 1 auto; color: #dbe3ef; overflow-wrap: anywhere; }
.wk-wealth-v { flex: 0 0 auto; color: var(--gold-2); font-weight: 600; font-size: 15px; }

.wk-uses { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; margin: 6px 0 14px; }
.wk-uses .wk-use {
  display: grid;
  grid-template-columns: 30px 170px 1fr;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(36,58,94,.6);
  font-size: 13.5px;
  background: rgba(11,17,30,.35);
}
.wk-uses .wk-use:last-child { border-bottom: none; }
.wk-uses .wk-use-k { color: var(--gold-2); font-weight: 600; overflow-wrap: anywhere; cursor: help; }
.wk-uses .wk-use-g { color: var(--muted); cursor: help; }
.wk-uses .wk-use-g b { color: #b9c7de; font-weight: 600; }

/* ── Prev / next within a category ──────────────────────────────────────── */
.wk-pager {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.wk-pager a { max-width: 46%; }
.wk-pager .wk-pager-dir { display: block; font-size: 11.5px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--muted); }
.wk-pager .wk-pager-next { text-align: right; margin-left: auto; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.wk-foot {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 28px 22px 40px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.wk-foot a { color: var(--gold); }
.wk-foot .wk-foot-made { display: block; margin-top: 8px; font-size: 12px; color: #5f7190; }

@media (max-width: 620px) {
  .wk-nav { padding: 9px 14px; }
  .wk-nav .wk-links { gap: 12px; }
  .wk-nav .wk-links a { font-size: 13px; }
  .wk-wrap { padding: 0 15px; }
  dl.wk-values div { flex-direction: column; gap: 2px; }
  dl.wk-values dd { white-space: normal; }
  .wk-uses .wk-use { grid-template-columns: 30px 1fr; gap: 6px 10px; align-items: start; }
  .wk-uses .wk-use-g { grid-column: 1 / -1; }
  .wk-grid, .wk-grid.wk-grid-sm { grid-template-columns: 1fr; }
  .wk-items { grid-template-columns: 1fr; }
  .wk-gloss { grid-template-columns: 1fr; }
}
