* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: #1b1b1b;
  color: #eee;
  min-height: 100vh;
}
#app { max-width: 480px; margin: 0 auto; padding: 16px; padding-bottom: 48px; }
h1 { font-size: 20px; margin: 8px 0 16px; }
h2 { font-size: 16px; margin: 16px 0 8px; color: #bbb; }
button {
  background: #3a7d44; color: #fff; border: none; border-radius: 8px;
  padding: 10px 16px; font-size: 15px; cursor: pointer;
}
button.secundario { background: #444; }
button.perigo { background: #7d3a3a; }
button:disabled { opacity: 0.5; }
input, select {
  width: 100%; padding: 10px; font-size: 15px; margin-bottom: 10px;
  border-radius: 8px; border: 1px solid #555; background: #262626; color: #eee;
}
.cartao {
  background: #262626; border-radius: 10px; padding: 14px; margin-bottom: 10px;
}
.jogo-btn {
  display: block; width: 100%; text-align: left; font-family: inherit;
  background: #262626; border: none; border-left: 6px solid #777; border-radius: 10px;
  padding: 14px; margin-bottom: 10px; cursor: pointer; color: #eee;
}
.jogo-btn:active { background: #2f2f2f; }
.bolinha {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px;
}
.linha { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #444; }
.pill.vez { background: #3a7d44; }
.pill.atrasado { background: #7d3a3a; }
.erro { color: #ff8080; font-size: 13px; min-height: 18px; }
a, .link { color: #8ac4ff; cursor: pointer; text-decoration: underline; }

.tabuleiro-bloco { max-width: 440px; margin: 12px auto; }
.tabuleiro-linha-principal { display: flex; }
.rotulos-linha, .rotulos-linha-spacer { width: 18px; flex-shrink: 0; }
.rotulos-linha { display: flex; flex-direction: column; }
.rotulos-linha > div {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #888;
}
.rotulos-coluna-wrap { display: flex; }
.rotulos-coluna { display: flex; flex: 1; }
.rotulos-coluna > div {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #888; padding-top: 2px;
}
#tabuleiro {
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  flex: 1; min-width: 0;
  aspect-ratio: 1; border: 2px solid #444; user-select: none;
}
.casa {
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(20px, 7vw, 32px); line-height: 1; position: relative; cursor: pointer;
  aspect-ratio: 1; min-width: 0; min-height: 0; overflow: hidden;
}
.casa.clara { background: #eeeed2; }
.casa.escura { background: #769656; }
.casa.selecionada { outline: 3px solid #ffdd55; outline-offset: -3px; }
.casa.destino::after {
  content: ''; position: absolute; width: 22%; height: 22%; border-radius: 50%;
  background: rgba(0,0,0,0.35);
}
.peca-branca { color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.peca-preta { color: #111; text-shadow: 0 0 2px #fff; }
#historico { max-height: 180px; overflow-y: auto; font-size: 13px; background: #202020; border-radius: 8px; padding: 8px; }
#historico div { padding: 2px 0; border-bottom: 1px solid #2d2d2d; }
#chat { max-height: 200px; overflow-y: auto; font-size: 13px; background: #202020; border-radius: 8px; padding: 8px; }
#chat div { padding: 4px 0; border-bottom: 1px solid #2d2d2d; word-break: break-word; }
#chatInput { flex: 1; }
.topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
