/* Wiki do Realms of Aldren — madeira escura, dourado e pergaminho, como o jogo.
   Fonte: tools/wiki/wiki.css (copiado pro site por tools/wiki/build-wiki.ts). */
@font-face {
  font-family: "Cinzel";
  src: url("/wiki/fonts/Cinzel-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
:root {
  --wood-0: #140c06;
  --wood-1: #22150b;
  --wood-2: #3a2512;
  --wood-3: #5a3a1c;
  --gold: #e0b050;
  --gold-2: #f3cf73;
  --gold-dim: #a57a2c;
  --parch: #f3e6c4;
  --parch-2: #e8d6a8;
  --parch-3: #dcc590;
  --ink: #2b1d0e;
  --ink-2: #5b4526;
  --line: #b89457;
  --red: #8f2a1a;
  --green: #3f6b22;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--wood-1);
  background-image:
    repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.18) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, var(--wood-2), var(--wood-0));
  background-attachment: fixed;
  font: 16px/1.55 Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  min-height: 100vh;
}
a { color: var(--red); }
a:hover { color: #b8452b; }
img { max-width: 100%; }
h1, h2, h3, .brand, .nav a, .card-title, summary {
  font-family: "Cinzel", Georgia, serif;
  letter-spacing: 0.02em;
}

/* ---------- topo ---------- */
.top {
  position: relative;
  z-index: 20;
  background: linear-gradient(180deg, #2c1c0d, #1a100733);
  background-color: #23160b;
  border-bottom: 2px solid var(--gold-dim);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.top-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-2);
  text-decoration: none;
  font-size: 17px;
  text-shadow: 0 2px 0 #000;
  margin-right: auto;
}
.brand img { width: 44px; height: auto; }
.brand small { display: block; font-size: 11px; color: var(--gold); letter-spacing: 0.2em; }
.lang {
  display: flex;
  gap: 4px;
}
.lang a {
  color: var(--parch-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 9px;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
}
.lang a[aria-current] { background: var(--gold); color: var(--wood-1); }
.search {
  flex: 1 1 100%;
  position: relative;
  order: 3;
}
.search input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--gold-dim);
  background: #140c06;
  color: var(--parch);
}
.search input::placeholder { color: #a8916a; }
.search input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--parch);
  border: 2px solid var(--gold-dim);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  max-height: 65vh;
  overflow: auto;
}
.results[hidden] { display: none; }
.results a {
  display: block;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}
.results a:hover, .results a:focus, .results a.active { background: var(--parch-3); }
.results strong { display: block; font-size: 15px; }
.results span { font-size: 12px; color: var(--ink-2); }
.results .empty { padding: 8px; color: var(--ink-2); font-size: 14px; }

