/* ═══════════════════════════════════════════════════════
   CABINET DE CURIOSITÉS — DESIGN SYSTEM — THÈME LEGO
   ═══════════════════════════════════════════════════════ */


/* ── CSS VARIABLES ── */
:root {
  /* Briques LEGO officielles */
  --brick-red:    #d01012;
  --brick-yellow: #ffd500;
  --brick-blue:   #0055bf;
  --brick-green:  #00a650;
  --brick-orange: #ff7e14;

  /* Mode sombre (défaut) : plaque de base bleu nuit */
  --accent-rgb: 255, 213, 0;
  --border-rgb: 255, 255, 255;
  --stud-dot:   rgba(255, 255, 255, 0.05);

  --bg-primary:    #0c1626;
  --bg-secondary:  #112038;
  --bg-surface:    #17294a;
  --bg-card:       #1a2f55;
  --bg-glass:      rgba(208, 16, 18, 0.96);
  --bg-overlay:    rgba(8, 14, 26, 0.88);

  --border-subtle: rgba(var(--border-rgb), 0.12);
  --border-mid:    rgba(var(--border-rgb), 0.24);
  --border-accent: rgba(var(--accent-rgb), 0.7);

  --text-primary:   #fff8e1;
  --text-secondary: #d6dff0;
  --text-muted:     #8fa3c7;
  --text-link:      #ffd500;

  --accent-violet:  #ffd500;   /* accent principal = jaune LEGO */
  --accent-gold:    #ffb400;
  --accent-rose:    #ff5a5f;
  --accent-teal:    #3ddc84;
  --accent-blue:    #4da3ff;
  --accent-orange:  #ff8a1f;
  --accent-red:     #ff5a5a;

  --shadow-sm:   0 2px 6px rgba(0,0,0,0.4);
  --shadow-md:   0 8px 20px rgba(0,0,0,0.5);
  --shadow-lg:   0 16px 44px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 30px rgba(var(--accent-rgb), 0.12);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --font-display: 'Lilita One', 'Fredoka', system-ui, sans-serif;
  --font-body:    'Fredoka', system-ui, sans-serif;
  --font-mono:    'DM Mono', monospace;

  --nav-height: 68px;
  --transition: 0.2s cubic-bezier(.4,0,.2,1);
}

/* Mode clair : plaque de base crème */
[data-theme="light"] {
  --accent-rgb: 208, 16, 18;
  --border-rgb: 0, 0, 0;
  --stud-dot:   rgba(0, 0, 0, 0.05);

  --bg-primary:    #f5f1e6;
  --bg-secondary:  #ece6d4;
  --bg-surface:    #e4dcc4;
  --bg-card:       #ffffff;
  --bg-glass:      rgba(208, 16, 18, 0.96);
  --bg-overlay:    rgba(245, 241, 230, 0.92);

  --border-subtle: rgba(var(--border-rgb), 0.1);
  --border-mid:    rgba(var(--border-rgb), 0.2);
  --border-accent: rgba(var(--accent-rgb), 0.7);

  --text-primary:   #1b1b1b;
  --text-secondary: #43403a;
  --text-muted:     #7a7566;
  --text-link:      #0055bf;

  --accent-violet:  #d01012;   /* accent principal = rouge LEGO */
  --accent-gold:    #c98a00;
  --accent-rose:    #c43070;
  --accent-teal:    #00852b;
  --accent-blue:    #0055bf;
  --accent-orange:  #d96a00;
  --accent-red:     #c01010;

  --shadow-sm:   0 2px 6px rgba(0,0,0,0.12);
  --shadow-md:   0 8px 20px rgba(0,0,0,0.16);
  --shadow-lg:   0 16px 44px rgba(0,0,0,0.2);
  --shadow-glow: 0 0 30px rgba(var(--accent-rgb), 0.08);
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  padding-top: var(--nav-height);
  transition: background var(--transition), color var(--transition);
  line-height: 1.6;
}

/* Noise grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* Background radial glow */
body::after {
  content: '';
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  height: 60vw;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb),0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] body::after {
  background: radial-gradient(ellipse, rgba(var(--accent-rgb),0.06) 0%, transparent 70%);
}

/* ── TYPOGRAPHY ── */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.25; }
h3 { font-size: 1.15rem; }

a { color: var(--text-link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-violet); }

/* ── NAVIGATION ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 900;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  transition: background var(--transition);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--accent-violet);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-violet);
  background: rgba(var(--accent-rgb),0.1);
  border-color: var(--border-mid);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── BREADCRUMB NAV (fallback for non-auth) ── */
.crumbs {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── HERO / INTRO ── */
.hero {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 80px auto 60px;
  padding: 60px 40px;
  text-align: center;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-violet);
  margin-bottom: 20px;
  opacity: 0.9;
}

.hero h1 {
  color: var(--text-primary);
  margin-bottom: 18px;
}

