* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #1c1c1e;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.calculator {
  background: #1c1c1e;
  border-radius: 20px;
  overflow: hidden;
  width: 320px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
}

.display {
  background: #1c1c1e;
  padding: 20px 24px 12px;
  text-align: right;
}

#expression {
  color: rgba(255,255,255,0.4);
  font-size: 1rem;
  min-height: 22px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#result {
  color: #fff;
  font-size: 3rem;
  font-weight: 300;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: #3a3a3c;
}

.btn {
  background: #333335;
  color: #fff;
  font-size: 1.25rem;
  padding: 22px 0;
  border: none;
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
}

.btn:hover {
  background: #4a4a4c;
}

.btn:active {
  background: #5a5a5c;
}

.btn.wide {
  grid-column: span 2;
  text-align: left;
  padding-left: 28px;
}

.btn.operator {
  background: #ff9f0a;
  color: #fff;
}

.btn.operator:hover {
  background: #ffb340;
}

.btn.operator:active {
  background: #ffc060;
}

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

.btn.equals {
  background: #ff9f0a;
  color: #fff;
}

.btn.equals:hover {
  background: #ffb340;
}

/* top row special buttons */
.buttons .btn:nth-child(1),
.buttons .btn:nth-child(2),
.buttons .btn:nth-child(3) {
  background: #505053;
  color: #fff;
}

.buttons .btn:nth-child(1):hover,
.buttons .btn:nth-child(2):hover,
.buttons .btn:nth-child(3):hover {
  background: #636366;
}
