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

body {
  font-family: 'Segoe UI', sans-serif;
  background: #f5f4f0;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

h1 {
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}

.tela {
  width: 100%;
  max-width: 380px;
}

.escondido {
  display: none !important;
}

/* ── Cadastro ── */

.card {
  background: #fff;
  border: 1px solid #e0ddd6;
  border-radius: 12px;
  padding: 24px;
}

.campo {
  margin-bottom: 16px;
}

.campo label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}

.campo input {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: none;
  background: #fafafa;
  transition: border-color 0.15s;
}

.campo input:focus {
  border-color: #888;
  background: #fff;
}

.campo input.erro {
  border-color: #e24b4a;
}

/* ── Botões ── */

button {
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

button:hover {
  background: #f0eeea;
  border-color: #aaa;
}

button:active {
  transform: scale(0.98);
}

#btn-comecar {
  width: 100%;
  margin-top: 8px;
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

#btn-comecar:hover {
  background: #333;
  border-color: #333;
}

.botoes-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

/* ── Jogo ── */

.jogadores-row {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 16px;
}

.jogador-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #555;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.jogador-tag.ativo {
  border-color: #1a1a1a;
  background: #fff;
  color: #1a1a1a;
  font-weight: 500;
}

.bolinha {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.bolinha-x { background: #D85A30; }
.bolinha-o { background: #185FA5; }

.status {
  text-align: center;
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
  min-height: 20px;
}

.status strong {
  color: #1a1a1a;
  font-weight: 600;
}

/* ── Tabuleiro ── */

.tabuleiro {
  display: grid;
  grid-template-columns: repeat(3, 88px);
  gap: 0;
  margin: 0 auto;
  width: 264px;
}

.espaco {
  width: 88px;
  height: 88px;
  border: 2px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s;
}

.espaco:hover:not(.ocupado) {
  background: #f0eeea;
}

.espaco.ocupado {
  cursor: default;
}

.espaco.vencedor {
  background: #eaf3de;
}

.espaco:nth-child(1),
.espaco:nth-child(2),
.espaco:nth-child(3) { border-top: none; }

.espaco:nth-child(7),
.espaco:nth-child(8),
.espaco:nth-child(9) { border-bottom: none; }

.espaco:nth-child(1),
.espaco:nth-child(4),
.espaco:nth-child(7) { border-left: none; }

.espaco:nth-child(3),
.espaco:nth-child(6),
.espaco:nth-child(9) { border-right: none; }

.espaco svg {
  width: 52px;
  height: 52px;
}

/* ── Placar ── */

.placar-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  margin-bottom: 24px;
  align-items: center;
}

.placar-card {
  background: #fff;
  border: 1px solid #e0ddd6;
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
}

.placar-empates {
  background: #f5f4f0;
  border-color: #ddd;
}

.placar-nome {
  font-size: 12px;
  color: #888;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.placar-numero {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1;
}

.placar-label {
  font-size: 11px;
  color: #aaa;
  margin-top: 3px;
}

.historico-titulo {
  font-size: 13px;
  font-weight: 600;
  color: #666;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.historico {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e0ddd6;
  border-radius: 10px;
  background: #fff;
}

.historico li {
  padding: 10px 14px;
  font-size: 13px;
  color: #444;
  border-bottom: 1px solid #f0eeea;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.historico li:last-child {
  border-bottom: none;
}

.historico .resultado-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background: #eaf3de;
  color: #3B6D11;
}

.historico .resultado-badge.empate {
  background: #f1efe8;
  color: #5F5E5A;
}

.historico-vazio {
  padding: 16px;
  text-align: center;
  color: #aaa;
  font-size: 13px;
}
