/* Wiki MC Macaco — tema escuro por padrão, claro pelo sistema ou pelo botão */
:root {
  --bg: #121519;
  --painel: #1a1e24;
  --painel2: #20252d;
  --borda: #2c323c;
  --texto: #e4e6ea;
  --sub: #9aa3ae;
  --link: #79c0ff;
  --verde: #6cc070;
  --ouro: #e6b450;
  --vermelho: #e5534b;
  --slot: #8b8b8b;
  --slot-claro: #c6c6c6;
  --slot-escuro: #373737;
  --kbd: #2a3039;
  --sombra: 0 1px 2px rgba(0,0,0,.35);
  --larg: 860px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f2ec; --painel: #ffffff; --painel2: #f0ece4; --borda: #ddd6ca; --texto: #1f2328; --sub: #5f6873;
    --link: #0b62c4; --verde: #2e7d32; --ouro: #9a6700; --vermelho: #c62828; --kbd: #eceae4;
    --sombra: 0 1px 2px rgba(0,0,0,.08); color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f2ec; --painel: #ffffff; --painel2: #f0ece4; --borda: #ddd6ca; --texto: #1f2328; --sub: #5f6873;
  --link: #0b62c4; --verde: #2e7d32; --ouro: #9a6700; --vermelho: #c62828; --kbd: #eceae4;
  --sombra: 0 1px 2px rgba(0,0,0,.08); color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--texto);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img.px, .px { image-rendering: pixelated; image-rendering: crisp-edges; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .9em; }
code { background: var(--painel2); padding: .1em .35em; border-radius: 4px; border: 1px solid var(--borda); }
kbd {
  display: inline-block; min-width: 1.8em; text-align: center; padding: .05em .45em; margin: 0 .1em;
  background: var(--kbd); border: 1px solid var(--borda); border-bottom-width: 3px; border-radius: 5px; line-height: 1.4;
}

/* topo */
.topo {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  height: 58px; padding: 0 16px; background: var(--painel); border-bottom: 1px solid var(--borda);
}
.logo { display: flex; align-items: center; gap: 9px; color: var(--texto); font-weight: 700; font-size: 18px; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo em { font-style: normal; color: var(--verde); font-weight: 600; }
.busca { position: relative; flex: 1; max-width: 560px; margin-left: auto; }
.busca input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--borda);
  background: var(--bg); color: var(--texto); font-size: 15px;
}
.busca input:focus { outline: 2px solid var(--link); outline-offset: -1px; }
.busca-res {
  display: none; position: absolute; top: 44px; left: 0; right: 0; max-height: 70vh; overflow: auto;
  background: var(--painel); border: 1px solid var(--borda); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.busca-res.on { display: block; }
.busca-res a { display: flex; gap: 10px; align-items: center; padding: 8px 12px; color: var(--texto); border-bottom: 1px solid var(--borda); }
.busca-res a:last-child { border-bottom: 0; }
.busca-res a.sel, .busca-res a:hover { background: var(--painel2); text-decoration: none; }
.busca-res img { width: 28px; height: 28px; image-rendering: pixelated; flex: none; }
.busca-res .r-t { font-weight: 600; }
.busca-res .r-s { font-size: 12px; color: var(--sub); }
.busca-res .r-x { font-size: 13px; color: var(--sub); }
.busca-res .vazio { padding: 12px; color: var(--sub); }
.btn-tema, .btn-menu {
  flex: none; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--borda); background: var(--bg);
  color: var(--texto); cursor: pointer;
}
.btn-tema::before { content: "◐"; font-size: 18px; }
.btn-menu { display: none; flex-direction: column; justify-content: center; gap: 4px; padding: 0 9px; }
.btn-menu span { display: block; height: 2px; background: var(--texto); border-radius: 2px; }

/* layout */
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 230px; gap: 0; max-width: 1480px; margin: 0 auto; }
.lateral {
  position: sticky; top: 58px; height: calc(100vh - 58px); overflow-y: auto; padding: 18px 10px 40px 16px;
  border-right: 1px solid var(--borda);
}
.nav-sec { margin-bottom: 16px; }
.nav-tit { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--sub); font-weight: 700; margin: 0 0 4px 4px; }
.nav-tit img { width: 20px; height: 20px; }
.lateral ul { list-style: none; margin: 0; padding: 0; }
.lateral li a { display: block; padding: 4px 10px; border-radius: 6px; color: var(--texto); font-size: 15px; }
.lateral li a:hover { background: var(--painel2); text-decoration: none; }
.lateral li a[aria-current="page"] { background: var(--painel2); color: var(--verde); font-weight: 600; box-shadow: inset 3px 0 0 var(--verde); }
.conteudo { padding: 20px 40px 60px; min-width: 0; }
.conteudo article { max-width: var(--larg); }
.trilha { font-size: 13px; color: var(--sub); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.lado-dir { position: sticky; top: 58px; height: calc(100vh - 58px); overflow-y: auto; padding: 24px 16px; }
.toc-tit { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--sub); font-weight: 700; margin-bottom: 6px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--borda); }
.toc li a { display: block; padding: 3px 0 3px 12px; font-size: 13.5px; color: var(--sub); }
.toc li.t3 a { padding-left: 24px; font-size: 13px; }
.toc li a:hover { color: var(--texto); text-decoration: none; }
.toc li a.ativo { color: var(--verde); box-shadow: -1px 0 0 var(--verde); }

