/* Freistück – Design-Tokens und Oberfläche
   Farben: warmes Grün (verschenken), Pappkarton-Amber (Regeln), gedecktes Rot (Warnung) */
:root{
  --bg:#EDF1EA; --surface:#FBFCF8; --surface-2:#F2F5EE; --ink:#212A20; --muted:#5D6A5A;
  --line:#D8DED1; --accent:#2F7D4E; --accent-strong:#27693F; --accent-soft:#DCEBDD;
  --accent-ink:#F4FBF5; --amber:#A9741F; --amber-soft:#F4E7CB; --card-tape:#E8D9B4;
  --danger:#B8433A; --danger-soft:#F6E0DC; --sticker:#FBF6E8;
  --shadow:0 18px 45px rgba(35,48,34,.16), 0 4px 12px rgba(35,48,34,.10);
  --pin-ring:#FFFFFF; --you:#3B6FB4; --focus:#2F7D4E;
  --display:"Bricolage Grotesque","Avenir Next","Trebuchet MS",system-ui,sans-serif;
  --body:"Schibsted Grotesk","Segoe UI",system-ui,sans-serif;
  --hand:"Caveat","Segoe Script",cursive;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#131810; --surface:#1C231A; --surface-2:#222B20; --ink:#E7EDE2; --muted:#9CAA95;
    --line:#323C2F; --accent:#6CBE8B; --accent-strong:#84D3A2; --accent-soft:#26382A;
    --accent-ink:#0D2015; --amber:#D9A85B; --amber-soft:#3A3120; --card-tape:#4A4028;
    --danger:#E07C6F; --danger-soft:#3E2723; --sticker:#2A2C22;
    --shadow:0 18px 45px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.35);
    --pin-ring:#2E3830; --you:#7FA8DC; --focus:#6CBE8B;
  }
}
:root[data-theme="dark"]{
  --bg:#131810; --surface:#1C231A; --surface-2:#222B20; --ink:#E7EDE2; --muted:#9CAA95;
  --line:#323C2F; --accent:#6CBE8B; --accent-strong:#84D3A2; --accent-soft:#26382A;
  --accent-ink:#0D2015; --amber:#D9A85B; --amber-soft:#3A3120; --card-tape:#4A4028;
  --danger:#E07C6F; --danger-soft:#3E2723; --sticker:#2A2C22;
  --shadow:0 18px 45px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.35);
  --pin-ring:#2E3830; --you:#7FA8DC; --focus:#6CBE8B;
}
*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{background:var(--bg);color:var(--ink);font-family:var(--body);font-size:16px;line-height:1.5;
  min-height:100dvh;overflow:hidden}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--focus);outline-offset:2px;border-radius:6px}
::placeholder{color:var(--muted);opacity:.8}
.hidden{display:none !important}

/* Grundgerüst: App füllt den Bildschirm, auf großen Schirmen zentriert */
.app{display:flex;flex-direction:column;height:100dvh;max-width:520px;margin:0 auto;
  background:var(--surface);position:relative;overflow:hidden}
@media (min-width:560px){ .app{border-left:1px solid var(--line);border-right:1px solid var(--line)} }

.appbar{display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:12px 16px 8px;flex:0 0 auto;border-bottom:1px solid transparent}
.logo{font-family:var(--display);font-weight:800;font-size:21px;letter-spacing:-.01em}
.logo .dot{color:var(--accent)}
.barbtns{display:flex;gap:8px;align-items:center}
.iconbtn{width:34px;height:34px;border-radius:50%;border:1px solid var(--line);background:var(--surface);
  display:inline-flex;align-items:center;justify-content:center;color:var(--muted);flex:0 0 auto}
.iconbtn:hover{color:var(--ink);border-color:var(--muted)}
.iconbtn svg{width:17px;height:17px}
.textbtn{font-size:13.5px;font-weight:700;color:var(--accent-strong);padding:6px 10px;border-radius:99px}
.textbtn:hover{background:var(--accent-soft)}

.screens{flex:1 1 auto;position:relative;overflow:hidden}
.screen{position:absolute;inset:0;display:none;flex-direction:column}
.screen.active{display:flex}

/* Karte */
#map{position:absolute;inset:0}
.mapwrap{position:relative;flex:1;overflow:hidden;background:var(--surface-2)}
.map-ctl{position:absolute;top:12px;left:12px;right:12px;display:flex;justify-content:space-between;
  gap:8px;align-items:flex-start;pointer-events:none;z-index:5}
