diff --git a/index.html b/index.html
index 605c3ad..8a3470b 100644
--- a/index.html
+++ b/index.html
@@ -346,7 +346,7 @@ footer b{color:var(--txt)}
@@ -608,11 +608,14 @@ const DEFAULT = {
bake:null
};
let S = Object.assign({}, DEFAULT);
+const BALL_MIN = 150;
+const BALL_MAX = 400;
/* ============================================================
RECHENKERN
============================================================ */
const clamp = (x,a,b)=>Math.min(b,Math.max(a,x));
+const clampBall = x => clamp(Number.isFinite(+x) ? +x : DEFAULT.ball, BALL_MIN, BALL_MAX);
const rate = T => Math.pow(2.5,(T-20)/10); // Q10 = 2.5
/* Eine Garephase mit Temperaturwechsel. tc = Stunden, bis der Teigkern
@@ -853,7 +856,7 @@ function initUI(){
});
chips($("styles"), STYLES, "style", k=>{
const st=STYLES[k];
- S.ball=st.ball; S.hyd=st.hyd; S.salt=st.salt; S.oil=st.oil; S.sugar=st.sugar; S.mode=st.mode;
+ S.ball=clampBall(st.ball); S.hyd=st.hyd; S.salt=st.salt; S.oil=st.oil; S.sugar=st.sugar; S.mode=st.mode;
if (S.uxMode==="simple") S.mode="w";
});
chips($("modes"), MODES, "mode");
@@ -902,6 +905,7 @@ function initUI(){
function syncInputs(){
document.body.dataset.ux = S.uxMode;
+ S.ball = clampBall(S.ball);
if (S.uxMode==="simple" && S.mode!=="w") S.mode="w";
RANGES.forEach(id=>{ $(id).value=S[id]; });
$("ballsOut").textContent=S.balls;
@@ -1107,6 +1111,7 @@ function readHash(){
});
if (!STYLES[S.style]) S.style="napo";
if (!UX_MODES[S.uxMode]) S.uxMode="simple";
+ S.ball = clampBall(S.ball);
if (!PLANS[S.plan]) S.plan="free";
if (p.has("method")){ // alte Links: method=room|cold
S.seq = p.get("method")==="room" ? "room" : "warmcold";