:root {
  --ink: #1c1726;
  --ink-soft: #3a3248;
  --indigo: #171225;
  --indigo-deep: #100c1b;
  --paper: #f6efdf;
  --paper-shadow: #e6dcc4;
  --red: #b8382c;
  --red-deep: #8c2a20;
  --teal: #3f8f85;
  --gold: #d1a13f;
  --line: rgba(28, 23, 38, 0.12);

  --font-display: 'Shippori Mincho', serif;
  --font-body: 'Zen Maru Gothic', sans-serif;
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }

body {
  margin: 0;
  background: var(--indigo);
  font-family: var(--font-body);
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; }

/* ---------- Cover / header ---------- */

.cover {
  position: relative;
  background:
    radial-gradient(circle at 12% 20%, rgba(255,255,255,0.05), transparent 40%),
    linear-gradient(160deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  padding: 56px 32px 40px;
  overflow: hidden;
  border-bottom: 1px solid rgba(246,239,223,0.08);
}

.cover-header { max-width: 980px; margin: 0 auto; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gold);
  margin: 0 0 14px;
}

.title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1;
  margin: 0 0 6px;
  color: var(--paper);
  letter-spacing: 0.01em;
}

.title-sub {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: rgba(246,239,223,0.55);
  margin-top: 10px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 32px;
}

.stat { display: flex; flex-direction: column; }
.stat strong { font-family: var(--font-display); font-size: 28px; color: var(--paper); }
.stat span { font-size: 12px; color: rgba(246,239,223,0.5); letter-spacing: 0.04em; }
.stat--vu strong { color: var(--red); }
.stat--encours strong { color: var(--gold); }
.stat--avoir strong { color: var(--teal); }

/* ---------- Page ---------- */

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 32px 90px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tab {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border: 1px solid rgba(246,239,223,0.15);
  border-bottom: none;
  background: rgba(246,239,223,0.04);
  color: rgba(246,239,223,0.6);
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  position: relative;
  top: 1px;
  flex-shrink: 0;
  white-space: nowrap;
}

.tab--active {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.toolbar-actions { display: flex; gap: 10px; align-items: center; }

.search-inline {
  font-family: var(--font-body);
  padding: 9px 14px;
  border-radius: 20px;
  border: 1px solid rgba(246,239,223,0.18);
  background: rgba(246,239,223,0.06);
  color: var(--paper);
  font-size: 13px;
  width: 200px;
}
.search-inline::placeholder { color: rgba(246,239,223,0.35); }

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.97); }

.btn--primary { background: var(--red); color: var(--paper); }
.btn--primary:hover { background: var(--red-deep); }
.btn--small { background: var(--teal); color: var(--paper); }
.btn--ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); opacity: 0.65; }
.btn--ghost:hover { color: var(--red); border-color: var(--red); opacity: 1; }
.btn--toggle { flex: 1; }
.btn--marquer-vu {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 7px 10px;
  font-size: 11px;
}
.btn--marquer-vu:hover { background: var(--ink); color: var(--paper); }

.link-btn {
  background: none;
  border: none;
  color: var(--gold);
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}

/* ---------- Grille & cartes ---------- */

.grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 22px;
  background: var(--paper);
  border-radius: 4px 16px 16px 16px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}

.vide-message {
  text-align: center;
  color: rgba(246,239,223,0.5);
  font-family: var(--font-body);
  margin-top: 24px;
}

.carte {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(28,23,38,0.14);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.carte:hover { transform: rotate(0deg) translateY(-4px); box-shadow: 0 14px 26px rgba(28,23,38,0.22); }

.carte-poster {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--paper-shadow);
  overflow: hidden;
}
.carte-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }

.carte-favori {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(28,23,38,0.55);
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
}
.carte-favori.est-favori { color: var(--gold); background: rgba(28,23,38,0.7); }

.tampon {
  position: absolute;
  top: 50%; left: 50%;
  width: 84px; height: 84px;
  transform: translate(-50%, -50%) rotate(-18deg) scale(0);
  border: 4px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  mix-blend-mode: multiply;
  opacity: 0;
  transition: transform 0.35s cubic-bezier(.34,1.6,.5,1), opacity 0.2s ease;
  pointer-events: none;
}
.carte[data-statut="vu"] .tampon,
.carte[data-statut="lu"] .tampon {
  transform: translate(-50%, -50%) rotate(-18deg) scale(1);
  opacity: 0.88;
}

