/*
  Teklo — Design "tech'low" (halftone violet, pixel art).
  Palette monochrome violet + accents (bleu étoiles, vert valeurs ponctuels).
  Coins droits 0 radius, traits noirs 1-3px, ombres dures 4-6px.
  Pixel art 8x8 / 12x12 grid. BBB Manifont Grotesk (Book + BookItalic).
  Accessibilité : AAA (contraste texte ≥ 7:1, focus visible, cibles ≥ 44px).

  Scope : admin + magicienne + login. PAS les layouts du site visiteur.
*/

/* ========== FONTS LOCALES ==========
   BBB Manifont Grotesk Book + BookItalic — titres, body, mono.
   Italique = voix (quotes, hints). */
@font-face {
  font-family: 'Manifont';
  src: url('/admin/static/fonts/BBBManifontGrotesk-Book.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Manifont';
  src: url('/admin/static/fonts/BBBManifontGrotesk-BookItalic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ========== TOKENS ========== */
:root {
  /* couleurs — palette halftone violet (light mode, AAA) */
  --bg:            #f3eef2;   /* lavande très clair */
  --paper:         #ffffff;   /* papier pur */
  --ink:           #2e1d2f;   /* deep purple — 13:1 sur bg */
  --ink-dim:       #3a243b;   /* texte secondaire — 11:1 */
  --ink-mute:      #5b3e5d;   /* meta, captions — 7:1 AAA */
  --line:          #2e1d2f;   /* bordures, traits — même que ink */
  --accent:        #a561a1;   /* violet moyen — boutons d'action */
  --accent-strong: #3a243b;   /* texte accent sur bg — 11:1 AAA */
  --accent-soft:   #ccaece;   /* lavande décorative */
  --accent-on:     #ffffff;   /* texte sur bg accent */
  --feu-bg:        #8a4a86;   /* fond du bloc du feu — blanc dessus : 6,17:1 */
  --postit:        #e9b5e5;   /* rose lavande post-it */
  --halftone:      #dfc7de;   /* rose pâle halftone */
  --success:       #3e6f46;   /* vert fleurs (accent ponctuel) */
  --info:          #466e9f;   /* bleu étoiles (accent ponctuel) */
  --danger:        #7a1818;   /* rouge sombre AAA */
  --danger-soft:   #f2dcd6;

  /* typo — Manifont Grotesk partout, italique pour la voix */
  --font-title: 'Manifont', -apple-system, system-ui, sans-serif;
  --font-body:  'Manifont', -apple-system, system-ui, sans-serif;
  --font-mono:  'Manifont', ui-monospace, monospace;

  /* échelles — 0 radius (do/don't : pas de border-radius) */
  --r-sm: 0;
  --r-md: 0;
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  /* ombres dures (do : ombres dures 4-6px) */
  --shadow-sm: 3px 3px 0 0 var(--line);
  --shadow-md: 5px 5px 0 0 var(--line);
  --shadow-lg: 6px 6px 0 0 var(--line);
}

/* ========== RESET + BASE ========== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  /* halftone violet subtil — pixel dither sur 8x8 */
  background-image:
    radial-gradient(rgba(46, 29, 47, 0.08) 1px, transparent 1px),
    radial-gradient(rgba(46, 29, 47, 0.05) 1px, transparent 1px);
  background-size: 8px 8px, 16px 16px;
  background-position: 0 0, 4px 4px;
}

/* focus AAA : outline épaisse, offset, couleur contrastée */
:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}

a { color: var(--accent-strong); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

/* ========== TYPO ========== */
.t-title {
  font-family: var(--font-title);
  font-weight: 400;
  font-style: normal;
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.t-title-xxl { font-size: clamp(56px, 8vw, 88px); }
.t-title-xl  { font-size: clamp(40px, 5vw, 64px); }
.t-title-lg  { font-size: clamp(28px, 3vw, 36px); }
.t-title-md  { font-size: clamp(22px, 2.2vw, 28px); }
.t-title-sm  { font-size: 20px; }

.t-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-mute);
}
.t-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
  font-weight: 600;
}

/* ========== LAYOUT SHELL ========== */
.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static !important; min-height: auto !important; }
}

.sidebar {
  background: var(--ink);                /* deep purple — sidebar fond sombre */
  color: var(--accent-on);
  border-right: 2px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 2;
}
.sidebar__brand {
  padding: 24px 22px;
  border-bottom: 1px solid rgba(243, 239, 224, 0.18);
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.sidebar__brand:hover { background: rgba(243, 239, 224, 0.05); }
.sidebar__brand svg { color: var(--accent-on) !important; }
.sidebar__brand-title {
  font-family: var(--font-title);
  font-style: normal;
  font-weight: 400;
  font-size: 26px;
  line-height: 1;
  color: var(--accent-on);
}
.sidebar__brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 239, 224, 0.65);
  margin-top: 4px;
}
.sidebar__nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar__link {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  min-height: 46px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  position: relative;
  border-radius: 0;                       /* do/don't : pas de border-radius */
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar__link:hover {
  background: rgba(243, 239, 224, 0.1);
  color: var(--accent-on);
}
.sidebar__link[aria-current="page"] {
  background: rgba(243, 239, 224, 0.16);
  color: var(--accent-on);
  font-weight: 700;
}
.sidebar__link .illu { flex-shrink: 0; color: rgba(243, 239, 224, 0.75); }
.sidebar__link:hover .illu,
.sidebar__link[aria-current="page"] .illu { color: var(--accent-on); }
.sidebar__group summary { list-style: none; cursor: pointer; }
.sidebar__group summary::-webkit-details-marker { display: none; }
.sidebar__group { margin: 2px 0; }
.sidebar__subnav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0 6px 16px;
  padding-left: 14px;
  border-left: 1px solid rgba(243, 239, 224, 0.22);
}
.sidebar__subnav .sidebar__link {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(243, 239, 224, 0.75);
}
.sidebar__subnav .sidebar__link:hover {
  background: rgba(243, 239, 224, 0.1);
  color: var(--accent-on);
}
.sidebar__subnav .sidebar__link[aria-current="page"] {
  background: rgba(243, 239, 224, 0.18);
  color: var(--accent-on);
}
.sidebar__group-arrow {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 0;                       /* coins droits */
  background: transparent;
  transition: transform 0.2s ease, background 0.15s ease;
}
.sidebar__group[open] > summary .sidebar__group-arrow {
  transform: rotate(90deg);
  background: rgba(243, 239, 224, 0.12);
}
.sidebar__foot {
  padding: 16px 14px;
  border-top: 1px solid rgba(243, 239, 224, 0.18);
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar__foot .sidebar__link { color: rgba(243, 239, 224, 0.85) !important; }
.sidebar__foot .sidebar__link:hover { color: var(--accent-on) !important; }
.sidebar__foot .sidebar__link[href="/admin/publier"] {
  background: var(--accent) !important;       /* violet moyen, accent fort */
  color: var(--accent-on) !important;
  font-weight: 700 !important;
  justify-content: center;
  border: 2px solid var(--accent-on);
  box-shadow: 4px 4px 0 0 rgba(255,255,255,0.25);
}
.sidebar__foot .sidebar__link[href="/admin/publier"]:hover {
  background: var(--postit) !important;
  color: var(--accent-strong) !important;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 0 rgba(255,255,255,0.35);
}
.sidebar__foot .sidebar__link[href="/admin/publier"] .illu { color: inherit; }

/* clip, pas hidden : hidden ferait de .main un conteneur de défilement, et
   tout position:sticky dedans (barre du haut, « Enregistrer ») cesserait
   de coller à la fenêtre. */
.main { overflow-x: clip; }
.main__topbar {
  position: sticky; top: 0; z-index: 3;
  background: var(--bg);
  border-bottom: 1.5px solid var(--line);
  padding: 16px 40px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}

.page { padding: 40px 48px; }
.page__kicker { display: inline-block; margin-bottom: 8px; }
.page__title { margin: 20px 0 16px; }
.page__lede { max-width: 640px; font-size: 17px; color: var(--ink-dim); line-height: 1.6; margin: 0; }

/* ========== BOUTONS ========== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px;
  min-height: 48px;
  border: 2px solid var(--line);          /* trait noir 2px */
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  border-radius: 0;                       /* coins droits */
  box-shadow: var(--shadow-sm);           /* ombre dure permanente */
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translate(0, 0); box-shadow: 1px 1px 0 0 var(--line); }