.seg{display:inline-flex;background:var(--surface);border:1px solid var(--line);border-radius:99px;
  padding:3px;box-shadow:0 3px 10px rgba(35,48,34,.14);pointer-events:auto}
.seg button{border-radius:99px;padding:6px 13px;font-size:13.5px;font-weight:500;color:var(--muted);white-space:nowrap}
.seg button[aria-pressed="true"]{background:var(--accent);color:var(--accent-ink);font-weight:700}
.countchip{pointer-events:auto;background:var(--surface);border:1px solid var(--line);border-radius:99px;
  padding:7px 13px;font-size:12.5px;font-weight:500;color:var(--muted);box-shadow:0 3px 10px rgba(35,48,34,.14)}
.countchip b{color:var(--ink);font-weight:700;font-variant-numeric:tabular-nums}
.mapbtns{position:absolute;right:12px;bottom:16px;z-index:5;display:flex;flex-direction:column;gap:8px}
.mapbtns .iconbtn{width:40px;height:40px;background:var(--surface);box-shadow:0 3px 10px rgba(35,48,34,.18)}
.mapbtns .iconbtn svg{width:19px;height:19px}

/* Marker */
.pin{width:44px;height:52px;display:flex;align-items:flex-start;justify-content:center;cursor:pointer;
  background:none;border:0;padding:0}
.pin .tile{width:40px;height:40px;border-radius:12px;border:2.5px solid var(--pin-ring);overflow:hidden;
  box-shadow:0 4px 10px rgba(20,30,20,.3);position:relative;transition:transform .15s ease;background:var(--surface-2)}
.pin .tile img{width:100%;height:100%;object-fit:cover;display:block}
.pin::after{content:"";position:absolute;left:50%;top:40px;width:9px;height:9px;background:var(--pin-ring);
  transform:translateX(-50%) rotate(45deg);border-radius:2px;box-shadow:2px 2px 4px rgba(20,30,20,.2)}
.pin:hover .tile{transform:scale(1.1)}
.cluster{width:40px;height:40px;border-radius:50%;background:var(--accent);color:var(--accent-ink);
  border:2.5px solid var(--pin-ring);display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:14px;cursor:pointer;box-shadow:0 4px 10px rgba(20,30,20,.3);font-variant-numeric:tabular-nums}
.mefix{width:16px;height:16px;border-radius:50%;background:var(--you);border:3px solid var(--pin-ring);
  box-shadow:0 0 0 6px rgba(59,111,180,.18)}
.maplibregl-ctrl-attrib{font-size:10px}

/* Galerie */
.toolbar{padding:6px 16px 10px;display:flex;flex-direction:column;gap:9px;flex:0 0 auto}
.search{display:flex;align-items:center;gap:8px;background:var(--surface-2);border:1px solid var(--line);
  border-radius:13px;padding:9px 12px}
.search svg{width:16px;height:16px;color:var(--muted);flex:0 0 auto}
.search input{border:0;background:none;outline:none;width:100%;font-size:14.5px}
.togglerow{display:flex;gap:8px;align-items:center;justify-content:space-between}
.sort{border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:99px;
  padding:6px 10px;font-size:13px;font-weight:500}
