:root {
  --slider-bg: #ccc;
  --slider-hue: 0;
  --slider-saturation: 0;
  --slider-lightness: 0;
  --lightness-min: 0;
  --lightness-max: 100;
  --saturation-min: 0;
  --saturation-max: 100;
}

/* Base styles */
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: #f4f4f4;
  color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  height: 100vh;
  transition: background-color 1s ease, color 1s ease;
  overflow-x: hidden;
}

/* Layout components */
.slidecontainer {
  display: flex;
  flex-direction: column;
  align-content: center;
  justify-content: center;
  max-width: 100%;
  width: 800px;
  padding: 20px;
}

/* Form elements */
label {
  display: inline-block;
  float: left;
  font-weight: 600;
  margin: 0 10px 20px 0;
  max-width: 30%;
  text-align: right;
  text-transform: uppercase;
  width: 110px;
  top: 5px;
  position: relative;
}

#output {
  color: #333;
  font-family: menlo, "Courier New", Courier, monospace;
  line-height: 2;
  max-width: 100%;
  font-size: 1.2em;
}

.black #output {
  color: #fff;
}

/* Slider styles */
.slider {
  -webkit-appearance: none;
  appearance: none;
  background: #d3d3d3;
  border-radius: 5px;
  border: solid 1px #ccc;
  filter: saturate(3);
  float: left;
  height: 20px;
  margin-top: 4px;
  max-width: 80%;
  opacity: 0.7;
  outline: none;
  transition: opacity 0.2s;
  width: 100%;
}

.slider::-webkit-slider-thumb,
.slider::-moz-range-thumb {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--slider-bg);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* Special sliders */
#hue.slider {
  background: linear-gradient(
    to right,
    hsl(0, var(--slider-saturation), var(--slider-lightness)),
    hsl(42, var(--slider-saturation), var(--slider-lightness)),
    hsl(84, var(--slider-saturation), var(--slider-lightness)),
    hsl(126, var(--slider-saturation), var(--slider-lightness)),
    hsl(168, var(--slider-saturation), var(--slider-lightness)),
    hsl(210, var(--slider-saturation), var(--slider-lightness)),
    hsl(255, var(--slider-saturation), var(--slider-lightness))
  );
}

#saturation.slider {
  background: linear-gradient(
    to right,
    hsl(var(--slider-hue), var(--saturation-min), var(--slider-lightness)),
    hsl(var(--slider-hue), var(--saturation-max), var(--slider-lightness))
  );
}

#lightness.slider {
  background: linear-gradient(
    to right,
    hsl(var(--slider-hue), var(--slider-saturation), var(--lightness-min)),
    hsl(var(--slider-hue), var(--slider-saturation), var(--lightness-max))
  );
}

/* Button styles */
.copy-button {
  background: transparent;
  border-radius: 10px;
  border: solid 1px #ccc;
  color: #333;
  font-size: 20px;
  height: 2.4em;
  line-height: 2.5;
  margin-left: 10px;
  padding: 4px 10px;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.copy-button:hover,
.copy-button:focus {
  background-color: #12cbdd;
}

.copy-button.success {
  background-color: #95d242;
}

.black .copy-button {
  color: #fff;
}

/* Dark theme */
.black {
  color: #fff;
}

.black .slider {
  filter: saturate(1.5);
}

.black #output {
  background: #333;
  color: #fff;
}

.black #blackwhite {
  color: #fff;
}

#blackwhite {
  font-size: 1em;
  font-weight: 600;
  border: solid 1px #ccc;
  border-radius: 4px;
  background: transparent;
}

#type {
  font-size: 1.2em;
  line-height: 1;
  height: 50px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #333;
  top: -5px;
  position: relative;
}

.black #type {
  color: #fff;
}

.black .slider {
  border: solid 1px #999;
}

@media screen and (max-width: 644px) {
  label {
    margin: 10px 0 0 0 auto;
    text-align: left;
    top: 6px;
  }

  .slider {
    max-width: 100%;
    width: 99%;
  }
}
