/* The wiki: a sidebar of pages, an article, and canvases for the pictures (all drawn
   with the game's own renderer, so a unit here looks exactly as it does in a game). */

:root {
  --navy-0: #070c1a;
  --navy-1: #0e1730;
  --navy-2: #18264a;
  --royal: #24407e;
  --gold: #e0b24a;
  --gold-light: #f7dc8c;
  --gold-dark: #9a7224;
  --text: #efe6cf;
  --muted: #a9b1c7;
  --danger: #ff8a78;
  --ok: #8fe07a;
  --display: "Cinzel", Georgia, "Times New Roman", serif;
  --line: rgba(224, 178, 74, 0.22);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--navy-0);
  color: var(--text);
  font: 16px/1.65 Georgia, "Times New Roman", serif;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(80, 120, 210, 0.22) 0%, transparent 70%),
    linear-gradient(var(--navy-1), var(--navy-0) 600px);
  background-attachment: fixed;
}

a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(224, 178, 74, 0.35); }
a:hover { color: var(--gold-light); border-bottom-color: var(--gold-light); }
.hidden { display: none !important; }

/* ------------------------------------------------------------------- Header */

#top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  background: rgba(7, 12, 26, 0.94);
  border-bottom: 1px solid var(--line);
}
#top .brand { display: flex; align-items: center; gap: 10px; border: 0; }
#top .brand img { height: 34px; }
#top .brand span { font: 700 20px var(--display); color: var(--gold-light); letter-spacing: 0.06em; }
#top .play { margin-left: auto; font: 700 13px var(--display); letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 14px; border: 1px solid var(--gold-dark); border-radius: 4px; background: rgba(36, 64, 126, 0.5); }
#menu-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--gold); border-radius: 4px; font-size: 18px; padding: 2px 9px; cursor: pointer; }

.search { position: relative; margin-left: 20px; min-width: 0; }
.search input {
  width: 260px; max-width: 42vw; padding: 6px 10px;
  background: rgba(14, 23, 48, 0.9); color: var(--text);
  border: 1px solid var(--line); border-radius: 4px; font: 15px Georgia, serif;
}
.search input:focus { outline: none; border-color: var(--gold); }
#results {
  position: absolute; top: 110%; left: 0; width: 330px; max-width: 80vw; max-height: 60vh; overflow: auto;
  margin: 0; padding: 4px; list-style: none; z-index: 30;
  background: #0b1430; border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
#results li a { display: block; padding: 5px 9px; border: 0; color: var(--text); border-radius: 3px; }
#results li a:hover, #results li a.on { background: rgba(36, 64, 126, 0.65); color: var(--gold-light); }
#results .kind { float: right; color: var(--muted); font-size: 12px; }

/* --------------------------------------------------------------------- Body */

#shell { display: flex; align-items: flex-start; max-width: 1400px; margin: 0 auto; }

#nav {
  position: sticky; top: 51px;
  flex: 0 0 248px; max-height: calc(100vh - 51px); overflow: auto;
  padding: 18px 10px 40px 16px;
  border-right: 1px solid var(--line);
}
#nav h4 { margin: 18px 0 5px; font: 700 12px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-dark); }
#nav a { display: block; padding: 3px 8px; border: 0; border-radius: 3px; color: var(--text); font-size: 15px; }
#nav a:hover { background: rgba(36, 64, 126, 0.45); }
#nav a.on { background: rgba(224, 178, 74, 0.16); color: var(--gold-light); }
#nav .sub { margin-left: 10px; padding-left: 8px; border-left: 1px solid var(--line); }
#nav .sub a { font-size: 14px; color: var(--muted); }
#nav .sub a.on { color: var(--gold-light); }

#main { flex: 1 1 auto; min-width: 0; padding: 22px 34px 70px; }
#foot { margin-top: 48px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------ Article */

#page h1 { font: 900 38px/1.15 var(--display); color: var(--gold-light); margin: 0 0 4px; }
#page h2 { font: 700 24px var(--display); color: var(--gold); margin: 34px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
#page h3 { font: 700 18px var(--display); color: var(--gold-light); margin: 22px 0 4px; }
#page p, #page li { color: var(--text); }
#page .lede { font-size: 18px; color: var(--muted); margin-top: 0; }
#page ul, #page ol { padding-left: 22px; }
#page li { margin: 3px 0; }
#page code { background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; font-size: 14px; }
#page .crumb { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
#page .crumb a { color: var(--muted); }
.loading { color: var(--muted); }

/* A note or warning box */
.note { border-left: 3px solid var(--gold-dark); background: rgba(36, 64, 126, 0.25); padding: 8px 14px; margin: 16px 0; border-radius: 0 4px 4px 0; }
.note b { color: var(--gold-light); }

/* Tables of numbers */
table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 15px; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font: 700 13px var(--display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-dark); }
tbody th { font-weight: normal; color: var(--muted); width: 38%; }
table.stats tbody th { width: 46%; }
tr:hover td { background: rgba(255, 255, 255, 0.03); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Pictures: a canvas the renderer draws into, with a caption */
figure { margin: 0; text-align: center; }
figure figcaption { font-size: 13px; color: var(--muted); margin-top: 2px; }
/* The drawing is done at the size the page asked for, then shrunk to fit a narrow screen */
canvas.art { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.art-wrap { background: radial-gradient(ellipse at 50% 60%, rgba(60, 96, 170, 0.35), rgba(7, 12, 26, 0) 70%); border-radius: 6px; padding: 6px; }

/* The picture beside the opening paragraphs */
.infobox {
  float: right; width: 280px; margin: 0 0 18px 24px; padding: 10px;
  background: rgba(14, 23, 48, 0.85); border: 1px solid var(--line); border-radius: 6px;
}
.infobox h4 { margin: 0 0 6px; font: 700 14px var(--display); color: var(--gold-light); text-align: center; letter-spacing: 0.05em; }
.infobox table { margin: 8px 0 0; font-size: 14px; }
.infobox th, .infobox td { padding: 3px 6px; }

/* A grid of cards (the index pages) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; margin: 18px 0; }
.card {
  display: block; border: 1px solid var(--line); border-radius: 6px; padding: 10px;
  background: rgba(14, 23, 48, 0.6); color: var(--text);
}
.card:hover { border-color: var(--gold); background: rgba(36, 64, 126, 0.45); }
.card .card-name { font: 700 16px var(--display); color: var(--gold-light); text-align: center; margin-top: 6px; }
.card .card-sub { font-size: 13px; color: var(--muted); text-align: center; }
.card p { font-size: 14px; margin: 6px 0 0; color: var(--muted); }

/* A row of small pictures with labels */
.strip { display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0; }
.strip figure { width: 110px; }

@media (max-width: 900px) {
  #menu-toggle { display: block; }
  #nav { position: fixed; inset: 51px auto 0 0; width: 250px; background: #0a1226; z-index: 25; max-height: none; height: calc(100vh - 51px); transform: translateX(-100%); transition: transform 0.18s; }
  #nav.open { transform: none; }
  #main { padding: 18px 16px 60px; }
  .infobox { float: none; width: auto; margin: 0 0 18px; }
  #page h1 { font-size: 30px; }
  .search { margin-left: 6px; }
}

/* Phones: the header has to give way before the page does */
@media (max-width: 560px) {
  #top { gap: 8px; padding: 8px 10px; }
  #top .brand span { display: none; }
  #top .brand img { height: 28px; }
  #top .play { padding: 5px 9px; }
  .search input { width: 150px; }
  #page h1 { font-size: 26px; }
  #main { padding: 14px 12px 50px; }
}