.chiprow{display:flex;gap:7px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.chiprow::-webkit-scrollbar{display:none}
.fchip{flex:0 0 auto;font-size:12.5px;font-weight:500;color:var(--muted);border:1px solid var(--line);
  border-radius:99px;padding:5px 12px;background:var(--surface);white-space:nowrap}
.fchip[aria-pressed="true"]{background:var(--accent-soft);color:var(--accent-strong);border-color:var(--accent);font-weight:700}
.gallery{flex:1;overflow-y:auto;padding:2px 16px 20px;-webkit-overflow-scrolling:touch}
.gcount{font-size:12.5px;color:var(--muted);padding:2px 2px 9px}
.gcount b{color:var(--ink);font-variant-numeric:tabular-nums}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (min-width:440px){ .grid{grid-template-columns:repeat(3,1fr)} }
.card{text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:16px;
  overflow:hidden;padding:0;display:flex;flex-direction:column;transition:transform .15s ease,box-shadow .15s ease}
.card:hover{transform:translateY(-2px);box-shadow:0 8px 20px rgba(35,48,34,.14)}
.card .ph{aspect-ratio:4/3.1;border-bottom:1px solid var(--line);background:var(--surface-2)}
.card .ph img{width:100%;height:100%;object-fit:cover;display:block}
.card .body{padding:9px 11px 11px;display:flex;flex-direction:column;gap:3px}
.card h3{font-family:var(--body);font-weight:700;font-size:13.5px;line-height:1.3;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.card .meta{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.card .meta b{color:var(--accent-strong);font-weight:700}
.empty{text-align:center;padding:44px 20px;color:var(--muted)}
.empty .hand{font-family:var(--hand);font-size:24px;color:var(--amber);display:block;margin-top:6px;transform:rotate(-2deg)}
.skeleton{background:linear-gradient(90deg,var(--surface-2),var(--line),var(--surface-2));
  background-size:200% 100%;animation:sk 1.3s linear infinite;border-radius:16px;aspect-ratio:4/4.6}
@keyframes sk{0%{background-position:200% 0}100%{background-position:-200% 0}}

/* Formulare & Flows */
.flow{flex:1;overflow-y:auto;padding:6px 18px 24px;display:flex;flex-direction:column;gap:14px}
.steps{display:flex;gap:6px;align-items:center;justify-content:center;padding-top:2px}
.stepdot{width:26px;height:26px;border-radius:50%;border:1.5px solid var(--line);color:var(--muted);
  font-size:12.5px;font-weight:700;display:flex;align-items:center;justify-content:center;font-variant-numeric:tabular-nums}
.stepdot.on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.stepbar{width:26px;height:1.5px;background:var(--line)}
h2.title{font-family:var(--display);font-weight:800;font-size:22px;letter-spacing:-.01em;text-wrap:balance}
.lead{color:var(--muted);font-size:14px;margin-top:4px}
.cardboard{background:var(--amber-soft);border:1px solid var(--card-tape);border-radius:14px;
  padding:18px 16px 16px;position:relative;transform:rotate(-.6deg)}
.cardboard::before,.cardboard::after{content:"";position:absolute;top:-9px;width:58px;height:18px;
  background:var(--card-tape);opacity:.75;border-radius:2px}
.cardboard::before{left:22px;transform:rotate(-5deg)}
.cardboard::after{right:22px;transform:rotate(4deg)}
.cardboard h3{font-family:var(--hand);font-weight:700;font-size:26px;color:var(--amber);margin-bottom:10px;transform:rotate(-1deg)}
.rule{display:flex;gap:11px;padding:9px 0;border-top:1px dashed var(--card-tape);font-size:14px;line-height:1.45}
.rule:first-of-type{border-top:0}
.rule .ic{flex:0 0 auto;width:30px;height:30px;border-radius:9px;background:var(--surface);
  border:1px solid var(--card-tape);display:flex;align-items:center;justify-content:center;font-size:15px}
.rule b{display:block}
.rule small{color:var(--muted);font-size:12.5px;display:block;margin-top:1px}
.rule .warn{color:var(--danger);font-weight:700}
.agree{display:flex;flex-direction:column;gap:9px}
.agree label{display:flex;gap:10px;align-items:flex-start;background:var(--surface-2);border:1px solid var(--line);
  border-radius:12px;padding:11px 12px;font-size:13.5px;font-weight:500;cursor:pointer;line-height:1.4}
.agree input{width:18px;height:18px;accent-color:var(--accent);margin-top:1px;flex:0 0 auto}
.btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;background:var(--accent);
  color:var(--accent-ink);font-weight:700;font-size:15.5px;border-radius:14px;padding:14px;
  text-decoration:none;transition:background .15s ease}
.btn:hover{background:var(--accent-strong)}
.btn:disabled{opacity:.4;cursor:not-allowed}
.btn.ghost{background:var(--surface);color:var(--ink);border:1px solid var(--line);font-weight:500}
.btn.ghost:hover{border-color:var(--muted);background:var(--surface-2)}
.btn.dangerghost{background:var(--surface);color:var(--danger);border:1px solid var(--line);font-weight:500}
.btn.dangerghost:hover{border-color:var(--danger);background:var(--danger-soft)}
.field{display:flex;flex-direction:column;gap:5px}
.field label{font-size:12.5px;font-weight:700;color:var(--muted);letter-spacing:.04em;text-transform:uppercase}
.field input,.field select,.field textarea{border:1px solid var(--line);background:var(--surface);border-radius:12px;
  padding:11px 12px;font-size:14.5px;outline:none;width:100%;font-family:inherit}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--accent)}
