@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400&display=swap");

/* Universal Selector */
* {
  font-family: "Roboto", sans-serif;
  margin: 0;
  padding: 0;
}

/* Variables */
:root {
  --function-background-color: #d4d4d2;
  --operator-background-color: #ff9500;
  --button-background-color: #505050;
  --text-color: #fff;
  --background-color: #000;
}

html {
  font-size: 62.5%;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100vh;
  width: 100vw;
}

button {
  border: none;
}

.calculator {
  max-width: 56rem;
}

#screen {
  font-size: 6.4rem;
  height: 6.4rem;
  outline: none;
  border: none;
  width: 100%;
  text-align: right;
  background-color: var(--background-color);
  color: var(--text-color);
  margin-bottom: 3rem;
}

.keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 1.6rem;
}

.key {
  background-color: var(--button-background-color);
  color: var(--text-color);
  font-size: 6.4rem;
  height: 12.8rem;
  width: 12.8rem;
  border-radius: 17.6rem;
  cursor: pointer;
}

.key:hover {
  background-color: var(--text-color);
  color: var(--background-color);
  transition: all 0.3s ease-in;
}

.function {
  background-color: var(--function-background-color);
  color: var(--background-color);
}

.operator {
  background-color: var(--operator-background-color);
  color: var(--text-color);
}

.zero {
  grid-column: span 2;
  width: 100%;
  text-align: left;
  padding-left: 4.8rem;
}

/* Media Queries */

/* 578px */
@media (max-width: 36em) {
  html {
    font-size: 56.25%;
  }
}

/* 578px */
@media (max-width: 32em) {
  html {
    font-size: 50%;
  }
}

/* 449px */
@media (max-width: 28em) {
  html {
    font-size: 45%;
  }
}

/* 414px */
@media (max-width: 25em) {
  html {
    font-size: 40%;
  }
}

/* 362px */
@media (max-width: 22em) {
  html {
    font-size: 35%;
  }
}
