:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --text: #1d2026;
  --muted: #646b78;
  --line: #dde0e6;
  --accent: #2f7d4a;
  --accent-soft: #e3f1e7;
  --slot: #8b8b8b;
  --slot-dark: #373737;
  --slot-light: #ffffff;
  --slot-bg: #8b8b8b;
  --head: #1f2a24;
  --head-text: #eef3ef;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181d;
    --panel: #1e2229;
    --text: #e3e6eb;
    --muted: #98a0ad;
    --line: #2f3540;
    --accent: #5fc07f;
    --accent-soft: #1f3327;
    --head: #10140f;
    --head-text: #e3efe6;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
img.px { image-rendering: pixelated; image-rendering: crisp-edges; }

/* Barra superior */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px 20px;
       background: var(--head); color: var(--head-text); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--head-text); font-weight: 700; font-size: 18px; white-space: nowrap; }
.brand img { width: 32px; height: 32px; }
.brand:hover { text-decoration: none; }
.lang { color: var(--head-text); border: 1px solid #ffffff44; padding: 4px 10px; border-radius: 6px; white-space: nowrap; }
.menu { display: none; background: none; border: 0; color: var(--head-text); font-size: 22px; cursor: pointer; }
.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search input { width: 100%; padding: 8px 12px; border-radius: 6px; border: 0; font: inherit; background: #ffffff1a; color: var(--head-text); }
.search input::placeholder { color: #ffffff99; }
#results { position: absolute; top: 42px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
           box-shadow: 0 8px 24px #0004; max-height: 420px; overflow: auto; display: none; }
#results.open { display: block; }
#results a { display: flex; align-items: center; gap: 10px; padding: 6px 12px; color: var(--text); }
#results a small { margin-left: auto; color: var(--muted); }
#results a:hover, #results a.sel { background: var(--accent-soft); text-decoration: none; }
#results img { width: 32px; height: 32px; }

/* Estructura */
.wrap { display: flex; max-width: 1280px; margin: 0 auto; }
.side { width: 250px; flex-shrink: 0; padding: 20px 16px; position: sticky; top: 56px; align-self: flex-start;
        max-height: calc(100vh - 56px); overflow: auto; font-size: 14px; }
.side h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 6px; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: block; padding: 3px 8px; border-radius: 5px; color: var(--text); }
.side li a:hover { background: var(--accent-soft); text-decoration: none; }
.side .home { font-weight: 600; padding: 3px 8px; }
main { flex: 1; min-width: 0; padding: 24px 28px 48px; background: var(--panel); border-left: 1px solid var(--line);
       border-right: 1px solid var(--line); min-height: calc(100vh - 56px); }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px; border-top: 1px solid var(--line); }
h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.25; }
h2 { margin: 28px 0 12px; font-size: 20px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
h3 { margin: 20px 0 8px; font-size: 17px; }
.muted { color: var(--muted); }
.lead { font-size: 17px; }
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 12px; }

/* Ítem */
.item-head { display: flex; align-items: center; gap: 18px; margin-bottom: 12px; }
.item-head img.big { width: 96px; height: 96px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.meta { margin: 0; color: var(--muted); font-size: 13px; }
.info { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 6px; }

/* Tarjetas */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.item-link { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); }
.item-link:hover { border-color: var(--accent); text-decoration: none; background: var(--accent-soft); }
.item-link img { width: 32px; height: 32px; flex-shrink: 0; }
.inline-item { white-space: nowrap; }
.inline-item img { width: 20px; height: 20px; vertical-align: -4px; margin-right: 3px; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.cat { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.cat img { width: 40px; height: 40px; }
.cat small { margin-left: auto; color: var(--muted); }
.cat:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.guide-list { columns: 2; padding-left: 20px; }

/* Recetas al estilo del inventario de Minecraft */
.recipe { display: inline-flex; flex-direction: column; gap: 6px; margin: 0 14px 14px 0; padding: 12px; background: #c6c6c6;
          border: 2px solid; border-color: #ffffff #555555 #555555 #ffffff; border-radius: 4px; vertical-align: top; color: #222; }
.recipe-body { display: flex; align-items: center; gap: 10px; }
.recipe .grid { display: grid; grid-template-columns: repeat(3, 40px); }
.recipe .row { display: flex; flex-wrap: wrap; max-width: 200px; }
.slot { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
        background: var(--slot-bg); border: 2px solid; border-color: var(--slot-dark) var(--slot-light) var(--slot-light) var(--slot-dark); }
.slot img { width: 32px; height: 32px; }
a.slot:hover { background: #a8a8a8; text-decoration: none; }
.slot .count { position: absolute; right: 1px; bottom: -2px; color: #fff; font: 700 13px/1 system-ui, sans-serif; text-shadow: 1px 1px 0 #3f3f3f; }
.slot .tagmark { position: absolute; left: 2px; top: 0; color: #ffe066; font: 700 11px/1 system-ui, sans-serif; text-shadow: 1px 1px 0 #3f3f3f; }
.arrow { font-size: 26px; color: #555; }
.station { font-size: 13px; color: #333; }
.station a { color: #1b5e33; }
.station .note { color: #555; }

/* Guías */
.guide { max-width: 820px; }
.guide p, .guide li { max-width: 760px; }
.table { overflow-x: auto; }
table { border-collapse: collapse; margin: 12px 0; font-size: 14px; }
th, td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
th { background: var(--accent-soft); }

/* Celular */
@media (max-width: 860px) {
  .menu { display: block; }
  .side { display: none; position: fixed; top: 56px; left: 0; bottom: 0; width: 280px; max-height: none; background: var(--panel);
          border-right: 1px solid var(--line); z-index: 9; }
  body.nav-open .side { display: block; }
  main { padding: 18px 16px 40px; border: 0; }
  .top { gap: 10px; padding: 10px 12px; }
  .brand span, .brand { font-size: 16px; }
  .guide-list { columns: 1; }
}
@media (max-width: 520px) {
  .recipe { display: flex; margin-right: 0; }
  .brand { font-size: 0; }
  .brand img { width: 28px; height: 28px; }
}
