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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.calculator {
  background: #1e1e2e;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  width: 360px;
}

.display {
  background: #0d0d14;
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  text-align: right;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.previous-operand {
  font-size: 18px;
  color: #6b7280;
  min-height: 24px;
  margin-bottom: 4px;
}

.current-operand {
  font-size: 42px;
  font-weight: 300;
  color: #f8fafc;
  word-break: break-all;
}

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

.btn {
  border: none;
  font-size: 22px;
  font-weight: 500;
  padding: 18px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #2a2a3e;
  color: #f8fafc;
}

.btn:hover {
  background: #3a3a52;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  background: #4a4a62;
}

.btn.operator {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: white;
  font-weight: 600;
}

.btn.operator:hover {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
}

.btn.equals {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  font-weight: 600;
}

.btn.equals:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.btn.clear {
  background: #ef4444;
  color: white;
  font-weight: 600;
}

.btn.clear:hover {
  background: #f87171;
}

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

.btn[data-action="backspace"] {
  background: #374151;
  font-size: 18px;
}

.btn[data-action="backspace"]:hover {
  background: #4b5563;
}