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

body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
}

.calc-container {
  width: 100%;
  max-width: 400px;
  height: auto;
  max-height: 90vh;
  background-color: hsl(180, 25%, 35%);
  margin: 2rem auto;
  padding: 2rem;
  border: solid #444 6px;
  border-radius: 24px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.calc-screen {
  width: 100%;
  max-width: 380px;
  height: 100px;
  margin: 0 auto 1rem;
  background-color: darkslategray;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.calc-screen-text {
  font-family: Arial, Helvetica, sans-serif;
  color: greenyellow;
  font-size: 3.5rem;
  position: absolute;
  top: 18px;
  left: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-buttons {
  width: 100%;
  max-width: 368px;
  max-height: 85vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 10px;
}

.button {
  font-size: 2.5rem;
  text-align: center;
  width: 100%;
  height: 60px;
  border: none;
  border-radius: 20%;
  margin: 5px;
  cursor: pointer;
  background-color: white;
  transition: background-color 0.3s;
}

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

.button:active {
  background-color: hsl(0, 0%, 93%);
}

#plus-minus-button {
  font-size: 2rem;
}

@media (max-width: 600px) {
  .calc-container {
    padding: 1.5rem;
    width: 90%;
  }

  .calc-screen {
    width: 100%;
    max-width: 100%;
    height: 90px;
  }

  .calc-screen-text {
    font-size: 2.5rem;
    top: -25px;
  }

  .calc-buttons {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(5, 1fr);
  }

  .button {
    font-size: 2.5rem;
    height: 60px;
  }
}

@media (max-width: 480px) {
  .calc-container {
    padding: 1rem;
    width: 95%;
  }

  .calc-screen {
    height: 80px;
    padding: 20px 5px;
  }

  .calc-screen-text {
    font-size: 2rem;
    position: static;
  }

  .button {
    font-size: 2rem;
    height: 50px;
  }

  #backspace-button i {
    position: relative;
    top: -9px;
  }
}
