/* PROJETO EXILE: wiki. Mesmo visual da landing (escuro e dourado), sem frameworks nem recursos externos. */
:root {
	--bg: #0b0b0f;
	--bg2: #111118;
	--panel: #16161d;
	--panel2: #1c1c25;
	--line: #2a2833;
	--gold: #ffd980;
	--gold2: #b8913f;
	--gold3: #7a5a22;
	--text: #e8e6f0;
	--muted: #a8a4b8;
	--ok: #4fd18b;
	--bad: #ff6b6b;
	--magic: #8aa0ff;
	--rare: #ffe066;
	--unique: #ff8c26;
	--radius: 12px;
	--display: "Bahnschrift", "DIN Alternate", "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
	--body: "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 120px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.2; margin: 0; }
p { margin: 0 0 .7em; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #000; padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; font: 700 1rem/1 var(--display); letter-spacing: .04em;
	padding: .7em 1.2em; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn-gold { background: linear-gradient(180deg, #ffe39e, #e0a948); color: #1a1205; border-color: #ffe7a8; }
.btn-gold:hover { box-shadow: 0 0 18px rgba(255, 200, 90, .35); }
.btn-sm { padding: .5em 1em; font-size: .9rem; }

/* ---------- topo ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(11, 11, 15, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 14px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--gold); font: 700 1.05rem/1 var(--display); letter-spacing: .08em; text-decoration: none !important; }
.brand img { border-radius: 6px; }
.wiki-badge { font: 700 .8rem/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: #1a1205; background: var(--gold2);
	padding: .35em .6em; border-radius: 6px; text-decoration: none !important; }
.topbar .btn { margin-left: auto; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text); font-size: 1.2rem; border-radius: 8px; padding: .25em .6em; cursor: pointer; }
.wiki-nav { border-top: 1px solid var(--line); background: rgba(17, 17, 24, .9); }
.wiki-nav .wrap { display: flex; flex-wrap: wrap; gap: 2px 4px; padding: 6px 0; }
.wiki-nav a { color: var(--muted); padding: .3em .65em; border-radius: 6px; font: 600 .9rem/1.4 var(--display); letter-spacing: .02em; }
.wiki-nav a:hover { color: var(--gold); background: var(--panel); text-decoration: none; }
.wiki-nav a[aria-current="page"] { color: #1a1205; background: var(--gold); }
@media (max-width: 760px) {
	.nav-toggle { display: inline-block; }
	.nav-toggle + .btn { margin-left: 0; }
	.brand span { display: none; }
	.wiki-nav { display: none; }
	.wiki-nav.open { display: block; }
	.wiki-nav .wrap { flex-direction: column; }
	.wiki-nav a { padding: .55em .6em; font-size: 1rem; }
}

/* ---------- conteúdo ---------- */
.wiki-main { padding: 18px 0 48px; min-height: 70vh; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.crumbs span { margin: 0 .3em; opacity: .6; }
.page-title { font-size: clamp(1.6rem, 4vw, 2.3rem); color: var(--gold); letter-spacing: .02em; }
.lead { color: var(--muted); max-width: 900px; margin: 6px 0 16px; }
.note { color: var(--muted); font-size: .88rem; margin-top: 18px; }
.loading { color: var(--muted); padding: 30px 0; }
h2.sec { font-size: 1.35rem; color: var(--gold); margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
h3.sub { font-size: 1.08rem; color: #f3e2b5; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }

/* ---------- filtros ---------- */
.tools { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 8px 0 14px; position: sticky; top: 96px; z-index: 20;
	background: rgba(11, 11, 15, .95); padding: 8px 0; border-bottom: 1px solid transparent; }
.tools:empty { display: none; }
.tools input[type="search"], .tools input[type="number"], .tools select, .search-all input {
	background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: .5em .7em; font: inherit; min-height: 38px; }
.tools input[type="search"] { flex: 1 1 240px; min-width: 180px; }
.tools input[type="number"] { width: 84px; }
.tools select { max-width: 220px; }
.tools input:focus, .tools select:focus, .search-all input:focus { border-color: var(--gold2); outline: none; }
.tools label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .88rem; }
.tools .count { color: var(--muted); font-size: .85rem; margin-left: auto; }
.chipset { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { background: var(--panel); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: .25em .7em; font-size: .82rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--gold); color: #1a1205; border-color: var(--gold); }
@media (max-width: 760px) { .tools { position: static; } .tools select { max-width: 48%; } }
@media (max-width: 520px) {
	.dex { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
	.mon { padding: 6px 4px; }
	.mon .spr { height: 58px; }
	.mon img { max-height: 58px; }
	.mon .nm { font-size: .85rem; }
	.type { font-size: .66rem; padding: .05em .4em; }
	.grid { grid-template-columns: 1fr; }
}

/* ---------- tipos, raridades ---------- */
.type { display: inline-block; padding: .08em .55em; border-radius: 5px; font: 700 .74rem/1.5 var(--display); letter-spacing: .04em; text-transform: uppercase;
	color: #111; text-shadow: 0 1px 0 rgba(255, 255, 255, .25); margin: 1px 2px 1px 0; }
.tag { display: inline-block; background: #24222d; border: 1px solid var(--line); color: var(--muted); border-radius: 5px; padding: 0 .45em; font-size: .76rem; margin: 1px 2px 1px 0; }
.tag.gold { color: var(--gold); border-color: var(--gold3); }
.tag.leg { color: #ffb3f0; border-color: #6b3a63; }
.tag.myt { color: #9ff3ff; border-color: #2b5f66; }
.pre { color: #a9c6ff; }
.suf { color: #ffcf8a; }
.uq { color: var(--unique); }
.mod { color: #b9c8ff; }
.imp { color: #e6dcc0; }
.lore { color: #b9a77d; font-style: italic; }

/* ---------- cartões / grades ---------- */
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.card:target, .card.hl, tr.hl td { outline: 2px solid var(--gold); outline-offset: -2px; }
.card h3 { font-size: 1.05rem; color: var(--text); display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.card h3 img { width: 30px; height: 30px; image-rendering: pixelated; }
.card .meta { color: var(--muted); font-size: .82rem; margin-bottom: 6px; }
.card ul { margin: 4px 0 0; padding-left: 18px; }
.card li { margin: 2px 0; }
.ic { width: 24px; height: 24px; image-rendering: pixelated; vertical-align: middle; }
.ic-lg { width: 36px; height: 36px; image-rendering: pixelated; }

/* ---------- tabelas ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin: 8px 0 14px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: .45em .6em; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--panel2); color: var(--gold); font: 700 .8rem/1.3 var(--display); letter-spacing: .04em; text-transform: uppercase; position: sticky; top: 0; z-index: 1; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: " ↕"; opacity: .4; }
th[data-dir="asc"]::after { content: " ↑"; opacity: 1; }
th[data-dir="desc"]::after { content: " ↓"; opacity: 1; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 217, 128, .04); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.detail td { background: #13131a; }

/* ---------- Pokédex ---------- */
.dex { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.mon { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px; cursor: pointer; text-align: center; color: var(--text);
	font: inherit; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: border-color .15s, transform .15s; }
.mon:hover { border-color: var(--gold2); transform: translateY(-1px); }
.mon .spr { height: 76px; display: flex; align-items: flex-end; justify-content: center; }
.mon img { max-height: 76px; max-width: 100%; image-rendering: pixelated; }
.mon .no { color: var(--muted); font-size: .75rem; }
.mon .nm { font: 700 .95rem/1.2 var(--display); }
.mon .bst { color: var(--muted); font-size: .75rem; }
.stats { display: grid; grid-template-columns: 90px 40px 1fr; gap: 3px 8px; align-items: center; font-size: .88rem; }
.bar { height: 8px; background: #26242f; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold3), var(--gold)); }
.evo-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.evo-line a { display: inline-flex; align-items: center; gap: 4px; }
.evo-line img { width: 34px; height: 34px; object-fit: contain; image-rendering: pixelated; }
.minimon { display: inline-flex; align-items: center; gap: 4px; margin: 2px 8px 2px 0; }
.minimon img { width: 28px; height: 28px; object-fit: contain; image-rendering: pixelated; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .72); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; overflow-y: auto; }
.modal-box { background: var(--bg2); border: 1px solid var(--gold3); border-radius: 14px; width: min(920px, 100%); padding: 18px 20px 22px; position: relative; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.modal-close { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--muted); font-size: 1.8rem; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--gold); }
.mhead { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.mhead img { width: 96px; height: 96px; object-fit: contain; image-rendering: pixelated; background: radial-gradient(circle, #23212c, transparent 70%); }
.mhead h2 { font-size: 1.6rem; color: var(--gold); }
.mcols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
.mcols h4 { color: var(--gold); font-size: .95rem; margin: 10px 0 6px; text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 700px) { .mcols { grid-template-columns: 1fr; } .mhead img { width: 72px; height: 72px; } }

/* ---------- afixos ---------- */
.tiers { width: 100%; font-size: .86rem; margin-top: 6px; }
.tiers td, .tiers th { padding: .25em .45em; }
.tiers tr.off td { opacity: .35; }
.chance { color: var(--ok); font-weight: 600; }

/* ---------- hub ---------- */
.search-all { position: relative; margin: 10px 0 18px; max-width: 720px; }
.search-all input { width: 100%; font-size: 1.05rem; padding: .7em .9em; }
.qall-res { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; max-height: 60vh; overflow-y: auto; }
.qall-res a { display: flex; justify-content: space-between; gap: 10px; padding: .5em .8em; color: var(--text); border-bottom: 1px solid var(--line); }
.qall-res a:hover, .qall-res a:focus { background: var(--panel2); text-decoration: none; }
.qall-res a span { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.hub { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.hub-card { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--text);
	text-decoration: none !important; transition: border-color .15s, transform .15s; }
.hub-card:hover { border-color: var(--gold2); transform: translateY(-2px); }
.hub-ic { font-size: 1.5rem; }
.hub-t { font: 700 1.15rem/1.2 var(--display); color: var(--gold); }
.hub-d { color: var(--muted); font-size: .9rem; }
.hub-n { margin-top: auto; color: var(--gold2); font-size: .82rem; font-weight: 700; }
.hub-sim { border-color: var(--gold3); background: linear-gradient(180deg, #1d1a12, var(--panel)); }

/* ---------- prosa (mecânicas/drops) ---------- */
.prose { max-width: 1000px; }
.prose h2 { font-size: 1.35rem; color: var(--gold); margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 1.05rem; color: #f3e2b5; margin: 16px 0 6px; }
.prose ul { padding-left: 20px; margin: 4px 0 10px; }
.prose li { margin: 3px 0; }
.prose code, .formula { font-family: Consolas, "Cascadia Mono", monospace; background: #1d1b25; border: 1px solid var(--line); border-radius: 5px; padding: 0 .35em; font-size: .88em; color: #ffe7b0; }
.formula { display: block; padding: .6em .8em; margin: 6px 0 10px; overflow-x: auto; white-space: pre-wrap; }
.prose section { scroll-margin-top: 120px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.toc a { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: .2em .7em; font-size: .85rem; }
.callout { border-left: 3px solid var(--gold2); background: #17150f; padding: .6em .9em; border-radius: 0 8px 8px 0; margin: 8px 0 12px; color: #e9dfc3; }

details.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0; }
details.box > summary { cursor: pointer; padding: 10px 14px; font: 700 1rem/1.3 var(--display); color: var(--gold); list-style: none; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
details.box > summary::-webkit-details-marker { display: none; }
details.box > summary::before { content: "▸"; color: var(--gold2); transition: transform .15s; }
details.box[open] > summary::before { transform: rotate(90deg); }
details.box > .in { padding: 0 14px 12px; }

/* ---------- rodapé ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg2); padding: 28px 0 34px; }
.footer-in { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.foot-brand { display: flex; align-items: center; gap: 8px; color: var(--gold); font: 700 1rem/1 var(--display); letter-spacing: .08em; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; }
.foot-links a { color: var(--muted); font-size: .92rem; }
.foot-links a:hover { color: var(--gold); }
.foot-wiki a { font-size: .85rem; }
.disclaimer { color: #7d7990; font-size: .8rem; max-width: 760px; }
.foot-gen { color: #5f5c70; font-size: .76rem; margin: 0; }

/* ---------- tabela de tipos ---------- */
table.eff { font-size: .8rem; }
table.eff th, table.eff td { padding: .3em .35em; text-align: center; }
table.eff tbody th { text-align: left; position: static; white-space: nowrap; }
.eff-se { background: rgba(79, 209, 139, .22); color: #8ff0b8; font-weight: 700; }
.eff-nv { background: rgba(255, 107, 107, .16); color: #ffb0b0; }
.eff-im { background: rgba(120, 120, 140, .3); color: #d0d0e0; font-weight: 700; }

/* ---------- utilitários (sem style inline por causa da CSP) ---------- */
img.broken { visibility: hidden; }
.cur { color: #fff !important; font-weight: 700; }
.qall-none { padding: .6em .8em; margin: 0; }
.mt6 { margin-top: 6px; }
.tag.bad { color: var(--bad); border-color: #6b2b2b; }
.gem { color: #40d9d9; }

/* cores dos tipos (geradas por tools/build_wiki.py) */
.t-normal{background:#a8a77a}.t-fire{background:#ee8130}.t-water{background:#6390f0}.t-electric{background:#f7d02c}.t-grass{background:#7ac74c}.t-ice{background:#96d9d6}.t-fighting{background:#c22e28}.t-poison{background:#a33ea1}.t-ground{background:#e2bf65}.t-flying{background:#a98ff3}.t-psychic{background:#f95587}.t-bug{background:#a6b91a}.t-rock{background:#b6a136}.t-ghost{background:#735797}.t-dragon{background:#6f35fc}.t-dark{background:#705746}.t-steel{background:#b7b7ce}.t-fairy{background:#d685ad}