.hero h1 em {
  color: var(--accent-violet);
  font-style: italic;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: 1.75;
}

/* ── COLLECTION GRID (homepage) ── */
.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px;
}

.collection-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.35s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.collection-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s;
}

.collection-card:hover::before { opacity: 1; }
.collection-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card-pez::before    { background: radial-gradient(ellipse at 50% 0%, rgba(244,127,172,0.12) 0%, transparent 70%); }
.card-piece::before  { background: radial-gradient(ellipse at 50% 0%, rgba(232,200,122,0.12) 0%, transparent 70%); }
.card-bd::before     { background: radial-gradient(ellipse at 50% 0%, rgba(127,179,245,0.12) 0%, transparent 70%); }
.card-dvd::before    { background: radial-gradient(ellipse at 50% 0%, rgba(111,214,200,0.12) 0%, transparent 70%); }

.card-pez:hover    { border-color: rgba(244,127,172,0.4); }
.card-piece:hover  { border-color: rgba(232,200,122,0.4); }
.card-bd:hover     { border-color: rgba(127,179,245,0.4); }
.card-dvd:hover    { border-color: rgba(111,214,200,0.4); }

.card-icon {
  font-size: 2.8rem;
  line-height: 1;
  display: block;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
}

.collection-card:hover .card-icon {
  transform: scale(1.15) rotate(-3deg);
}

.card-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.card-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  font-weight: 500;
}

.card-pez   .card-badge { background: rgba(244,127,172,0.15); color: var(--accent-rose); }
.card-piece .card-badge { background: rgba(232,200,122,0.15); color: var(--accent-gold); }
.card-bd    .card-badge { background: rgba(127,179,245,0.15); color: var(--accent-blue); }
.card-dvd   .card-badge { background: rgba(111,214,200,0.15); color: var(--accent-teal); }

/* ── SEARCH BAR ── */
.search-bar-container {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 820px;
  margin: 36px auto 28px;
  padding: 0 24px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

.search-container {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

#searchInput {
  width: 100%;
  padding: 14px 20px 14px 44px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-pill);
  outline: none;
  transition: all var(--transition);
}

#searchInput::placeholder { color: var(--text-muted); }
#searchInput:focus {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.12), var(--shadow-sm);
  background: var(--bg-surface);
}

.total-count {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.total-count .count-num {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent-gold);
}

/* ── COLLECTION SECTION ── */
.collection {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto 60px;
  padding: 0 24px;
}

.collection-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.collection-header h2 {
  color: var(--text-primary);
}

.category-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 2px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
}

/* ── GALLERY GRID ── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

/* ── CARTE (standard) ── */
.carte {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 14px 14px;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}

