/* Belohnungsweg – keine Schriften oder Dateien von fremden Servern. */
/* Layout: eine schmale Handy-Spalte. Oben die Tagesroutine, darunter die aktuelle Etappe
   als Abreißkarte (Aufgaben oben, Belohnung als Abschnitt unten), dann Gutscheine und der ganze Weg. */
:root {
  --paper: #EDF2EE;
  --card: #FFFFFF;
  --ink: #14312B;
  --muted: #587068;
  --line: #C9D7D0;
  --berry: #B4235A;
  --berry-soft: #FAE3EC;
  --sun: #F0B429;
  --on-sun: #3A2900;
  --water: #2C7CC0;
  --water-soft: #DCEAF6;
  --display: "Avenir Next", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1D19;
    --card: #172A25;
    --ink: #E7F0EB;
    --muted: #9BB2A9;
    --line: #2E4A42;
    --berry: #F26A95;
    --berry-soft: #3B1E2B;
    --sun: #F3C24F;
    --on-sun: #2E2000;
    --water: #6BB1EA;
    --water-soft: #1A3145;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E1D19;
  --card: #172A25;
  --ink: #E7F0EB;
  --muted: #9BB2A9;
  --line: #2E4A42;
  --berry: #F26A95;
  --berry-soft: #3B1E2B;
  --sun: #F3C24F;
  --on-sun: #2E2000;
  --water: #6BB1EA;
  --water-soft: #1A3145;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); }
body {
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
#app {
  max-width: 540px;
  margin: 0 auto;
  padding: 28px 18px 56px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2 { font-family: var(--display); text-wrap: balance; }
h1 { font-size: 36px; line-height: 1.02; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 22px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 16px; font-weight: 600; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--water); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.leise { color: var(--muted); font-size: 14px; }

/* Kopf */
.kopf { display: flex; flex-direction: column; gap: 14px; }
.fuer {
  font-family: var(--display); font-weight: 600; font-size: 15px;
  color: var(--berry); letter-spacing: 0.02em;
}
.stempel-reihe { display: flex; flex-wrap: wrap; gap: 7px; }
.stempel-reihe li {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--line); color: var(--muted);
}
.stempel-reihe li.fertig { background: var(--sun); border-color: var(--sun); color: var(--on-sun); }
.stempel-reihe li.fertig svg { width: 14px; height: 14px; }
.stempel-reihe li.aktuell { border: 2px solid var(--berry); color: var(--berry); }
.stand { font-size: 15px; color: var(--muted); }
.stand strong { color: var(--ink); font-weight: 600; }

/* Abschnitte */
.block { display: flex; flex-direction: column; gap: 14px; }
.block-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.karte {
  background: var(--card); border-radius: 18px; padding: 18px;
  display: flex; flex-direction: column; gap: 16px;
}

/* Tageswahl */
.tagwahl { display: flex; gap: 4px; background: var(--card); border-radius: 999px; padding: 3px; }
.tagwahl button {
  border: 0; background: transparent; border-radius: 999px;
  padding: 5px 12px; font-size: 14px; font-weight: 500; color: var(--muted);
}
.tagwahl button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Wasser */
.wasser { display: flex; flex-direction: column; gap: 8px; }
.zeile-titel { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.zeile-titel h3 { font-family: var(--display); font-size: 17px; }
.glaeser { display: flex; flex-wrap: wrap; gap: 6px; }
.glas-knopf {
  border: 0; background: transparent; padding: 4px;
  width: 44px; height: 54px; display: grid; place-items: center;
}
.glas {
  width: 32px; height: 44px;
  clip-path: polygon(0 0, 100% 0, 85% 100%, 15% 100%);
  background: var(--water-soft);
  position: relative; display: block;
}
.glas::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: var(--water); transition: height 220ms ease-out;
}
.glas-knopf.voll .glas::after { height: 82%; }

/* Routinen */
.routinen { display: flex; flex-wrap: wrap; gap: 8px; }
.pille {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--line); background: transparent;
  border-radius: 999px; padding: 9px 16px 9px 10px;
  font-weight: 500; min-height: 44px;
}
.pille .kreis, .aufgabe .kreis {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--line); display: grid; place-items: center; color: transparent;
}
.kreis svg { width: 14px; height: 14px; }
.pille[aria-pressed="true"] { border-color: var(--ink); }
.pille[aria-pressed="true"] .kreis, .aufgabe[aria-pressed="true"] .kreis {
  background: var(--ink); border-color: var(--ink); color: var(--paper);
}
.tag-status { font-size: 15px; color: var(--muted); }
.tag-status.voll { color: var(--ink); font-weight: 500; }
.tag-status .marke {
  display: inline-block; background: var(--sun); color: var(--on-sun);
  font-weight: 600; font-size: 13px; border-radius: 6px; padding: 1px 8px; margin-right: 6px;
}
.naechste { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.naechste strong { color: var(--berry); font-weight: 600; }

/* Etappe als Abreißkarte */
.etappe { background: var(--card); border-radius: 18px; }
.etappe .aufgaben { padding: 8px; display: flex; flex-direction: column; }
.aufgabe {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; background: transparent; border-radius: 12px;
  padding: 12px 10px; min-height: 52px; font-weight: 500;
}
.aufgabe + .aufgabe { border-top: 1px solid var(--line); border-radius: 0; }
.aufgabe[aria-pressed="true"] .text { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.abschnitt {
  position: relative; border-top: 2px dashed var(--line);
  background: var(--berry-soft); border-radius: 0 0 18px 18px;
  padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.abschnitt::before, .abschnitt::after {
  content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--paper);
}
.abschnitt::before { left: -10px; }
.abschnitt::after { right: -10px; }
.lohn-label {
  display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--berry);
}
.lohn-text { font-family: var(--display); font-size: 19px; font-weight: 700; line-height: 1.2; }
.rest {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--berry);
}
.rest svg { width: 14px; height: 14px; }
.hinweis { font-size: 14px; color: var(--muted); max-width: 60ch; }

