/* TELA DE ENTRADA — mesmo tema das janelas do jogo (telas.css): painel escuro, borda dourada apagada,
   título serifado dourado, botão principal verde. Tudo em "em": encolhe junto com a tela.
   Cabe em 1280x720, 480x270 e 300x520 sem barra de rolagem. */

.ve {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 35%, #1b2230 0%, #0d0f12 70%);
  font: 700 16px/1.25 "Trebuchet MS", Verdana, sans-serif;
  font-size: clamp(10px, min(1.25vw, 2.2222vh), 28px);
  color: #ece6d8;
  overflow: hidden;
  user-select: none; -webkit-user-select: none;
}
.ve *, .ve *::before, .ve *::after { box-sizing: border-box; }
.ve [hidden] { display: none !important; }
.ve p { margin: 0; }

.ve-painel {
  width: 23em; max-width: calc(100vw - 1em); max-height: calc(100vh - .6em);
  margin: 0; padding: 1.1em 1.4em 1em;
  display: flex; flex-direction: column; gap: .6em;
  background: #17181b; border: 1px solid #8a6f3a; border-radius: .45em;
  box-shadow: 0 .25em .8em rgba(0, 0, 0, .5);
}
.ve-painel.largo { width: 47em; }

.ve-titulo {
  margin: 0; text-align: center; white-space: nowrap;
  font: 700 1.9em Georgia, "Times New Roman", serif; font-variant: small-caps; letter-spacing: .12em;
  color: #f0d58a; text-shadow: 0 .06em .12em #000;
}
.ve-painel.largo .ve-titulo { font-size: 1.4em; }
.ve-sub { text-align: center; font-size: .8em; font-weight: 400; color: #aaa69b; margin-top: -.45em !important; }

.ve-campo { display: flex; flex-direction: column; gap: .2em; font-size: .85em; color: #aaa69b; }
.ve-campo input {
  font: 700 1.18em "Trebuchet MS", Verdana, sans-serif; color: #ece6d8;
  background: #0e0f12; border: 1px solid #3b3d44; border-radius: .3em;
  padding: .4em .6em; width: 100%; outline: none;
  user-select: text; -webkit-user-select: text;
}
.ve-campo input:focus { border-color: #e8c45a; }

.ve-erro { min-height: 1.25em; text-align: center; font-size: .85em; color: #ff8f80; }
.ve-erro.calmo { color: #aaa69b; }

.ve-bt {
  font: inherit; color: #ece6d8; cursor: pointer; margin: 0; white-space: nowrap;
  background: #24262b; border: 1px solid #8a6f3a; border-radius: .35em; padding: .55em 1.2em;
  display: inline-flex; align-items: center; justify-content: center;
}
.ve-bt:hover:not(:disabled) { border-color: #e8c45a; background: #2e3137; }
.ve-bt.verde { background: #2f6b33; border-color: #5fae5f; }
.ve-bt.verde:hover:not(:disabled) { background: #3a8040; border-color: #8fd98f; }
.ve-bt:disabled { opacity: .45; filter: grayscale(.7); cursor: default; }
.ve :focus-visible { outline: 2px solid #fff6c9; outline-offset: 1px; }
.ve-campo input:focus-visible { outline: none; }

.ve-dica { text-align: center; font-size: .78em; font-weight: 400; color: #aaa69b; }
.ve-linha { display: flex; gap: .6em; justify-content: center; }
.ve-linha .ve-bt { min-width: 8em; }

/* ---------- escolha da vocação ---------- */
.ve-cartoes { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6em; }
.ve-cartao {
  font: inherit; color: #ece6d8; cursor: pointer; margin: 0; text-align: center;
  background: #1e2024; border: 1px solid #45474e; border-radius: .4em; padding: .55em .5em .6em;
  display: flex; flex-direction: column; align-items: center; gap: .3em; min-width: 0;
}
.ve-cartao:hover { border-color: #8a6f3a; background: #24262b; }
.ve-cartao.escolhido { border-color: #e8c45a; background: #4e3d1c; }
.ve-cartao b { font: 700 1.05em Georgia, "Times New Roman", serif; letter-spacing: .08em; color: #f0d58a; }
.ve-cartao small { font-size: .76em; font-weight: 400; line-height: 1.25; color: #c9c4b6; }
.ve-boneco { width: 3.4em; height: 5.1em; flex: none; display: flex; align-items: center; justify-content: center; }
.ve-boneco img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.ve-boneco.semarte { background: #2a2c33; border: 1px dashed #4a4d57; border-radius: .25em;
  font: 700 1.6em Georgia, "Times New Roman", serif; color: #8d909a; }

/* janela baixa (ex.: 480x270): tudo mais junto */
@media (max-height: 450px) {
  .ve-painel { padding: .7em 1.2em .6em; gap: .4em; }
  .ve-titulo { font-size: 1.5em; }
  .ve-boneco { width: 2.6em; height: 3.9em; }
  .ve-cartao { padding: .4em .4em .45em; gap: .2em; }
}

/* janela em pé (ex.: 300x520): cartões em 2 colunas */
@media (max-aspect-ratio: 4/5) {
  .ve-painel, .ve-painel.largo { width: 28em; padding: .9em .8em .8em; }
  .ve-cartoes { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- roupa: modelo + 4 cores (criação e janela "Roupa" do jogo) ---------- */
.ve.ve-sobre { background: rgba(8, 9, 12, .62); }
.ve-painel.roupa { width: 36em; padding: .8em 1.1em .8em; gap: .45em; }
.ve-painel.roupa .ve-titulo { font-size: 1.4em; }
.ve-painel.roupa .ve-erro { min-height: 0; }
.vr-corpo { display: flex; gap: .7em; align-items: stretch; }
.vr-col1 { width: 8.4em; flex: none; display: flex; flex-direction: column; gap: .35em; }
.vr-previa { width: 100%; height: 11.2em; display: block; background: radial-gradient(ellipse at 50% 70%, #2b3a2a 0%, #1a2019 75%); border: 1px solid #4b3f25; border-radius: .35em; }
.vr-mod { display: flex; gap: .25em; }
.vr-bt { padding: .3em .2em; font-size: .85em; min-width: 0 !important; flex: 1; }
.vr-bt.escolhido { background: #4e3d1c; border-color: #e8c45a; }
.vr-col2 { width: 8.2em; flex: none; display: flex; flex-direction: column; gap: .3em; }
.vr-zona {
  font: inherit; font-size: .9em; color: #ece6d8; cursor: pointer; margin: 0; text-align: left;
  display: flex; align-items: center; gap: .5em; padding: .3em .4em;
  background: #1e2024; border: 1px solid #45474e; border-radius: .35em;
}
.vr-zona:hover { border-color: #8a6f3a; }
.vr-zona.escolhido { border-color: #e8c45a; background: #4e3d1c; }
.vr-cor { width: 1.5em; height: 1.5em; flex: none; border-radius: .25em; border: 1px solid #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.vr-sorteio { margin-top: auto; }
.vr-grade { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .14em; align-content: start; }
.vr-amostra { aspect-ratio: 1 / 1; width: 100%; min-width: 0; margin: 0; padding: 0; cursor: pointer; border: 1px solid rgba(0, 0, 0, .6); border-radius: .2em; }
.vr-amostra:hover { border-color: #fff6c9; }
.vr-amostra.escolhido { border: 2px solid #fff; box-shadow: 0 0 0 1px #000; }
@media (max-height: 450px) {
  .ve-painel.roupa { padding: .5em .8em .5em; gap: .3em; width: 36.5em; }
  .vr-previa { height: 10.5em; }
  .vr-col2 { gap: .22em; }
}

/* =====================================================================================
   ARTE NOVA (arte/telas/tela-login, tela-criacao-personagem, tela-espera-erro)
   O "palco" é a arte de 1280x720: --p = pixels de tela por pixel da arte, --ox/--oy = canto (o JS em entrada.js mede).
   Tudo que cai em cima da arte usa --x --y --w --h em pixels da arte. Sem a arte, o visual simples de cima continua valendo.
   ===================================================================================== */
.ve[data-tela] { background: #0d0f12; }
.ve[data-tela] .ve-estagio { box-sizing: border-box; position: absolute; left: var(--ox, 0); top: var(--oy, 0); width: calc(1280 * var(--p, 1px)); height: calc(720 * var(--p, 1px));
  margin: 0; font-size: max(11px, calc(15 * var(--p, 1px))); }
.ve[data-tela] .ve-estagio > *, .cp-roupa .a { box-sizing: border-box; }
.lg, .cp { background: var(--tl-login) 0 0 / 100% 100% no-repeat; }
.ve[data-tela=criacao] .cp { background-image: var(--tl-criacao); }
.lg > * { position: absolute; margin: 0; left: calc(var(--x) * var(--p, 1px)); top: calc(var(--y) * var(--p, 1px)); width: calc(var(--w) * var(--p, 1px)); height: calc(var(--h) * var(--p, 1px)); }
@media (min-width: 801px) and (min-height: 451px) {
  .cp > .cp-t1, .cp > .cp-voltar, .cp > .cp-info, .cp > .cp-msg, .cp > .cp-comecar, .cp .vr-previa, .cp .vr-bt, .cp .vr-zona, .cp .vr-grade {
    position: absolute; margin: 0; left: calc(var(--x) * var(--p, 1px)); top: calc(var(--y) * var(--p, 1px)); width: calc(var(--w) * var(--p, 1px)); height: calc(var(--h) * var(--p, 1px)); }
}

/* ---------- login ---------- */
.lg-titulo { --x: 440; --y: 232; --w: 400; --h: 34; display: flex; align-items: center; justify-content: center; font: 700 calc(26 * var(--p, 1px)) Georgia, "Times New Roman", serif; font-variant: small-caps; letter-spacing: .14em; color: #4a3414; text-shadow: 0 1px 0 rgba(255, 240, 200, .5); white-space: nowrap; }
.lg input { padding: 0 calc(14 * var(--p, 1px)); font: 700 calc(22 * var(--p, 1px)) "Trebuchet MS", Verdana, sans-serif; color: #3a2a14; background: transparent; border: 0; border-radius: calc(12 * var(--p, 1px)); outline: none; user-select: text; -webkit-user-select: text; }
.lg input::placeholder { color: rgba(90, 66, 30, .55); font-weight: 400; }
.lg input:focus { box-shadow: 0 0 0 calc(2 * var(--p, 1px)) rgba(160, 110, 20, .8); }
.lg-nome { --x: 463; --y: 268; --w: 354; --h: 48; }
.lg-senha { --x: 463; --y: 339; --w: 354; --h: 49; }
.lg-entrar { --x: 502; --y: 418; --w: 275; --h: 66; cursor: pointer; padding: 0; background: transparent; border: 0; border-radius: calc(30 * var(--p, 1px)); font: 700 calc(28 * var(--p, 1px)) Georgia, "Times New Roman", serif; font-variant: small-caps; letter-spacing: .12em; color: #f3e3b8; text-shadow: 0 2px 3px #000, 0 0 6px #000; }
.lg-entrar:hover:not(:disabled) { color: #fff; box-shadow: 0 0 calc(14 * var(--p, 1px)) rgba(232, 196, 90, .55); }
.lg-entrar:disabled { opacity: .5; cursor: default; }
.lg-entrar:focus-visible { outline: 2px solid #fff6c9; }
.lg-msg { --x: 508; --y: 524; --w: 264; --h: 44; display: flex; align-items: center; justify-content: center; text-align: center; font-size: max(8px, calc(13 * var(--p, 1px))) !important; line-height: 1.1; font-weight: 400; color: #ffb4a8; text-shadow: 0 1px 2px #000; overflow: visible; }
.lg-msg.calmo { color: #d8caa4; }

/* ---------- criação (tela grande: tudo à vista, como na arte) ---------- */
@media (min-width: 801px) and (min-height: 451px) {
  .cp-abas { display: none; }
  .cp-t1 { --x: 280; --y: 61; --w: 218; --h: 38; background: linear-gradient(#17181b, #0f1013); border-radius: .4em; box-shadow: inset 0 0 0 1px rgba(232, 196, 90, .45); white-space: nowrap; display: flex; align-items: center; justify-content: center; font: 700 calc(17 * var(--p, 1px)) Georgia, serif; font-variant: small-caps; letter-spacing: .08em; color: #f6e6b8; text-shadow: 0 2px 3px #000; }
  .cp-voltar { --x: 777; --y: 55; --w: 231; --h: 50; }
  .cp .ve-bt { background: transparent; border: 0; border-radius: calc(22 * var(--p, 1px)); padding: 0; font-weight: 700; font-size: calc(19 * var(--p, 1px)); color: #f3e3b8; text-shadow: 0 2px 3px #000; }
  .cp .ve-bt:hover:not(:disabled) { background: rgba(232, 196, 90, .14); box-shadow: 0 0 calc(12 * var(--p, 1px)) rgba(232, 196, 90, .5); }
  .cp-comecar { --x: 903; --y: 577; --w: 248; --h: 50; font-size: calc(24 * var(--p, 1px)) !important; font-variant: small-caps; letter-spacing: .12em; }
  .cp-comecar:disabled { opacity: .55; filter: none; }
  .cp .ve-bt.verde { background: transparent; }
  .cp-msg { --x: 872; --y: 496; --w: 314; --h: 40; display: flex; align-items: center; justify-content: center; text-align: center; font-size: max(10px, calc(13 * var(--p, 1px))) !important; line-height: 1.15; color: #4a3a1c; font-weight: 700; min-height: 0; }
  .cp-msg.calmo { color: #5a4724; } .cp .ve-erro:not(.calmo) { color: #8a1f14; }
  /* vocações: 4 quadros da esquerda */
  .cp-voc { --x: 0; --y: 0; --w: 1280; --h: 720; display: contents; }
  .cp-voc .ve-cartao { position: absolute; left: calc(var(--x) * var(--p, 1px)); top: calc(var(--y) * var(--p, 1px)); width: calc(var(--w) * var(--p, 1px)); height: calc(var(--h) * var(--p, 1px));
    margin: 0; padding: calc(6 * var(--p, 1px)); background: transparent; border: 0; border-radius: calc(8 * var(--p, 1px)); gap: calc(4 * var(--p, 1px)); justify-content: flex-end; }
  .cp-voc .ve-cartao:nth-child(1) { --x: 80; --y: 145; --w: 147; --h: 207; } .cp-voc .ve-cartao:nth-child(2) { --x: 243; --y: 145; --w: 147; --h: 207; }
  .cp-voc .ve-cartao:nth-child(3) { --x: 80; --y: 372; --w: 147; --h: 228; } .cp-voc .ve-cartao:nth-child(4) { --x: 243; --y: 372; --w: 147; --h: 228; }
  .cp-voc .ve-cartao:hover { background: rgba(232, 196, 90, .1); }
  .cp-voc .ve-cartao.escolhido { background: rgba(232, 196, 90, .16); box-shadow: inset 0 0 0 calc(3 * var(--p, 1px)) #e8c45a, 0 0 calc(14 * var(--p, 1px)) rgba(232, 196, 90, .55); }
  .cp-voc .ve-boneco { width: 100%; flex: 1; height: auto; min-height: 0; }
  .cp-voc .ve-cartao b { font-size: calc(17 * var(--p, 1px)); text-shadow: 0 1px 2px #000; }
  .cp-voc .ve-cartao small { display: none; }
  .cp-info { --x: 452; --y: 540; --w: 330; --h: 84; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align: center; font-size: max(10px, calc(15 * var(--p, 1px))); line-height: 1.25; color: #d8caa4; text-shadow: 0 1px 3px #000; }
  .cp-info b { font: 700 calc(22 * var(--p, 1px)) Georgia, serif; font-variant: small-caps; letter-spacing: .1em; color: #f0d58a; }
  .cp-info span { font-size: .8em; font-weight: 400; color: #aaa69b; }
  /* roupa: o editor vira peças soltas sobre a arte */
  .cp-roupa, .cp-roupa .vr-corpo, .cp-roupa .vr-col1, .cp-roupa .vr-col2, .cp-roupa .vr-mod { display: contents; }
  .cp .vr-previa { --x: 440; --y: 138; --w: 354; --h: 492; background: none; border: 0; border-radius: 0; }
  .cp .vr-bt[data-mod] { font-size: 0; border-radius: calc(14 * var(--p, 1px)); }
  .cp .vr-bt[data-mod=homem] { --x: 927; --y: 140; --w: 88; --h: 78; } .cp .vr-bt[data-mod=mulher] { --x: 1047; --y: 140; --w: 88; --h: 78; }
  .cp .vr-bt.escolhido { background: rgba(232, 196, 90, .18); box-shadow: inset 0 0 0 calc(3 * var(--p, 1px)) #e8c45a, 0 0 calc(12 * var(--p, 1px)) rgba(232, 196, 90, .6); }
  .cp .vr-zona { padding: 0; border: 0; background: transparent; border-radius: calc(8 * var(--p, 1px)); --w: 56; --h: 42; --x: 853; }
  .cp .vr-zona:nth-child(1) { --y: 252; } .cp .vr-zona:nth-child(2) { --y: 308; } .cp .vr-zona:nth-child(3) { --y: 364; } .cp .vr-zona:nth-child(4) { --y: 420; }
  .cp .vr-zona span { display: none; }
  .cp .vr-zona .vr-cor { position: absolute; right: calc(-1 * var(--p, 1px)); bottom: calc(-1 * var(--p, 1px)); width: calc(16 * var(--p, 1px)); height: calc(16 * var(--p, 1px)); border: 2px solid #fff6; }
  .cp .vr-zona:hover { background: rgba(232, 196, 90, .12); }
  .cp .vr-zona.escolhido { background: rgba(232, 196, 90, .2); box-shadow: inset 0 0 0 calc(3 * var(--p, 1px)) #e8c45a, 0 0 calc(10 * var(--p, 1px)) rgba(232, 196, 90, .6); }
  .cp .vr-sorteio { --x: 531; --y: 55; --w: 219; --h: 50; position: absolute; margin: 0; left: calc(var(--x) * var(--p, 1px)); top: calc(var(--y) * var(--p, 1px)); width: calc(var(--w) * var(--p, 1px)); height: calc(var(--h) * var(--p, 1px)); }
  .cp .vr-grade { --x: 915; --y: 240; --w: 291; --h: 238; gap: calc(2 * var(--p, 1px)); grid-template-columns: repeat(12, 1fr); grid-auto-rows: 1fr; align-content: stretch; }
  .cp .vr-amostra { aspect-ratio: auto; height: 100%; border-radius: calc(3 * var(--p, 1px)); }
  .cp .vr-amostra.escolhido { border: 2px solid #fff; box-shadow: 0 0 0 1px #000, 0 0 calc(6 * var(--p, 1px)) #000; z-index: 1; }
}

/* ---------- criação (janela pequena): painel do kit, 2 abas (Vocação / Roupa) ---------- */
@media (max-width: 800px), (max-height: 450px) {
  .ve[data-tela=criacao] .ve-estagio.cp { position: relative; left: auto; top: auto; width: min(37em, calc(100vw - .6em)); height: auto; max-height: calc(100vh - .4em); margin: 0;
    padding: .7em .8em .6em; font-size: inherit; display: flex; flex-wrap: wrap; align-content: flex-start; gap: .4em; background: #17181b; border: 1px solid #8a6f3a; border-radius: .45em; box-shadow: 0 .25em .8em rgba(0, 0, 0, .5); }
  .ve.com-arte[data-tela=criacao] .ve-estagio.cp { background: none; border: .75em solid transparent; border-image: var(--k-janela) 72 fill / .75em stretch; border-radius: 0; box-shadow: none; padding: .1em .3em; }
  .cp > * { position: static; }
  .cp-t1 { display: none; }
  .cp-abas { order: 1; display: flex; gap: .3em; flex: 1 1 60%; }
  .cp-abas .ve-bt { flex: 1; padding: .3em .2em; min-width: 0; }
  .cp-voltar { order: 2; padding: .3em .8em; }
  .cp-abas .ve-bt.escolhido { background: #4e3d1c; border-color: #e8c45a; }
  .cp-voc, .cp-roupa, .cp-info { order: 3; flex: 1 1 100%; }
  .cp[data-aba=voc] .cp-roupa, .cp[data-aba=roupa] .cp-voc, .cp[data-aba=roupa] .cp-info { display: none; }
  .cp-voc { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4em; }
  .cp-voc .ve-cartao small { display: none; }
  .cp-info { order: 4; font-weight: 400; font-size: .78em; line-height: 1.2; text-align: center; color: #c9c4b6; min-height: 2.4em; }
  .cp-info b { color: #f0d58a; }
  .cp-info span { color: #aaa69b; }
  .cp-msg { order: 5; flex: 1 1 50%; min-height: 0; text-align: left; font-size: .72em; }
  .cp-comecar { order: 6; margin-left: auto; padding: .35em 1em; }
  .cp .vr-corpo { gap: .5em; }
  .cp .vr-col1 { width: 6.6em; } .cp .vr-previa { height: 9.2em; }
  .cp .vr-col2 { width: 6em; }
  .cp .vr-grade { gap: .1em; }
}
@media (max-height: 450px) { .ve[data-tela=criacao] .ve-boneco { width: 2.6em; height: 3.6em; } }

/* ---------- espera / erro: a lanterna (tela-espera-erro: esquerda = espera, direita = erro) ---------- */
.ve-espera { position: relative; width: min(29em, calc(100vw - .6em)); aspect-ratio: 313 / 252; background: #17181b; border: 1px solid #8a6f3a; border-radius: .45em; }
.ve.com-arte .ve-espera { background: var(--tl-espera) 0 0 / 200% 100% no-repeat; border: 0; border-radius: 0; }
.ve.com-arte .ve-espera.erro { background-position: 100% 0; }
.ve-espera-t { position: absolute; left: 12.5%; top: 47%; width: 75%; height: 33%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25em; text-align: center; overflow: hidden; }
.ve-espera-t .ve-titulo { font-size: 1.2em; }
.ve-espera-t p { font-size: .88em; font-weight: 400; line-height: 1.2; color: #d8caa4; }
.ve-espera.erro .ve-espera-t p { color: #ffb4a8; }
.ve[data-tela=espera] .ve-espera .ve-titulo { white-space: nowrap; }

/* seletor de idioma: cantinho da tela de entrada */
.ve-idioma { position: fixed; top: 8px; right: 8px; z-index: 5; display: flex; gap: 2px; padding: 2px; background: rgba(13, 15, 18, .78); border: 1px solid rgba(201, 169, 96, .55); border-radius: 8px; }
.ve-idioma button { cursor: pointer; padding: 3px 9px; font: 700 12px/1.2 "Trebuchet MS", Verdana, sans-serif; color: #c9b88a; background: transparent; border: 0; border-radius: 6px; }
.ve-idioma button:hover { color: #fff; }
.ve-idioma button.ativo { color: #2a1c08; background: #d8b45a; }
