/* =====================================================================
   Integrated Boogaloo Wiki — base + components (prefix: ib-)
   Each block below is documented with a live example in styleguide.html.
   ===================================================================== */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; scroll-padding-top: calc(var(--ib-topbar) + 16px); }
body { margin: 0; background: var(--ib-bg); color: var(--ib-text); font: var(--ib-fs-md)/var(--ib-lh) var(--ib-font-body); }
a { color: var(--ib-link); text-decoration: none; }
a:hover { color: var(--ib-link-hover); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ib-gold-500); outline-offset: 2px; }
code, kbd, .ib-mono { font-family: var(--ib-font-mono); font-size: .9em; }
code { background: var(--ib-bg-deep); border: 1px solid var(--ib-border); padding: 0 4px; }
kbd { background: var(--ib-surface-3); border: 1px solid var(--ib-border-strong); border-bottom-width: 3px; padding: 0 5px; font-size: var(--ib-fs-xs); }
img.px, .px img, .ib-icon img { image-rendering: pixelated; image-rendering: crisp-edges; }
::selection { background: var(--ib-purple-600); color: #fff; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--ib-bg-deep); }
::-webkit-scrollbar-thumb { background: var(--ib-surface-3); border: 2px solid var(--ib-bg-deep); }

/* ---------- headings ---------- */
.ib-h1, .ib-h2, .ib-h3, .ib-eyebrow { font-family: var(--ib-font-display); letter-spacing: .03em; margin: 0; font-weight: 700; }
.ib-h1 { font-size: var(--ib-fs-2xl); line-height: 1.15; color: var(--ib-text); text-shadow: var(--ib-text-shadow); }
.ib-h2 { font-size: var(--ib-fs-xl); color: var(--ib-gold-500); text-shadow: var(--ib-text-shadow-gold); text-transform: uppercase; margin: var(--s6) 0 var(--s3); }
.ib-h3 { font-size: var(--ib-fs-md); color: var(--ib-purple-300); text-transform: uppercase; margin: var(--s5) 0 var(--s2); }
.ib-eyebrow { font-size: var(--ib-fs-2xs); color: var(--ib-text-muted); text-transform: uppercase; letter-spacing: .1em; }
.ib-muted { color: var(--ib-text-muted); }
.ib-faint { color: var(--ib-text-faint); }

/* ---------- chevron button (main-menu button) ---------- */
.ib-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 36px; padding: 0 28px; border: 0; cursor: pointer; white-space: nowrap;
  background: #000; color: #fff; text-decoration: none !important;
  font: 700 var(--ib-fs-sm) var(--ib-font-display); letter-spacing: .08em; text-transform: uppercase;
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
  transition: color var(--ib-fast);
}
.ib-btn::before, .ib-btn::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 11px; background: var(--ib-chevron);
  clip-path: polygon(100% 0, 40% 50%, 100% 100%, 62% 100%, 0 50%, 62% 0);
}
.ib-btn::before { left: 2px; }
.ib-btn::after { right: 2px; transform: scaleX(-1); }
.ib-btn:hover, .ib-btn.is-active { color: var(--ib-orange); }
.ib-btn.is-active::before, .ib-btn.is-active::after { background: var(--ib-purple-500); }
.ib-btn img { width: 16px; height: 16px; }
.ib-btn--sm { height: 28px; padding: 0 22px; font-size: var(--ib-fs-2xs); }
.ib-btn--gold { background: var(--ib-gold-500); color: #1a1000; }
.ib-btn--gold:hover { color: #000; background: var(--ib-gold-300); }

/* plain square button (inside panels / AntOS) */
.ib-sqbtn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; cursor: pointer;
  background: var(--ib-surface-2); color: var(--ib-text); border: var(--ib-bw) solid var(--ib-border-strong); box-shadow: var(--ib-bevel);
  font: var(--ib-fs-xs) var(--ib-font-body); }
.ib-sqbtn:hover { border-color: var(--ib-purple-500); color: #fff; }
.ib-sqbtn.is-on { border-color: var(--ib-gold-500); color: var(--ib-gold-300); }

/* ---------- panel ---------- */
.ib-panel { background: var(--ib-surface); border: var(--ib-bw) solid var(--ib-border); box-shadow: var(--ib-bevel); }
.ib-panel__head { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s4); border-bottom: var(--ib-bw) solid var(--ib-border);
  font: 700 var(--ib-fs-xs) var(--ib-font-display); text-transform: uppercase; letter-spacing: .08em; color: var(--ib-text-muted); }
.ib-panel__head .ib-count { margin-left: auto; }
.ib-panel__body { padding: var(--s4); }
.ib-panel--inset { background: var(--ib-bg-deep); box-shadow: var(--ib-bevel-in); }
.ib-panel + .ib-panel { margin-top: var(--s4); }

/* ---------- icon ---------- */
.ib-icon { display: inline-grid; place-items: center; flex: none; width: var(--sz, 32px); height: var(--sz, 32px); position: relative; vertical-align: middle; }
.ib-icon img { width: 100%; height: 100%; object-fit: contain; }
/* sprite cell: sheets are 32 cols of 32px icons; scale the whole sheet so one cell = --sz */
.ib-spr { display: block; width: 100%; height: 100%; background-repeat: no-repeat; image-rendering: pixelated;
  background-size: calc(var(--sz, 32px) * 32) auto;
  background-position: calc(var(--c) * var(--sz, 32px) * -1) calc(var(--r) * var(--sz, 32px) * -1); }
.ib-icon--16 { --sz: var(--icon-16); } .ib-icon--32 { --sz: var(--icon-32); } .ib-icon--48 { --sz: var(--icon-48); } .ib-icon--64 { --sz: var(--icon-64); }
.ib-icon__ph { width: 100%; height: 100%; display: grid; place-items: center; background: hsl(var(--mod-hue, 270) 35% 22%);
  box-shadow: inset -3px -3px 0 rgba(0,0,0,.35), inset 3px 3px 0 rgba(255,255,255,.12);
  font: 700 calc(var(--sz, 32px) * .32) var(--ib-font-display); color: hsl(var(--mod-hue, 270) 70% 82%); }
.ib-icon--mob .ib-icon__ph { background: #3a1414; color: #ff9b94; border-radius: 0; }

/* ---------- inline reference (auto-linked prose) ---------- */
.ib-ref { display: inline; white-space: normal; }
.ib-ref .ib-icon { --sz: 16px; margin: -3px 3px 0 0; }
.ib-ref--item { color: var(--ib-gold-300); }
.ib-ref--mob { color: #ff9b94; }
.ib-ref--biome { color: #a6e88a; }
.ib-ref--structure { color: #e1bd92; }
.ib-ref--task { color: var(--ib-antos-300); }
.ib-ref--entry { color: #8ff0e4; }
.ib-ref--mod { color: var(--ib-orange); }
.ib-ref--guide { color: var(--ib-purple-300); }
.ib-ref--missing { color: var(--ib-text-muted); text-decoration: underline dotted; }

/* ---------- chip (entity pill) ---------- */
.ib-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px 3px 4px; margin: 0 6px 6px 0;
  background: var(--ib-surface-2); border: 1px solid var(--ib-border); border-left: 3px solid hsl(var(--mod-hue, 270) 60% 60%);
  color: var(--ib-text); font-size: var(--ib-fs-sm); text-decoration: none !important; vertical-align: middle; }
.ib-chip:hover { background: var(--ib-surface-3); color: #fff; border-color: var(--ib-border-strong); }
.ib-chip .ib-icon { --sz: 24px; }
.ib-chip__sub { color: var(--ib-text-faint); font-size: var(--ib-fs-xs); }
.ib-chip__n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-chip--hidden { opacity: .55; }
.ib-chips { display: flex; flex-wrap: wrap; }

/* ---------- badges ---------- */
.ib-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border: 1px solid currentColor; vertical-align: middle;
  font: 700 var(--ib-fs-2xs) var(--ib-font-display); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.ib-badge--dump { color: var(--ib-antos-500); }
.ib-badge--kubejs { color: var(--ib-gold-500); }
.ib-badge--kubejs-data { color: var(--ib-gold-300); }
.ib-badge--jar { color: var(--ib-text-faint); }
.ib-badge--kind { color: var(--kind, var(--ib-text-muted)); }
.ib-badge--hidden { color: var(--ib-danger); }
.ib-badge--fill { background: currentColor; }
.ib-badge--fill > span { color: #000; }

/* ---------- Minecraft slot + recipe ---------- */
.ib-slot { position: relative; width: 40px; height: 40px; display: grid; place-items: center; flex: none;
  background: var(--ib-bg-deep); box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 #3d424a; }
.ib-slot .ib-icon { --sz: 32px; }
.ib-slot--out { width: 56px; height: 56px; }
.ib-slot--out .ib-icon { --sz: 48px; }
.ib-slot a { display: grid; place-items: center; }
.ib-slot__n { position: absolute; right: 2px; bottom: 0; font: 700 13px var(--ib-font-display); color: #fff; text-shadow: 2px 2px 0 #3f3f3f; pointer-events: none; }
.ib-slot__tag { position: absolute; left: 1px; top: -2px; font: 700 10px var(--ib-font-display); color: var(--ib-purple-300); text-shadow: 1px 1px 0 #000; pointer-events: none; }
.ib-slot__chance { position: absolute; left: 2px; top: 0; font: 9px var(--ib-font-mono); color: var(--mc-yellow); }
.ib-grid3 { display: grid; grid-template-columns: repeat(3, 40px); gap: 2px; }
.ib-row { display: flex; flex-wrap: wrap; gap: 2px; max-width: 220px; }
.ib-recipe { background: var(--ib-surface); border: var(--ib-bw) solid var(--ib-border); box-shadow: var(--ib-bevel); }
.ib-recipe__head { display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s3); border-bottom: 1px solid var(--ib-border); font-size: var(--ib-fs-xs); color: var(--ib-text-muted); }
.ib-recipe__head .ib-icon { --sz: 20px; }
.ib-recipe__head .ib-badge { margin-left: auto; }
.ib-recipe__body { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s4); padding: var(--s3); }
.ib-recipe__arrow { width: 32px; height: 22px; flex: none; background: var(--ib-text-faint);
  clip-path: polygon(0 35%, 60% 35%, 60% 0, 100% 50%, 60% 100%, 60% 65%, 0 65%); }
.ib-recipe__meta { padding: 0 var(--s3) var(--s2); font-size: var(--ib-fs-xs); color: var(--ib-text-faint); display: flex; gap: var(--s3); flex-wrap: wrap; min-width: 0; }
.ib-recipe__meta span { overflow-wrap: anywhere; min-width: 0; }
.ib-recipe__fluid { font: var(--ib-fs-xs) var(--ib-font-mono); color: var(--ib-info); }
.ib-recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s3); }

/* ritual chalk circle */
.ib-ritual { display: grid; gap: 1px; background: #0b0b14; padding: 4px; width: max-content; }
.ib-ritual i { width: 8px; height: 8px; display: block; }
.ib-ritual i.c-w { background: #e8e4d8; } .ib-ritual i.c-g { background: var(--ib-gold-500); }
.ib-ritual i.c-r { background: #d8463d; } .ib-ritual i.c-p { background: var(--ib-purple-500); } .ib-ritual i.c-o { background: #6b7a90; }

/* ---------- callouts ---------- */
.ib-callout { position: relative; padding: var(--s3) var(--s4) var(--s3) 52px; margin: var(--s3) 0; background: var(--ib-surface-2);
  border: 1px solid var(--ib-border); border-left: 4px solid var(--c, var(--ib-info)); }
.ib-callout::before { content: var(--glyph, "i"); position: absolute; left: 12px; top: 10px; width: 26px; height: 26px; display: grid; place-items: center;
  background: var(--c, var(--ib-info)); color: #000; font: 700 15px var(--ib-font-display); }
.ib-callout__title { display: block; font: 700 var(--ib-fs-2xs) var(--ib-font-display); text-transform: uppercase; letter-spacing: .08em; color: var(--c); margin-bottom: 2px; }
.ib-callout--tip { --c: var(--ib-antos-500); --glyph: "+"; }
.ib-callout--warn { --c: var(--ib-danger); --glyph: "!"; }
.ib-callout--correction { --c: var(--ib-gold-500); --glyph: "≠"; }
.ib-callout--info { --c: var(--ib-info); --glyph: "i"; }
.ib-callout--pack { --c: var(--ib-purple-500); --glyph: "★"; }

/* ---------- Minecraft tooltip ---------- */
.ib-tooltip { position: fixed; z-index: 100; pointer-events: none; max-width: 320px; padding: 6px 8px; display: none;
  background: var(--mc-tooltip-bg); border: 2px solid transparent; border-image: linear-gradient(var(--mc-tooltip-border-top), var(--mc-tooltip-border-bottom)) 1;
  outline: 2px solid #100010; font-size: var(--ib-fs-sm); line-height: 1.35; }
.ib-tooltip__n { color: var(--mc-white); }
.ib-tooltip__n.r-uncommon { color: var(--mc-yellow); } .ib-tooltip__n.r-rare { color: var(--mc-aqua); } .ib-tooltip__n.r-epic { color: var(--mc-pink); }
.ib-tooltip__l { color: var(--mc-gray); }
.ib-tooltip__mod { color: var(--mc-modname); font-style: italic; }
.ib-tooltip__id { color: #555; font: var(--ib-fs-2xs) var(--ib-font-mono); }

/* ---------- key/value rail ---------- */
.ib-kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px var(--s3); font-size: var(--ib-fs-sm); }
.ib-kv dt { color: var(--ib-text-faint); font: 700 var(--ib-fs-2xs) var(--ib-font-display); text-transform: uppercase; padding-top: 3px; }
.ib-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- tabs ---------- */
.ib-tabs { display: flex; gap: 2px; border-bottom: var(--ib-bw) solid var(--ib-border); margin-bottom: var(--s3); overflow-x: auto; }
.ib-tab { padding: 6px 12px; background: transparent; border: 0; border-bottom: 3px solid transparent; color: var(--ib-text-muted); cursor: pointer;
  font: 700 var(--ib-fs-2xs) var(--ib-font-display); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.ib-tab:hover { color: var(--ib-text); }
.ib-tab.is-active { color: var(--ib-gold-500); border-bottom-color: var(--ib-gold-500); }
.ib-tab .ib-count { color: var(--ib-text-faint); margin-left: 4px; }

/* ---------- progress ---------- */
.ib-progress { height: 8px; background: var(--ib-bg-deep); box-shadow: var(--ib-bevel-in); }
.ib-progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ib-purple-600), var(--ib-purple-500)); }
.ib-progress--gold > i { background: linear-gradient(90deg, var(--ib-gold-700), var(--ib-gold-500)); }

/* ---------- rewards / objectives ---------- */
.ib-reward { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; margin: 0 6px 6px 0; background: #241d05; border: 1px solid #6b5a12; color: var(--ib-gold-300); font-size: var(--ib-fs-sm); }
.ib-reward--xp { background: #10240a; border-color: #3f7a1f; color: #b5f58a; }
.ib-coin { width: 12px; height: 12px; background: var(--ib-gold-500); box-shadow: inset -2px -2px 0 var(--ib-gold-700), inset 2px 2px 0 var(--ib-gold-100); }
.ib-orb { width: 12px; height: 12px; background: #7fe03b; box-shadow: inset -2px -2px 0 #3f7a1f, inset 2px 2px 0 #d8ffb0; }
.ib-objectives { list-style: none; padding: 0; margin: 0; }
.ib-objectives li { position: relative; padding: 6px 0 6px 28px; border-bottom: 1px dashed var(--ib-border); }
.ib-objectives li::before { content: ""; position: absolute; left: 0; top: 9px; width: 14px; height: 14px; border: 2px solid var(--ib-antos-500); }
.ib-objectives li.is-done::before { background: var(--ib-antos-500); }
.ib-objectives .ib-objectives__how { display: block; font-size: var(--ib-fs-xs); color: var(--ib-text-faint); }

/* ---------- tiles ---------- */
.ib-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); }
.ib-tile { display: flex; gap: var(--s3); align-items: center; padding: var(--s3); background: var(--ib-surface); border: var(--ib-bw) solid var(--ib-border); box-shadow: var(--ib-bevel); color: var(--ib-text); text-decoration: none !important; }
.ib-tile:hover { border-color: var(--ib-purple-500); color: #fff; transform: translateY(-1px); }
.ib-tile__t { font-weight: 600; }
.ib-tile__s { font-size: var(--ib-fs-xs); color: var(--ib-text-faint); }
.ib-tile .ib-progress { margin-top: 6px; }

/* ---------- list rows ---------- */
.ib-list { list-style: none; margin: 0; padding: 0; }
.ib-list > li { display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s2); border-bottom: 1px solid var(--ib-border); }
.ib-list > li:hover { background: var(--ib-surface-2); }
.ib-list .ib-list__sub { margin-left: auto; color: var(--ib-text-faint); font-size: var(--ib-fs-xs); text-align: right; }

/* ---------- prose (guides, archive, task text) ---------- */
.ib-prose { max-width: 78ch; }
.ib-prose p { margin: 0 0 var(--s3); }
.ib-prose ul, .ib-prose ol { padding-left: 22px; margin: 0 0 var(--s3); }
.ib-prose li { margin: 3px 0; }
.ib-prose li::marker { color: var(--ib-purple-500); }
.ib-prose h2 { font: 700 var(--ib-fs-lg) var(--ib-font-display); color: var(--ib-gold-500); text-shadow: var(--ib-text-shadow-gold); text-transform: uppercase; margin: var(--s6) 0 var(--s3); }
.ib-prose h3 { font: 700 var(--ib-fs-md) var(--ib-font-display); color: var(--ib-purple-300); margin: var(--s5) 0 var(--s2); }
.ib-prose strong { color: #fff; }
.ib-table-wrap { overflow-x: auto; margin: 0 0 var(--s4); max-width: 100%; }
.ib-table { border-collapse: collapse; width: 100%; font-size: var(--ib-fs-sm); background: var(--ib-surface); border: var(--ib-bw) solid var(--ib-border); }
.ib-table th { text-align: left; padding: 8px 10px; background: var(--ib-surface-3); color: var(--ib-gold-300); font: 700 var(--ib-fs-2xs) var(--ib-font-display); text-transform: uppercase; letter-spacing: .05em; }
.ib-table td { padding: 7px 10px; border-top: 1px solid var(--ib-border); vertical-align: top; }
.ib-table tr:hover td { background: var(--ib-surface-2); }

/* ---------- search ---------- */
.ib-search { position: relative; flex: 1; max-width: 520px; }
.ib-search__box { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; background: var(--ib-bg-deep); border: var(--ib-bw) solid var(--ib-border-strong); box-shadow: var(--ib-bevel-in); }
.ib-search__box:focus-within { border-color: var(--ib-purple-500); }
.ib-search__box input { all: unset; flex: 1; min-width: 0; color: var(--ib-text); font: var(--ib-fs-sm) var(--ib-font-body); }
.ib-search__box input::placeholder { color: var(--ib-text-faint); }
.ib-search__glass { width: 14px; height: 14px; border: 2px solid var(--ib-text-faint); border-radius: 50%; position: relative; flex: none; }
.ib-search__glass::after { content: ""; position: absolute; width: 6px; height: 2px; background: var(--ib-text-faint); right: -6px; bottom: -3px; transform: rotate(45deg); }
.ib-search__drop { position: absolute; left: 0; right: 0; top: 42px; z-index: 60; max-height: min(70vh, 620px); overflow: auto; display: none;
  background: var(--ib-surface); border: var(--ib-bw) solid var(--ib-purple-600); box-shadow: var(--ib-drop), 0 18px 40px rgba(0,0,0,.5); }
.ib-search__drop.is-open { display: block; }
.ib-search__group { padding: 6px 10px 2px; font: 700 var(--ib-fs-2xs) var(--ib-font-display); text-transform: uppercase; letter-spacing: .08em; color: var(--kind, var(--ib-text-faint)); display: flex; }
.ib-search__group span { margin-left: auto; color: var(--ib-text-faint); }
.ib-hit { display: flex; align-items: center; gap: 10px; padding: 6px 10px; color: var(--ib-text); text-decoration: none !important; border-left: 3px solid transparent; }
.ib-hit:hover, .ib-hit.is-sel { background: var(--ib-surface-3); border-left-color: var(--ib-gold-500); color: #fff; }
.ib-hit .ib-icon { --sz: 28px; }
.ib-hit__t { display: block; }
.ib-hit__t mark { background: none; color: var(--ib-gold-300); text-decoration: underline; text-underline-offset: 2px; }
.ib-hit__s { display: block; font-size: var(--ib-fs-xs); color: var(--ib-text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px; }
.ib-hit__k { margin-left: auto; }
.ib-search__foot { padding: 6px 10px; border-top: 1px solid var(--ib-border); font-size: var(--ib-fs-xs); color: var(--ib-text-faint); display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- AntOS monitor ---------- */
.ib-monitor { background: #2a2d33; padding: 12px; border: 2px solid #000; box-shadow: inset 0 0 0 2px #3c4048, var(--ib-drop); }
.ib-screen { position: relative; background: radial-gradient(ellipse at center, #07140c 0%, var(--ib-antos-screen) 75%); border: 2px solid #000; overflow: hidden; color: var(--ib-antos-300); font-family: var(--ib-font-mono); }
.ib-screen--scan::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px); z-index: 4; }
.ib-osbar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: var(--ib-antos-900); border-bottom: 1px solid var(--ib-antos-800); font-size: var(--ib-fs-xs); color: var(--ib-antos-500); position: relative; z-index: 5; flex-wrap: wrap; }
.ib-osbar img { width: 16px; height: 16px; }
.ib-osbar__sp { flex: 1; }
.ib-osbtn { all: unset; cursor: pointer; padding: 2px 8px; border: 1px solid var(--ib-antos-700); color: var(--ib-antos-500); font: var(--ib-fs-xs) var(--ib-font-mono); }
.ib-osbtn:hover, .ib-osbtn.is-on { background: #0f2a18; color: var(--ib-antos-300); }
.ib-osbtn:focus-visible { outline: 1px solid var(--ib-antos-300); }
.ib-term { padding: var(--s4); line-height: 1.6; }
.ib-term a { color: var(--ib-antos-300); text-decoration: underline; }

/* task map svg */
.ib-map { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.ib-map.is-drag { cursor: grabbing; }
.ib-map .edge { fill: none; stroke: var(--ib-antos-700); stroke-width: 3; }
.ib-map .edge.is-dashed { stroke-dasharray: 6 5; }
.ib-map .edge.is-hl { stroke: var(--ib-gold-500); stroke-width: 4; }
.ib-map .edge.is-done { stroke: #8a7414; }
.ib-map .node { cursor: pointer; }
.ib-map .node .shape { fill: #0b1f13; stroke: var(--ib-antos-500); stroke-width: 2.5; }
.ib-map .node.is-locked .shape { fill: #0a0f0c; stroke: #2a5a3b; }
.ib-map .node.is-locked image { opacity: .45; }
.ib-map .node.is-done .shape { fill: #3a3000; stroke: var(--ib-gold-500); }
.ib-map .node.is-hl .shape { stroke: var(--ib-gold-500); stroke-width: 4.5; }
.ib-map .node.is-sel .shape { fill: #1a3d26; stroke-width: 4; }
.ib-map .node.is-focus .shape { animation: ib-pulse 1.2s ease-in-out 3; }
.ib-map .node text.lbl { font: 11px var(--ib-font-body); fill: #cfe; paint-order: stroke; stroke: var(--ib-antos-screen); stroke-width: 3; text-anchor: middle; pointer-events: none; }
.ib-map .node text.ph { font: 700 10px var(--ib-font-mono); fill: #bfffd4; text-anchor: middle; pointer-events: none; }
.ib-map .node .check { fill: var(--ib-gold-500); stroke: #000; stroke-width: 1; }
.ib-map .catnode rect { fill: #0b1f13; stroke: var(--ib-antos-500); stroke-width: 2; }
.ib-map .catnode:hover rect { stroke: var(--ib-gold-500); }
.ib-map .catnode text { fill: #cfe; font: 12px var(--ib-font-body); text-anchor: middle; }
.ib-map .catnode .cnt { fill: var(--ib-antos-500); font: 11px var(--ib-font-mono); }
.ib-map .grouplbl { fill: var(--ib-antos-700); font: 700 13px var(--ib-font-display); letter-spacing: .1em; text-anchor: middle; text-transform: uppercase; }
@keyframes ib-pulse { 50% { stroke: #fff; stroke-width: 6; } }
.ib-mapside { position: absolute; z-index: 6; top: 40px; right: 10px; bottom: 10px; width: 340px; padding: 14px; overflow: auto;
  background: rgba(6, 16, 10, .96); border: 1px solid var(--ib-antos-700); color: #cfe; font: var(--ib-fs-sm) var(--ib-font-body);
  transform: translateX(370px); transition: transform var(--ib-med); }
.ib-mapside.is-open { transform: none; }
.ib-mapside h3 { margin: 0 0 4px; color: var(--ib-antos-500); font: 700 var(--ib-fs-md) var(--ib-font-display); }
.ib-mapside a { color: var(--ib-antos-300); }
.ib-maplegend { position: absolute; z-index: 5; left: 10px; bottom: 10px; padding: 6px 8px; background: rgba(3,8,6,.85); border: 1px solid var(--ib-antos-800); font: var(--ib-fs-2xs) var(--ib-font-mono); color: #8fdcaa; }
.ib-maplegend i { display: inline-block; width: 10px; height: 10px; margin: 0 4px 0 10px; border: 2px solid; vertical-align: -1px; }

/* ---------- bestiary cards + portrait ---------- */
.ib-bestiary { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }
.ib-bestiary--strip { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.ib-mobcard { display: flex; flex-direction: column; align-items: center; padding: var(--s2) var(--s2) var(--s3); text-align: center; text-decoration: none !important;
  background: radial-gradient(ellipse at 50% 35%, var(--ib-surface-3) 0%, var(--ib-surface) 70%); border: var(--ib-bw) solid var(--ib-border); box-shadow: var(--ib-bevel); color: var(--ib-text); }
.ib-mobcard:hover { border-color: var(--kind-mob); color: #fff; transform: translateY(-1px); }
.ib-mobcard__pic { width: 128px; height: 128px; display: grid; place-items: center; }
.ib-mobcard__pic img { width: 128px; height: 128px; object-fit: contain; filter: drop-shadow(0 4px 0 rgba(0,0,0,.35)); }
.ib-bestiary--strip .ib-mobcard__pic, .ib-bestiary--strip .ib-mobcard__pic img { width: 96px; height: 96px; }
.ib-mobcard.is-egg .ib-mobcard__pic { opacity: .9; }
.ib-mobcard__n { font-weight: 600; font-size: var(--ib-fs-sm); line-height: 1.25; }
.ib-mobcard__s { font-size: var(--ib-fs-2xs); color: var(--ib-text-faint); margin-top: 2px; }
.ib-portrait { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: var(--s5); padding: var(--s4);
  background: radial-gradient(ellipse at 50% 40%, #2b313a 0%, var(--ib-bg-deep) 75%); border: var(--ib-bw) solid var(--ib-border); box-shadow: var(--ib-bevel-in); }
.ib-portrait img { width: 256px; height: 256px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 8px 0 rgba(0,0,0,.35)); }
.ib-portrait span { font-size: var(--ib-fs-xs); }

/* ---------- misc ---------- */
.ib-empty { padding: var(--s6); text-align: center; color: var(--ib-text-faint); border: 2px dashed var(--ib-border); }
.ib-sep { height: 2px; background: var(--ib-border); border: 0; margin: var(--s5) 0; }
.ib-count { font: var(--ib-fs-2xs) var(--ib-font-mono); color: var(--ib-text-faint); }
.ib-skeleton { background: linear-gradient(90deg, var(--ib-surface) 0, var(--ib-surface-2) 50%, var(--ib-surface) 100%); background-size: 200% 100%; animation: ib-shimmer 1.2s infinite; }
@keyframes ib-shimmer { to { background-position: -200% 0; } }
.ib-more { display: block; width: 100%; margin-top: var(--s2); padding: 6px; background: var(--ib-surface-2); border: 1px dashed var(--ib-border-strong); color: var(--ib-text-muted); cursor: pointer; font: var(--ib-fs-xs) var(--ib-font-body); }
.ib-more:hover { color: #fff; border-color: var(--ib-purple-500); }