/* Gutscheine */
.gutscheine { display: flex; flex-direction: column; gap: 12px; }
.gutschein {
  position: relative; background: var(--berry-soft); border-radius: 16px;
  padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.gutschein::before, .gutschein::after {
  content: ""; position: absolute; top: 50%; margin-top: -10px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--paper);
}
.gutschein::before { left: -10px; }
.gutschein::after { right: -10px; }
.gutschein .quelle { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--berry); }
.knopf {
  border: 0; border-radius: 999px; background: var(--berry); color: var(--card);
  font-weight: 600; padding: 10px 18px; min-height: 44px; flex: none;
}
.knopf.zweit { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.knopf.klein { padding: 6px 12px; min-height: 36px; font-size: 14px; }
.knopf.warn { background: transparent; color: var(--berry); border: 1.5px solid var(--berry); }
.eingeloest { display: flex; flex-direction: column; gap: 2px; }
.eingeloest li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px;
}
.eingeloest .wann { color: var(--muted); font-size: 13px; }
.link-knopf { border: 0; background: transparent; color: var(--muted); text-decoration: underline; font-size: 13px; padding: 6px; }

/* Der ganze Weg */
.weg { display: flex; flex-direction: column; }
.weg li { display: grid; grid-template-columns: 32px 1fr; gap: 14px; position: relative; padding-bottom: 20px; }
.weg li::before {
  content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--line);
}
.weg li:last-child { padding-bottom: 0; }
.weg li:last-child::before { display: none; }
.weg .nr {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--line); color: var(--muted); background: var(--paper);
}
.weg .nr svg { width: 16px; height: 16px; }
.weg li.fertig .nr { background: var(--sun); border-color: var(--sun); color: var(--on-sun); }
.weg li.fertig::before { background: var(--sun); }
.weg li.aktuell .nr { border: 2px solid var(--berry); color: var(--berry); }
.weg li.gesperrt h3, .weg li.gesperrt .weg-aufgaben { color: var(--muted); }
.weg h3 { font-family: var(--display); font-size: 17px; line-height: 1.25; padding-top: 4px; }
.weg-aufgaben { font-size: 14px; color: var(--ink); margin-top: 2px; }
.weg-lohn { font-size: 14px; color: var(--berry); font-weight: 500; margin-top: 2px; }

/* Fuß */
.fuss { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 18px; }
.fuss a { color: var(--ink); font-weight: 600; }

/* Feier-Dialog */
.schleier {
  position: fixed; inset: 0; background: rgba(8, 20, 17, 0.62);
  display: grid; place-items: center; padding: 18px; z-index: 10;
}
.feier {
  background: var(--card); border-radius: 22px; padding: 26px 22px 20px; width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: 14px;
  animation: hoch 320ms cubic-bezier(.2,.9,.3,1.2);
}
.feier .quelle { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.feier .gutschein { --paper: var(--card); margin: 4px 0; padding: 22px 22px; }
.feier .gutschein::before, .feier .gutschein::after { background: var(--card); }
.frei {
  font-family: var(--display); font-weight: 800; font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--berry); border: 2.5px solid var(--berry); border-radius: 8px; padding: 2px 9px; flex: none;
  transform: rotate(-8deg);
  animation: stempeln 420ms 180ms cubic-bezier(.2,.9,.3,1.4) backwards;
}
.feier .aktionen { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
@keyframes hoch { from { transform: translateY(18px) scale(.96); opacity: .4; } }
@keyframes stempeln { from { transform: rotate(-8deg) scale(2.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .feier, .frei { animation: none; }
  .glas::after { transition: none; }
}

/* Einrichten */
.form { display: flex; flex-direction: column; gap: 26px; }
.gruppe { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.gruppe legend { font-family: var(--display); font-weight: 700; font-size: 20px; padding: 0; margin-bottom: 10px; }
.feld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.feld label, .feld-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.feld input:not([type="checkbox"]):not([type="radio"]), .reihe input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%; min-width: 0; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--card); padding: 10px 12px; min-height: 44px;
}
.reihe { display: flex; gap: 8px; align-items: center; }
.reihe .schmal { width: 76px; flex: none; }
.haken { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; min-height: 36px; }
.haken input { width: 20px; height: 20px; accent-color: var(--berry); }
.ed-etappe { background: var(--card); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ed-etappe .reihe input:not([type="checkbox"]), .ed-etappe .feld input:not([type="checkbox"]) { background: var(--paper); }
.ed-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ed-kopf strong { font-family: var(--display); font-size: 17px; }
.ed-kopf .werkzeug { display: flex; gap: 6px; }
.x {
  border: 1.5px solid var(--line); background: transparent; border-radius: 10px;
  width: 44px; height: 44px; flex: none; font-size: 18px; line-height: 1; color: var(--muted);
}
.leiste {
  position: sticky; bottom: 0; background: var(--paper); padding: 12px 0;
  display: flex; gap: 10px; border-top: 1px solid var(--line);
}
.meldung { background: var(--berry-soft); border-radius: 12px; padding: 12px 14px; font-size: 14px; }

/* Anmeldung und Zugang */
.weit { flex: 1; }
.unten { align-self: flex-end; }
.umbruch { flex-wrap: wrap; }
.schmal-form { max-width: 380px; }
.haken-reihe { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.knopf[disabled] { opacity: .55; cursor: default; }
.fuss-zeile { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }

