* {
  --blue: #4070c9;
  --green: #2e8b57;
  --red: #ff6347;
  font-family: sans-serif;
}

html {
  font-size: 16px;
}

@media only screen and (max-width: 800px) {
  html {
    font-size: 12px;
  }
}

body {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
  background-color: #eee;
  touch-action: manipulation;
}

.app-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 50px;
  max-height: 100%;
  max-width: 80vw;
}

.launchpad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media only screen and (max-width: 750px) {
  .launchpad {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media only screen and (max-width: 500px) {
  .launchpad {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pad {
  aspect-ratio: 1 !important;
  padding: 1rem;
  background-color: var(--blue);
  color: white;
  border-radius: 15px;
  cursor: pointer;
  transition: background-color 0.2s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  user-select: none;
}

.pad .label {
  text-align: center;
  font-weight: bold;
}

.pad .sublabel {
  text-align: center;
}

.pad.playing {
  background-color: var(--green);
}

.pad .duration {
  font-size: 0.8rem;
}

.pad .number {
  color: white;
  opacity: 0.8;
  font-weight: bold;
  font-size: 3rem;
  margin-top: -16px;
}

.pad-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.3);
  opacity: 0;
  transition: opacity 1s;
  pointer-events: none;
}

.pad-overlay.active {
  opacity: 1;
}

.progress-bar {
  position: absolute;
  bottom: 0;
  left: 15px;
  height: 15px;
  background-color: var(--green);
  width: 0%;
  transition: width 0.1s linear;
  max-width: calc(100% - 30px);
}

.main-controls {
  order: 2;
  display: flex;
  flex-direction: row;
  gap: 16px;
  padding: 20px;
  width: 100%;
}

.volume-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #c4d4f0;
  padding: 10px;
  border-radius: 10px;
  color: var(--blue);
  font-weight: bold;
  flex-grow: 1;
}

.stop-all-control {
  width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--red);
  padding: 10px;
  border-radius: 10px;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.volume-slider {
  flex-grow: 1;
  margin: 1rem 0;
  width: 100%;
}

.controls {
  margin-top: 16px;
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.controls > div {
  padding: 4px;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 100%;
}

.controls > div.active {
  padding: 4px;
  background-color: rgba(255, 255, 255, 1);
  transition: opacity 0.3s;
}