.field textarea{resize:vertical;min-height:64px}
.formnote{font-size:12.5px;color:var(--muted);line-height:1.45;display:flex;gap:8px}
.formnote span:first-child{flex:0 0 auto}
.errbox{background:var(--danger-soft);border:1px solid var(--danger);color:var(--danger);border-radius:12px;
  padding:10px 12px;font-size:13.5px;font-weight:600}
.okbox{background:var(--accent-soft);border:1px solid var(--accent);color:var(--accent-strong);border-radius:12px;
  padding:10px 12px;font-size:13px;font-weight:700;display:flex;gap:9px;align-items:center;font-variant-numeric:tabular-nums}

/* Kamera */
.finder{border-radius:18px;background:var(--surface-2);border:1px dashed var(--muted);position:relative;
  aspect-ratio:4/3.4;flex:0 0 auto;display:flex;align-items:center;justify-content:center;overflow:hidden}
.finder video,.finder img{width:100%;height:100%;object-fit:cover;display:block}
.finder .corner{position:absolute;width:22px;height:22px;border:2.5px solid var(--muted);opacity:.55}
.finder .c1{top:10px;left:10px;border-right:0;border-bottom:0;border-radius:6px 0 0 0}
.finder .c2{top:10px;right:10px;border-left:0;border-bottom:0;border-radius:0 6px 0 0}
.finder .c3{bottom:10px;left:10px;border-right:0;border-top:0;border-radius:0 0 0 6px}
.finder .c4{bottom:10px;right:10px;border-left:0;border-top:0;border-radius:0 0 6px 0}
.finder .hintt{color:var(--muted);font-size:13.5px;text-align:center;max-width:250px;text-wrap:balance;padding:16px}
.shutterrow{display:flex;justify-content:center;gap:14px;align-items:center}
.shutter{width:66px;height:66px;border-radius:50%;border:4px solid var(--surface);outline:2.5px solid var(--accent);
  background:var(--accent);box-shadow:0 6px 16px rgba(35,48,34,.22);transition:transform .12s ease}
.shutter:hover{transform:scale(1.06)}
.shutter:disabled{opacity:.45;cursor:not-allowed}

/* Detail-Blatt, Dialog, Toast */
.scrim{position:absolute;inset:0;background:rgba(15,22,14,.45);z-index:10;opacity:0;pointer-events:none;transition:opacity .2s ease}
.scrim.on{opacity:1;pointer-events:auto}
.sheet{position:absolute;left:0;right:0;bottom:0;z-index:11;background:var(--surface);
  border-radius:22px 22px 0 0;border-top:1px solid var(--line);padding:10px 18px 22px;
  transform:translateY(105%);transition:transform .28s cubic-bezier(.32,.72,.28,1);
  max-height:88%;overflow-y:auto;box-shadow:0 -12px 40px rgba(15,22,14,.25)}
.sheet.on{transform:translateY(0)}
.grab{width:40px;height:4px;border-radius:99px;background:var(--line);margin:0 auto 12px}
.dphoto{border-radius:16px;border:1px solid var(--line);aspect-ratio:4/2.8;flex:0 0 auto;overflow:hidden;
  position:relative;margin-bottom:12px;background:var(--surface-2)}
.dphoto img{width:100%;height:100%;object-fit:cover;display:block}
.dphoto .gratis{position:absolute;top:10px;right:12px;font-family:var(--hand);font-weight:700;font-size:22px;
  color:var(--danger);background:var(--sticker);border:1px solid var(--card-tape);border-radius:4px;
  padding:0 10px 1px;transform:rotate(5deg);box-shadow:0 2px 6px rgba(35,48,34,.14)}
