/* ===================== Onde é usado? (whereused.js) ===================== */
/* celular primeiro; só classes .wu-*; cores das variáveis do site (style.css) */
.wu-root { max-width: 900px; min-width: 0; }
.wu-root * { min-width: 0; }
.wu-head { margin-bottom: 16px; padding-left: 14px; border-left: 6px solid var(--s5, var(--accent)); }
.wu-head h1 { margin: 0 0 6px; font-size: clamp(28px, 7vw, 44px); line-height: 1.1; }
.wu-lead { margin: 0; color: var(--muted); font-size: 16px; max-width: 65ch; }
.wu-hint { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.wu-credit { margin-top: 24px; font-size: 12px; color: var(--muted); }
.wu-back { display: inline-flex; align-items: center; min-height: 40px; margin-bottom: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.wu-back:hover { color: var(--accent); }

/* busca */
.wu-picker { position: relative; max-width: 640px; margin: 0 0 20px; }
.wu-input {
  width: 100%; min-height: 52px; padding: 12px 16px; font: inherit; font-size: 17px;
  border-radius: 12px; border: 1px solid var(--line-2, var(--line)); background: var(--panel); color: var(--text);
}
.wu-input::placeholder { color: var(--muted); opacity: 1; }
.wu-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 194, 48, .25); }
.wu-list {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; max-height: min(60vh, 440px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow, 0 14px 30px rgba(0, 0, 0, .4));
}
.wu-opt { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; color: var(--text); text-decoration: none; }
.wu-opt:hover, .wu-opt[aria-selected="true"] { background: var(--panel-2); }
.wu-opt[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--accent); }
.wu-opt-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wu-opt small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.wu-opt-none { color: var(--muted); }
.wu-opt-img { flex: none; width: 32px; height: 32px; object-fit: contain; border-radius: 6px; background: var(--bg-2); }

/* atalhos (mais procurados) */
.wu-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.wu-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px 10px;
  min-height: 44px; text-align: center; text-decoration: none; color: var(--text); font-size: 13px;
  background: var(--panel); border-radius: 14px; border-left: 5px solid var(--wu-r, var(--line-2, var(--line)));
}
.wu-tile:hover { background: var(--panel-2); }
.wu-tile small { color: var(--muted); font-size: 12px; }
.wu-tile-name { font-weight: 600; overflow-wrap: anywhere; }
.wu-tile-img { width: 56px; height: 56px; object-fit: contain; }

/* item não encontrado */
.wu-missing { margin: 0 0 14px; padding: 14px 16px; background: var(--panel); border-radius: 12px; border-left: 5px solid var(--s1, var(--accent)); }
.wu-missing h2 { margin: 0 0 4px; font-size: 20px; }
.wu-missing p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }

/* cabeçalho do item */
.wu-item {
  display: flex; gap: 14px; align-items: center; margin: 0 0 14px; padding: 14px;
  background: var(--panel); border-radius: 14px; border-top: 4px solid var(--wu-r, var(--line-2, var(--line)));
}
.wu-img { flex: none; width: 80px; height: 80px; object-fit: contain; border-radius: 10px; background: var(--bg-2); }
.wu-img.ph, .wu-tile-img.ph, .wu-opt-img.ph, .wu-row-img.ph {
  display: grid; place-items: center; font-weight: 800; color: var(--muted); background: var(--panel-2); border-radius: 10px;
}
.wu-img.ph { font-size: 32px; }
.wu-name { margin: 0; font-size: clamp(24px, 6vw, 36px); line-height: 1.15; overflow-wrap: anywhere; }
.wu-en { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.wu-meta { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.wu-rar { font-weight: 700; color: var(--text); }
.wu-price { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: var(--text); }
.wu-r-comum { --wu-r: var(--comum); } .wu-r-incomum { --wu-r: var(--incomum); } .wu-r-rara { --wu-r: var(--rara); }
.wu-r-epica { --wu-r: var(--epica); } .wu-r-lendaria { --wu-r: var(--lendaria); }
/* --rara (#3d8bd4) fica abaixo de 4,5:1 como texto sobre --panel: aí o nome da raridade usa a cor do texto */
.wu-item.wu-r-comum .wu-rar, .wu-item.wu-r-incomum .wu-rar, .wu-item.wu-r-epica .wu-rar, .wu-item.wu-r-lendaria .wu-rar { color: var(--wu-r); }

/* resumo "guardar ou vender?" */
.wu-sum { margin: 0 0 14px; padding: 16px; background: var(--panel-2); border-radius: 14px; border-left: 6px solid var(--muted); }
.wu-sum.wu-keep { border-left-color: var(--accent); }
.wu-sum.wu-sell { border-left-color: var(--ok, #6db33f); }
.wu-sum.wu-craft { border-left-color: var(--s5, #2a9d8f); }
.wu-sum-h { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.wu-need { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.wu-need-l { font-size: 16px; }
.wu-big { font-size: 40px; line-height: 1; font-weight: 800; color: var(--accent); }
.wu-sell .wu-big, .wu-craft .wu-big { color: var(--text); }
.wu-split { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.wu-verdict { margin: 10px 0 0; font-size: 18px; font-weight: 700; color: var(--text); }
.wu-notes { margin: 8px 0 0; padding-left: 18px; font-size: 14px; color: var(--muted); }
.wu-notes li + li { margin-top: 2px; }

/* links para Sucata e Planejador */
.wu-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.wu-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px;
  border-radius: 999px; border: 2px solid var(--text); color: var(--text); text-decoration: none; font-weight: 700; font-size: 14px;
}
.wu-btn:hover { background: rgba(242, 238, 230, .08); }

/* seções de uso */
.wu-sec { margin-top: 22px; }
.wu-sec h2 { margin: 0 0 4px; font-size: 20px; }
.wu-count { font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--muted); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.wu-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wu-row-in {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px;
  background: var(--panel); border-radius: 10px; color: var(--text); text-decoration: none;
}
a.wu-row-in:hover { background: var(--panel-2); }
.wu-row-main { flex: 1; display: flex; flex-direction: column; }
.wu-row-name { display: flex; align-items: center; gap: 8px; font-weight: 600; overflow-wrap: anywhere; }
.wu-row-sub { font-size: 13px; color: var(--muted); }
.wu-row-img { flex: none; width: 32px; height: 32px; object-fit: contain; }
.wu-qty { flex: none; font-weight: 800; font-size: 16px; color: var(--accent); white-space: nowrap; }
.wu-tag { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--panel-3, var(--panel-2)); color: var(--text); }
.wu-tag-done { color: var(--ok, #6db33f); }
.wu-row.is-done .wu-row-name { text-decoration: line-through; color: var(--muted); }
.wu-row.is-done .wu-qty { color: var(--muted); }
.wu-row.is-off .wu-qty { color: var(--muted); }
.wu-empty { padding: 20px 0; color: var(--muted); }

@media (min-width: 700px) {
  .wu-tiles { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .wu-tile-img { width: 64px; height: 64px; }
  .wu-img { width: 112px; height: 112px; }
  .wu-item { padding: 18px 20px; gap: 20px; }
  .wu-sum { padding: 18px 20px; }
  .wu-big { font-size: 48px; }
}
