body {
  background: linear-gradient(135deg, #dfe9f3, #ffffff);
  font-family: 'Segoe UI', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.header {
  text-align: center;
  margin-bottom: 15px;
}

/* Title row (icon + text) */
.title-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

/* Icon */
.icon {
  font-size: 24px;
  animation: bounce 2s infinite;
}

/* Title */
.title {
  font-size: 24px;
  font-weight: bold;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  animation: fadeSlide 1s ease;
}

/* Subtitle */
.subtitle {
  font-size: 14px;
  color: #777;
  margin-top: 3px;
  letter-spacing: 1px;

  animation: fadeSlide 1.5s ease;
}

/* Animations */
@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Calculator box */
.calculator {
  background: #ffffff;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 15px 30px rgba(0,0,0,0.15);
  width: 300px;
}

/* Display */
#display {
  width: 100%;
  height: 70px;
  font-size: 28px;
  margin-bottom: 20px;
  text-align: right;
  padding: 15px 20px;
  border-radius: 15px;
  border: none;

  background: linear-gradient(135deg, #eef2f7, #ffffff);
  box-shadow: inset 5px 5px 10px #d1d9e6,
              inset -5px -5px 10px #ffffff;

  color: #222;
  font-weight: bold;
  letter-spacing: 1px;
  box-sizing: border-box; /* 🔥 important */
}

#display::placeholder {
  color: #999;
}

/* Grid layout */
.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

/* Base button */
button {
  padding: 18px;
  font-size: 18px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.2s;
  font-weight: 600;
}

/* Number buttons */
.btn-number {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

/* Operator buttons */
.btn-operator {
  background: linear-gradient(135deg, #43cea2, #185a9d);
  color: white;
}

/* Equal button */
.btn-equal {
  background: linear-gradient(135deg, #f7971e, #ffd200);
  color: black;
}

/* Clear button */
.btn-clear {
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  color: white;
}

/* Hover effect */
button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

/* Click effect */
button:active {
  transform: scale(0.95);
}

/* Zero button */
.zero {
  grid-column: span 2;
}

.history {
  text-align: right;
  font-size: 14px;
  color: #888;
  margin-bottom: 5px;
}

button {
  transition: all 0.15s ease;
}

button:active {
  transform: scale(0.9);
}