/* navegação: fileira que rola no celular */
.nav {
  background: #1a1007;
  border-bottom: 1px solid #4a3218;
}
.nav ul {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6px 12px;
  list-style: none;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.nav li { flex: 0 0 auto; }
.nav a {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  color: var(--parch-2);
  text-decoration: none;
  font-size: 12.5px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.nav a img { width: 20px; height: 20px; object-fit: contain; }
.nav a:hover { border-color: var(--gold-dim); color: var(--gold-2); }
.nav a[aria-current] { background: var(--wood-3); border-color: var(--gold); color: var(--gold-2); }

/* ---------- conteúdo ---------- */
main {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 0 12px 24px;
}
.page {
  background: var(--parch);
  background-image: radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(150, 105, 40, 0.18), transparent 55%);
  border: 3px solid var(--wood-3);
  outline: 1px solid var(--gold-dim);
  outline-offset: -8px;
  border-radius: 14px;
  padding: 20px 16px 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
h1 {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.2;
  color: var(--wood-2);
  display: flex;
  align-items: center;
  gap: 10px;
}
h1 img { width: 44px; height: 44px; object-fit: contain; }
.lead { font-size: 17px; color: var(--ink-2); margin: 4px 0 14px; }
h2 {
  font-size: 21px;
  color: var(--wood-2);
  margin: 30px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
  scroll-margin-top: 12px;
}
.h-ico { width: 30px; height: 30px; object-fit: contain; vertical-align: -6px; margin-right: 8px; }
h3 .h-ico { width: 24px; height: 24px; vertical-align: -5px; }
h3 { font-size: 17px; color: var(--wood-3); margin: 20px 0 8px; scroll-margin-top: 12px; }
section { scroll-margin-top: 12px; }
p { margin: 8px 0; }
ul.plain { padding-left: 20px; margin: 8px 0; }
ul.plain li { margin: 3px 0; }
.toc {
  background: var(--parch-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 12px 0 6px;
}
.toc strong { font-family: "Cinzel", Georgia, serif; font-size: 13px; color: var(--wood-3); }
.toc ol { margin: 6px 0 0; padding-left: 20px; columns: 2 200px; column-gap: 20px; font-size: 14.5px; }
.note {
  background: #fff3cf;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 10px 0;
  font-size: 15px;
}
.soon {
  display: inline-block;
  font-family: "Cinzel", Georgia, serif;
  font-size: 11px;
  background: var(--wood-2);
  color: var(--gold-2);
  border-radius: 999px;
  padding: 2px 9px;
  vertical-align: middle;
  white-space: nowrap;
}
.muted { color: var(--ink-2); font-size: 14px; }

/* cartões (lista de prédios, heróis, páginas) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  background: var(--parch-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 8px;
  color: var(--ink);
  text-decoration: none;
}
a.card:hover { background: var(--parch-3); border-color: var(--wood-3); }
.card img { width: 72px; height: 72px; object-fit: contain; }
.card-title { font-size: 14px; color: var(--wood-2); }
.card small { color: var(--ink-2); font-size: 12.5px; line-height: 1.35; }

.item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin: 14px 0;
  scroll-margin-top: 12px;
}
.item > .pic { display: flex; flex-direction: row; justify-content: center; align-items: flex-end; gap: 10px; }
.item > .pic img { width: 96px; height: 96px; object-fit: contain; }
.item > .pic .small { width: 56px; height: 56px; opacity: 0.95; }
.item h3 { margin-top: 0; }
.item .body { min-width: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.tag {
  font-size: 12.5px;
  background: var(--parch-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 9px;
}

/* tabelas */
.table-wrap { overflow-x: auto; margin: 10px 0; border-radius: 10px; border: 1px solid var(--line); background: #fbf3de; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 6px 9px; border-bottom: 1px solid #e0cc9c; text-align: left; vertical-align: top; }
th { background: var(--wood-2); color: var(--gold-2); font-family: "Cinzel", Georgia, serif; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
tbody tr:nth-child(even) td { background: rgba(220, 197, 144, 0.28); }
td { white-space: nowrap; }
td.wrap { white-space: normal; min-width: 200px; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }
.res { display: inline-flex; align-items: center; gap: 3px; margin: 1px 8px 1px 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.res img { width: 18px; height: 18px; object-fit: contain; }
.ico { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; }
.ico.gear-art { width: 40px; height: 40px; margin-right: 4px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }
.ico-lg { width: 40px; height: 40px; object-fit: contain; vertical-align: middle; }

details {
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.25);
}
summary {
  cursor: pointer;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--wood-3);
}
details[open] > summary { border-bottom: 1px solid var(--line); }
details > .table-wrap { margin: 8px; }
details > p, details > ul { margin: 8px 12px; }

.faq dt { font-weight: 700; margin-top: 14px; color: var(--wood-2); }
.faq dd { margin: 4px 0 0 0; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 8px 10px 8px 46px;
  margin: 8px 0;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 10px;
  top: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--wood-2);
  color: var(--gold-2);
  font-family: "Cinzel", Georgia, serif;
  font-size: 13px;
  display: grid;
  place-items: center;
}

.hero-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-banner img { width: 150px; height: auto; }
.hero-banner div { flex: 1 1 260px; }

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px 30px;
  color: #bca77e;
  font-size: 13px;
  text-align: center;
}
footer a { color: var(--gold-2); }

@media (min-width: 720px) {
  /* No celular o topo rola junto (sobra tela pra ler); no computador fica preso em cima. */
  .top { position: sticky; top: 0; }
  h2, h3, section, .item, .faq dt { scroll-margin-top: 150px; }
  .search { flex: 0 1 320px; order: 0; }
  .page { padding: 28px 32px 36px; }
  h1 { font-size: 32px; }
  .item { grid-template-columns: 120px 1fr; }
  .item > .pic { flex-direction: column; align-items: center; justify-content: flex-start; }
  .item > .pic img { width: 120px; height: 120px; }
}
@media (min-width: 1000px) {
  .nav ul { flex-wrap: wrap; overflow: visible; }
}
@media print {
  .top, .nav, footer { display: none; }
  body { background: #fff; }
  .page { box-shadow: none; border: 0; outline: 0; }
}
/* Raridade das peças de equipamento (mesmas cores do jogo: gearSlotIcons.tsx). */
.rar { display: inline-block; padding: 1px 6px; margin: 1px 0; border-radius: 4px; font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; }
.rar-common { background: #8a8a7a; }
.rar-uncommon { background: #4f9a3c; }
.rar-rare { background: #3f7fc6; }
.rar-epic { background: #9a4ecb; }
.rar-legendary { background: #c98a22; }
.rar-mythic { background: #d0402e; }

/* História de Aldren (27/10/2026): ilustração larga em cima de cada parte */
.lore-pic { display: block; width: 100%; max-width: 900px; height: auto; margin: 6px 0 14px; border-radius: 10px; border: 2px solid rgba(201, 151, 63, 0.55); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
