:root {
  --bg: #0e0c0b;
  --bg-2: #161311;
  --panel: #1c1815;
  --panel-2: #241f1b;
  --line: #3b322a;
  --line-2: #54473b;
  --text: #ebe2d3;
  --muted: #a39581;
  --dim: #6f6355;
  --gold: #e9c46a;
  --gold-2: #b8913f;
  --good: #8fd16a;
  --bad: #ef7a62;
  --info: #79b8f2;
  --t-projectile: #c0504d;
  --t-static_projectile: #d9893d;
  --t-modifier: #4f8fd6;
  --t-draw_many: #3fb5a7;
  --t-material: #6aa84f;
  --t-other: #9a7b5b;
  --t-utility: #b06fc9;
  --t-passive: #7c9a5a;
  --radius: 6px;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --pixel: "Pixelify Sans", "Inter", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 70px; }
body {
  margin: 0;
  background: var(--bg) radial-gradient(1200px 500px at 50% -200px, #2a1f14 0%, transparent 70%) no-repeat;
  color: var(--text);
  font: 15px/1.6 "Inter", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
img { image-rendering: pixelated; }
code, pre { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--pixel); font-weight: 600; line-height: 1.2; color: var(--gold); }
h1 { font-size: 2rem; margin: 0.2em 0 0.4em; }
h2 { font-size: 1.4rem; margin: 1.6em 0 0.6em; }
h3 { font-size: 1.1rem; margin: 1.3em 0 0.4em; color: var(--text); }
button, input, select {
  font: inherit; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line-2); border-radius: var(--radius); padding: 6px 10px;
}
button { cursor: pointer; }
button:hover { border-color: var(--gold-2); }
button.primary { background: var(--gold-2); color: #1a1208; border-color: var(--gold); font-weight: 600; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 1px; }
input[type="number"] { width: 6.5em; }
input[type="checkbox"] { accent-color: var(--gold-2); width: 16px; height: 16px; }

/* --- barra superior --- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 8px 20px; background: rgba(14, 12, 11, 0.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--gold); text-decoration: none !important; }
.brand-wand { height: 22px; transform: rotate(-30deg); }
.brand-name { font-family: var(--pixel); font-size: 1.25rem; font-weight: 600; white-space: nowrap; }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
.nav a { color: var(--muted); padding: 6px 12px; border-radius: var(--radius); white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav a.active { color: var(--gold); background: var(--panel-2); }
.lang { font-size: 0.85rem; padding: 4px 10px; }

.app { width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 20px 60px; flex: 1; }
.app:focus { outline: none; }
.footer {
  border-top: 1px solid var(--line); color: var(--dim); font-size: 0.82rem;
  padding: 14px 20px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; text-align: center;
}
.loading, .muted { color: var(--muted); }
.error { color: var(--bad); }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 60em; }

/* --- icono de hechizo con marco de tipo --- */
.sicon {
  --s: 32px;
  display: inline-grid; place-items: center; flex: none;
  width: var(--s); height: var(--s);
  background: url(../img/ui/item_bg_other.png) center / 100% 100%;
  image-rendering: pixelated; vertical-align: middle;
}
.sicon img { width: 80%; height: 80%; }
.sicon.empty { background: url(../img/ui/full_inventory_box.png) center / 100% 100%; }
.sicon.t-projectile { background-image: url(../img/ui/item_bg_projectile.png); }
.sicon.t-static_projectile { background-image: url(../img/ui/item_bg_static_projectile.png); }
.sicon.t-modifier { background-image: url(../img/ui/item_bg_modifier.png); }
.sicon.t-draw_many { background-image: url(../img/ui/item_bg_draw_many.png); }
.sicon.t-material { background-image: url(../img/ui/item_bg_material.png); }
.sicon.t-other { background-image: url(../img/ui/item_bg_other.png); }
.sicon.t-utility { background-image: url(../img/ui/item_bg_utility.png); }
.sicon.t-passive { background-image: url(../img/ui/item_bg_passive.png); }
.slink { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.slink span { text-decoration: inherit; }

.badge {
  display: inline-block; font-size: 0.72rem; line-height: 1; padding: 4px 7px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap;
  vertical-align: middle;
}
.badge.type { color: #fff; border-color: transparent; }
.badge.t-projectile { background: var(--t-projectile); }
.badge.t-static_projectile { background: var(--t-static_projectile); }
.badge.t-modifier { background: var(--t-modifier); }
.badge.t-draw_many { background: var(--t-draw_many); }
.badge.t-material { background: var(--t-material); }
.badge.t-other { background: var(--t-other); }
.badge.t-utility { background: var(--t-utility); }
.badge.t-passive { background: var(--t-passive); }
.badge.gold { color: var(--gold); border-color: var(--gold-2); }
.badge.warn { color: var(--bad); border-color: #6b3328; }
.good { color: var(--good); }
.bad { color: var(--bad); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid-2 > * { min-width: 0; }

/* --- inicio --- */
.hero { padding: 20px 0 10px; }
.hero h1 { font-size: 2.6rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 24px; }
.card {
  display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px; color: var(--text); transition: border-color .15s, transform .15s; min-width: 0;
}
.card:hover { border-color: var(--gold-2); text-decoration: none; transform: translateY(-2px); }
.card h3 { margin: 6px 0; color: var(--gold); }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.card .icons { display: flex; gap: 4px; }
.type-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* --- lista de hechizos --- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.filters input[type="search"] { flex: 1 1 280px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip {
  font-size: 0.82rem; padding: 4px 10px; border-radius: 999px; background: var(--panel);
  border: 1px solid var(--line-2); color: var(--muted); display: inline-flex; align-items: center; gap: 6px;
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chip.on { color: var(--text); border-color: var(--gold-2); background: var(--panel-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.spells { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.spells th, table.spells td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.spells th { position: sticky; top: 0; background: var(--panel-2); color: var(--muted); font-weight: 500; cursor: pointer; user-select: none; }
table.spells th.num, table.spells td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.spells tr:hover td { background: var(--panel); }
table.spells td.name { white-space: normal; min-width: 220px; }
table.spells td.name small { display: block; color: var(--dim); font-size: 0.75rem; }
th .arrow { color: var(--gold); }

/* --- ficha de hechizo --- */
.spell-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.spell-head .titles { min-width: 0; flex: 1; }
.spell-head h1 { margin: 0; }
.spell-head .sub { color: var(--muted); font-family: var(--mono); font-size: 0.85rem; }
.spell-desc { font-size: 1.05rem; margin: 14px 0; max-width: 55em; }
dl.stats { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
dl.stats dt { color: var(--muted); display: flex; align-items: center; gap: 8px; }
dl.stats dt img { width: 14px; height: 14px; }
dl.stats dd { margin: 0; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.tiers { display: flex; gap: 6px; align-items: flex-end; height: 90px; margin-top: 8px; }
.tiers .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 0.75rem; color: var(--muted); }
.tiers .bar i { display: block; width: 100%; max-width: 42px; background: var(--gold-2); border-radius: 3px 3px 0 0; min-height: 2px; }
.tiers .bar.off i { background: var(--line); }
pre.code {
  background: #0a0908; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
  overflow-x: auto; line-height: 1.5; margin: 0;
}
.code .kw { color: #d7a65f; } .code .fn { color: #8ec7e8; } .code .num { color: #b7d38b; }
.code .str { color: #d1958a; } .code .com { color: #6f6355; font-style: italic; }
details summary { cursor: pointer; color: var(--muted); }
.proj { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.proj:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.proj-name { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }

/* --- guía --- */
.guide { display: grid; grid-template-columns: 240px 1fr; gap: 28px; }
.guide > * { min-width: 0; }
.toc { position: sticky; top: 70px; align-self: start; font-size: 0.92rem; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: g; }
.toc li { counter-increment: g; }
.toc a { display: block; padding: 5px 10px; border-radius: var(--radius); color: var(--muted); }
.toc a::before { content: counter(g) ". "; color: var(--dim); }
.toc a.active { background: var(--panel-2); color: var(--gold); }
.toc .level { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); margin: 14px 10px 4px; }
.article { max-width: 52em; }
.article p, .article li { color: #ddd3c3; }
.article .note {
  border-left: 3px solid var(--gold-2); background: var(--panel); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 16px 0;
}
.article .note.code-note { border-left-color: var(--info); }
.article table { border-collapse: collapse; margin: 12px 0; font-size: 0.92rem; }
.article th, .article td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.article th { background: var(--panel-2); color: var(--muted); font-weight: 500; }
.article .table-wrap { border: 0; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; border-top: 1px solid var(--line); padding-top: 16px; }

/* demo de varita incrustada en la guía */
.wand-demo {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 14px 0;
}
.wand-demo .slots { display: flex; flex-wrap: wrap; gap: 3px; flex: 1; min-width: 0; }
.wand-demo .meta { font-size: 0.8rem; color: var(--muted); }
.wand-demo a.open { font-size: 0.85rem; white-space: nowrap; }

/* selector de hechizos */
dialog.picker {
  width: min(860px, calc(100vw - 32px)); max-height: min(80vh, 760px); padding: 0;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 12px;
}
dialog.picker::backdrop { background: rgba(0, 0, 0, 0.6); }
.picker-head { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; background: var(--bg-2); }
.picker-head input { flex: 1 1 200px; min-width: 0; }
.picker-body { padding: 12px; overflow-y: auto; max-height: calc(min(80vh, 760px) - 120px); }
.picker-group h4 { margin: 10px 0 6px; font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.picker-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.picker-grid button { padding: 0; border: 0; background: none; border-radius: 4px; }
.picker-grid button:hover { outline: 2px solid var(--gold); }
.picker-hover { padding: 8px 12px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); min-height: 2.6em; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--gold-2); color: #1a1208;
  padding: 8px 16px; border-radius: 999px; font-weight: 600; z-index: 50;
}

@media (max-width: 900px) {
  .guide { grid-template-columns: 1fr; }
  .toc { position: static; }
}
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 16px; }
  .nav { order: 3; flex-basis: 100%; }
  .brand-name { font-size: 1.05rem; }
  .app { padding: 16px 16px 40px; }
  .hero h1 { font-size: 2rem; }
}

/* --- varitas: histogramas --- */
.hist-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.hist { margin: 0; min-width: 0; }
.hist figcaption { font-size: 0.85rem; margin-bottom: 4px; display: flex; justify-content: space-between; gap: 8px; }
.hist svg { width: 100%; height: auto; display: block; }
.hist .axis { fill: var(--dim); font-size: 10px; }
.hist .hbar:hover path { fill: var(--gold); }
.toc li.level { counter-increment: none; }
.toc summary { display: none; }
.article table { display: block; overflow-x: auto; max-width: 100%; }
.article pre.code { max-width: 100%; }
@media (max-width: 900px) {
  .toc summary {
    display: block; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius); color: var(--gold);
  }
  .toc details[open] summary { margin-bottom: 6px; }
}

/* --- ficha flotante de hechizo --- */
.spell-tip {
  position: fixed; z-index: 100; pointer-events: none; width: 280px;
  background: #0b0908f2; border: 1px solid var(--gold-2); border-radius: 8px; padding: 10px 12px;
  font-size: 0.82rem; box-shadow: 0 8px 24px #000a;
}
.spell-tip .tip-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.spell-tip strong { font-family: var(--pixel); color: var(--gold); font-size: 1rem; font-weight: 600; }
.spell-tip p { margin: 6px 0; color: var(--muted); }
.spell-tip dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; }
.spell-tip dt { color: var(--dim); }
.spell-tip dd { margin: 0; font-variant-numeric: tabular-nums; }
.spell-tip .tip-id { font-family: var(--mono); color: var(--dim); font-size: 0.7rem; margin-top: 6px; }

/* --- simulador (estilo Tinker with Wands) --- */
.tw { display: grid; gap: 10px; }
.tw > * { min-width: 0; }
.tw-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px;
  border-bottom: 2px solid var(--line-2); margin-top: 14px;
}
.tw-tab {
  margin: 0; padding: 6px 22px 4px 10px; font-size: 1.05rem; color: var(--text);
  border: 2px solid var(--line-2); border-bottom: 0; border-radius: 4px 18px 0 0; background: var(--panel);
  position: relative; top: 2px;
}
.tw-tools { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 4px; }
.tw-tools button { font-family: var(--pixel); font-size: 0.85rem; padding: 3px 9px; background: var(--panel); }
.wand-box {
  display: grid; grid-template-columns: 250px 1fr; gap: 16px;
  border: 2px solid var(--gold-2); border-radius: 4px; padding: 12px; background: #0b0908;
}
.wand-box > * { min-width: 0; }
.wb-stats { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; align-items: center; font-family: var(--pixel); font-size: 0.92rem; }
.wb-stats label { color: var(--text); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.wb-stats label img { width: 14px; height: 14px; }
.wb-stats .st-val { display: flex; align-items: center; gap: 4px; min-width: 0; }
.wb-stats input[type="number"] {
  width: 100%; min-width: 0; background: transparent; border: 1px solid transparent; padding: 1px 4px;
  font-family: var(--pixel); color: var(--gold);
}
.wb-stats input[type="number"]:hover, .wb-stats input[type="number"]:focus { border-color: var(--line-2); background: var(--panel-2); }
.wb-stats i { font-style: normal; color: var(--dim); }
.wb-slots { display: grid; gap: 10px; align-content: start; }
.slots-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.slot { width: 48px; height: 48px; padding: 0; border: 0; background: none; position: relative; border-radius: 3px; }
.slot .sicon { --s: 48px; }
.slot:hover { outline: 2px solid var(--gold-2); }
.slot.sel { outline: 2px solid var(--gold); box-shadow: 0 0 8px #e9c46a66; }
.slot.drag-over, .palette.drag-over { outline: 2px dashed var(--gold); }
.slot .idx { position: absolute; right: 2px; bottom: 0; font-size: 0.62rem; color: var(--muted); pointer-events: none; font-family: var(--pixel); }
.always-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wb-label { font-family: var(--pixel); font-size: 0.9rem; display: flex; gap: 6px; align-items: center; }
.wb-label img { width: 14px; height: 14px; }
.wb-hint { margin: 0; font-size: 0.78rem; color: var(--dim); }
.palette { border: 2px solid var(--line-2); border-radius: 4px; background: #0b0908; }
.pal-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); align-items: center; }
.pal-tab { font-size: 0.8rem; padding: 3px 9px; display: inline-flex; align-items: center; gap: 5px; background: var(--panel); }
.pal-tab .dot { width: 8px; height: 8px; border-radius: 50%; }
.pal-tab.on { border-color: var(--gold); color: var(--gold); }
.pal-tabs input { flex: 1 1 180px; min-width: 0; padding: 3px 8px; }
.pal-grid { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px; max-height: 330px; overflow-y: auto; }
.pal-grid button { padding: 0; border: 0; background: none; border-radius: 3px; cursor: grab; }
.pal-grid button:hover { outline: 2px solid var(--gold); }
.cast-cfg { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 0.88rem; }
.cc-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px; }
.cc-field { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.cc-field input { width: 6.5em; padding: 2px 6px; }
.cc-chk, .view-chk { display: flex; gap: 4px; align-items: center; color: var(--muted); white-space: nowrap; }
.view-chk { font-size: 0.82rem; padding: 0 4px; }
.sim-summary .summary-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.sim-casts { display: grid; gap: 10px; }
.cast { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.cast.reload { border-color: #5a4626; }
.cast-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 0.84rem; color: var(--muted); }
.cast-head strong { color: var(--text); font-family: var(--pixel); font-size: 1.05rem; font-weight: 600; }
.wrapb { font-size: 0.65rem; background: #3d2b12; color: var(--gold); padding: 2px 5px; border-radius: 4px; }
.cb-sec { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: start; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 8px; }
.cb-sec > * { min-width: 0; }
.cb-label { font-family: var(--pixel); font-size: 0.8rem; color: var(--dim); padding-top: 8px; }
.cnt { font-family: var(--pixel); font-size: 0.75rem; color: var(--gold); margin-left: 2px; }
/* proyectiles */
.pt { display: flex; flex-direction: column; gap: 4px; }
.pt-item { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.pt-self { display: inline-flex; align-items: flex-end; }
.pt-payload { display: flex; align-items: flex-start; gap: 6px; padding-left: 6px; border-left: 2px solid var(--t-draw_many); }
.pt-arrow { color: var(--t-draw_many); font-size: 0.75rem; white-space: nowrap; padding-top: 10px; }
/* acciones */
.acts { display: flex; flex-wrap: wrap; gap: 8px 4px; align-items: center; }
.act-wrap { display: inline-flex; align-items: flex-end; }
.act { position: relative; display: inline-block; line-height: 0; }
.act.skip { opacity: 0.45; }
.act-b {
  position: absolute; left: -3px; top: -4px; font: 600 0.58rem/1 var(--pixel); padding: 2px 3px; border-radius: 3px;
  background: #2b4a6b; color: #cfe6ff;
}
.act.call .act-b { background: #6b2b4e; color: #ffd0ea; }
.act.always .act-b { background: var(--gold-2); color: #1a1208; }
.act.skip .act-b { background: #5a1f17; color: #ffb3a5; }
.act-i { position: absolute; right: -2px; bottom: -3px; font: 0.6rem/1 var(--pixel); color: var(--text); background: #000a; padding: 1px 2px; border-radius: 2px; }
.act-r { position: absolute; left: -3px; bottom: -3px; font: 0.6rem/1 var(--pixel); background: #5b3fa0; color: #fff; padding: 1px 3px; border-radius: 2px; }
.act-w { position: absolute; right: -3px; top: -4px; font: 600 0.55rem/1 var(--pixel); background: #3d2b12; color: var(--gold); padding: 2px 3px; border-radius: 3px; }
.act-sep { color: var(--t-draw_many); font-size: 0.75rem; padding: 0 4px; }
/* árbol horizontal */
.ht { display: flex; flex-direction: column; gap: 3px; }
.ht .ht { border-left: 2px solid var(--line-2); padding-left: 8px; margin-left: 4px; }
.ht-row { display: flex; align-items: flex-start; gap: 6px; }
.ht-self { flex: none; padding-top: 4px; }
.ht-pay { color: var(--t-draw_many); font-size: 0.75rem; white-space: nowrap; padding-top: 8px; }
.cb-states { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.shot { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 0.86rem; min-width: 0; }
.shot h4 { margin: 0 0 6px; font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.shot .projs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.shot ul { margin: 0; padding-left: 18px; color: var(--muted); }
.tnode { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
/* diálogos del simulador */
.dlg-title { font-family: var(--pixel); color: var(--gold); flex: 1; align-self: center; }
.preset-list { display: grid; gap: 4px; }
.preset { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--panel); padding: 5px 8px; flex-wrap: wrap; }
.preset-name { min-width: 170px; font-weight: 500; }
.preset-icons { display: flex; gap: 1px; flex-wrap: wrap; }
.exp-row { display: grid; grid-template-columns: 170px 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; color: var(--muted); }
.exp-row input { min-width: 0; font-family: var(--mono); font-size: 0.8rem; }
.cfg-row { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; }
.picker-body h4 { color: var(--muted); font-weight: 500; margin: 12px 0 4px; }
.picker-body textarea { background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; padding: 8px; font-family: var(--mono); }
.sim-credit { font-size: 0.78rem; margin-top: 18px; }
@media (max-width: 900px) {
  .wand-box { grid-template-columns: 1fr; }
  .cb-sec { grid-template-columns: 1fr; gap: 4px; }
  .cb-label { padding-top: 0; }
  .exp-row { grid-template-columns: 1fr auto; }
  .exp-row span { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .slot { width: 40px; height: 40px; }
  .slot .sicon { --s: 40px; }
}
/* mosaicos de resumen y línea de tiempo (simulador y varitas) */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat-tile { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.stat-tile .v { font-family: var(--pixel); font-size: 1.4rem; color: var(--gold); }
.stat-tile .l { font-size: 0.78rem; color: var(--muted); }
.timeline { width: 100%; height: 46px; display: block; margin-top: 12px; }
/* números pequeños legibles (la fuente pixel confunde 2 y 8 a este tamaño) */
.cnt, .act-i, .act-r, .slot .idx { font-family: "Inter", system-ui, sans-serif; font-weight: 600; }
.cnt { font-size: 0.8rem; }
@media (min-width: 901px) { .wand-box { grid-template-columns: 340px 1fr; } }
.wb-stats { grid-template-columns: minmax(0, 1fr) 96px; }
.wb-stats label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wb-stats label img { flex: none; }
/* cifras siempre en fuente legible */
.stat-tile .v, .cast-head strong, .wb-stats input[type="number"] {
  font-family: "Inter", system-ui, sans-serif; font-weight: 700; font-variant-numeric: tabular-nums;
}
.stat-tile .v { font-size: 1.3rem; }
