* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-light: #ffffff;
  --bg-dark: hsl(var(--base-color), 5%, 7%);

  --bg-cards-light: hsl(var(--base-color), 9%, 89%);
  --bg-cards-dark: hsl(var(--base-color), 6%, 17%);
  --bg-cards-select-light: hsl(194, 97%, 32%);
  --bg-cards-select-dark: hsl(195, 74%, 15%);

  --controls-dark: hsl(var(--base-color), 7%, 78%);

  --text-light: hsl(var(--base-color), 6%, 21%);
  --text-dark: #ffffff;

  --base-color: 240;

  font-size: 62.5%;
}

body {
  background-color: var(--bg-light);
  color: var(--text-light);

  font-family: "Roboto", sans-serif;
  font-size: 1.6rem;

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

  min-height: 100vh;

  transition: background-color 0.5s ease;
}

button {
  background-color: transparent;
  border: none;

  cursor: pointer;
}

.box-wrapper {
  display: grid;
  grid-template-areas: "main aside";

  width: clamp(54.7rem, 64.1vw, 82.1rem);
}

header {
  position: absolute;
  top: clamp(4rem, 4.7vw, 6rem);
  right: clamp(4rem, 4.7vw, 6rem);
}

header button svg {
  width: clamp(2.7rem, 3.1vw, 4rem);
  height: auto;
}

.hide {
  display: none;
}

main {
  grid-area: main;

  width: clamp(21.4rem, 25.1vw, 32.1rem);

  align-self: center;
}

#timer {
  font-size: clamp(8.4rem, 9.8vw, 12.6rem);

  display: flex;
  margin-bottom: 1.7rem;
}

#controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2.7rem, 3.1vw, 4rem);
}

#controls button svg {
  width: clamp(3.2rem, 3.8vw, 4.8rem);
  height: auto;
}

aside {
  grid-area: aside;

  width: clamp(20.5rem, 24.1vw, 30.8rem);

  display: grid;
  grid-template-areas: "forest rain" "coffee-shop fireplace";
  gap: clamp(2.1rem, 2.5vw, 3.2rem);
  justify-self: right;
}

.card-forest,
.card-rain,
.card-coffee-shop,
.card-fireplace {
  position: relative;
}

aside button {
  width: clamp(9.2rem, 10.8vw, 13.8rem);
  height: clamp(10.1rem, 11.9vw, 15.2rem);

  border-radius: clamp(1.6rem, 1.9vw, 2.4rem);
  padding: clamp(1.6rem, 1.9vw, 2.4rem);

  background-color: var(--bg-cards-light);

  transition: background 0.5s ease;
}

aside div.active button {
  background-color: var(--bg-cards-select-light);
}

aside button svg {
  width: auto;
  height: clamp(3.7rem, 4.4vw, 5.6rem);
  margin-bottom: clamp(2.1rem, 2.5vw, 3.2rem);
}

aside button svg path {
  fill: var(--text-light);
}

aside div.active button svg path {
  fill: var(--bg-light);
}

.sound-forest {
  grid-area: forest;
}

.sound-rain {
  grid-area: rain;
}

.sound-coffee-shop {
  grid-area: coffee-shop;
}

.sound-fireplace {
  grid-area: fireplace;
}

input[type="range"] {
  -webkit-appearance: none;

  width: clamp(6rem, 7vw, 9rem);
  cursor: pointer;

  background: transparent;

  position: absolute;
  bottom: clamp(1.6rem, 1.9vw, 2.4rem);
  left: calc(50% - clamp(6rem, 7vw, 9rem) / 2);
}

input[type="range"]::-webkit-slider-runnable-track {
  -webkit-appearance: none;

  width: clamp(6rem, 7vw, 9rem);
  height: clamp(0.3rem, 0.3vw, 0.4rem);
  border-radius: 0.5rem;

  background-color: var(--text-light);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;

  width: clamp(1.1rem, 1.3vw, 1.6rem);
  height: clamp(1.1rem, 1.3vw, 1.6rem);
  border-radius: 50%;

  background-color: var(--text-light);

  position: relative;
  top: calc(50% - clamp(1.1rem, 1.3vw, 1.6rem) / 2);
}

aside div.active input[type="range"]::-webkit-slider-runnable-track,
aside div.active input[type="range"]::-webkit-slider-thumb {
  background-color: var(--bg-light);
}

input[type="range"]::-moz-range-track {
  -webkit-appearance: none;

  width: clamp(6rem, 7vw, 9rem);
  height: clamp(0.3rem, 0.3vw, 0.4rem);
  border-radius: 0.5rem;

  background-color: var(--text-light);
}

input[type="range"]::-moz-range-thumb {
  -webkit-appearance: none;

  width: clamp(1.1rem, 1.3vw, 1.6rem);
  height: clamp(1.1rem, 1.3vw, 1.6rem);
  border-radius: 50%;

  background-color: var(--text-light);

  position: relative;
  top: calc(50% - clamp(1.1rem, 1.3vw, 1.6rem) / 2);
}

aside div.active input[type="range"]::-moz-range-track,
aside div.active input[type="range"]::-moz-range-thumb {
  background-color: var(--bg-light);
}

body.dark-mode {
  background-color: var(--bg-dark);
  color: var(--text-dark);

  transition: background-color 0.5s ease;
}

body.dark-mode #controls button svg path {
  fill: var(--controls-dark);
}

body.dark-mode aside button {
  background-color: var(--bg-cards-dark);

  transition: background 0.5s ease;
}

body.dark-mode aside div.active button {
  background-color: var(--bg-cards-select-dark);
}

body.dark-mode aside button svg path {
  fill: var(--controls-dark);
}

body.dark-mode aside div.active button svg path {
  fill: var(--bg-light);
}

body.dark-mode aside input[type="range"]::-webkit-slider-runnable-track,
body.dark-mode aside input[type="range"]::-webkit-slider-thumb {
  background-color: var(--bg-light);
}

body.dark-mode aside input[type="range"]::-moz-range-track,
body.dark-mode aside input[type="range"]::-moz-range-thumb {
  background-color: var(--bg-light);
}

@media (max-width: 360px) {
  .box-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3rem;
  }

  aside {
    align-self: center;
  }
}
