@font-face { font-family: 'Geist'; src: url('/fonts/geist-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/fonts/geist-mono-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f5f3ee;
  --surface: #fffefb;
  --ink: #1d1d1b;
  --ink-2: #57564f;
  --ink-3: #8b8a82;
  --line: #e4e1d8;
  --ball: #ffffff;
  --ball-ring: #cfccc3;
  --euro: #3c3c40;
  --accent: #1f6b55;
  --accent-soft: #e3efe9;
  --warn: #b5532f;
  --mid: #b88a1d;
  --shadow: 0 1px 2px rgba(60, 50, 30, .05), 0 8px 24px -12px rgba(60, 50, 30, .12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615; --surface: #1f1f1d; --ink: #f0eee8; --ink-2: #b9b7ae; --ink-3: #85837b;
    --line: #2f2e2b; --ball: #f4f2ec; --ball-ring: #4a4944; --euro: #55555b;
    --accent: #5cbf9c; --accent-soft: #1d3029; --warn: #e08560; --mid: #d9ae4a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Geist', system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: 'Geist Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
b { font-weight: 600; }
h1, h2 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); font-weight: 650; }
h2 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.eyebrow { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin-bottom: .35rem; }
.lead { color: var(--ink-2); max-width: 62ch; margin: .5rem 0 1.25rem; }

.page > * { min-width: 0; }
.page { max-width: 880px; margin: 0 auto; padding: 28px 16px 64px; display: grid; gap: 18px; }

.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; padding: 12px 0 8px; }
.logout { color: var(--ink-3); font-size: .85rem; text-decoration: none; padding: .4rem 0; }
.logout:hover { color: var(--ink); }

/* Ehrlicher Kasten */
.truth { padding: 24px 0 8px; border-top: 1px solid var(--line); }
.truth h2 { font-size: 1rem; color: var(--ink-3); font-weight: 500; margin-bottom: 1rem; }
.truth-grid { display: grid; gap: 24px; }
.truth-big { font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 600; letter-spacing: -0.03em; margin-bottom: .5rem; }
.truth-head { font-weight: 600; margin-bottom: .5rem; }
.levers { margin: 0 0 .75rem; padding-left: 1.2rem; display: grid; gap: .5rem; }
@media (min-width: 760px) { .truth-grid { grid-template-columns: 1fr 1.15fr; gap: 40px; } }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px 18px; box-shadow: var(--shadow); }
@media (min-width: 640px) { .card { padding: 28px; } }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card h2 + div, .card .eyebrow + h2 { margin-bottom: 1rem; }
.split { display: grid; gap: 24px; }
@media (min-width: 760px) { .split { grid-template-columns: 1fr 1.1fr; gap: 36px; } }

