/* PIANO ARMY · the wiki (web/wiki.html, web/js/army-wiki.js). The fonts and the palette are the game's (army.css). */
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/BarlowCondensed-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/BarlowCondensed-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --bg: #121620; --bg2: #1b2130; --bg3: #252d40; --line: #343d55;
  --ink: #ecebe4; --dim: #a3a9b8; --soft: #c9c6bb;
  --gold: #e2b452; --gold2: #f0cf85; --red: #e0483b; --green: #63b47a; --blue: #4f7dff;
  --melee: #6f8de0; --ranged: #57b5a8; --siege: #c9934d; --violet: #b38cf0;
  --top: 64px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 12px); }
body { margin: 0; background: radial-gradient(ellipse at 50% 0%, #22304d 0%, var(--bg) 55%) fixed, var(--bg); color: var(--ink); font: 15px/1.5 Barlow, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
[hidden] { display: none !important; }
a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { font-family: "Barlow Condensed", Barlow, sans-serif; margin: 0; letter-spacing: .3px; }
p { margin: 6px 0; }
ul, ol { margin: 6px 0; padding-left: 20px; }
li { margin: 3px 0; }
.sub, .dim { color: var(--dim); font-size: 13px; }
button { font: inherit; color: var(--ink); background: var(--bg3); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
button:hover { border-color: var(--gold); }
button.on { border-color: var(--gold); color: var(--gold2); background: #3a3220; }

/* ------------------------------------------------------------------ the top -- */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; min-height: var(--top); padding: 8px 16px; background: rgba(18, 22, 32, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.home { flex: none; font: 800 16px/1 "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .6px; background: var(--gold); color: #2a2010; padding: 9px 14px; border-radius: 999px; }
.home:hover { background: var(--gold2); text-decoration: none; }
.crest { height: 44px; flex: none; }
.name { min-width: 0; flex: 1; }
.name h1 { font-size: 28px; font-weight: 800; color: var(--gold2); line-height: 1; text-shadow: 0 2px 0 #5a3d10; }
.name h1 span { color: var(--ink); font-weight: 700; }
.name p { margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#q { flex: 0 1 300px; min-width: 0; font: inherit; color: var(--ink); background: var(--bg3); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; }
#q:focus { outline: none; border-color: var(--gold); }

/* ------------------------------------------------------------------ the layout -- */
.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; max-width: 1320px; margin: 0 auto; padding: 16px; }
.toc { position: sticky; top: calc(var(--top) + 16px); align-self: start; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - var(--top) - 32px); overflow-y: auto; }
.toc a { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; border-radius: 10px; color: var(--soft); font-weight: 700; }
.toc a b { font: 800 13px/1 "Barlow Condensed", sans-serif; color: var(--dim); min-width: 16px; }
.toc a:hover { background: var(--bg2); text-decoration: none; }
.toc a.on { background: var(--bg3); color: var(--gold2); }
main { min-width: 0; }
.sec { margin-bottom: 34px; }
.sec > h2 { display: flex; align-items: center; gap: 10px; font-size: 30px; font-weight: 800; color: var(--gold2); text-transform: uppercase; margin: 6px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.sec > h2 .num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: #2a2010; font-size: 20px; }
.lead { font-size: 18px; color: var(--soft); }
h3.grp { font-size: 22px; color: var(--gold2); text-transform: uppercase; margin: 18px 0 8px; }
.box h3 { font-size: 20px; color: var(--gold2); margin: 2px 0 6px; }
.box h3 + ul, .box h3 + ol { margin-top: 0; }
.box, .entry.unit, .entry.hero, .entry.card, .entry.building { background: rgba(27, 33, 48, .92); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; min-width: 0; }
.cols2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.cols2 > .box, .cols2 > .entry { margin-bottom: 0; }
.cols2 + .box, .cols2 + .cols2, .box + .cols2 { margin-top: 12px; }
.cols2 { margin-bottom: 12px; }
ul.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.chip { display: inline-block; font: 700 11px/1 "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .5px; padding: 4px 7px; border-radius: 999px; background: var(--bg3); color: var(--soft); border: 1px solid var(--line); white-space: nowrap; }
.chip.melee { border-color: var(--melee); color: #b9c9f5; }
.chip.ranged { border-color: var(--ranged); color: #a9e2d9; }
.chip.siege { border-color: var(--siege); color: #ecc996; }
.chip.fly { border-color: var(--violet); color: #dccbfa; }
.chip.rare { border-color: var(--gold); color: var(--gold2); background: #3a3220; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0; }

/* ------------------------------------------------------------------ tables -- */
.tbl { overflow-x: auto; margin: 8px 0 2px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 700 12px/1.2 "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .5px; color: var(--dim); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
table.mini { font-size: 13px; }
table.mini td, table.mini th { padding: 3px 6px; }
table.prices td { line-height: 1.9; }
img.mini { height: 26px; width: 30px; object-fit: contain; vertical-align: middle; margin-right: 6px; }

/* ------------------------------------------------------------------ units, heroes, cards -- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 12px; margin-bottom: 12px; }
.cards-grid.narrow { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cards-grid.wide { grid-template-columns: minmax(0, 1fr); }
.cards-grid > .entry { margin-bottom: 0; }
.uh, .ch { display: flex; gap: 12px; align-items: center; }
.uh img { width: 84px; height: 84px; object-fit: contain; flex: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.hero .uh img { width: 110px; height: 110px; }
.uh h4, .ch h4 { font-size: 22px; line-height: 1.1; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px 10px; margin: 8px 0 4px; font-size: 14px; }
.stats dt { color: var(--dim); font: 700 11px/1.2 "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .4px; }
.stats dd { margin: 0; font-weight: 700; }
.stats dd small { display: block; font-weight: 500; font-size: 12px; color: var(--dim); }
.notes .shot { display: block; margin: 4px 0 2px; }
.notes .shot img { width: 100%; max-width: 230px; height: 40px; object-fit: contain; object-position: left center; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.notes { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--soft); }
.unit > p, .hero > p, .card > p, .building > p { color: var(--soft); font-size: 14px; }
.abilities { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 8px; }
.ability { display: flex; gap: 10px; background: var(--bg2); border-radius: 12px; padding: 10px; min-width: 0; }
.ability > div { min-width: 0; flex: 1; }
.ability img.fx { width: 70px; height: 70px; object-fit: contain; flex: none; }
.ability h5 { font-size: 18px; color: var(--gold2); }
.ability p { font-size: 13.5px; color: var(--soft); }
.ch .art { position: relative; flex: none; width: 64px; height: 64px; display: grid; place-items: center; background: radial-gradient(circle, #3a4360, var(--bg2) 70%); border-radius: 12px; }
.ch .art img { max-width: 52px; max-height: 52px; object-fit: contain; }
.ch .art img.who { position: absolute; right: -8px; bottom: -6px; width: 30px; height: 30px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .7)); }
.card.rare { border-color: var(--gold); box-shadow: 0 0 18px rgba(226, 180, 82, .25); }
table.tiers td:first-child { color: var(--dim); }
.card p.never { color: #f2a59e; font-size: 13px; }
.building .pics { display: flex; justify-content: center; align-items: flex-end; gap: 10px; height: 100px; margin-bottom: 6px; }
.building .pics img { max-height: 100px; max-width: 30%; object-fit: contain; }
.building h4 { font-size: 22px; }

/* ------------------------------------------------------------------ races -- */
.races { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.race { margin-bottom: 0; }
.rtop { display: flex; gap: 14px; align-items: center; }
.rtop > div { flex: 1; min-width: 0; }
.rtop img.castle { height: 74px; flex: none; }
.rtop img.tower { height: 74px; flex: none; }
.rtop h3 { font-size: 26px; }
.race .motto { font: 700 italic 15px/1.2 Barlow, sans-serif; color: var(--soft); margin: 0 0 2px; }
.race .key { font: 700 16px/1.2 "Barlow Condensed", sans-serif; color: var(--gold2); margin: 0; }
.roster { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.ru { display: flex; flex-direction: column; align-items: center; width: 92px; padding: 6px 4px; background: var(--bg2); border-radius: 10px; color: var(--ink); text-align: center; }
.ru:hover { text-decoration: none; background: var(--bg3); }
.ru img { width: 62px; height: 56px; object-fit: contain; }
.ru b { font: 700 14px/1.1 "Barlow Condensed", sans-serif; margin-top: 2px; }
.ru small { color: var(--dim); font-size: 11px; text-transform: uppercase; }
.ru.hero { box-shadow: inset 0 0 0 1px var(--gold); }

/* ------------------------------------------------------------------ boosts, options, tips -- */
.boost-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 8px; }
.boost { display: flex; gap: 10px; align-items: flex-start; background: var(--bg2); border-radius: 12px; padding: 10px; }
.boost img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.boost h4 { font-size: 18px; color: var(--gold2); }
.boost p { margin: 2px 0; font-size: 14px; }
dl.opts { margin: 0; }
dl.opts dt { font-weight: 700; color: var(--gold2); margin-top: 8px; }
dl.opts dd { margin: 0; color: var(--soft); font-size: 14px; }
details.box summary { cursor: pointer; }
details.box[open] summary { margin-bottom: 6px; }
ol.tips { counter-reset: tip; list-style: none; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
ol.tips li { counter-increment: tip; position: relative; background: rgba(27, 33, 48, .92); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 10px 46px; margin: 0; color: var(--soft); }
ol.tips li::before { content: counter(tip); position: absolute; left: 12px; top: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #2a2010; display: grid; place-items: center; font: 800 14px/1 "Barlow Condensed", sans-serif; }

/* ------------------------------------------------------------------ the maps -- */
.mappics { display: flex; gap: 8px; align-items: center; height: 96px; margin: 4px 0 8px; }
.mappics img { height: 100%; max-width: 34%; object-fit: cover; border-radius: 10px; }
.mappics img:not(:first-child) { object-fit: contain; }

table.buildings-art img.bpic { width: 64px; height: 52px; object-fit: contain; }
table.buildings-art td, table.buildings-art th { text-align: center; vertical-align: top; }
table.buildings-art td:nth-child(-n+3), table.buildings-art th:nth-child(-n+3) { text-align: left; }
table.buildings-art img.bpic { display: block; margin: 0 auto 2px; }
/* (the computer players' spending: one line a personality; on a phone the table scrolls sideways in its box) */
table.spending td { white-space: nowrap; }
.plotpics { display: flex; gap: 10px; margin: 4px 0 10px; }
.plotpics img { width: 30%; max-width: 140px; height: 80px; object-fit: contain; }

/* ------------------------------------------------------------------ balance testing -- */
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.cols3 > .box { margin-bottom: 0; }
.test h3 { display: flex; align-items: center; gap: 8px; }
.test .tn { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #2a2010; font-size: 16px; flex: none; }
.box code { font: 13px ui-monospace, Menlo, monospace; color: var(--soft); }

/* ------------------------------------------------------------------ the balance log -- */
.logbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
ul.log { list-style: none; padding: 0; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: rgba(27, 33, 48, .92); }
.log .line { display: grid; grid-template-columns: 148px 76px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 8px 12px; margin: 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.log .line:last-child { border-bottom: none; }
.log time { font: 700 15px/1.2 "Barlow Condensed", sans-serif; white-space: nowrap; color: var(--gold2); font-variant-numeric: tabular-nums; }
.log .chip { justify-self: start; }
.log code { font: 12px/1 ui-monospace, Menlo, monospace; color: var(--dim); }
.log .said { display: block; color: var(--dim); font-size: 13px; font-style: italic; }
.log .undone .what b { text-decoration: line-through; text-decoration-color: var(--red); }
.chip.tag-balance { border-color: var(--gold); color: var(--gold2); }
.chip.tag-new { border-color: var(--green); color: #a8dcb6; }
.chip.tag-rule { border-color: var(--blue); color: #b6c8ff; }
.chip.tag-look { border-color: var(--violet); color: #dccbfa; }
.chip.tag-revert { border-color: var(--red); color: #f2a59e; }
.chip.tag-admin { color: var(--dim); }

.recent ul.log { margin-top: 4px; }
.recent .line .said { display: none; }

/* ------------------------------------------------------------------ the search -- */
.searching .miss { display: none !important; }
.searching .cols2 { grid-template-columns: minmax(0, 1fr); }

/* ------------------------------------------------------------------ narrow screens and portrait -- */
@media (max-width: 900px) {
  :root { --top: 104px; }
  .top { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .crest { height: 34px; }
  .name h1 { font-size: 24px; }
  #q { flex: 1 1 100%; order: 5; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 0 12px 16px; gap: 0; }
  .toc { position: sticky; top: var(--top); z-index: 4; flex-direction: row; overflow-x: auto; max-height: none; margin: 0 -12px 12px; padding: 6px 12px; background: rgba(18, 22, 32, .96); border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .toc a { flex: none; padding: 5px 10px; font-size: 14px; white-space: nowrap; }
  html { scroll-padding-top: calc(var(--top) + 54px); }
  .cols2, .cols3, .abilities, ol.tips { grid-template-columns: minmax(0, 1fr); }
  ul.two { grid-template-columns: minmax(0, 1fr); }
  .sec > h2 { font-size: 24px; }
}
@media (max-width: 520px) {
  .cards-grid, .cards-grid.narrow, .boost-grid { grid-template-columns: minmax(0, 1fr); }
  .home span { display: none; }
  .name p { display: none; }
  :root { --top: 96px; }
  .log .line { grid-template-columns: auto minmax(0, 1fr); }
  .log .line .chip { grid-column: 2; grid-row: 1; }
  .log .line .what { grid-column: 1 / -1; }
  .log .line code { grid-column: 1 / -1; }
  .rtop img.castle { height: 52px; }
  .rtop img.tower { display: none; }
  .uh img { width: 68px; height: 68px; }
}
