/* Combo Codex (js/ui/recipeBook.js + js/ui/codex/*). Layers on css/recipes.css; class names rb-* kept for e2e. */
.rb-codex { --rb-ink: #3a2410; }
.rb-head { flex-wrap: wrap; row-gap: 2px; }
.rb-discovered { font-size: 15px; color: #6a4a1c; }
.rb-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 2px 22px 6px; flex: none; }
.rb-tools select, .rb-tools button { font: inherit; font-size: 14px; color: var(--rb-ink); background: linear-gradient(#ead6ac, #cfb585); border: 2px solid #5a3b17; border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.rb-tools .rb-near-toggle.on { background: #ffd100; }
.rb-chain-select { display: none; }

.rb-body { min-width: 0; }
.rb-rail { flex: 0 0 196px; overflow-y: auto; padding: 4px 6px 10px 0; }
.rb-rail-group h4 { margin: 10px 0 3px; font-family: var(--font-head); font-size: 15px; color: #6a4a1c; letter-spacing: .04em; text-transform: uppercase; }
.rb-rail-item { display: flex; width: 100%; justify-content: space-between; align-items: baseline; gap: 6px; text-align: left; font: inherit; font-size: 14px; color: var(--rb-ink);
  background: transparent; border: 0; border-left: 3px solid transparent; border-radius: 3px; padding: 4px 6px; cursor: pointer; }
.rb-rail-item small { font-size: 12px; color: #7a5a2c; white-space: nowrap; }
.rb-rail-item:hover { background: rgba(90, 59, 23, .14); }
.rb-rail-item.on { background: rgba(90, 59, 23, .26); border-left-color: #5a3b17; font-weight: bold; }
.rb-group h3 small, .rb-chain-title small { font-size: 13px; color: #7a5a2c; font-family: inherit; }

/* tree mode: the page becomes a single scroll box */
.rb-page.rb-treemode { display: block; overflow: auto; }
.rb-chain-title { margin: 0 0 6px; font-family: var(--font-head); font-size: 24px; color: #4a2c0e; }
.rb-tree { position: relative; }
.rb-canvas { position: relative; }
.rb-edges { position: absolute; inset: 0; pointer-events: none; }
.rb-edge { stroke: #7a5a2c; stroke-width: 3; opacity: .55; transition: opacity .15s; }
.rb-edge.known { opacity: 1; }
.rb-edge.er-uncommon { stroke: #1a9c00; } .rb-edge.er-rare { stroke: #0b5fb8; } .rb-edge.er-epic { stroke: #8a2bd0; } .rb-edge.er-legendary { stroke: #d96a00; }
.rb-edge.catalyst { stroke-dasharray: 7 5; }
.rb-glyph { fill: #3a2410; stroke: #f0dca8; stroke-width: 1; }
.rb-edge.rb-near { stroke-width: 5; opacity: 1; }
.rb-edge.rb-dim, .rb-glyph.rb-dim { opacity: .18; }
.rb-edge.rb-faded, .rb-glyph.rb-faded { opacity: .12; }

.rb-node { position: absolute; width: 112px; margin-left: -30px; padding: 0 0 0 30px; box-sizing: border-box; display: flex; flex-direction: column; align-items: flex-start; font: inherit; background: none; border: 0; text-align: left; color: var(--rb-ink); cursor: pointer; transition: opacity .15s; }
.rb-node.rb-faded { opacity: .22; }
.rb-ico { display: block; width: 52px; height: 52px; border: 3px solid #4a3010; border-radius: 7px; background: #2a1a0c; overflow: hidden; margin-left: -0px; }
.rb-ico img { width: 100%; height: 100%; display: block; }
.rb-node.r-uncommon .rb-ico { border-color: #1eff00; } .rb-node.r-rare .rb-ico { border-color: #0070dd; }
.rb-node.r-epic .rb-ico { border-color: #a335ee; } .rb-node.r-legendary .rb-ico { border-color: #ff8000; }
.rb-name, .rb-riddle { display: block; width: 104px; margin-left: -28px; font-size: 11px; line-height: 1.15; text-shadow: 0 1px 0 #000; overflow: hidden; max-height: 26px; }
.rb-name { text-align: center; } .rb-riddle { text-align: center; font-style: italic; color: #5a3b17; text-shadow: none; }
.rb-node.st-silhouette .rb-ico img { filter: brightness(0); }
.rb-node.st-seen .rb-ico img { opacity: .85; }
.rb-node:hover .rb-ico, .rb-node:focus-visible .rb-ico { outline: 3px solid #fff3d0; }
.rb-wild { width: 112px; margin-left: -30px; padding-left: 30px; cursor: default; }
.rb-chip { display: inline-block; margin-top: 14px; padding: 4px 10px; border-radius: 12px; border: 2px dashed #5a3b17; background: rgba(90, 59, 23, .16); font-size: 12px; white-space: nowrap; }

/* results grid + side pane additions */
.rb-result.rb-dim, .rb-recipe.rb-dim { opacity: .3; }
.rb-result.rb-near { outline: 3px solid #ffd100; }
.rb-ing-wild { justify-content: center; }
.rb-ing em { font-size: 11px; color: #6a4a1c; }
.rb-side-head { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rb-side-head small { font-size: 12px; color: #5a3b17; text-shadow: none; text-transform: capitalize; }
.rb-side-head small.rb-riddle-line { font-style: italic; text-transform: none; }
.rb-card-ico { width: 60px; height: 60px; border: 3px solid #4a3010; border-radius: 7px; background: #2a1a0c; overflow: hidden; }
.rb-card-ico img { width: 100%; height: 100%; display: block; }
.rb-card-ico.r-uncommon { border-color: #1eff00; } .rb-card-ico.r-rare { border-color: #0070dd; } .rb-card-ico.r-epic { border-color: #a335ee; } .rb-card-ico.r-legendary { border-color: #ff8000; }
.rb-side h4 { margin: 10px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #6a4a1c; }
.rb-recipe { flex-wrap: wrap; }
.rb-share-box { width: 100%; box-sizing: border-box; font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.rb-calm *, .rb-calm *::before { transition: none !important; animation: none !important; }

@media (max-width: 900px) {
  .rb-overlay { padding: 0; overflow-x: hidden; }
  .rb-book { border-radius: 0; height: 100%; max-width: 100vw; }
  .rb-head { padding: 10px 52px 4px 16px; justify-content: flex-start; }
  .rb-head h2 { font-size: 26px; }
  .rb-tools { padding: 2px 16px 6px; }
  .rb-chain-select { display: inline-block; max-width: 100%; }
  .rb-rail { display: none; }
  .rb-body { flex-direction: column; padding: 4px 16px 12px; gap: 8px; min-height: 0; overflow-y: auto; }
  .rb-page { flex: 0 0 auto; min-height: 220px; max-width: 100%; overflow-x: auto; }
  .rb-page.rb-treemode { max-width: 100%; }
  .rb-side { flex: 0 0 auto; max-height: none; }
}