.btn--primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn--primary:hover { box-shadow: 5px 5px 0 0 var(--accent); }

.btn--accent {
  background: var(--accent);
  color: var(--accent-on);
  border-color: var(--line);
}
.btn--accent:hover { box-shadow: 5px 5px 0 0 var(--line); }

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-dim);
  min-height: 44px;
  padding: 8px 12px;
}
.btn--ghost:hover {
  background: rgba(15, 26, 19, 0.06);
  color: var(--ink);
  transform: none;
  box-shadow: none;
}

.btn--danger { background: var(--danger); color: var(--accent-on); border-color: var(--line); }

/* ========== CARTES / AFFICHETTES ========== */
.card {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--line);
  padding: 22px 20px;
  border-radius: 0;                       /* coins droits */
  box-shadow: var(--shadow-md);           /* ombre dure 5px */
}
.card--accent {
  background: var(--accent);
  color: var(--accent-on);
  border-color: var(--line);
}
.card--accent .t-meta { color: var(--accent-soft); }
.card--soft {
  background: var(--halftone);
  border-color: var(--line);
}
/* card--clic : une .card qui est aussi un lien (ex : quêtes) — même effet
   de survol que .btn, pour que "c'est cliquable" se voie sans avoir à lire. */
.card--clic { transition: transform 0.1s ease, box-shadow 0.1s ease; }
.card--clic:hover, .card--clic:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

/* affichette — légère rotation, pas de rounded corners */
.affichette {
  position: relative;
  transition: transform 0.15s ease;
}
.affichette:hover, .affichette:focus-within { transform: rotate(0deg) !important; }
.affichette:nth-child(1) { transform: rotate(-1.8deg); }
.affichette:nth-child(2) { transform: rotate(1.2deg); }
.affichette:nth-child(3) { transform: rotate(-0.8deg); }
.affichette:nth-child(4) { transform: rotate(1.8deg); }

/* post-it (ex : "site en ligne") */
.postit {
  position: relative;
  background: var(--postit);
  border: 2px solid var(--line);
  padding: 22px;
  border-radius: 0;                       /* coins droits */
  box-shadow: var(--shadow-md);
  transform: rotate(-1.5deg);
  color: var(--ink);
}