.drows{margin:10px 0 14px;border-top:1px solid var(--line)}
.drow{display:flex;justify-content:space-between;gap:14px;padding:8px 0;border-bottom:1px solid var(--line);font-size:13.5px}
.drow span{color:var(--muted)}
.drow b{font-weight:700;text-align:right;font-variant-numeric:tabular-nums}
.status{display:inline-flex;align-items:center;gap:6px;color:var(--accent-strong);font-weight:700}
.status::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--accent)}
.sheetbtns{display:flex;flex-direction:column;gap:8px}
.modal{position:absolute;z-index:13;left:16px;right:16px;top:50%;transform:translateY(-46%) scale(.96);
  background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:22px 18px 18px;
  opacity:0;pointer-events:none;transition:opacity .2s ease,transform .2s ease;box-shadow:var(--shadow);
  max-height:82%;overflow-y:auto}
.modal.on{opacity:1;pointer-events:auto;transform:translateY(-50%) scale(1)}
.modal h2{font-family:var(--display);font-weight:800;font-size:20px;margin-bottom:8px;text-wrap:balance}
.modal p{font-size:14px;color:var(--muted);margin-bottom:10px}
.modal p b{color:var(--ink)}
.modal .banbox{background:var(--danger-soft);border:1px solid var(--danger);color:var(--danger);
  border-radius:12px;padding:11px 12px;font-size:13.5px;font-weight:700;margin-bottom:14px}
.toast{position:absolute;left:50%;bottom:86px;transform:translate(-50%,20px);z-index:14;background:var(--ink);
  color:var(--bg);font-size:13.5px;font-weight:500;border-radius:12px;padding:10px 16px;opacity:0;
  pointer-events:none;transition:all .25s ease;max-width:86%;text-align:center;box-shadow:0 8px 24px rgba(15,22,14,.3)}
.toast.on{opacity:1;transform:translate(-50%,0)}

/* Navigation unten */
.nav{flex:0 0 auto;display:flex;align-items:center;justify-content:space-around;border-top:1px solid var(--line);
  padding:8px 10px calc(10px + env(safe-area-inset-bottom,0px));background:var(--surface)}
.nav button{display:flex;flex-direction:column;align-items:center;gap:3px;font-size:11.5px;font-weight:500;
  color:var(--muted);min-width:76px;padding:4px 6px;border-radius:12px}
.nav button svg{width:22px;height:22px}
.nav button[aria-current="true"]{color:var(--accent-strong);font-weight:700}
.nav .give{background:var(--accent);color:var(--accent-ink);border-radius:16px;padding:9px 18px 7px;
  box-shadow:0 6px 16px rgba(35,48,34,.2);font-weight:700;transform:translateY(-8px)}
.nav .give:hover{background:var(--accent-strong)}
.nav .give[aria-current="true"]{color:var(--accent-ink)}

/* Startbildschirm / Anmeldung */
.hero{flex:1;overflow-y:auto;padding:22px 20px 30px;display:flex;flex-direction:column;gap:16px;justify-content:center}
.brandline{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.brand{font-family:var(--display);font-weight:800;font-size:clamp(30px,9vw,42px);letter-spacing:-.02em}
.sticker{font-family:var(--hand);font-weight:700;font-size:19px;color:var(--amber);background:var(--sticker);
  border:1px solid var(--card-tape);border-radius:4px;padding:1px 10px 2px;transform:rotate(-3.5deg);
  display:inline-block;box-shadow:0 2px 6px rgba(35,48,34,.1)}
.tabs{display:flex;gap:6px;background:var(--surface-2);border-radius:99px;padding:4px}
.tabs button{flex:1;border-radius:99px;padding:8px;font-size:14px;font-weight:600;color:var(--muted)}
.tabs button[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:0 2px 6px rgba(35,48,34,.1)}
.mylist{display:flex;flex-direction:column;gap:10px}
.myrow{display:flex;gap:11px;align-items:center;background:var(--surface-2);border:1px solid var(--line);
  border-radius:14px;padding:10px}
.myrow img{width:56px;height:56px;border-radius:10px;object-fit:cover;flex:0 0 auto;background:var(--line)}
.myrow .info{flex:1;min-width:0}
.myrow h4{font-size:14px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.myrow small{color:var(--muted);font-size:12px}
.badge{font-size:11px;font-weight:700;border-radius:99px;padding:2px 9px;white-space:nowrap}
.badge.live{background:var(--accent-soft);color:var(--accent-strong)}
.badge.off{background:var(--surface);color:var(--muted);border:1px solid var(--line)}
.badge.bad{background:var(--danger-soft);color:var(--danger)}
@media (prefers-reduced-motion: reduce){ *{animation:none !important;transition:none !important} }
