/* ---------- Recipe viewer (recipes.html) ----------
   Recipe cards borrow the Minecraft inventory GUI: light grey bevelled panel, inset slots, grey arrow.
   Everything else follows the site tokens in style.css. */

.rv-spoiler { display: flex; gap: 10px; align-items: flex-start; background: rgba(245, 197, 24, .08); border: 1px solid rgba(245, 197, 24, .35);
  border-radius: 12px; padding: 10px 14px; color: var(--text); font-size: .92rem; margin: 0 0 22px; max-width: 760px; }
.rv-spoiler b { color: var(--yellow); }

/* toolbar */
.rv-bar { position: sticky; top: var(--nav-h); z-index: 20; background: rgba(11, 20, 12, .94); backdrop-filter: blur(8px);
  padding: 12px 0 10px; margin: 0 0 14px; border-bottom: 1px solid var(--card-2); }
.rv-search { display: flex; align-items: center; gap: 10px; background: var(--card); border: 2px solid var(--card-2); border-radius: 12px; padding: 0 14px; }
.rv-search:focus-within { border-color: var(--green); }
.rv-search .ic { width: 18px; height: 18px; opacity: .7; flex: none; }
.rv-search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); font: inherit; font-size: 1rem; padding: 12px 0; outline: none; }
.rv-search input::-webkit-search-cancel-button { filter: invert(1); }
.rv-chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.rv-chips::-webkit-scrollbar { display: none; }
.rv-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border-radius: 999px; border: 1px solid var(--card-2);
  background: var(--card); color: var(--text); font: inherit; font-size: .88rem; cursor: pointer; white-space: nowrap; }