/* texto */
h1 { font-size: 2.1rem; line-height: 1.2; margin: 0 0 18px; }
h2 { font-size: 1.5rem; margin: 2.1em 0 .6em; padding-bottom: 6px; border-bottom: 1px solid var(--borda); }
h3 { font-size: 1.18rem; margin: 1.6em 0 .5em; }
h4 { font-size: 1rem; margin: 1.3em 0 .4em; color: var(--sub); text-transform: uppercase; letter-spacing: .04em; }
p, ul, ol { margin: .6em 0 .9em; }
li { margin: .25em 0; }
li > ul, li > ol { margin: .2em 0; }
strong, b { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--borda); margin: 2em 0; }
.sub, small { color: var(--sub); }
.lead { font-size: 1.12rem; color: var(--texto); }
.headerlink { opacity: 0; margin-left: .3em; }
h2:hover .headerlink, h3:hover .headerlink { opacity: .6; }

/* tabelas */
table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 15px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--borda); vertical-align: top; }
thead th { background: var(--painel2); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--sub); }
.tabela { overflow-x: auto; }
table.feiticos td:nth-child(2) { text-align: center; width: 56px; }
table.feiticos td:last-child { width: 170px; font-size: 13.5px; }

/* item inline */
.it { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; vertical-align: -6px; }
.it img.ic { width: 24px; height: 24px; }
a.it span { text-decoration: none; }
a.it:hover span { text-decoration: underline; }
.ic-falta { display: inline-block; background: var(--painel2); border-radius: 3px; }
.mobl { display: inline-flex; align-items: center; gap: 4px; vertical-align: -6px; white-space: nowrap; }
.mobl img.mini { width: 26px; height: 26px; object-fit: contain; }
.feit { font-weight: 600; }
.esc-arcano { color: #c58af9; } .esc-fogo { color: #ff8a3d; } .esc-gelo { color: #6fd3ff; } .esc-cura { color: #f5d76e; }
.esc-raio { color: #8ec5ff; } .esc-alma { color: #7ee0c3; } .esc-fisico { color: var(--texto); }
.esc { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: currentColor; }
span.esc.esc-arcano { background: #c58af9; } span.esc.esc-fogo { background: #ff8a3d; } span.esc.esc-gelo { background: #6fd3ff; }
span.esc.esc-cura { background: #f5d76e; } span.esc.esc-fisico { background: var(--sub); } span.esc.esc-alma { background: #7ee0c3; }
.enc { color: #b392f0; font-weight: 600; }

/* fabricação estilo inventário */
.receitas { display: flex; flex-wrap: wrap; gap: 14px; margin: 1em 0; }
.receita {
  background: #c6c6c6; color: #3f3f3f; border-radius: 4px; padding: 8px 10px 10px;
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #555, var(--sombra);
}
.rec-tit { font-size: 12px; font-weight: 700; margin-bottom: 6px; color: #3f3f3f; }
.rec-corpo { display: flex; align-items: center; gap: 10px; }
.grade { display: grid; gap: 0; }
.grade.g3 { grid-template-columns: repeat(3, 36px); }
.grade.g1 { grid-template-columns: 36px; gap: 6px; }
.grade.g3l { grid-template-columns: repeat(3, 36px); gap: 6px; }
.slot {
  position: relative; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  background: var(--slot); box-shadow: inset 2px 2px 0 var(--slot-escuro), inset -2px -2px 0 #fff;
}
.slot img.ic { width: 32px; height: 32px; }
.slot.res { width: 48px; height: 48px; }
.slot.res img.ic { width: 40px; height: 40px; }
.slot .qtd { position: absolute; right: 2px; bottom: 0; font: 700 13px/1 system-ui, sans-serif; color: #fff; text-shadow: 1px 1px 0 #3f3f3f; }
.slot .mais { position: absolute; left: 2px; top: 0; font: 700 11px/1 system-ui, sans-serif; color: #fff; text-shadow: 1px 1px 0 #3f3f3f; }
.seta { flex: none; }
.fogo { width: 36px; height: 20px; display: block; background: radial-gradient(circle at 50% 80%, #ff9b2f, #c4380b 55%, transparent 60%); }

/* fichas de mob */
.ficha {
  float: right; clear: right; width: 300px; margin: 0 0 18px 24px; background: var(--painel); border: 1px solid var(--borda);
  border-radius: 10px; overflow: hidden; box-shadow: var(--sombra);
}
.ficha-tit { padding: 10px 14px 0; font-weight: 700; font-size: 18px; }
.ficha-en { padding: 0 14px; color: var(--sub); font-size: 13px; }
.item-cab .ficha-en { padding: 0; }
.ficha-img { display: flex; justify-content: center; align-items: center; min-height: 140px; padding: 10px;
  background: radial-gradient(circle at 50% 60%, var(--painel2), var(--painel)); }
.mob-img { max-width: 100%; max-height: 230px; }
.ficha table { margin: 0; font-size: 14px; }
.ficha th { width: 34%; color: var(--sub); font-weight: 600; }
.ficha td, .ficha th { padding: 6px 12px; }
.ficha ul.drops { list-style: none; padding: 0; margin: 0; }
.ficha ul.drops li { margin: 2px 0; }
.cor { display: inline-block; width: 13px; height: 12px; vertical-align: -1px;
  background: #e5534b; clip-path: polygon(50% 100%, 0 40%, 10% 8%, 30% 0, 50% 18%, 70% 0, 90% 8%, 100% 40%); }
.limpa { clear: both; }
h2, h3 { clear: none; }

/* cartões de item e grade */
.itens { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 1em 0; }
.itens .cel { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--painel); border: 1px solid var(--borda);
  border-radius: 8px; color: var(--texto); font-size: 14px; line-height: 1.25; }
.itens .cel:hover { border-color: var(--link); text-decoration: none; }
.itens .cel img { width: 40px; height: 40px; flex: none; }
.cards { margin-top: 2em; }
.item-card { background: var(--painel); border: 1px solid var(--borda); border-radius: 10px; padding: 14px 16px; margin: 0 0 14px; }
.item-card:target { outline: 2px solid var(--verde); }
.item-cab { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.item-cab img { width: 48px; height: 48px; }
.item-nome { font-weight: 700; font-size: 17px; }
.item-card p { margin: .3em 0; font-size: 15px; }

/* avisos */
.admonition { border: 1px solid var(--borda); border-left: 4px solid var(--link); background: var(--painel); border-radius: 8px; padding: 10px 14px; margin: 1.2em 0; }
.admonition-title { font-weight: 700; margin: 0 0 .3em; }
.admonition.importante, .admonition.warning { border-left-color: var(--ouro); }
.admonition.perigo, .admonition.danger { border-left-color: var(--vermelho); }
.admonition.dica, .admonition.tip { border-left-color: var(--verde); }
.admonition p:last-child { margin-bottom: 0; }
.aviso { color: var(--vermelho); }
.passos { counter-reset: p; list-style: none; padding-left: 0; }
.cartoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 1.2em 0; }
.cartoes a { display: block; padding: 14px; background: var(--painel); border: 1px solid var(--borda); border-radius: 10px; color: var(--texto); }
.cartoes a:hover { border-color: var(--verde); text-decoration: none; }
.cartoes b { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cartoes span { color: var(--sub); font-size: 14px; }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 1em 0; }
.galeria figure { margin: 0; background: var(--painel); border: 1px solid var(--borda); border-radius: 10px; padding: 8px; text-align: center; }
.galeria img { max-width: 100%; height: 120px; object-fit: contain; }
.galeria figcaption { font-size: 13px; }

.rodape { max-width: var(--larg); margin-top: 60px; padding-top: 16px; border-top: 1px solid var(--borda); color: var(--sub); font-size: 13px; }
.rodape div { margin: 4px 0; }

/* responsivo */
@media (max-width: 1240px) {
  .layout { grid-template-columns: 250px minmax(0, 1fr); }
  .lado-dir { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .btn-menu { display: flex; }
  .lateral {
    position: fixed; top: 58px; left: 0; bottom: 0; width: 84vw; max-width: 320px; height: auto; z-index: 30;
    background: var(--painel); transform: translateX(-102%); transition: transform .18s ease; box-shadow: 4px 0 18px rgba(0,0,0,.4);
  }
  body.menu .lateral { transform: none; }
  .conteudo { padding: 16px 16px 50px; }
  .logo span { display: none; }
  .ficha { float: none; width: 100%; margin: 1em 0; }
  h1 { font-size: 1.7rem; }
  .busca input::placeholder { font-size: 13px; }
}

/* atributos de equipamento */
ul.stats { list-style: none; padding: 0; margin: .4em 0; font-size: 14.5px; }
ul.stats li { margin: 1px 0; color: #5b9cf5; }
ul.stats li:first-child { color: var(--texto); }
table.equip td:nth-child(2), table.equip td:nth-child(3) { white-space: nowrap; }
table.equip td:last-child { font-size: 14px; color: #5b9cf5; }
table.equip tr.total td { background: var(--painel2); }
