:root {
  --bg: #0f172a;
  --card: #1e293b;
  --texto: #e2e8f0;
  --destaque: #38bdf8;
  --ok: #4ade80;
  --erro: #f87171;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--texto);
  min-height: 100vh;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  text-align: center;
}

h1 { margin: 0 0 16px; }

.modos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--destaque);
  color: #082f49;
  font-weight: 600;
}
button:hover:not(:disabled) { filter: brightness(1.1); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.secundario { background: transparent; color: var(--texto); border: 1px solid #475569; }

.modo { background: var(--card); color: var(--texto); }
.modo.ativo { background: var(--destaque); color: #082f49; }

.painel {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  margin-top: 12px;
}

.oculto { display: none !important; }

input {
  font: inherit;
  width: 100%;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #475569;
  background: var(--bg);
  color: var(--texto);
  text-align: center;
  margin-bottom: 12px;
}

.linha { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

#forca { width: 200px; max-width: 60%; }
#forca line, #forca circle {
  stroke: var(--texto);
  stroke-width: 4;
  stroke-linecap: round;
  fill: none;
}
.parte { display: none; stroke: var(--erro) !important; }
.parte.visivel { display: inline; }

.palavra {
  font-size: 2rem;
  letter-spacing: .4rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  margin: 12px 0;
  word-break: break-all;
}

.erradas { color: var(--erro); min-height: 1.4em; margin: 4px 0; }
.status { font-weight: 700; min-height: 1.4em; }
.status.vitoria { color: var(--ok); }
.status.derrota { color: var(--erro); }
.log-ia { color: var(--destaque); min-height: 1.4em; font-size: .9rem; }
.placar { margin: 4px 0; font-weight: 600; }
.erro { color: var(--erro); min-height: 1.2em; }

.teclado {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  gap: 6px;
  margin-top: 12px;
}
.tecla { padding: 10px 0; background: #334155; color: var(--texto); }
.tecla.certa { background: var(--ok); color: #052e16; }
.tecla.errada { background: var(--erro); color: #450a0a; }