.carte-corps { padding: 12px 14px 14px; }
.carte-titre {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin: 0 0 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.carte-meta {
  font-size: 11px;
  color: var(--ink-soft);
  margin: 0 0 10px;
  opacity: 0.7;
}
.carte-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.carte-actions .btn { padding: 7px 10px; font-size: 11px; }
.carte-actions .btn--toggle { flex-basis: 100%; }

.carte[data-statut="a_voir"] .btn--toggle,
.carte[data-statut="a_lire"] .btn--toggle { background: var(--teal); color: #fff; }
.carte[data-statut="en_cours"] .btn--toggle { background: var(--gold); color: var(--ink); }
.carte[data-statut="vu"] .btn--toggle,
.carte[data-statut="lu"] .btn--toggle { background: var(--ink); color: var(--paper); }
.carte[data-statut="vu"] .btn--toggle:disabled,
.carte[data-statut="lu"] .btn--toggle:disabled { cursor: default; opacity: 1; }

.carte-progression {
  height: 5px;
  background: rgba(28,23,38,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin: 2px 0 10px;
}
.carte-progression-barre {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ---------- Modales ---------- */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(16,12,27,0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: var(--paper);
  color: var(--ink);
  border-radius: 12px;
  max-width: 560px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none;
  font-size: 18px; cursor: pointer;
  color: var(--ink-soft);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0 0 18px;
  color: var(--ink);
}

.recherche-bloc { display: flex; gap: 8px; margin-bottom: 6px; }
.recherche-bloc input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 13px;
}
.recherche-hint { font-size: 11px; color: var(--ink-soft); opacity: 0.7; margin: 0 0 16px; }

.resultats-liste { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; max-height: 320px; overflow-y: auto; }

.recherche-barre-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 2px 10px;
  font-size: 12px;
}
.recherche-tout { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); cursor: pointer; }
.recherche-tout input { margin: 0; }

.resultat-item {
  display: flex;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  align-items: center;
}
.resultat-item .resultat-check { flex-shrink: 0; width: 16px; height: 16px; margin: 0; cursor: pointer; }
.resultat-item img { width: 44px; height: 60px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.resultat-info { flex: 1; min-width: 0; }
.resultat-info strong { display: block; font-size: 13px; }
.resultat-info span { font-size: 11px; color: var(--ink-soft); }
.resultat-item .btn { flex-shrink: 0; }

.manuel-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.manuel-details summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--teal); }

.form-manuel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.form-manuel label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.form-manuel label.full { grid-column: 1 / -1; }
.form-manuel input, .form-manuel textarea {
  font-family: var(--font-body);
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink);
}
.form-manuel .checkbox { flex-direction: row; align-items: center; gap: 8px; }
.form-manuel .checkbox input { width: auto; }
.form-manuel button { grid-column: 1 / -1; margin-top: 4px; }

.modal--detail { max-width: 640px; }
.detail-header { display: flex; gap: 20px; margin-bottom: 16px; }
.detail-header img { width: 130px; border-radius: 8px; flex-shrink: 0; box-shadow: 0 8px 20px rgba(0,0,0,0.2); }
.detail-title { font-family: var(--font-display); font-size: 22px; margin: 0 0 6px; }
.detail-original { font-size: 12px; color: var(--ink-soft); margin: 0 0 10px; }
.detail-genres span {
  display: inline-block;
  font-size: 10px;
  background: rgba(63,143,133,0.12);
  color: var(--teal);
  padding: 3px 9px;
  border-radius: 12px;
  margin: 0 4px 4px 0;
  font-weight: 700;
}
.detail-synopsis { font-size: 13px; line-height: 1.6; color: var(--ink); }
.detail-note { margin-top: 16px; }
.detail-note label { font-size: 12px; font-weight: 700; color: var(--ink-soft); display: block; margin-bottom: 6px; }

