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

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f1c2c, #928dab);
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.calculator {
  width: 340px;
  background: #1e1e2f;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.display {
  background: #14141f;
  border-radius: 16px;
  padding: 20px 16px;
  margin-bottom: 20px;
  text-align: right;
  overflow: hidden;
}

.expression {
  color: #8b8b9e;
  font-size: 1rem;
  min-height: 20px;
  overflow-x: auto;
  white-space: nowrap;
}

.result {
  color: #ffffff;
  font-size: 2.5rem;
  font-weight: 600;
  overflow-x: auto;
  white-space: nowrap;
  margin-top: 4px;
}

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

.btn {
  border: none;
  outline: none;
  padding: 18px 0;
  font-size: 1.2rem;
  font-weight: 500;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
  color: #ffffff;
  background: #2c2c3e;
}

.btn:active {
  transform: scale(0.94);
}

.btn:hover {
  filter: brightness(1.15);
}

.btn.function {
  background: #3a3a52;
  color: #ffd166;
}

.btn.operator {
  background: #ff8c42;
  color: #ffffff;
}

.btn.equals {
  background: linear-gradient(135deg, #06d6a0, #05a97e);
  grid-column: span 2;
}

.btn.zero {
  grid-column: span 2;
}

.btn.number {
  background: #2c2c3e;
}
