@font-face {
  font-family: "Fraunces";
  src: url("/static/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --green-900: #274a2c;
  --green-700: #35673e;
  --green-600: #46804f;
  --green-100: #dfe8d4;
  --green-50: #eef2e4;
  --paper: #faf8f0;
  --ink: #26301f;
  --ink-soft: #5b6350;
  --tomato: #d24a2e;
  --carrot: #e0882c;
  --corn: #e9b83d;
  --cucumber: #6da24f;
  --sky: #4a7fa5;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(38, 48, 31, .05), 0 8px 22px rgba(38, 48, 31, .07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* schmale bunte Ernte-Linie ganz oben */
body::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(90deg,
    var(--green-700) 0 30%, var(--cucumber) 30% 48%, var(--corn) 48% 64%,
    var(--carrot) 64% 82%, var(--tomato) 82% 100%);
}

.site-header {
  padding: 1.3rem clamp(1rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}

.header-nav a {
  color: var(--green-700);
  text-decoration: none;
  font-weight: 500;
  font-size: .95rem;
  padding: .4rem .9rem;
  border: 1.5px solid rgba(70, 128, 79, .35);
  border-radius: 999px;
}

.header-nav a:hover { background: rgba(70, 128, 79, .08); }

.brand {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--green-900);
  text-decoration: none;
  letter-spacing: .01em;
}

main {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.1rem 3rem;
}

/* ---------- Startansicht ---------- */

.hero {
  text-align: center;
  padding-top: clamp(2rem, 11vh, 6.5rem);
}

.hero h1 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 3rem);
  color: var(--green-900);
  margin: 0 0 .6rem;
  line-height: 1.15;
}

.hero .sub {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 36rem;
  margin: 0 auto 2.2rem;
  line-height: 1.55;
}

.start-form {
  display: flex;
  gap: .5rem;
  max-width: 42rem;
  margin: 0 auto;
  background: var(--card);
  border: 1.5px solid var(--green-100);
  border-radius: calc(var(--radius) + 6px);
  padding: .45rem;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}

.start-form:focus-within {
  border-color: var(--green-600);
  box-shadow: 0 0 0 4px rgba(70, 128, 79, .12), var(--shadow);
}

.start-form input {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1.08rem;
  padding: .75rem .9rem;
  color: var(--ink);
  outline: none;
  min-width: 0;
}

.start-form button {
  border: 0;
  background: linear-gradient(135deg, var(--green-600), var(--green-700));
  color: #f8f7f0;
  font: inherit;
  font-weight: 600;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: filter .15s;
}

.start-form button:hover { filter: brightness(1.12); }

.examples {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  justify-content: center;
}

.examples button {
  border: 1.5px solid;
  background: var(--card);
  font: inherit;
  font-size: .92rem;
  font-weight: 500;
  padding: .5rem .95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}

.examples button:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(38, 48, 31, .12);
}

.ex-green  { border-color: rgba(70,128,79,.5);  color: var(--green-700); }
.ex-tomato { border-color: rgba(210,74,46,.45); color: #b03d24; }
.ex-carrot { border-color: rgba(224,136,44,.5); color: #b76a1c; }
.ex-corn   { border-color: rgba(203,155,26,.55); color: #96700d; }
.ex-blue   { border-color: rgba(74,127,165,.45); color: #3c688a; }

/* ---------- Dialog ---------- */

.hidden { display: none !important; }

.dialog { padding-top: 2rem; }

.bubble {
  background: var(--card);
  border: 1px solid var(--green-100);
  border-left: 4px solid var(--green-600);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.3rem;
  margin-bottom: 1rem;
  animation: rise .25s ease-out;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.bubble.user {
  background: var(--green-700);
  border-color: var(--green-700);
  color: #f4f4ea;
  margin-left: clamp(2rem, 18%, 10rem);
  padding: .85rem 1.2rem;
}

.bubble .q-text {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--green-900);
  margin: 0 0 .35rem;
}

.bubble .q-explain {
  color: var(--ink-soft);
  font-size: .95rem;
  margin: 0 0 .9rem;
  line-height: 1.5;
}

.options { display: flex; flex-direction: column; gap: .5rem; }

.options button {
  text-align: left;
  border: 1.5px solid var(--green-100);
  background: var(--green-50);
  border-radius: 10px;
  padding: .7rem .95rem;
  font: inherit;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}

.options button:hover { border-color: var(--green-600); background: var(--card); }

.options .opt-label { font-weight: 600; color: var(--green-900); }

.options .opt-hint {
  display: block;
  color: var(--ink-soft);
  font-size: .88rem;
  margin-top: .15rem;
}

.freetext { display: flex; gap: .5rem; margin-top: .8rem; }

.freetext input {
  flex: 1;
  font: inherit;
  padding: .6rem .8rem;
  border: 1.5px solid var(--green-100);
  border-radius: 10px;
  background: var(--paper);
  outline: none;
  min-width: 0;
}

.freetext input:focus { border-color: var(--green-600); }

.freetext button {
  border: 0;
  background: var(--green-600);
  color: #f8f7f0;
  font: inherit;
  font-weight: 600;
  padding: .6rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
}

.freetext button:hover { background: var(--green-900); }

/* ---------- Ergebnisse ---------- */

.results-intro {
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
  color: var(--green-900);
  line-height: 1.5;
  margin: 0 0 1.1rem;
}

.section-label {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--green-700);
  margin: 1.4rem 0 .7rem;
}

.section-label.cross { color: var(--tomato); }

.cross-note {
  color: var(--ink-soft);
  font-size: .92rem;
  margin: -0.4rem 0 .8rem;
}

.shop-group { margin-bottom: 1.1rem; }

.shop-name {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  color: var(--ink);
  font-size: .98rem;
  margin: 0 0 .55rem;
}

.shop-name::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--shop-color, var(--green-600));
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .9rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--green-100);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .12s ease-out, box-shadow .12s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(38,48,31,.07), 0 14px 30px rgba(38,48,31,.11);
}

