/* ============================================================
   LA PLUME DE PATRICK LA LICORNE — feuille de style
   Structure pensée pour être facilement modifiable :
   couleurs, polices et espacements regroupés en haut du fichier.
   ============================================================ */

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

:root {
  /* ---- Couleurs : modifiez ici pour changer le thème ---- */
  --bg: hsl(40, 35%, 96%);
  --fg: hsl(30, 25%, 20%);
  --border: hsl(35, 25%, 85%);
  --card: hsl(40, 40%, 98%);
  --muted: hsl(35, 20%, 90%);
  --muted-fg: hsl(30, 15%, 45%);
  --primary: hsl(15, 65%, 50%);
  --primary-light: hsl(15, 65%, 96%);
  --secondary: hsl(35, 50%, 60%);

  /* ---- Typographies ---- */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Outfit', system-ui, sans-serif;
  --font-title: 'Great Vibes', cursive;

  --radius: 0.75rem;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  background-attachment: fixed;
  user-select: none;
  -webkit-user-select: none;
}

/* Les champs de saisie restent normalement utilisables (sinon impossible d'écrire !) */
input, textarea, select {
  user-select: text;
  -webkit-user-select: text;
}

/* Dissuasion légère : les images ne se font pas glisser / enregistrer facilement */
img { -webkit-user-drag: none; user-drag: none; }

h1, h2, h3, h4, h5 { font-family: var(--font-serif); color: var(--fg); }

/* ============ BANNIÈRE ============ */
.banner {
  position: relative;
  width: 100%;
  overflow: hidden;
  cursor: pointer;
  height: clamp(150px, 22vw, 340px);
  display: block;
}

.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
}

.banner-title {
  font-family: var(--font-title);
  font-size: clamp(2rem, 7.5vw, 5.5rem);
  color: #6d3b8f;
  text-shadow: 0 2px 12px rgba(255,255,255,0.6);
  text-align: center;
  line-height: 1.1;
}

/* ============ NAVIGATION ============ */
nav {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(180,150,130,0.3);
  background: rgba(249,246,241,0.88);
  backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.nav-links { display: flex; align-items: center; gap: 0.25rem; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  border: none;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.nav-btn:hover { background: var(--muted); }
.nav-btn.active { background: var(--muted); font-weight: 600; }
.nav-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

@media (max-width: 768px) {
  .nav-links .nav-btn { display: none; }
}

.nav-auth { display: flex; align-items: center; gap: 0.5rem; }
@media (max-width: 768px) {
  .nav-auth { display: none; }
}

.nav-avatar-mobile { display: none; }
@media (max-width: 768px) {
  .nav-avatar-mobile { display: flex; }
}
.avatar-small {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(180,100,60,0.2);
  object-fit: cover;
  object-position: top;
  cursor: pointer;
}

.btn-outline {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  font-family: var(--font-serif);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-outline:hover { background: var(--muted); }

.btn-primary {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: calc(var(--radius) - 2px);
  border: none;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.88; }

/* ============ CONTENU PRINCIPAL ============ */
main { flex: 1; }

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ============ CARTE DE BIENVENUE ============ */
.welcome-card {
  border-radius: var(--radius);
  border: 1px solid rgba(180,130,100,0.18);
  background: rgba(255,253,250,0.75);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.welcome-card h2 { font-size: 1.65rem; font-weight: 700; line-height: 1.25; }
.welcome-tagline { font-family: var(--font-serif); font-style: italic; color: var(--primary); font-size: 1.05rem; }
.welcome-desc { color: var(--muted-fg); font-family: var(--font-serif); line-height: 1.7; user-select: none; }
.welcome-sub { font-family: var(--font-serif); }
.welcome-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 1rem;
  list-style: none;
  color: var(--muted-fg);
  font-family: var(--font-serif);
}
.welcome-list li { display: flex; align-items: center; gap: 0.5rem; }
.welcome-list .dot { color: var(--primary); }

/* ============ BOUTONS RAPIDES ============ */
.quick-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--muted-fg);
  margin-bottom: 0.5rem;
}
.quick-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.quick-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid;
  background: transparent;
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.quick-btn svg { width: 14px; height: 14px; }
.q-blague   { border-color: #fcd34d; color: #92400e; }  .q-blague:hover   { background: #fffbeb; }
.q-poeme    { border-color: #a5b4fc; color: #3730a3; }  .q-poeme:hover    { background: #eef2ff; }
.q-tendre   { border-color: #fda4af; color: #9f1239; }  .q-tendre:hover   { background: #fff1f2; }
.q-histoire { border-color: #5eead4; color: #115e59; }  .q-histoire:hover { background: #f0fdfa; }
.q-rale     { border-color: #fdba74; color: #9a3412; }  .q-rale:hover     { background: #fff7ed; }
.q-humour   { border-color: #86efac; color: #166534; }  .q-humour:hover   { background: #f0fdf4; }
.q-conte    { border-color: #c4b5fd; color: #5b21b6; }  .q-conte:hover    { background: #f5f3ff; }

/* ============ COMPOSITEUR ============ */
.composer {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,253,250,0.8);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
}
.composer-header {
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--muted-fg);
  user-select: none;
}
.composer-header:hover { background: rgba(0,0,0,0.02); }
.composer-body {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}
.composer-body.open { display: flex; }
.composer-body textarea, .composer-body input[type=text] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: var(--bg);
  padding: 0.6rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--fg);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.composer-body textarea:focus, .composer-body input:focus { border-color: var(--primary); }
.composer-body textarea { min-height: 100px; }
.composer-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: var(--bg);
  padding: 0.6rem 0.75rem;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--fg);
  outline: none;
}
.composer-footer { display: flex; justify-content: flex-end; }

.composer-origin {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--muted-fg);
}
.composer-origin label { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.composer-origin input[type=radio] { accent-color: var(--primary); cursor: pointer; }

.composer-image-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.85rem 0;
  padding: 0.85rem;
  border: 1px dashed var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: rgba(255,253,250,0.5);
}
.composer-image-label {
  font-size: 0.82rem;
  color: var(--muted-fg);
  font-family: var(--font-sans);
}
.composer-image-field input[type=file] {
  font-size: 0.82rem;
  color: var(--muted-fg);
  font-family: var(--font-sans);
}
.composer-image-preview {
  max-width: 160px;
  max-height: 160px;
  border-radius: calc(var(--radius) - 4px);
  object-fit: cover;
  border: 1px solid var(--border);
}
.composer-image-remove {
  align-self: flex-start;
  border: none;
  background: none;
  color: #b91c1c;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-sans);
}
.composer-image-remove:hover { text-decoration: underline; }

.post-image {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
  margin-bottom: 0.75rem;
}

/* ============ ONGLETS ============ */
.tabs-wrap { overflow-x: auto; padding-bottom: 0.25rem; }
.tabs {
  display: inline-flex;
  border: 1px solid rgba(180,150,130,0.3);
  background: rgba(249,246,241,0.5);
  border-radius: var(--radius);
  padding: 0.25rem;
  gap: 0.125rem;
  min-width: max-content;
}
.tab-btn {
  padding: 0.45rem 1rem;
  border-radius: calc(var(--radius) - 4px);
  border: none;
  background: transparent;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--muted-fg);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--fg); background: rgba(255,255,255,0.5); }
