/* v2 build bar (bottom centre): lacquer tabs on top, a dó-paper body in a dark frame with the chain strip and a row of
   large painted tiles; the road · fold · demolish medallions hang on its lower edge. */
.bb {
  position: absolute;
  bottom: var(--bb-bottom, 4px);
  left: var(--bb-x, 50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  padding-bottom: 18px;
  width: var(--bb-w, auto);
  transform: translateX(-50%);
}
.bb > * {
  zoom: var(--bb-zoom, 1);
}
.bb__tabs {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 0 16px;
  overflow: hidden;
}
.btab {
  position: relative;
  top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 36px;
  padding: 0 12px 4px 5px;
  border: 1px solid var(--then-600);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: var(--black);
  color: var(--paper-200);
  font-size: 12.5px;
  font-weight: 600;
}
.btab.is-on {
  top: 4px;
  height: 40px;
  border-color: var(--vang-500);
  background: var(--red);
  color: var(--vang-200);
  box-shadow: inset 0 1px 0 rgba(239, 200, 112, 0.45);
}
.btab .portrait {
  width: 24px;
  height: 24px;
  box-shadow: 0 0 0 1.5px var(--tone);
}
.btab__icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--vang-200);
}
.btab__name {
  font-family: var(--font-title);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}
.btab.is-locked {
  color: var(--muc-400);
}
.btab.is-locked .portrait {
  filter: grayscale(1) brightness(0.8);
}
.bb.tabs-compact .btab:not(.is-on) .btab__name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.bb__body {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px 12px 20px;
  background-color: var(--paper-200);
}
.bb.is-collapsed .bb__body {
  display: none;
}
.bb.is-collapsed .bb__tabs {
  padding-bottom: 6px;
  border-radius: 12px;
  background: var(--black);
  box-shadow: inset 0 0 0 1px rgba(200, 161, 84, 0.5), var(--shadow);
}
.bb.is-collapsed .btab {
  top: 0;
  border-bottom: 1px solid var(--then-600);
  border-radius: 9px;
  margin-top: 6px;
}
/* chain strip */
.bb__chains {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 52px;
  padding: 0 4px;
  overflow: hidden;
  border-bottom: 1px solid rgba(188, 148, 90, 0.5);
}
.bb__chains--hint {
  gap: 8px;
  color: var(--text-2);
  font-size: 12.5px;
}
.chain {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 2px 8px;
  border-radius: 10px;
}
.chain[hidden] {
  display: none;
}
.chain.is-focus {
  background: rgba(246, 232, 197, 0.7);
  box-shadow: inset 0 0 0 1px var(--paper-400);
}
.cnode {
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: 46px;
}
.cnode small {
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.cnode__img {
  width: 34px;
  height: 30px;
  object-fit: contain;
}
.cnode__img--good {
  width: 26px;
  height: 26px;
  margin: 2px 4px;
}
.cnode__img--glyph {
  display: grid;
  place-items: center;
  height: 30px;
  color: var(--text-2);
}
.cnode.is-on small {
  color: var(--title);
}
.cnode--good small {
  color: var(--title);
  font-weight: 700;
}
.carrow {
  color: var(--muc-500);
}
.cop {
  color: var(--muc-500);
  font-weight: 700;
}
/* tile row */
.bb__rowwrap {
  position: relative;
  min-width: 0;
}
.bb__row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  padding: 4px 2px 2px;
}
.bb__row::-webkit-scrollbar {
  display: none;
}
.bgroup {
  display: flex;
  gap: 6px;
  flex: none;
}
.bgroup__sep {
  flex: none;
  align-self: stretch;
  width: 1px;
  margin: 4px 6px 22px;
  background: linear-gradient(180deg, transparent, var(--paper-400) 20%, var(--paper-400) 80%, transparent);
}
.btile {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 3px;
  flex: none;
  width: 80px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}
