@import url("https://fonts.googleapis.com/css2?family=Spartan:wght@700&display=swap");
* {
  margin: 0;
  padding: 0;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
}

body {
  font-family: "Spartan", sans-serif;
  color: #fff;
  padding: 6%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
}

/* Theming */
body.theme-1 {
  background-color: #3a4764;
}

body.theme-1 .logo {
  color: #fff;
}

body.theme-1 .theme-toggle {
  background-color: #232c43;
}

body.theme-1 .theme-toggle::-webkit-slider-thumb {
  background-color: #d03f2f;
}

body.theme-1 .theme-toggle::-moz-range-thumb {
  background-color: #d03f2f;
}

body.theme-1 #display-box {
  background-color: #182034;
}

body.theme-1 #keypad {
  background-color: #232c43;
}

body.theme-1 .key {
  color: #444b5a;
  background-color: #eae3dc;
  -webkit-box-shadow: 0 5px #b4a597;
          box-shadow: 0 5px #b4a597;
}

body.theme-1 .key.highlighted {
  background-color: #fff;
}

body.theme-1 .reset, body.theme-1 .del {
  color: #fff;
  background-color: #637097;
  -webkit-box-shadow: 0 5px #404e72;
          box-shadow: 0 5px #404e72;
}

body.theme-1 .equals {
  color: #fff;
  background-color: #d03f2f;
  -webkit-box-shadow: 0 5px #93261a;
          box-shadow: 0 5px #93261a;
}

body.theme-1 .operator.selected {
  background-color: #fff;
  color: #3a4764;
}

body.theme-1 .attribution a {
  color: #637097;
}

body.theme-2 {
  background-color: #e6e6e6;
  color: #35352c;
}

body.theme-2 .theme-toggle {
  background-color: #d1cccc;
}

body.theme-2 .theme-toggle::-webkit-slider-thumb {
  background-color: #ca5502;
}

body.theme-2 .theme-toggle::-moz-range-thumb {
  background-color: #ca5502;
}

body.theme-2 #display-box {
  background-color: #ededed;
  color: #35352c;
}

body.theme-2 #keypad {
  background-color: #d1cccc;
}

body.theme-2 .key {
  background-color: #e5e4e1;
  -webkit-box-shadow: 0 5px #a69d91;
          box-shadow: 0 5px #a69d91;
}

body.theme-2 .key.highlighted {
  background-color: #fff;
}

body.theme-2 .reset, body.theme-2 .del {
  color: #fff;
  background-color: #377f86;
  -webkit-box-shadow: 0 5px #1b5f65;
          box-shadow: 0 5px #1b5f65;
}

body.theme-2 .equals {
  color: #fff;
  background-color: #ca5502;
  -webkit-box-shadow: 0 5px #893901;
          box-shadow: 0 5px #893901;
}

body.theme-2 .operator.selected {
  background-color: #fff;
  color: #a69d91;
}

body.theme-2 .attribution a {
  color: #377f86;
}

body.theme-3 {
  background-color: #160628;
  color: #ffe53d;
}

body.theme-3 .theme-toggle {
  background-color: #1d0934;
}

body.theme-3 .theme-toggle::-webkit-slider-thumb {
  background-color: #00e0d1;
}

body.theme-3 .theme-toggle::-moz-range-thumb {
  background-color: #00e0d1;
}

body.theme-3 #display-box {
  background-color: #1d0934;
}

body.theme-3 #keypad {
  background-color: #1d0934;
}

body.theme-3 .key {
  color: #ffe53d;
  background-color: #341c4f;
  -webkit-box-shadow: 0 5px #871c9c;
          box-shadow: 0 5px #871c9c;
}

body.theme-3 .key.highlighted {
  background-color: #bc15f4;
}

body.theme-3 .reset, body.theme-3 .del {
  color: #fff;
  background-color: #58077d;
  -webkit-box-shadow: 0 5px #bc15f4;
          box-shadow: 0 5px #bc15f4;
}

body.theme-3 .equals {
  color: #1b2428;
  background-color: #00e0d1;
  -webkit-box-shadow: 0 5px #6cf9f2;
          box-shadow: 0 5px #6cf9f2;
}

body.theme-3 .operator.selected {
  background-color: #bc15f4;
  color: #fff;
}

body.theme-3 .attribution a {
  color: #58077d;
}

header {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  font-size: .7em;
  margin-bottom: 2em;
}

header .logo {
  font-size: 3em;
}

header .theme-selector {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: end;
      -ms-flex-align: end;
          align-items: flex-end;
  -webkit-box-pack: end;
      -ms-flex-pack: end;
          justify-content: flex-end;
}

header .toggle-label {
  margin-right: 1em;
  margin-bottom: .2em;
}

header .toggle-options-label {
  display: inline;
  width: 70%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  margin-bottom: .2em;
}

header .toggle-container {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  width: 35%;
}

header input[type=range] {
  display: inline;
  -webkit-appearance: none;
  width: 100%;
  height: 26px;
  padding: 0 5px;
  border-radius: 5em;
  cursor: pointer;
}

header input[type=range]:focus {
  outline: none;
}

header input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
}

header input[type=range]::-moz-range-track {
  width: 20%;
}

header input[type=range]::-moz-range-thumb {
  border: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
}

main {
  width: 100%;
}

#display-box {
  width: 100%;
  border-radius: 10px;
  margin-bottom: .5em;
  display: block;
  text-align: right;
  padding: 7% 7% 5% 7%;
  font-size: 2.6em;
}

.keys-container {
  position: relative;
  width: 100%;
  display: block;
  z-index: 0;
}

#keypad {
  position: relative;
  height: 60vh;
  max-height: 500px;
  width: 100%;
  display: -ms-grid;
  display: grid;
  border-radius: 10px;
  -ms-grid-rows: (1fr)[5];
      grid-template-rows: repeat(5, 1fr);
  -ms-grid-columns: (1fr)[4];
      grid-template-columns: repeat(4, 1fr);
  padding: 6% 6% 7% 6%;
  gap: 1em;
}

#keypad.theme-1 {
  background-color: #232c43;
}

#keypad.theme-2 {
  background-color: #d1cccc;
}

#keypad.theme-3 {
  background-color: #1d0934;
}

#keypad button {
  position: relative;
  font-family: "Spartan", sans-serif;
  font-size: 1.5em;
  border: none;
  border-radius: 5px;
  padding: .7em 0 .6em 0;
  cursor: pointer;
}

#keypad .reset {
  -ms-grid-column: 1;
  -ms-grid-column-span: 2;
  grid-column: 1 / span 2;
}

#keypad .reset, #keypad .del {
  font-size: 1em;
}

#keypad .equals {
  font-size: 1em;
  -ms-grid-column: 3;
  -ms-grid-column-span: 2;
  grid-column: 3 / span 2;
}

.attribution {
  font-size: .5em;
  text-align: center;
}

.attribution a {
  color: #3e52a3;
  text-decoration: none;
}

@media screen and (min-width: 1201px) {
  body {
    padding-bottom: 2%;
  }
  #content-container {
    width: 40%;
    position: relative;
    left: 50%;
    -webkit-transform: translateX(-50%);
            transform: translateX(-50%);
  }
  #display-box {
    font-size: 3em;
  }
  #keypad {
    height: auto;
    gap: 2em;
  }
  #keypad button {
    font-size: 1.8em;
    border-radius: 10px;
    padding: .5em 0 .4em 0;
  }
}