.detail-commentaires { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.detail-commentaires > label { font-size: 12px; font-weight: 700; color: var(--ink-soft); display: block; margin-bottom: 10px; }

.modal-commentaires-liste { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; max-height: 180px; overflow-y: auto; }
.modal-commentaires-vide { font-size: 12px; color: var(--ink-soft); opacity: 0.6; margin: 0 0 12px; }

.modal-commentaire {
  background: rgba(28,23,38,0.05);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.modal-commentaire-corps { flex: 1; min-width: 0; }
.modal-commentaire strong { display: block; color: var(--teal); font-size: 11px; margin-bottom: 2px; }
.modal-commentaire span { color: var(--ink); }
.modal-commentaire-supprimer {
  background: none;
  border: none;
  color: var(--ink-soft);
  opacity: 0.4;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
  flex-shrink: 0;
}
.modal-commentaire-supprimer:hover { opacity: 1; color: var(--red); }

.modal-form-commentaire { display: flex; gap: 8px; }
.modal-form-commentaire input {
  flex: 1;
  font-family: var(--font-body);
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  font-size: 12px;
}

.cover-topline {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cover-topline .eyebrow { margin: 0 auto 0 0; }

.user-pill {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: rgba(246,239,223,0.7);
  background: rgba(246,239,223,0.06);
  border: 1px solid rgba(246,239,223,0.15);
  border-radius: 20px;
  padding: 6px 8px 6px 14px;
}
.user-pill span { font-weight: 700; color: var(--paper); }
.user-pill a {
  text-decoration: none;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 14px;
  color: var(--teal);
  background: rgba(63,143,133,0.14);
}
.user-pill a:hover { background: rgba(63,143,133,0.24); }
.user-pill a.lien-danger {
  color: var(--red);
  background: rgba(184,56,44,0.12);
}
.user-pill a.lien-danger:hover { background: rgba(184,56,44,0.22); }

.lang-switch {
  display: flex;
  gap: 4px;
  background: rgba(246,239,223,0.06);
  border: 1px solid rgba(246,239,223,0.15);
  border-radius: 20px;
  padding: 4px;
}
.lang-btn {
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 14px;
  color: rgba(246,239,223,0.55);
}
.lang-btn:hover { color: var(--paper); }
.lang-btn--active { color: var(--paper); background: rgba(63,143,133,0.28); }

/* ---------- Page de connexion ---------- */

.body--auth {
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.05), transparent 40%),
    linear-gradient(160deg, var(--indigo) 0%, var(--indigo-deep) 100%);
}

.auth-page {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 24px;
  position: relative;
}
.auth-page .lang-switch { position: absolute; top: 24px; right: 24px; }

.auth-card {
  max-width: 380px;
  margin: 0 auto;
  background: var(--paper);
  color: var(--ink);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}
.auth-card .eyebrow { color: var(--red); }

.auth-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  margin: 0 0 20px;
  color: var(--ink);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
}
.auth-tab--active { color: var(--red); border-color: var(--red); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.auth-form input {
  font-family: var(--font-body);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink);
}
.auth-form .btn { margin-top: 6px; }

.case-souvenir {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  font-weight: 400 !important;
  color: var(--ink) !important;
  font-size: 13px !important;
  cursor: pointer;
}
.case-souvenir input { width: auto; }

.champ-mdp { position: relative; display: flex; }
.champ-mdp input { flex: 1; padding-right: 40px; }
.btn-voir-mdp {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 6px 8px;
  line-height: 1;
  opacity: 0.6;
}
.btn-voir-mdp:hover { opacity: 1; }
.btn-voir-mdp.actif { opacity: 1; }

.auth-erreur {
  background: rgba(184,56,44,0.1);
  color: var(--red-deep);
  border: 1px solid rgba(184,56,44,0.25);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin: 0 0 16px;
}

.auth-hint {
  font-size: 12px;
  color: var(--ink-soft);
  opacity: 0.75;
  margin: 18px 0 0;
  text-align: center;
}

/* ---------- Écran de sélection de profil ---------- */

.profils-page {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.profils-page .eyebrow { justify-content: center; }
.profils-page .lang-switch { align-self: center; margin: 0 0 28px; }

.profils-titre {
  font-family: var(--font-display);
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 800;
  margin: 4px 0 40px;
  color: var(--paper);
}

.profils-grille {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  margin-bottom: 36px;
}

.profil-carte {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 110px;
}

.profil-select { margin: 0; }

.profil-avatar {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  border: none;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--paper);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 24px rgba(0,0,0,0.3);
}
.profil-avatar:hover { transform: translateY(-4px) scale(1.03); box-shadow: 0 16px 32px rgba(0,0,0,0.4); }

.profil-avatar--ajout {
  background: rgba(246,239,223,0.06);
  border: 2px dashed rgba(246,239,223,0.25);
  color: rgba(246,239,223,0.4);
  box-shadow: none;
}

.profil-nom {
  font-size: 13px;
  font-weight: 700;
  color: rgba(246,239,223,0.75);
  display: flex;
  align-items: center;
  gap: 6px;
}

.profil-renommer {
  background: none;
  border: none;
  color: rgba(246,239,223,0.35);
  font-size: 12px;
  cursor: pointer;
  padding: 2px;
}
.profil-renommer:hover { color: var(--gold); }

