/* A janela Vender do Premium VIP (pt-venda.js): presa à esquerda como a loja; o inventário vai para a direita. Prefixo vd-
   (lj- é da loja, vp- do VIP). As cores da raridade: comum, incomum, raro, épico, lendário. */
#venda.vd-jan { --vd-comum: #e9e3d6; --vd-incomum: #8fdc72; --vd-raro: #5fb4ff; --vd-epico: #b88cff; --vd-lendario: #ffa24d;
  position: fixed; top: calc(86px * var(--hn-k, 1)); left: 12px; z-index: 6; display: flex; flex-direction: column; box-sizing: border-box;
  width: 600px; max-width: calc(100vw - 24px); max-height: max(320px, calc(100vh - 86px * var(--hn-k, 1) - 16px));
  padding: 0 18px 14px; overflow: hidden; color: #efe6d4; font: 13px/1.35 "Segoe UI", system-ui, sans-serif;
  border-radius: 9px; border: 1px solid rgba(233,194,122,.45);
  background: radial-gradient(ellipse at 50% 0, rgba(95,216,230,.06), transparent 60%), linear-gradient(#1d1814, #120f0c);
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 14px 34px rgba(0,0,0,.55); user-select: none; -webkit-user-select: none; }
#venda.vd-jan[hidden] { display: none; }
#venda button { font: inherit; color: inherit; margin: 0; cursor: pointer; }
#venda button:disabled { cursor: default; }
#venda p { margin: 0; }
body:has(#venda:not([hidden])) #inv.iv-janela { left: auto; right: 12px; transform: scale(var(--hn-k, 1)); transform-origin: 100% 0; }

.vd-cab { display: flex; align-items: center; justify-content: space-between; flex: none; height: 54px; }
.vd-cab h2 { margin: 0; font: 600 21px/1 "Cinzel", Georgia, serif; letter-spacing: .06em; text-shadow: 0 1px 3px #000; }
#venda .vd-x { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; color: rgba(239,230,212,.7); font: 400 20px/1 system-ui, sans-serif; }
#venda .vd-x:hover { color: #fff; background: rgba(255,255,255,.08); }
.vd-filete { position: relative; flex: none; height: 1px; margin: 0 -18px 14px; background: linear-gradient(90deg, transparent, rgba(233,194,122,.7) 20%, rgba(233,194,122,.7) 80%, transparent); }
.vd-filete::after { content: ''; position: absolute; left: 50%; top: 0; width: 15px; height: 15px; transform: translate(-50%, -50%) rotate(45deg); border-radius: 3px;
  background: radial-gradient(circle at 35% 30%, #e6fdff, #5fd8e6 40%, #1f6fb0); box-shadow: 0 0 14px rgba(95,216,230,.8), 0 0 0 2px rgba(0,0,0,.6); }

/* o ouro e o botão dourado */
.vd-ouro { display: flex; align-items: center; gap: 6px; flex: none; margin-bottom: 10px; font-size: 12px; color: rgba(239,230,212,.65); }
.vd-ouro > b { font-size: 13px; color: #efe6d4; }
.vd-moeda { width: 15px; height: 15px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff1b8, #e9b844 50%, #9a6d1c); box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.vd-info { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 2px; border-radius: 50%; border: 1px solid rgba(239,230,212,.45);
  font: 700 9px/1 Georgia, serif; color: rgba(239,230,212,.75); cursor: help; }
#venda .vd-dourado { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 16px 0 6px; border: 1px solid rgba(255,236,190,.55); border-radius: 6px;
  background: linear-gradient(#f0d394, #d2a65a 55%, #b88a42); color: #3a2a12; font: 700 11.5px/1 "Cinzel", Georgia, serif; letter-spacing: .12em;
  text-transform: uppercase; box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 3px 10px rgba(0,0,0,.4); }
#venda .vd-dourado:hover:not(:disabled) { filter: brightness(1.08); }
#venda .vd-dourado:disabled { filter: grayscale(.6) brightness(.7); }
#venda .vd-vender { margin-left: auto; }
.vd-vender span:not(.vd-gema) { display: block; }
.vd-vender small { display: block; margin-left: 2px; font: 600 10.5px/1 "Segoe UI", system-ui, sans-serif; letter-spacing: 0; text-transform: none; color: #4a3616; }
.vd-gema { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 40% 35%, #2b3f52, #0d1722);
  box-shadow: 0 0 0 1.5px #8a6a32; }
.vd-gema::before { content: ''; width: 8px; height: 12px; background: linear-gradient(135deg, #e6fbff, #5fd8e6 45%, #1f6fb0); clip-path: polygon(50% 0, 100% 40%, 50% 100%, 0 40%); }

.vd-aviso, .vd-filtro { flex: none; margin-bottom: 8px; padding: 9px 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.22);
  font-size: 12px; color: rgba(239,230,212,.8); }
.vd-filtro { position: relative; display: flex; align-items: center; gap: 10px; }
.vd-filtro > span { flex: 1; min-width: 0; }
#venda .vd-filtros-bt { flex: none; height: 28px; padding: 0 26px 0 12px; border-radius: 5px; border: 1px solid rgba(233,194,122,.45); background: rgba(0,0,0,.35);
  color: #e9c27a; font: 700 10.5px/1 "Cinzel", Georgia, serif; letter-spacing: .12em; text-transform: uppercase; position: relative; }
.vd-filtros-bt::after { content: ''; position: absolute; right: 10px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.vd-filtros-bt[aria-expanded="true"]::after { margin-top: -1px; transform: rotate(-135deg); }
#venda .vd-filtros-bt:hover { border-color: #e9c27a; }

/* o painel dos filtros, por cima da grade */
.vd-painel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 2; display: grid; gap: 12px; width: 470px; padding: 14px 16px; border-radius: 7px;
  border: 1px solid rgba(233,194,122,.4); background: linear-gradient(#211b16, #15110d); box-shadow: 0 12px 30px rgba(0,0,0,.6); }
.vd-linha { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vd-op { display: flex; align-items: center; gap: 7px; font-size: 12px; color: rgba(239,230,212,.85); white-space: nowrap; cursor: pointer; }
.vd-op input[type="checkbox"], .vd-check { appearance: none; -webkit-appearance: none; flex: none; width: 15px; height: 15px; margin: 0; border-radius: 3px;
  border: 1px solid rgba(239,230,212,.35); background: rgba(0,0,0,.4); cursor: pointer; display: grid; place-items: center; }
.vd-op input[type="checkbox"]:checked, .vd-check:checked { border-color: #5fd8e6; background: #2bb8c8; box-shadow: 0 0 6px rgba(95,216,230,.5); }
.vd-op input[type="checkbox"]:checked::after, .vd-check:checked::after { content: ''; width: 4px; height: 8px; margin-top: -2px; border: solid #062a30; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.vd-check:disabled { opacity: .35; cursor: default; }
.vd-op select { height: 26px; padding: 0 6px; border-radius: 4px; border: 1px solid rgba(239,230,212,.25); background: #15110d; color: #efe6d4; font: inherit; }
.vd-nivel { display: flex; align-items: center; gap: 5px; }
#venda .vd-nivel button { width: 24px; height: 24px; padding: 0; border-radius: 4px; border: 1px solid rgba(239,230,212,.25); background: rgba(0,0,0,.35); }
#venda .vd-nivel button:disabled { opacity: .4; }
.vd-nivel input { box-sizing: border-box; width: 52px; height: 26px; padding: 0 4px; border-radius: 4px; border: 1px solid rgba(239,230,212,.25); background: rgba(0,0,0,.45);
  color: #efe6d4; text-align: center; font: inherit; -moz-appearance: textfield; }
.vd-nivel input::-webkit-outer-spin-button, .vd-nivel input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.vd-nivel input:disabled { opacity: .45; }
.vd-ops { display: grid; grid-template-columns: repeat(3, auto); gap: 10px 14px; justify-content: start; }
.vd-ops .vd-op:has(select) { grid-column: span 2; }
#venda .vd-link { justify-self: start; padding: 0; border: 0; background: none; color: #9eeaf2; font-size: 11.5px; text-decoration: underline; text-underline-offset: 2px; }

.vd-dica { flex: none; margin: 2px 0 8px; font-size: 11.5px; color: rgba(239,230,212,.6); }
.vd-apagado { color: rgba(239,230,212,.4); }

/* a grade: 4 cartões por linha */
.vd-grade { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 8px;
  flex: 1 1 auto; min-height: 220px; overflow-y: auto; padding: 2px 6px 4px 2px; scrollbar-width: thin; scrollbar-color: #b88a42 rgba(255,255,255,.05); }
.vd-vazio { grid-column: 1 / -1; padding: 30px 0; text-align: center; color: rgba(239,230,212,.5); }
.vd-card { --cor: var(--vd-comum); position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; min-height: 128px; padding: 10px 6px 12px;
  border-radius: 7px; border: 1px solid rgba(255,255,255,.08); background: linear-gradient(#211b17, #17130f); text-align: center; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03); transition: border-color .12s, box-shadow .12s, opacity .12s; }
.vd-card:hover { border-color: rgba(233,194,122,.45); }
.vd-card.marcado { border-color: #5fd8e6; box-shadow: 0 0 0 1px rgba(95,216,230,.35), 0 0 14px rgba(95,216,230,.2); }
.vd-card.fora:not(.marcado) { opacity: .5; }
.vd-card.travado { cursor: default; }
#venda .r-incomum { --cor: var(--vd-incomum); } #venda .r-raro { --cor: var(--vd-raro); } #venda .r-epico { --cor: var(--vd-epico); } #venda .r-lendario { --cor: var(--vd-lendario); }
.vd-card:not(.r-comum) { border-color: color-mix(in srgb, var(--cor) 45%, transparent); }
.vd-card .vd-check { position: absolute; left: 7px; top: 7px; }
#venda .vd-trava { position: absolute; right: 5px; top: 5px; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px;
  background: none; color: rgba(239,230,212,.35); }
#venda .vd-trava svg { width: 14px; height: 14px; }
#venda .vd-trava:hover:not(:disabled) { color: #efe6d4; background: rgba(255,255,255,.07); }
#venda .vd-trava[aria-pressed="true"] { color: #e9c27a; }
.vd-hex { position: relative; display: grid; place-items: center; flex: none; width: 52px; height: 58px; margin-bottom: 2px; background: linear-gradient(#e9c27a, #8a6a32);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.vd-hex-in { display: grid; place-items: center; width: 48px; height: 54px; overflow: hidden; font-size: 10px; color: #b5ab98;
  background: radial-gradient(circle at 50% 40%, #2c241d, #15110d); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.vd-hex-in img { max-width: 38px; max-height: 46px; object-fit: contain; }
.vd-icone { position: relative; display: grid; }
.vd-qtd { position: absolute; right: -14px; bottom: 4px; padding: 1px 4px; border-radius: 3px; background: rgba(0,0,0,.8); font: 700 10px/1.2 "Segoe UI", system-ui, sans-serif; color: #fff; }
.vd-nome { font-size: 11.5px; line-height: 1.25; color: var(--cor); }
.vd-rar { font: 700 9px/1 "Segoe UI", system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: color-mix(in srgb, var(--cor) 75%, #8a826f); }
.vd-preco { margin-top: 4px; font-size: 11px; color: rgba(239,230,212,.6); }
.vd-preco b { font-size: 12px; color: #efe6d4; }
.vd-dur { position: absolute; left: 12px; right: 12px; bottom: 5px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.vd-dur i { display: block; height: 100%; background: linear-gradient(90deg, #c99a4c, #f0d394); }

/* a confirmação, por cima da janela */
.vd-fundo { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 16px; background: rgba(5,4,3,.6); }
.vd-conf { display: flex; flex-direction: column; box-sizing: border-box; width: min(440px, 100%); max-height: 100%; padding: 0 18px 16px; border-radius: 9px;
  border: 1px solid rgba(233,194,122,.5); background: linear-gradient(#221b16, #14100c); box-shadow: 0 18px 40px rgba(0,0,0,.7); }
.vd-conf .vd-cab { height: 48px; }
.vd-conf .vd-cab h2 { font-size: 19px; }
.vd-pergunta { font-size: 13px; font-weight: 600; }
.vd-sub { margin-top: 4px !important; font-size: 11.5px; color: rgba(239,230,212,.55); }
.vd-lista { flex: 1 1 auto; min-height: 60px; max-height: 210px; margin: 10px 0; overflow-y: auto; border-radius: 6px; border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.25); scrollbar-width: thin; scrollbar-color: #b88a42 rgba(255,255,255,.05); }
.vd-item { --cor: var(--vd-comum); display: grid; grid-template-columns: 1fr auto 80px; align-items: center; gap: 10px; padding: 6px 10px; font-size: 12px; }
.vd-item + .vd-item { border-top: 1px solid rgba(255,255,255,.05); }
.vd-item .vd-n { color: rgba(239,230,212,.55); font-size: 11px; }
.vd-item b { text-align: right; font-variant-numeric: tabular-nums; }
.vd-alerta { margin-bottom: 8px !important; font-size: 11.5px; color: #ff8a6a; }
.vd-fica { font-size: 11px; line-height: 1.45; color: rgba(239,230,212,.55); }
.vd-botoes { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
#venda .vd-cancelar { height: 38px; padding: 0 22px; border-radius: 6px; border: 1px solid rgba(233,194,122,.45); background: rgba(0,0,0,.35);
  color: #efe6d4; font: 700 11.5px/1 "Cinzel", Georgia, serif; letter-spacing: .12em; text-transform: uppercase; }
#venda .vd-cancelar:hover { border-color: #e9c27a; }

/* no inventário (pt-inventario.js): o botão Vender no rodapé e o cadeado no quadro do item travado */
.iv-jan .iv-vender { display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 0 16px 0 12px; border-radius: 6px; border: 1px solid rgba(233,194,122,.5);
  background: rgba(0,0,0,.35); color: #efe6d4; font: 700 11px/1 "Cinzel", Georgia, serif; letter-spacing: .12em; text-transform: uppercase; }
.iv-jan .iv-vender:hover { border-color: #e9c27a; background: rgba(233,194,122,.1); }
.iv-vender i { width: 9px; height: 13px; background: linear-gradient(135deg, #e6fbff, #5fd8e6 45%, #1f6fb0); clip-path: polygon(50% 0, 100% 40%, 50% 100%, 0 40%); }
.iv-quadro.travado::after { content: ''; position: absolute; left: 3px; top: 3px; width: 11px; height: 11px; pointer-events: none;
  background: #e9c27a; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3' fill='none' stroke='black' stroke-width='2.4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3' fill='none' stroke='black' stroke-width='2.4'/%3E%3C/svg%3E") center / contain no-repeat; }
