:root {
  --primary: #2a5298;
  --secondary: #1e3c72;
  --btn-operator-bg: #ffcc80;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
}

.calculator {
  background: #fff;
  width: min(90vw, 400px);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.display {
  background: #f4f4f4;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  text-align: right;
  font-size: 3rem;
  min-height: 4rem;
  margin-bottom: 1rem;
  overflow: hidden;
}

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

.btn {
  padding: 1rem;
  font-size: 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  background: #e0e0e0;
}

.btn:hover {
  background: #d5d5d5;
}

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

.number {
  background: #fafafa;
}

.operator {
  background: var(--btn-operator-bg);
}

#clear {
  background: #ff8a80;
  color: #fff;
}

#= {
  background: #81c784;
  color: #fff;
}

@media (max-width: 400px) {
  .btn {
    padding: 0.75rem;
    font-size: 1.25rem;
  }

  .display {
    font-size: 2.5rem;
  }
}

