:root {
  --bg: #0f1020;
  --bg-soft: #16182c;
  --text: #f5f4ff;
  --muted: #a9a7c7;
  --accent: #7C6BFF;
  --accent2: #FF7EB6;
  --like: #33d17a;
  --skip: #ff5c5c;
  --never: #6b6b80;
  --radius: 20px;
  --shadow: 0 20px 50px rgba(0,0,0,.35);
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
p { line-height: 1.55; color: var(--muted); }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Topbar (commune) ---------- */
.topbar, .app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15,16,32,.85);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.25rem; }
.brand-icon { font-size: 1.4rem; }
.topnav { display: flex; align-items: center; gap: 22px; font-weight: 600; }
.topnav a:not(.cta-small) { color: var(--muted); }
.cta-small {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  padding: 8px 16px;
  border-radius: 999px;
  color: #fff !important;
  font-weight: 700;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.merkliste-link {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-soft);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  padding: 0 16px;
  height: 42px;
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
}
.merkliste-icon { font-size: 1rem; }
.merkliste-count { color: var(--accent2); font-weight: 800; }
.merkliste-count.hidden { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border-radius: 14px;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; box-shadow: var(--shadow); }
.btn-ghost { background: rgba(255,255,255,.08); color: var(--text); border: 1px solid rgba(255,255,255,.15); }
.btn-lg { padding: 18px 36px; font-size: 1.1rem; }
.btn-block { width: 100%; margin-top: 8px; }