.tab-btn.active {
  background: var(--card);
  color: var(--fg);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ============ PUBLICATIONS ============ */
.posts { display: flex; flex-direction: column; gap: 1.25rem; }

.post-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,253,250,0.65);
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.07);
}

.post-header {
  padding: 1rem 1.25rem 0.6rem;
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}

.avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(180,100,60,0.15);
  object-fit: cover;
  object-position: top;
  flex-shrink: 0;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.post-meta { flex: 1; min-width: 0; }
.post-author {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--fg);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-time {
  display: flex; align-items: center; gap: 0.25rem;
  font-size: 0.72rem; color: var(--muted-fg);
  margin-top: 0.1rem;
}
.post-time svg { width: 11px; height: 11px; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid;
  font-size: 0.72rem;
  font-weight: 500;
  font-family: var(--font-sans);
  margin-top: 0.3rem;
}
.badge-blague   { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge-poeme    { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.badge-tendre   { background: #ffe4e6; color: #9f1239; border-color: #fecdd3; }
.badge-histoire { background: #ccfbf1; color: #115e59; border-color: #99f6e4; }
.badge-citation { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.badge-rale_info { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.badge-novella  { background: #dcfce7; color: #166534; border-color: #bbf7d0; }

.post-content { padding: 0 1.25rem 0.75rem; }
.post-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--fg);
  user-select: none;
}
.post-body {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(60,40,25,0.9);
  white-space: pre-wrap;
  user-select: none;
}
.post-copyright {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.68rem;
  color: rgba(120,100,80,0.5);
  margin-top: 0.6rem;
  user-select: none;
}

/* Dissuasion supplémentaire : empêche le glisser-déposer des images (CSS) */
img { -webkit-user-drag: none; -khtml-user-drag: none; user-drag: none; }

/* ============ ÉTIQUETTE IA / HUMAIN ============ */
.origin-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.55rem;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: 1px solid;
}
.origin-tag.is-ai {
  background: #ede9fe; color: #5b21b6; border-color: #ddd6fe;
}
.origin-tag.is-human {
  background: #f0fdf4; color: #166534; border-color: #bbf7d0;
}

/* ============ COMMENTAIRES ============ */
.comments-section {
  display: none;
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid rgba(180,150,130,0.2);
  background: rgba(255,253,250,0.6);
}
.comments-section.open { display: block; }
.comments-banner {
  display: block;
  max-width: 260px;
  width: 100%;
  margin: 0 auto 0.85rem;
  border-radius: calc(var(--radius) - 4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.comment-item {
  display: flex;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed rgba(180,150,130,0.25);
}
.comment-item:last-of-type { border-bottom: none; }
.comment-avatar {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--secondary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
  font-family: var(--font-sans);
}
.comment-body { flex: 1; }
.comment-author {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--fg);
}
.comment-time { font-size: 0.68rem; color: var(--muted-fg); margin-left: 0.4rem; }
.comment-text { font-size: 0.875rem; color: rgba(60,40,25,0.9); margin-top: 0.1rem; white-space: pre-wrap; user-select: none; }
.no-comments { font-size: 0.85rem; color: var(--muted-fg); font-style: italic; padding: 0.4rem 0; }
.comment-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.comment-form input[type=text] {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: var(--bg);
  padding: 0.45rem 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--fg);
  outline: none;
}
.comment-form input[type=text]:focus { border-color: var(--primary); }
.comment-name-input { flex: 0 0 130px; }
.comment-text-input { flex: 1 1 200px; }
.comment-send-btn {
  border: none;
  border-radius: calc(var(--radius) - 4px);
  background: var(--primary);
  color: #fff;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.comment-send-btn:hover { opacity: 0.9; }

.post-footer {
  padding: 0.6rem 1.25rem 0.75rem;
  border-top: 1px solid rgba(180,150,130,0.2);
  background: rgba(240,235,228,0.3);
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: calc(var(--radius) - 4px);
  border: none; background: transparent;
  color: var(--muted-fg);
  font-size: 0.875rem; font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.action-btn svg { width: 18px; height: 18px; }
.action-btn:hover { background: rgba(0,0,0,0.05); color: var(--fg); }
.action-btn.liked { color: #f43f5e; background: rgba(244,63,94,0.08); }
.action-btn.liked svg { fill: currentColor; }

/* Bouton Supprimer (visible seulement en Mode auteur déverrouillé) */
.action-btn.danger { color: #b91c1c; margin-left: auto; }
.action-btn.danger:hover { background: rgba(185,28,28,0.08); color: #991b1b; }

/* Bouton "Mode auteur" dans la nav */
#btn-author-lock.author-unlocked {
  background: rgba(185,28,28,0.08);
  border-color: #b91c1c;
  color: #b91c1c;
}

/* ============ FENÊTRE MODE AUTEUR ============ */
.author-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,20,15,0.55);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.author-modal-overlay.open { display: flex; }
.author-modal {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem 1.75rem 1.5rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.author-modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--muted-fg);
  cursor: pointer;
}
.author-modal-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.author-modal-text {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--fg);
  line-height: 1.5;
  margin-bottom: 1rem;
}
.author-modal-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
  font-family: var(--font-sans);
}
.author-modal-confirm { width: 100%; padding: 0.65rem; font-size: 0.95rem; }
.author-modal-error {
  color: #b91c1c;
  font-size: 0.8rem;
  margin-top: 0.6rem;
  min-height: 1em;
}

/* Note de protection blockchain, affichée sous chaque texte */
.post-protection {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem 0.9rem;
  border-top: 1px solid rgba(180,150,130,0.2);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted-fg);
  font-family: var(--font-sans);
}
.post-protection .seal-icon { font-size: 0.95rem; line-height: 1.3; flex-shrink: 0; }

/* ============ PUBLICATION AU HASARD ============ */
.random-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%;
  padding: 0.65rem;
  border-radius: var(--radius);
  border: 1px dashed rgba(180,130,100,0.4);
  background: transparent;
  color: var(--muted-fg);
  font-family: var(--font-serif);
  font-size: 0.925rem;
  cursor: pointer;
  transition: all 0.2s;
}
.random-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.random-btn svg { width: 16px; height: 16px; }

/* ============ DON ============ */
.donate-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  border-radius: 9999px;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
}
.donate-btn:hover { opacity: 0.9; transform: scale(1.02); }

/* ============ LA SCÈNE (statistiques) ============ */
.stats-page { max-width: 760px; margin: 2.5rem auto; padding: 0 1rem; }
.stats-page h1 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  text-align: center;
  margin-bottom: 0.4rem;
  color: var(--fg);
}
.stats-sub {
  text-align: center;
  color: var(--muted-fg);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.9rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.stat-number {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--primary);
}
.stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted-fg);
  margin-top: 0.2rem;
}
.stats-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.4rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.novella-banner {
  background: rgba(220,252,231,0.45);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #166534;
  text-align: center;
}
.stats-section h2 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--fg);
}
.bar-row { margin-bottom: 0.75rem; }
.bar-row:last-child { margin-bottom: 0; }
.bar-row-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: var(--fg);
}
.bar-row-label span:last-child { color: var(--muted-fg); font-weight: 600; }
.bar-track {
  width: 100%;
  height: 10px;
  border-radius: 9999px;
  background: var(--muted);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  transition: width 0.4s ease;
}
.origin-split {
  display: flex;
  height: 14px;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}
