body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f4f4;
  color: #222;
}

.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  text-align: center;
}

h1 {
  margin: 0 0 10px;
}

.instructions {
  margin: 0 0 22px;
  font-size: 18px;
}

.top-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.top-controls select,
.top-controls button {
  font-size: 16px;
  padding: 10px 12px;
}

.numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 24px;
}

.number-tile {
  width: 72px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 2px solid #222;
  border-radius: 10px;
  font-size: 30px;
  font-weight: bold;
  box-sizing: border-box;
}

.expression-wrap {
  max-width: 700px;
  margin: 0 auto 18px;
  text-align: left;
}

.expression-wrap label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

#expression {
  width: 100%;
  font-size: 22px;
  padding: 12px;
  box-sizing: border-box;
  border: 2px solid #222;
  border-radius: 8px;
}

.button-pad {
  max-width: 720px;
  margin: 0 auto 20px;
  text-align: left;
}

.hidden {
  display: none;
}

.pad-section {
  margin-bottom: 18px;
}

.pad-title {
  font-weight: bold;
  margin-bottom: 10px;
}

.pad-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.pad-btn {
  width: 72px;
  height: 72px;
  font-size: 28px;
  font-weight: bold;
  border: 2px solid #222;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.pad-btn:hover {
  background: #eaeaea;
}

.action-btn {
  font-size: 24px;
}

.action-row {
  margin-top: 6px;
}

.action-row button {
  font-size: 16px;
  padding: 12px 20px;
  margin: 6px;
}

.result {
  min-height: 28px;
  font-size: 20px;
  margin: 16px 0;
  font-weight: bold;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 18px;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .number-tile,
  .pad-btn {
    width: 62px;
    height: 62px;
    font-size: 24px;
  }

  #expression {
    font-size: 18px;
  }
}