/* ========== FORMS ========== */
.field { display: block; margin-bottom: 20px; }
.field__label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.field__hint {
  display: block;
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 6px;
  font-family: var(--font-mono);
}
.input, .textarea, .select {
  width: 100%;
  padding: 12px 14px;
  min-height: 48px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 0;                       /* coins droits */
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);           /* ombre dure 3px */
}
.input:focus-visible, .textarea:focus-visible, .select:focus-visible {
  border-color: var(--accent);
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.input--mono { font-family: var(--font-mono); font-size: 15px; letter-spacing: 0.04em; }

/* ========== ALERTES ========== */
.alert {
  border: 2px solid var(--line);
  border-radius: 0;                       /* coins droits */
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 15px;
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.alert--error {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}
.alert--warn {
  background: #f6ecc8;
  border-color: #7a5e18;
  color: #4a3a10;
}
.alert--info { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }

/* ========== ILLUSTRATIONS ========== */
/* utilisées via <svg class="illu" …><use href="/admin/static/sprite.svg#feu"/></svg> */
.illu { display: inline-block; vertical-align: middle; color: var(--ink); }
.illu--accent { color: var(--accent); }
.illu--on-accent { color: var(--accent-on); }
.illu-xs { width: 14px; height: 14px; }
.illu-sm { width: 22px; height: 22px; }
.illu-md { width: 44px; height: 44px; }
.illu-lg { width: 96px; height: 96px; }
.illu-xl { width: 180px; height: 180px; }

/* ========== DIVERS ========== */
.hr-dashed { border: none; border-top: 1.5px dashed var(--ink-mute); margin: 24px 0; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border: 1.5px solid var(--line);
  border-radius: 0;                       /* coins droits, pas de pill */
  background: var(--paper);
  color: var(--ink-dim);
}
.tag--draft { border-color: var(--accent-strong); color: var(--accent-strong); }

/* "biffé " avec un trait */
.strike {
  position: relative;
  color: var(--ink-mute);
}
.strike::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px; top: 55%;
  height: 2px;
  background: var(--ink-dim);
  transform: rotate(-1.5deg);
}

/* skip link (accessibilité clavier) */
.skip-link {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: fixed; left: 12px; top: 12px; width: auto; height: auto;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  z-index: 1000;
  border-radius: 0;
}

/* ========== VOIX (italique pour citations / hints) ========== */
.voice, .voice em, em.voice, blockquote {
  font-style: italic;
  color: var(--ink-dim);
}
blockquote {
  margin: 0;
  padding: 12px 18px;
  border-left: 3px solid var(--accent);
  background: var(--halftone);
}

/* ========== HALFTONE / PIXEL ==========
   Pas de filtre auto : utilisateurice fournit images déjà ditherées.
   .halftone-frame = cadre violet pour images traitées. */
.halftone-frame {
  display: block;
  border: 2px solid var(--line);
  box-shadow: var(--shadow-md);
  background: var(--halftone);
  image-rendering: pixelated;             /* zoom net pour pixel art */
}
.halftone-frame img,
.halftone-frame svg {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

/* ========== MASCOTTE ========== */
.mascotte {
  display: block;
  image-rendering: pixelated;
}
.mascotte--sm { width: 64px; height: auto; }
.mascotte--md { width: 120px; height: auto; }
.mascotte--lg { width: 220px; height: auto; }
.mascotte--xl { width: 360px; height: auto; }

/* ========== LOGIN SPLIT ==========
   Split horizontal : moitié gauche image halftone, moitié droite form. */
.login-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  background: var(--bg);
}
.login-split__art {
  background: var(--accent-soft);
  background-image: url("/admin/static/img/mascotte.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 60%;
  border-right: 2px solid var(--line);
  position: relative;
}
.login-split__art::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(var(--ink) 1px, transparent 1.5px);
  background-size: 8px 8px;
  opacity: 0.18;
  pointer-events: none;
}
.login-split__form {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 32px;
}
.login-split__inner {
  width: 100%; max-width: 420px;
}
@media (max-width: 820px) {
  .login-split { grid-template-columns: 1fr; }
  .login-split__art { min-height: 240px; border-right: none; border-bottom: 2px solid var(--line); }
}

/* ========== 404 ========== */
.notfound {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 24px;
}
.notfound__code {
  font-family: var(--font-mono);
  font-size: clamp(96px, 18vw, 180px);
  line-height: 0.9;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.notfound__msg {
  font-style: italic;
  color: var(--ink-dim);
  max-width: 420px;
}

/* ── Pop-up d'onboarding (mini-tuto) ──────────────────────────────────────
   <dialog> natif partagé par la liste (découverte) et l'éditeur (premier
   geste). Backdrop assombri natif → focale sans lib ni JS de positionnement.
   Apparition douce, aucune animation permanente. */
.onb-dialog {
  border: 2.5px solid var(--accent-strong);
  border-radius: var(--r-sm);
  padding: 0;
  box-shadow: var(--shadow-md);
  background: var(--card, #fff);
  color: var(--ink);
  max-width: 560px;
  width: calc(100% - 32px);
}
.onb-dialog::backdrop {
  background: rgba(20, 16, 28, 0.85);
  backdrop-filter: blur(1.5px);
}
.onb-dialog[open] {
  animation: onbPop 0.22s ease-out;
}
@keyframes onbPop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* Étapes numérotées du tuto éditeur */
.onb-steps { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 14px; }
.onb-steps li { display: flex; gap: 13px; align-items: flex-start; }
.onb-steps .onb-num {
  flex: 0 0 32px; height: 32px; border-radius: 999px;
  background: var(--accent-strong); color: var(--accent-on);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
}
.onb-steps .onb-txt { font-size: 15.5px; line-height: 1.45; padding-top: 4px; }

/* ========== BARRE DE PROGRESSION (quêtes) ==========
   Ajout v4 : la v3 dessinait la barre d'XP en styles inline dans le template.
   Ici c'est un composant, réutilisé par le feu de camp et par chaque quête. */
.barre {
  background: var(--halftone);
  border: 2px solid var(--line);
  height: 18px;
  overflow: hidden;
}
.barre > div {
  background: var(--accent);
  height: 100%;
  transition: width 0.3s ease;
}
.card--accent .barre { border-color: var(--accent-on); background: rgba(255,255,255,0.25); }
.card--accent .barre > div { background: var(--accent-on); }

/* ========== LE BLOC DU FEU (tableau de bord) ==========
   Tout le jeu dans un seul cadre blanc : scène, points, barre, quêtes. Le
   découpage en cartes séparées faisait un tableau de bord encombré où rien ne
   ressortait. `position:relative` porte les fleurs et les confettis. */
.feu-bloc {
  position: relative;
  overflow: hidden;
  background: var(--feu-bg);
  color: var(--accent-on);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-md);
  padding: var(--s-6);
  /* La réserve de droite : les fleurs occupent ce coin, le texte s'arrête
     avant. Voir la règle @media plus bas, qui la retire quand les fleurs
     disparaissent. */
  margin-bottom: var(--s-5);
}
/* Le texte posé DIRECTEMENT sur le violet passe en blanc. Les cartes qui
   vivent dedans ont leur propre fond clair : elles gardent l'encre sombre,
   d'où la remise à zéro juste après. */
/* .t-title, .t-meta et .t-kicker portent chacun une couleur explicite : sans
   ces trois lignes ils resteraient sombres sur le violet, l'héritage ne les
   atteint pas. */
.feu-bloc .t-title,
.feu-bloc .t-meta,
.feu-bloc .t-kicker { color: var(--accent-on); }
.feu-bloc .quete,
.feu-bloc .quete-mois { color: var(--ink); }
.feu-bloc .quete .t-title,
.feu-bloc .quete-mois .t-title { color: var(--ink); }
.feu-bloc .quete .t-meta,
.feu-bloc .quete-mois .t-meta,
.feu-bloc .quete .t-kicker,
.feu-bloc .quete-mois .t-kicker { color: var(--ink-mute); }

/* La barre à paliers, sur fond violet : piste translucide, remplissage blanc. */
.feu-bloc__mesure .barre {
  background: rgba(255, 255, 255, 0.22);
  border-color: var(--accent-on);
}
.feu-bloc__mesure .barre > div { background: var(--accent-on); }

/* Un calque pas encore débloqué : sur fond sombre, 16 % ne se voyait plus du
   tout. On remonte pour qu'il se devine — c'est ce qui donne envie. */
.feu-bloc .feu-locked { opacity: 0.3; }
.feu-bloc__tete {
  display: flex; gap: var(--s-6); align-items: center; flex-wrap: wrap;
  position: relative;
}
.feu-bloc__mesure { flex: 1; min-width: 17rem; }
.feu-bloc__titre {
  margin: var(--s-6) 0 var(--s-4);
  position: relative;   /* au-dessus des fleurs */
}

/* ── La quête du mois, en large ── */
.quete-mois {
  position: relative;
  display: flex; gap: var(--s-4); align-items: flex-start; flex-wrap: wrap;
  border: 2px solid var(--line);
  box-shadow: var(--shadow-sm);
  background: var(--paper);
  padding: var(--s-4);
  margin-bottom: var(--s-5);
}
/* La quête du mois une fois faite : une ligne, calée sur le même registre que
   le résumé « Quêtes accomplies » qui la suit. */
.quete-mois-faite {
  position: relative;
  display: flex; align-items: baseline; gap: var(--s-2); flex-wrap: wrap;
  margin: 0 0 var(--s-2);
  padding: var(--s-2) 0;
  font-size: 14px; color: var(--accent-on);
}
.quete-mois-faite .illu { color: var(--accent-on); }
.quete-mois-faite .t-meta { margin-left: auto; }

.quete-mois__etiquette {
  border: 1.5px solid var(--line);
  padding: 4px 10px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--paper);
}

/* ── La grille des quêtes à faire ──
   auto-fill + minmax : trois par ligne au large, une seule sur téléphone,
   sans point de rupture à écrire. */
.quetes-grille {
  position: relative;
  display: grid; gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  margin-bottom: var(--s-5);
}
.quete {
  display: flex; flex-direction: column;
  border: 2px solid var(--line);
  box-shadow: var(--shadow-sm);
  background: var(--paper);
  padding: var(--s-4);
}
/* Une quête réclamable se repère de loin : c'est du travail déjà fait. */
.quete--prete { background: var(--postit); }
.quete__tete {
  display: flex; align-items: baseline; gap: var(--s-2);
  margin-bottom: var(--s-2);
}
.quete__desc { margin: 0 0 var(--s-4); font-size: 14px; }
.quete__pied { margin-top: auto; }
.quete__aller {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  margin-top: 6px;
  font-size: 13px; font-weight: 600;
  color: inherit; text-decoration: none;
}
.quete__aller:hover { text-decoration: underline; }

/* ── Le repli des quêtes accomplies ──
   Elles n'apprennent plus rien à personne : on ne fait pas défiler du travail
   terminé pour atteindre ce qui reste. */
.quetes-faites { position: relative; color: var(--accent-on); }
.quetes-faites > summary {
  display: flex; align-items: center; gap: var(--s-2);
  cursor: pointer; list-style: none;
  font-weight: 600; padding: var(--s-2) 0;
  user-select: none;
}
.quetes-faites > summary::-webkit-details-marker { display: none; }
.quetes-faites > summary::after {
  content: ""; width: 8px; height: 8px;
  border-right: 2.5px solid var(--accent-on); border-bottom: 2.5px solid var(--accent-on);
  transform: rotate(45deg); transition: transform 0.2s ease;
}
.quetes-faites[open] > summary::after { transform: rotate(-135deg); }
.quetes-faites__liste {
  list-style: none; margin: 0; padding: 0 0 0 var(--s-2);
  display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}
.quetes-faites__liste li {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: 14px; color: var(--accent-on); opacity: .85;
}

/* ── La réserve du coin fleuri ──
   Les fleurs occupent 300 px en bas à droite du bloc. Sans réserve, la ligne
   de la quête du mois et le résumé « Quêtes accomplies » leur passent dessus
   et deviennent illisibles. Plutôt que de poser un fond derrière le texte —
   qui ferait une bande opaque au milieu du dessin — on arrête simplement le
   texte avant le coin.

   Sous 900 px il n'y a plus la place : les fleurs s'effacent (elles ne portent
   aucune information) et la réserve disparaît avec elles. */
@media (min-width: 900px) {
  .feu-bloc .quete-mois-faite,
  .feu-bloc .quetes-faites { padding-right: 300px; }
}
@media (max-width: 899px) {
  .feu-flowers { display: none; }
}

/* ========== RACCOURCIS « Que veux-tu faire aujourd'hui ? » ==========
   Légèrement de travers, comme des cartons posés sur une table. Le tableau de
   bord répond à « et maintenant ? » avant de raconter des chiffres. */
.raccourcis {
  display: grid; gap: var(--s-5);
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}
.raccourci {
  display: block;
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-md);
  padding: var(--s-4);
  text-decoration: none; color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
/* L'inclinaison alterne : deux cartes voisines ne penchent pas du même côté. */
.raccourci:nth-child(odd)  { transform: rotate(-0.7deg); }
.raccourci:nth-child(even) { transform: rotate(0.6deg); }
.raccourci:hover, .raccourci:focus-visible {
  transform: rotate(0deg) translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.raccourci .t-title { margin: 2px 0 6px; }
.raccourci .illu { margin-bottom: var(--s-3); }
.raccourci .t-meta { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .raccourci, .quetes-faites > summary::after { transition: none; }
  .raccourci:nth-child(odd), .raccourci:nth-child(even) { transform: none; }
  .raccourci:hover { transform: translateY(-3px); }
}

/* ========== BARRE D'OUTILS DE L'ÉDITEUR ==========
   Collée au textarea (bordure du bas partagée) pour qu'on la lise comme le
   haut du champ, pas comme une rangée de boutons flottante. */
.barre-outils {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  border: 1.5px solid var(--line);
  border-bottom: none;
  background: var(--halftone);
  padding: 6px 8px;
}
.barre-outils button {
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body); font-size: 13px;
  padding: 4px 9px;
  cursor: pointer;
  min-height: 30px;
}
.barre-outils button:hover { background: var(--paper); border-color: var(--line); }
.barre-outils button:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.barre-outils button code { font-family: var(--font-mono); font-size: 12px; }
.barre-outils__sep {
  width: 1.5px; height: 20px; background: var(--ink-mute); opacity: .4;
  margin: 0 4px;
}
/* Le textarea qui suit la barre perd son coin haut : les deux ne font qu'un. */
.barre-outils + .textarea { border-top-width: 1.5px; margin-top: 0; }

/* ── Le ✕ qui retire une ligne d'un formulaire ──
   Le fantôme est une doublure invisible : sur les lignes vides il occupe la
   même place, sinon les colonnes ne s'alignent plus d'une ligne à l'autre. */
.btn-retirer {
  flex-shrink: 0;
  width: 2.25rem; height: 2.25rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--danger);
  font-size: 15px; font-weight: 700; line-height: 1;
  cursor: pointer;
}
.btn-retirer:hover { background: var(--danger-soft); }
.btn-retirer:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-retirer--fantome { visibility: hidden; cursor: default; }

