: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;
}

/* ---------- 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: 4%;
  left: 4%;
  right: 4%;
  height: 64%;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(0,0,0,.3));
}
.card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(200deg, transparent 28%, rgba(0,0,0,.68) 100%);
}
.idea-body { position: relative; }
.idea-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.idea-badge {
  background: rgba(255,255,255,.22);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
}
.idea-card h2 { font-size: 1.5rem; margin: 0 0 8px; }
.idea-card p { color: rgba(255,255,255,.92); font-size: .95rem; 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 { right: 24px; color: var(--like); border-color: var(--like); transform: rotate(12deg); }
.stamp-skip { left: 24px; color: var(--skip); border-color: var(--skip); transform: rotate(-12deg); }

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

.action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
}
.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; }

/* 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; }

/* Liked list */
.liked-list { padding: 16px 20px 40px; max-width: 640px; margin: 0 auto; width: 100%; overflow-y: auto; }
.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-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-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);
}

@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; }
}
