* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at top left, #0f1c4d 0%, #140d22 50%, #3b0a14 100%);
  padding: 20px;
}

.calculator {
  width: 360px;
  background: #111218;
  border-radius: 32px;
  padding: 20px;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.display {
  height: 150px;
  background: linear-gradient(180deg, #3b3d46, #2c2f38);
  border-radius: 24px;
  margin-bottom: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.display-expression {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 8px;
  word-break: break-all;
}

.display-result {
  font-size: 42px;
  font-weight: bold;
  color: #fff;
  word-break: break-all;
}

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

.btn {
  height: 72px;
  border: none;
  border-radius: 22px;
  background: linear-gradient(180deg, #8b8b94, #70717b);
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease;
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

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

.btn:active {
  transform: scale(0.94);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.25),
    inset 0 2px 5px rgba(0, 0, 0, 0.22);
}

.btn-gray {
  background: linear-gradient(180deg, #a4a4ad, #888992);
}

.btn-orange {
  background: linear-gradient(180deg, #ff9500, #ff7b00);
}

.btn-orange:hover {
  filter: brightness(1.4);
}

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

@media (max-width: 420px) {
  .calculator {
    width: 100%;
    max-width: 340px;
    padding: 16px;
    border-radius: 26px;
  }

  .display {
    height: 130px;
    border-radius: 20px;
  }

  .display-result {
    font-size: 34px;
  }

  .btn {
    height: 64px;
    font-size: 26px;
    border-radius: 18px;
  }
}