.carte::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% -20%, rgba(var(--accent-rgb),0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.carte:hover::after { opacity: 1; }
.carte:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.carte img {
  width: 140px;
  height: 210px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  display: block;
}

.carte img:hover { transform: scale(1.04); }

.carte h3 {
  font-size: 0.95rem;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.4;
  margin-top: 2px;
}

/* BD specific */
.carte-bd img {
  height: 225px;
  object-fit: cover;
  width: 150px;
}

/* DVD specific */
.carte-dvd img {
  height: 220px;
  width: 150px;
  object-fit: cover;
}

/* Numero badge */
.badge-numero {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.badge-bd  { background: rgba(127,179,245,0.15); color: var(--accent-blue); border: 1px solid rgba(127,179,245,0.25); }
.badge-dvd { background: rgba(111,214,200,0.15); color: var(--accent-teal); border: 1px solid rgba(111,214,200,0.25); }

.carte .meta-line {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.carte .meta-line span { margin: 0 4px; }

/* ── DELETE BUTTON ── */
.btn-delete {
  display: none;
  padding: 5px 12px;
  background: transparent;
  color: var(--accent-red);
  border: 1px solid rgba(244,106,106,0.25);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 4px;
}

.carte:hover .btn-delete { display: block; }

.btn-delete:hover {
  background: rgba(244,106,106,0.12);
  border-color: rgba(244,106,106,0.5);
  transform: translateY(-1px);
}

.carte-actions {
  display: none;
  gap: 8px;
  margin-top: 4px;
}

.carte:hover .carte-actions {
  display: flex;
}

.btn-edit {
  padding: 5px 12px;
  background: transparent;
  color: var(--accent-violet);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-block;
}

.btn-edit:hover {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: var(--accent-violet);
  transform: translateY(-1px);
}

/* ── POPUP IMAGE ── */
.popup {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(16px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1100;
  cursor: zoom-out;
  padding: 40px;
}

.popup img {
  max-width: min(85vw, 640px);
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-mid);
  animation: popupIn 0.25s cubic-bezier(.4,0,.2,1);
}

@keyframes popupIn {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ── DELETE CONFIRM POPUP ── */
.delete-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1200;
  padding: 20px;
}

.delete-popup-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  padding: 40px 44px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: popupIn 0.3s cubic-bezier(.4,0,.2,1);
}

.delete-popup-icon { font-size: 3rem; margin-bottom: 12px; }

.delete-popup-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.delete-popup-message {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 8px;
}

.delete-popup-message strong {
  color: var(--accent-violet);
}

.delete-popup-warning {
  font-size: 0.82rem;
  color: var(--accent-red);
  margin-bottom: 28px;
  font-style: italic;
}

.delete-popup-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-cancel {
  padding: 10px 24px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-cancel:hover {
  background: var(--bg-card);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.btn-confirm {
  padding: 10px 24px;
  background: rgba(244,106,106,0.15);
  color: var(--accent-red);
  border: 1px solid rgba(244,106,106,0.35);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-confirm:hover {
  background: rgba(244,106,106,0.25);
  border-color: rgba(244,106,106,0.6);
  transform: translateY(-1px);
}

/* ── FORMULAIRE ── */
.page-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 48px 24px 0;
  margin-bottom: 32px;
}

.page-header h1 {
  color: var(--text-primary);
  margin-bottom: 10px;
}

.page-header h1 em { color: var(--accent-violet); font-style: italic; }

.page-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.type-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 600px;
  margin: 0 auto 32px;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.type-btn {
  padding: 9px 22px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.type-btn:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
  background: var(--bg-surface);
}

.type-btn.active {
  background: rgba(var(--accent-rgb),0.15);
  border-color: var(--accent-violet);
  color: var(--accent-violet);
  font-weight: 600;
}

.formulaire {
  max-width: 520px;
  margin: 0 auto 60px;
  padding: 36px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.formulaire .form-section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text-primary);
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.formulaire input[type="text"],
.formulaire input[type="number"],
.formulaire input[type="password"],
.formulaire select {
  padding: 11px 16px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition);
  -webkit-appearance: none;
}

.formulaire input:focus,
.formulaire select:focus {
  border-color: var(--accent-violet);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.1);
}

.formulaire input::placeholder { color: var(--text-muted); }

.formulaire input[type="file"] {
  padding: 10px 16px;
  font-size: 0.88rem;
  font-family: var(--font-body);
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px dashed var(--border-mid);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition);
}

.formulaire input[type="file"]:hover {
  border-color: var(--accent-violet);
}

.formulaire input[type="file"]::file-selector-button {
  padding: 6px 14px;
  background: rgba(var(--accent-rgb),0.12);
  color: var(--accent-violet);
  border: 1px solid rgba(var(--accent-rgb),0.3);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  margin-right: 10px;
  transition: all var(--transition);
}

.formulaire input[type="file"]::file-selector-button:hover {
  background: rgba(var(--accent-rgb),0.22);
}

.btn-primary {
  padding: 14px 28px;
  background: rgba(var(--accent-rgb),0.15);
  color: var(--accent-violet);
  border: 1px solid rgba(var(--accent-rgb),0.4);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}

.btn-primary:hover {
  background: rgba(var(--accent-rgb),0.25);
  border-color: var(--accent-violet);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--accent-rgb),0.25);
}

