/* ------------------------------------------------------------------
   Fontes no proprio projeto (36 KB no total).
   Depender do Google Fonts era risco alto aqui: se a rede do servidor
   bloquear, a fonte pixelada some e o visual inteiro vira monoespaçado
   comum. Assim funciona sempre, inclusive sem internet externa.
   ------------------------------------------------------------------ */

@font-face {
  font-family: 'Pixelify Sans';
  src: url('fontes/pixelify-sans-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: 'Pixelify Sans';
  src: url('fontes/pixelify-sans-latin-500-normal.woff2') format('woff2');
  font-weight: 500 700;
  font-display: block;
}
@font-face {
  font-family: 'Silkscreen';
  src: url('fontes/silkscreen-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: 'Silkscreen';
  src: url('fontes/silkscreen-latin-ext-400-normal.woff2') format('woff2');
  font-weight: 400;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
  font-display: block;
}

/* ==================================================================
   ChatCraft Web — visual do jogo
   Sem canto arredondado, borda chanfrada de inventário, sombra de
   texto deslocada (o detalhe que mais "cheira" a Minecraft) e fonte
   pixelada.
   ================================================================== */

:root {
  /* mundo */
  --fundo:        #14151a;
  --fundo-2:      #1b1d23;

  /* painel de inventario */
  --painel:       #2f3136;
  --painel-alto:  #3a3d43;
  --painel-fundo: #26282c;
  --bevel-claro:  #565a63;
  --bevel-escuro: #101114;

  /* pedra dos botoes */
  --pedra:        #6e7178;
  --pedra-clara:  #8d9199;
  --pedra-escura: #3f4248;

  /* texto */
  --texto:        #f2f2f4;
  --texto-2:      #b9bbc2;
  --texto-3:      #83868e;
  --sombra-texto: rgba(0, 0, 0, .75);

  /* cores oficiais do chat do jogo */
  --amarelo:  #fcfc54;
  --ouro:     #ffaa00;
  --verde:    #55ff55;
  --vermelho: #ff5555;
  --aqua:     #55ffff;
  --cinza:    #aaaaaa;

  --topo: 56px;

  --pix: 'Pixelify Sans', 'Silkscreen', ui-monospace, monospace;
  --tela: 'Silkscreen', 'Pixelify Sans', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--pix);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
  text-shadow: 2px 2px 0 var(--sombra-texto);
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  image-rendering: pixelated;
}

/* Fundo de terra escurecida — e literalmente o que o Minecraft usa
   atras dos menus. Textura de 16x16 ampliada sem suavizar. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url('bloco-terra.png');
  background-size: 64px 64px;
  background-repeat: repeat;
  image-rendering: pixelated;
  opacity: .62;
}
body::after {                     /* escurece, como o jogo faz */
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 35%, rgba(0,0,0,.52), rgba(0,0,0,.76) 78%);
}

.oculto { display: none !important; }
.tela { height: 100%; position: relative; z-index: 1; }

::selection { background: var(--ouro); color: #1a1205; text-shadow: none; }

/* barra de rolagem quadrada */
* { scrollbar-width: thin; scrollbar-color: var(--pedra) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: var(--pedra);
  border: 2px solid var(--fundo-2);
  box-shadow: inset 2px 2px 0 var(--pedra-clara), inset -2px -2px 0 var(--pedra-escura);
}
*::-webkit-scrollbar-track { background: transparent; }

/* ==================================================================
   Chanfro: a assinatura da interface do jogo
   ================================================================== */

.chanfro {
  box-shadow:
    inset 2px 2px 0 var(--bevel-claro),
    inset -2px -2px 0 var(--bevel-escuro);
}
.chanfro-fundo {           /* afundado, como um campo de texto */
  box-shadow:
    inset 2px 2px 0 var(--bevel-escuro),
    inset -2px -2px 0 var(--bevel-claro);
}

/* ==================================================================
   Marca
   ================================================================== */

.marca { display: flex; align-items: center; gap: 12px; }
.marca h1 {
  font-family: var(--tela);
  font-size: 22px;
  margin: 0;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--texto);
}
.marca h1 em { font-style: normal; color: var(--amarelo); }
.marca.compacta strong {
  font-family: var(--tela);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1px;
}