/* Les flèches ▲ ▼ qui déplacent une entrée de menu d'un cran. Même boîte que
   le ✕ voisin, mais à l'encre du texte : ranger n'est pas supprimer. Grisée,
   la flèche reste visible pour que la rangée garde sa largeur. */
.btn-ranger {
  flex-shrink: 0;
  width: 2.25rem; height: 2.25rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px; font-weight: 700; line-height: 1;
  cursor: pointer;
}
.btn-ranger:hover { background: var(--bg); }
.btn-ranger:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-ranger[disabled] { opacity: .3; cursor: default; }

/* ========== ÉDITEUR DU MÉGA-MENU ==========
   Une section = un <fieldset> encadré. Le cadre est ce qui rend visible où
   commence et finit une section, dans un formulaire qui en empile plusieurs. */
.mega-section {
  border: 1.5px solid var(--line);
  padding: var(--s-4);
  margin-bottom: var(--s-4);
  background: var(--paper);
}
.mega-section > legend { padding: 0 var(--s-2); }

/* ========== JOURNAL DES QUÊTES (replié dans le tableau de bord) ==========
   <details> natif : l'ouverture ne coûte pas une ligne de JS. Replié, il tient
   sur une ligne ; c'est ce qui permet de garder le journal sur la home sans
   encombrer. */
.journal {
  border: 2px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--s-5);
}
.journal__resume {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  list-style: none;          /* on dessine notre propre chevron */
  user-select: none;
}
.journal__resume::-webkit-details-marker { display: none; }
.journal__resume:hover { background: var(--halftone); }
.journal__resume:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.journal__resume .t-meta { margin-left: auto; }
/* Le chevron, en dernier : il pivote quand le bloc s'ouvre. */
.journal__resume::after {
  content: ""; width: 9px; height: 9px;
  border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink);
  transform: rotate(45deg); margin-left: var(--s-1);
  transition: transform 0.2s ease;
}
.journal[open] > .journal__resume::after { transform: rotate(-135deg); }
.journal[open] > .journal__resume { border-bottom: 1.5px solid var(--line); }
.journal__corps { padding: var(--s-4); }
.journal__corps h3 { margin: 0 0 var(--s-3); }

@media (prefers-reduced-motion: reduce) {
  .journal__resume::after { transition: none; }
}

/* ========== BANDEAU DU FEU (barre de titre, tous les écrans) ==========
   Compact et discret : c'est un repère du coin de l'œil, pas un tableau de
   bord. La grande scène et la barre à paliers restent sur /admin/dashboard. */
