/* Biblioteca de builds (prefixo bd-) */

.bd-topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 20px; }
.bd-topo h1 { margin: 0; }
.bd-intro { margin: 8px 0 0; color: var(--suave); max-width: 600px; }
.bd-filtros .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------- filtros ---------------- */
.bd-filtros { display: grid; gap: 12px; margin-bottom: 8px; }
.bd-filtros .busca input { min-height: 46px; }
.bd-fil-linha { display: flex; gap: 8px; flex-wrap: wrap; }
.bd-fil {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--linha2); background: var(--sup); color: var(--suave); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .12s; white-space: nowrap;
}
.bd-fil b { font-size: 12px; font-weight: 700; color: var(--apagado); font-variant-numeric: tabular-nums; }
.bd-fil svg { width: 15px; height: 15px; color: var(--cor, currentColor); }
.bd-fil:hover { background: var(--sup3); color: var(--texto); border-color: #4a403c; }
.bd-fil:active { transform: scale(.96); }
.bd-fil.on { background: rgba(217, 180, 95, .13); border-color: var(--ouro); color: var(--ouro); }
.bd-fil.on b { color: var(--ouro-esc); }
.bd-fil-cl.on { background: color-mix(in srgb, var(--cor) 16%, transparent); border-color: var(--cor); color: var(--texto); }
.bd-conta { margin: 4px 2px 12px; color: var(--apagado); font-size: 13px; }

/* ---------------- cartoes ---------------- */
.bd-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.bd-cartao {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 16px; overflow: hidden;
  border-radius: var(--raio); background: var(--sup); border: 1px solid var(--linha);
  transition: border-color .15s, transform .2s var(--mola), box-shadow .2s;
  animation: bd-entra .3s ease-out backwards;
}
.bd-cartao::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--cor); opacity: .75;
}
.bd-cartao:hover { border-color: color-mix(in srgb, var(--cor) 55%, var(--linha2)); transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0, 0, 0, .35); }
.bd-cartao:active { transform: translateY(-1px) scale(.995); }
@keyframes bd-entra { from { opacity: 0; transform: translateY(6px); } }
.bd-cartao-topo { display: flex; gap: 14px; align-items: center; min-width: 0; }
.bd-cartao-tit { display: grid; gap: 8px; min-width: 0; }
.bd-cartao-tit h3 { font-size: 19px; overflow-wrap: anywhere; }
.bd-resumo {
  margin: 0; color: var(--suave); font-size: 14px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bd-cartao .build-linha { flex-wrap: nowrap; }

.bd-classe {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 99px; font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--cor); background: color-mix(in srgb, var(--cor) 13%, transparent);
}
.bd-classe svg { width: 12px; height: 12px; }

/* icone da arma com brilho da classe */
.bd-arma {
  position: relative; display: inline-grid; place-items: center; flex: none; width: calc(var(--t) * 1px); height: calc(var(--t) * 1px);
  border-radius: 18px; background:
    radial-gradient(circle at 50% 58%, color-mix(in srgb, var(--cor) 42%, transparent), transparent 70%),
    rgba(0, 0, 0, .28);
  border: 1px solid color-mix(in srgb, var(--cor) 30%, transparent);
  box-shadow: 0 0 26px color-mix(in srgb, var(--cor) 24%, transparent);
}
.bd-arma.t64 { --t: 64; border-radius: 16px; }
.bd-arma.t96 { --t: 96; }
.bd-arma img { width: 118%; height: 118%; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); transition: transform .3s var(--mola); }
.bd-cartao:hover .bd-arma img { transform: scale(1.08) rotate(-3deg); }
.bd-arma i { display: grid; place-items: center; color: var(--cor); }
.bd-arma i svg { width: 40%; height: 40%; }
.bd-arma.t64 { overflow: hidden; }
.bd-arma.t96 { overflow: hidden; }

.bd-vazio { padding: 56px 20px; }
.bd-vazio h2 { color: var(--texto); }
.bd-vazio-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; color: var(--ouro); background: rgba(217, 180, 95, .1); }
.bd-vazio-ic svg { width: 30px; height: 30px; }
.bd-sem { grid-column: 1 / -1; margin: 0; }