/* ── LOGIN ── */
.login-wrapper {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

.login-card {
  max-width: 400px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-icon {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.login-card h2 {
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 32px;
}

.error-msg {
  padding: 10px 16px;
  background: rgba(244,106,106,0.1);
  border: 1px solid rgba(244,106,106,0.25);
  border-radius: var(--radius-md);
  color: var(--accent-red);
  font-size: 0.88rem;
  margin-bottom: 16px;
  text-align: left;
}

/* ── NOTIFICATIONS ── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 2000;
  padding: 14px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s cubic-bezier(.4,0,.2,1);
  max-width: 360px;
}

.toast.success { border-color: rgba(111,214,200,0.4); }
.toast.success::before { content: '✓'; color: var(--accent-teal); font-weight: 700; }

@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── SORT & FILTER ROW ── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 820px;
  margin: 0 auto 16px;
  padding: 0 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.toolbar-label {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sort-btn {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-family: var(--font-body);
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition);
}

.sort-btn:hover,
.sort-btn.active {
  color: var(--accent-violet);
  border-color: var(--border-accent);
  background: rgba(var(--accent-rgb),0.08);
}

/* ── STATS PAGE (homepage stats) ── */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  max-width: 700px;
  margin: 48px auto 0;
  padding: 0 24px;
  flex-wrap: wrap;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stat-chip .stat-n {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-primary);
}

/* ── BOUTON CONNEXION ── */
.btn-login {
  padding: 7px 16px;
  background: rgba(var(--accent-rgb),0.1);
  color: var(--accent-violet);
  border: 1px solid rgba(var(--accent-rgb),0.3);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-family: var(--font-body);
  text-decoration: none;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-login:hover {
  background: rgba(var(--accent-rgb),0.2);
  border-color: var(--accent-violet);
  color: var(--accent-violet);
  transform: translateY(-1px);
}

/* ── BOUTON DECONNEXION ── */
.btn-logout {
  padding: 7px 16px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-logout:hover {
  color: var(--accent-red);
  border-color: rgba(244,106,106,0.35);
  background: rgba(244,106,106,0.06);
}

/* ── PAGE TITLE BAR ── */
.page-title-bar {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 40px auto 0;
  padding: 0 24px 28px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.page-title-bar h1 {
  color: var(--text-primary);
  line-height: 1.1;
}

.page-title-bar h1 em { color: var(--accent-violet); font-style: italic; }

.page-title-bar .nav-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav { padding: 0 16px; }
  .nav-brand { font-size: 1rem; }
  .nav-links a { font-size: 0.78rem; padding: 5px 10px; }
  .hero { padding: 40px 20px; margin-top: 40px; }
  .formulaire { padding: 28px 24px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .search-bar-container { flex-direction: column; }
  .total-count { width: 100%; justify-content: center; }
  .delete-popup-content { padding: 28px 24px; }
}

@media (max-width: 480px) {
  .collections-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .carte img { width: 100%; height: 180px; }
  .carte-bd img, .carte-dvd img { height: 180px; width: 100%; }
}

/* ── UTILITIES ── */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-32 { margin-top: 32px; }

/* Divider */
.divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-violet), transparent);
  margin: 24px auto;
}

/* Section spacer */
.section-spacer { height: 60px; }

/* Fade in animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  animation: fadeInUp 0.5s cubic-bezier(.4,0,.2,1) both;
}

.fade-in-up:nth-child(2)  { animation-delay: 0.05s; }
.fade-in-up:nth-child(3)  { animation-delay: 0.10s; }
.fade-in-up:nth-child(4)  { animation-delay: 0.15s; }
.fade-in-up:nth-child(5)  { animation-delay: 0.20s; }

/* Stagger gallery cards */
.gallery .carte {
  animation: fadeInUp 0.4s cubic-bezier(.4,0,.2,1) both;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-accent); }

/* ═══════════════════════════════════════════════════════
   AJOUT — DVD Disney : état "non possédé" (grisé)
   ═══════════════════════════════════════════════════════ */

.carte.non-possede {
  opacity: 0.35;
  filter: grayscale(1);
}

.carte.non-possede:hover {
  opacity: 0.55;
  transform: none;
  box-shadow: none;
  border-color: var(--border-subtle);
}

.carte.non-possede::after { display: none; }

.placeholder-manquant {
  width: 150px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px dashed var(--border-mid);
  border-radius: var(--radius-sm);
  font-size: 2rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════
   AJOUT — Toggle "Possédé ?" (switch stylé)
   ═══════════════════════════════════════════════════════ */

.toggle-possession {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 28px;
}

.toggle-possession input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 52px;
  height: 28px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.toggle-slider {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-pill);
  transition: all var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.toggle-possession input[type="checkbox"]:checked ~ .toggle-slider {
  background: rgba(var(--accent-rgb), 0.22);
  border-color: var(--accent-violet);
}

.toggle-possession input[type="checkbox"]:checked ~ .toggle-slider::before {
  transform: translateX(24px);
  background: var(--accent-violet);
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.4);
}

.toggle-possession input[type="checkbox"]:focus-visible ~ .toggle-slider {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}

.toggle-possession input[type="checkbox"]:hover ~ .toggle-slider {
  border-color: var(--border-accent);
}

.toggle-label {
  display: none;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  user-select: none;
  transition: color var(--transition);
}

.toggle-possession input[type="checkbox"]:checked ~ .toggle-yes {
  display: inline;
  color: var(--accent-teal);
}

.toggle-possession input[type="checkbox"]:not(:checked) ~ .toggle-no {
  display: inline;
  color: var(--accent-red);
}

/* ═══════════════════════════════════════════════════════
   AJOUT — Toggle de thème (clair / sombre) dans la nav
   ═══════════════════════════════════════════════════════ */

.theme-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle::before {
  content: '☾';
  position: absolute;
  top: 1px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-violet);
  color: var(--bg-primary);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .theme-toggle::before {
  content: '☀';
  transform: translateX(20px);
  background: var(--accent-gold);
}

.theme-toggle:hover {
  border-color: var(--border-accent);
}

.theme-toggle-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  white-space: nowrap;
}
/* ═══════════════════════════════════════════════════════
   AJOUT — Recettes de cuisine
   ═══════════════════════════════════════════════════════ */

.carte-recette {
  max-width: 320px;
  align-items: stretch;
  text-align: left;
  padding: 18px 20px 20px;
}

.carte-recette img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.carte-recette h3 {
  text-align: left;
  font-size: 1.15rem;
  margin-top: 4px;
}

.recette-section { width: 100%; }

.recette-section h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 6px;
}