/* bloco de grama em CSS puro */
.bloco {
  width: 30px; height: 30px;
  flex: none;
  position: relative;
  background: linear-gradient(180deg, #6aa63f 0 34%, #8a6440 34% 100%);
  box-shadow:
    inset 2px 2px 0 rgba(255,255,255,.28),
    inset -2px -2px 0 rgba(0,0,0,.45);
  image-rendering: pixelated;
}
.bloco::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(0,0,0,.14) 0 3px, transparent 3px 6px),
    repeating-linear-gradient(0deg, rgba(0,0,0,.12) 0 3px, transparent 3px 6px);
}
.marca.compacta .bloco { width: 24px; height: 24px; }

/* ==================================================================
   Login — tela de menu do jogo
   ================================================================== */

.tela-centro {
  display: flex;
  /* flex-start + margem automatica no cartao: centralizado quando sobra
     espaco, rolavel quando falta. Com align-items:center o topo do cartao
     fica cortado e fora de alcance em tela baixa (celular deitado). */
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}
.tela-centro > .cartao { margin: auto 0; }

.cartao {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--painel);
  border: 4px solid var(--bevel-escuro);
  padding: 30px 28px 24px;
  box-shadow:
    inset 2px 2px 0 var(--bevel-claro),
    inset -2px -2px 0 var(--bevel-escuro),
    0 10px 0 rgba(0,0,0,.35);
}
.cartao .marca { margin-bottom: 18px; }

/* a logo do servidor mandando na tela de entrada */
.marca-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.logo-wild {
  /* quem manda é a altura: em tela baixa a logo cede espaço sozinha, sem
     media query. (Com `width` fixo + `max-height`, o navegador corta a
     altura e mantém a largura — a arte fica achatada.) */
  height: min(210px, 26vh);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  /* sombra acompanhando o contorno, não uma caixa atrás */
  filter: drop-shadow(3px 3px 0 rgba(0,0,0,.45));
}
.marca-login h1 {
  font-family: var(--tela);
  font-size: 18px;
  margin: 0;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--texto-2);
  text-align: center;
}
.marca-login h1 em { font-style: normal; color: var(--amarelo); }

/* tela baixa: aperta o resto junto com a logo */
@media (max-height: 680px) {
  .marca-login { gap: 6px; margin-bottom: 12px; }
  .cartao { padding: 18px 20px 16px; }
}

/* ==================================================================
   Texto auxiliar
   ================================================================== */

.ajuda {
  color: var(--texto-2);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 16px;
}
.rodape-ajuda {
  color: var(--texto-3);
  font-size: 13px;
  line-height: 1.5;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 2px solid var(--bevel-escuro);
}
.erro {
  color: var(--vermelho);
  font-size: 14px;
  margin: 0 0 12px;
  padding: 9px 11px;
  background: rgba(255,85,85,.12);
  box-shadow: inset 2px 2px 0 rgba(255,85,85,.35), inset -2px -2px 0 rgba(0,0,0,.4);
}

/* ==================================================================
   Campos
   ================================================================== */

.campo { display: block; margin-bottom: 14px; }
.campo > span {
  display: block;
  font-family: var(--tela);
  font-size: 10px;
  color: var(--texto-3);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

input[type="text"], input[type="password"], input[type="number"], input[type="email"] {
  width: 100%;
  background: #0b0c0f;
  border: none;
  color: var(--texto);
  padding: 11px 12px;
  font-size: 16px;
  font-family: var(--pix);
  text-shadow: 2px 2px 0 var(--sombra-texto);
  outline: none;
  box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 #4a4d54;
  transition: box-shadow .1s;
}
input::placeholder { color: var(--texto-3); }
input:focus {
  box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 #4a4d54, 0 0 0 2px var(--amarelo);
}

/* Campo preenchido pelo navegador (senha salva).
   O Chrome pinta o fundo de azul claro com `!important` na folha dele —
   nenhum `background` daqui ganha dessa briga. Mas ele não mexe em
   `box-shadow`: uma sombra interna gorda cobre o campo inteiro e devolve
   o fundo escuro. O relevo continua por cima porque vem antes na lista. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--texto);
  caret-color: var(--texto);
  box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 #4a4d54, inset 0 0 0 100px #0b0c0f;
  /* segura o "flash" amarelo que o Chrome faz ao preencher */
  transition: background-color 99999s ease-in-out 0s;
}
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--texto);
  box-shadow:
    inset 2px 2px 0 #000, inset -2px -2px 0 #4a4d54,
    inset 0 0 0 100px #0b0c0f,
    0 0 0 2px var(--amarelo);
}