.feu-bandeau {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  text-decoration: none; color: inherit;
  flex-shrink: 0;
}
.feu-bandeau:hover { background: var(--halftone); }
.feu-bandeau:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.feu-bandeau .illu { color: var(--accent-strong); }
.feu-bandeau__points {
  font-family: var(--font-title); font-weight: 700; font-size: 15px;
  font-variant-numeric: tabular-nums;  /* le chiffre ne fait pas sauter la jauge */
}
.feu-bandeau__jauge {
  display: block; width: 72px; height: 8px;
  background: var(--halftone);
  border: 1.5px solid var(--line);
  overflow: hidden;
}
.feu-bandeau__jauge > span {
  display: block; height: 100%;
  background: var(--accent);
  transition: width 1.1s cubic-bezier(.22,.61,.36,1);  /* la montée se regarde */
}
.feu-bandeau__badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px;
  background: var(--postit);
  border: 1.5px solid var(--line);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.feu-bandeau__badge .illu { color: var(--ink); }

/* Sous 720px la jauge saute : le total et le badge suffisent. */
@media (max-width: 720px) {
  .feu-bandeau__jauge { display: none; }
}

/* ========== TOAST DE GAIN ==========
   Posé en bas à droite, hors du flux, il ne pousse rien. Deux toasts peuvent
   se suivre (gain puis palier) : le second se décale au-dessus du premier. */
.feu-toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  padding: 12px 18px;
  border: 2px solid var(--line);
  box-shadow: var(--shadow-md);
  font-family: var(--font-title); font-weight: 700; font-size: 15px;
  animation: feuToast 4.6s cubic-bezier(.22,.61,.36,1) forwards;
  pointer-events: none;
}
.feu-toast--gain    { background: var(--accent); color: var(--accent-on); }
.feu-toast--palier  { background: var(--postit); color: var(--ink); bottom: 84px; }

@keyframes feuToast {
  0%        { opacity: 0; transform: translateY(18px); }
  8%, 82%   { opacity: 1; transform: translateY(0); }
  100%      { opacity: 0; transform: translateY(-10px); }
}

/* Mouvement réduit : on garde l'information, on retire le déplacement. */
@media (prefers-reduced-motion: reduce) {
  .feu-bandeau__jauge > span { transition: none; }
  .feu-toast { animation: none; }
}

/* ========== SCÈNE DU FEU DE CAMP ==========
   Trois calques de pixel art qui s'allument aux paliers de points :
   le feu, puis les étoiles, puis les fleurs. Un calque non débloqué est
   grisé — on montre ce qui viendra, on ne le cache pas.
   Réglages des tailles et positions ici. */
.feu-scene   { position: relative; width: 200px; height: 210px; flex-shrink: 0; }
.feu-layer   { position: absolute; display: block; }
.feu-fire    { left: 50%; bottom: 0; height: 160px; transform: translateX(-50%); }
.feu-stars   { top: -4px; left: -10px; width: 100px; }
.feu-flowers { right: -14px; bottom: -10px; width: 300px; z-index: 0; }
.feu-locked  { filter: grayscale(1); opacity: 0.16; }