.profil-supprimer { position: absolute; top: -8px; right: 4px; margin: 0; }
.profil-supprimer button {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  line-height: 1;
}

.profil-form-nouveau {
  display: flex;
  gap: 10px;
  justify-content: center;
  max-width: 340px;
  margin: 0 auto 24px;
}
.profil-form-nouveau input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid rgba(246,239,223,0.2);
  background: rgba(246,239,223,0.06);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
}
.profil-form-nouveau input::placeholder { color: rgba(246,239,223,0.35); }

/* ===================================================================
   RESPONSIVE — largeurs intermédiaires (≤ 900px)
   Empile la barre d'outils plus tôt pour éviter que les onglets ne
   soient écrasés par la barre de recherche à largeur fixe.
   =================================================================== */
@media (max-width: 900px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-actions { flex-direction: column; }
  .search-inline { width: 100%; }
}

/* ===================================================================
   RESPONSIVE — tablette et mobile (≤ 768px)
   =================================================================== */
@media (max-width: 768px) {
  .cover { padding: 36px 20px 24px; }
  .page { padding: 24px 16px 70px; }

  .cover-topline { flex-direction: column; align-items: flex-start; gap: 10px; }
  .user-pill { flex-wrap: wrap; width: 100%; padding: 8px; gap: 6px; }
  .user-pill span { width: 100%; padding: 0 6px; }

  .stats { gap: 18px 24px; }
  .stat strong { font-size: 24px; }

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

  .decouvrir-grille { grid-template-columns: 1fr; }
  .pub-grille { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

  .modal { padding: 20px; max-height: 90vh; }
  .modal-overlay { padding: 12px; }
  .detail-header { flex-direction: column; }
  .detail-header img { width: 100%; max-width: 180px; }

  .recherche-bloc { flex-direction: column; }
  .recherche-bloc .btn { width: 100%; }

  .form-manuel { grid-template-columns: 1fr; }

  .legal-bloc { padding: 24px 20px; }

  .site-footer { padding: 20px; }
  .site-footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }

  .profils-grille { gap: 20px; }
}

/* ===================================================================
   RESPONSIVE — petits téléphones (≤ 420px)
   =================================================================== */
@media (max-width: 420px) {
  .title { font-size: 30px; }
  .title-sub { font-size: 13px; }
  .eyebrow { font-size: 10px; letter-spacing: 0.2em; }

  .stats { gap: 14px 20px; }
  .stat strong { font-size: 20px; }

  .grille { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding: 12px; }
  .carte-corps { padding: 8px 10px 10px; }
  .carte-actions { flex-direction: column; gap: 4px; }
  .carte-actions .btn { width: 100%; }

  .pub-grille { grid-template-columns: repeat(2, 1fr); }
  .decouvrir-avatar { width: 44px; height: 44px; font-size: 18px; }

  .profil-carte { width: 90px; }
  .profil-avatar { width: 76px; height: 76px; font-size: 28px; }

  .auth-card { padding: 24px 18px; }
  .modal-title { font-size: 20px; }

  .btn-remonter { bottom: 16px; right: 16px; width: 40px; height: 40px; font-size: 16px; }

  .site-footer-nav { gap: 12px 16px; }

  /* Zones tactiles agrandies (min. ~40px) */
  .carte-favori { width: 34px; height: 34px; font-size: 16px; }
  .profil-supprimer button { width: 28px; height: 28px; font-size: 13px; }
  .modal-close { padding: 6px; font-size: 20px; }
  .pub-carte-header { padding: 8px 2px; margin: -8px -2px 0; }

  .profil-form-nouveau { flex-direction: column; max-width: 100%; }
  .pub-form-commentaire { flex-direction: column; align-items: stretch; }
  .pub-form-commentaire .btn { width: 100%; }

  .decouvrir-carte { padding: 12px; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .carte, .tampon { transition: none; }
}

/* ---------- Découvrir : annuaire des profils ---------- */

.decouvrir-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.decouvrir-carte {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--paper);
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
  transition: transform 0.15s ease;
}
.decouvrir-carte:hover { transform: translateY(-3px); }
.decouvrir-carte--moi { outline: 2px solid var(--gold); }

.decouvrir-avatar {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
}

