

body, html {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: sans-serif;
  background: #000;
}

canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

.ui-panel {
  position: absolute;  /* This allows the panel to move around the screen */
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: max-content;
  min-height: 126px;
  border: 0px solid #fff;
  background: rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  z-index: 10;
  padding: 16px 40px;
}



.control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 150px;
}

.control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.control-group-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 4px;
}

.control-group label {
  font-size: 18px;
}

.control-group input[type=number] {
  font-size: 18px;
  text-align: right;
  width: 60px;
  padding: 4px;
  background: transparent;
  color: white;
  border: none;
  border-bottom: 0px solid white;
}

.control-group input[type=range] {
  width: 150px;
  margin-top: 4px;
  -webkit-appearance: none;
  appearance: none;
  height: 12px;
  border-radius: 6px;
  background: #aaa;
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  margin-top: -6px;
}

input[type="color"].pill {
  width: 35px;                 /* Width of the pill */
  height: 62px;                /* Height of the pill */
  transform: rotate(0deg);    /* Rotate the pill */
  border-radius: 50px;         /* Rounded edges to make it pill-shaped */
  border: 0px solid #fff;      /* White border */
  background: transparent;     /* Transparent background */
  padding: 0;                  /* Remove default padding */
  cursor: pointer;            /* Change cursor to indicate it's clickable */
  -webkit-appearance: none;    /* Remove default styles in Webkit browsers */
  appearance: none;            /* Remove default styles in other browsers */
}

input[type="color"].pill::-webkit-color-swatch {
  border-radius: 50px;         /* Ensure the swatch is fully rounded */
  border: none;                /* Remove any border on the swatch itself */
  background: transparent;     /* Allow the background to show through */
}

input[type="color"].pill::-webkit-color-swatch-wrapper {
  border-radius: 50px;         /* Ensure the background is also rounded */
}

input[type="color"]:focus {
  outline: none;               /* Remove the focus outline */
}


input[type=text] {
  width: 80px;
  background: transparent;
  color: white;
  border: none;
  border-bottom: 0px solid white;
  font-size: 18px;
  text-align: center;
}

.control.color {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.text-control {
  align-items: flex-start;
  min-width: 220px;
  display: none;
}

.text-control textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  padding: 8px 10px;
  font-family: "Brockmann", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  box-sizing: border-box;
  outline: none;
}

.text-control textarea:focus,
.text-control textarea:hover {
  border-color: rgba(255, 255, 255, 0.8);
}

.control-group-top span {
  font-size: 16px;
  min-width: 52px;
  text-align: right;
}

@media (max-width: 900px) {
  .ui-panel {
    position: fixed;
    top: 68px;
    left: 12px;
    right: 12px;
    transform: none;
    width: auto;
    justify-content: left;
    gap: 8px;
    padding: 12px;
    border-radius: 20px;
    font-size: 14px;
  }

  input#sizeValue, span#speedValue, input#lineHeightValue,input#scanLineValue {
    display: none; 
}

  .ui-panel .control,
  .ui-panel .text-control {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    align-items: left;
  }

  .control-group{
    width: 100%;
    gap: 8px;
    padding-bottom: 16px;
  }

  .control-group label,
  .control-group-top span {
    font-size: 14px;
  }

  .control-group input[type=number],
  input[type=text],
  .text-control textarea {
    font-size: 14px;
  }

  .control-group input[type=range] {
    width: 100%;
    height: 4px;
  }

  input[type=range]::-webkit-slider-thumb {
    width: 16px;
    height: 15px;
    margin-top: -2px;
  }

  input[type="color"].pill {
    width: 28px;
    height: 32px;
  }

  .text-control {
    order: 3;
    flex-basis: 100%;
    display: flex;
  }

  .control.color {
    flex: 0 1 calc(50% - 8px);
    justify-content: flex-start;
    gap: 6px;
  }

  .instruction-card-wrapper {
    top: auto;
    bottom: 16px;
  }
}

.control.color label {
  margin-bottom: 4px;
  text-align: left;
}

.control.color .hex-input-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