.feu-twinkle { animation: feuTwinkle 3.2s ease-in-out infinite; }
.feu-sway    { transform-origin: bottom center; animation: feuSway 6s ease-in-out infinite; }
@keyframes feuTwinkle { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes feuSway {
  0%, 100% { transform: rotate(-1.6deg); }
  50%      { transform: rotate(1.6deg); }
}

/* Confettis : chute d'un morceau coloré, à la réclamation d'une quête. */
@keyframes confettiFall {
  0%   { transform: translateY(-8px) rotate(0deg);    opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateY(120px) rotate(180deg); opacity: 0; }
}

/* Bandeau d'erreur de build, affiché en tête de tous les écrans admin. */
.alerte-build {
  border: 3px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
}
.alerte-build pre {
  font-family: var(--font-mono); font-size: 13px;
  white-space: pre-wrap; margin: var(--s-2) 0 0; color: var(--ink);
}


/* ═══ GESTION DU CONTENU — liste, éditeur, nouvelle page ═══════════════════ */

/* L'attribut hidden doit gagner sur les style="display:block" écrits dans
   les gabarits — sinon la recherche ne cache rien. */
[hidden] { display: none !important; }

/* Liste des contenus : une section = un tiroir <details>. */
.tiroir > summary { cursor: pointer; padding: var(--s-2) 0; list-style: none; }
.tiroir > summary::before { content: "▸ "; }
.tiroir[open] > summary::before { content: "▾ "; }

/* Badges de langue : plein si la traduction existe, barré sinon. */
.badge-langue {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  padding: 1px 6px; border: 1px solid var(--line);
  background: var(--accent-soft);
}
.badge-langue--manque { background: transparent; text-decoration: line-through; opacity: .6; }

/* Éditeur : le panneau des blocs, sous la barre d'outils. */
.blocs { margin: var(--s-2) 0; }
.blocs > summary { cursor: pointer; font-weight: 600; }
.blocs__liste { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.blocs__liste button {
  font: inherit; padding: var(--s-2) var(--s-3); cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.blocs__liste button:hover { background: var(--accent-soft); }

/* Éditeur : « Enregistrer » collé en bas de l'écran pendant qu'on écrit. */
.barre-enregistrer {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; gap: var(--s-3); align-items: center;
  padding: var(--s-3) 0; margin-top: var(--s-4);
  background: var(--bg); border-top: 1px solid var(--line);
}

/* Nouvelle page : des cartes à cliquer plutôt qu'une liste de dossiers.
   Le bouton radio reste dans la carte (accessible au clavier) ; :has()
   colore la carte choisie. */
.choix-type {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: var(--s-3); margin: var(--s-2) 0 var(--s-5);
}
.choix-type__carte {
  display: flex; flex-direction: column; gap: var(--s-1); cursor: pointer;
  padding: var(--s-4); background: var(--paper);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.choix-type__carte span { color: var(--ink-mute); font-size: .9em; }
.choix-type__carte:has(input:checked) { background: var(--accent-soft); box-shadow: var(--shadow-md); }

/* Tableau de bord : le mot d'accueil des premières connexions. */
.accueil { border-width: 2px; }
.accueil__etapes { margin: 0 0 var(--s-3) var(--s-5); display: grid; gap: var(--s-2); }

/* Résumé + image principale : un seul bloc, celui des aperçus. */
.partage {
  border: 2px solid var(--line); background: var(--paper);
  box-shadow: var(--shadow-sm);
  padding: var(--s-4); margin: 0 0 var(--s-5);
}
.partage > legend { padding: 0 var(--s-2); background: var(--paper); }
.partage__grille { display: grid; grid-template-columns: 3fr 2fr; gap: var(--s-4); }
.partage__grille .field { margin-bottom: 0; }
.partage__vignette {
  display: block; width: 100%; aspect-ratio: 1.91 / 1;   /* format des partages */
  object-fit: cover; margin-top: var(--s-2);
  border: 1.5px solid var(--line); background: var(--bg);
}
.partage__vignette[hidden] { display: none; }
@media (max-width: 640px) { .partage__grille { grid-template-columns: 1fr; } }

/* ========== ÉDITEUR, façon Notion ==========
   Épuré : pas de cadre autour de la page, le titre en grand, le texte
   juste dessous, la barre d'outils qui s'efface quand on n'écrit pas.
   Les réglages vivent dans un tiroir (popover) à droite. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.editeur { max-width: 46rem; margin-inline: auto; padding-top: var(--s-4); }

.feuille__liens {
  display: flex; flex-wrap: wrap; gap: var(--s-1);
  margin: 0 0 var(--s-3) calc(-1 * var(--s-2));
  opacity: .6; transition: opacity .2s ease;
}
.feuille:hover .feuille__liens,
.feuille__liens:focus-within { opacity: 1; }
.lien-discret {
  font: inherit; font-size: 14px; color: var(--ink-mute);
  background: none; border: 0; cursor: pointer;
  padding: var(--s-1) var(--s-2);
}
.lien-discret:hover { background: rgb(46 29 47 / .07); color: var(--ink); }

.feuille__titre {
  display: block; width: 100%;
  border: 0; background: transparent; padding: 0;
  font-family: var(--font-title); font-size: clamp(32px, 4vw, 44px);
  font-weight: 700; line-height: 1.15; color: var(--ink);
  margin-bottom: var(--s-5);
}
.feuille__titre::placeholder,
.zone-ecriture .textarea::placeholder { color: var(--ink-mute); opacity: .45; }
.feuille__titre:focus-visible { outline: none; }

/* Barre d'outils : discrète, sans cadre ; pleine quand on écrit. Elle colle
   sous la barre du haut (--haut-topbar, posée en JS). */
.feuille .outils-editeur {
  position: sticky; top: var(--haut-topbar, 0px); z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2);
  margin-left: calc(-1 * var(--s-2));
  padding: var(--s-1) 0;
  background: var(--bg);
  opacity: .45; transition: opacity .2s ease;
}
.feuille:focus-within .outils-editeur,
.feuille .outils-editeur:hover { opacity: 1; }
.feuille .barre-outils { border: 0; background: transparent; padding: 0; }
.feuille .barre-outils button { color: var(--ink-mute); }
.feuille .barre-outils button:hover { color: var(--ink); background: rgb(46 29 47 / .07); border-color: transparent; }
.feuille .blocs { margin: 0; }
.feuille .blocs > summary { font-size: 13px; font-weight: 400; color: var(--ink-mute); padding: 4px 9px; list-style: none; }
.feuille .blocs > summary::-webkit-details-marker { display: none; }
.feuille .blocs[open] { flex-basis: 100%; }

/* Le texte : rien autour, aéré, et il grandit avec ce qu'on écrit
   (field-sizing) — plus de double défilement. Repli : rows="26". */
.zone-ecriture .textarea {
  border: 0; box-shadow: none; background: transparent;
  padding: var(--s-3) 0;
  font-size: 18px; line-height: 1.75;
  field-sizing: content;
  min-height: 60vh;
  resize: none;
}
.zone-ecriture .textarea:focus-visible { outline: none; }

/* Le tiroir des réglages : glisse depuis la droite, pleine hauteur. */
.panneau-reglages {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: min(26rem, 100vw); height: 100vh; max-height: none;
  padding: 0; overflow-y: auto;
  background: var(--paper); color: var(--ink);
  border: 0; border-left: 2px solid var(--line);
  box-shadow: -6px 0 0 0 rgb(46 29 47 / .15);
  transition: translate .25s ease, overlay .25s allow-discrete, display .25s allow-discrete;
  translate: 100% 0;
}
.panneau-reglages:popover-open { translate: 0 0; }
@starting-style { .panneau-reglages:popover-open { translate: 100% 0; } }
.panneau-reglages::backdrop { background: rgb(46 29 47 / .25); }
.panneau-reglages__tete {
  position: sticky; top: 0; z-index: 1;
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-3);
  padding: var(--s-4) var(--s-5); background: var(--paper);
  border-bottom: 1.5px solid var(--line);
}
.panneau-reglages__corps { padding: var(--s-5); }
.panneau-reglages .card { box-shadow: none; padding: var(--s-3); }
.panneau-reglages .partage { box-shadow: none; padding: var(--s-3); }
.panneau-reglages .partage__grille { grid-template-columns: 1fr; }

/* Enregistrer : une pastille discrète en bas à droite, plus une barre. */
.editeur-notion .barre-enregistrer {
  width: fit-content; margin-left: auto;
  gap: var(--s-4);
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
  border-width: 1.5px; box-shadow: var(--shadow-sm);
}
.editeur-notion .barre-enregistrer .btn { padding: 8px 16px; min-height: 0; }

/* Les liens d'aide, sous la consigne. Des boutons (ils ouvrent un popover),
   habillés en liens. */
.zone-ecriture__aides { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-2); }
.lien-aide {
  font: inherit; font-size: 14px;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent-strong);
  text-decoration: underline; text-underline-offset: 3px;
}
.lien-aide::before { content: "? "; font-weight: 700; }
.lien-aide:hover { text-decoration-thickness: 2px; }

