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

body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(to bottom right, #f7d9e3, #ffe5b4);
 
}

.calculator {
  background-color: #ffffff;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  width: 300px;
}

.screen {
  background-color: #f1f1f1;
  border-radius: 10px;
  margin-bottom: 20px;
  padding: 15px;
  font-size: 1.5rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: end;
}


.buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.number-container,
.operator-container {
  display: grid;
  gap: 10px;
}

.number-container {
  grid-template-columns: repeat(3, 1fr);
}

.operator-container {
  grid-template-columns: repeat(5, 1fr);
}

button {
  padding: 1rem;
  font-size: 1.2rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.number {
  background-color: #f0f0f0;
}

.number:hover {
  background-color: #e0e0e0;
}

.operator {
  background-color: #f8c8dc;
}

.operator:hover {
  background-color: #f4a9c1;
}

.equal{
  background-color: #ff8c42;
  color: white;
}

.equal:hover {
  background-color: #724a31;
}

.clear{
  background-color: #d78f8f;
}


.selected {
  background-color: #f4a9c1; 
}

footer {
  position: fixed;
  bottom: 20px;
  right: 20px;
}

footer .legend {
  background-color: #ffffff;
  padding: 1rem 1.5rem;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
  max-width: 250px;
  line-height: 1.4;
}

footer .legend p {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

footer .legend ul {
  list-style: none;
  padding: 0;
}

footer .legend li {
  margin-bottom: 0.3rem;
}

footer .legend code {
  background-color: #f1f1f1;
  padding: 2px 5px;
  border-radius: 5px;
  font-family: monospace;
}
