body {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  min-height: 100vh;
}

#game-container {
  max-width: 960px;
  text-align: center;
  margin-top: 2rem;
}

.restart-container {
  margin-bottom: 1rem;
}

.task-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.num-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  line-height: 1.5;
  padding-top: 0.1rem;
  text-align: center;
  border: 2px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  caret-color: transparent;
}

.num-slot.active {
  border-color: #88b;
  background-color: #eef;
}

.num-slot.ok {
  border-color: green;
  background-color: #e0ffe0;
}

.num-slot.fail {
  border-color: red;
  background-color: #ffe0e0;
}

.num-grid {
  display: grid;
  grid-template-columns: repeat(3, 3rem);
  gap: 0.5rem;
  justify-content: center;
}

.num-key {
  width: 3rem;
  height: 3rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  border: 1px solid #999;
  border-radius: 6px;
  background: #f9f9f9;
  cursor: pointer;
}

.num-key:hover {
  background-color: #eef;
}

.operator,
.equals {
  font-size: 1.5rem;
}

.result-block {
  font-size: 2rem;
  padding: 0.5rem 1rem;
  border: 2px solid #ccc;
  border-radius: 8px;
  min-width: 3rem;
}

button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
}

button:hover {
  background-color: #eef;
}

#feedback {
  margin-top: 1rem;
  font-size: 1.2rem;
  font-weight: bold;
  color: #444;
  min-height: 1.5em;
  transition: color 0.3s ease, transform 0.15s ease;
}

.feedback-ok {
  color: green;
  transform: scale(1.03);
}

.feedback-fail {
  color: red;
  transform: scale(1.03);
}

#level-info {
  display: none;
}

canvas {
  max-width: 960px;
  margin: 1rem auto;
  display: block;
}

table {
  width: 80%;
  margin: 0 auto;
  border-collapse: collapse;
}

th,
td {
  padding: 0.8rem;
  text-align: left;
  border: 1px solid #ccc;
}

th {
  background-color: #f1f1f1;
}

#restart-btn {
  margin-top: 1rem;
}

#check-btn {
  grid-column: 3;
  grid-row: 5;
  height: 3rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1rem;
  padding: 0;
  margin: 0;
}