/* ---------- Landing hero ---------- */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
  padding: 40px 20px 60px;
  max-width: 1100px;
  margin: 0 auto;
}
.hero-text { flex: 1 1 420px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); }
.hl { background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.1rem; max-width: 520px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 24px 0; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-badges span {
  background: var(--bg-soft);
  border: 1px solid rgba(255,255,255,.08);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .85rem;
  color: var(--muted);
}

.hero-cards { position: relative; flex: 1 1 300px; height: 320px; min-width: 260px; }
.demo-card {
  position: absolute;
  width: 220px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 1.05rem;
  border: 1px solid rgba(255,255,255,.08);
}
.demo-card-1 { top: 60px; left: 10%; transform: rotate(-8deg); background: linear-gradient(160deg, #11998E, #38EF7D); color:#04241f;}
.demo-card-2 { top: 10px; left: 40%; transform: rotate(4deg); background: linear-gradient(160deg, #FF512F, #DD2476); color:#fff;}
.demo-card-3 { top: 130px; left: 25%; transform: rotate(-2deg); background: linear-gradient(160deg, #f7971e, #ffd200); color:#3a2500;}

/* ---------- How it works ---------- */
.how, .categories, .final-cta { max-width: 1100px; margin: 0 auto; padding: 50px 20px; }
.how h2, .categories h2, .final-cta h2 { text-align: center; font-size: 1.8rem; margin-bottom: 30px; }
.how-grid, .cat-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.how-card, .cat-card {
  background: var(--bg-soft);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 24px;
}
.how-num {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; margin-bottom: 12px;
}
.cat-card { border-top: 4px solid; border-image: linear-gradient(90deg, var(--c1), var(--c2)) 1; }
.cat-icon { font-size: 1.8rem; }

.final-cta { text-align: center; padding-bottom: 90px; }

.site-footer {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 30px 20px;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.site-footer nav { display: flex; gap: 16px; }
.footer-note { width: 100%; color: var(--muted); font-size: .85rem; margin: 0; }

.legal { max-width: 700px; margin: 0 auto; padding: 40px 20px; }

/* ---------- App ---------- */
.app-body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.icon-btn {
  background: var(--bg-soft);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.page-title { font-size: 1.1rem; margin: 0; }

.card-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  overflow: hidden;
}
.card-stack { position: relative; width: min(400px, 100%); height: min(560px, 78vh); }

.idea-card {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  box-shadow: var(--shadow);
  touch-action: none;
  user-select: none;
  will-change: transform;
  transition: transform .25s ease, opacity .25s ease;
  overflow: hidden;
}
.idea-illustration {
  position: absolute;
  top: 2%;
  left: 2%;
  right: 2%;
  height: 76%;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(0,0,0,.3));
}
.idea-illustration.idea-photo {
  top: 0; left: 0; right: 0; bottom: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  filter: none;
}
.card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(200deg, transparent 22%, rgba(0,0,0,.72) 100%);
}
.photo-credit {
  position: absolute;
  bottom: 8px;
  right: 10px;
  z-index: 2;
  font-size: .65rem;
  color: rgba(255,255,255,.75);
  background: rgba(0,0,0,.35);
  padding: 2px 8px;
  border-radius: 999px;
  pointer-events: none;
}
.idea-body { position: relative; }
.idea-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.idea-badge {
  background: rgba(255,255,255,.22);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
}
.idea-card h2 { font-size: 1.3rem; margin: 0 0 6px; }
.idea-card p { color: rgba(255,255,255,.92); font-size: .88rem; margin: 0; }

.stamp {
  position: absolute;
  top: 30px;
  padding: 8px 16px;
  border: 4px solid;
  border-radius: 10px;
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity .15s ease;
}
.stamp-like { left: 24px; color: var(--like); border-color: var(--like); transform: rotate(-12deg); }
.stamp-skip { right: 24px; color: var(--skip); border-color: var(--skip); transform: rotate(12deg); }

.info-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  padding: 8px 14px;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
}

.empty-state { text-align: center; padding: 30px; }
.empty-state p { font-size: 1.1rem; color: var(--text); }

.action-bar {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 26px;
  padding: 10px 20px calc(14px + env(safe-area-inset-bottom));
}
.action-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.action-label { font-size: .72rem; font-weight: 600; color: var(--muted); }
.action-btn {
  border: none;
  border-radius: 50%;
  width: 58px; height: 58px;
  font-size: 1.4rem;
  background: var(--bg-soft);
  box-shadow: 0 8px 20px rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center;
}
.action-never { width: 46px; height: 46px; font-size: 1.1rem; opacity: .8; }
.action-skip { color: var(--skip); }
.action-like { width: 68px; height: 68px; color: var(--like); font-size: 1.7rem; }
.action-item:has(.action-like) { margin-top: -5px; }

/* ---------- Swipe-Hint (Onboarding-Animation) ---------- */
.swipe-hint {
  position: absolute;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transition: opacity .35s ease, transform .35s cubic-bezier(.34,1.56,.64,1);
  z-index: 150;
  pointer-events: none;
}
.swipe-hint-left { left: 0; transform: translateY(-50%) translateX(-24px); }
.swipe-hint-right { right: 0; transform: translateY(-50%) translateX(24px); }
.swipe-hint.show { opacity: 1; }
.swipe-hint-left.show { transform: translateY(-50%) translateX(0); }
.swipe-hint-right.show { transform: translateY(-50%) translateX(0); }

.swipe-hint-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,10,20,.5);
  backdrop-filter: blur(6px);
  border: 2.5px solid currentColor;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.45));
}
.swipe-hint-circle svg { width: 30px; height: 30px; }
.swipe-hint-left .swipe-hint-circle { color: var(--skip); }
.swipe-hint-right .swipe-hint-circle { color: var(--like); }
/* ---------- "Erster Like"-Animation zur Merkliste ---------- */
.like-flyer {
  position: fixed;
  width: 32px;
  height: 32px;
  font-size: 26px;
  line-height: 32px;
  text-align: center;
  z-index: 300;
  pointer-events: none;
  transition: left .65s cubic-bezier(.3,-.25,.65,1.3), top .65s cubic-bezier(.3,-.25,.65,1.3), transform .65s ease, opacity .65s ease;
  transform: scale(1);
  opacity: 1;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.4));
}

.merkliste-pulse { animation: merklistePulse .9s ease; }
@keyframes merklistePulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(124,107,255,.55); }
  35% { transform: scale(1.18); box-shadow: 0 0 0 10px rgba(124,107,255,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(124,107,255,0); }
}

.ideo-toast {
  position: fixed;
  bottom: 112px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(10,10,20,.92);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 300;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
  pointer-events: none;
}
.ideo-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.swipe-hint-label {
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(10,10,20,.65);
  backdrop-filter: blur(4px);
}
.swipe-hint-left .swipe-hint-label { color: var(--skip); }
.swipe-hint-right .swipe-hint-label { color: var(--like); }

@keyframes cardHintWiggle {
  0% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-38px) rotate(-7deg); }
  50% { transform: translateX(0) rotate(0); }
  75% { transform: translateX(38px) rotate(7deg); }
  100% { transform: translateX(0) rotate(0); }
}
.card-hint-wiggle { animation: cardHintWiggle 1.7s ease-in-out 1; }

