My point is though that there needs to be some way for the kingdom to dissolve. Kingdom titles have been lost permeability throughout history and this is a sandbox game so having a chance of that happening here, like it did in other eras, is appropriate.
There can be some limit. Like if you won't solve the civil war in 5 years, the kingdom will be done. Or something more dynamic like a year for every duke or so.
Also the possibility of inviting foreign dynasty was historical option. Like when in 1306 died the last male member of Premyslid dynasty Wenceslaus III Bohemian nobility elected Henry IV (husband of Wenceslau's daughter). However two emperors were against him (first Albert I and later Henry VII) so he never ruled for long. However this brings two new possibilities.
-When the title is not passed along female line, nobility will still probably vote for someone who married woman from the ruling house to keep the original bloodline on throne and will prefer this solution to most powerful domestic duke without strong connection to the king
-As the example of Henry VII's son John shows, it is possible to gain support to the throne by marrying woman after the death of king and thus gain the right to rule
Although the second one is more complicated and involves pressure from the emperor, it may still be an option for countries within HRE