body {
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  background: #f5f5f5;
}

.calculator {
  background: #222;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  text-align: center;
  width: 260px;
  max-width: 90vw; /* shrink on small screens */
}

.calculator h2 {
  color: #fff;
  margin-bottom: 15px;
}

#display {
  width: 100%;
  height: 50px;
  margin-bottom: 15px;
  padding: 10px;
  font-size: 20px;
  text-align: right;
  border: none;
  border-radius: 8px;
  background: #333;
  color: #fff;
  box-sizing: border-box;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

button {
  padding: 15px;
  font-size: 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #444;
  color: #fff;
  transition: 0.2s;
}

button:hover {
  background: #555;
}

.operator {
  background: #ff9500;
}

.operator:hover {
  background: #e08900;
}

.equals {
  background: #28a745;
}

.equals:hover {
  background: #218838;
}

.clear {
  background: #dc3545;
  grid-column: span 2;
}

.clear:hover {
  background: #b02a37;
}

.delete {
  background: #6c757d;
  grid-column: span 2;
}

.delete:hover {
  background: #5a6268;
}

/* 📱 Mobile responsiveness */
@media (max-width: 480px) {
  .calculator {
    width: 100%;
    padding: 15px;
  }

  #display {
    font-size: 18px;
    height: 45px;
  }

  button {
    padding: 12px;
    font-size: 16px;
  }
}
