:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3348;
  --accent: #6c63ff;
  --accent-dim: #3d3870;
  --text: #e8eaf0;
  --text-dim: #7a7f99;
  --green: #4caf82;
  --red: #e05c5c;
  --radius: 10px;
  --font: 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  min-height: 100vh;
}

/* ── Nav ── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 16px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 10;
}
nav .logo {
  font-weight: 700;
  font-size: 17px;
  color: var(--accent);
  margin-right: auto;
}
nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
nav a.active, nav a:hover { color: var(--text); border-color: var(--accent); }

/* ── Update banner ── */
.update-banner {
  background: var(--accent-dim);
  border-bottom: 1px solid var(--accent);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text);
}
.update-banner span { flex: 1; }

/* ── Layout ── */
main { max-width: 960px; margin: 0 auto; padding: 24px 16px; }

h1 { font-size: 22px; font-weight: 600; margin-bottom: 20px; }
h2 { font-size: 16px; font-weight: 600; color: var(--text-dim); margin-bottom: 12px; }

/* ── Partage / réseaux sociaux ── */
.shareIt {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.ReseauxSociaux {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.social {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px 7px 11px;
  transition: color .15s, border-color .15s, background .15s;
}
.social svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  flex-shrink: 0;
}
.social:hover { color: #fff; }
.social-facebook:hover  { background: #1877f2; border-color: #1877f2; }
.social-vinted:hover    { background: #007782; border-color: #007782; }
.social-instagram:hover { background: #d62976; border-color: #d62976; }
.social-ebay:hover      { background: #e53238; border-color: #e53238; }

/* ── Stat cards ── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stat .label { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.stat .value { font-size: 26px; font-weight: 700; }
.stat .value.green { color: var(--green); }
.stat .value.red   { color: var(--red); }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
thead th:hover { color: var(--text); }
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 10px 12px; vertical-align: middle; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge.mythic  { background: #4a1a00; color: #ff8c42; }
.badge.rare    { background: #2a2200; color: #f0c040; }
.badge.uncommon{ background: #1a2a1a; color: #7ec87e; }
.badge.common  { background: #222; color: #aaa; }
.badge.foil    { background: #1a1a3a; color: #a78bfa; }

.delta.pos { color: var(--green); font-weight: 600; }
.delta.neg { color: var(--red);   font-weight: 600; }

.td-thumb { width: 44px; padding: 4px 8px !important; }
.card-thumb {
  width: 40px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  background: var(--surface2);
}

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 13px;
  transition: color .15s, border-color .15s;
}
.btn-icon:hover { color: var(--red); border-color: var(--red); }

/* ── Set picker ── */
.set-picker { margin-bottom: 16px; }

.sp-nav { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.sp-nav-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.sp-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}
.sp-search {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  padding: 2px 4px;
  outline: none;
  min-width: 0;
}
.sp-search::placeholder { color: var(--text-dim); }
.sp-clear {
  font-size: 12px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sp-strip {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sp-strip::-webkit-scrollbar { height: 3px; }
.sp-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sp-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 6px 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
  min-width: 44px;
}
.sp-icon:hover  { border-color: var(--border); background: var(--surface2); }
.sp-icon.active { border-color: var(--accent); background: var(--accent-dim); }
.sp-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  filter: brightness(0) invert(0.7);
}
.sp-icon.active img { filter: brightness(0) invert(1); }
.sp-icon span {
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.sp-icon.active span { color: var(--accent); font-weight: 600; }
.sp-loading { color: var(--text-dim); font-size: 12px; padding: 4px 2px; white-space: nowrap; }
.sp-error   { color: var(--text-dim); font-size: 12px; padding: 4px 2px; }

/* ── Search page ── */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.search-bar input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  padding: 10px 14px;
  outline: none;
  transition: border-color .15s;
}
.search-bar input:focus { border-color: var(--accent); }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 360px;
  max-width: 95vw;
}
.modal h3 { font-size: 16px; margin-bottom: 16px; }
.modal label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 4px; margin-top: 12px; }
.modal input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 15px;
  padding: 8px 12px;
  outline: none;
}
.modal input:focus { border-color: var(--accent); }
.foil-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  margin-top: 12px;
  cursor: pointer;
}
.foil-label input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.btn {
  padding: 8px 18px;
  border-radius: 7px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .15s;
}
.btn:hover { opacity: .85; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost   { background: var(--surface2); color: var(--text); }

/* ── Misc ── */
.empty { text-align: center; color: var(--text-dim); padding: 48px 0; }
.error { color: var(--red); font-size: 13px; margin-top: 6px; }

/* ── Scan page ── */
.scan-hint {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.scan-zone {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.scan-btn { font-size: 15px; padding: 12px 24px; }
.preview-img {
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}
.scan-status {
  margin: 12px 0;
  font-size: 14px;
  color: var(--text-dim);
  min-height: 20px;
}
.scan-status.error { color: var(--red); }
.candidate-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 20px;
}
.candidate-btn {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  padding: 12px 16px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.candidate-btn:hover { border-color: var(--accent); background: var(--surface2); }
.scan-manual {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}
.scan-manual input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  padding: 10px 14px;
  outline: none;
}
.scan-manual input:focus { border-color: var(--accent); }
.scan-raw {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 13px;
}
.scan-raw summary { cursor: pointer; margin-bottom: 8px; }
.scan-raw pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.5;
}

.neu {
  color: var(--color-text-muted);
}

/* ── Collection : vignette cliquable ── */
.card-thumb { cursor: zoom-in; }

/* ── Collection : cellule notes ── */
.note-cell { cursor: pointer; max-width: 200px; }
.note-preview {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  color: var(--text-dim);
  border-bottom: 1px dotted var(--border);
}
.note-cell:hover .note-preview { color: var(--text); }
.note-full { white-space: pre-wrap; line-height: 1.5; font-size: 14px; color: var(--text); }

/* ── Modal image plein écran ── */
.img-modal { cursor: zoom-out; padding: 24px; }
.img-modal img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* ── Page Partager ── */
.share-intro { color: var(--text-dim); font-size: 14px; margin: 6px 0 18px; }
.share-modes { border: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.share-mode {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; cursor: pointer;
  transition: border-color .15s;
}
.share-mode:has(input:checked) { border-color: var(--accent); }
.share-mode input { margin-top: 3px; accent-color: var(--accent); }
.share-mode span { font-size: 14px; color: var(--text-dim); }
.share-mode strong { color: var(--text); }
.share-btn { width: 100%; padding: 12px; font-size: 15px; }
.copied-toast {
  text-align: center; color: var(--green); font-size: 13px;
  margin-top: 10px; font-weight: 500;
}
.link-preview {
  text-align: center; color: var(--text-dim); font-size: 12px;
  margin: 10px 0 4px; word-break: break-all; font-family: monospace;
}

/* ── Hero banner (page Collection) — design Claude, styles scopés .hero-* ── */
.hero-banner {
  position: relative;
  width: 100%;
  height: 200px;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a0533 0%, #0f1117 25%, #0f1117 50%, #1a0533 75%, #0f1117 100%);
  background-size: 300% 300%;
  animation: hero-gradient 8s ease infinite;
}
/* Halos lumineux */
.hero-glow { position: absolute; border-radius: 50%; filter: blur(40px); pointer-events: none; }
.hero-glow-left  { left: -60px; top: -40px; width: 280px; height: 280px; opacity: .3;  background: radial-gradient(circle, oklch(0.55 0.25 295) 0%, transparent 70%); }
.hero-glow-right { right: -40px; bottom: -60px; width: 240px; height: 240px; opacity: .25; background: radial-gradient(circle, oklch(0.55 0.2 330) 0%, transparent 70%); }
.hero-glow-top   { left: 50%; top: -80px; transform: translateX(-50%); width: 400px; height: 200px; opacity: .15; border-radius: 0; filter: blur(30px); background: radial-gradient(ellipse, oklch(0.5 0.18 270) 0%, transparent 70%); }
/* Cartes flottantes */
.hero-card { position: absolute; border-radius: 4px; pointer-events: none; }
.hero-card-1 { left: 8%;   top: 20%;    width: 42px; height: 58px; border: 1.5px solid oklch(0.65 0.2 295 / 0.25); background: oklch(0.65 0.2 295 / 0.06); animation: hero-float1 4s ease-in-out infinite; }
.hero-card-2 { right: 12%; top: 15%;    width: 36px; height: 50px; border-radius: 3px; border: 1.5px solid oklch(0.6 0.2 330 / 0.2);  background: oklch(0.6 0.2 330 / 0.05); animation: hero-float2 5s ease-in-out infinite .5s; }
.hero-card-3 { left: 22%;  bottom: 18%; width: 30px; height: 42px; border-radius: 3px; border: 1px solid oklch(0.6 0.18 270 / 0.2);  background: oklch(0.6 0.18 270 / 0.04); animation: hero-float3 3.5s ease-in-out infinite 1s; }
.hero-card-4 { right: 25%; bottom: 22%; width: 48px; height: 66px; border: 1.5px solid oklch(0.65 0.22 295 / 0.18); background: oklch(0.65 0.22 295 / 0.04); animation: hero-float4 4.5s ease-in-out infinite .3s; }
.hero-card-5 { left: 42%;  top: 8%;     width: 26px; height: 36px; border-radius: 2px; border: 1px solid oklch(0.55 0.2 310 / 0.15); background: oklch(0.55 0.2 310 / 0.03); animation: hero-float5 5.5s ease-in-out infinite .8s; }
.hero-card-6 { right: 38%; top: 70%;    width: 34px; height: 47px; border-radius: 3px; border: 1px solid oklch(0.6 0.15 280 / 0.15); background: oklch(0.6 0.15 280 / 0.03); animation: hero-float1 6s ease-in-out infinite 1.2s; }
/* Particules */
.hero-dot { position: absolute; border-radius: 50%; pointer-events: none; }
.hero-dot-1 { left: 15%;  top: 60%;    width: 3px;   height: 3px;   background: oklch(0.7 0.2 295 / 0.4);  animation: hero-float3 3s ease-in-out infinite; }
.hero-dot-2 { right: 18%; top: 40%;    width: 2px;   height: 2px;   background: oklch(0.7 0.2 330 / 0.35); animation: hero-float2 4s ease-in-out infinite .5s; }
.hero-dot-3 { left: 55%;  top: 25%;    width: 2.5px; height: 2.5px; background: oklch(0.65 0.18 270 / 0.3); animation: hero-float4 3.5s ease-in-out infinite 1s; }
.hero-dot-4 { left: 70%;  bottom: 30%; width: 2px;   height: 2px;   background: oklch(0.7 0.22 295 / 0.3); animation: hero-float5 4.5s ease-in-out infinite; }
/* Ligne horizontale d'accent */
.hero-line {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 90%; max-width: 800px; height: 1px;
  background: linear-gradient(90deg, transparent 0%, oklch(0.6 0.2 295 / 0.15) 20%, oklch(0.65 0.22 295 / 0.3) 50%, oklch(0.6 0.2 330 / 0.15) 80%, transparent 100%);
}
/* Titre */
.hero-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.hero-title {
  margin: 0;
  font-family: 'Outfit', var(--font);
  font-weight: 900;
  font-size: 56px;
  letter-spacing: -1.5px;
  line-height: 1;
  text-align: center;
  background: linear-gradient(135deg, #ffffff 0%, #e2d0fa 40%, #c084fc 60%, #a855f7 80%, #e879a8 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: hero-shimmer 6s linear infinite;
}
.hero-eyebrow-row { margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.hero-eyebrow {
  font-family: 'Outfit', var(--font);
  font-weight: 700; font-size: 11px; letter-spacing: 4px;
  text-transform: uppercase; color: oklch(0.7 0.15 295 / 0.7);
}
.hero-eyebrow-line { width: 24px; height: 1px; }
.hero-eyebrow-line-l { background: linear-gradient(90deg, transparent, oklch(0.65 0.2 295 / 0.6)); }
.hero-eyebrow-line-r { background: linear-gradient(90deg, oklch(0.65 0.2 295 / 0.6), transparent); }
/* Liseré du bas */
.hero-edge {
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, oklch(0.55 0.2 295 / 0.3) 30%, oklch(0.6 0.22 295 / 0.5) 50%, oklch(0.55 0.2 330 / 0.3) 70%, transparent 100%);
}
/* Sous-titre dynamique (vue active) affiché sous le hero */
.collection-title { font-size: 18px; font-weight: 600; color: var(--text-dim); margin: 0 0 12px; }

@keyframes hero-float1 { 0%, 100% { transform: rotate(-12deg) translateY(0); } 50% { transform: rotate(-12deg) translateY(-8px); } }
@keyframes hero-float2 { 0%, 100% { transform: rotate(8deg)   translateY(0); } 50% { transform: rotate(8deg)   translateY(-10px); } }
@keyframes hero-float3 { 0%, 100% { transform: rotate(-5deg)  translateY(0); } 50% { transform: rotate(-5deg)  translateY(-6px); } }
@keyframes hero-float4 { 0%, 100% { transform: rotate(15deg)  translateY(0); } 50% { transform: rotate(15deg)  translateY(-12px); } }
@keyframes hero-float5 { 0%, 100% { transform: rotate(-18deg) translateY(0); } 50% { transform: rotate(-18deg) translateY(-7px); } }
@keyframes hero-shimmer { 0% { background-position: -200% center; } 100% { background-position: 200% center; } }
@keyframes hero-gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* Mobile : on réduit le hero */
@media (max-width: 480px) {
  .hero-banner { height: 150px; }
  .hero-title { font-size: 38px; letter-spacing: -1px; }
  .hero-eyebrow { font-size: 10px; letter-spacing: 3px; }
}

/* Accessibilité : coupe les animations si l'utilisateur le demande */
@media (prefers-reduced-motion: reduce) {
  .hero-bg, .hero-title, .hero-card, .hero-dot { animation: none; }
}