.origin-split .human { background: #166534; }
.origin-split .ai { background: #5b21b6; }
.origin-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted-fg);
}
.origin-legend .dot-human, .origin-legend .dot-ai {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.3rem;
}
.origin-legend .dot-human { background: #166534; }
.origin-legend .dot-ai { background: #5b21b6; }
.top-text-item {
  padding: 0.6rem 0;
  border-bottom: 1px dashed rgba(180,150,130,0.25);
}
.top-text-item:last-child { border-bottom: none; }
.top-text-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
}
.top-text-meta { font-size: 0.78rem; color: var(--muted-fg); margin-top: 0.15rem; }
.stats-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted-fg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ============ MON PROFIL ============ */
.profile-page { max-width: 760px; margin: 2.5rem auto; padding: 0 1rem; }
.profile-header {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.profile-avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--primary-light);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-name {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg);
}
.profile-tag {
  font-size: 0.85rem;
  color: var(--muted-fg);
  margin-top: 0.15rem;
}
.profile-bio {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.75;
  color: rgba(60,40,25,0.9);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  user-select: none;
}
.profile-bio p { margin-bottom: 0.75rem; }
.profile-bio p:last-child { margin-bottom: 0; }
.profile-section-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin: 0 0 0.9rem 0.1rem;
  color: var(--fg);
}

