/* Recipes book overlay (js/ui/recipeBook.js) + the shop button that opens it */
.scene .sign.recipes-btn { border: 0; cursor: pointer; display: inline-block; transition: transform .12s; }
.scene .sign.recipes-btn:hover { transform: scale(1.06) rotate(-1deg); }
@media (max-width: 900px) { .scene .sign.recipes-btn { display: inline-block; font-size: 16px; padding: 4px 16px; } }

.rb-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(8, 4, 0, .78); display: flex; align-items: center; justify-content: center; padding: 18px; }
.rb-book { position: relative; width: min(1180px, 100%); height: min(780px, 100%); display: flex; flex-direction: column; border-radius: 10px; color: #3a2410;
  background: radial-gradient(ellipse at 50% 45%, #ecd6a4 0%, #dcc08a 55%, #b8935a 88%, #7a5628 100%);
  box-shadow: inset 0 0 0 3px #5a3b17, inset 0 0 0 5px #e9d29c, inset 0 0 90px rgba(70, 40, 10, .55), 0 10px 40px #000; }
.rb-head { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 14px 56px 6px; position: relative; flex: none; }
.rb-head h2 { font-family: var(--font-head); font-size: 40px; color: #4a2c0e; text-shadow: 0 1px 0 #f6e6c4; margin: 0; }
.rb-count { font-family: var(--font-head); font-size: 22px; color: #6a4a1c; background: rgba(90, 59, 23, .15); padding: 2px 14px; border-radius: 12px; }
.rb-close { position: absolute; right: 14px; top: 12px; width: 38px; height: 38px; border-radius: 50%; border: 2px solid #5a3b17; background: linear-gradient(#e8d2a8, #c9ad7a);
  color: #3a2410; font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 2px 0 #000; }
.rb-close:hover { background: #f0dca8; }
.rb-body { flex: 1; min-height: 0; display: flex; gap: 14px; padding: 6px 22px 22px; }
.rb-page { flex: 1; min-width: 0; overflow-y: auto; padding: 4px 10px 10px 4px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px 26px; }
.rb-group { flex: 0 1 auto; }
.rb-group h3 { font-family: var(--font-head); color: #5a3b17; font-size: 19px; text-shadow: none; margin: 4px 0 4px; border-bottom: 2px solid rgba(90, 59, 23, .35); letter-spacing: .03em; }
.rb-shelf { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 4px 8px; border-bottom: 5px solid #6b4620; border-radius: 0 0 3px 3px; background: linear-gradient(transparent 80%, rgba(60, 35, 10, .25)); max-width: 560px; }
.rb-result { width: 84px; height: 84px; padding: 0; border: 3px solid #4a3010; border-radius: 6px; background: #2a1a0c; cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, .5); overflow: hidden; }
.rb-result img { width: 100%; height: 100%; display: block; }
.rb-result:hover, .rb-result:focus-visible { outline: 3px solid #fff3d0; transform: translateY(-2px); }
.rb-result.r-uncommon { border-color: #1eff00; } .rb-result.r-rare { border-color: #0070dd; }
.rb-result.r-epic { border-color: #a335ee; } .rb-result.r-legendary { border-color: #ff8000; }
.rb-result.unknown { border-color: #6b4620; background: #a98450; }
.rb-result.unknown img { filter: grayscale(1) brightness(.3) contrast(1.8); opacity: .75; }
.rb-side { flex: 0 0 290px; padding: 12px; border-radius: 8px; background: rgba(90, 59, 23, .14); box-shadow: inset 0 0 0 2px rgba(90, 59, 23, .45); overflow-y: auto; }
.rb-side-head { font-family: var(--font-head); font-size: 22px; margin-bottom: 10px; text-align: center; text-shadow: 0 1px 0 #000; }
.rb-recipe { display: flex; align-items: flex-start; justify-content: center; gap: 8px; padding: 8px 0; border-top: 1px dashed rgba(90, 59, 23, .4); }
.rb-ing { display: flex; flex-direction: column; align-items: center; width: 100px; text-align: center; font-size: 13px; gap: 4px; }
.rb-ing img { width: 56px; height: 56px; border: 2px solid #4a3010; border-radius: 5px; background: #2a1a0c; }
.rb-ing span { text-shadow: 0 1px 1px #000; }
.rb-plus { font-family: var(--font-head); font-size: 30px; line-height: 56px; color: #4a2c0e; }
.rb-hint { font-size: 13px; color: #5a3b17; margin: 10px 0 0; }
@media (max-width: 760px) {
  .rb-overlay { padding: 0; }
  .rb-book { border-radius: 0; height: 100%; }
  .rb-head { padding: 10px 52px 4px; } .rb-head h2 { font-size: 28px; } .rb-count { font-size: 16px; }
  .rb-body { flex-direction: column-reverse; padding: 4px 10px 12px; gap: 8px; }
  .rb-side { flex: 0 0 auto; max-height: 34%; }
  .rb-page { gap: 4px 14px; }
  .rb-result { width: 60px; height: 60px; }
}
.scene .top-right { display: flex; align-items: center; gap: 10px; }

/* craft feedback (js/ui/craftFeedback.js): pieces about to fuse glow; a fresh craft flashes; the book ticks crafted recipes */
.piece.craft-hint { animation: crafthint 1.6s ease-in-out infinite; z-index: 3; }
@keyframes crafthint { 0%, 100% { filter: drop-shadow(0 0 2px #ffcf40); } 50% { filter: drop-shadow(0 0 9px #ffe27a) brightness(1.18); } }
.piece.crafted-new { animation: craftednew 1.4s ease-out 2; z-index: 4; }
@keyframes craftednew { 0% { filter: brightness(2.6) drop-shadow(0 0 16px #fff3b0); transform: scale(1.18); } 60% { filter: brightness(1.3) drop-shadow(0 0 10px #ffd24a); transform: scale(1); } 100% { filter: none; transform: none; } }
.combat-log .ll.craft { color: #ffd24a; }
.rb-result { position: relative; }
.rb-result.crafted::after { content: "\2713"; position: absolute; right: -4px; top: -6px; width: 22px; height: 22px; border-radius: 50%; background: #2c7a2c; color: #fff; font-size: 15px; line-height: 22px; text-align: center; box-shadow: 0 1px 0 #000; }

/* shoploop: 'You have n/m' and the Craftable soon count */
.rb-have { align-self: center; font-size: 12px; color: #6a4a1c; margin-left: 6px; } .rb-have.full { color: #2f7a1f; font-weight: bold; }
.recipes-btn .soon-count { margin-left: 6px; padding: 0 6px; border-radius: 9px; font-size: 12px; color: #2a1a0c; background: #ffd100; }
