/* MORE THAN ENOUGH wiki: the game's palette, tuned for long reading. */

:root {
  color-scheme: dark;
  --bg: #0a0e0b;
  --panel: #111813;
  --line: rgba(255, 255, 255, 0.09);
  --ink: #e6efe3;
  --ink-dim: #9aab97;
  --green: #7fd07a;
  --gold: #e8d9a8;
  --code: #1a231c;
}

* { box-sizing: border-box; }

html { scroll-padding-top: 16px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--green); }
a:hover { color: #a6e8a1; }

.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  max-width: 1120px;
  margin: 0 auto;
  min-height: 100vh;
}

/* ------------------------------------------------------------- sidebar */

nav {
  position: sticky; top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 16px;
  border-right: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--gold); font-weight: 800; letter-spacing: 0.06em; text-decoration: none; }
.brand img { border-radius: 7px; }
.version { color: var(--ink-dim); font-size: 12px; }

#search {
  width: 100%;
  margin: 16px 0 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font: inherit; font-size: 14px;
}

#toc { list-style: none; margin: 0; padding: 0; }
#toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink-dim);
  font-size: 14.5px;
  text-decoration: none;
}
#toc a:hover { color: var(--ink); background: rgba(255,255,255,0.04); }
#toc a[aria-current="page"] { color: var(--ink); background: rgba(80,130,90,0.3); }
/* Getting into the game is never more than a tap away: a big button at the
   top of the sidebar on desktop, a floating one on phones, and one on Home. */
.play, .play-hero {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: 12px;
  background: var(--green); color: #0b1a0d;
  font-weight: 800; font-size: 15px; text-decoration: none;
  box-shadow: 0 4px 14px rgba(127, 208, 122, 0.25);
}
.play { margin: 14px 0 4px; }
.play:hover, .play-hero:hover { background: #9fe39a; color: #0b1a0d; }
.play-hero { display: inline-flex; margin-top: 6px; font-size: 16px; padding: 13px 22px; }
/* The language switch: the wiki reloads in the next language. */
.language {
  width: 100%; margin: 10px 0 0; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--ink);
  font: inherit; font-size: 14px; cursor: pointer;
}
.language:hover { border-color: var(--green); }

/* ------------------------------------------------------------- articles */

main { padding: 32px 40px 80px; min-width: 0; }

article { max-width: 760px; }
article[hidden] { display: none; }

h1 { margin: 0 0 6px; font-size: 32px; line-height: 1.2; }
h2 { margin: 36px 0 8px; font-size: 21px; color: var(--gold); }
h3 { margin: 24px 0 6px; font-size: 17px; }
.lede { margin-top: 0; color: var(--ink-dim); font-size: 17px; }

kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--code);
  font: 13px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.note {
  margin: 18px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--green);
  border-radius: 0 10px 10px 0;
  background: var(--panel);
}

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; padding: 0; list-style: none; }
.cards a {
  display: block; height: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
}
.cards a:hover { border-color: rgba(127,208,122,0.5); }
.cards strong { display: block; color: var(--gold); }
.cards span { color: var(--ink-dim); font-size: 14px; }

/* ---------------------------------------------------------------- ideas */