/* Filter panel (bottom sheet) */
.filter-panel {
  position: fixed;
  inset: 0;
  background: rgba(10,10,20,.7);
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.filter-panel.hidden { display: none; }
.sheet {
  background: var(--bg-soft);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  width: 100%;
  max-height: 85vh;
  min-height: 0;
  overflow-y: auto;
  box-sizing: border-box;
}
.sheet h2 { margin-bottom: 16px; }

.filter-group { margin-bottom: 20px; }
.filter-group label { display: block; font-weight: 700; margin-bottom: 8px; }
.segmented { display: flex; background: rgba(255,255,255,.06); border-radius: 12px; padding: 4px; gap: 4px; }
.seg-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 10px;
  border-radius: 9px;
  font-weight: 700;
  font-size: .9rem;
}
.seg-btn.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.radius-wrap { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.radius-wrap input[type=range] { flex: 1; }

.chip-grid { display: grid; gap: 8px; }
.chip-grid-3 { grid-template-columns: repeat(3, 1fr); }
.chip-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,.06);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 10px 6px;
  color: var(--muted);
  text-align: center;
}
.chip-icon { font-size: 1.5rem; }
.chip-label { font-size: .7rem; font-weight: 700; line-height: 1.2; }
.chip-btn.active {
  background: rgba(124,107,255,.18);
  border-color: var(--accent);
  color: #fff;
}

/* Liked list */
.liked-page { flex: 1; overflow-y: auto; max-width: 640px; margin: 0 auto; width: 100%; }
.liked-map {
  height: 220px;
  width: 100%;
  margin: 16px 0 0;
  border-radius: 0;
  background: var(--bg-soft);
}
.liked-map.hidden { display: none; }
.liked-map .leaflet-popup-content { font-family: inherit; }
.map-popup { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.map-popup strong { font-size: .9rem; }
.map-popup-loc { font-size: .78rem; color: #555; }
.map-popup-link {
  margin-top: 4px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: .78rem;
  padding: 6px 10px;
  cursor: pointer;
}
.liked-list { padding: 16px 20px 40px; width: 100%; }
.liked-item {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,.06);
}
.liked-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.liked-icon img { width: 70%; height: 70%; object-fit: contain; }
.liked-icon img.liked-photo { width: 100%; height: 100%; object-fit: cover; }
.liked-info { flex: 1; min-width: 0; }
.liked-info h3 { margin: 0 0 4px; font-size: 1rem; }
.liked-info p { margin: 0; font-size: .82rem; }
.liked-item { cursor: pointer; }
.liked-actions { display: flex; gap: 8px; flex-shrink: 0; }
.liked-actions button {
  background: rgba(255,255,255,.08);
  border: none;
  border-radius: 10px;
  width: 36px; height: 36px;
  color: var(--text);
}

/* Detail-Overlay für eine gemerkte Idee */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8,8,16,.75);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.detail-overlay.hidden { display: none; }
.detail-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-soft);
  border-radius: 24px 24px 0 0;
  padding: 0 0 calc(24px + env(safe-area-inset-bottom));
}
.detail-illustration-wrap {
  position: relative;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px 24px 0 0;
}
.detail-illustration-wrap img { width: 55%; height: 55%; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0,0,0,.3)); }
.detail-illustration-wrap.has-photo { overflow: hidden; }
.detail-illustration-wrap.has-photo img { width: 100%; height: 100%; object-fit: cover; filter: none; }
.detail-illustration-wrap.has-photo .photo-credit { bottom: 10px; }
.detail-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
}
.detail-body { padding: 20px 22px calc(20px + env(safe-area-inset-bottom)); }
.detail-maps-link { margin-top: 16px; }
.detail-share-btn { margin-top: 10px; }
.detail-body h3 { font-size: 1.3rem; margin: 0 0 10px; }
.detail-body p { font-size: .95rem; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.detail-badges .idea-badge { background: rgba(255,255,255,.1); color: var(--text); }
.detail-meta { font-size: .85rem; font-weight: 600; color: var(--text); margin: 10px 0 0; }

@media (min-width: 720px) {
  .app-body { align-items: center; }
  .app-topbar, .card-stage, .action-bar, #filterPanel .sheet { max-width: 480px; margin: 0 auto; width: 100%; }
  #filterPanel { justify-content: center; }
  .sheet { border-radius: 24px; }
  .detail-overlay { align-items: center; }
  .detail-sheet { border-radius: 24px; }
  .detail-illustration-wrap { border-radius: 24px 24px 0 0; }
}
