:root {
  --padcolor: #fffa7cab;
  --padhover: #fffb7c55;
  --white: #ffffff;
  --buttoncircle: #9eb08c;
  --modal: #fffffff0;
}

body {
  font-family: monospace;

  display: flex;
  justify-content: center;
  align-items: center;

  margin: 35px 0;
  min-width: 280px;
  box-sizing: border-box;

  background: linear-gradient(
    -45deg,
    #26381d,
    #656d43,
    #2cbb99,
    #dae3be,
    #442744
  );
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
}

body.details {
  background: #dae3be;

  display: block;
  margin: 35px 35px;
}

body.details span {
  font-weight: bold;
  font-style: italic;
}

body.MIDI .pad,
body.MIDI .playButton,
body.MIDI .resetButton {
  pointer-events: none;
  cursor: not-allowed;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row-reverse;
  justify-content: center;

  height: 100%;
  width: calc(35px * 8);
}

.grid.loading {
  opacity: 0.5;
}

.pad {
  display: inline-block;

  height: 35px;
  width: 35px;
  box-sizing: border-box;

  cursor: pointer;
  border: 1px solid var(--white);
  border-radius: 50%;
}

.pad.active {
  background: var(--padcolor);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

button {
  position: relative;
  width: 100px;
  margin: 15px;
  padding: 20px;

  border: none;
  border-radius: 25px;
  font-family: monospace;
  background: var(--white);
  cursor: pointer;
}

button::after {
  display: inline-block;
  height: 5px;
  width: 5px;
  position: absolute;
  content: "";
  border: 1px solid #000000;
  border-radius: 25px;
  right: 8.25%;
  top: 44%;
  background: var(--buttoncircle);
}

.modal {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  position: fixed;

  height: 85vh;
  width: calc(100vw / 1.5);
  min-height: 560px;
  max-height: 625px;
  max-width: 1000px;
  padding: 30px;
  background: var(--modal);
  border-radius: 25px;
}

.showModal {
  display: flex;
  z-index: 69;
}

.modalTitle {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modalTitle h1 {
  font-size: 2rem;
}

.modalTitle .closeButton {
  color: var(--white);
  background: #454545;
  margin: 0;
}

.credits {
  display: none;
  font-size: 1rem;
}

.modal a {
  color: #000;
}

.credits a {
  color: var(--white);
}

.showCredits {
  display: block;
}

@media (hover: hover) {
  .grid .pad:not(.active):hover {
    background-color: var(--padhover);
  }

  button:hover {
    background-color: var(--padcolor);
  }

  button:hover::after {
    background: var(--white);
  }

  .modalTitle .closeButton:hover {
    background: #000000;
  }
}

@media (min-width: 620px) {
  .grid {
    max-height: 580px;
    width: calc(50px * 8);
  }
  .pad {
    height: 50px;
    width: 50px;
    border: 0.1px solid var(--white);
  }
}

@media (max-width: 750px) {
  .modal {
    justify-content: initial;
    overflow: scroll;
    padding: 30px 30px 0;

    top: 0;
    height: 96vh;
    max-height: 1000px;
    width: 85vw;
  }
  .modalTitle {
    flex-direction: column;
  }
  .modalTitle .closeButton {
    margin-bottom: 20px;
  }
  .modalDetails {
    margin-bottom: 120px;
  }
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
