/* Loja do Aventureiro (loja.js, 28/09/2026): janela larga em três colunas no molde da ficha e do diário de quests — departamentos e
   Supply Pouch à esquerda; ouro, bolsas, a cena do Sam no balcão, filtros e a grade no meio; detalhes e Venda rápida à direita.
   Os títulos usam o .fh-t da ficha. A cena é só arte do acervo (tijolo, tábua, mesa, barril, caixote e o boneco do Sam). */
#jan.jloja { width: min(1560px, 97vw); height: min(900px, 92vh); max-height: 92vh; }
#jan.jloja #janC { display: block; padding: 12px; overflow-y: auto; }
.lj { display: grid; grid-template-columns: 270px minmax(0, 1fr) 330px; gap: 12px; align-items: start; }
.lj .win { box-shadow: 0 0 0 1px #000, 0 0 0 2px #5c4a2c, 0 0 0 3px #1a140c, inset 0 0 0 1px rgba(228,188,108,.14) !important; border-radius: 6px; }
.lj-esq, .lj-meio, .lj-dir { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lj-col { padding: 10px 12px 12px; }
.lj img { image-rendering: pixelated; }
.lj .neg { color: #ff8060 !important; }
.lj-ti { width: 20px; height: 20px; vertical-align: -5px; margin-right: 6px; }
.lj-nota { margin: 8px 0 6px; color: var(--ink-muted); font-size: 12px; }
.lj-nota b { color: var(--ink); }
.lj-larga { width: 100%; }
.lj-vazio { color: var(--ink-muted); font-style: italic; margin: 6px 2px; }

/* esquerda: departamentos */
.lj-deps { display: flex; flex-direction: column; gap: 7px; }
.lj-dep { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; cursor: pointer; text-align: left;
  background: rgba(0,0,0,.35); box-shadow: 0 0 0 1px #2c2417; color: var(--ink); font: 700 15px var(--font-display); }
.lj-dep:hover { box-shadow: 0 0 0 1px #8a6d3b; }
.lj-dep.on { background: linear-gradient(rgba(58,46,23,.55), rgba(20,16,9,.6)); box-shadow: 0 0 0 1px #000, 0 0 0 2px #e4bc6c, 0 0 12px rgba(228,188,108,.25); color: #ffd98a; }
.lj-dep img { flex: none; width: 34px; height: 34px; padding: 3px; border-radius: 5px; background: radial-gradient(circle at 50% 40%, #2c261c, #070605 75%); box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #5c4a2c; }
.lj-dep span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lj-dep small { color: var(--ink-muted); font: 400 11px var(--font-serif); }
.lj-dep i { font-style: normal; font-size: 22px; color: #8a6d3b; }
.lj-dep.on i { color: #e4bc6c; }

/* esquerda: Supply Pouch */
.lj-sups { display: flex; flex-direction: column; }
.lj-sup { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 13px; color: var(--ink); }
.lj-sup img { width: 24px; height: 24px; }
.lj-sup span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lj-sup b { font: 600 11px var(--font-mono); color: var(--ink-muted); }
.lj-barra { height: 5px; margin: 3px 0 0 31px; border-radius: 2px; background: #07080a; box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #3d3322; overflow: hidden; }
.lj-barra i { display: block; height: 100%; background: linear-gradient(#ffd46a, #d59a22 55%, #9a6b10); }

/* meio: cabeçalho */
.lj-cab { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 16px; }
.lj-tit h3 { margin: 0; color: #ffd98a; font: 700 26px/1.1 var(--font-display); letter-spacing: .03em; text-shadow: 0 2px 2px #000; }
.lj-tit small { color: var(--ink-muted); font: 400 13px var(--font-serif); }
.lj-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.lj-chip { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 6px; background: rgba(0,0,0,.4); box-shadow: 0 0 0 1px #5c4a2c; }
.lj-chip img { width: 30px; height: 30px; }
.lj-chip span { display: flex; flex-direction: column; color: var(--ink-muted); font-size: 11px; line-height: 1.2; }
.lj-chip b { color: var(--ink); font: 700 15px var(--font-mono); }
.lj-chip.cheio b { color: #ff8060; }

/* meio: a cena do mercador (parede de tijolo, chão de tábua, balcão de mesa; o Sam atrás do balcão e o balão de fala) */
.lj-cena { position: relative; height: 190px; overflow: hidden; border-radius: 6px;
  background: linear-gradient(rgba(0,0,0,.15), rgba(0,0,0,.45)), var(--lj-parede) 0 0 / 48px 48px repeat;
  box-shadow: 0 0 0 1px #000, 0 0 0 2px #5c4a2c, 0 0 0 3px #1a140c, inset 0 -30px 40px rgba(0,0,0,.55); image-rendering: pixelated; }
.lj-cena::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 58px; background: linear-gradient(rgba(0,0,0,.25), rgba(0,0,0,.1)), var(--lj-chao) 0 0 / 48px 48px repeat; box-shadow: 0 -2px 0 #1a140c; }
.lj-obj { position: absolute; width: 56px; height: 56px; bottom: 26px; z-index: 1; }
.lj-obj.e1 { left: 16px; } .lj-obj.e2 { left: 64px; bottom: 18px; width: 48px; height: 48px; }
.lj-obj.d1 { right: 18px; } .lj-obj.d2 { right: 70px; bottom: 18px; width: 50px; height: 50px; }
/* o outfit vem num quadro de 64 px com o corpo no quarto de baixo à direita (como no cliente): o quadro passa do alto da cena e as
   pernas ficam atrás do balcão */
.lj-npc { position: absolute; left: calc(50% - 250px); bottom: 26px; z-index: 1; line-height: 0; }
.lj-npc :is(img, canvas) { height: 200px !important; width: 200px; image-rendering: pixelated; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.lj-balcao { position: absolute; left: 50%; bottom: 20px; transform: translateX(-72%); z-index: 2; width: 240px; height: 50px; display: flex; align-items: flex-start; justify-content: center; gap: 18px;
  background: var(--lj-mesa) 0 0 / 50px 50px repeat-x; box-shadow: 0 6px 10px rgba(0,0,0,.55); }
.lj-balcao img { width: 32px; height: 32px; margin-top: -14px; filter: drop-shadow(0 2px 1px #000); }
.lj-fala { position: absolute; left: calc(50% + 10px); top: 18px; z-index: 3; max-width: min(340px, 42%); padding: 9px 13px; border-radius: 8px;
  background: rgba(12,10,7,.92); box-shadow: 0 0 0 1px #000, 0 0 0 2px #8a6d3b; color: var(--ink); font: 400 14px/1.4 var(--font-serif); }
.lj-fala::before { content: ''; position: absolute; left: -9px; top: 22px; border: 8px solid transparent; border-right-color: #8a6d3b; border-left: 0; }
.lj-fala b { display: block; color: #ffd98a; font: 700 12px var(--font-display); letter-spacing: .08em; text-transform: uppercase; }

/* meio: filtros e grade */
.lj-filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.lj-filtros input { flex: 1 1 200px; min-width: 0; }
.lj-filtros label { display: flex; align-items: center; gap: 6px; color: var(--ink-muted); font-size: 12px; }
.lj-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.lj-c { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 8px 8px; border-radius: 6px; cursor: pointer; text-align: center;
  background: rgba(0,0,0,.35); box-shadow: 0 0 0 1px #2c2417; }
.lj-c:hover { box-shadow: 0 0 0 1px #8a6d3b; }
.lj-c.on { background: linear-gradient(rgba(58,46,23,.55), rgba(20,16,9,.6)); box-shadow: 0 0 0 1px #000, 0 0 0 2px #e4bc6c, 0 0 12px rgba(228,188,108,.25); }
.lj-c.fraco { opacity: .6; }
.lj-ci { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 6px;
  background: radial-gradient(circle at 50% 40%, #2c261c, #070605 75%); box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #5c4a2c; }
.lj-ci img { width: 40px; height: 40px; }
.lj-ci.p { width: 36px; height: 36px; flex: none; } .lj-ci.p img { width: 30px; height: 30px; }
.lj-c > b { font: 700 13px/1.2 var(--font-display); min-height: 2.4em; display: flex; align-items: center; }
.lj-c > small { color: var(--ink-muted); font-size: 11px; }
.lj-cp { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; margin-top: 4px; }
.lj-cp span { display: flex; align-items: center; gap: 3px; color: var(--ink); font: 700 13px var(--font-mono); }
.lj-cp span img { width: 18px; height: 18px; }
.lj-cp .bt { padding: 3px 9px; font-size: 12px; }

/* direita: detalhes */
.lj-det { display: flex; flex-direction: column; gap: 7px; }
.lj-dcab { display: flex; gap: 12px; align-items: center; }
.lj-dico { flex: none; width: 78px; height: 78px; display: flex; align-items: center; justify-content: center; border-radius: 8px;
  background: radial-gradient(circle at 50% 40%, #3a3122, #070605 75%); box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #8a6d3b, 0 0 14px rgba(228,188,108,.15); }
.lj-dico img { width: 64px; height: 64px; }
.lj-dcab h3 { margin: 0 0 3px; font: 700 20px/1.15 var(--font-display); text-shadow: 0 2px 2px #000; }
.lj-dcab small { color: var(--ink-muted); font-size: 12px; }
.lj-lin { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-muted); font-size: 13px; }
.lj-lin b { color: var(--ink); font: 600 13px var(--font-mono); text-align: right; }
.lj-lin.total b { color: #ffd98a; font-size: 16px; }
.lj-faz { margin: 0; padding: 7px 9px; border-radius: 5px; background: rgba(0,0,0,.3); box-shadow: 0 0 0 1px #2c2417; color: var(--ink); font: 400 13px/1.45 var(--font-serif); }
.lj-ver { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.lj-ver small { color: var(--ink-muted); }
.lj-qtd { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; padding: 8px 0; border-top: 1px solid rgba(92,74,44,.5); border-bottom: 1px solid rgba(92,74,44,.5); color: var(--ink-muted); font-size: 13px; }
.lj-qc { display: flex; gap: 4px; justify-content: flex-end; }
.lj-qc input { width: 70px; text-align: center; }
.lj-qc .bt { width: 30px; padding: 3px 0; }
.lj-at { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.lj-conta { display: flex; flex-direction: column; gap: 4px; }
.lj-trava { margin: 0; color: #ff8060; font-size: 12px; }
.lj-comprar { width: 100%; padding: 10px 0 !important; font: 700 16px var(--font-display) !important; letter-spacing: .1em; color: #eaffea !important;
  background: linear-gradient(#2fa84f, #127a2f 55%, #0b5a21) !important; box-shadow: 0 0 0 1px #000, 0 0 0 2px #3fd46a, inset 0 1px 0 rgba(255,255,255,.25) !important; }
#jan .lj-comprar:is(:hover, :active):not(:disabled) { background: linear-gradient(#3cc160, #179138 55%, #0d6a27) !important; color: #fff !important; }      /* o hover de aço do tema.css apagava o verde */
.lj-comprar:disabled { filter: grayscale(.85) brightness(.7); }

/* direita: venda rápida */
.lj-vr { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; padding: 2px; }
.lj-vi { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 5px; background: rgba(0,0,0,.3); box-shadow: 0 0 0 1px #2c2417; }
.lj-vi.prot { opacity: .65; }
.lj-vi > span { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lj-vi small { color: var(--ink-muted); font-size: 11px; }
.lj-vi > b { color: var(--ink); font: 600 12px var(--font-mono); white-space: nowrap; }
.lj-vi .bt { padding: 3px 8px; font-size: 12px; }

@media (max-width: 1400px) { .lj { grid-template-columns: 230px minmax(0, 1fr) 290px; } }
@media (max-width: 1100px) {
  .lj { grid-template-columns: minmax(0, 1fr); }
  .lj-deps { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .lj-grade { max-height: 440px; overflow-y: auto; padding: 2px; }      /* a grade não empurra os detalhes para longe */
}
@media (max-width: 700px) {
  #jan.jloja #janC { padding: 8px; }
  .lj-deps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .lj-dep { flex-direction: column; gap: 4px; padding: 7px 4px; font-size: 13px; text-align: center; }
  .lj-dep small, .lj-dep i { display: none; }
  .lj-tit h3 { font-size: 21px; }
  .lj-cena { height: 170px; }
  .lj-npc { left: calc(50% - 205px); bottom: 30px; } .lj-npc :is(img, canvas) { height: 160px !important; width: 160px; }
  .lj-balcao { width: 170px; transform: translateX(-85%); gap: 10px; }
  .lj-fala { left: auto; right: 8px; top: 8px; max-width: 52%; font-size: 12px; padding: 7px 9px; }
  .lj-obj.e2, .lj-obj.d2 { display: none; }
  .lj-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lj-chip { flex: 1 1 100px; }
}
