/* 2bitWiki: RealmEye's wiki layout, in the dark. */
:root {
  color-scheme: dark;
  --bg: #111316;
  --bg2: #15181c;
  --stripe: #181b20;
  --hover: #1f232a;
  --line: #292d34;
  --line2: #3a3f48;
  --text: #d5d8de;
  --head: #eceef2;
  --muted: #9ba2ad;
  --faint: #6f7682;
  --link: #5aa8ea;
  --link2: #8fcaff;
  --gold: #b8860b;
  --gold-text: #ffd27a;
  --box: #34383f;
  --nav1: #23272d;
  --nav2: #1a1d22;
  --input: #1b1e23;
  --red: #ff2f3f;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 54px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/20px var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link2); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--link2); outline-offset: 2px; }
b, strong { color: var(--head); }
p { margin: 0 0 10px; }
ul { margin: 0 0 10px; padding-left: 22px; }
code { font: 12.5px/1.4 ui-monospace, Consolas, monospace; background: #1d2026; border: 1px solid var(--line); padding: 0 4px; border-radius: 3px; }
canvas.spr { image-rendering: pixelated; image-rendering: crisp-edges; vertical-align: middle; }
img.pix { image-rendering: pixelated; vertical-align: middle; }

/* ---- top bar ------------------------------------------------------------------------- */
.navbar { position: sticky; top: 0; z-index: 50; height: 42px; background: linear-gradient(var(--nav1), var(--nav2)); border-bottom: 1px solid #2c3036; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45); }
.nav-inner { max-width: 1170px; margin: 0 auto; height: 42px; padding: 0 15px; display: flex; align-items: center; }
.brand { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 15px; color: #e9e9ea; margin-right: 14px; white-space: nowrap; }
.brand:hover { text-decoration: none; color: #fff; }
.brand b { color: var(--link); }
.menu { display: flex; height: 100%; flex: 1; min-width: 0; }
.menu > div { position: relative; }
.menu > div > a { display: flex; align-items: center; gap: 4px; height: 42px; padding: 0 10px; color: #9da3ad; font-size: 13px; white-space: nowrap; }
.menu > div > a::after { content: ""; border: 4px solid transparent; border-top-color: currentColor; margin-top: 4px; opacity: 0.7; }
.menu > div > a.plain::after { display: none; }
.menu > div:hover > a, .menu > div.on > a { color: #fff; background: rgba(255, 255, 255, 0.06); text-decoration: none; }
.drop { display: none; position: absolute; top: 42px; left: 0; min-width: 210px; max-height: calc(100vh - 60px); overflow: auto; background: #1c1f24; border: 1px solid var(--line2); border-top: 0; border-radius: 0 0 4px 4px; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.55); padding: 5px 0; }
.menu > div:hover .drop, .menu > div:focus-within .drop { display: block; }
.drop a { display: block; padding: 4px 18px; color: var(--text); white-space: nowrap; font-size: 13px; }
.drop a:hover { background: #2a2f37; color: #fff; text-decoration: none; }
.drop .sep { height: 1px; background: var(--line2); margin: 5px 0; }
.nav-search { margin-left: auto; display: flex; align-items: center; }
.nav-search button { width: 32px; height: 28px; border: 1px solid var(--line2); background: #23272d; border-radius: 4px; color: #c9cdd4; cursor: pointer; display: grid; place-items: center; }
.nav-search button:hover { background: #2c3138; }

/* ---- page layout --------------------------------------------------------------------- */
.container { max-width: 1170px; margin: 0 auto; padding: 0 15px; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 30px; }
main { min-width: 0; padding-bottom: 70px; }
aside { padding-top: 66px; min-width: 0; }
h1 { font-size: 36px; line-height: 1.1; font-weight: 700; margin: 22px 0 12px; color: var(--head); }
h2 { font-size: 28px; line-height: 1.15; font-weight: 700; margin: 26px 0 10px; color: var(--head); }
h3 { font-size: 20px; line-height: 1.2; font-weight: 700; margin: 18px 0 8px; color: var(--head); }
h4 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; color: var(--head); }
.updated { text-align: center; font-weight: 700; font-size: 12.5px; padding: 0 0 7px; border-bottom: 1px solid var(--line); margin-bottom: 12px; color: var(--muted); }
.updated a { font-weight: 700; }
.center { text-align: center; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.backtop { font-size: 12px; display: inline-block; margin: 2px 0 6px; }
hr.sec { border: 0; border-top: 1px solid var(--line); margin: 18px 0 0; }

/* ---- tables ----------------------------------------------------------------------- */
.tw { overflow-x: auto; margin: 0 0 20px; }
table.wt { width: 100%; border-collapse: collapse; }
.wt caption { caption-side: top; text-align: center; font-weight: 700; font-size: 16px; color: var(--head); padding: 6px 0 8px; }
.wt th { border-bottom: 2px solid var(--line2); padding: 8px; text-align: center; font-weight: 700; color: var(--head); vertical-align: bottom; }
.wt td { padding: 7px 8px; border-top: 1px solid var(--line); text-align: center; vertical-align: middle; }
.wt tbody tr:nth-child(odd) { background: var(--stripe); }
.wt tbody tr:hover { background: var(--hover); }
.wt td.l, .wt th.l { text-align: left; }
.wt td.nw { white-space: nowrap; }
.wt td.name a { font-weight: 700; }
.wt td.hl { background: var(--gold); color: #1a1300; font-weight: 700; }
.wt td.hl a { color: #1a1300; }
.wt.compact td { padding: 4px 8px; }
.wt.sortable th { cursor: pointer; user-select: none; }
.wt.sortable th:hover { color: #fff; }
.wt th.asc::after { content: " \25B2"; font-size: 9px; color: var(--link); }
.wt th.desc::after { content: " \25BC"; font-size: 9px; color: var(--link); }
.wt tr.target td { box-shadow: inset 0 0 0 9999px rgba(90, 168, 234, 0.14); }
.ae { display: inline-flex; align-items: center; justify-content: center; background: var(--box); border: 1px solid #454a53; border-radius: 4px; min-width: 44px; min-height: 32px; padding: 4px 6px; }
.dmg { font-weight: 700; color: var(--head); }
.heavy { color: #ff8a5c; font-weight: 700; }

/* ---- info blocks ------------------------------------------------------------------ */
dl.stats { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 1px 12px; margin: 0 0 14px; }
dl.stats dt { font-weight: 700; color: var(--head); }
dl.stats dd { margin: 0; }
.itemhead { display: flex; align-items: flex-start; gap: 16px; padding: 4px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.itemhead .pics { display: flex; align-items: center; gap: 10px; flex: none; }
.itemhead .desc { padding-top: 6px; }
.infobox { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; background: var(--stripe); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 0 12px; }
.lorebox { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 14px 0; }
.lorebox .who { background: #1b1e23; padding: 4px 6px; font-weight: 700; font-size: 13px; }
.lorebox .who span { color: var(--link); }
.lorebox .body { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 8px 6px; align-items: start; }
.lorebox .face { display: grid; place-items: center; min-height: 40px; }
.lorebox .lines { font-style: italic; color: #c3c7ce; font-size: 13px; }
.lorebox .lines div { margin: 0 0 3px; }
.toc { display: inline-block; min-width: 240px; margin: 4px 0 8px; }
.toc h2 { font-size: 26px; margin: 10px 0 6px; }
.toc ul { margin: 0; padding-left: 26px; list-style: disc; }
.toc li { font-size: 13px; line-height: 19px; }
.note { border-left: 3px solid var(--line2); padding: 4px 10px; color: var(--muted); margin: 0 0 12px; font-size: 13px; }
.note b { color: var(--text); }
.callout { background: #171a1f; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin: 0 0 14px; }

/* ---- sprite grids (dungeon enemies, bosses) ----------------------------------------- */
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); background: var(--stripe); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 0 16px; }
.sgrid a, .sgrid .cell { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding: 10px 6px; text-align: center; font-size: 12px; line-height: 15px; min-height: 92px; }
.sgrid a:hover { background: var(--hover); text-decoration: none; }
.sgrid small { color: var(--faint); font-size: 11px; }
.band-title { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin: 10px 0 4px; }

/* ---- small bits ------------------------------------------------------------------- */
.chip { display: inline-block; font-size: 11px; line-height: 16px; font-weight: 700; padding: 0 7px; border-radius: 9px; border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.chip.c { color: #111; border: 0; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; border: 1px solid rgba(255, 255, 255, 0.2); }
.pips { display: inline-flex; gap: 7px; padding: 0 2px; }
.pips i { width: 10px; height: 10px; transform: rotate(45deg); background: #2b3038; border: 1px solid #414752; }
.pips i.on { background: var(--gold-text); border-color: #a3832f; box-shadow: 0 0 5px rgba(255, 210, 122, 0.45); }
.portal { width: 64px; height: 64px; border-radius: 50%; position: relative; }
.icon24 { width: 48px; height: 48px; image-rendering: pixelated; vertical-align: middle; }
.icon16 { width: 32px; height: 32px; vertical-align: middle; }
.ilink { display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }
.ilink img, .ilink canvas { flex: none; }
.rar { font-weight: 700; }
.u-red { color: var(--red); font-weight: 700; }
.kbd, kbd { display: inline-block; min-width: 22px; text-align: center; font: 700 11.5px/18px var(--font); padding: 0 5px; border-radius: 4px; background: #262a31; border: 1px solid #454b55; border-bottom-width: 2px; color: #e6e8ec; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; align-items: center; }
.filters span.lab { font-size: 12px; font-weight: 700; color: var(--faint); text-transform: uppercase; margin-right: 2px; }
.filters button, .btn { font: 600 12px/1 var(--font); color: var(--text); background: #1d2126; border: 1px solid var(--line2); border-radius: 999px; padding: 6px 11px; cursor: pointer; }
.filters button:hover, .btn:hover { background: #262b32; }
.filters button[aria-pressed="true"] { background: #23476a; border-color: var(--link); color: #fff; }
.filters input { background: var(--input); border: 1px solid var(--line2); color: var(--text); border-radius: 4px; padding: 5px 8px; font: 13px var(--font); min-width: 200px; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line2); margin: 0 0 12px; flex-wrap: wrap; }
.tabs button { font: 600 13px var(--font); background: none; border: 1px solid transparent; border-bottom: 0; color: var(--link); padding: 7px 14px; cursor: pointer; border-radius: 4px 4px 0 0; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { background: var(--bg); border-color: var(--line2); color: var(--head); }
.homegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0 0 18px; }
.homegrid a { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--stripe); color: var(--text); }
.homegrid a:hover { border-color: var(--line2); background: var(--hover); text-decoration: none; }
.homegrid a b { display: block; color: var(--link); }
.homegrid a small { color: var(--muted); font-size: 12px; line-height: 15px; display: block; }
.frames { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: flex-end; margin: 6px 0; }
.frames figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--faint); }

/* ---- maps ------------------------------------------------------------------------- */
.mapbox { position: relative; margin: 0 auto 8px; background: #07080c; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.mapbox img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.mapbox .wp { position: absolute; width: 9px; height: 9px; margin: -5px 0 0 -5px; border-radius: 50%; background: #9fe0ff; border: 2px solid #0b1a24; box-shadow: 0 0 6px rgba(159, 224, 255, 0.9); cursor: help; }
.mapbox .wp.gate { width: 14px; height: 14px; margin: -7px 0 0 -7px; background: #ffd27a; box-shadow: 0 0 10px rgba(255, 210, 122, 0.9); }
.mapbox .rl { position: absolute; transform: translate(-50%, -50%); font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000, 0 0 6px #000; white-space: nowrap; pointer-events: none; letter-spacing: 0.02em; }
.mapbox.hide-labels .rl, .mapbox.hide-wp .wp { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---- sidebar ---------------------------------------------------------------------- */
.side h6 { font-size: 11px; line-height: 14px; color: #8b919b; text-transform: uppercase; margin: 10px 0 3px; font-weight: 700; }
.side .search { position: relative; }
.side input[type="search"] { width: 100%; background: var(--input); border: 1px solid var(--line2); color: var(--text); border-radius: 3px; padding: 4px 7px; font: 12.5px var(--font); }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 40; background: #1c1f24; border: 1px solid var(--line2); border-radius: 4px; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5); max-height: 420px; overflow: auto; display: none; }
.results.open { display: block; }
.results a { display: flex; align-items: center; gap: 7px; padding: 4px 8px; font-size: 12.5px; color: var(--text); }
.results a small { margin-left: auto; color: var(--faint); font-size: 10.5px; text-transform: uppercase; }
.results a.sel, .results a:hover { background: #2a2f37; text-decoration: none; }
.results .empty { padding: 6px 8px; color: var(--faint); font-size: 12px; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 12px; }
.tree > ul { padding-left: 12px; }
.tree a { display: block; font-size: 12.5px; line-height: 18px; padding: 1px 0; }
.tree a.cur { font-weight: 700; color: #fff; }
.tree .t { display: flex; align-items: center; }
.tree .t button { width: 14px; height: 18px; flex: none; background: none; border: 0; color: var(--faint); cursor: pointer; padding: 0; font-size: 9px; margin-left: -14px; }
.tree li.shut > ul { display: none; }
.side .tools a { display: block; font-size: 12.5px; line-height: 18px; padding-left: 12px; }
.side .built { font-size: 11.5px; color: var(--faint); padding-left: 12px; margin-top: 4px; line-height: 16px; }

/* ---- hover cards ------------------------------------------------------------------ */
.tip { position: fixed; z-index: 100; pointer-events: none; background: #1b1e23; border: 1px solid #4a505b; border-radius: 6px; padding: 8px 10px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6); max-width: 300px; font-size: 12.5px; line-height: 17px; display: none; }
.tip.open { display: block; }
.tip .th { display: flex; gap: 8px; align-items: center; margin-bottom: 5px; }
.tip .th b { display: block; font-size: 13.5px; }
.tip .th small { color: var(--muted); }
.tip .row { display: flex; justify-content: space-between; gap: 12px; }
.tip .row span:first-child { color: var(--muted); }
.tip .lore { color: #b9bec7; font-style: italic; margin-top: 5px; }

/* ---- small screens ---------------------------------------------------------------- */
@media (max-width: 991px) {
  .container { grid-template-columns: minmax(0, 1fr); gap: 0; }
  aside { padding-top: 0; border-top: 1px solid var(--line); margin-top: 10px; padding-bottom: 40px; }
  .menu > div > a { padding: 0 7px; font-size: 12.5px; }
}
@media (max-width: 720px) {
  .menu { overflow-x: auto; scrollbar-width: none; }
  .menu::-webkit-scrollbar { display: none; }
  .menu .drop { display: none !important; }
  .menu > div > a::after { display: none; }
  .brand > span:last-child { display: none; }
  .nav-search { margin-left: 8px; flex: none; }
  h1 { font-size: 28px; }
  h2 { font-size: 23px; }
  dl.stats { grid-template-columns: 120px minmax(0, 1fr); }
  .itemhead { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