.card.cross-card { border-top: 3px solid var(--corn); }

.card .img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
}

.card .img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Platzhalter, wenn kein (ladbares) Produktbild vorhanden ist */
.card .img .ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 2.6rem;
  color: rgba(39, 74, 44, .45);
  background:
    repeating-linear-gradient(-45deg, rgba(70,128,79,.07) 0 14px, transparent 14px 28px),
    var(--green-50);
}

.card .body { padding: .8rem .95rem 1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }

.card .name { font-weight: 600; line-height: 1.3; }

.card .meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  font-size: .9rem;
  color: var(--ink-soft);
}

.card .price { font-weight: 600; color: var(--green-900); font-size: 1rem; }

.card .unavailable { color: var(--tomato); font-size: .85rem; }

.card .reason {
  font-size: .87rem;
  color: var(--ink-soft);
  line-height: 1.45;
  margin-top: .2rem;
  border-top: 1px dashed var(--green-100);
  padding-top: .5rem;
}

/* ---------- Sonstiges ---------- */

.loading {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--ink-soft);
  padding: .4rem .2rem 1rem;
}

.loading-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--carrot);
  animation: pulse 1s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: .35; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1); }
}

.error {
  background: #f9e9e4;
  border: 1px solid rgba(210, 74, 46, .35);
  color: #7c2d1c;
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  margin-bottom: 1rem;
}

.restart {
  border: 1.5px solid rgba(70, 128, 79, .45);
  background: transparent;
  color: var(--green-700);
  font: inherit;
  font-weight: 500;
  padding: .6rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  margin-top: .4rem;
}

.restart:hover { background: rgba(70, 128, 79, .08); }

.site-footer {
  padding: 1.6rem clamp(1rem, 4vw, 3rem) 2rem;
  color: var(--ink-soft);
  font-size: .82rem;
  text-align: center;
  border-top: 1px solid var(--green-100);
  background: #f4f1e6;
}

.site-footer p { max-width: 44rem; margin: 0 auto .6rem; line-height: 1.5; }

.footer-links { display: flex; gap: 1.2rem; justify-content: center; }

.footer-links a { color: var(--ink-soft); }

/* ---------- Teilen & Feedback ---------- */

.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin-top: 1.2rem;
  padding-top: .9rem;
  border-top: 1px solid var(--green-100);
}

.result-actions .hint { color: var(--ink-soft); font-size: .9rem; margin-right: .2rem; }

.result-actions button {
  border: 1.5px solid rgba(70, 128, 79, .4);
  background: transparent;
  color: var(--green-700);
  font: inherit;
  font-size: .92rem;
  font-weight: 500;
  padding: .45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}

.result-actions button:hover:not(:disabled) { background: rgba(70, 128, 79, .08); }

.result-actions button.voted {
  background: var(--green-700);
  color: #f6f4ec;
  border-color: var(--green-700);
}

.result-actions button:disabled { opacity: .55; cursor: default; }

/* ---------- Saisonkalender ---------- */

.calendar { padding-top: 1.2rem; }

.calendar h1 {
  font-family: "Fraunces", serif;
  color: var(--green-900);
  font-size: 2.1rem;
  margin-bottom: .3rem;
}

.calendar .sub { color: var(--ink-soft); margin-top: 0; }

.month-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: 1.2rem 0 1.6rem;
}

.month-nav a {
  text-decoration: none;
  color: var(--green-700);
  border: 1.5px solid var(--green-100);
  border-radius: 8px;
  padding: .35rem .65rem;
  font-size: .9rem;
  font-weight: 500;
}

.month-nav a.active {
  background: var(--green-700);
  border-color: var(--green-700);
  color: #f6f4ec;
}

.month-title {
  font-family: "Fraunces", serif;
  color: var(--green-900);
  font-size: 1.6rem;
  margin: 0 0 .4rem;
}

.cal-label {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--green-700);
  margin: 1.4rem 0 .5rem;
}

.cal-label.ernte { color: var(--tomato); }

.chip-row { display: flex; flex-wrap: wrap; gap: .45rem; }

.chip {
  text-decoration: none;
  background: var(--card);
  border: 1.5px solid var(--green-100);
  color: var(--ink);
  border-radius: 999px;
  padding: .4rem .9rem;
  font-size: .92rem;
}

.chip:hover { border-color: var(--green-600); }

.task-list { margin: 0; padding-left: 1.2rem; line-height: 1.7; color: var(--ink); }

/* ---------- Rechtsseiten ---------- */

.legal {
  padding-top: 1.5rem;
  line-height: 1.6;
}

.legal h1 {
  font-family: "Fraunces", serif;
  color: var(--green-900);
  font-size: 2rem;
}

.legal h2 {
  font-family: "Fraunces", serif;
  color: var(--green-900);
  font-size: 1.25rem;
  margin-top: 1.8rem;
}

.legal a { color: var(--green-700); }

@media (max-width: 560px) {
  .start-form { flex-direction: column; padding: .6rem; }
  .start-form button { width: 100%; padding: .8rem; }
  .bubble.user { margin-left: 1.5rem; }
}
