/* The wiki (wiki.html). The game's battle fonts and its colours of ink, stone, wood and gold. */
@font-face { font-family: 'Game Display'; src: url(../../art/fonts/grenze-gotisch.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Game UI'; src: url(../../art/fonts/grenze.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Menu UI'; src: url(../../art/fonts/jersey-10.woff2) format('woff2'); font-weight: 100 900; size-adjust: 124%; font-display: swap; }

:root {
  --ink: #17131a; --ink-2: #1f1a20; --card: #29222a; --card-2: #322a30; --line: #4a3c32; --line-2: #6b5640;
  --text: #e8dcc4; --dim: #a8987e; --gold: #e0b354; --gold-2: #f2d48a; --ok: #8fbf6a; --bad: #e07a4a;
  --kingdom: #6f9fd8; --elves: #79c48f; --dwarves: #d99a4e; --shadow: #c8504a;
  --display: 'Game Display', Georgia, serif; --ui: 'Game UI', Georgia, serif; --num: 'Menu UI', 'Game UI', monospace;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 70px; }
body { margin: 0; background: var(--ink); color: var(--text); font: 18px/1.5 var(--ui); }
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img.missing { visibility: hidden; }
.muted { color: var(--dim); }
.small { font-size: 15px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; color: var(--gold); }
h1 { font-size: 46px; line-height: 1.05; margin: 4px 0 10px; }
h2 { font-size: 30px; margin: 36px 0 10px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
h3 { font-size: 24px; margin: 0 0 2px; }
h4 { font: 600 14px var(--ui); text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); margin: 16px 0 6px; }
kbd { font: 15px var(--num); background: var(--ink); border: 1px solid var(--line-2); border-radius: 3px; padding: 0 5px; color: var(--gold-2); }

/* ---------- Frame ---------- */
#top {
  position: sticky; top: 0; z-index: 10; height: 58px; display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: linear-gradient(#2a2224, #19141a); border-bottom: 2px solid var(--line-2);
}
#brand { font: 28px var(--display); color: var(--gold); white-space: nowrap; }
#brand span { font: 15px var(--ui); color: var(--dim); text-transform: uppercase; letter-spacing: 0.12em; margin-left: 4px; }
#brand:hover { text-decoration: none; }
#search-wrap { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
#search { width: 100%; font: 17px var(--ui); color: var(--text); background: var(--ink); border: 1px solid var(--line-2); border-radius: 4px; padding: 6px 10px; }
#search:focus { outline: none; border-color: var(--gold); }
#results { position: absolute; top: 40px; left: 0; right: 0; background: var(--card); border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; box-shadow: 0 8px 24px #0009; }
#results a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; color: var(--text); }
#results a small { margin-left: auto; color: var(--dim); }
#results a.sel, #results a:hover { background: var(--card-2); text-decoration: none; }
#play { font: 20px var(--display); border: 1px solid var(--gold); color: var(--gold); padding: 3px 14px; border-radius: 4px; white-space: nowrap; }
#play:hover { background: #e0b35422; text-decoration: none; }
#menu-btn { display: none; font-size: 22px; background: none; border: 1px solid var(--line-2); color: var(--text); border-radius: 4px; padding: 2px 10px; cursor: pointer; }

#layout { display: flex; max-width: 1280px; margin: 0 auto; }
#nav { position: sticky; top: 58px; align-self: flex-start; width: 230px; flex: none; padding: 8px 12px 24px 16px; max-height: calc(100vh - 58px); overflow-y: auto; }
#nav h3 { font: 600 12px var(--ui); text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); margin: 12px 0 2px; }
#nav ul { list-style: none; margin: 0; padding: 0; }
#nav a { display: flex; align-items: center; gap: 8px; padding: 2px 8px; border-radius: 4px; color: var(--text); font-size: 16px; line-height: 1.3; }
#nav a:hover { background: var(--card); text-decoration: none; }
#nav a.on { background: var(--card-2); color: var(--gold-2); box-shadow: inset 3px 0 var(--gold); }
#page { flex: 1; min-width: 0; padding: 20px 28px 80px; max-width: 1000px; }
.crumbs { font-size: 15px; color: var(--dim); }
.crumbs a { color: var(--dim); }

.ico { width: 22px; height: 22px; image-rendering: pixelated; vertical-align: -5px; flex: none; }
.ico.lg { width: 40px; height: 40px; }
.rico { width: 18px; height: 18px; image-rendering: pixelated; vertical-align: -3px; margin-right: 2px; }
.res { font-family: var(--num); white-space: nowrap; }
.ulink { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ulink .ico { border: 1px solid var(--line); border-radius: 2px; }

/* ---------- Home ---------- */
.hero-banner { position: relative; border: 2px solid var(--line-2); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.hero-art { display: block; width: 100%; aspect-ratio: 16 / 7; object-fit: cover; image-rendering: pixelated; }
.hero-text { position: absolute; inset: auto 0 0 0; padding: 60px 26px 20px; background: linear-gradient(transparent, #110d12ee 55%); }
.hero-text h1 { font-size: 54px; margin: 0; }
.hero-text p { margin: 4px 0 0; max-width: 640px; }
.pcards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.pcard { position: relative; display: block; border: 2px solid var(--line-2); border-radius: 6px; overflow: hidden; aspect-ratio: 3 / 4; }
.pcard-art { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; transition: transform .3s; }
.pcard:hover .pcard-art { transform: scale(1.04); }
.pcard:hover { text-decoration: none; border-color: var(--fc); }
.pcard-text { position: absolute; inset: auto 0 0 0; padding: 40px 12px 12px; background: linear-gradient(transparent, #110d12f0 50%); display: flex; flex-direction: column; }
.pcard-name { font: 24px var(--display); color: var(--gold-2); }
.pcard-tag { font-size: 15px; color: var(--text); }
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.gcard { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; color: var(--text); }
.gcard b { font: 22px var(--display); color: var(--gold-2); font-weight: 400; }
.gcard:hover { border-color: var(--gold); text-decoration: none; }
.gcard-group { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); }

.f-kingdom { --fc: var(--kingdom); } .f-elves { --fc: var(--elves); } .f-dwarves { --fc: var(--dwarves); } .f-shadow { --fc: var(--shadow); }

/* ---------- People ---------- */
.fhead { display: flex; gap: 24px; align-items: flex-start; }
.fhead-art { width: 240px; flex: none; border: 2px solid var(--fc); border-radius: 6px; image-rendering: pixelated; }
.fhead .tagline { font-style: italic; color: var(--fc); margin-top: -6px; }
.specs { padding-left: 20px; color: var(--dim); }
.roster { display: flex; flex-wrap: wrap; gap: 0 26px; }
.roster-group { margin-bottom: 4px; }
h2.clear { clear: both; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { width: 104px; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 6px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; color: var(--text); }
.chip:hover { border-color: var(--gold); text-decoration: none; background: var(--card-2); }
.chip-art { width: 56px; height: 56px; image-rendering: pixelated; border-radius: 3px; }
.chip-name { font-size: 16px; line-height: 1.15; margin-top: 4px; }
.chip-tier { font-size: 13px; color: var(--dim); }
.ways { display: grid; gap: 16px; }
.way { display: flex; gap: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.way.focus { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.way-art { width: 180px; flex: none; object-fit: cover; image-rendering: pixelated; }
.way-body { padding: 14px 16px 16px 0; }
.way .tagline { font-style: italic; color: var(--dim); margin: 0 0 8px; }
.traits { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.traits dt { font: 600 13px var(--ui); text-transform: uppercase; letter-spacing: 0.08em; padding-top: 4px; }
.traits dd { margin: 0; }
.traits .sig { color: var(--gold); } .traits .good { color: var(--ok); } .traits .bad { color: var(--bad); }

/* ---------- Tables ---------- */
table.data { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 16px; }
table.data th { text-align: left; font: 600 13px var(--ui); text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); border-bottom: 1px solid var(--line-2); padding: 6px 8px; }
table.data td { border-bottom: 1px solid #3a302c; padding: 6px 8px; vertical-align: middle; }
table.data tr:hover td { background: #ffffff06; }
.scroll-x { overflow-x: auto; }
table.sortable th { cursor: pointer; white-space: nowrap; }
table.sortable th::after { content: attr(data-dir); margin-left: 3px; color: var(--gold); }
table.sortable td { font-family: var(--num); font-size: 18px; }
table.sortable td:first-child, table.sortable td:nth-child(2) { font-family: var(--ui); font-size: 16px; }
table.sortable tr td:first-child { box-shadow: inset 3px 0 var(--fc); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.filters button { font: 16px var(--ui); color: var(--text); background: var(--card); border: 1px solid var(--line-2); border-radius: 4px; padding: 3px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.filters button.on { border-color: var(--gold); color: var(--gold-2); background: var(--card-2); }
.filters label { color: var(--dim); margin-left: 8px; }

/* ---------- Unit ---------- */
.article { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0 28px; align-items: start; }
.article-main { grid-column: 1; grid-row: 1; min-width: 0; }
.article-main > h2:first-child, .article-main > .lede:first-child { margin-top: 0; }
.infobox { grid-column: 2; grid-row: 1; position: sticky; top: 74px; background: var(--card); border: 1px solid var(--line-2); border-top: 4px solid var(--fc); border-radius: 6px; overflow: hidden; }
.ib-title { font: 26px var(--display); color: var(--gold); text-align: center; padding: 8px 10px 4px; }
.ib-art { display: block; width: 96px; height: 96px; margin: 0 auto; image-rendering: pixelated; border: 2px solid var(--line-2); border-radius: 4px; }
.ib-sub { text-align: center; padding: 8px; }
.fbadge { display: inline-flex; align-items: center; gap: 6px; color: var(--fc); }
.wbadge { color: var(--gold-2); font-style: italic; }
table.stats { width: 100%; border-collapse: collapse; font-size: 16px; }
table.stats th { text-align: left; font-weight: 400; color: var(--dim); padding: 4px 12px; width: 44%; }
table.stats td { padding: 4px 12px 4px 0; font-family: var(--num); font-size: 19px; }
table.stats td .muted { font-size: 16px; }
table.stats tr:nth-child(odd) { background: #ffffff05; }
.tag { font: 14px var(--ui); background: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; }
.ib-foot { padding: 10px 12px; border-top: 1px solid var(--line); font-size: 15px; display: grid; gap: 4px; }
.ib-foot b { color: var(--dim); font-weight: 400; margin-right: 4px; }
.lede { font-size: 21px; }
.quote { font-style: italic; color: var(--dim); border-left: 3px solid var(--line-2); padding-left: 12px; }
.special { list-style: none; padding: 0; }
.special li { background: var(--card); border-left: 3px solid var(--gold); padding: 6px 12px; margin: 6px 0; border-radius: 0 4px 4px 0; }
.abilities { display: grid; gap: 10px; }
.ability { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.ab-icon { width: 56px; height: 56px; flex: none; image-rendering: pixelated; border: 1px solid var(--line-2); border-radius: 4px; }
.ab-name { font: 22px var(--display); color: var(--gold-2); }
.ab-facts { display: flex; gap: 16px; font: 17px var(--num); color: var(--dim); margin-top: 2px; }
.vs-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vs { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 4px 14px 12px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-content: flex-start; }
.vs h4 { width: 100%; margin: 8px 0 2px; }
.vs.good h4 { color: var(--ok); } .vs.bad h4 { color: var(--bad); }
.tips li { margin: 6px 0; }
.opening li { margin: 6px 0; }
ul.tight { margin: 6px 0; padding-left: 20px; }
.sigc { color: var(--gold); font-weight: 400; }
.works { display: flex; gap: 20px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin: 14px 0; }
.works h2 { margin: 0 0 4px; border: 0; padding: 0; }
.works-art { width: 96px; height: 96px; flex: none; image-rendering: pixelated; border: 2px solid var(--line-2); border-radius: 4px; }
.small-stats { max-width: 420px; }
td.num { font-family: var(--num); font-size: 18px; white-space: nowrap; }
tr:target td, .ability:target { background: #e0b35418; }
.stale { background: #e07a4a22; border: 1px solid #e07a4a77; border-radius: 6px; padding: 8px 12px; }
.wb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wb-col { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 4px 12px 10px; }
.wb-col h4 { margin: 8px 0 6px; } .wb-col.good h4 { color: var(--ok); } .wb-col.bad h4 { color: var(--bad); }
.wb-count { font: 15px var(--num); color: var(--dim); margin-left: 4px; }
.wb-col ul { list-style: none; margin: 0; padding: 0; }
.wb-col li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 3px 0 3px 8px; border-left: 3px solid var(--fc); margin: 2px 0; }
.wb-meta { font-size: 14px; color: var(--dim); white-space: nowrap; }
.wb-line { font-size: 16px; } .wb-line .ulink { margin-right: 8px; }
.fine { clear: both; margin-top: 30px; }

/* ---------- Guides ---------- */
.guide { max-width: 760px; }
.guide h2:first-child { margin-top: 10px; }
.formula { font: 20px var(--num); background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 10px 16px; margin: 12px 0; color: var(--gold-2); }
.tip { background: #e0b35414; border: 1px solid #e0b35455; border-radius: 6px; padding: 12px 16px; margin: 20px 0; }
.guide li { margin: 5px 0; }

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
  #menu-btn { display: block; }
  #nav { position: fixed; top: 58px; left: 0; bottom: 0; z-index: 9; background: var(--ink-2); border-right: 1px solid var(--line-2); transform: translateX(-100%); transition: transform .2s; max-height: none; }
  .nav-open #nav { transform: none; }
  #page { padding: 16px 16px 60px; }
  .pcards { grid-template-columns: repeat(2, 1fr); }
  .article { grid-template-columns: minmax(0, 1fr); }
  .infobox, .article-main { grid-column: 1; grid-row: auto; }
  .infobox { position: static; margin: 4px 0 20px; }
  .fhead { flex-direction: column; }
  .fhead-art { width: 100%; max-width: 360px; }
  .way { flex-direction: column; }
  .way-art { width: 100%; height: 180px; }
  .way-body { padding: 0 16px 16px; }
  .vs-wrap, .wb-cols { grid-template-columns: 1fr; }
  .hero-text h1 { font-size: 36px; }
  #brand span, #play { display: none; }
}
