/* Essensplaner – schlicht, groß genug für den Daumen, hell und dunkel */
:root {
  color-scheme: light dark;
  --grund: light-dark(#f6f4ee, #151713);
  --karte: light-dark(#ffffff, #1f221d);
  --text: light-dark(#1d1f1b, #ecefe8);
  --leise: light-dark(#666b61, #a2a89c);
  --linie: light-dark(#dedbd2, #343830);
  --gruen: light-dark(#2f6b3f, #7fcf96);
  --gruen-hell: light-dark(#e3f0e5, #243a2a);
  --warn: light-dark(#a24a12, #f0a070);
  --rot: light-dark(#b3261e, #f28b82);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* sonst gewinnt z. B. "display: flex" der Leiste gegen hidden */
body {
  margin: 0; background: var(--grund); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
.kopf {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .6rem;
  padding: .7rem 1rem; background: var(--grund); border-bottom: 1px solid var(--linie);
}
.kopf h1 { font-size: 1.15rem; margin: 0; flex: 1; }
.hinweis { font-size: .8rem; color: var(--warn); }
main { max-width: 720px; margin: 0 auto; padding: 1rem; }
h2 { font-size: 1.25rem; margin: .2rem 0 .8rem; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 .4rem; }
.leise { color: var(--leise); font-size: .9rem; }

/* Untere Leiste (wie eine App) */
.leiste {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex;
  background: var(--karte); border-top: 1px solid var(--linie);
  padding-bottom: env(safe-area-inset-bottom);
}
.leiste button {
  flex: 1; border: 0; background: none; color: var(--leise); font-size: 1.3rem;
  padding: .45rem 0 .5rem; display: flex; flex-direction: column; align-items: center; gap: .1rem;
}
.leiste button span { font-size: .72rem; }
.leiste button.aktiv { color: var(--gruen); font-weight: 600; }

/* Karten */
.karten { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.karte {
  background: var(--karte); border: 1px solid var(--linie); border-radius: 14px; overflow: hidden;
  cursor: pointer; text-align: left; padding: 0; color: inherit; font: inherit; width: 100%;
}
.karte img, .karte .ohne-foto { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--gruen-hell); }
.karte .ohne-foto { display: grid; place-items: center; font-size: 2.5rem; }
.karte .text { padding: .6rem .8rem .8rem; }
.karte .titel { font-weight: 600; }
.karte .info { color: var(--leise); font-size: .85rem; margin-top: .2rem; }
.marke {
  display: inline-block; font-size: .75rem; padding: .05rem .45rem; border-radius: 99px;
  background: var(--gruen-hell); color: var(--gruen); margin-right: .3rem;
}
.marke.gekocht { background: var(--gruen); color: var(--karte); }
.marke.ausgelassen { background: var(--linie); color: var(--leise); }

/* Detailansicht */
.zurueck { border: 0; background: none; color: var(--gruen); font: inherit; padding: .2rem 0 .6rem; cursor: pointer; }
.titelbild { width: 100%; border-radius: 14px; max-height: 320px; object-fit: cover; }
.kasten { background: var(--gruen-hell); border-radius: 12px; padding: .7rem .9rem; margin: .8rem 0; }
.kasten .warn { color: var(--warn); }
ul.zutaten { list-style: none; padding: 0; margin: 0; }
ul.zutaten li { padding: .45rem 0; border-bottom: 1px solid var(--linie); }
ul.zutaten li.vorrat { color: var(--leise); }
ol.schritte { padding-left: 1.3rem; }
ol.schritte li { margin: .45rem 0; }
a { color: var(--gruen); }

/* Bilanz */
.punkte { font-size: 2.4rem; font-weight: 700; }
.abzeichen { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.abzeichen div { background: var(--karte); border: 1px solid var(--linie); border-radius: 10px; padding: .5rem; text-align: center; font-size: .85rem; }
.abzeichen .erreicht { border-color: var(--gruen); }
.abzeichen .zu_viel { border-color: var(--rot); }
.abzeichen b { display: block; font-size: 1.3rem; }
.balken { height: 12px; background: var(--linie); border-radius: 6px; overflow: hidden; }
.balken div { height: 100%; background: var(--gruen); }
.quest { padding: .4rem 0; }
.quest.erledigt { color: var(--leise); text-decoration: line-through; }

/* Anmeldung */
form.anmelden { display: grid; gap: .7rem; max-width: 360px; margin: 2rem auto; }
form.anmelden input, form.anmelden button {
  font: inherit; padding: .75rem .9rem; border-radius: 10px; border: 1px solid var(--linie);
  background: var(--karte); color: var(--text);
}
form.anmelden button { background: var(--gruen); color: #fff; border: 0; font-weight: 600; }
.fehler { color: var(--rot); }
.abmelden { border: 0; background: none; color: var(--leise); font: inherit; text-decoration: underline; cursor: pointer; margin-top: 2rem; }
