/* Path: static/crafting.css
   Purpose: the crafting panel (static/crafting.js): the bench name, the materials grid and the recipes
   list with their needs and Make buttons. Its stacking comes from static/windows.js. */

.craft-box { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100% - 32px));
  max-height: calc(100% - 24px); overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box; display: grid; gap: 10px;
  padding: 16px; background: rgba(7,11,20,.96); border: 1px solid rgba(155,232,155,.45); color: #dcebff; font-size: 13px; }
.craft-box header { display: flex; align-items: center; gap: 10px; }
.craft-box h3 { flex: 1; min-width: 0; margin: 0; font: 400 20px var(--f-type); color: #eaf4ff; overflow-wrap: anywhere; }
.craft-box h4 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #7f9bb8; }
.craft-box p { margin: 0; }
.craft-icon { flex: none; display: block; width: 46px; height: 16px; }
.craft-icon svg { display: block; width: 100%; height: 100%; }
.craft-none { color: #7f9bb8; }

/* The nine materials, three to a row; a material with none in the bag is dimmed. */
.craft-mats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 8px; }
.craft-mats li { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 3px 0; }
.craft-mats li.none { opacity: .4; }
/* A long name ("Circuit board") wraps rather than being cut off. */
.craft-mats .name { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.2; font-size: 12px; }
.craft-mats .craft-icon { width: 30px; }
.craft-mats .count { flex: none; font-variant-numeric: tabular-nums; color: #eaf4ff; }

/* Each recipe: what it makes and its button or the bench it needs, then what it takes. */
.craft-recipes { list-style: none; margin: 0; padding: 0; display: grid; }
.craft-recipes li { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.craft-recipes li:first-child { border-top: 0; }
.craft-top { display: flex; align-items: center; gap: 8px; }
.craft-top b { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.craft-top .act { flex: none; }
.craft-at { flex: none; font-size: 12px; color: #7f9bb8; }
.craft-recipes li.above b { color: #b9cbe0; }
.craft-needs { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: #b9cbe0; }
.craft-needs .short { color: #f08a7a; }

html.bk-touch-ui .craft-box button { min-height: 44px; min-width: 44px; }
html.bk-touch-ui .craft-recipes li { min-height: 44px; }
/* A phone on its side: less padding, and the materials four to a row so the recipes show sooner. */
@media (max-height: 500px) {
  .craft-box { padding: 10px 12px; gap: 6px; width: min(560px, calc(100% - 32px)); }
  .craft-box h3 { font-size: 17px; }
  .craft-mats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .craft-recipes li { padding: 4px 0; }
}