.note-ideas { border-left-color: var(--gold); }
.area-blurb { margin-top: 0; color: var(--ink-dim); }
.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 0; list-style: none; }
.idea {
  padding: 12px 14px;
  border: 1px dashed rgba(232, 217, 168, 0.28);
  border-radius: 12px;
  background: var(--panel);
}
.idea p { margin: 6px 0 0; font-size: 14.5px; }
.idea .builds { color: var(--ink-dim); font-size: 13px; }
.idea-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.idea-head strong { color: var(--gold); }
.size {
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.06); color: var(--ink-dim);
}
.size-small { color: #9fe08a; }
.size-medium { color: #e8d9a8; }
.size-large { color: #f0a868; }
.size-huge { color: #f08a8a; }

/* --------------------------------------------------------------- tables */

.table { overflow-x: auto; margin: 12px 0 20px; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--ink-dim); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; background: var(--panel); }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --------------------------------------------------------------- phones */

@media (max-width: 760px) {
  .layout { display: block; }
  nav {
    position: static; height: auto;
    padding: 16px;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  #toc { display: flex; flex-wrap: wrap; gap: 4px; }
  /* On phones the play button floats in reach of the thumb on every page. */
  .play {
    position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 20;
    margin: 0; border-radius: 999px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  }

  #toc a { padding: 5px 9px; font-size: 13.5px; background: var(--panel); }
  main { padding: 20px 16px 96px; } /* room for the floating play button */
  h1 { font-size: 26px; }
}

/* ------------------------------------------------------------- pictures */

/* Pictures from the default texture pack, inline with text. */
.pic { width: 1.35em; height: 1.35em; object-fit: contain; vertical-align: -0.32em; }
h3 .pic { width: 1.6em; height: 1.6em; }

/* Everything in the game: one card per thing, its pictures on the left. */
.count { color: var(--ink-dim); }
.things { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; padding: 0; list-style: none; }
.thing {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,0.02);
}
.thing-pics {
  flex: 0 0 104px; display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-end;
  padding: 6px; border-radius: 10px; background: #1b2018;
}
.slotpics { display: flex; flex-wrap: wrap; gap: 3px; align-items: flex-end; }
.thumb { width: 44px; height: 44px; object-fit: contain; }
.thumb-top, .thumb-face { width: 30px; height: 30px; border-radius: 3px; }
.thumb-face { height: 15px; }
.thumb-cut { width: 30px; height: 30px; }
.swatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.25); }
.thing-text { min-width: 0; }
.thing-text p { margin: 4px 0 0; font-size: 14px; }
.thing-head strong { color: var(--gold); }
.thing-id { font-size: 12px; color: var(--ink-dim); }
.thing-slots { color: var(--ink-dim); font-size: 13px; }
code.req { font-weight: 800; color: var(--ink); }

/* Stockpile piles in the tiers table. */
img.pile { height: 44px; max-width: 70px; object-fit: contain; vertical-align: bottom; }

.button {
  padding: 10px 16px; border-radius: 10px; border: 1px solid rgba(127,208,122,0.5);
  background: rgba(127,208,122,0.12); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer;
}
.button:disabled { opacity: 0.5; }
.error { color: #ff9b8a; }
.note.error { border-left-color: #ff5a5a; }
pre { overflow-x: auto; padding: 12px; border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); font-size: 13px; }
.thumb-tiers { width: 30px; height: 30px; }

/* --------------------------------------------------------------- search */

#results { max-width: 760px; }
.hit-group h2 a { color: var(--gold); text-decoration: none; }
.hit-count {
  margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.07); color: var(--ink-dim); font-size: 12.5px; vertical-align: 2px;
}
.hits { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hits a {
  display: block; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  color: var(--ink); text-decoration: none;
}
.hits a:hover { border-color: rgba(127,208,122,0.5); }
.where { display: block; color: var(--ink-dim); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.snip { display: block; font-size: 14.5px; }
mark { padding: 0 2px; border-radius: 3px; background: rgba(232, 217, 168, 0.85); color: #12160f; }
.flash { animation: flash 2.4s ease-out; border-radius: 6px; }
@keyframes flash { 0%, 30% { background: rgba(127, 208, 122, 0.28); } 100% { background: transparent; } }
@media (max-width: 760px) { body.searching #toc { display: none; } }

/* --------------------------------------------------------------- prices */

/* One pill per resource: its picture, then its amount. */
.cost { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.amt {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 9px 1px 4px;
  border: 1px solid color-mix(in srgb, var(--res, #fff) 50%, transparent); border-radius: 999px;
  background: color-mix(in srgb, var(--res, #fff) 10%, transparent);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.amt .pic { width: 1.25em; height: 1.25em; vertical-align: 0; }