.recette-ingredients,
.recette-etapes {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.recette-ingredients li::before {
  content: '•';
  color: var(--accent-violet);
  margin-right: 8px;
}

.recette-etapes { counter-reset: etape; }

.recette-etapes li {
  counter-increment: etape;
  display: flex;
  gap: 8px;
}

.recette-etapes li::before {
  content: counter(etape);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb),0.15);
  color: var(--accent-violet);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Carte collection (page d'accueil) — optionnel si tu ajoutes une tuile Recettes */
.card-recette::before { background: radial-gradient(ellipse at 50% 0%, rgba(232,200,122,0.12) 0%, transparent 70%); }
.card-recette:hover { border-color: rgba(232,200,122,0.4); }
.card-recette .card-badge { background: rgba(232,200,122,0.15); color: var(--accent-gold); }

/* ── FORMULAIRE — lignes dynamiques (ingrédients / étapes) ── */
.dynamic-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dynamic-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dynamic-row input[type="text"] { flex: 1; }

.btn-remove-row {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent-red);
  border: 1px solid rgba(244,106,106,0.25);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition);
}

.btn-remove-row:hover {
  background: rgba(244,106,106,0.12);
  border-color: rgba(244,106,106,0.5);
}

.btn-add-row {
  margin-top: 4px;
  align-self: flex-start;
  padding: 7px 16px;
  background: rgba(var(--accent-rgb),0.1);
  color: var(--accent-violet);
  border: 1px dashed rgba(var(--accent-rgb),0.35);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-add-row:hover {
  background: rgba(var(--accent-rgb),0.18);
  border-color: var(--accent-violet);
}

/* Grille dédiée : une seule colonne sur mobile, deux sur desktop,
   au lieu des vignettes étroites de 180px utilisées pour pez/bd/dvd */
.gallery-recette {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
 
@media (min-width: 860px) {
  .gallery-recette {
    grid-template-columns: repeat(2, 1fr);
  }
}
 
/* La carte recette prend toute la largeur de sa colonne,
   texte aligné à gauche (pas centré comme les cartes-image) */
.carte-recette {
  max-width: none;
  width: 100%;
  align-items: stretch;
  text-align: left;
  padding: 26px 26px 22px;
  gap: 14px;
}
 
.carte-recette img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-md);
  cursor: pointer;
}
 
.carte-recette h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-align: left;
  color: var(--text-primary);
  margin: 4px 0 2px;
  line-height: 1.25;
}
 
/* Section ingrédients / étapes */
.recette-section {
  width: 100%;
}
 
.recette-section h4 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-teal);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-subtle);
}
 
/* Ingrédients : liste à puces discrètes */
.recette-ingredients {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
 
.recette-ingredients li {
  position: relative;
  padding-left: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
 
.recette-ingredients li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-teal);
}
 
/* Étapes : liste numérotée avec pastilles rondes */
.recette-etapes {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: etape;
}
 
.recette-etapes li {
  position: relative;
  padding-left: 36px;
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.65;
  counter-increment: etape;
}
 
.recette-etapes li::before {
  content: counter(etape);
  position: absolute;
  left: 0;
  top: -1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(111, 214, 200, 0.15);
  border: 1px solid rgba(111, 214, 200, 0.35);
  color: var(--accent-teal);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
 
/* Actions (modifier / supprimer) alignées à gauche, toujours visibles
   (contrairement aux cartes-image où elles n'apparaissent qu'au survol) */
.carte-recette .carte-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 6px;
}
 
