.thermometer {
    display: block;
    position: relative;
    height: 100px;
}

.bulb {
    display: inline-block;
    border: 2px solid #222;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: absolute;
    left: 0px;
    bottom: 0px;
    border-top: 2px solid #fff;
    box-shadow: 0px 0px 0px 2px #fff inset;
    background: red;
}

.stem {
    display: inline-block;
    border: 2px solid #222;
    width: 12px;
    height: 80px;
    border-radius: 0px 0px 20px 20px;
    border-top: 2px solid transparent;
    position: absolute;
    bottom: 18px;
    left: 4px;
    box-shadow: 0px 0px 0px 2px #fff inset;
    transform: rotate(180deg);
    z-index: 10;
    padding-bottom: 3px;
}

.stem-perct {
    height: calc(var(--temp, 50) * 1%);
    width: 8px;
    background: red;
    display: block;
    margin: 0px auto;
    border-radius: 10px;
    transition: height 0.3s ease-in-out;
}

/* Cambio de altura basado en el valor del input */
#temp-range {
    position: absolute;
    bottom: -40px;
    width: 100%;
}

#temp-range:focus + .thermometer .stem .stem-perct {
    height: calc(var(--temp) * 0.8%);
}

input[type="range"] {
    --temp: 50; /* valor por defecto */
}