.decouvrir-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.decouvrir-info strong { font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.decouvrir-info span { font-size: 11px; color: var(--ink-soft); opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.decouvrir-stats { font-size: 11px; color: var(--teal); font-weight: 700; margin-top: 4px; display: flex; gap: 6px; }

/* ---------- Fiche publique d'un profil ---------- */

.pub-section-titre {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--paper);
  margin: 32px 0 16px;
}
.pub-section-titre span { font-family: var(--font-body); font-size: 12px; font-weight: 400; color: rgba(246,239,223,0.5); margin-left: 8px; }

.pub-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 12px;
}

.pub-carte {
  background: var(--paper);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
}

.pub-poster { aspect-ratio: 3/4; background: var(--paper-shadow); }
.pub-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-poster-vide { width: 100%; height: 100%; }

.pub-corps { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.pub-corps h3 { font-size: 14px; margin: 0; color: var(--ink); font-family: var(--font-body); font-weight: 700; }
.pub-note { margin: 0; font-size: 12px; color: var(--gold); font-weight: 700; }
.pub-favori { margin: 0; font-size: 11px; color: var(--red); font-weight: 700; }

.pub-carte-header { cursor: pointer; display: flex; flex-direction: column; gap: 4px; padding: 2px; margin: -2px; border-radius: 6px; }
.pub-carte-header:hover { background: rgba(63,143,133,0.08); }

.pub-comment-count {
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
}
.pub-aucun-avis { font-size: 11px; color: var(--ink-soft); opacity: 0.6; margin: 4px 0; }

.pub-ajouter-catalogue { align-self: flex-start; }

.suggestions-plus-zone { text-align: center; margin-top: 20px; }

.pub-details { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

.pub-commentaires { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.pub-commentaire {
  background: rgba(28,23,38,0.05);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}
.pub-commentaire-corps { flex: 1; min-width: 0; }
.pub-commentaire strong { display: block; color: var(--teal); font-size: 10px; margin-bottom: 2px; }
.pub-commentaire span { color: var(--ink); }
.pub-commentaire-supprimer-form { margin: 0; flex-shrink: 0; }
.pub-commentaire-supprimer {
  background: none;
  border: none;
  color: var(--ink-soft);
  opacity: 0.35;
  cursor: pointer;
  font-size: 10px;
  padding: 2px 4px;
}
.pub-commentaire-supprimer:hover { opacity: 1; color: var(--red); }

.pub-form-commentaire { display: flex; gap: 6px; margin-top: 6px; }
.pub-form-commentaire input {
  flex: 1;
  font-family: var(--font-body);
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-size: 11px;
}
.pub-form-commentaire .btn { padding: 6px 12px; font-size: 11px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid rgba(246,239,223,0.1);
  padding: 24px 32px;
  margin-top: 40px;
}

.site-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer-copyright {
  font-size: 12px;
  color: rgba(246,239,223,0.45);
  margin: 0;
}

.site-footer-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer-nav a {
  font-size: 12px;
  color: rgba(246,239,223,0.5);
  text-decoration: none;
}
.site-footer-nav a:hover { color: var(--gold); text-decoration: underline; }

.body--auth .site-footer { border-top: none; }
.body--auth { display: flex; flex-direction: column; min-height: 100vh; }
.body--auth .auth-page,
.body--auth .profils-page { flex: 1; }

/* ---------- Pages légales ---------- */

.page--legal { max-width: 760px; }

.legal-bloc {
  background: var(--paper);
  color: var(--ink);
  border-radius: 14px;
  padding: 36px 40px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.legal-bloc h2 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  margin: 28px 0 10px;
}
.legal-bloc h2:first-child { margin-top: 0; }

.legal-bloc p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.legal-bloc code {
  background: rgba(28,23,38,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* ---------- Bouton remonter en haut ---------- */

.btn-remonter {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--red);
  color: var(--paper);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
  z-index: 40;
}
.btn-remonter--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.btn-remonter:hover { background: var(--red-deep); }

@media (prefers-reduced-motion: reduce) {
  .btn-remonter { transition: opacity 0.15s ease; }
}

/* ---------- Suggestions ---------- */
.sugg-carte .btn--primary { width: 100%; margin-top: 8px; }

.tab--lien {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  color: var(--gold);
  border-color: rgba(209,161,63,0.3);
}
.tab--lien:hover { background: rgba(209,161,63,0.1); }

/* ---------- Avatars de profil (personnages AniList) ---------- */
.profil-avatar--image {
  background-size: cover;
  background-position: center top;
  border: 2px solid rgba(246,239,223,0.15);
}

.profil-changer-avatar {
  background: rgba(246,239,223,0.08);
  border: 1px solid rgba(246,239,223,0.15);
  color: rgba(246,239,223,0.6);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 10px;
  cursor: pointer;
  margin-top: -4px;
}
.profil-changer-avatar:hover { color: var(--gold); border-color: var(--gold); }

.avatars-onglets {
  display: flex;
  gap: 6px;
  margin: 14px 0 4px;
  flex-wrap: wrap;
}
.avatar-onglet {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 7px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.avatar-onglet:hover { color: var(--ink); border-color: rgba(28,23,38,0.3); }
.avatar-onglet--actif { color: var(--red-deep); background: rgba(184,56,44,0.14); border-color: var(--red); }

.avatars-galerie {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.avatar-choix {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 2px solid var(--line);
  background-size: cover;
  background-position: center top;
  cursor: pointer;
  padding: 0;
}
.avatar-choix:hover { border-color: var(--red); transform: scale(1.05); }

@media (max-width: 420px) {
  .avatars-galerie { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Badges plateformes de streaming ---------- */
.streaming-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.streaming-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(63,143,133,0.14);
  color: var(--teal);
  text-decoration: none;
  border: 1px solid rgba(63,143,133,0.3);
}
.streaming-badge:hover { background: rgba(63,143,133,0.26); }

.carte-streaming { margin: -2px 0 8px; }
.carte-streaming:empty { display: none; }

.streaming-badge--mini {
  font-size: 10px;
  padding: 2px 7px;
  margin-right: 4px;
}

/* ---------- Badges de type (Manga/Scan) ---------- */

.carte-type-badge {
  margin: 0.5rem 0 0 0;
}

.type-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.type-badge--manga {
  background-color: #e8d4f1;
  color: #6b4e8e;
}

.type-badge--scan {
  background-color: #ffd7e8;
  color: #c71585;
}

/* ===================================================================
   NOUVELLES PAGES — Comics, Jeux, Romans
   =================================================================== */

/* ---------- Badges statut jeux ---------- */
.carte-statut-badge {
  margin: 0.4rem 0 0 0;
}

.statut-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge--a-jouer   { background: rgba(140,127,92,0.15); color: var(--or, #c09a4a); }
.badge--en-cours  { background: rgba(74,159,120,0.15); color: #4a9f78; }
.badge--termine   { background: rgba(90,120,180,0.15); color: #5a78b4; }
.badge--complete  { background: rgba(255,215,0,0.2);   color: #b8860b; }
.badge--abandonne { background: rgba(180,60,60,0.15);  color: #b43c3c; }

/* ---------- Auteur sur les cartes romans ---------- */
.carte-auteur {
  font-size: 11px;
  opacity: 0.7;
  margin: 2px 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- user-pill avec beaucoup de liens ---------- */
.user-pill {
  flex-wrap: wrap;
}

/* ---------- Toolbar double rangée tabs (manga) ---------- */
.toolbar {
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Responsive nouvelles pages ---------- */
@media (max-width: 768px) {
  /* Réduire padding des tabs sur mobile */
  .tab {
    font-size: 12px;
    padding: 7px 12px;
  }

  /* user-pill avec beaucoup de liens */
  .user-pill a {
    font-size: 12px;
    padding: 4px 8px;
  }

  /* Badges statut sur mobile */
  .statut-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
  }

  /* Carte auteur tronqué */
  .carte-auteur {
    font-size: 10px;
  }
}

@media (max-width: 420px) {
  /* Tabs encore plus petits */
  .tab {
    font-size: 11px;
    padding: 6px 10px;
  }

  /* user-pill compact */
  .user-pill {
    gap: 4px;
  }

  .user-pill a {
    font-size: 11px;
    padding: 3px 7px;
  }

  /* Stats jeux sur petits écrans */
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Bouton installer l'application (dans l'en-tête, à côté du sélecteur de langue) ---------- */

.btn-installer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gold);
  background: rgba(209,161,63,0.14);
  border: 1px solid rgba(209,161,63,0.35);
  border-radius: 20px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-installer-pill:hover { background: rgba(209,161,63,0.26); }
.btn-installer-pill svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Sur la page de connexion, le sélecteur de langue est en position absolue en haut à droite ;
   on place le bouton d'installation en miroir, en haut à gauche. */
.auth-page .btn-installer-pill--auth {
  position: absolute;
  top: 24px;
  left: 24px;
}

@media (max-width: 480px) {
  .btn-installer-pill span { display: none; }
  .btn-installer-pill { padding: 7px; }
  .btn-installer-pill svg { width: 15px; height: 15px; }
}