/* Kugeln wie im Spielauftrag */
.balls { display: inline-flex; align-items: center; gap: 6px; padding: 6px; background: var(--line); border-radius: 999px; max-width: 100%; }
.ball {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: var(--ball); color: #1d1d1b; font-weight: 500; font-size: 1.05rem;
  font-variant-numeric: tabular-nums; box-shadow: inset 0 -2px 0 rgba(0,0,0,.06);
}
.euro-group { display: inline-flex; gap: 6px; padding: 4px; margin: -4px -4px -4px 2px; background: var(--euro); border-radius: 999px; }
.ball.hit { background: var(--accent); color: #fff; }
@media (max-width: 380px) { .ball { width: 34px; height: 34px; font-size: .95rem; } .balls, .euro-group { gap: 4px; } }

.checks { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.checks:empty { display: none; }
.check-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; }
.check-row .balls { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
.check-row .balls { transform: scale(.88); transform-origin: left center; }
.check-name { font-weight: 500; }
.check-res { font-family: 'Geist Mono', monospace; color: var(--ink-3); font-size: .9rem; }
.check-res.won { color: var(--accent); font-weight: 600; }

/* Beliebtheits-Anzeige */
.meter { margin: 4px 0 14px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.meter-label { font-weight: 600; font-size: 1.1rem; }
.meter-head .mono { font-size: 1.4rem; font-weight: 600; }
.meter-head small { font-size: .8rem; color: var(--ink-3); font-weight: 400; }
.meter-track { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter-fill { height: 100%; width: 100%; transform-origin: left; border-radius: 99px; transition: transform .6s cubic-bezier(.16,1,.3,1); }
.meter.good .meter-fill { background: var(--accent); } .meter.good .meter-label { color: var(--accent); }
.meter.mid .meter-fill { background: var(--mid); } .meter.mid .meter-label { color: var(--mid); }
.meter.bad .meter-fill { background: var(--warn); } .meter.bad .meter-label { color: var(--warn); }
.meter-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--ink-3); margin-top: 4px; }
.reasons { list-style: none; padding: 0; margin: 0 0 4px; display: grid; gap: 6px; font-size: .92rem; color: var(--ink-2); }
.reasons li { padding-left: 1.3rem; position: relative; }
.reasons li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.reasons li.minus::before { content: '−'; color: var(--warn); }
.reasons li.plus::before { content: '+'; color: var(--accent); }
.history { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .92rem; color: var(--ink-2); }

/* Feld 2 */
#f2-current, #f2-suggestion { margin-bottom: 16px; }
#f2-current .balls, #f2-suggestion .balls { margin-bottom: 14px; }
#f2-suggestion:empty { display: none; }
#f2-suggestion { padding: 18px; border-radius: 16px; background: var(--accent-soft); animation: rise .45s cubic-bezier(.16,1,.3,1); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.empty { color: var(--ink-3); padding: 14px 16px; border: 1px dashed var(--line); border-radius: 14px; font-size: .92rem; }
.gen { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 4px 0 16px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--ink-2); cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Buttons und Formulare */
button {
  font: inherit; font-weight: 550; border: 0; border-radius: 12px; padding: 11px 18px; cursor: pointer;
  background: var(--ink); color: var(--bg); transition: transform .15s ease, opacity .15s ease;
}
button:active { transform: scale(.98); }
button.primary { background: var(--accent); color: #fff; }
button.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.edit { margin-top: 14px; }
.edit summary { cursor: pointer; color: var(--ink-2); font-size: .9rem; }
.field-form { display: grid; gap: 6px; margin-top: 12px; max-width: 320px; }
.field-form label { font-size: .85rem; color: var(--ink-2); margin-top: 6px; }
.field-form button { margin-top: 8px; justify-self: start; }
input:not([type=checkbox]) {
  font: inherit; font-family: 'Geist Mono', monospace; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%;
}
.error { color: var(--warn); font-size: .88rem; min-height: 0; }
.error:empty { display: none; }
.error-box { background: var(--surface); border: 1px solid var(--warn); color: var(--warn); padding: 14px 16px; border-radius: 14px; }

/* Quoten */
.compare { display: grid; gap: 12px; margin: 16px 0 14px; }
@media (min-width: 560px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare > div { padding: 16px; border-radius: 14px; border: 1px solid var(--line); }
.compare .accent { background: var(--accent-soft); border-color: transparent; }
.compare .big { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; margin: 2px 0 4px; }
.compare .muted { font-size: .85rem; }
.table-wrap { overflow-x: auto; margin-top: 18px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); }
td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
td:first-child { color: var(--ink-3); }
tr.sum td { font-weight: 600; border-bottom: 0; padding-top: 12px; }

/* Häufigkeiten */
.tag { font-size: .75rem; padding: 3px 10px; border-radius: 99px; background: var(--line); color: var(--ink-2); }
.freq-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.euro-grid { grid-template-columns: repeat(12, 1fr); }
@media (max-width: 520px) { .euro-grid { grid-template-columns: repeat(6, 1fr); } }
.cell {
  aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; align-content: center;
  background: color-mix(in oklab, var(--accent) calc(var(--t) * 70% + 6%), var(--surface));
  color: var(--ink); line-height: 1.1;
}
.cell span { font-weight: 550; font-size: .9rem; }
.cell small { font-family: 'Geist Mono', monospace; font-size: .62rem; opacity: .7; }

.euro-label { margin-top: 18px; }
#freq-note { margin-top: 12px; }

footer { color: var(--ink-3); font-size: .8rem; display: grid; gap: 6px; padding: 12px 4px 0; }

/* Laden */
.skel { display: inline-block; background: linear-gradient(90deg, var(--line), var(--surface), var(--line)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
.skel.w8 { width: 8rem; height: 1em; }
.balls-skel { width: min(340px, 100%); height: 52px; border-radius: 99px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Login */
body.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px 24px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 1.7rem; margin: 18px 0 4px; }
.login-card form { display: grid; gap: 8px; margin-top: 20px; }
.login-card label { font-size: .85rem; color: var(--ink-2); }
.login-card button { margin-top: 6px; background: var(--accent); color: #fff; }
.login-balls { display: inline-flex; gap: 6px; padding: 5px; background: var(--line); border-radius: 99px; }
.login-balls span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ball); color: #1d1d1b; font-weight: 500; }
.login-balls .euro { background: var(--euro); color: #fff; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ===== Version 2: Optimierer ===== */
:root { --s-blue: #2a78d6; --s-orange: #eb6834; --good: #1f6b55; }
@media (prefers-color-scheme: dark) { :root { --s-blue: #3987e5; --s-orange: #d95926; --good: #5cbf9c; } }
.w10 { width: 10rem; height: 2rem; } .w12 { width: 12rem; height: 1.2em; }
h3 { margin: 0 0 .5rem; font-size: 1.12rem; font-weight: 600; letter-spacing: -0.01em; }
.small { font-size: .85rem; }

/* Hero */
.hero { display: grid; gap: 22px; }
@media (min-width: 720px) { .hero { grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; } }
.hero h2 { font-size: 1.5rem; }
.jackpot { font-size: clamp(2.2rem, 9vw, 3.2rem); font-weight: 650; letter-spacing: -0.04em; margin-top: 14px; line-height: 1; }
.hero-side { padding: 18px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.signal-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; padding: 4px 10px 4px 6px; border-radius: 99px; }
.signal-badge svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.signal-badge.good { color: var(--good); background: color-mix(in oklab, var(--good) 14%, transparent); }
.signal-badge.mid { color: var(--mid); background: color-mix(in oklab, var(--mid) 14%, transparent); }
.signal-badge.low { color: var(--warn); background: color-mix(in oklab, var(--warn) 14%, transparent); }
.signal-num { font-size: 2.4rem; font-weight: 650; letter-spacing: -0.03em; margin-top: 10px; line-height: 1.1; }
.signal-num span { font-size: 1rem; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.signal-text { font-size: .85rem; color: var(--ink-2); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Felder */
.fields { display: grid; gap: 16px; }
@media (min-width: 760px) { .fields { grid-template-columns: 1fr 1fr; } }
.field { padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); min-width: 0; }
.field .balls { margin: 2px 0 14px; }
.facts { margin: 0; display: grid; gap: 10px; }
.facts div { display: grid; gap: 1px; }
.facts dt { font-size: .78rem; color: var(--ink-3); }
.facts dd { margin: 0; font-size: 1.15rem; font-weight: 600; }
.facts small { font-family: 'Geist', sans-serif; font-weight: 400; font-size: .8rem; color: var(--ink-2); }
.facts small.up { color: var(--s-blue); font-weight: 500; } .facts small.down { color: var(--s-orange); font-weight: 500; }
.notes { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; font-size: .88rem; color: var(--ink-2); }
.notes li { padding-left: 14px; position: relative; }
.notes li::before { content: ''; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; border-radius: 50%; }
.notes li.warm::before { background: var(--s-orange); } .notes li.cool::before { background: var(--s-blue); }
.okline, .warnline { font-size: .86rem; margin-top: 12px; padding: 8px 10px; border-radius: 10px; }
.okline { background: color-mix(in oklab, var(--good) 12%, transparent); color: var(--ink); }
.warnline { background: color-mix(in oklab, var(--warn) 12%, transparent); color: var(--ink); }
.plan-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 4px; }
button.link { background: none; color: var(--ink-3); padding: 6px 0; margin-top: 8px; font-weight: 400; font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; }
.proposal { margin-top: 16px; padding: 18px; border-radius: 16px; background: color-mix(in oklab, var(--s-blue) 9%, var(--surface)); display: grid; gap: 14px; animation: rise .45s cubic-bezier(.16,1,.3,1); }
.prop-row .balls { margin: 2px 0 8px; }
select { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }

/* Kugeln mit Beliebtheitsfarbe */
.ball.pop.warm { box-shadow: inset 0 0 0 calc(1px + var(--t) * 2.5px) color-mix(in oklab, var(--s-orange) calc(30% + var(--t) * 70%), transparent); }
.ball.pop.cool { box-shadow: inset 0 0 0 calc(1px + var(--t) * 2.5px) color-mix(in oklab, var(--s-blue) calc(30% + var(--t) * 70%), transparent); }

/* Hebel */
.levers-intro { padding: 18px 2px 0; }
.levers-intro h2 { font-size: 1.5rem; }
.lever { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.lever > div { min-width: 0; }
.lever-no { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 600; margin-top: -2px; }
@media (max-width: 520px) { .lever { grid-template-columns: 1fr; } }
.stats { display: grid; gap: 0; margin-top: 8px; }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.stat-l { color: var(--ink-2); font-size: .92rem; }
.stat-v { display: flex; gap: 8px; align-items: baseline; white-space: nowrap; }
.stat-v .arrow { color: var(--ink-3); }
.stat-v .strong { font-weight: 650; font-size: 1.05rem; }
.stat-foot { margin-top: 8px; }
table.compact td, table.compact th { padding: 7px 10px 7px 0; }
tr.best td { font-weight: 600; }
tr.me td { background: color-mix(in oklab, var(--s-orange) 10%, transparent); }
.tag { font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: var(--line); color: var(--ink-2); font-weight: 500; }

.legend-pop { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--ink-2); margin: 12px 0 8px; }
.lp-bar { flex: 0 1 160px; height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--s-blue), var(--line) 50%, var(--s-orange)); }
.pop-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.pop-grid.euro-grid { grid-template-columns: repeat(12, 1fr); }
@media (max-width: 520px) { .pop-grid.euro-grid { grid-template-columns: repeat(6, 1fr); } }
.pcell { aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; align-content: center; line-height: 1.1; color: var(--ink); }
.pcell.warm { background: color-mix(in oklab, var(--s-orange) calc(var(--t) * 55%), var(--surface)); }
.pcell.cool { background: color-mix(in oklab, var(--s-blue) calc(var(--t) * 55%), var(--surface)); }
.pcell span { font-weight: 600; font-size: .9rem; }
.pcell small { font-family: 'Geist Mono', monospace; font-size: .58rem; opacity: .8; }
.pcell.mine { outline: 2px solid var(--ink); outline-offset: -2px; }
@media (max-width: 420px) { .pcell small { display: none; } }

/* Diagramm */
.chart { margin: 14px 0 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--ink-2); margin-bottom: 8px; }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.chart-legend i.dash { background: repeating-linear-gradient(90deg, var(--ink-3) 0 4px, transparent 4px 7px) !important; }
.chart-box { position: relative; width: 100%; }
.chart-box svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-family: 'Geist Mono', monospace; }
.chart .axis.ref { font-family: 'Geist', sans-serif; }
.chart .line { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.dash { stroke-dasharray: 5 4; stroke-width: 1.75; }
.chart .dlabel { fill: var(--ink-2); font-size: 11.5px; }
.chart .now { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .now-t { font-family: 'Geist', sans-serif; fill: var(--ink-2); }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; }
.chart .hdot { stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: crosshair; }
.tip { position: absolute; top: 8px; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: .8rem; box-shadow: var(--shadow); display: grid; gap: 3px; min-width: 170px; }
.tip span { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tip span b { margin-left: auto; color: var(--ink); }
.tip i { width: 8px; height: 8px; border-radius: 50%; }

/* Aufklapper */
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h2 { font-size: 1.15rem; }
.fold > summary::after { content: '+'; font-size: 1.4rem; color: var(--ink-3); margin-left: auto; }
.fold[open] > summary::after { content: '−'; }
.fold[open] > summary { margin-bottom: 14px; }
.method { display: grid; gap: 12px; font-size: .93rem; color: var(--ink-2); max-width: 68ch; }
.method b { color: var(--ink); }
.history { margin-top: 14px; }

.tip[hidden] { display: none; }
@media (max-width: 440px) {
  .field { padding: 14px 12px; }
  .field .ball, .proposal .ball { width: 33px; height: 33px; font-size: .92rem; }
  .field .balls, .field .euro-group, .proposal .balls, .proposal .euro-group { gap: 4px; }
  .card { padding: 20px 14px; }
}
.chart-x { font-size: .75rem; color: var(--ink-3); text-align: right; margin-top: 2px; }