/* ---------------- detalhe ---------------- */
.bd-hero {
  display: grid; grid-template-columns: auto 1fr; gap: 14px 22px; align-items: center; padding: 22px; border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--cor) 28%, var(--linha));
  background: linear-gradient(135deg, color-mix(in srgb, var(--cor) 12%, transparent), transparent 55%), var(--sup);
}
.bd-hero-info { display: grid; gap: 10px; min-width: 0; }
.bd-hero h1 { overflow-wrap: anywhere; }
.bd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 0; color: var(--suave); font-size: 14px; }
.bd-meta span { display: inline-flex; align-items: center; }
.bd-meta svg { color: var(--ouro-esc); margin-right: 7px; }
.bd-meta strong { color: var(--texto); font-weight: 600; margin-left: 4px; }
.bd-hero-acoes { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .06); }

.bd-bloco { margin-top: 6px; }
.bd-itens { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bd-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border-radius: 12px; background: var(--sup); border: 1px solid var(--linha);
  min-width: 0; transition: border-color .15s, transform .2s var(--mola), background .15s;
}
.bd-item:hover { border-color: var(--ouro-esc); background: var(--sup2); transform: translateY(-2px); }
.bd-item > div { display: grid; min-width: 0; line-height: 1.25; }
.bd-item small { color: var(--apagado); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.bd-item strong { font-size: 14px; overflow-wrap: anywhere; }
.bd-item-ic {
  position: relative; display: grid; place-items: center; flex: none; width: 58px; height: 58px; border-radius: 10px; overflow: hidden;
  background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .06);
}
.bd-item-ic img { width: 118%; height: 118%; object-fit: contain; }
.bd-item-ic i { font-style: normal; color: var(--apagado); font-size: 12px; font-weight: 700; }
.bd-item-ic .enc { position: absolute; right: 4px; bottom: 2px; font-size: 10px; font-weight: 800; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.bd-item-ic .enc.e1 { color: #7fe39b; } .bd-item-ic .enc.e2 { color: #6fb7ff; } .bd-item-ic .enc.e3 { color: #c58cff; } .bd-item-ic .enc.e4 { color: #ffd36b; }
.bd-item.duas, .bd-item.livre { opacity: .6; border-style: dashed; }
.bd-item.duas:hover, .bd-item.livre:hover { transform: none; border-color: var(--linha); background: var(--sup); }

.bd-resumo-grande { margin: 0; font-size: 16.5px; line-height: 1.65; color: var(--texto); max-width: 760px; }
.bd-texto { max-width: 760px; }
.bd-texto p { margin: 0 0 14px; line-height: 1.7; color: #ddd4ca; }
.bd-texto p:last-child { margin-bottom: 0; }

.bd-habs { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.bd-hab { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--sup); border: 1px solid var(--linha); transition: border-color .15s, transform .2s var(--mola); }
.bd-hab:hover { border-color: var(--ouro-esc); transform: translateY(-2px); }
.bd-hab > div { display: grid; gap: 4px; min-width: 0; }
.bd-hab strong { font-size: 15px; overflow-wrap: anywhere; }
.bd-hab p { margin: 0; color: var(--suave); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.bd-tecla {
  display: grid; place-items: center; flex: none; min-width: 46px; height: 46px; padding: 0 8px; border-radius: 11px; max-width: 92px;
  font-family: Cinzel, serif; font-weight: 700; font-size: 17px; color: #1c1307; background: linear-gradient(180deg, #e4c272, var(--ouro));
  box-shadow: 0 4px 14px rgba(217, 180, 95, .2); text-align: center; line-height: 1.1; overflow-wrap: anywhere;
}
.bd-tecla.vazia { background: var(--sup3); color: var(--apagado); box-shadow: none; }
.bd-dicas { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 760px; }
.bd-dicas li { position: relative; padding: 11px 14px 11px 40px; border-radius: 12px; background: var(--sup); border: 1px solid var(--linha); line-height: 1.55; overflow-wrap: anywhere; }
.bd-dicas li::before { content: ''; position: absolute; left: 16px; top: 19px; width: 9px; height: 9px; border-radius: 3px; background: var(--ouro); transform: rotate(45deg); }

.bd-copia { font-size: 14px; line-height: 1.5; font-family: ui-monospace, Consolas, monospace; }

/* ---------------- editor ---------------- */
.bd-form { display: grid; gap: 16px; margin-top: 6px; }
.bd-fs { border: 1px solid var(--linha); border-radius: var(--raio); padding: 18px; margin: 0; background: var(--sup); display: grid; gap: 14px; min-width: 0; }
.bd-fs legend { padding: 0 8px; font-family: Cinzel, serif; font-weight: 700; color: var(--ouro); }
.bd-fs .dica { margin: 0; }
.bd-fs label small { margin-left: 6px; }
.bd-grade-form { display: grid; grid-template-columns: 2fr 1.4fr 1fr; gap: 14px; align-items: start; }
.bd-cat-campo { display: grid; gap: 10px; }
.bd-rotulo { font-size: 13px; color: var(--suave); font-weight: 500; margin-bottom: -6px; }
.bd-classes-sel { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 8px; }
.bd-cl {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 7px 12px 7px 8px; border-radius: 12px; cursor: pointer; text-align: left;
  border: 1px solid var(--linha2); background: var(--sup2); color: var(--suave); font-weight: 600; font-size: 14px;
  transition: border-color .15s, background .15s, color .15s, transform .12s;
}
.bd-cl:hover { color: var(--texto); border-color: color-mix(in srgb, var(--cor) 55%, var(--linha2)); }
.bd-cl:active { transform: scale(.97); }
.bd-cl.on { color: var(--texto); border-color: var(--cor); background: color-mix(in srgb, var(--cor) 15%, var(--sup2)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--cor) 40%, transparent); }
.bd-editor { padding: 14px; border-radius: 12px; background: rgba(0, 0, 0, .22); border: 1px dashed var(--linha2); display: flex; justify-content: center; overflow: hidden; }
.bd-editor .build-linha { flex-wrap: nowrap; }
.bd-lista { display: grid; gap: 10px; }
.bd-lin { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: var(--sup2); border: 1px solid var(--linha); animation: bd-entra .2s ease-out; }
.bd-lin-cab { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; align-items: center; }
.bd-lin-cab:has(> textarea) { grid-template-columns: 1fr auto; align-items: start; }
.bd-lin-acoes { display: flex; gap: 6px; }
.bd-lin .btn-icone { width: 44px; height: 44px; }
.bd-lin .btn-icone:disabled { opacity: .3; pointer-events: none; }
.bd-fs .btn.pequeno { justify-self: start; min-height: 44px; }
.bd-dica-vazia { padding: 4px 2px; }
.bd-cont { float: right; color: var(--apagado); font-variant-numeric: tabular-nums; }
.bd-cont.perto { color: #f0a33a; }
.bd-alta { min-height: 220px; line-height: 1.6; }

/* ---------------- celular e tablet ---------------- */
@media (max-width: 980px) {
  .bd-itens { grid-template-columns: repeat(2, 1fr); }
  .bd-grade-form { grid-template-columns: 1fr 1fr; }
  .bd-l-nome { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .bd-topo { align-items: stretch; }
  .bd-topo > .btn { width: 100%; }
  .bd-grade { grid-template-columns: 1fr; }
  .bd-fil-linha { flex-wrap: nowrap; overflow-x: auto; margin-inline: -12px; padding: 2px 12px 4px; scrollbar-width: none; }
  .bd-fil-linha::-webkit-scrollbar { display: none; }
  .bd-hero { grid-template-columns: 1fr; padding: 18px; border-radius: 18px; }
  .bd-hero h1 { font-size: 26px; }
  .bd-hero-acoes { display: grid; grid-template-columns: 1fr 1fr; }
  .bd-hero-acoes .btn { padding: 0 10px; white-space: normal; text-align: center; line-height: 1.2; }
  .bd-hero-acoes .btn.ouro, .bd-hero-acoes .btn:nth-child(2) { grid-column: 1 / -1; }
  .bd-itens { grid-template-columns: 1fr; gap: 8px; }
  .bd-habs { grid-template-columns: 1fr; }
  .bd-fs { padding: 14px; }
  .bd-grade-form { grid-template-columns: 1fr; }
  .bd-classes-sel { grid-template-columns: 1fr 1fr; }
  /* 8 quadrados em 4 colunas, bons para o toque */
  .bd-editor { padding: 12px; }
  .bd-editor .build-linha { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
  .bd-editor .build-linha .eq { width: 100%; height: auto; aspect-ratio: 1; }
  .bd-lin-cab { grid-template-columns: 104px 1fr; }
  .bd-lin-cab .bd-lin-acoes { grid-column: 1 / -1; justify-content: flex-end; }
  .bd-lin-cab:has(> textarea) { grid-template-columns: 1fr; }
  .bd-lin-cab:has(> textarea) .bd-lin-acoes { grid-column: auto; }
}
@media (hover: none) {
  .bd-cartao:hover, .bd-item:hover, .bd-hab:hover { transform: none; box-shadow: none; }
  .bd-cartao:hover .bd-arma img { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bd-cartao, .bd-lin { animation: none !important; }
  .bd-cartao:hover, .bd-item:hover, .bd-hab:hover { transform: none; }
}

.bd-rot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bd-cont { float: none; margin-left: 0; }
.bd-meta strong + * { margin: 0; }
