:root {
  --pink: #ff4d8d;
  --purple: #7b2ff7;
  --blue: #2de1fc;
  --yellow: #ffcc00;
  --green: #29d98c;
  --orange: #ff8a3d;
  --ink: #1e1533;
  --card-bg: #ffffff;
  --bg-light: #f4f1ff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
.category-block, [id^="cat-"], [id^="give-"], [id^="miss-"], #doublons, #manquantes {
  scroll-margin-top: 16px;
}
.category-block:target,
[id^="cat-"]:target,
[id^="give-"]:target,
[id^="miss-"]:target {
  animation: target-flash 1.6s ease-out;
  border-radius: 16px;
}
@keyframes target-flash {
  0% { box-shadow: 0 0 0 4px var(--yellow); }
  100% { box-shadow: 0 0 0 4px rgba(255,204,0,0); }
}

body {
  margin: 0;
  font-family: 'Baloo 2', 'Fredoka', system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, #fff3d6 0%, #ffe0ef 35%, #e4e0ff 70%, #d7f6ff 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(90deg, var(--pink), var(--purple) 55%, var(--blue));
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  flex-wrap: wrap;
  gap: 10px;
}

.navbar .brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  letter-spacing: 0.5px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.15);
}

.navbar nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.navbar nav a, .navbar nav button {
  color: white;
  background: rgba(255,255,255,0.18);
  border: 2px solid rgba(255,255,255,0.4);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
  font-family: inherit;
}
.navbar nav a:hover, .navbar nav button:hover {
  background: rgba(255,255,255,0.35);
  transform: translateY(-2px);
}
.navbar nav .highlight {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--yellow);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

