body {
  font-family: Arial, sans-serif;
  text-align: center;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100vh;
  background-color: #f0f0f0;
  touch-action: manipulation;
  -webkit-user-select: none; /* Prevents accidental selection and zoom */
  overscroll-behavior: none; /* Prevents pull-to-refresh */
  -webkit-overscroll-behavior: none; /* Safari specific */
}

.container {
  max-width: 600px;
  margin: auto;
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.level-selector {
  margin-top: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.level-selector label {
  font-size: 1em;
  margin: 0;
}

.level-selector input {
  font-size: 1em;
  padding: 5px;
  width: 40px;
  text-align: center;
  border: 2px solid #eee;
  margin: 0;
}

.level-selector .gray {
  font-size: 1em;
  margin: 0;
  padding: 5px 10px;
  height: auto;
}

#problem {
  font-size: 3em;
  margin-top: 20px;
}

.answer-display {
  font-size: 1.5em;
  padding: 10px;
  margin-top: 20px;
  margin-bottom: 10px;
  border: 2px solid #ccc;
  border-radius: 5px;
  width: 80%;
  margin-left: auto;
  margin-right: auto;
  background-color: #fafafa;
  min-height: 1.2em;
}

.error-display {
  border-color: red !important;
}

.help-button {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 1em;
  margin-left: 10px;
  cursor: pointer;
  display: none;
}

.help-button:hover {
  background-color: #218838;
}

.answer-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  margin-bottom: 10px;
}

button.gray {
  margin-top: 10px;
  font-size: 1em;
  border: none;
  background-color: lightgray;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

button {
  margin-top: 10px;
  font-size: 1em;
  border: none;
  background-color: #007bff;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

button:disabled {
  background-color: lightgray;
  cursor: not-allowed;
}

.keypad {
  display: inline-block;
  margin-top: 20px;
}

.keypad .row {
  display: flex;
  justify-content: center;
  margin: 5px 0;
}

.keypad button {
  width: 60px;
  height: 60px;
  font-size: 2em;
  margin: 0 5px;
  padding: 0;
  border-radius: 8px;
}

.keypad button.mainaction,
.keypad button.dangerous {
  font-size: 1em;
}

.mainaction {
  background-color: #28a745;
}

.dangerous {
  background-color: #dc3545;
}

#log {
  display: none;
  text-align: left;
  max-height: 200px;
  height: 300px;
  overflow-y: auto;
  margin-top: 20px;
  background-color: #e8e8e8;
  padding: 10px;
  border-radius: 5px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

#successEmoji {
  font-size: 2em;
  margin-bottom: 10px;
  opacity: 0;
}