.linha-dupla { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ==================================================================
   Botoes de pedra
   ================================================================== */

.botao {
  border: none;
  background: var(--pedra);
  color: var(--texto);
  font-family: var(--tela);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(0,0,0,.6);
  padding: 12px 16px;
  cursor: pointer;
  box-shadow:
    inset 2px 2px 0 var(--pedra-clara),
    inset -2px -2px 0 var(--pedra-escura);
  transition: background .08s;
  white-space: nowrap;
}
.botao:hover { background: #7e828a; color: var(--amarelo); }
.botao:active {
  /* afunda, como o botao do jogo */
  box-shadow: inset 2px 2px 0 var(--pedra-escura), inset -2px -2px 0 var(--pedra-clara);
  padding: 13px 16px 11px;
}
.botao:focus-visible { outline: 2px solid var(--amarelo); outline-offset: 2px; }

.botao.principal {
  background: #3f8f3f;
  box-shadow: inset 2px 2px 0 #63bb63, inset -2px -2px 0 #235f23;
  color: #fff;
}
.botao.principal:hover { background: #4aa64a; color: var(--amarelo); }
.botao.principal:active { box-shadow: inset 2px 2px 0 #235f23, inset -2px -2px 0 #63bb63; }

.botao.perigo {
  background: #a33b3b;
  box-shadow: inset 2px 2px 0 #cc5c5c, inset -2px -2px 0 #6e2020;
  color: #fff;
}
.botao.perigo:hover { background: #b84545; }
.botao.perigo:active { box-shadow: inset 2px 2px 0 #6e2020, inset -2px -2px 0 #cc5c5c; }

.botao.fantasma {
  background: var(--painel-alto);
  box-shadow: inset 2px 2px 0 var(--bevel-claro), inset -2px -2px 0 var(--bevel-escuro);
  color: var(--texto-2);
}
.botao.fantasma:hover { background: #45484f; color: var(--amarelo); }
.botao.fantasma:active { box-shadow: inset 2px 2px 0 var(--bevel-escuro), inset -2px -2px 0 var(--bevel-claro); }

.botao.largo { display: block; width: 100%; margin-top: 10px; text-align: center; text-decoration: none; }
.botao.pequeno { padding: 9px 12px; font-size: 10px; }
.botao.pequeno:active { padding: 10px 12px 8px; }
.botao.icone { padding: 11px 13px; font-size: 14px; letter-spacing: 0; }
.botao:disabled { opacity: .45; cursor: not-allowed; }

/* ==================================================================
   Topo
   ================================================================== */

.topo {
  height: var(--topo);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  padding-top: env(safe-area-inset-top);
  background: var(--painel);
  border-bottom: 4px solid var(--bevel-escuro);
  box-shadow: inset 0 2px 0 var(--bevel-claro);
  position: sticky;
  top: 0;
  z-index: 20;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
  padding: 6px 11px;
  background: #0b0c0f;
  box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 #3a3d44;
  font-family: var(--tela);
  font-size: 10px;
  letter-spacing: .5px;
  color: var(--texto-2);
}
#status-texto { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* quadradinho, nunca bolinha */
.ponto {
  width: 8px; height: 8px;
  background: var(--texto-3);
  flex: none;
}
.ponto.on   { background: var(--verde);    box-shadow: 0 0 0 2px rgba(85,255,85,.2); }
.ponto.meio { background: var(--ouro);     animation: piscar 1s steps(2, end) infinite; }
.ponto.erro { background: var(--vermelho); box-shadow: 0 0 0 2px rgba(255,85,85,.2); }

@keyframes piscar { 0%, 100% { opacity: 1 } 50% { opacity: .25 } }

.acoes-topo { display: flex; gap: 8px; flex: none; }

/* ==================================================================
   Autorizacao Microsoft — placa de aviso
   ================================================================== */

.caixa-codigo {
  padding: 22px 16px;
  text-align: center;
  background: var(--painel-fundo);
  border-bottom: 4px solid var(--bevel-escuro);
  box-shadow: inset 0 2px 0 var(--bevel-claro);
}
.titulo-codigo {
  font-family: var(--tela);
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--amarelo);
  text-transform: uppercase;
}
.caixa-codigo .ajuda { margin-bottom: 14px; }

.codigo {
  display: inline-block;
  font-family: var(--tela);
  font-size: clamp(22px, 7vw, 30px);
  letter-spacing: 6px;
  text-indent: 6px;
  color: var(--amarelo);
  background: #0b0c0f;
  padding: 16px 20px;
  margin-bottom: 10px;
  cursor: pointer;
  user-select: all;
  box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 #4a4d54, 0 0 0 2px var(--ouro);
}

.relogio {
  margin: 0 0 14px;
  font-family: var(--tela);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--texto-3);
}
.relogio.vencido { color: var(--vermelho); }

.caixa-codigo .botao.largo { max-width: 360px; margin-left: auto; margin-right: auto; }

.passos {
  max-width: 380px;
  margin: 16px auto 0;
  padding-left: 22px;
  text-align: left;
  font-size: 14px;
  line-height: 1.6;
  color: var(--texto-2);
}
.passos li { margin-bottom: 4px; }
.passos li::marker { color: var(--amarelo); }
.passos strong { color: var(--texto); font-weight: 400; }

.alerta {
  max-width: 380px;
  margin: 14px auto 0;
  padding: 11px 12px;
  background: rgba(255,85,85,.12);
  box-shadow: inset 2px 2px 0 rgba(255,85,85,.32), inset -2px -2px 0 rgba(0,0,0,.45);
  color: #ff9b9b;
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}

/* ==================================================================
   Corpo
   ================================================================== */

.corpo {
  display: flex;
  height: calc(100% - var(--topo));
  min-height: 0;
}

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background-color: #0e0f13;
  background-image:
    linear-gradient(180deg, rgba(0,0,0,.86), rgba(0,0,0,.92)),
    url('bloco-pedra.png');
  background-size: auto, 64px 64px;
  image-rendering: pixelated;
}

/* ---------- caixa de chat do jogo ---------- */

.chat {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 6px 12px 0;
  font-size: 16px;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
#chat-linhas { margin-top: auto; }

.chat .linha {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 2px 14px 3px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  background: rgba(0, 0, 0, .42);       /* igual ao chat do Minecraft */
  margin-bottom: 1px;
}
.chat .linha:hover { background: rgba(0, 0, 0, .62); }

.chat .hora {
  flex: none;
  color: #5e6068;
  font-family: var(--tela);
  font-size: 9px;
  letter-spacing: .5px;
  padding-top: 3px;
}

.chat .sistema { color: var(--cinza); }
.chat .sistema.ok     { color: var(--verde); }
.chat .sistema.erro   { color: var(--vermelho); }
.chat .sistema.aviso  { color: var(--ouro); }
.chat .sistema.enviado{ color: var(--amarelo); }

/**
 * Trecho clicavel vindo do servidor.
 *
 * No jogo, texto com clickEvent e IGUAL ao texto comum — quem descobre
 * que da para clicar e o cursor e a dica. Por isso aqui nao ha caixa,
 * fundo nem borda: uma mensagem onde o servidor poe clique no prefixo e
 * no nick tem que sair igualzinha a uma onde ele nao poe.
 * O aviso de que clica aparece so no hover.
 */
.chat .clicavel {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-shadow: inherit;
  line-height: inherit;
  vertical-align: baseline;
  cursor: pointer;
  /* Botao descarta espaco no comeco e no fim. Como o servidor manda
     "ADMIN " com o espaco DENTRO do pedaco clicavel, sem isto as
     palavras grudavam. */
  white-space: pre-wrap;
}
.chat .clicavel:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  filter: brightness(1.25);
}
.chat .clicavel:active { filter: brightness(.85); }
.chat .clicavel:focus-visible { outline: 2px solid var(--amarelo); outline-offset: 1px; }

/* estado vazio */
.vazio {
  margin: auto;
  padding: 40px 24px;
  text-align: center;
  color: var(--texto-3);
  font-size: 14px;
  line-height: 1.7;
  max-width: 360px;
}
.vazio .icone-vazio {
  font-size: 34px;
  display: block;
  margin-bottom: 14px;
  opacity: .55;
}
.vazio strong {
  display: block;
  font-family: var(--tela);
  color: var(--texto-2);
  font-size: 13px;
  letter-spacing: 1px;
  margin-bottom: 10px;
  font-weight: 400;
  text-transform: uppercase;
}

/* ---------- barra de envio ---------- */

.barra-envio {
  display: flex;
  gap: 10px;
  padding: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: var(--painel);
  border-top: 4px solid var(--bevel-escuro);
  box-shadow: inset 0 2px 0 var(--bevel-claro);
}
.barra-envio input { flex: 1; }
.campo-envio { position: relative; flex: 1; min-width: 0; display: flex; }

/* ---------- sugestoes do servidor (tab-complete) ---------- */

.sugestoes {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 46vh;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 3px;
  background: var(--painel);
  box-shadow:
    inset 2px 2px 0 var(--bevel-claro),
    inset -2px -2px 0 var(--bevel-escuro),
    0 -6px 0 rgba(0,0,0,.35);
  z-index: 15;
}

.sugestao {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 10px;
  cursor: pointer;
  background: rgba(0,0,0,.28);
  margin-bottom: 2px;
}
.sugestao:last-child { margin-bottom: 0; }
.sugestao:hover { background: rgba(0,0,0,.5); }
.sugestao.ativa {
  background: var(--ambar, #3f8f3f);
  background: #3f8f3f;
  box-shadow: inset 2px 2px 0 #63bb63, inset -2px -2px 0 #235f23;
}
.sugestao.ativa .sugestao-valor { color: #fff; }

.sugestao-valor {
  font-size: 15px;
  color: var(--amarelo);
  word-break: break-all;
}
.sugestao-dica {
  margin-left: auto;
  font-size: 11px;
  color: var(--texto-3);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}
.sugestao.ativa .sugestao-dica { color: rgba(255,255,255,.8); }

/* ==================================================================
   Painel lateral — janela de inventario
   ================================================================== */

.lateral {
  width: 356px;
  flex: none;
  background: var(--painel);
  border-left: 4px solid var(--bevel-escuro);
  box-shadow: inset 2px 0 0 var(--bevel-claro);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* abas iguais as do inventario criativo */
.abas {
  display: flex;
  gap: 3px;
  padding: 8px 8px 0;
  background: var(--painel-fundo);
  border-bottom: 3px solid var(--bevel-escuro);
  flex: none;
}
.abas::-webkit-scrollbar { display: none; }

.aba {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  background: var(--painel-alto);
  border: none;
  color: var(--texto-3);
  font-family: var(--tela);
  font-size: 9px;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(0,0,0,.6);
  padding: 10px 4px;
  cursor: pointer;
  box-shadow: inset 2px 2px 0 var(--bevel-claro), inset -2px -2px 0 var(--bevel-escuro);
  margin-bottom: -3px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .08s;
}
.aba:hover { color: var(--texto-2); background: #43464d; }
.aba.ativa {
  background: var(--painel);
  color: var(--amarelo);
  box-shadow: inset 2px 2px 0 var(--bevel-claro), inset -2px 0 0 var(--bevel-escuro);
  padding-bottom: 13px;
}

.fechar-painel {
  display: none;
  margin-left: auto;
  align-self: flex-start;
  background: var(--painel-alto);
  border: none;
  color: var(--texto-2);
  font-family: var(--tela);
  font-size: 11px;
  width: 34px; height: 34px;
  cursor: pointer;
  flex: none;
  box-shadow: inset 2px 2px 0 var(--bevel-claro), inset -2px -2px 0 var(--bevel-escuro);
}
.fechar-painel:hover { color: var(--vermelho); }
.fechar-painel:active { box-shadow: inset 2px 2px 0 var(--bevel-escuro), inset -2px -2px 0 var(--bevel-claro); }

.lateral-conteudo {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.painel { display: none; }
.painel.ativo { display: block; }

.secao { margin-bottom: 22px; }
.secao:last-child { margin-bottom: 0; }
.secao h2 {
  font-family: var(--tela);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--texto-3);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.contagem {
  background: var(--ouro);
  color: #1a1205;
  padding: 2px 7px;
  font-family: var(--tela);
  font-size: 9px;
  letter-spacing: 0;
  text-shadow: none;
}

.cartao-info {
  background: var(--painel-fundo);
  padding: 12px;
  margin-bottom: 14px;
  box-shadow: inset 2px 2px 0 var(--bevel-escuro), inset -2px -2px 0 var(--bevel-claro);
}
.cartao-info .linha-usuario { margin: 0; }

.linha-usuario { font-size: 14px; color: var(--texto-2); }
.linha-usuario strong { color: var(--amarelo); font-weight: 400; }

/* ---------- listas ---------- */

.jogadores, .lista-favoritos, .lista-usuarios { list-style: none; margin: 0; padding: 0; }

/* lista de jogadores igual a do Tab no jogo */
.jogadores li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  font-size: 15px;
  cursor: pointer;
  background: rgba(0,0,0,.3);
  margin-bottom: 2px;
}
.jogadores li:hover { background: rgba(0,0,0,.5); color: var(--amarelo); }
.jogadores li .cabeca {           /* "cabeça" do jogador, 8x8 */
  width: 16px; height: 16px;
  flex: none;
  background: #7a5b43;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.22), inset -2px -2px 0 rgba(0,0,0,.4);
}
.jogadores li .ping {
  margin-left: auto;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.jogadores li .ping i {          /* barrinhas de sinal */
  width: 3px;
  background: #3d4047;
  display: block;
}
.jogadores li .ping i.on { background: var(--verde); }
.jogadores li .ping i:nth-child(1) { height: 4px; }
.jogadores li .ping i:nth-child(2) { height: 6px; }
.jogadores li .ping i:nth-child(3) { height: 8px; }
.jogadores li .ping i:nth-child(4) { height: 10px; }
.jogadores li .ping i:nth-child(5) { height: 12px; }

.jogadores .nenhum {
  color: var(--texto-3);
  font-size: 14px;
  padding: 10px 4px;
  cursor: default;
  background: none;
}
.jogadores .nenhum:hover { background: none; color: var(--texto-3); }

.lista-favoritos li, .lista-usuarios li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  background: rgba(0,0,0,.3);
  margin-bottom: 2px;
}
.lista-favoritos li:hover, .lista-usuarios li:hover { background: rgba(0,0,0,.5); }

.usar-favorito {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: none;
  border: none;
  color: var(--texto);
  font: inherit;
  text-shadow: inherit;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}
.usar-favorito .nome { font-size: 15px; }
.usar-favorito:hover .nome { color: var(--amarelo); }
.lista-favoritos .cmd {
  color: var(--texto-3);
  font-family: var(--tela);
  font-size: 9px;
  letter-spacing: .5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remover {
  background: none;
  border: none;
  color: var(--texto-3);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 6px 10px;
  flex: none;
  text-shadow: inherit;
}
.remover:hover { color: var(--vermelho); }

.lista-usuarios .nome { padding: 9px 10px; font-size: 15px; }
.lista-usuarios .etiqueta {
  background: var(--ouro);
  color: #1a1205;
  padding: 2px 6px;
  font-family: var(--tela);
  font-size: 8px;
  letter-spacing: .5px;
  text-transform: uppercase;
  text-shadow: none;
}
.acoes-usuario { margin-left: auto; display: flex; align-items: center; gap: 3px; flex: none; padding-right: 4px; }
.acoes-usuario .mini {
  background: var(--painel-alto);
  border: none;
  color: var(--texto-2);
  font-family: var(--tela);
  font-size: 9px;
  letter-spacing: .5px;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(0,0,0,.6);
  padding: 5px 9px;
  cursor: pointer;
  box-shadow: inset 2px 2px 0 var(--bevel-claro), inset -2px -2px 0 var(--bevel-escuro);
}
.acoes-usuario .mini:hover { color: var(--amarelo); }
.acoes-usuario .mini:active { box-shadow: inset 2px 2px 0 var(--bevel-escuro), inset -2px -2px 0 var(--bevel-claro); }

/* ---------- formularios no painel ---------- */

.form-compacto { margin-top: 12px; }
.form-compacto .campo { margin-bottom: 10px; }
.form-compacto code, .ajuda code {
  background: #0b0c0f;
  padding: 1px 6px;
  font-family: var(--tela);
  font-size: 10px;
  color: var(--amarelo);
  box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 #3a3d44;
}
.aviso-linha { font-size: 13px; color: var(--verde); margin: 10px 0 0; min-height: 1em; }
.aviso-linha.ruim { color: var(--vermelho); }

.separador { height: 3px; background: var(--bevel-escuro); box-shadow: 0 3px 0 var(--bevel-claro); margin: 22px 0 26px; border: none; }

/* ==================================================================
   Celular
   ================================================================== */

.fundo-lateral {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 25;
}

/* ==================================================================
   Menu aberto pelo servidor — a janela de inventario do jogo

   As cores sao as do Minecraft, tiradas do proprio jogo: painel
   #C6C6C6 com relevo branco em cima e #555 embaixo, slot #8B8B8B
   afundado (escuro em cima/esquerda, branco embaixo/direita) e a
   dica roxa #100010. Nada de tema escuro aqui: esta janela e a do
   jogo, nao a do site.
   ================================================================== */

.menu-fundo {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0,0,0,.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
  overflow: auto;
}

.menu-janela {
  /* largura pela grade, como no jogo — nao estica ate a tela toda */
  width: auto;
  max-width: 100%;
  background: #c6c6c6;
  border: none;
  padding: 8px;
  box-shadow:
    inset 3px 3px 0 #ffffff,
    inset -3px -3px 0 #555555,
    0 8px 0 rgba(0,0,0,.45);
}

.menu-topo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 2px 6px;
}
.menu-titulo {
  flex: 1;
  min-width: 0;
  font-family: var(--pix);
  font-size: 15px;
  letter-spacing: 0;
  /* o titulo do jogo e cinza escuro e SEM sombra */
  color: #404040;
  text-shadow: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-titulo span { text-shadow: none; }

/* botao de fechar no estilo dos botoes do jogo */
.menu-topo .botao {
  background: #c6c6c6;
  color: #3f3f3f;
  text-shadow: none;
  font-size: 10px;
  padding: 6px 10px;
  box-shadow: inset 2px 2px 0 #ffffff, inset -2px -2px 0 #555555;
}
.menu-topo .botao:hover { background: #d4d4d4; }
.menu-topo .botao:active {
  box-shadow: inset 2px 2px 0 #555555, inset -2px -2px 0 #ffffff;
  transform: none;
}

.menu-grade {
  display: grid;
  /* colados: a borda branca de um slot encosta na escura do vizinho,
     igual a textura do jogo */
  gap: 0;
  background: #c6c6c6;
  padding: 0;
  box-shadow: none;
}

.slot {
  position: relative;
  width: 46px;
  height: 46px;
  min-height: 0;
  background: #8b8b8b;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  font: inherit;
  color: #fff;
  box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #ffffff;
  overflow: visible;
}
/* no jogo o slot sob o mouse recebe um veu branco */
.slot:hover { background: #c5c5c5; }
.slot:active { background: #b6b6b6; }
.slot:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

/* slot vazio e igual aos outros — no jogo nao ha diferenca nenhuma */
.slot.vazio-slot {
  background: #8b8b8b;
  box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #ffffff;
  cursor: default;
}

/* O item: a textura de verdade, recortada da folha itens.png.
   Sem suavizar — textura de 16x16 esticada tem que continuar quadrada. */
.slot .item-icone {
  width: 32px; height: 32px;
  flex: none;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}
/* item que nao esta na folha (plugin, mod, versao nova): quadrado de cor */
.slot .item-icone.sem-textura {
  width: 28px; height: 28px;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.3), inset -2px -2px 0 rgba(0,0,0,.45);
}

/* No computador quem mostra nome e descricao e a dica, como no jogo. */
.slot-nome, .slot-lore { display: none; }

/* quantidade no canto de baixo a direita, branca com sombra */
.slot-qtd {
  position: absolute;
  right: 3px;
  bottom: 0;
  padding: 0;
  background: none;
  font-family: var(--pix);
  font-size: 14px;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0,0,0,.65);
  line-height: 1.2;
  pointer-events: none;
}

/* ---- a dica que aparece ao passar o mouse, igual a do jogo ---- */
.dica-item {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  max-width: 320px;
  padding: 6px 7px;
  /* fundo #100010 com a moldura roxa em degrade — as duas cores do jogo */
  background:
    linear-gradient(rgba(16,0,16,.94), rgba(16,0,16,.94)) padding-box,
    linear-gradient(180deg, rgba(80,0,255,.31), rgba(40,0,127,.31)) border-box;
  border: 2px solid transparent;
  box-shadow: 0 0 0 2px rgba(16,0,16,.94);
  font-size: 14px;
  line-height: 1.35;
}
.dica-item .dica-linha { white-space: pre-wrap; word-break: break-word; }
.dica-item .dica-lore { color: #aaa; }
.dica-item .dica-id {
  color: #555;
  font-size: 12px;
  margin-top: 2px;
}

.menu-dica {
  margin: 8px 2px 2px;
  font-size: 11px;
  color: #555;
  text-shadow: none;
  text-align: center;
}

/* No celular nao existe passar o mouse, e 9 colunas picam os nomes no
   meio ("Comp rar"). Entao aqui vira lista: um item por linha, com nome
   e descricao inteiros. A posicao do item so importa para o servidor — e
   ela vai no clique, nao na tela.

   A linha recebe o fundo escuro da dica do jogo de proposito: nome de
   item vem nas cores do chat (amarelo, verde, ciano), e essas cores
   foram feitas para fundo preto — sobre o cinza claro do painel elas
   somem. */
@media (max-width: 640px) {
  .menu-janela { padding: 6px; width: 100%; }
  .menu-grade {
    display: flex !important;
    flex-direction: column;
    gap: 3px;
    padding: 0;
    max-height: 62vh;
    overflow-y: auto;
  }
  .slot.vazio-slot { display: none; }
  .slot {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "cubo nome qtd"
      "cubo lore qtd";
    align-items: center;
    column-gap: 10px;
    width: auto;
    height: auto;
    text-align: left;
    padding: 9px 10px;
    color: var(--texto);
    background:
      linear-gradient(rgba(16,0,16,.94), rgba(16,0,16,.94)) padding-box,
      linear-gradient(180deg, rgba(80,0,255,.31), rgba(40,0,127,.31)) border-box;
    border: 2px solid transparent;
    box-shadow: none;
  }
  .slot:hover, .slot:active {
    background:
      linear-gradient(rgba(34,4,36,.96), rgba(34,4,36,.96)) padding-box,
      linear-gradient(180deg, rgba(80,0,255,.5), rgba(40,0,127,.5)) border-box;
  }
  .slot .item-icone { grid-area: cubo; width: 32px; height: 32px; }
  .slot .item-icone.sem-textura { width: 26px; height: 26px; }
  .slot-nome {
    grid-area: nome;
    display: block;
    font-size: 15px;
    line-height: 1.3;
  }
  .slot-lore {
    grid-area: lore;
    display: block;
    font-size: 12px;
    line-height: 1.3;
    color: #aaa;
  }
  .slot-lore .lore-linha { display: block; }
  .slot-qtd {
    grid-area: qtd;
    position: static;
    font-size: 15px;
    align-self: center;
  }
  .dica-item { display: none; }
}

@media (max-width: 860px) {
  body { font-size: 16px; }
  .lateral {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(92vw, 360px);
    z-index: 30;
    transform: translateX(101%);
    transition: transform .18s steps(4, end);
    padding-top: env(safe-area-inset-top);
    border-left: 4px solid var(--bevel-escuro);
  }
  .lateral.aberta { transform: translateX(0); }
  .fechar-painel { display: block; }
  .chat .linha { padding-left: 12px; padding-right: 12px; }
}

/* Em tela estreita o bloco sozinho ja identifica o app, e o espaco vai
   para o status, que e a informacao que muda. */
@media (max-width: 520px) {
  .marca.compacta strong { display: none; }
  .topo { gap: 8px; padding: 0 8px; }
  .status { padding: 6px 9px; }
}

@media (min-width: 861px) {
  #btn-painel { display: none; }
  .fundo-lateral { display: none !important; }
}
