/* Flohmarkt Rastede */
:root {
  --grund: #1d1b2e;
  --flaeche: #2a2740;
  --flaeche2: #35314f;
  --text: #f4f2ff;
  --leise: #b4aed6;
  --akzent: #ffd24a;
  --gruen: #25d366;
  --rot: #ff6b6b;
  --radius: 14px;
  --oben: env(safe-area-inset-top, 0px);
  --unten: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(180deg, #2b2050 0%, var(--grund) 320px);
  background-color: var(--grund);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(76px + var(--unten));
}
[hidden] { display: none !important; }

.kopf {
  display: flex; align-items: center; gap: 12px;
  padding: calc(14px + var(--oben)) 16px 10px;
}
.logo { width: 96px; height: auto; flex: 0 0 auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.kopf h1 { font-size: 24px; margin: 0; letter-spacing: .3px; }
.unterzeile { margin: 2px 0 0; color: var(--akzent); font-size: 13px; font-weight: 600; }

main { max-width: 760px; margin: 0 auto; padding: 0 12px; }
h2 { font-size: 20px; margin: 8px 4px 14px; }

/* Suche und Kategorien */
.suche input {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border-radius: var(--radius); border: 1px solid var(--flaeche2);
  background: var(--flaeche); color: var(--text);
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--flaeche2); background: var(--flaeche);
  color: var(--text); padding: 8px 14px; border-radius: 999px; font-size: 14px;
}
.chip.an { background: var(--akzent); color: #222; border-color: var(--akzent); font-weight: 700; }

/* Raster der Anzeigen */
.raster { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .raster { grid-template-columns: repeat(3, 1fr); } }
.karte {
  background: var(--flaeche); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
  border: 1px solid transparent;
}
.karte:active { border-color: var(--akzent); }
.karte .bild { aspect-ratio: 1 / 1; background: var(--flaeche2) center / cover no-repeat; display: grid; place-items: center; font-size: 36px; }
.karte .info { padding: 8px 10px 10px; }
.karte .titel { font-size: 14px; line-height: 1.3; max-height: 2.6em; overflow: hidden; }
.preis-text { color: var(--akzent); font-weight: 700; font-size: 15px; margin-top: 4px; }
.preis-text.frei { color: var(--gruen); }

.hinweis { text-align: center; color: var(--leise); padding: 30px 10px; }
.klein { font-size: 12px; color: var(--leise); margin: 6px 0 0; }
.fehler { color: var(--rot); background: rgba(255,107,107,.12); padding: 10px 12px; border-radius: 10px; }

/* Knöpfe */
.knopf {
  display: block; width: 100%; text-align: center; text-decoration: none;
  background: var(--akzent); color: #222; border: 0; border-radius: var(--radius);
  padding: 14px; font-size: 16px; font-weight: 700; margin-top: 12px; cursor: pointer;
}
.knopf.zweit { background: var(--flaeche2); color: var(--text); font-weight: 600; }
.knopf.wa { background: var(--gruen); color: #fff; }
.knopf.rot { background: transparent; color: var(--rot); border: 1px solid var(--rot); }
.knopf:disabled { opacity: .6; }
.zurueck { background: none; border: 0; color: var(--akzent); font-size: 16px; padding: 8px 4px; cursor: pointer; }

/* Detailansicht */
.galerie { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius); background: var(--flaeche2); }
.galerie img { flex: 0 0 100%; width: 100%; max-height: 70vh; object-fit: contain; scroll-snap-align: center; background: #000; }
.galerie .leer { width: 100%; aspect-ratio: 4/3; display: grid; place-items: center; font-size: 60px; }
.punkte { text-align: center; color: var(--leise); font-size: 12px; margin-top: 6px; }
.detail h2 { margin: 14px 0 4px; }
.detail .preis-text { font-size: 22px; }
.merkmale { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.merkmale span { background: var(--flaeche2); padding: 5px 10px; border-radius: 999px; font-size: 13px; }
.beschreibung { white-space: pre-wrap; line-height: 1.5; background: var(--flaeche); padding: 12px 14px; border-radius: var(--radius); }
.datum { color: var(--leise); font-size: 12px; margin-top: 10px; }

/* Formular */
form label, .feldgruppe { display: block; margin-bottom: 14px; font-size: 14px; color: var(--leise); }
.feldname { display: block; margin-bottom: 6px; }
form input:not([type=checkbox]):not([type=radio]), form select, form textarea {
  display: block; width: 100%; margin-top: 6px; padding: 12px; font-size: 16px;
  border-radius: 10px; border: 1px solid var(--flaeche2); background: var(--flaeche); color: var(--text);
  font-family: inherit;
}
.feldgruppe > input { margin-top: 0 !important; }
.umschalter { display: flex; gap: 8px; }
.umschalter label { flex: 1; margin: 0; background: var(--flaeche); border-radius: 10px; padding: 10px; color: var(--text); text-align: center; }
.umschalter input { margin-right: 6px; }
.preis { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.preis input { margin-top: 0 !important; }
.preis span { font-size: 18px; color: var(--text); }
.haken { color: var(--text) !important; display: flex !important; align-items: center; gap: 10px; padding: 6px 0; margin: 0 !important; }
.haken input { width: 22px; height: 22px; accent-color: var(--akzent); }
.foto-vorschau { display: flex; gap: 8px; flex-wrap: wrap; }
.foto-vorschau .stueck { position: relative; width: 96px; height: 96px; border-radius: 10px; background: center / cover no-repeat var(--flaeche2); }
.foto-vorschau .weg { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--rot); color: #fff; font-weight: 700; }
.foto-knopf { margin-top: 8px !important; }
.falle { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Meine */
.zeile { display: flex; gap: 8px; align-items: center; }
.zeile input { flex: 1; margin: 0 !important; }
.zeile .knopf { width: auto; margin: 0; padding: 12px 16px; }
.meine-liste { margin-top: 14px; display: grid; gap: 10px; }
.meine-eintrag { display: flex; gap: 10px; align-items: center; background: var(--flaeche); border-radius: var(--radius); padding: 8px; }
.meine-eintrag .mini { width: 60px; height: 60px; border-radius: 10px; background: center / cover no-repeat var(--flaeche2); flex: 0 0 auto; display: grid; place-items: center; }
.meine-eintrag .mitte { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.meine-eintrag .mitte div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meine-eintrag .knopf { width: auto; margin: 0; padding: 8px 12px; font-size: 14px; }

/* Untere Leiste */
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: rgba(29, 27, 46, .96); border-top: 1px solid var(--flaeche2);
  padding-bottom: var(--unten); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.leiste a { flex: 1; text-align: center; color: var(--leise); text-decoration: none; font-size: 12px; padding: 8px 0 10px; }
.leiste a .sym { display: block; font-size: 22px; line-height: 28px; }
.leiste a.an { color: var(--akzent); }

/* Einführung */
.einfuehrung {
  position: fixed; inset: 0; z-index: 30; background: rgba(10, 8, 22, .78);
  display: flex; align-items: center; justify-content: center;
  padding: calc(12px + var(--oben)) 12px calc(12px + var(--unten));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.ef-karte {
  position: relative; width: 100%; max-width: 420px; max-height: 100%;
  background: linear-gradient(180deg, #34275f, var(--flaeche)); border-radius: 20px;
  padding: 18px 18px 16px; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.ef-zu { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--leise); font-size: 30px; line-height: 1; padding: 4px 8px; cursor: pointer; }
.ef-seiten { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ef-seite { text-align: center; padding: 6px 4px; }
.ef-seite h2 { margin: 10px 0 10px; font-size: 21px; }
.ef-seite p { line-height: 1.45; margin: 8px 0; }
.ef-logo { width: 140px; height: auto; margin-top: 6px; }
.ef-gross { font-size: 52px; line-height: 1; margin-top: 10px; color: var(--akzent); }
.ef-schritte { list-style: none; padding: 0; margin: 10px 0; text-align: left; counter-reset: s; }
.ef-schritte li { display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,.2); border-radius: 12px; padding: 10px; margin-bottom: 8px; line-height: 1.35; }
.ef-bild { flex: 0 0 44px; height: 44px; border-radius: 10px; background: #fff; color: #007aff; display: grid; place-items: center; }
.ef-bild svg { width: 26px; height: 26px; }
.ef-geraet[data-geraet=android] .ef-bild { color: #3c4043; }
.ef-bild-icon { background: none; }
.ef-bild-icon img { width: 44px; height: 44px; border-radius: 10px; }
.ef-fertig { background: rgba(37,211,102,.15); border-radius: 12px; padding: 10px; }
.ef-punkte { display: flex; justify-content: center; gap: 8px; margin: 10px 0 2px; }
.ef-punkte span { width: 8px; height: 8px; border-radius: 50%; background: var(--flaeche2); }
.ef-punkte span.an { background: var(--akzent); }
.ef-knoepfe { display: flex; gap: 10px; }
.ef-knoepfe .knopf { margin-top: 8px; }
.ef-knoepfe .knopf.zweit { flex: 0 0 38%; }

.meldung {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + var(--unten)); z-index: 20;
  background: #fff; color: #222; padding: 10px 16px; border-radius: 999px; font-size: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.4);
  max-width: 90vw; text-align: center;
}