/* ========== AIDES (popover) ========== */
.aide {
  width: min(44rem, calc(100vw - 2 * var(--s-4)));
  max-height: 85vh;
  overflow: auto;
  padding: var(--s-5);
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.aide::backdrop { background: rgb(46 29 47 / .6); }
.aide__tete {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.aide__titre { font-family: var(--font-title); font-size: 22px; font-weight: 700; margin: 0; }
.aide__intro, .aide__astuce { margin: 0 0 var(--s-4); }
.aide__astuce { background: var(--halftone); border: 1.5px solid var(--line); padding: var(--s-3); margin: var(--s-4) 0 0; }
.aide code { font-family: var(--font-mono); font-size: 14px; background: var(--bg); padding: 1px 4px; overflow-wrap: anywhere; }
.aide__table { width: 100%; border-collapse: collapse; }
.aide__table th, .aide__table td { text-align: left; padding: var(--s-2); border-bottom: 1px solid var(--accent-soft); vertical-align: top; }
.aide__table th { font-size: 13px; color: var(--ink-mute); border-bottom: 2px solid var(--line); }
.aide__regles { margin: 0 0 var(--s-4); padding-left: var(--s-5); display: grid; gap: var(--s-1); }
.aide__blocs { margin: 0; }
.aide__blocs dt { font-weight: 700; margin-top: var(--s-4); }
.aide__blocs dd { margin: var(--s-1) 0 0; line-height: 1.7; }

/* ========== CHOIX D'IMAGE (popover de l'éditeur) ========== */
.choix-image__grille {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: var(--s-2); margin-top: var(--s-3);
}
.choix-image__vignette {
  padding: 0; border: 1.5px solid var(--line); background: var(--bg);
  cursor: pointer; aspect-ratio: 1; overflow: hidden;
}
.choix-image__vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.choix-image__vignette:hover,
.choix-image__vignette:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.choix-image__vignette[hidden] { display: none; }

/* ========== BARRE ENREGISTRER (éditeur) ==========
   Carte flottante collée en bas : Brouillon à gauche, Enregistrer à droite.
   En brouillon, elle passe en rose post-it : l'état se voit de loin. */
.barre-enregistrer {
  bottom: var(--s-3);
  justify-content: space-between; flex-wrap: wrap;
  padding: var(--s-3) var(--s-4);
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-md);
  transition: background-color .2s ease;
}
/* La barre prend la couleur de la visibilité choisie : rose post-it en
   brouillon, bleu pâle en « lien seulement », blanc en ligne. */
.barre-enregistrer:has(option[value="brouillon"]:checked) { background: var(--postit); }
.barre-enregistrer:has(option[value="lien"]:checked) { background: #dce6f2; }
.barre-enregistrer__actions { display: flex; gap: var(--s-3); margin-left: auto; }

/* Le menu Visibilité, dans la barre. */
.visibilite { display: flex; align-items: center; gap: var(--s-2); }
.visibilite__nom { font-size: 13px; font-weight: 700; color: var(--ink-mute); }
.visibilite__choix {
  font: inherit; font-size: 15px; font-weight: 600; color: var(--ink);
  padding: 6px 10px; min-height: 0;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 0;
  cursor: pointer;
}
.visibilite__choix:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; }
/* « Un lien secret sera créé… » : seulement quand on vient de choisir
   « Lien seulement » (la page ne l'est pas encore). */
.visibilite__note { display: none; font-size: 13px; color: var(--ink-mute); }
.barre-enregistrer:has(option[value="lien"]:checked) .visibilite__note { display: inline; }
.panneau-reglages__danger { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1.5px solid var(--accent-soft); }

/* ========== ÉDITEUR : couverture + propriétés (façon Notion) ==========
   La couverture : l'image principale en bandeau au-dessus du titre.
   Les propriétés : une grille nom | valeur, sans cadre ; la valeur se
   révèle modifiable au survol et au focus. */
.feuille__couverture {
  display: block; width: 100%; aspect-ratio: 1.91 / 1;   /* format des partages */
  max-height: 18rem; object-fit: cover;
  margin-bottom: var(--s-4);
  border: 1.5px solid var(--line);
}
.feuille__couverture[hidden] { display: none; }

.proprietes {
  display: grid; grid-template-columns: 9.5rem minmax(0, 1fr);
  row-gap: 2px;
  margin: 0 0 var(--s-5);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--accent-soft);
}
.propriete { display: contents; }
.propriete__nom {
  font-size: 14px; color: var(--ink-mute);
  padding: 7px var(--s-2) 7px 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.propriete__valeur {
  width: 100%; min-height: 34px;
  font: inherit; font-size: 15px; color: var(--ink);
  background: transparent; border: 0; border-radius: 0;
  padding: 6px var(--s-2);
  margin-left: calc(-1 * var(--s-2));
}
.propriete__valeur::placeholder { color: var(--ink-mute); opacity: .55; }
.propriete__valeur:hover { background: rgb(46 29 47 / .06); }
.propriete__valeur:focus-visible {
  outline: none; background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.propriete__valeur--texte { resize: none; field-sizing: content; line-height: 1.5; }
.propriete__valeur.input--mono { font-size: 14px; }

@media (max-width: 640px) {
  .proprietes { grid-template-columns: 1fr; }
  .propriete__nom { padding-bottom: 0; }
}

/* Propriétés composées : valeur + bouton (Image), valeur + pastilles (Tags). */
.propriete__ligne { display: flex; align-items: center; gap: var(--s-1); min-width: 0; }
.propriete__ligne .propriete__valeur { flex: 1; min-width: 0; }
.propriete__ligne .lien-discret { flex: none; font-size: 13px; }
.propriete__pile { display: flex; flex-direction: column; min-width: 0; }
.tags-existants { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 0 var(--s-2); }
.tag-existant {
  font: inherit; font-size: 12px; cursor: pointer;
  padding: 2px 8px; color: var(--ink-mute);
  background: rgb(46 29 47 / .06); border: 1px solid transparent;
}
.tag-existant:hover { color: var(--ink); border-color: var(--line); }
.tag-existant--actif { background: var(--accent-soft); color: var(--ink); }
.tag-existant--actif::before { content: "✓ "; }

/* Téléverser depuis le sélecteur d'images : le champ fichier est masqué,
   le bouton visible porte son focus. */
.envoi-image { display: inline-block; margin-bottom: var(--s-4); cursor: pointer; }
.envoi-image:focus-within .btn { outline: 3px solid var(--accent-strong); outline-offset: 2px; }
.envoi-image:has(input:disabled) .btn { opacity: .6; cursor: progress; }
.envoi-image__etat { margin: calc(-1 * var(--s-2)) 0 var(--s-4); font-size: 14px; color: var(--ink-mute); }

/* ═══ BIENVENUE : Teklo et le sentier (bienvenue.html) ══════════════════════
   Les couleurs viennent des variables du haut de ce fichier : changer
   --accent ou --postit recolore aussi l'accueil. */

/* ── L'accueil : un voile plein écran, Teklo à gauche, sa bulle à droite ── */
.teklo {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: safe center;   /* safe : sur un petit écran, le haut ne se coupe pas */
  overflow-y: auto;
  padding: var(--s-4);
  background: rgb(46 29 47 / .82);           /* --ink, la nuit autour du feu */
  animation: tekloArrivee .5s ease both;
}
.teklo__boite {
  position: relative;
  display: grid; grid-template-columns: 9rem minmax(0, 1fr);
  align-items: end; gap: var(--s-6);
  width: min(44rem, 100%);
  margin-block: var(--s-7) var(--s-4);      /* la place du « Passer » au-dessus */
}
.teklo__mascotte {
  width: 100%; height: auto;
  animation: tekloFlotte 4s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgb(233 181 229 / .45));   /* la lueur du feu */
}

/* Les cartes : une seule visible, celle que vise l'adresse (#teklo-N,
   :target), ou la première tant qu'aucune n'est visée. Chacune garde sa
   propre hauteur. La bulle a une petite pointe vers Teklo (::before). */
.teklo__carte {
  display: none; flex-direction: column;
  position: relative;
  padding: var(--s-6);
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-lg);
  animation: tekloCarte .3s ease both;
}
.teklo__carte:target,
.teklo__cartes:not(:has(.teklo__carte:target)) .teklo__carte:first-child { display: flex; }
.teklo__carte::before {
  content: ""; position: absolute; left: -14px; bottom: 3rem;
  width: 24px; height: 24px; background: var(--paper);
  border-left: 2px solid var(--line); border-bottom: 2px solid var(--line);
  rotate: 45deg;
}
.teklo__carte p { margin: 0 0 var(--s-3); font-size: 17px; line-height: 1.6; }
.teklo__etape { font-size: 13px !important; color: var(--ink-mute); letter-spacing: .08em; }
.teklo__titre {
  font-family: var(--font-title); font-size: clamp(26px, 4vw, 34px);
  line-height: 1.15; margin: 0 0 var(--s-4);
}
.teklo__actions { display: flex; gap: var(--s-3); padding-top: var(--s-3); flex-wrap: wrap; }
.teklo__plus-tard,
.teklo__passer {
  font: inherit; font-size: 14px; cursor: pointer;
  background: none; border: 0; padding: var(--s-2) 0;
  text-decoration: underline; text-underline-offset: 3px;
}
.teklo__plus-tard { color: var(--ink-mute); align-self: flex-start; margin-top: var(--s-2); }
.teklo__passer { position: absolute; top: calc(-1 * var(--s-6)); right: 0; color: var(--accent-on); }

