/* === Variáveis CSS === */
:root {
  --cor-fundo: #464647;
  --cor-fundo-secundaria: #494749;
  --cor-botao: #ffd700;
  --cor-botao-hover: #ffc107;
  --cor-botao-reiniciar: #4a90e2;
  --cor-botao-reiniciar-hover: #357abd;
  --cor-texto: #ffffff;
  --cor-texto-secundario: #e0e0e0;
  --fonte-principal: Arial, sans-serif;
  --espacamento-padrao: 20px;
  --border-radius: 8px;
}

/* === Reset básico === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Configuração do body === */
body {
  font-family: var(--fonte-principal);
  background: linear-gradient(135deg, var(--cor-fundo), var(--cor-fundo-secundaria));
  color: var(--cor-texto);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: var(--espacamento-padrao);
}

/* === Container principal === */
main {
  background: rgba(0, 0, 0, 0.3);
  padding: 40px;
  border-radius: var(--border-radius);
  text-align: center;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* === Títulos === */
h1 {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--cor-botao);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* === Parágrafos === */
p {
  margin-bottom: var(--espacamento-padrao);
  color: var(--cor-texto-secundario);
  font-size: 1rem;
  line-height: 1.5;
}

/* === Campo de entrada === */
input[type="number"] {
  width: 100%;
  max-width: 200px;
  padding: 12px;
  font-size: 1.2rem;
  text-align: center;
  border: 2px solid var(--cor-botao);
  border-radius: var(--border-radius);
  margin-bottom: var(--espacamento-padrao);
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--cor-botao-hover);
  box-shadow: 0 0 10px var(--cor-botao);
  transform: scale(1.05);
}

/* === Container dos botões === */
.botoes {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--espacamento-padrao);
}

/* === Estilo base dos botões === */
button {
  padding: 12px 25px;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* === Botão Tentar === */
#btnTentar {
  background-color: var(--cor-botao);
  color: #333;
}

#btnTentar:hover:not(:disabled) {
  background-color: var(--cor-botao-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#btnTentar:disabled {
  background-color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

/* === Botão Reiniciar === */
#btnReiniciar {
  background-color: var(--cor-botao-reiniciar);
  color: var(--cor-texto);
}

#btnReiniciar:hover {
  background-color: var(--cor-botao-reiniciar-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* === Mensagem de resultado === */
#mensagem {
  font-size: 1.2rem;
  font-weight: bold;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.1);
  line-height: 1.6;
}

/* === Media Queries - Responsividade === */
@media (max-width: 600px) {
  main {
    padding: 25px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  p {
    font-size: 0.9rem;
  }
  
  input[type="number"] {
    max-width: 150px;
    font-size: 1rem;
  }
  
  button {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  #mensagem {
    font-size: 1rem;
    min-height: 50px;
  }
}

@media (max-width: 400px) {
  main {
    padding: 20px;
  }
  
  h1 {
    font-size: 1.3rem;
  }
  
  .botoes {
    flex-direction: column;
    width: 100%;
  }
  
  button {
    width: 100%;
  }
}