h1 { font-size: 2.1rem; font-weight: 800; margin-bottom: 6px; }
h2 { font-weight: 800; }
.subtitle { color: #4b3f6b; margin-top: 0; margin-bottom: 24px; }

.card-panel {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(80, 40, 130, 0.12);
  margin-bottom: 24px;
}

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  font-weight: 800;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-pink { background: var(--pink); color: white; box-shadow: 0 4px 0 #c22a63; }
.btn-blue { background: var(--blue); color: var(--ink); box-shadow: 0 4px 0 #159ab3; }
.btn-yellow { background: var(--yellow); color: var(--ink); box-shadow: 0 4px 0 #c99900; }
.btn-purple { background: var(--purple); color: white; box-shadow: 0 4px 0 #5316b8; }
.btn-green { background: var(--green); color: var(--ink); box-shadow: 0 4px 0 #1a9d67; }
.btn-outline { background: white; border: 2px solid var(--purple); color: var(--purple); }
.btn-small { padding: 5px 14px; font-size: 0.82rem; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid #e0d9ff;
  font-family: inherit;
  font-size: 1rem;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--purple);
}
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 180px; }

.alert {
  padding: 12px 18px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-weight: 700;
}
.alert-error { background: #ffe1e1; color: #a10000; border: 2px solid #ffb3b3; }
.alert-success { background: #e1ffe8; color: #007a2f; border: 2px solid #9df0b9; }

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.album-tile {
  border-radius: 20px;
  padding: 22px;
  color: white;
  font-weight: 800;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
  transition: transform 0.15s ease;
}
.album-tile:hover { transform: translateY(-4px) rotate(-0.5deg); }
.album-tile .meta { font-weight: 500; font-size: 0.85rem; opacity: 0.9; }

.stats-bar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.stat-pill {
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 800;
  color: white;
  font-size: 0.95rem;
}

.category-block { margin-bottom: 32px; }
summary.category-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px;
  border-radius: 999px;
  color: white;
  font-weight: 800;
  margin-bottom: 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
summary.category-title::-webkit-details-marker { display: none; }
.cat-count-badge {
  background: rgba(255,255,255,0.3);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 700;
}
summary.category-title::after {
  content: '▾';
  font-size: 0.8em;
  transition: transform 0.2s ease;
}
details[open] > summary.category-title::after { transform: rotate(180deg); }
details .sticker-grid, details table.admin-table { margin-top: 4px; }

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.sticker {
  background: white;
  border-radius: 16px;
  border: 3px solid #eee;
  padding: 10px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  transition: transform 0.1s ease;
}
.sticker:hover { transform: translateY(-3px); }
.sticker.status-MANQUE { border-color: #ffb3b3; opacity: 0.75; }
.sticker.status-HAVE { border-color: #b3d9ff; }
.sticker.status-DOUBLE { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255,204,0,0.35); }
.sticker.status-PENDING { border-color: #17a2b8; border-style: dashed; }

.sticker .num {
  font-weight: 800;
  font-size: 0.8rem;
  background: var(--purple);
  color: white;
  border-radius: 999px;
  display: inline-block;
  padding: 2px 10px;
  margin-bottom: 6px;
}
.sticker img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 6px;
  background: #f0f0f0;
}
.sticker .placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 10px;
  margin-bottom: 6px;
  background: repeating-linear-gradient(45deg, #f0edff, #f0edff 10px, #e6e0ff 10px, #e6e0ff 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: #b3a4f5;
}
.sticker .label { font-size: 0.78rem; font-weight: 700; margin-bottom: 4px; min-height: 2.1em; }
.sticker .note-line { font-size: 0.68rem; font-style: italic; color: #17a2b8; min-height: 1.2em; margin-bottom: 4px; }
.placeholder-pending { color: #17a2b8 !important; }

.toggle-group {
  display: flex;
  flex-wrap: wrap;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #eee;
}
.toggle-group button {
  flex: 1 1 50%;
  border: none;
  background: #f7f7f7;
  padding: 5px 0;
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}
.toggle-group button.active-MANQUE { background: #ff6b6b; color: white; }
.toggle-group button.active-HAVE { background: #4da6ff; color: white; }
.toggle-group button.active-DOUBLE { background: var(--yellow); color: var(--ink); }
.toggle-group button.active-PENDING { background: #17a2b8; color: white; }

.result-card {
  border-left: 6px solid var(--purple);
  background: white;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 6px 16px rgba(80,40,130,0.1);
}
.result-card h3 { margin: 0 0 4px; }
.result-card .city-tag {
  display: inline-block;
  background: var(--blue);
  color: var(--ink);
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  margin-left: 8px;
}
.match-lists { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 10px; }
.match-list { flex: 1; min-width: 220px; }
.match-list h4 { margin: 0 0 6px; font-size: 0.9rem; }
.match-list .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--bg-light);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 700;
}
.chip.give { background: #d6f9e6; }
.chip.get { background: #ffe9c2; }

.anchor-nav-panel { padding: 18px 24px; display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.anchor-nav-panel label { font-weight: 800; margin: 0; white-space: nowrap; }
.jump-select {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid #e0d9ff;
  font-family: inherit;
  font-size: 1rem;
  background: white;
  color: var(--ink);
}
.jump-select:focus { outline: none; border-color: var(--purple); }

.status-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  padding: 8px 18px;
  border-radius: 999px;
  border: 2px solid #e0d9ff;
  background: white;
  color: var(--ink);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  font-size: 0.9rem;
  transition: transform 0.1s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.filter-btn:hover { border-color: var(--purple); transform: translateY(-1px); }
.filter-btn.active { background: var(--purple); color: white; border-color: var(--purple); }

table.admin-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
table.admin-table th, table.admin-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}
table.admin-table th { color: #7b2ff7; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--purple);
  color: white;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #7a6f99;
  font-weight: 600;
}

.card-thumb-small {
  width: 40px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  vertical-align: middle;
}

.hero {
  text-align: center;
  padding: 48px 20px 28px;
  max-width: 760px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-block;
  background: rgba(123, 47, 247, 0.1);
  color: var(--purple);
  font-weight: 800;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  margin-bottom: 18px;
}
.hero-title {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 16px;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: #4b3f6b;
  margin: 0 0 28px;
  line-height: 1.5;
}
.hero > div { justify-content: center; }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 12px;
}
.step-card {
  background: white;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(80, 40, 130, 0.1);
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pink);
  color: white;
  font-weight: 800;
  margin-bottom: 12px;
}
.step-card h3 { margin: 0 0 8px; }
.step-card p { margin: 0; color: #4b3f6b; font-size: 0.92rem; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}
.feature-card {
  background: white;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 6px 18px rgba(80, 40, 130, 0.08);
}
.feature-icon { font-size: 1.8rem; margin-bottom: 8px; }
.feature-card h3 { margin: 0 0 6px; font-size: 1rem; }
.feature-card p { margin: 0; color: #4b3f6b; font-size: 0.88rem; }

@media print {
  body { background: white !important; }
  .navbar, footer, .no-print, .anchor-nav-panel { display: none !important; }
  .card-panel { box-shadow: none !important; border: 1px solid #ddd; }
  details:not([open]) > *:not(summary) { display: block !important; }
  summary { cursor: default !important; }
  summary::after { display: none !important; }
  a[href]::after { content: none !important; }
}
