
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Times New Roman", Times, serif;
  background: #f5f0e8;
  color: #000;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s, color 0.3s;
}

body.tema-escuro {
  background: #1a1a1a;
  color: #fff;
}

/* ========== HEADER ========== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
}

.logo {
  font-size: 3rem;
  font-weight: bold;
  letter-spacing: 2px;
}

.btn-tema {
  padding: 0.4rem 1rem;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.9rem;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  cursor: pointer;
  transition: all 0.3s;
}

body.tema-escuro .btn-tema {
  background: #fff;
  color: #000;
  border: 1px solid #fff;
}

/* ========== APP HEADER ========== */
.app-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.header-esquerda {
  display: flex;
  align-items: center;
}

.header-direita {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo-app {
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: 1px;
}

.btn-correspondencia {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.3rem;
}

body.tema-escuro .btn-correspondencia {
  filter: invert(1);
}

.icone-perfil {
  width: 40px;
  height: 40px;
  border: 1px solid #000;
  background: #ddd;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  overflow: hidden;
}

body.tema-escuro .icone-perfil {
  border: 1px solid #fff;
  background: #444;
}

.icone-perfil img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-hamburguer {
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  font-family: "Times New Roman", Times, serif;
  padding: 0.3rem;
}

body.tema-escuro .menu-hamburguer {
  color: #fff;
}

/* ========== LINHAS DIVISÓRIAS ========== */
.linha-divisoria {
  display: flex;
  flex-direction: column;
  height: 6px;
}

.linha-preta {
  flex: 1;
  background: #000;
  transition: background 0.3s;
}

.linha-vermelha {
  flex: 1;
  background: #cc0000;
}

body.tema-escuro .linha-preta {
  background: #fff;
}

/* ========== NAVEGAÇÃO ========== */
.nav-botoes {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 0.8rem;
  flex-wrap: wrap;
}

.nav-btn {
  padding: 0.4rem 1.5rem;
  font-family: "Times New Roman", Times, serif;
  font-size: 1rem;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  cursor: pointer;
  transition: all 0.3s;
}

.nav-btn:hover {
  background: #333;
}

.nav-btn.ativo {
  background: #cc0000;
  border-color: #cc0000;
}

body.tema-escuro .nav-btn {
  background: #fff;
  color: #000;
  border: 1px solid #fff;
}

body.tema-escuro .nav-btn:hover {
  background: #ccc;
}

body.tema-escuro .nav-btn.ativo {
  background: #cc0000;
  color: #fff;
  border-color: #cc0000;
}

/* ========== CORPO ========== */
.corpo {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  padding: 3rem 1rem;
}

.bloco-acao {
  text-align: center;
}

.bloco-acao p {
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
}

.btn-acao {
  padding: 0.6rem 2rem;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.1rem;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-acao:hover {
  background: #333;
}

body.tema-escuro .btn-acao {
  background: #fff;
  color: #000;
  border: 1px solid #fff;
}

body.tema-escuro .btn-acao:hover {
  background: #ccc;
}

/* ========== CONTEÚDO ========== */
.conteudo {
  flex: 1;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
}

.secao-pagina {
  display: none;
}

.secao-pagina.ativa {
  display: block;
}

.titulo-secao {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ========== LISTA DE AMIGOS ========== */
.lista-amigos {
  margin-bottom: 2rem;
}

.amigo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid #000;
  margin-bottom: 0.5rem;
  background: #fff;
}

body.tema-escuro .amigo-item {
  background: #2a2a2a;
  border: 1px solid #fff;
}

.amigo-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.amigo-avatar {
  width: 35px;
  height: 35px;
  border: 1px solid #000;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  overflow: hidden;
  cursor: pointer;
}

body.tema-escuro .amigo-avatar {
  border: 1px solid #fff;
  background: #444;
}

.amigo-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.amigo-nome {
  cursor: pointer;
}

.amigo-nome:hover {
  text-decoration: underline;
}

.btn-remover {
  padding: 0.3rem 0.8rem;
  font-family: "Times New Roman", Times, serif;
  background: #cc0000;
  color: #fff;
  border: 1px solid #cc0000;
  cursor: pointer;
}

/* ========== BOTÃO ADICIONAR ========== */
.btn-adicionar-amigos {
  display: block;
  margin: 0 auto;
  padding: 0.6rem 2rem;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.1rem;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-adicionar-amigos:hover {
  background: #333;
}

body.tema-escuro .btn-adicionar-amigos {
  background: #fff;
  color: #000;
  border: 1px solid #fff;
}

body.tema-escuro .btn-adicionar-amigos:hover {
  background: #ccc;
}

/* ========== RODAPÉ ========== */
.rodape {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
}

/* ========== OVERLAY ========== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 100;
}

/* ========== POPUPS ========== */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  background: #f5f0e8;
  border: 2px solid #000;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
}

body.tema-escuro .popup {
  background: #1a1a1a;
  border: 2px solid #fff;
}

.popup h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.popup .fechar {
  position: absolute;
  right: 0.8rem;
  top: 0.3rem;
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  font-family: "Times New Roman", Times, serif;
  color: #000;
}

body.tema-escuro .popup .fechar {
  color: #fff;
}

.popup label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
}

.input-campo {
  display: block;
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  font-family: "Times New Roman", Times, serif;
  font-size: 1rem;
  border: 1px solid #000;
  background: #fff;
}

body.tema-escuro .input-campo {
  background: #333;
  color: #fff;
  border: 1px solid #fff;
}

.input-campo:focus {
  outline: 1px solid #cc0000;
}

.campo-senha-wrap {
  position: relative;
  margin-bottom: 1rem;
}
.campo-senha-wrap .input-campo {
  margin-bottom: 0;
  padding-right: 2.4rem;
}
.btn-olho {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  color: #555;
  -webkit-tap-highlight-color: transparent;
}
.btn-olho:hover { color: #000; }
body.tema-escuro .btn-olho { color: #aaa; }
body.tema-escuro .btn-olho:hover { color: #fff; }

/* O Edge injeta o próprio ícone de "mostrar senha" dentro do campo — sem
   isso aqui, ele briga com o nosso botão pelo mesmo espaço/clique. */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}

.btn-enviar {
  width: 100%;
  padding: 0.6rem;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.1rem;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  cursor: pointer;
  margin-top: 0.5rem;
}

body.tema-escuro .btn-enviar {
  background: #fff;
  color: #000;
  border: 1px solid #fff;
}

/* ========== POPUP PESQUISA ========== */
.popup-pesquisa-conteudo {
  background: #f5f0e8;
  border: 2px solid #000;
  padding: 2rem;
  width: 90%;
  max-width: 500px;
}

body.tema-escuro .popup-pesquisa-conteudo {
  background: #1a1a1a;
  border: 2px solid #fff;
}

.popup-pesquisa-conteudo h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

.input-pesquisa {
  width: 100%;
  padding: 0.5rem;
  font-family: "Times New Roman", Times, serif;
  font-size: 1rem;
  border: 1px solid #000;
  margin-bottom: 1rem;
}

body.tema-escuro .input-pesquisa {
  background: #333;
  color: #fff;
  border: 1px solid #fff;
}

.btn-pesquisar-popup {
  width: 100%;
  padding: 0.5rem;
  font-family: "Times New Roman", Times, serif;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  cursor: pointer;
}

body.tema-escuro .btn-pesquisar-popup {
  background: #fff;
  color: #000;
  border: 1px solid #fff;
}

.resultado-pesquisa {
  margin-top: 1rem;
  border-top: 1px solid #000;
  padding-top: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

body.tema-escuro .resultado-pesquisa {
  border-top: 1px solid #fff;
}

.resultado-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid #ddd;
}

body.tema-escuro .resultado-item {
  border-bottom: 1px solid #444;
}

.btn-adicionar {
  padding: 0.3rem 0.8rem;
  font-family: "Times New Roman", Times, serif;
  background: #008000;
  color: #fff;
  border: 1px solid #008000;
  cursor: pointer;
}

/* ========== MENSAGENS ========== */
.msg-erro {
  color: #cc0000;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
}

.msg-sucesso {
  color: #008000;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
}

body.tema-escuro .msg-erro { color: #ff4444; }
body.tema-escuro .msg-sucesso { color: #44ff44; }

/* ========== TROCAR POPUP ========== */
.trocar-popup {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.trocar-popup a { color: #000; }
body.tema-escuro .trocar-popup a { color: #fff; }

/* ========== EM BREVE ========== */
.em-breve {
  text-align: center;
  font-size: 1.2rem;
  padding: 3rem;
  border: 1px dashed #000;
}

body.tema-escuro .em-breve { border: 1px dashed #fff; }

/* ========== MENU LATERAL ========== */
.menu-lateral {
  position: fixed;
  top: 0;
  right: 0;
  width: 250px;
  height: 100%;
  background: #f5f0e8;
  border-left: 2px solid #000;
  z-index: 300;
  padding: 2rem 1.5rem;
  transform: translateX(100%);
  transition: transform 0.3s;
}

.menu-lateral.aberto { transform: translateX(0); }

body.tema-escuro .menu-lateral {
  background: #1a1a1a;
  border-left: 2px solid #fff;
}

.menu-lateral .fechar-menu {
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  margin-bottom: 2rem;
  font-family: "Times New Roman", Times, serif;
}

body.tema-escuro .menu-lateral .fechar-menu { color: #fff; }

.menu-lateral a {
  display: block;
  padding: 0.5rem 0;
  color: #000;
  text-decoration: none;
  font-size: 1.1rem;
  border-bottom: 1px solid #ccc;
}

body.tema-escuro .menu-lateral a {
  color: #fff;
  border-bottom: 1px solid #444;
}

/* ========== CHAT SOCIAL ========== */
.msg-minha {
  background: #e0e0e0;
  padding: 0.6rem;
  border: 1px solid #000;
  word-break: break-word;
}

body.tema-escuro .msg-minha {
  background: #3a3a3a;
  border: 1px solid #fff;
}

.msg-outro {
  background: #fff;
  padding: 0.6rem;
  border: 1px solid #000;
  word-break: break-word;
}

body.tema-escuro .msg-outro {
  background: #2a2a2a;
  border: 1px solid #fff;
}

/* ========== SEM AMIGOS ========== */
.sem-amigos {
  text-align: center;
  color: #888;
  padding: 2rem;
}

/* ========== FLAPPY BIRD E RANKINGS ========== */
.link-voltar {
  display: inline-block;
  margin-bottom: 1rem;
  color: #000;
  text-decoration: none;
  font-size: 0.95rem;
}

.link-voltar:hover { text-decoration: underline; }
body.tema-escuro .link-voltar { color: #fff; }

.flappy-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.flappy-tela {
  position: relative;
  width: 360px;
  max-width: 100%;
  border: 2px solid #000;
  background: #f5f0e8;
  line-height: 0;
}

body.tema-escuro .flappy-tela {
  border: 2px solid #fff;
  background: #1a1a1a;
}

.flappy-tela canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  cursor: pointer;
}

.flappy-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.flappy-overlay-caixa { text-align: center; padding: 1.5rem; }
.flappy-instrucao { color: #fff; font-size: 1rem; margin-bottom: 1.2rem; line-height: 1.5; }
.flappy-fim-titulo { color: #fff; font-size: 1.4rem; margin-bottom: 1rem; }
.flappy-fim-pontos { color: #fff; font-size: 1.1rem; margin-top: 1rem; }
.flappy-fim-erro { color: #ff6666; font-size: 0.85rem; margin-bottom: 1rem; max-width: 260px; }

.flappy-placar {
  position: absolute;
  top: 0.8rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 2rem;
  font-weight: bold;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  pointer-events: none;
}

.flappy-podio { width: 360px; max-width: 100%; }
.flappy-podio-titulo { font-size: 1.2rem; margin-bottom: 0.8rem; text-align: center; }
.flappy-ranking-lista { width: 100%; border-collapse: collapse; }

.flappy-ranking-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid #ddd;
  overflow: hidden;
}

body.tema-escuro .flappy-ranking-item { border-bottom: 1px solid #444; }
.flappy-ranking-pos { flex-shrink: 0; width: 2.2rem; text-align: center; font-size: 0.9rem; font-weight: bold; }
.flappy-ranking-pos.ouro { background: #f5c518; color: #000; padding: 0.15rem 0.3rem; border: 1px solid #c9a800; }
.flappy-ranking-pos.prata { background: #b8b8b8; color: #000; padding: 0.15rem 0.3rem; border: 1px solid #909090; }
.flappy-ranking-pos.bronze { background: #cd7f32; color: #fff; padding: 0.15rem 0.3rem; border: 1px solid #a0632a; }
.flappy-ranking-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; cursor: pointer; }
.flappy-ranking-nome:hover { text-decoration: underline; }
.flappy-ranking-pontos { flex-shrink: 0; font-weight: bold; font-size: 0.9rem; text-align: right; }
.flappy-minha-posicao { text-align: center; margin-top: 1rem; font-size: 0.9rem; color: #888; padding: 0.4rem; border-top: 1px solid #ddd; }
body.tema-escuro .flappy-minha-posicao { border-top: 1px solid #444; }

/* ========== COMUNIDADE, FEEDBACK E DENÚNCIA ========== */
.selo-beta {
  position: fixed;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 80;
  padding: 0.3rem 0.55rem;
  background: #fff3cd;
  color: #5f4700;
  border: 1px solid #c9a800;
  font-size: 0.72rem;
}

.btn-feedback-flutuante {
  position: fixed;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 80;
  padding: 0.55rem 0.8rem;
  border: 1px solid #000;
  background: #000;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
}

body.tema-escuro .btn-feedback-flutuante { background: #fff; color: #000; border-color: #fff; }
.comunidade-modal { max-width: 520px; max-height: 86vh; overflow-y: auto; }
.comunidade-modal .form-input,
.comunidade-modal .form-textarea { display: block; width: 100%; margin: 0.7rem 0; padding: 0.6rem; font-family: inherit; }
.comunidade-ajuda { color: #666; line-height: 1.35; margin-bottom: 0.8rem; }
body.tema-escuro .comunidade-ajuda { color: #bbb; }
.comunidade-estado { color: #b00020; margin: 0.5rem 0; }
.comunidade-estado.sucesso { color: #087f23; }
.btn-denunciar-conteudo {
  border: 0;
  background: none;
  color: #a40000;
  text-decoration: underline;
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.2rem;
}
body.tema-escuro .btn-denunciar-conteudo { color: #ff8a8a; }
.btn-feedback-jogo {
  display: block;
  margin: -0.75rem auto 1.1rem;
  padding: 0.42rem 0.7rem;
  border: 1px solid #a40000;
  background: transparent;
  color: #a40000;
  font-family: inherit;
  cursor: pointer;
}
body.tema-escuro .btn-feedback-jogo { color: #ff8a8a; border-color: #ff8a8a; }

/* ========== SOCIAL RESPONSIVO ========== */
.social-conteudo {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.social-mensagens {
  flex: 1;
  min-height: 0;
  max-height: 450px;
  overflow-y: auto;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overscroll-behavior: contain;
}

.social-composer {
  flex: 0 0 auto;
  border-top: 2px solid #000;
  padding-top: 0.5rem;
  background: #f5f0e8;
}

body.tema-escuro .social-composer { background: #1a1a1a; border-color: #fff; }
.social-avatar { width: 30px !important; height: 30px !important; min-width: 30px; flex: 0 0 30px; aspect-ratio: 1; }
.social-avatar img { width: 100%; height: 100%; object-fit: cover; }
.social-mensagem-coluna { min-width: 0; }
.social-mensagem-cabecalho { min-width: 0; flex-wrap: wrap; }

/* ========== CATÁLOGO E JOGOS ONLINE ========== */
.jogos-grade {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1rem;
}

.jogo-card {
  min-height: 165px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.2rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.jogo-card:hover { transform: translateY(-2px); box-shadow: 3px 3px 0 #cc0000; }
.jogo-card-icone { font-size: 2.6rem; margin-bottom: 0.45rem; }
.jogo-card p { color: #777; font-size: 0.82rem; margin-top: 0.35rem; }
body.tema-escuro .jogo-card p { color: #bbb; }
.jogos-subtitulo { margin: 2rem 0 0.4rem; text-align: center; }
.jogos-explicacao { text-align: center; color: #777; margin-bottom: 1rem; }
body.tema-escuro .jogos-explicacao { color: #bbb; }

.aviso-teste-online {
  max-width: 760px;
  margin: 1.4rem auto 0.9rem;
  padding: 0.8rem 1rem;
  border: 1px solid #d39b00;
  border-left: 5px solid #d39b00;
  background: #fff4c7;
  color: #5d4600;
  line-height: 1.4;
}
body.tema-escuro .aviso-teste-online { background: #3d330f; color: #ffe69a; border-color: #d39b00; }

.online-tempo {
  width: fit-content;
  margin: 0 auto 0.65rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid #777;
  font-variant-numeric: tabular-nums;
  font-weight: bold;
}
.online-tempo.urgente { color: #a40000; border-color: #a40000; }
body.tema-escuro .online-tempo.urgente { color: #ff8c8c; border-color: #ff8c8c; }

.online-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(230px, 320px);
  gap: 1.2rem;
  align-items: start;
}
.online-layout.sem-chat { grid-template-columns: minmax(280px, 650px); justify-content: center; }

.online-painel {
  border: 1px solid #000;
  background: #fff;
  padding: 1rem;
}
body.tema-escuro .online-painel { border-color: #fff; background: #252525; }
.online-status { text-align: center; min-height: 1.5rem; margin-bottom: 0.8rem; }
.online-acoes { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin: 1rem 0; }
.online-btn {
  padding: 0.55rem 0.9rem;
  border: 1px solid #000;
  background: #000;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
}
.online-btn.secundario { background: transparent; color: #000; }
.online-btn.perigo { background: #a40000; border-color: #a40000; }
body.tema-escuro .online-btn { background: #fff; color: #000; border-color: #fff; }
body.tema-escuro .online-btn.secundario { background: transparent; color: #fff; }
body.tema-escuro .online-btn.perigo { background: #cc3030; color: #fff; border-color: #cc3030; }
.online-btn:disabled { opacity: 0.55; cursor: default; }

.game-board { width: min(100%, 560px); margin: 0 auto; display: grid; user-select: none; touch-action: manipulation; }
.ttt-board { grid-template-columns: repeat(3, 1fr); border: 2px solid #000; }
.ttt-cell { aspect-ratio: 1; border: 1px solid #000; background: #fff; font-size: clamp(2.2rem, 13vw, 5rem); font-family: inherit; cursor: pointer; }
body.tema-escuro .ttt-board, body.tema-escuro .ttt-cell { border-color: #fff; }
body.tema-escuro .ttt-cell { background: #222; color: #fff; }

.board-8x8 { grid-template-columns: repeat(8, 1fr); border: 2px solid #000; }
.board-square { position: relative; aspect-ratio: 1; border: 0; display: flex; align-items: center; justify-content: center; font-family: inherit; cursor: pointer; padding: 0; }
.board-square.light { background: #ead9b5; }
.board-square.dark { background: #7f4f35; }
.board-square.selected { box-shadow: inset 0 0 0 4px #ffd400; }
.board-square.last-move { box-shadow: inset 0 0 0 3px rgba(204, 0, 0, 0.65); }
.board-piece.chess { font-size: clamp(1.55rem, 7vw, 3.4rem); line-height: 1; text-shadow: 0 1px 1px rgba(255,255,255,0.65); }
.board-piece.checker { width: 72%; height: 72%; border-radius: 50%; box-shadow: inset 0 -4px 0 rgba(0,0,0,0.28), 0 2px 2px rgba(0,0,0,0.4); }
.board-piece.checker.red { background: #d72638; border: 2px solid #7f0712; }
.board-piece.checker.black { background: #191919; border: 2px solid #777; }
.board-piece.checker.king::after { content: '★'; color: #ffd400; font-size: clamp(0.75rem, 3vw, 1.4rem); }

.online-jogadores { display: flex; justify-content: space-between; gap: 0.7rem; margin-bottom: 0.8rem; }
.online-jogador { flex: 1; padding: 0.55rem; border: 1px solid #bbb; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-jogador.turno { border-color: #cc0000; box-shadow: inset 0 0 0 1px #cc0000; }
.online-chat-lista { height: 310px; overflow-y: auto; border: 1px solid #bbb; padding: 0.6rem; display: flex; flex-direction: column; gap: 0.4rem; }
.online-chat-msg { padding: 0.4rem 0.5rem; background: #f2eee8; overflow-wrap: anywhere; }
.online-chat-msg.minha { background: #e0e0e0; align-self: flex-end; }
body.tema-escuro .online-chat-msg { background: #333; }
body.tema-escuro .online-chat-msg.minha { background: #444; }
.online-chat-form { display: flex; gap: 0.45rem; margin-top: 0.55rem; }
.online-chat-form input { flex: 1; min-width: 0; padding: 0.55rem; font-family: inherit; }
.online-lista-item { border-bottom: 1px solid #ccc; padding: 0.7rem 0; display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
body.tema-escuro .online-lista-item { border-color: #555; }

/* ========== UTILITÁRIOS ========== */
.hidden { display: none !important; }
small { font-size: 0.8rem; display: block; margin-bottom: 0.5rem; color: #555; }
body.tema-escuro small { color: #aaa; }

/* Em celulares a navegação fica sempre em duas linhas de três botões. */
@media (max-width: 767px) {
  .nav-botoes {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem !important;
    width: 100%;
    padding: 0.6rem !important;
  }
  .nav-btn {
    width: 100%;
    min-width: 0;
    min-height: 28px;
    padding: 0.25rem 0.2rem !important;
    font-size: 0.85rem !important;
    line-height: 1.1;
  }
}

@media (max-width: 700px) {
  .app-header { padding: 0.7rem 1rem; }
  .header-direita { gap: 0.75rem; }
  .conteudo { padding: 1rem; }
  .online-layout { grid-template-columns: 1fr; }

  body.social-page {
    height: var(--social-viewport-height, 100dvh);
    min-height: 0;
    overflow: hidden;
  }
  .social-page .social-conteudo { padding-top: 0.35rem; padding-bottom: max(0.35rem, env(safe-area-inset-bottom)); }
  .social-page .social-mensagens { max-height: none; padding: 0.45rem 0; }
  .social-page .social-mensagem-coluna { max-width: 86% !important; }
  .social-page .rodape,
  .social-page .social-rodape-extra { flex: 0 0 auto; }
  .social-page.teclado-aberto .rodape,
  .social-page.teclado-aberto .social-rodape-extra,
  .social-page.teclado-aberto .btn-feedback-flutuante,
  .social-page.teclado-aberto .selo-beta { display: none !important; }
  .social-page.teclado-aberto .nav-botoes,
  .social-page.teclado-aberto > .linha-divisoria:nth-of-type(1),
  .social-page.teclado-aberto > .linha-divisoria:nth-of-type(2) { display: none; }
  .social-page.teclado-aberto .app-header { padding-top: 0.35rem; padding-bottom: 0.35rem; }
  .social-page .social-composer { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
  .social-page .social-composer .input-pesquisa { font-size: 16px; }
}