/* La maquette des quêtes (carte 4) : les vraies classes du tableau de bord,
   en réduction et inertes. Les repères ① ② renvoient à la légende. */
.teklo__maquette {
  display: grid; gap: var(--s-3);
  margin: var(--s-2) 0 var(--s-4);
  padding: var(--s-4);
  background: var(--bg); border: 1.5px dashed var(--ink-mute);
  font-size: 14px;
  pointer-events: none; user-select: none;
}
.teklo__maquette > * { position: relative; margin: 0; }
.teklo__maquette p { font-size: 14px !important; margin: 0 !important; }
.teklo__repere,
.teklo__legende li::before {
  display: inline-grid; place-items: center;
  width: 1.6rem; height: 1.6rem; flex: none;
  font-size: 13px; font-weight: 700;
  background: var(--postit); color: var(--ink); border: 2px solid var(--line);
  border-radius: 50%;
}
.teklo__repere { position: absolute; top: -.7rem; left: -.7rem; }
.teklo__legende { list-style: none; counter-reset: repere; margin: 0 0 var(--s-3); padding: 0; display: grid; gap: var(--s-2); }
.teklo__legende li { counter-increment: repere; display: flex; gap: var(--s-2); align-items: baseline; font-size: 15px; }
.teklo__legende li::before { content: counter(repere); }

@keyframes tekloArrivee { from { opacity: 0; } }
@keyframes tekloFlotte { 50% { translate: 0 -10px; } }

@keyframes tekloCarte { from { opacity: 0; translate: 12px 0; } }

/* La maquette de la barre de gauche (cartes 2 et 3) : mêmes couleurs que la
   vraie, l'entrée visée ressort en post-it avec son repère. */
.teklo__barre {
  display: grid; gap: 2px;
  margin: var(--s-1) 0 var(--s-4);
  padding: var(--s-2);
  background: var(--ink); color: var(--accent-on);
  max-width: 17rem;
  pointer-events: none; user-select: none;
}
.teklo__barre-lien {
  position: relative;
  display: flex; align-items: center; gap: var(--s-2);
  padding: 6px var(--s-3); font-size: 14px; opacity: .55;
}
.teklo__barre-lien--vise { opacity: 1; background: var(--postit); color: var(--ink); font-weight: 700; }
.teklo__barre-lien .teklo__repere { left: auto; right: -.8rem; top: 50%; translate: 0 -50%; }
.teklo__liste { margin: 0 0 var(--s-3); padding-left: var(--s-5); display: grid; gap: var(--s-1); font-size: 15px; }

@media (max-width: 640px) {
  .teklo__boite { grid-template-columns: 1fr; gap: var(--s-3); }
  .teklo__mascotte { width: 5rem; justify-self: center; }
  .teklo__carte { padding: var(--s-5); }
  .teklo__carte::before { display: none; }
}

/* ── Le sentier : trois pastilles reliées par un chemin en pointillés ── */
.sentier {
  display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: var(--s-5);
  align-items: start;
  margin-bottom: var(--s-5); padding: var(--s-5);
  background: var(--paper); border: 2px solid var(--line); box-shadow: var(--shadow-md);
}
.sentier__teklo { width: 100%; height: auto; animation: tekloFlotte 4s ease-in-out infinite; }
.sentier__titre { margin: .25rem 0 var(--s-4); }
.sentier__pas { list-style: none; margin: 0 0 var(--s-3); padding: 0; counter-reset: pas; }
.sentier__pas li {
  counter-increment: pas;
  position: relative;
  padding: 0 0 var(--s-4) 3.25rem;
  min-height: 2.5rem;
}
/* Le chemin : un pointillé vertical d'une pastille à la suivante. */
.sentier__pas li:not(:last-child)::after {
  content: ""; position: absolute; left: calc(1.125rem - 1px); top: 2.4rem; bottom: 0;
  border-left: 2px dashed var(--accent-soft);
}
/* La pastille : le numéro du pas… */
.sentier__pas li::before {
  content: counter(pas);
  position: absolute; left: 0; top: 0;
  width: 2.25rem; height: 2.25rem; display: grid; place-items: center;
  font-weight: 700; background: var(--bg); border: 2px solid var(--line);
}
.sentier__pas a { font-weight: 700; font-size: 17px; }
.sentier__pas span { display: block; color: var(--ink-mute); font-size: 14px; }
/* …qui devient une flamme quand le pas est fait. */
/* Pas fait : la pastille passe en post-it, le numéro s'efface et l'icône
   feu du sprite (posée dans le HTML) vient à sa place. */
.sentier__feu { display: none; }
.sentier__pas li.sentier__pas--fait::before { content: ""; background: var(--postit); }
.sentier__pas li.sentier__pas--fait .sentier__feu {
  display: block; position: absolute; left: .45rem; top: .45rem; z-index: 1;
  width: 1.35rem; height: 1.35rem;
}
.sentier__pas li.sentier__pas--fait::after { border-left-style: solid; border-color: var(--accent); }
.sentier__pas li.sentier__pas--fait a { color: var(--ink-mute); text-decoration: line-through; }

@media (max-width: 640px) {
  .sentier { grid-template-columns: 1fr; }
  .sentier__teklo { width: 4rem; }
}

/* ── Bienvenue : garde-fous de largeur (mobile) ──
   Un enfant de flex/grid refuse par défaut de rétrécir sous sa largeur
   « naturelle » (min-width: auto) : un bouton ou une étiquette suffisait à
   faire déborder la carte des quêtes. On l'autorise partout dans l'accueil. */
.teklo__boite > *, .teklo__carte > *, .teklo__maquette > * { min-width: 0; }
.teklo__carte { overflow-wrap: anywhere; }
.teklo__maquette .btn {
  white-space: normal; text-align: center; justify-content: center;
  min-height: 0; padding: 8px 12px; font-size: 14px;
}
.teklo__maquette .quete-mois { padding: var(--s-3); gap: var(--s-2); margin: 0; }
.teklo__maquette .quete { padding: var(--s-3); }
@media (max-width: 640px) {
  .teklo { padding: var(--s-3); }
  .teklo__boite { margin-block: var(--s-6) var(--s-3); }
  .teklo__carte { padding: var(--s-4); }
  .teklo__carte p { font-size: 16px; }
  .teklo__maquette { padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4); }
  .teklo__actions .btn { padding: 10px 14px; min-height: 0; }
}
/* Maquette : l'étiquette « Quête du mois » au-dessus du texte, qui garde
   toute la largeur. */
.teklo__maquette .quete-mois > div { flex-basis: 100%; }
.teklo__maquette .quete-mois__etiquette { order: -1; }

/* La propriété « Lien à partager » ressort un peu : c'est ce qu'on vient
   chercher sur une page non référencée. */
.propriete--partage .propriete__nom { color: var(--info); font-weight: 700; }
.propriete--partage .propriete__valeur { color: var(--info); }