.btile__pic {
  display: grid;
  place-items: center;
  width: 76px;
  height: 64px;
  border: 1px solid var(--paper-400);
  border-radius: 9px;
  background: radial-gradient(circle at 50% 38%, var(--paper-50), var(--paper-200));
  box-shadow: 0 1px 2px rgba(36, 27, 18, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btile__img {
  width: 70px;
  height: 60px;
  object-fit: contain;
}
.btile__img--good {
  width: 42px;
  height: 42px;
}
.btile__img--glyph {
  display: grid;
  place-items: center;
  color: var(--text-2);
}
.btile.is-temp .btile__pic {
  border-style: dashed;
}
.btile__name {
  width: 100%;
  min-height: 28px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}
.btile__key {
  position: absolute;
  top: -4px;
  left: 0;
  min-width: 17px;
  height: 17px;
  font-size: 10px;
}
.btile--tool .btile__pic {
  color: var(--text-2);
}
.btile--up .btile__pic {
  gap: 0;
  grid-auto-flow: column;
  color: var(--muc-500);
  position: relative;
}
.btile__count {
  position: absolute;
  right: 3px;
  bottom: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: var(--vang-200);
  font-size: 11px;
  line-height: 18px;
}
.btile:hover .btile__pic,
.btile.is-hover .btile__pic {
  border-color: var(--vang-600);
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px var(--vang-400), 0 6px 12px rgba(36, 27, 18, 0.3);
}
.btile.is-suggested .btile__pic {
  box-shadow: 0 0 0 2px var(--ngoc-500), 0 0 0 5px rgba(47, 96, 96, 0.3);
}
.btile__new {
  position: absolute;
  top: -6px;
  right: 0;
}
.bb__scroll {
  position: absolute;
  top: 26px;
  z-index: 2;
  --orb: max(30px, var(--tap));
  display: grid;
  place-items: center;
  width: var(--orb);
  height: var(--orb);
  padding: 0;
  border: 1px solid var(--then-900);
  border-radius: 50%;
  background: var(--red-btn);
  color: var(--vang-200);
  box-shadow: inset 0 0 0 1.5px var(--vang-500), var(--shadow);
}
.bb__scroll[hidden] {
  display: none;
}
.bb__scroll--l {
  left: -6px;
}
.bb__scroll--r {
  right: -6px;
}
.bb__locked {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 96px;
  padding: 0 20px;
  color: var(--text-muted);
}
.bb__tools {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
}
.bb__tools .orb {
  --orb: max(36px, var(--tap));
}
.bb.is-collapsed {
  padding-bottom: 22px;
}

/* the hover card: what it makes, what it costs (as the concept's "Lò gạch" card) */
.bcard {
  position: absolute;
  z-index: 20;
  left: var(--card-x, 40%);
  bottom: var(--card-b, 260px);
  width: 270px;
  padding: 12px 14px;
  border-width: 3px;
}
.bcard__head {
  display: flex;
  gap: 10px;
  align-items: center;
}
.bcard__img {
  width: 56px;
  height: 50px;
  object-fit: contain;
  flex: none;
}
.bcard__img--good {
  width: 40px;
  height: 40px;
}
.bcard h3 {
  margin: 0;
  color: var(--title);
  font: 700 18px var(--font-head);
}
.bcard p {
  margin: 2px 0 0;
  color: var(--text-2);
  font-size: 12.5px;
}
.bcard__label {
  margin: 8px 0 4px;
  padding-top: 6px;
  border-top: 1px solid var(--paper-400);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}
.bcard__costs {
  display: grid;
  gap: 3px;
}
.bcard__costs span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.bcard__costs b {
  min-width: 42px;
  text-align: right;
}
.bcard__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-2);
}
.bcard__facts span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.bcard__foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--title);
  font-size: 12px;
  font-weight: 600;
}
.bcard::after {
  content: '';
  position: absolute;
  left: var(--card-arrow, 50%);
  bottom: -10px;
  width: 14px;
  height: 14px;
  background: var(--paper-100);
  border-right: 3px solid var(--son-frame);
  border-bottom: 3px solid var(--son-frame);
  transform: translateX(-50%) rotate(45deg);
}