/* ============ PETITE PLUME QUI VOLTIGE (pied de page) ============ */
.tiny-feather-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  background: rgba(255,253,250,0.5);
  border-top: 1px solid rgba(180,150,130,0.25);
  padding: 0.7rem 0;
}
.tiny-feather {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.12));
  animation: tiny-feather-voltige 4.8s ease-in-out infinite;
  transform-origin: center;
}
@keyframes tiny-feather-voltige {
  0%   { transform: translate(0, 0)      rotate(-8deg); }
  20%  { transform: translate(5px, -8px) rotate(6deg); }
  40%  { transform: translate(-4px, -3px) rotate(-14deg); }
  60%  { transform: translate(4px, -10px) rotate(10deg); }
  80%  { transform: translate(-3px, -2px) rotate(-6deg); }
  100% { transform: translate(0, 0)      rotate(-8deg); }
}
@media (prefers-reduced-motion: reduce) {
  .tiny-feather { animation: none; }
}

/* ============ PIED DE PAGE ============ */
footer {
  border-top: 1px solid rgba(180,150,130,0.2);
  padding: 2rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
footer .quote {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--muted-fg);
  font-size: 0.85rem;
  max-width: 360px;
  line-height: 1.6;
}
footer .copy {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.72rem;
  color: rgba(120,100,80,0.5);
}
.ots-note {
  font-size: 0.72rem;
  color: var(--muted-fg);
  max-width: 480px;
  margin: 0.35rem auto 0;
  line-height: 1.5;
}
.ots-note a { color: var(--primary); text-decoration: underline; }

/* ============ EMPREINTE NUMÉRIQUE (OpenTimestamps) ============ */
.hash-panel {
  display: none;
  padding: 0.85rem 1.25rem 1rem;
  border-top: 1px solid rgba(180,150,130,0.2);
  background: rgba(255,253,250,0.6);
  font-size: 0.82rem;
}
.hash-panel.open { display: block; }
.hash-intro { color: var(--muted-fg); margin-bottom: 0.5rem; line-height: 1.5; }
.hash-value {
  display: block;
  width: 100%;
  word-break: break-all;
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  padding: 0.55rem 0.7rem;
  color: var(--fg);
  margin-bottom: 0.65rem;
  user-select: text !important;
  -webkit-user-select: text !important;
}
.hash-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.hash-btn {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  color: var(--fg);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.hash-btn:hover { background: var(--muted); }
.hash-btn.ots-link { background: var(--primary); color: #fff; border-color: var(--primary); }
.hash-btn.ots-link:hover { opacity: 0.9; }

/* ============ NOTIFICATION TOAST ============ */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999;
  background: var(--fg);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s;
  pointer-events: none;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ============ RESPONSIVE ============ */
@media (max-width: 600px) {
  .welcome-card { padding: 1.25rem 1.1rem; }
  .welcome-list { grid-template-columns: 1fr; }
  .welcome-card h2 { font-size: 1.35rem; }
}
