/* Layout und Bausteine. Farben kommen ausschließlich aus tokens.css. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
/* zwei weiche Farbflächen hinter dem Glas */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.6;
  z-index: -1;
  pointer-events: none;
}
body::before { width: 280px; height: 280px; top: -80px; right: -90px; background: var(--flaeche-a); }
body::after  { width: 240px; height: 240px; top: 45vh; left: -120px; background: var(--flaeche-b); }

h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--haupt); outline-offset: 2px; }

.inhalt {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 24px) var(--rand) calc(env(safe-area-inset-bottom) + 110px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
body.vollbild .inhalt { padding-bottom: calc(env(safe-area-inset-bottom) + 24px); min-height: 100vh; }
body.vollbild .navigation { display: none; }

/* Kopfbereich */
.kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.kopf-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dachzeile { font-size: 14px; color: var(--gedaempft); }
.titel { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.zurueck {
  align-self: flex-start; min-height: var(--tipp); display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; padding: 0; color: var(--gedaempft); font-size: 15px;
}

/* Glas-Karte */
.karte {
  background: var(--karte);
  border: 1px solid var(--karte-rand);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  border-radius: var(--radius-gross);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.karte-titel { font-size: 15px; font-weight: 600; color: var(--gedaempft); }
.zeile { display: flex; gap: 12px; align-items: baseline; }
.zeile-label { width: 82px; flex-shrink: 0; font-size: 13px; color: var(--gedaempft); }
.zeile-wert { font-size: 16px; font-weight: 500; }
.leer { color: var(--gedaempft); font-weight: 400; }

/* Knöpfe */
.knopf {
  min-height: 52px; border-radius: 18px; border: none; padding: 0 18px;
  background: var(--haupt); color: var(--auf-haupt);
  font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
}
.knopf[disabled] { opacity: 0.45; cursor: default; }
.knopf.zweit { background: var(--karte); color: var(--text); border: 1px solid var(--karte-rand); -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); }
.knopf.leise { background: var(--akzent-grund); color: var(--akzent-text); min-height: var(--tipp); font-size: 14px; border-radius: 14px; }
.knopf.gefahr { background: var(--warnung); color: #FFFFFF; }
.text-knopf { background: none; border: none; color: var(--haupt); font-weight: 600; font-size: 14px; min-height: var(--tipp); padding: 0 4px; }
.rund-knopf {
  width: var(--tipp); height: var(--tipp); flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--karte); border: 1px solid var(--karte-rand); color: var(--gedaempft);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
}
.rund-knopf.voll { background: var(--haupt); color: var(--auf-haupt); border: none; }
.rund-knopf.umrandet { background: transparent; border: 1.5px solid var(--haupt); color: var(--haupt); font-size: 13px; font-weight: 600; }

/* Umschalter (Segmente) */
.segmente { display: flex; padding: 3px; border-radius: 99px; background: var(--spur); gap: 2px; }
.segmente button {
  flex: 1; min-height: 38px; border: none; border-radius: 99px; background: transparent;
  font-size: 13px; font-weight: 600; padding: 0 6px; white-space: nowrap;
}
.segmente button[aria-pressed="true"] { background: var(--haupt); color: var(--auf-haupt); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 600; border-radius: 99px; padding: 3px 10px; background: var(--akzent-grund); color: var(--akzent-text); }
.chip.rand { background: transparent; border: 1px solid var(--linie); color: var(--gedaempft); }
.hinweis { align-self: flex-start; }

/* Liste (Woche, Rezepte) */
.liste { display: flex; flex-direction: column; gap: 6px; }
.eintrag {
  position: relative; overflow: hidden; border-radius: 16px;
  background: var(--karte); border: 1px solid var(--karte-rand);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
}
.eintrag.gewaehlt { outline: 2px solid var(--haupt); outline-offset: -2px; }
.eintrag-vorne {
  position: relative; z-index: 1; width: 100%; min-height: 52px;
  display: flex; align-items: center; gap: 12px; padding: 6px 14px;
  background: transparent; border: none; text-align: left; touch-action: pan-y;
  transition: transform 0.2s ease;
}
.eintrag.offen .eintrag-vorne, .eintrag.zieht .eintrag-vorne { background: var(--karte-fest); }
.eintrag.zieht .eintrag-vorne { transition: none; }
.eintrag-hinten {
  visibility: hidden;
  position: absolute; right: 0; top: 0; bottom: 0; width: 92px; border: none;
  background: var(--warnung); color: #FFFFFF; font-weight: 600; font-size: 14px;
}
.eintrag.offen .eintrag-hinten, .eintrag.zieht .eintrag-hinten { visibility: visible; }
.tag { width: 28px; flex-shrink: 0; font-weight: 600; }
.eintrag-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.eintrag-name { font-size: 15px; font-weight: 500; }
.eintrag-meta { font-size: 13px; color: var(--gedaempft); }
.eintrag-plus { color: var(--haupt); font-weight: 600; }
.rezept-karte { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; }

/* Tagesleiste (Woche planen) */
.tagesleiste { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.tagesleiste span {
  min-height: 30px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; background: var(--spur); color: var(--gedaempft);
}
.tagesleiste span.belegt { background: var(--haupt); color: var(--auf-haupt); }

/* Suche */
.suche {
  min-height: var(--tipp); border-radius: 14px; border: 1px solid var(--karte-rand);
  background: var(--karte); padding: 0 14px; font-size: 16px;
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
}

/* Rezept-Details */
.zutatenliste { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.zutatenliste li { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.zutatenliste .menge { color: var(--gedaempft); white-space: nowrap; }
.schrittliste { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }

/* Kochmodus */
.koch-bild {
  position: fixed; left: 0; right: 0; top: 0; height: 46vh; z-index: -1;
  width: 100%; object-fit: cover; filter: blur(2px); opacity: 0.85;
  -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent);
  mask-image: linear-gradient(to bottom, #000 35%, transparent);
}
.koch-abstand { height: 22vh; }
.fortschritt { height: 4px; border-radius: 99px; background: var(--spur); overflow: hidden; }
.fortschritt div { height: 4px; background: var(--haupt); border-radius: 99px; }
.koch-zutaten { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; }
.koch-zutaten .menge { color: var(--gedaempft); }
.koch-text { font-size: 26px; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; }
.koch-unten { display: flex; gap: 10px; margin-top: auto; }
.koch-unten .knopf { flex: 1; min-height: 64px; }
.koch-unten .knopf:last-child { flex: 2; }
.timer-laeuft { background: var(--akzent-grund); }

/* Navigation unten */
.navigation {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  width: calc(100% - 40px); max-width: 520px;
  display: flex; padding: 6px; border-radius: 24px;
  background: var(--karte); border: 1px solid var(--karte-rand);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.navigation a {
  flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--gedaempft); font-size: 12px; font-weight: 600; border-radius: 18px;
}
.navigation a[aria-current="page"] { color: var(--haupt); }

.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon.klein { width: 18px; height: 18px; }

.meldung {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 92px);
  background: var(--text); color: var(--grund); padding: 10px 16px; border-radius: 14px; font-size: 14px;
  max-width: calc(100% - 40px); z-index: 10;
}
.versteckt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.feld { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--gedaempft); }
.erklaerung { font-size: 13px; color: var(--gedaempft); }

/* Chip-Leiste (Filter, waagerecht scrollbar) */
.chip-leiste { display: flex; gap: 6px; overflow-x: auto; margin: 0 calc(-1 * var(--rand)); padding: 2px var(--rand); scrollbar-width: none; }
.chip-leiste::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0; min-height: 36px; padding: 0 14px; border-radius: 99px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--karte-rand); background: var(--karte); color: var(--text);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
}
.filter-chip[aria-pressed="true"] { background: var(--haupt); color: var(--auf-haupt); border-color: transparent; }

/* Ideen: eine große Karte pro Vorschlag */
.idee-karte {
  position: relative; overflow: hidden; border-radius: 28px; min-height: 50vh;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--karte-fest); border: 1px solid var(--karte-rand);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: pointer;
  transition: transform 0.18s ease;
}
.idee-karte.zieht { transition: none; }
.idee-bild { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
/* Illustration statt Foto: freigestellt oben auf weicher Farbfläche */
.idee-karte:has(.illu) { background: linear-gradient(160deg, var(--flaeche-a), var(--karte-fest) 75%); }
.idee-bild.illu { inset: 3% 10% auto; width: 80%; height: 46%; object-fit: contain; }
.idee-karte::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, transparent 30%, var(--grund) 88%);
}
.idee-text { position: relative; z-index: 1; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.idee-titel { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; }
.idee-kurz { font-size: 16px; }
.idee-knoepfe { display: flex; justify-content: center; gap: 18px; }
.rund-knopf.gross { width: 56px; height: 56px; }
.rund-knopf[disabled] { opacity: 0.35; }
.idee-ende { min-height: 40vh; justify-content: center; text-align: center; align-items: center; }
.text-knopf.hell { color: var(--grund); text-decoration: underline; min-height: auto; }
@media (prefers-reduced-motion: reduce) { .idee-karte, .eintrag-vorne { transition: none; } }

/* Woche planen */
.eintrag-meta.eingeplant { color: var(--haupt); font-weight: 600; }
.fertig-leiste { position: sticky; bottom: calc(env(safe-area-inset-bottom) + 92px); z-index: 2; }
.idee-karte .chip { background: var(--grund); color: var(--haupt); }
.fertig-leiste .knopf { width: 100%; }

/* Startanimation (A1: Zutaten fallen in die Bowl) */
.start {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--grund); transition: opacity 0.28s ease;
}
.start.weg { opacity: 0; pointer-events: none; }
.start-bowl { overflow: visible; }
.start-bowl .p { fill: var(--haupt); }
.start-bowl .korn { fill: var(--grund); }
.start-name { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.start .f, .start .p { transform-box: fill-box; transform-origin: center; }
.start.voll .f { opacity: 0; animation: start-fall 0.55s cubic-bezier(.3, 1.5, .5, 1) forwards; }
.start.voll .p { opacity: 0; animation: start-pop 0.45s ease-out forwards; }
.start.voll .start-name { opacity: 0; animation: start-name 0.6s 1s ease-out forwards; }
.start.kurz { animation: start-name 0.25s ease-out; }
.start.voll .v1 { animation-delay: .15s; } .start.voll .v2 { animation-delay: .25s; } .start.voll .v3 { animation-delay: .35s; }
.start.voll .v4 { animation-delay: .45s; } .start.voll .v5 { animation-delay: .5s; } .start.voll .v6 { animation-delay: .6s; }
.start.voll .v7 { animation-delay: .68s; } .start.voll .v8 { animation-delay: .72s; } .start.voll .v9 { animation-delay: .76s; }
.start.voll .v10 { animation-delay: .8s; }
@keyframes start-fall { 0% { opacity: 0; transform: translateY(-140px) rotate(-20deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes start-pop { 0% { opacity: 0; transform: scale(.3); } 70% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }
@keyframes start-name { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 0.4.0: Vorkochen, Heute Abend, Tagesansicht, Protein-Hinweise */
.knopf-reihe { display: flex; gap: 10px; }
.knopf-reihe .knopf { flex: 1; }
.mini-bild { width: 48px; height: 48px; flex-shrink: 0; border-radius: var(--radius-klein); background: var(--spur); object-fit: contain; }
.rezept-karte.mit-bild { padding-left: 10px; }
.idee-zeile { display: flex; align-items: center; gap: 10px; }
.idee-zeile .knopf.leise { flex-shrink: 0; padding: 0 10px; min-height: 36px; font-size: 13px; border-radius: 12px; }
.idee-zeile .eintrag-name { line-height: 1.25; }
.warnhinweis, .eintrag-meta.warnhinweis { color: var(--warnung-bogen); font-size: 13px; font-weight: 600; }
.protein-hinweis {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 13px; padding: 6px 6px 6px 12px; border-radius: var(--radius-klein);
  background: var(--akzent-grund); color: var(--akzent-text);
}
.protein-hinweis .text-knopf { flex-shrink: 0; }
.protein-hinweis .erklaerung { color: inherit; flex-shrink: 0; }
.tagesleiste span.vorbei { opacity: 0.4; }
.eintrag.vorbei { opacity: 0.55; }
.tag-karte { gap: 8px; }
.tag-karte.vorbei { opacity: 0.55; }
.tag-karte.heute { outline: 2px solid var(--haupt); outline-offset: -2px; }
.tag-karte .zeile { min-height: 30px; align-items: center; }
.tag-karte .karte-titel { color: var(--text); }
.vorkoch-karte { border: 1.5px solid var(--haupt); gap: 6px; }
.vorkoch-karte .text-knopf { display: inline-flex; align-items: center; gap: 2px; padding: 0; align-self: flex-start; }
a.protein-hinweis { padding: 10px 12px; }
.rezept-bild { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-gross); }
.mini-bild[src$="-klein.webp"] { object-fit: cover; }
