body {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f0f0f0;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  color: #fff;
  box-sizing: border-box;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  overflow: hidden;
}

.calculator {
  width: 100%;
  max-width: 375px;
  background-color: #1c1c1c;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 812px; /* iPhone X/XS/11 Pro height */
}

.display {
  flex-grow: 1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 20px;
  font-size: 5rem;
  color: #fff;
  text-align: right;
  overflow: hidden;
  white-space: nowrap;
  direction: ltr;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 10px;
}

.btn {
  background-color: #333333;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 2.2rem;
  height: 80px;
  width: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.btn:active {
  filter: brightness(1.2);
}

.btn.zero {
  grid-column: span 2;
  border-radius: 40px;
  justify-content: flex-start;
  padding-left: 30px;
  width: auto;
}

.btn.operator {
  background-color: #ff9500;
}

.btn.operator:active {
  background-color: #fff;
  color: #ff9500;
}

.btn.ac, .btn.plus-minus, .btn.percent {
  background-color: #a6a6a6;
  color: #1c1c1c;
}

.btn.ac:active, .btn.plus-minus:active, .btn.percent:active {
  background-color: #fff;
  color: #a6a6a6;
}

.btn.equals {
  background-color: #ff9500;
}
.btn.equals:active {
  background-color: #fff;
  color: #ff9500;
}

.display {
  font-size: min(15vw, 5rem);
}

.display.long-number {
  font-size: min(10vw, 3.5rem);
}
.display.very-long-number {
  font-size: min(7vw, 2.5rem);
}