.rv-chip:hover { border-color: var(--green-dark); }
.rv-chip[aria-pressed="true"] { background: var(--green-dark); border-color: var(--green); color: #fff; }
.rv-chip .n { color: var(--muted); font-size: .78rem; }
.rv-chip[aria-pressed="true"] .n { color: #d9f2d3; }
.rv-chip.plain { padding-left: 12px; }
.rv-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--muted); font-size: .9rem; margin: 0 0 16px; min-height: 1.6em; }
.rv-focus { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--green-dark); border-radius: 10px; padding: 4px 6px 4px 8px; color: var(--text); }
.rv-focus b { color: var(--yellow); font-weight: 600; }
.rv-x { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: 1.1rem; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.rv-x:hover { color: var(--text); background: var(--card-2); }
.rv-tabs { display: inline-flex; border: 1px solid var(--card-2); border-radius: 10px; overflow: hidden; }
.rv-tabs button { background: var(--card); color: var(--muted); border: 0; font: inherit; font-size: .85rem; padding: 4px 12px; cursor: pointer; }
.rv-tabs button[aria-pressed="true"] { background: var(--green-dark); color: #fff; }
.rv-tabs button:disabled { opacity: .45; cursor: default; }

/* sprite icons */
.ico-i { display: inline-block; width: 32px; height: 32px; background-image: url(/assets/recipes/items.png?v=f1d307ee); background-repeat: no-repeat;
  image-rendering: pixelated; flex: none; }
.ico-i.sm { width: 20px; height: 20px; }

/* recipe grid of cards */
.rv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.rc { --slot: 40px; background: #c6c6c6; color: #3f3f3f; border-radius: 6px; padding: 10px 12px 12px;
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #555, 0 0 0 2px #000; }
.rc-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; min-height: 22px; }
.rc-title { flex: 1; min-width: 0; font-weight: 600; font-size: .95rem; line-height: 1.25; color: #3f3f3f; background: none; border: 0; padding: 0;
  font-family: inherit; text-align: left; cursor: pointer; }
.rc-title:hover { text-decoration: underline; }
.rc-st { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; color: #555; white-space: nowrap; }
.rc-body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rc-grid { display: grid; gap: 0; }
.rc-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 44px; }
.rc-note { font-size: .7rem; color: #555; line-height: 1.1; text-align: center; }
.rc-arrow { width: 32px; height: 22px; position: relative; }
.rc-arrow::before { content: ""; position: absolute; left: 0; top: 7px; width: 20px; height: 8px; background: #8b8b8b; }
.rc-arrow::after { content: ""; position: absolute; left: 18px; top: 0; border: 11px solid transparent; border-left: 13px solid #8b8b8b; border-right: 0; }
.rc-flame { width: 14px; height: 14px; background: linear-gradient(#ffb84a, #e2621b); clip-path: polygon(50% 0, 85% 45%, 75% 100%, 25% 100%, 15% 45%); opacity: .85; }
.rc-shapeless { font-size: .68rem; color: #555; }
.rc-id { margin: 8px 0 0; font-size: .68rem; color: #6b6b6b; font-family: ui-monospace, monospace; overflow-wrap: anywhere; }

.slot { width: var(--slot); height: var(--slot); background: #8b8b8b; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff;
  display: grid; place-items: center; position: relative; border: 0; padding: 0; margin: 0; cursor: pointer; }
.slot.empty { cursor: default; }
.slot:not(.empty):hover { background: #9d9d9d; }
.slot:focus-visible { outline: 3px solid var(--yellow); outline-offset: -1px; z-index: 1; }
.slot.out { --slot: 52px; }
.slot .cnt { position: absolute; right: 3px; bottom: 1px; font-weight: 700; font-size: .85rem; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; line-height: 1; }
.slot .tagdot { position: absolute; left: 3px; top: 2px; width: 6px; height: 6px; background: var(--yellow); box-shadow: 1px 1px 0 #3f3f3f; }

.rv-more { display: block; margin: 22px auto 0; }
.rv-empty { text-align: center; color: var(--muted); padding: 40px 0; }
.rv-sentinel { height: 1px; }

/* Minecraft-style tooltip (mouse only) */
.mc-tip { position: fixed; z-index: 300; pointer-events: none; background: rgba(16, 0, 16, .94); color: #fff; padding: 5px 8px 6px;
  border-radius: 3px; box-shadow: inset 0 0 0 2px #2a0d5e, 0 0 0 1px #100010; font-size: .85rem; line-height: 1.3; max-width: 260px; }
.mc-tip small { display: block; color: #a9a9ff; font-size: .74rem; }
.mc-tip[hidden] { display: none; }
.mc-tip .tip-n { color: #fff; margin-bottom: 2px; }
.mc-tip .lo { display: flex; align-items: center; flex-wrap: wrap; min-height: 18px; font-size: .82rem; }
.mc-tip .lo > span { display: inline-flex; align-items: center; white-space: pre-wrap; }
.mc-tip .lo-v { display: inline-flex; align-items: center; font-weight: 600; white-space: pre; }
.mc-tip .lo-k { color: #9a9ab8; font-size: .74rem; white-space: pre; }
.mc-tip .lo-dur { color: #9a9ab8; font-size: .74rem; margin-top: 2px; }
/* datapack font glyphs (hearts, sword, armor...), tinted by the lore colour */
.gl { display: inline-block; flex: none; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url(/assets/recipes/glyphs.png?v=436c5eed) 0 0 / 256px 96px no-repeat; mask: url(/assets/recipes/glyphs.png?v=436c5eed) 0 0 / 256px 96px no-repeat; }
.rv-stats.mc-tip { position: static; max-width: none; margin: 0 0 14px; padding: 8px 12px 9px; pointer-events: auto; }

/* item sheet (tap) */
.rv-sheet-bg { position: fixed; inset: 0; z-index: 250; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; }
.rv-sheet-bg[hidden] { display: none; }
.rv-sheet { width: min(460px, 100%); background: var(--card); border: 2px solid var(--green-dark); border-bottom: 0; border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0, 0, 0, .5); animation: rv-up .18s ease-out; }
@media (min-width: 700px) {
  .rv-sheet-bg { align-items: center; }
  .rv-sheet { border-radius: 18px; border-bottom: 2px solid var(--green-dark); }
}
@keyframes rv-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rv-sheet { animation: none; } }
.rv-sheet-top { display: flex; gap: 14px; align-items: center; margin: 0 0 14px; }
.rv-sheet-top .slot { --slot: 60px; cursor: default; }
.rv-sheet-top .slot .ico-i { transform: scale(1.5); }
.rv-sheet h2 { font-size: 1.25rem; text-align: left; margin: 0; color: var(--yellow); }
.rv-sheet .sub { color: var(--muted); font-size: .8rem; font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.rv-sheet .btn-row { justify-content: stretch; gap: 10px; }
.rv-sheet .btn { flex: 1; justify-content: center; padding: 12px 14px; font-size: .95rem; }
.rv-sheet .btn[disabled] { opacity: .45; pointer-events: none; }
.rv-alts { margin: 14px 0 0; }
.rv-alts p { margin: 0 0 6px; color: var(--muted); font-size: .85rem; }
.rv-alts .row { display: flex; flex-wrap: wrap; gap: 4px; }
.rv-alts .slot { --slot: 40px; }
.rv-close { position: absolute; }

@media (max-width: 600px) {
  .rv-bar { top: var(--nav-h); }
  .rc { --slot: 38px; }
}
.rv-more[hidden], .rv-sheet-bg[hidden] { display: none; }
@media (min-width: 900px) { .rv-chips { flex-wrap: wrap; overflow: visible; } }
.rv-sheet .bedrock { color: var(--text); font-size: .88rem; margin: 2px 0; }
.rv-sheet .bedrock b { color: var(--green); font-weight: 600; }
