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

body {
  background: linear-gradient(135deg, #02517059, #00000062);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.calculator {
  display: grid;
  grid-template-columns: repeat(4, 60px);
  gap: 10px;
  padding: 20px;
  background-color: grey;
  border-radius: 20px;
  font-size: 1.5rem;
}

.display {
  grid-column: span 4;
  text-align: right;
  padding: 10px;
  color: white;
  background-color: rgb(8, 8, 41);
  border-radius: 10px;
}

.button,
.item {
  padding: 15px;
  border-radius: 10px;
  border: none;
  color: white;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: background 0.3s;
}

.button {
  background-color: #28437e;
}

.item {
  background-color: #0050fd;
}

.button:hover {
  background-color: red;
}

.item:hover {
  background-color: rgb(49, 49, 49);
}

#history {
  padding: 100px;
  max-height: 200px;
  overflow-y: auto;
  background-color: rgba(73, 73, 73, 0.7);
  color: white;
  border-radius: 10px;
  font-size: 1rem;
  line-height: 1.5;
}

#history::-webkit-scrollbar {
  width: 6px;
}

#history::-webkit-scrollbar-thumb {
  background: #0010ec;
  border-radius: 4px;
}

#history::-webkit-scrollbar-thumb:hover {
  background: #2f00ff;
}

@media (max-width: 600px) {
  .calculator {
    grid-template-columns: repeat(4, 60px);
    gap: 8px;
    padding: 15px;
  }

  .display {
    font-size: 1.8rem;
    padding: 12px;
  }

  .button,
  .item {
    padding: 14px;
    font-size: 1rem;
  }

  #history {
    width: 95%;
    font-size: 0.9rem;
    padding: 15px;
  }
}
