.powerSliderContainer {
  height: 60%;
  width: 100%;
  max-width: 812px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 0;
  margin: 6px auto;

  /* The same timber in shadow: a channel routed into the rail rather than a
     separate brown box. The front face's wash is left off here, and the rim
     shadows turn the other way, so the groove reads as cut in. */
  background-color: var(--wood-dark);
  background-image: var(--wood-grain);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  border: 2px solid var(--wood-edge);
  border-radius: 2px;
  box-shadow:
    inset 0 2px 5px var(--wood-shade),
    inset 0 -1px 0 var(--wood-rim-dim);
  overflow: hidden;
  box-sizing: border-box;
  flex: 1 1 auto;
  align-self: center;
}

.powerPercent {
  position: absolute;
  left: 5%;
  font-family: var(--font-family-primary), sans-serif;
  font-size: 14px;
  font-weight: bold;
  color: #b0b0b0;
  text-shadow: 1px 1px 2px rgb(0 0 0 / 80%);
  pointer-events: none;
  z-index: 3;
}

/* Power Ramp (Sits behind the cue)

   The ramp is the floor of the channel, not a ribbon laid over it, so it wears
   the channel's light. The upper lip cuts the ramp's top edge into shadow, the
   floor falls away again at the lower lip, and the crown of the ramp is left
   clear for the power colour itself. That is the same bevel the timber beside
   it and the cue tip above it already paint, which is what makes the panel read
   as one continuous groove rather than a red sticker on a brown box. */
.power-track {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  clip-path: polygon(0 100%, 100% 100%, 100% 0);
  background:
    linear-gradient(
      180deg,
      rgb(0 0 0 / 48%) 0%,
      rgb(0 0 0 / 16%) 13%,
      rgb(0 0 0 / 3%) 34%,
      rgb(0 0 0 / 0%) 50%,
      rgb(0 0 0 / 3%) 68%,
      rgb(0 0 0 / 16%) 88%,
      rgb(0 0 0 / 42%) 100%
    ),
    linear-gradient(to right, rgb(255 0 0 / 90%) 0%, #ff0 100%);
}

input[type="range"].powerSlider {
  appearance: none;
  width: 100%;
  height: 100%;
  background: transparent;
  cursor: pointer;
  margin: 0;
  outline: none;
  position: relative;
  z-index: 2;

  --p: 65%;
  --p-inv: calc(100% - var(--p));
}

.powerSliderContainer.is-disabled .power-track,
input[type="range"].powerSlider.is-disabled,
input[type="range"].powerSlider:disabled {
  filter: brightness(0.5);
  cursor: not-allowed;
}

/* Track - Webkit (Chrome/Safari) */
input[type="range"].powerSlider::-webkit-slider-runnable-track {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(
        to bottom,
        rgb(0 0 0 / 80%) 0%,
        rgb(0 0 0 / 20%) 15%,
        rgb(255 230 200 / 30%) 40%,
        rgb(255 230 200 / 30%) 60%,
        rgb(0 0 0 / 20%) 85%,
        rgb(0 0 0 / 80%) 100%
      )
      no-repeat 100% 0 / var(--p-inv) 100%,
    linear-gradient(to right, transparent var(--p), var(--wood-lit) var(--p));
}

/* Track - Firefox */
input[type="range"].powerSlider::-moz-range-track {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(
        to bottom,
        rgb(0 0 0 / 80%) 0%,
        rgb(0 0 0 / 20%) 15%,
        rgb(255 230 200 / 30%) 40%,
        rgb(255 230 200 / 30%) 60%,
        rgb(0 0 0 / 20%) 85%,
        rgb(0 0 0 / 80%) 100%
      )
      no-repeat 100% 0 / var(--p-inv) 100%,
    linear-gradient(to right, transparent var(--p), var(--wood-lit) var(--p));
}

/* Thumb - Webkit (Cue Tip) */
input[type="range"].powerSlider::-webkit-slider-thumb {
  appearance: none;
  height: 100%;
  width: 36px;
  background:
    linear-gradient(
      to bottom,
      rgb(0 0 0 / 80%) 0%,
      rgb(0 0 0 / 20%) 15%,
      rgb(255 230 200 / 30%) 40%,
      rgb(255 230 200 / 30%) 60%,
      rgb(0 0 0 / 20%) 85%,
      rgb(0 0 0 / 80%) 100%
    ),
    linear-gradient(to right, #357abd 25%, #fff 0);
  border: none;
  border-left: 2px solid #000;
  cursor: grab;
}

/* Thumb - Firefox (Cue Tip) */
input[type="range"].powerSlider::-moz-range-thumb {
  height: 100%;
  width: 36px;
  background:
    linear-gradient(
      to bottom,
      rgb(0 0 0 / 80%) 0%,
      rgb(0 0 0 / 20%) 15%,
      rgb(255 230 200 / 30%) 40%,
      rgb(255 230 200 / 30%) 60%,
      rgb(0 0 0 / 20%) 85%,
      rgb(0 0 0 / 80%) 100%
    ),
    linear-gradient(to right, #357abd 25%, #fff 0);
  border: none;
  border-left: 2px solid #000;
  border-radius: 0;
  cursor: grab;
}

input[type="range"].powerSlider:active::-webkit-slider-thumb,
input[type="range"].powerSlider:active::-moz-range-thumb {
  cursor: grabbing;
}
