/* JANELAS COM A ARTE NOVA (arte/telas/tela-<janela>.png). Vem depois de telas.css, janelas2.css, loja2.css e social.css.
   Duas camadas:
   1) PEÇAS DO KIT em toda janela (moldura 9-slice, abas, botões): vale na janela pequena (canto) e quando a arte própria não carregou.
   2) CASCA (.vv-casca): só em tela grande. A janela inteira é o PNG da janela (já sem abas, botões e miolo de exemplo) e as medidas
      (em pixels do PNG, ver CASCAS em moldura.js) viram variáveis: --tix.. (abas), --cox.. (miolo), --fimx.. (faixa de baixo), --titx.. (título).
      Tudo anda em "em" (a janela cresce e encolhe com a letra do jogo, como o HUD). Peças vivas da janela: `.vv-a` com --x --y --w --h em pixels do PNG. */

/* ---------- 1) kit em toda janela ---------- */
#ui.vv-arte .vv-janela:not(.vv-casca) { background: none; border: .6em solid transparent; border-image: var(--k-janela) 72 fill / .6em stretch; border-radius: 0; box-shadow: none; }
#ui.vv-arte .vv-janela:not(.vv-casca) .vv-cab { background: none; border-bottom: 1px solid rgba(138, 111, 58, .5); }
#ui.vv-arte .vv-janela:not(.vv-casca) .vv-rodape { border-top-color: rgba(138, 111, 58, .5); }
#ui.vv-arte .vv-janela .vv-x { background: var(--k-fechar) center / contain no-repeat; border: 0; border-radius: 0; color: transparent !important; text-shadow: none; width: 2.2em; height: 2.2em; }
#ui.vv-arte .vv-janela .vv-x:hover { filter: brightness(1.3); }
#ui.vv-arte .vv-janela .vv-aba { border: .4em solid transparent; border-image: var(--k-aba) 30 fill / .4em stretch; background: none; border-radius: 0; padding: .05em .5em; color: var(--txt); }
#ui.vv-arte .vv-janela .vv-aba:hover { filter: brightness(1.25); }
#ui.vv-arte .vv-janela .vv-aba.ativa { border-image-source: var(--k-aba_ativa); color: var(--titulo); }
#ui.vv-arte .vv-janela .vv-bt { border: .4em solid transparent; border-image: var(--k-botao_escuro) 44 fill / .4em stretch; background: none; border-radius: 0; padding: .05em .55em; }
#ui.vv-arte .vv-janela .vv-bt:hover:not(:disabled) { background: none; filter: brightness(1.3); }
#ui.vv-arte .vv-janela .vv-bt.verde { border-image-source: var(--k-botao_verde); }
#ui.vv-arte .vv-janela .vv-bt.perigo { border-image-source: var(--k-botao_perigo); }
#ui.vv-arte .vv-janela .vv-bt.dourado, #ui.vv-arte .vv-janela .vv-bt.ativa, #ui.vv-arte .vv-janela .vv-bt.ativo { border-image-source: var(--k-botao); color: var(--titulo); }
#ui.vv-arte .vv-janela .vv-bt.vv-seta { padding: 0 .3em; min-width: 1.8em; }
#ui.vv-arte .vv-janela .vv-fim { padding: .3em .6em .5em; flex: none; }

/* janela de canto: a moldura de bronze aparece (mais grossa que na grande, senão some a 10 px de letra) */
@media (max-width: 800px), (max-height: 450px) {
  #ui.vv-arte .vv-janela:not(.vv-casca):not(.vv-confirma) { border: 1.4em solid transparent; border-image: var(--k-janela) 56 fill / 1.4em stretch; }
  #ui.vv-arte .vv-janela:not(.vv-casca) .vv-cab { padding: .1em .3em .25em .4em; }
  #ui.vv-arte .vv-janela:not(.vv-casca) .vv-corpo { padding: .35em .4em .4em; }
  #ui.vv-arte .vv-janela:not(.vv-casca) .vv-abas, #ui.vv-arte .vv-janela:not(.vv-casca) .vv-secoes { padding: .3em .4em 0; }
  .vv-tit h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .vv-cab-extra .vv-pil small { display: none; }
  /* abas de verdade na janela pequena: todas numa fila, letra menor */
  .vv-j-mochila .vv-abas { display: flex; flex-wrap: nowrap; gap: .15em; flex: none; padding-left: .2em; padding-right: .2em; }
  #ui.vv-arte .vv-j-mochila .vv-abas .vv-aba { flex: 1 1 auto; min-width: 0; padding: 0 .05em; border-width: .3em; border-image-width: .3em; font-size: .9em; white-space: nowrap; overflow: hidden; text-align: center; }
  .vv-j-mochila .vv-m-topo { flex-wrap: nowrap; align-items: center; gap: .4em; }
  .vv-j-mochila .vv-m-topo .vv-pil { white-space: nowrap; }
}