/* Responsive : image plus basse sur mobile */
@media (max-width: 480px) {
  .carte-recette img {
    height: 180px;
  }
}
/* ═══════════════════════════════════════════════════════
   AJOUT — Confort tactile & agrandissement mobile
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* Base légèrement plus grande : fait grandir proportionnellement
     tout ce qui est en rem (textes, badges, icônes...) */
  html { font-size: 17.5px; }

  /* Navigation : on ne cache plus les liens, on les fait passer
     à la ligne et on agrandit les zones cliquables */
  .nav {
    height: auto;
    min-height: var(--nav-height);
    padding: 14px 16px;
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    order: 3;
  }

  .nav-links a {
    font-size: 1.02rem;
    padding: 11px 16px;
  }

  .nav-brand { font-size: 1.25rem; }

  .nav-right { gap: 14px; }

  .theme-toggle { width: 50px; height: 28px; }
  .theme-toggle::before { width: 24px; height: 24px; font-size: 0.8rem; }
  [data-theme="light"] .theme-toggle::before { transform: translateX(22px); }

  .btn-login, .btn-logout {
    font-size: 0.9rem;
    padding: 9px 16px;
  }

  /* Boutons de type / filtres : plus grands, plus faciles à toucher */
  .type-btn {
    font-size: 0.95rem;
    padding: 11px 20px;
  }

  .sort-btn {
    font-size: 0.88rem;
    padding: 9px 16px;
  }

  /* Formulaire */
  .form-group label { font-size: 0.88rem; }

  .formulaire input[type="text"],
  .formulaire input[type="number"],
  .formulaire input[type="password"],
  .formulaire select,
  .formulaire input[type="file"] {
    font-size: 1rem;
    padding: 13px 16px;
  }

  .btn-primary {
    font-size: 1.02rem;
    padding: 16px 28px;
  }

  /* Toggle "Possédé ?" : switch plus grand, plus facile à toucher */
  .toggle-possession { min-height: 34px; }
  .toggle-possession input[type="checkbox"] { width: 60px; height: 34px; }
  .toggle-slider { width: 60px; height: 34px; }
  .toggle-slider::before { width: 28px; height: 28px; }
  .toggle-possession input[type="checkbox"]:checked ~ .toggle-slider::before {
    transform: translateX(26px);
  }
  .toggle-label { font-size: 0.98rem; }

  .btn-add-row, .btn-remove-row {
    font-size: 0.9rem;
    padding: 9px 16px;
  }
  .btn-remove-row { width: 38px; height: 38px; }

  /* Cartes : actions (Modifier / Supprimer) toujours visibles au tactile,
     car il n'y a pas de survol sur téléphone */
  .carte-actions {
    display: flex !important;
    gap: 10px;
    margin-top: 8px;
  }

  .btn-edit, .btn-delete {
    font-size: 0.85rem;
    padding: 8px 16px;
  }

  .carte h3 { font-size: 1.05rem; }
  .carte .meta-line { font-size: 0.85rem; }
  .badge-numero { font-size: 0.8rem; padding: 4px 12px; }

  .recette-ingredients, .recette-etapes { font-size: 0.92rem; }
  .recette-section h4 { font-size: 0.8rem; }

  /* Barre de recherche */
  #searchInput { font-size: 1rem; padding: 15px 20px 15px 46px; }
  .total-count { font-size: 0.95rem; }

  .gallery { gap: 22px; }

  .collection-card { padding: 28px 20px; }
  .card-name { font-size: 1.25rem; }
  .card-desc { font-size: 0.85rem; }
  .card-badge { font-size: 0.78rem; padding: 4px 14px; }
}

@media (max-width: 480px) {
  .carte img { height: 200px; }
  .carte-bd img, .carte-dvd img { height: 200px; }
  .placeholder-manquant { width: 100%; height: 200px; }
}

