/* O que a pessoa usa no site por cima do mundo: busca, ficha do personagem, a cidade e o editor de quem é dono. */
@font-face { font-family: "Pixelify Sans"; src: url("PixelifySans.ttf") format("truetype"); font-display: swap; }
:root { --painel: #1B1C2F; --linha: #464868; --texto: #fff; --fraco: #C9C6D8; --amarelo: #FAD741; --verde: #5AF849; --escuro: #1A1A25; }

/* o mundo e a tela de abertura */
html, body { margin: 0; height: 100%; background: #1B1C2F; overflow: hidden; overscroll-behavior: none; touch-action: none; }
#vila { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; outline: none; touch-action: none; }
#carga { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
         padding: 16px; box-sizing: border-box; color: #fff; font: 700 16px/1.4 ui-monospace, Consolas, Menlo, monospace; text-align: center; background: #1B1C2F; }
#carga h1 { margin: 0; color: #FAD741; font-size: clamp(22px, 6vw, 36px); letter-spacing: 1px; }
#carga img { width: 96px; image-rendering: pixelated; }
#trilho { width: min(320px, 80vw); height: 14px; background: #17182C; border: 2px solid #464868; box-sizing: border-box; }
#barra { width: 0; height: 100%; background: #5AF849; transition: width .2s linear; }
#aviso { max-width: 420px; color: #C9C6D8; font-weight: 400; }
#assistir { font: inherit; padding: 12px 20px; color: var(--escuro); background: var(--amarelo); border: 2px solid var(--escuro); border-radius: 0; cursor: pointer; }

#interface { font-family: "Pixelify Sans", ui-monospace, monospace; color: var(--texto); touch-action: auto; }
#interface button, #interface a.botao { font: inherit; font-weight: 700; padding: 8px 12px; color: var(--texto); background: var(--painel); border: 2px solid var(--linha); border-radius: 0; cursor: pointer; }
#interface button.forte { color: var(--escuro); background: var(--amarelo); border-color: var(--escuro); }
#interface input, #interface select, #interface textarea { font: inherit; font-size: 16px; padding: 8px 10px; color: var(--texto); background: var(--painel); border: 2px solid var(--linha); border-radius: 0; outline: none; max-width: 100%; box-sizing: border-box; }
#interface input:focus, #interface select:focus, #interface textarea:focus { border-color: var(--amarelo); }
#interface input::placeholder, #interface textarea::placeholder { color: var(--fraco); }

#busca { position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: min(420px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 6px; z-index: 3; }
#busca form { display: flex; gap: 6px; margin: 0; }
#nick { flex: 1; min-width: 0; }
#resposta { padding: 8px 10px; font-size: 15px; line-height: 1.3; background: var(--painel); border: 2px solid var(--linha); }
#resposta[hidden] { display: none; }
#menu { display: flex; gap: 6px; justify-content: flex-end; }

/* página ao vivo: quem só assiste */
#aoVivo { margin-right: auto; align-self: center; padding: 4px 8px; font-size: 14px; font-weight: 700; color: #fff; background: #C0392B; }
#aoVivo.parado { background: var(--linha); }
#interface a.botao { display: inline-block; text-decoration: none; }
#interface a.botao[hidden] { display: none; }

.janela { position: fixed; top: 96px; right: 16px; bottom: 136px; width: min(420px, calc(100vw - 32px)); box-sizing: border-box; padding: 14px; overflow-y: auto; background: var(--painel); border: 2px solid var(--linha); z-index: 4; -webkit-overflow-scrolling: touch; }
.janela[hidden] { display: none; }
.janela h2 { margin: 0 34px 2px 0; font-size: 22px; color: var(--amarelo); overflow-wrap: anywhere; }
.janela h3 { margin: 14px 0 6px; font-size: 16px; color: var(--amarelo); }
.janela p { margin: 4px 0; line-height: 1.35; }
.janela .fechar { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; padding: 0; }
.fraco { color: var(--fraco); font-size: 14px; }
.dados { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.dados div { padding: 6px 8px; background: #17182C; }
.dados b { display: block; font-size: 18px; overflow-wrap: anywhere; }
.barra { height: 8px; margin: 4px 0 8px; background: #17182C; }
.barra i { display: block; height: 100%; background: var(--verde); }
.historia { list-style: none; margin: 0; padding: 0; }
.historia li { padding: 6px 0; border-top: 1px solid #2E2C3A; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.campo { display: block; margin: 10px 0; }
.campo span { display: block; margin-bottom: 4px; font-size: 14px; color: var(--fraco); }
.campo input, .campo select, .campo textarea { width: 100%; }
.campo input[type=range] { padding: 0; accent-color: var(--amarelo); }
.modelos { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
#interface .modelos button { padding: 4px; aspect-ratio: 1; background: #17182C; }
#interface .modelos button[aria-pressed=true] { border-color: var(--amarelo); }
.modelos img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; display: block; }
/* a escolha da evolução (Noite do Meteoro): três heróis grandes, com o nome da classe embaixo */
.modelos.herois { grid-template-columns: repeat(3, 1fr); }
#interface .modelos.herois button { aspect-ratio: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; }
.modelos.herois img { width: 100%; max-width: 96px; height: auto; aspect-ratio: 1; }
.modelos.herois span { font-size: 13px; line-height: 1.2; text-align: center; }
.erro { color: #ff8f8f; }
.faixa-teste { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 20; padding: 4px 14px; color: #fff; background: #C0392B; font: 700 14px/1.3 "Pixelify Sans", ui-monospace, monospace; white-space: nowrap; pointer-events: none; }
.abas { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
#interface .abas button[aria-pressed=true] { border-color: var(--amarelo); color: var(--amarelo); }
.janela a { color: var(--verde); }
.aceite { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; font-size: 14px; line-height: 1.3; }
#interface .aceite input { flex: none; width: 20px; height: 20px; accent-color: var(--amarelo); }
.botoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.preco { font-size: 32px; font-weight: 700; color: var(--amarelo); margin: 8px 0; }
.lista { margin: 6px 0; padding-left: 20px; }
.lista li { margin: 4px 0; }
.ligacao { padding: 0 !important; border: 0 !important; background: none !important; color: var(--verde) !important; text-decoration: underline; font-weight: 400 !important; }

/* em pé, no celular: as janelas sobem do rodapé, sem esconder o personagem encontrado */
@media (orientation: portrait) {
  #busca { left: 16px; right: 16px; width: auto; }
  .janela { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 62dvh; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
}
@media (max-height: 520px) {
  .janela { top: 8px; bottom: 8px; }
}