/* ---------- 2) casca: tela grande ---------- */
@media (min-width: 801px) and (min-height: 451px) {
  #ui.vv-arte .vv-janela.vv-casca { border: 0; border-image: none; border-radius: 0; box-shadow: none; padding: 0; display: block; overflow: visible;
    background: var(--tj) 0 0 / 100% 100% no-repeat; aspect-ratio: var(--W) / var(--H); height: calc(var(--H) * var(--k) * 1em); width: auto; max-width: none; max-height: calc(100% - .6em); min-height: 0; }
  .vv-casca .vv-cab, .vv-casca .vv-tit { display: contents; }
  .vv-casca .vv-a, .vv-casca .vv-corpo, .vv-casca .vv-abas, .vv-casca .vv-secoes, .vv-casca .vv-fim, .vv-casca .vv-tit h2, .vv-casca .vv-tit p {
    position: absolute; box-sizing: border-box; margin: 0; }
  .vv-casca .vv-a { left: calc(var(--x) / var(--W) * 100%); top: calc(var(--y) / var(--H) * 100%); width: calc(var(--w) / var(--W) * 100%); height: calc(var(--h) / var(--H) * 100%); }
  /* título na pedra de cima */
  .vv-casca .vv-tit h2 { left: calc(var(--titx) / var(--W) * 100%); top: calc((var(--tity) + 4) / var(--H) * 100%); width: calc(var(--titw) / var(--W) * 100%); height: calc(var(--tith) / var(--H) * 100%);
    display: flex; align-items: center; justify-content: center; font-size: 1.02em; letter-spacing: .12em; text-align: center; white-space: nowrap; overflow: hidden;
    text-shadow: 0 1px 2px #000, 0 0 4px #000; }
  /* fechar: no canto de cima, sobre a pedra */
  .vv-casca .vv-x { display: none; position: absolute; right: .25em; top: .25em; z-index: 3; width: 2.1em; height: 2.1em; padding: 0; }
  /* abas / colunas-abas / dica na madeira de cima */
  .vv-casca .vv-abas, .vv-casca .vv-secoes { left: calc(var(--tix) / var(--W) * 100%); top: calc(var(--tiy) / var(--H) * 100%); width: calc(var(--tiw) / var(--W) * 100%); height: calc(var(--tih) / var(--H) * 100%);
    display: flex; align-items: center; justify-content: center; gap: .25em; padding: 0; flex-wrap: nowrap; }
  .vv-casca .vv-abas .vv-aba, .vv-casca .vv-secoes .vv-aba { flex: 1 1 auto; min-width: 0; max-width: 10em; height: 2.3em; padding: 0 .3em; font-size: .84em; border-width: .3em; border-image-width: .3em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .vv-casca .vv-secoes { display: none; } .vv-casca.colaba .vv-secoes { display: flex; }
  .vv-casca .vv-corpo.col-v { flex-direction: column; gap: .4em; }
  .vv-casca .vv-corpo > .vv-secoes { position: static; width: 100%; height: auto; flex: none; justify-content: flex-start; }
  .vv-casca .vv-corpo > .vv-secoes .vv-aba { max-width: 9em; height: 2em; }
  .vv-casca .vv-tit p { left: calc(var(--tix) / var(--W) * 100%); top: calc(var(--tiy) / var(--H) * 100%); width: calc(var(--tiw) / var(--W) * 100%); height: calc(var(--tih) / var(--H) * 100%);
    display: flex; align-items: center; justify-content: center; text-align: center; font-size: .78em; font-weight: 400; color: #d8caa4; line-height: 1.15; overflow: hidden; text-shadow: 0 1px 2px #000; }
  .vv-casca.tem-abas .vv-tit p { display: none; }
  /* miolo */
  .vv-casca .vv-corpo { left: calc(var(--cox) / var(--W) * 100%); top: calc(var(--coy) / var(--H) * 100%); width: calc(var(--cow) / var(--W) * 100%); height: calc(var(--coh) / var(--H) * 100%);
    padding: .15em .25em; gap: .6em; overflow: hidden; }
  .vv-casca .vv-col { display: flex; } .vv-casca.colaba .vv-col:not(.ativa) { display: none; }
  .vv-casca .vv-col.estreita, .vv-casca .vv-col.fina { flex: 1 1 0; }
  .vv-casca .vv-rodape-c { font-size: .75em; font-weight: 400; color: var(--cinza); }
  /* faixa de baixo */
  .vv-casca .vv-fim { left: calc(var(--fimx) / var(--W) * 100%); top: calc(var(--fimy) / var(--H) * 100%); width: calc(var(--fimw) / var(--W) * 100%); height: calc(var(--fimh) / var(--H) * 100%);
    display: flex; align-items: center; justify-content: center; gap: .4em; padding: 0; overflow: hidden; }
  .vv-casca .vv-fim .vv-bt { flex: 0 1 auto; min-width: 0; font-size: .92em; }
  /* botões mais finos sobre a arte: o texto (também em inglês) nunca passa da moldura */
  #ui.vv-arte .vv-casca .vv-bt { border-width: .32em; border-image-width: .32em; padding: .05em .35em; white-space: nowrap; }
  #ui.vv-arte .vv-casca .vv-fim .vv-bt { padding: .05em .2em; font-size: .86em; }
  #ui.vv-arte .vv-casca .vv-andares .vv-andar { padding: .2em .1em; font-size: .8em; }
  #ui.vv-arte .vv-casca .vv-pocao .vv-bt { font-size: .78em; }
  #ui.vv-arte .vv-casca .vv-produto .vv-bt { font-size: .84em; padding: .05em .1em; }
  .vv-casca .vv-fim.ex { justify-content: space-between; padding: 0 .9em; }
  .vv-casca .vv-extra-e { display: flex; align-items: center; gap: .4em; min-width: 0; }
  .vv-casca .vv-fim-d { display: flex; align-items: center; justify-content: center; gap: .4em; min-width: 0; }
  .vv-casca .vv-rodape-f { font-size: .75em; font-weight: 400; color: #d8caa4; text-align: center; line-height: 1.15; }
  .vv-casca .vv-linha.fim { justify-content: center; }
  .vv-casca .vv-pags { display: inline-flex; align-items: center; gap: .3em; }
  .vv-casca .vv-pags b { min-width: 2.4em; text-align: center; }

  /* ---------- confirmação: os dois botões caem em cima dos botões da arte ---------- */
  #ui.vv-arte .vv-janela.vv-confirma.vv-casca { width: auto; height: calc(var(--H) * var(--k) * 1em); }
  .vv-confirma .vv-conf-t { position: absolute; left: calc(var(--cox) / var(--W) * 100%); top: calc(var(--coy) / var(--H) * 100%); width: calc(var(--cow) / var(--W) * 100%); margin: 0;
    font: 700 1.05em Georgia, "Times New Roman", serif; letter-spacing: .1em; text-transform: uppercase; color: var(--titulo); text-align: center; text-shadow: 0 1px 2px #000; }
  .vv-confirma .vv-conf-x { position: absolute; left: calc(var(--cox) / var(--W) * 100%); top: calc((var(--coy) + 28) / var(--H) * 100%); width: calc(var(--cow) / var(--W) * 100%); height: calc((var(--coh) - 28) / var(--H) * 100%);
    margin: 0; overflow: hidden; text-align: center; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .2em; font-size: .95em; }
  .vv-confirma.vv-c-confirmacao-perigo .vv-conf-t { top: calc(var(--tiy) / var(--H) * 100%); left: calc(var(--tix) / var(--W) * 100%); width: calc(var(--tiw) / var(--W) * 100%); height: calc(var(--tih) / var(--H) * 100%);
    display: flex; align-items: center; justify-content: center; font-size: .9em; color: #ffd0c8; }
  .vv-confirma.vv-c-confirmacao-perigo .vv-conf-x { top: calc(var(--coy) / var(--H) * 100%); height: calc(var(--coh) / var(--H) * 100%); }
  .vv-cbt { position: absolute; padding: 0; background: none; border: 0; border-radius: .6em; font-size: 1em; font-weight: 700; color: #f3ecd6; text-shadow: 0 1px 2px #000, 0 0 3px #000; display: flex; align-items: center; justify-content: center; }
  .vv-cbt:hover { box-shadow: inset 0 0 0 2px var(--viva), 0 0 .6em rgba(232, 196, 90, .5); }
  .vv-cbt.sim { left: calc(var(--simx) / var(--W) * 100%); top: calc(var(--simy) / var(--H) * 100%); width: calc(var(--simw) / var(--W) * 100%); height: calc(var(--simh) / var(--H) * 100%); }
  .vv-cbt.nao { left: calc(var(--naox) / var(--W) * 100%); top: calc(var(--naoy) / var(--H) * 100%); width: calc(var(--naow) / var(--W) * 100%); height: calc(var(--naoh) / var(--H) * 100%); }

  /* ---------- equipamento e mochila ---------- */
  .vv-c-mochila .vv-corpo, .vv-c-mochila .vv-col, .vv-c-mochila .vv-col-vestido, .vv-c-mochila .vv-col-mochila { display: contents; }
  .vv-c-mochila .vv-eq { display: block; padding: 0; }
  .vv-c-mochila .vv-eq .vv-slot { --slot: 100%; width: 100%; height: 100%; padding: .2em; background: none; border: 0; border-radius: .35em; box-shadow: inset 0 0 0 2px var(--rar, transparent); }
  .vv-c-mochila .vv-eq .vv-slot.vazio { box-shadow: none; }
  .vv-c-mochila .vv-eq .vv-slot:hover { background: rgba(232, 196, 90, .12); }
  .vv-c-mochila .vv-eq small { display: none; }
  .vv-c-mochila .vv-centro { display: flex; flex-direction: column; align-items: center; gap: .25em; overflow: hidden; }
  .vv-c-mochila .vv-centro .vv-boneco-g { width: 6.6em; height: 7.6em; flex: none; }
  .vv-c-mochila .vv-centro .vv-quatro { grid-template-columns: repeat(2, 1fr); gap: .15em; width: 100%; flex: none; }
  .vv-c-mochila .vv-centro .vv-caixa-n { padding: .1em; border: 0; background: rgba(0, 0, 0, .35); }
  .vv-c-mochila .vv-centro .vv-caixa-n small { font-size: .6em; }
  .vv-c-mochila .vv-centro .vv-caixa-n b { font-size: .85em; }
  .vv-c-mochila .vv-centro .vv-bonus-resumo { font-size: .62em; line-height: 1.15; text-align: center; overflow: hidden; }
  .vv-c-mochila .vv-bolsa .vv-grade { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 1fr; gap: 0; width: 100%; height: 100%; justify-content: stretch; }
  .vv-c-mochila .vv-bolsa .vv-slot { --slot: 100%; width: 92.3%; height: 92%; margin: auto; padding: .2em; background: none; border: 0; border-radius: .3em; box-shadow: inset 0 0 0 2px var(--rar, transparent); }
  .vv-c-mochila .vv-bolsa .vv-slot.vazio { box-shadow: none; }
  .vv-c-mochila .vv-bolsa .vv-slot:hover { background: rgba(232, 196, 90, .12); }
  .vv-c-mochila .vv-pill-ouro { display: flex; align-items: center; gap: .3em; padding: 0 .8em 0 .2em; color: #f2c94c; font-size: .95em; }
  .vv-c-mochila .vv-pill-ouro small { font-size: .75em; color: var(--cinza); }
  .vv-casca.vv-c-mochila .vv-abas .vv-aba { font-size: .72em; }
  .vv-c-mochila .vv-regiao { display: flex; flex-direction: column; gap: .4em; overflow: hidden; padding: .3em .5em; background: linear-gradient(#141518, #101114); border-radius: .5em; }
}

/* ---------- missões (pergaminho): letra escura no papel; as linhas e botões mantêm o fundo escuro ---------- */
@media (min-width: 801px) and (min-height: 451px) {
  .vv-c-missoes .vv-corpo { padding: .3em .6em; background: linear-gradient(#141518, #101114); border-radius: .5em; box-shadow: 0 0 0 .25em #101114; }
  .vv-c-missoes .vv-corpo > * { min-width: 0; }
  .vv-c-missoes .vv-liga-linha { gap: .4em; }
  #ui .vv-c-missoes .vv-liga, .vv-c-missoes .vv-m-linha1, .vv-c-missoes .vv-bt { --txt: #ece6d8; --cinza: #aaa69b; --titulo: #f0d58a; --viva: #e8c45a; color: #ece6d8; }
  .vv-c-missoes .vv-m-linha1 b, .vv-c-missoes .vv-m-linha1 small { color: inherit; }
  .vv-c-missoes .vv-m-lista { gap: .25em; }
}

/* ---------- medidor, mapa, zeno, templo, morte, ferreiro, poções, loja ---------- */
@media (min-width: 801px) and (min-height: 451px) {
  /* medidor: as linhas caem no pergaminho (letra escura) */
  .vv-c-medidor .vv-corpo, .vv-c-medidor .vv-col { display: contents; }
  .vv-c-medidor .vv-med-r { display: flex; align-items: center; gap: .5em; padding: 0 .7em; color: #2b2113; }
  .vv-c-medidor .vv-med-r b { flex: 1; font-size: 1.05em; font-variant-numeric: tabular-nums; }
  #ui .vv-c-medidor .vv-med-r small { color: #6b5a3c; font-weight: 700; white-space: nowrap; }
  .vv-c-medidor .vv-med-r.lucro b { color: #6a3d00; }
  .vv-c-medidor .vv-med-topo { display: flex; align-items: center; gap: .5em; padding: 0 .3em; white-space: nowrap; overflow: hidden; }
  .vv-c-medidor .vv-med-t { font-size: 1.25em; color: var(--titulo); font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
  .vv-c-medidor .vv-med-topo small { margin-left: auto; color: #d8caa4; }
  /* mapa: zoom em cima dos botões desenhados */
  .vv-zoom { background: none; border: 0; border-radius: .6em; padding: 0; z-index: 2; }
  .vv-zoom:hover { box-shadow: inset 0 0 0 2px var(--viva), 0 0 .6em rgba(232, 196, 90, .5); }
  .vv-c-mapa-grande .vv-mapa-ctl .vv-bt:not(.vv-centrar) { display: none; }
  /* zeno: retrato no anel; título e dica nos dois lados */
  .vv-c-zeno .vv-ring-zeno { border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; }
  .vv-c-zeno .vv-ring-zeno .vv-fig { image-rendering: auto; }
  .vv-c-zeno .vv-tit h2 { left: calc(56 / var(--W) * 100%); width: calc(100 / var(--W) * 100%); top: calc(52 / var(--H) * 100%); height: calc(44 / var(--H) * 100%); font-size: .62em; letter-spacing: .04em; white-space: normal; line-height: 1.1; }
  .vv-c-zeno .vv-tit p { left: calc(250 / var(--W) * 100%); width: calc(90 / var(--W) * 100%); top: calc(52 / var(--H) * 100%); height: calc(44 / var(--H) * 100%); font-size: .58em; line-height: 1.1; white-space: normal; text-align: left; align-items: center; text-overflow: clip; }
  .vv-c-zeno .vv-dests { grid-template-columns: repeat(2, 1fr); gap: .35em; }
  .vv-c-zeno .vv-dest { padding: .25em .4em; }
  .vv-c-zeno .vv-aviso-viagem { font-size: .8em; padding: .2em .4em; }
  /* templo / morte */
  .vv-c-templo .vv-templo-t { font-size: 1.15em; text-align: center; padding: 1em 1.2em; line-height: 1.5; }
  .vv-c-templo .vv-col { justify-content: center; }
  .vv-c-morte .vv-morte-l { padding: .12em .55em; }
  .vv-c-morte .vv-morte-lista { gap: .15em; margin-bottom: .2em; }
  .vv-c-morte .vv-morte-resumo { margin: 0 0 .2em; }
  .vv-c-morte .vv-caca-frase { font-size: .8em; }
  /* ferreiro */
  .vv-c-ferreiro .vv-grade-eq { gap: .2em; }
  .vv-c-ferreiro .vv-grade-eq .vv-slot { --slot: 2.1em; }
  .vv-c-ferreiro .vv-grade-eq .vv-eq { padding: .15em; }
  .vv-c-ferreiro .vv-fundir { display: flex; flex-direction: column; gap: .15em; }
  .vv-c-ferreiro .vv-fundir small { font-size: .78em; line-height: 1.15; }
  .vv-c-ferreiro .vv-fundir .vv-bt { padding-top: 0; padding-bottom: 0; }
  .vv-c-ferreiro .vv-corpo { gap: .5em; }
  .vv-c-ferreiro .vv-col { min-height: 0; overflow: hidden; }
  /* poções */
  .vv-c-pocoes .vv-cartoes.dois { gap: .35em; }
  .vv-c-pocoes .vv-pocao { padding: .15em .4em; gap: .08em; }
  /* loja de coins */
  .vv-c-loja-vila-coins .vv-nota-beta { display: none; }
  .vv-c-loja-vila-coins .vv-col.estreita { flex: 1 1 0; }
  .vv-c-loja-vila-coins .vv-col.fina { flex: 0 0 9.5em; }
}

@media (min-width: 801px) and (min-height: 451px) {
  .vv-c-medidor .vv-tit p { display: none; }
  .vv-c-pocoes .vv-pocao .vv-linha { display: grid; grid-template-columns: repeat(3, 1fr); gap: .2em; }
  .vv-c-pocoes .vv-pocao .vv-bt { padding: .1em 0; font-size: .72em; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .05em; line-height: 1.1; }
  .vv-c-pocoes .vv-pocao .vv-bt .vv-pil { font-size: .9em; padding: 0 .25em; }
  .vv-c-pocoes .vv-pocao .vv-linha { align-items: stretch; }
  .vv-c-ferreiro .vv-grade-eq .vv-eq small { display: none; }
}

/* ---------- configurações (tela grande): conta na madeira, opções no escuro, avisos no pergaminho ---------- */
@media (min-width: 801px) and (min-height: 451px) {
  .vv-c-configuracoes .vv-risco { display: none; }
  .vv-c-configuracoes .vv-col { flex-direction: column; justify-content: center; gap: .55em; width: 100%; }
  .vv-c-configuracoes .vv-col .vv-linha { font-size: .92em; }
  .vv-c-configuracoes .vv-tit p { font-size: .8em; color: #f0d58a; font-weight: 700; }
  /* o miolo escuro de todas as janelas cobre o pergaminho desenhado (config, mapa) */
  .vv-perg { display: flex; flex-direction: column; justify-content: center; padding: .5em .9em; overflow: hidden; color: var(--txt); background: linear-gradient(#141518, #101114); border-radius: .5em; box-shadow: 0 0 0 .2em #101114; }
  .vv-perg .vv-avisos-caixas { flex-direction: column; align-items: flex-start; gap: .5em; }
  .vv-perg .vv-caixinha { color: var(--txt); font-size: 1.05em; font-weight: 700; }
  .vv-perg .vv-caixinha i { background: #15171a; border-color: var(--borda); }
  .vv-perg .vv-caixinha[aria-checked="true"] i { color: var(--titulo); }
  .vv-perg-mapa { justify-content: flex-start; gap: .15em; font-size: .85em; }
  .vv-perg-mapa small { color: var(--cinza); }
  .vv-perg-mapa b { color: var(--titulo); margin-bottom: .3em; overflow-wrap: anywhere; }
  .vv-perg-mapa .vv-risco { display: block; width: 100%; margin: .3em 0; }
  .vv-c-configuracoes .vv-fim { gap: .6em; }
}