/* ═══════════════════════════════════════════════════════
   AJOUT — Grilles spécifiques par collection
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Recettes : une seule par ligne, uniquement sur mobile */
  .gallery-recette {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  /* Pez et pièces : 3 par ligne sur mobile */
  .gallery-pez,
  .gallery-piece {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  /* Cartes plus compactes pour bien tenir à 3 sur petit écran */
  .gallery-pez .carte img,
  .gallery-piece .carte img {
    height: 130px;
  }

  .gallery-pez .carte h3,
  .gallery-piece .carte h3 {
    font-size: 0.8rem;
  }

  .gallery-pez .carte,
  .gallery-piece .carte {
    padding: 10px 6px 8px;
    gap: 6px;
  }
}
/* ═══════════════════════════════════════════════════════
   AJOUT — Filtres JS (recherche / J'ai / Il me manque)
   ═══════════════════════════════════════════════════════ */

.is-hidden { display: none !important; }

.carte img[role="button"]:focus-visible,
.nav a:focus-visible,
.btn-primary:focus-visible,
.type-btn:focus-visible {
  outline: 2px solid var(--accent-violet);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════
   AJOUT — Impression (surtout pour imprimer une recette)
   ═══════════════════════════════════════════════════════ */
@media print {
  .nav, .search-bar-container, .type-selector, .toolbar, .page-title-bar,
  .carte-actions, .no-print, .popup, .delete-popup, .toast, .total-count { display: none !important; }

  body, html { background: #fff !important; color: #000 !important; }
  body::before, body::after { display: none !important; }

  /* Impression d'une seule recette (bouton « Imprimer ») */
  body.printing-recipe .carte:not(.print-target),
  body.printing-recipe .collection-header { display: none !important; }

  .carte, .carte-recette {
    break-inside: avoid;
    box-shadow: none !important;
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #000 !important;
  }
  .carte *, .carte-recette * { color: #000 !important; }
  .carte img { max-height: 220px; width: auto; }
}


/* ═══════════════════════════════════════════════════════
   THÈME LEGO — briques, tenons (studs) et plaque de base
   ═══════════════════════════════════════════════════════ */

/* Plaque de base : grille de tenons en fond */
body::before {
  background-image: radial-gradient(circle at 50% 50%, var(--stud-dot) 0 7px, transparent 8px);
  background-size: 44px 44px;
  opacity: 1;
}
body::after {
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.08) 0%, transparent 70%);
}

h1, h2, h3 { letter-spacing: 0.03em; }
body { font-weight: 400; }

/* ── NAV : barre rouge + logo jaune ── */
.nav {
  background: var(--brick-red);
  border-bottom: 4px solid var(--brick-yellow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.nav-brand {
  font-style: normal;
  font-size: 1.2rem;
  color: var(--brick-red);
  background: var(--brick-yellow);
  padding: 4px 16px 2px;
  border: 3px solid #fff;
  border-radius: 8px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.3);
  letter-spacing: 0.05em;
}
.nav-brand:hover { color: var(--brick-red); transform: translateY(-1px); }
.nav-links a { color: #fff; font-weight: 500; }
.nav-links a:hover {
  color: #fff;
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.35);
}
.nav-links a.active {
  color: #1b1b1b;
  background: var(--brick-yellow);
  border-color: var(--brick-yellow);
  box-shadow: 0 2px 0 rgba(0,0,0,0.3);
}
.theme-toggle-label { color: #fff; }
.theme-toggle { background: rgba(0,0,0,0.25); border-color: rgba(255,255,255,0.6); }
.theme-toggle::before { background: var(--brick-yellow); color: #1b1b1b; }
[data-theme="light"] .theme-toggle::before { background: var(--brick-yellow); }
.nav .btn-login {
  background: #fff; color: var(--brick-red);
  border-color: #fff; font-weight: 600;
  box-shadow: 0 2px 0 rgba(0,0,0,0.3);
}
.nav .btn-login:hover { background: var(--brick-yellow); color: #1b1b1b; border-color: var(--brick-yellow); }
.nav .btn-logout { color: #fff; border-color: rgba(255,255,255,0.55); }
.nav .btn-logout:hover { color: #fff; background: rgba(0,0,0,0.25); border-color: #fff; }

/* ── HERO ── */
.hero-eyebrow { color: var(--accent-violet); }
.hero h1 em {
  font-style: normal;
  color: var(--brick-yellow);
  text-shadow: 3px 3px 0 var(--brick-red);
}
[data-theme="light"] .hero h1 em { color: var(--brick-red); text-shadow: 3px 3px 0 var(--brick-yellow); }
.page-header h1 em, .page-title-bar h1 em { font-style: normal; }

/* ── TUILES D'ACCUEIL : de vraies briques ── */
.collection-card {
  overflow: visible;
  margin-top: 10px;
  border: 0;
  border-radius: 14px;
  padding: 36px 24px 30px;
  box-shadow: 0 8px 0 var(--brick-shadow, rgba(0,0,0,0.35)), var(--shadow-md);
}
.collection-card::before { display: none; }
.collection-card::after {                 /* rangée de tenons */
  content: '';
  position: absolute;
  top: -10px; left: 16px; right: 16px;
  height: 10px;
  background-image: radial-gradient(ellipse 8px 5px at 50% 100%, var(--brick-bg) 0 98%, transparent 100%);
  background-size: 34px 10px;
  background-repeat: repeat-x;
  background-position: center bottom;
  filter: drop-shadow(0 -1px 0 rgba(255,255,255,0.25));
}
.collection-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 0 var(--brick-shadow, rgba(0,0,0,0.35)), var(--shadow-lg);
}
.collection-card:active { transform: translateY(4px); box-shadow: 0 4px 0 var(--brick-shadow, rgba(0,0,0,0.35)); }

.card-pez   { --brick-bg: var(--brick-red);    --brick-shadow: #8c0a0c; background: var(--brick-red);    color: #fff; }
.card-piece { --brick-bg: var(--brick-yellow); --brick-shadow: #b39500; background: var(--brick-yellow); color: #1b1b1b; }
.card-bd    { --brick-bg: var(--brick-blue);   --brick-shadow: #003c86; background: var(--brick-blue);   color: #fff; }
.card-dvd   { --brick-bg: var(--brick-green);  --brick-shadow: #006d34; background: var(--brick-green);  color: #fff; }
.card-pez:hover, .card-piece:hover, .card-bd:hover, .card-dvd:hover { border-color: transparent; }

.card-pez .card-name, .card-bd .card-name, .card-dvd .card-name { color: #fff; }
.card-piece .card-name { color: #1b1b1b; }
.card-pez .card-desc, .card-bd .card-desc, .card-dvd .card-desc { color: rgba(255,255,255,0.85); }
.card-piece .card-desc { color: rgba(0,0,0,0.7); }
.card-pez .card-badge, .card-bd .card-badge, .card-dvd .card-badge { background: rgba(0,0,0,0.25); color: #fff; }
.card-piece .card-badge { background: rgba(0,0,0,0.13); color: #1b1b1b; }
.card-badge { font-weight: 500; }

.stat-chip { border: 2px solid var(--border-mid); box-shadow: 0 3px 0 rgba(0,0,0,0.25); }
.stat-chip span:first-child { color: var(--brick-yellow); }
[data-theme="light"] .stat-chip span:first-child { color: var(--brick-red); }

/* ── CARTES (sets / pièces) : plaques avec tenons colorés ── */
.carte {
  overflow: visible;
  margin-top: 8px;
  border: 2px solid var(--border-mid);
  border-top: 5px solid var(--stud, var(--brick-yellow));
  border-radius: var(--radius-md);
  box-shadow: 0 5px 0 rgba(0,0,0,0.3);
}
.carte::before {                          /* tenons */
  content: '';
  position: absolute;
  top: -15px; left: 14px; right: 14px;
  height: 8px;
  background-image: radial-gradient(ellipse 7px 4px at 50% 100%, var(--stud, var(--brick-yellow)) 0 98%, transparent 100%);
  background-size: 24px 8px;
  background-repeat: repeat-x;
  background-position: center bottom;
  pointer-events: none;
}
.carte:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  border-top-color: var(--stud, var(--brick-yellow));
  box-shadow: 0 9px 0 rgba(0,0,0,0.3), var(--shadow-md);
}
.gallery .carte:nth-child(4n+1) { --stud: var(--brick-red); }
.gallery .carte:nth-child(4n+2) { --stud: var(--brick-yellow); }
.gallery .carte:nth-child(4n+3) { --stud: var(--brick-blue); }
.gallery .carte:nth-child(4n+4) { --stud: var(--brick-green); }
.carte.non-possede, .carte.non-possede:hover { box-shadow: none; }
.carte.non-possede::before { opacity: 0.6; }

.badge-bd, .badge-dvd {
  background: var(--brick-yellow);
  color: #1b1b1b;
  border: 0;
  font-weight: 500;
  box-shadow: 0 2px 0 rgba(0,0,0,0.25);
}

/* ── EN-TÊTES DE SECTION ── */
.collection-header { border-bottom: 4px solid var(--brick-yellow); }
[data-theme="light"] .collection-header { border-bottom-color: var(--brick-red); }
.category-count {
  background: var(--brick-yellow);
  color: #1b1b1b;
  border: 0;
  font-weight: 500;
  box-shadow: 0 2px 0 rgba(0,0,0,0.25);
}
[data-theme="light"] .category-count { background: var(--brick-red); color: #fff; }

/* ── BOUTONS : effet brique 3D ── */
.btn-primary {
  background: var(--brick-yellow);
  color: #1b1b1b;
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: 0 5px 0 #b39500;
  font-weight: 600;
}
.btn-primary:hover {
  background: #ffe033;
  border: 0;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #b39500;
}
.btn-primary:active { transform: translateY(3px); box-shadow: 0 2px 0 #b39500; }

.type-btn, .sort-btn { border-width: 2px; box-shadow: 0 3px 0 rgba(0,0,0,0.25); }
.type-btn.active, .sort-btn.active {
  background: var(--brick-yellow);
  border-color: var(--brick-yellow);
  color: #1b1b1b;
}
.type-btn:active, .sort-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.25); }

.btn-confirm { background: var(--brick-red); color: #fff; border: 0; box-shadow: 0 4px 0 #8c0a0c; }
.btn-confirm:hover { background: #e3181a; border: 0; transform: translateY(-1px); }
.btn-cancel { border-width: 2px; box-shadow: 0 4px 0 rgba(0,0,0,0.25); }

/* ── CHAMPS ── */
#searchInput, .formulaire input, .formulaire select { border-width: 2px; }
#searchInput:focus,
.formulaire input:focus,
.formulaire select:focus {
  border-color: var(--brick-yellow);
  box-shadow: 0 0 0 3px rgba(255, 213, 0, 0.3);
}
[data-theme="light"] #searchInput:focus,
[data-theme="light"] .formulaire input:focus,
[data-theme="light"] .formulaire select:focus {
  border-color: var(--brick-red);
  box-shadow: 0 0 0 3px rgba(208, 16, 18, 0.2);
}

.formulaire, .login-card, .delete-popup-content {
  border: 2px solid var(--border-mid);
  border-top: 6px solid var(--brick-yellow);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 0 rgba(0,0,0,0.3), var(--shadow-lg);
}
[data-theme="light"] .formulaire,
[data-theme="light"] .login-card,
[data-theme="light"] .delete-popup-content { border-top-color: var(--brick-red); }

.total-count { border: 2px solid var(--border-mid); box-shadow: 0 3px 0 rgba(0,0,0,0.25); }
.toast { border-width: 2px; border-left: 6px solid var(--brick-yellow); }

.divider { height: 4px; background: var(--brick-yellow); border-radius: 2px; }
::-webkit-scrollbar-thumb { background: var(--brick-yellow); }

/* Mobile : tenons un peu plus petits sur les cartes serrées */
@media (max-width: 480px) {
  .carte::before { background-size: 18px 8px; }
}
